From aa8df3ea0ba2846dd42f8aea24e73d7098a14686 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 23 Jan 2023 00:58:01 +0000 Subject: [PATCH 01/35] Update version to 5.0.0-beta, accept baselines, and LKG. --- lib/lib.decorators.d.ts | 357 + lib/lib.decorators.legacy.d.ts | 24 + lib/lib.dom.d.ts | 4377 ++--- lib/lib.dom.iterable.d.ts | 14 + lib/lib.es2023.array.d.ts | 344 + lib/lib.es2023.d.ts | 22 + lib/lib.es2023.full.d.ts | 25 + lib/lib.es5.d.ts | 15 +- lib/lib.esnext.d.ts | 2 +- lib/lib.webworker.d.ts | 3302 ++-- lib/tsc.js | 8574 +++++++--- lib/tsserver.js | 14006 +++++++++------- lib/tsserverlibrary.d.ts | 1369 +- lib/tsserverlibrary.js | 13741 ++++++++------- lib/typescript.d.ts | 1281 +- lib/typescript.js | 12949 ++++++++------ lib/typingsInstaller.js | 1339 +- package.json | 2 +- src/compiler/corePublic.ts | 2 +- ...DynamicImportWithPackageExports.errors.txt | 13 +- ...tionEmitDynamicImportWithPackageExports.js | 16 - ...DeclarationEmit1(module=node16).errors.txt | 20 +- ...portModeDeclarationEmit1(module=node16).js | 13 - ...clarationEmit1(module=nodenext).errors.txt | 20 +- ...rtModeDeclarationEmit1(module=nodenext).js | 13 - ...DeclarationEmit2(module=node16).errors.txt | 20 +- ...portModeDeclarationEmit2(module=node16).js | 13 - ...clarationEmit2(module=nodenext).errors.txt | 20 +- ...rtModeDeclarationEmit2(module=nodenext).js | 13 - ...ationEmitErrors1(module=node16).errors.txt | 5 +- ...deDeclarationEmitErrors1(module=node16).js | 7 - ...ionEmitErrors1(module=nodenext).errors.txt | 5 +- ...DeclarationEmitErrors1(module=nodenext).js | 7 - ...DeclarationEmit1(module=node16).errors.txt | 38 + ...TypeModeDeclarationEmit1(module=node16).js | 6 - ...clarationEmit1(module=nodenext).errors.txt | 38 + ...peModeDeclarationEmit1(module=nodenext).js | 6 - ...ationEmitErrors1(module=node16).errors.txt | 11 +- ...deDeclarationEmitErrors1(module=node16).js | 4 - ...ionEmitErrors1(module=nodenext).errors.txt | 11 +- ...DeclarationEmitErrors1(module=nodenext).js | 4 - ...esolutions-from-file-are-partially-used.js | 29 +- 42 files changed, 35259 insertions(+), 26818 deletions(-) create mode 100644 lib/lib.decorators.d.ts create mode 100644 lib/lib.decorators.legacy.d.ts create mode 100644 lib/lib.es2023.array.d.ts create mode 100644 lib/lib.es2023.d.ts create mode 100644 lib/lib.es2023.full.d.ts create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).errors.txt diff --git a/lib/lib.decorators.d.ts b/lib/lib.decorators.d.ts new file mode 100644 index 0000000000000..d2b6b29a63ce1 --- /dev/null +++ b/lib/lib.decorators.d.ts @@ -0,0 +1,357 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +/** + * The decorator context types provided to class member decorators. + */ +type ClassMemberDecoratorContext = + | ClassMethodDecoratorContext + | ClassGetterDecoratorContext + | ClassSetterDecoratorContext + | ClassFieldDecoratorContext + | ClassAccessorDecoratorContext + ; + +/** + * The decorator context types provided to any decorator. + */ +type DecoratorContext = + | ClassDecoratorContext + | ClassMemberDecoratorContext + ; + +/** + * Context provided to a class decorator. + * @template Class The type of the decorated class associated with this context. + */ +interface ClassDecoratorContext< + Class extends abstract new (...args: any) => any = abstract new (...args: any) => any, +> { + /** The kind of element that was decorated. */ + readonly kind: "class"; + + /** The name of the decorated class. */ + readonly name: string | undefined; + + /** + * Adds a callback to be invoked after the class definition has been finalized. + * + * @example + * ```ts + * function customElement(name: string): ClassDecoratorFunction { + * return (target, context) => { + * context.addInitializer(function () { + * customElements.define(name, this); + * }); + * } + * } + * + * @customElement("my-element") + * class MyElement {} + * ``` + */ + addInitializer(initializer: (this: Class) => void): void; +} + +/** + * Context provided to a class method decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class method. + */ +interface ClassMethodDecoratorContext< + This = unknown, + Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any, +> { + /** The kind of class member that was decorated. */ + readonly kind: "method"; + + /** The name of the decorated class member. */ + readonly name: string | symbol; + + /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + readonly static: boolean; + + /** A value indicating whether the class member has a private name. */ + readonly private: boolean; + + // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 + // /** An object that can be used to access the current value of the class member at runtime. */ + // readonly access: { + // /** + // * Gets the current value of the method from the provided receiver. + // * + // * @example + // * let fn = context.access.get.call(instance); + // */ + // get(this: This): Value; + // }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` member), or before instance initializers are run (when + * decorating a non-`static` member). + * + * @example + * ```ts + * const bound: ClassMethodDecoratorFunction = (value, context) { + * if (context.private) throw new TypeError("Not supported on private methods."); + * context.addInitializer(function () { + * this[context.name] = this[context.name].bind(this); + * }); + * } + * + * class C { + * message = "Hello"; + * + * @bound + * m() { + * console.log(this.message); + * } + * } + * ``` + */ + addInitializer(initializer: (this: This) => void): void; +} + +/** + * Context provided to a class getter decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The property type of the decorated class getter. + */ +interface ClassGetterDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class member that was decorated. */ + readonly kind: "getter"; + + /** The name of the decorated class member. */ + readonly name: string | symbol; + + /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + readonly static: boolean; + + /** A value indicating whether the class member has a private name. */ + readonly private: boolean; + + // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 + // /** An object that can be used to access the current value of the class member at runtime. */ + // readonly access: { + // /** + // * Invokes the getter on the provided receiver. + // * + // * @example + // * let value = context.access.get.call(instance); + // */ + // get(this: This): Value; + // }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` member), or before instance initializers are run (when + * decorating a non-`static` member). + */ + addInitializer(initializer: (this: This) => void): void; +} + +/** + * Context provided to a class setter decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class setter. + */ +interface ClassSetterDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class member that was decorated. */ + readonly kind: "setter"; + + /** The name of the decorated class member. */ + readonly name: string | symbol; + + /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + readonly static: boolean; + + /** A value indicating whether the class member has a private name. */ + readonly private: boolean; + + // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 + /** An object that can be used to access the current value of the class member at runtime. */ + // readonly access: { + // /** + // * Invokes the setter on the provided receiver. + // * + // * @example + // * context.access.set.call(instance, value); + // */ + // set(this: This, value: Value): void; + // }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` member), or before instance initializers are run (when + * decorating a non-`static` member). + */ + addInitializer(initializer: (this: This) => void): void; +} + +/** + * Context provided to a class `accessor` field decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of decorated class field. + */ +interface ClassAccessorDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class member that was decorated. */ + readonly kind: "accessor"; + + /** The name of the decorated class member. */ + readonly name: string | symbol; + + /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + readonly static: boolean; + + /** A value indicating whether the class member has a private name. */ + readonly private: boolean; + + // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 + // /** An object that can be used to access the current value of the class member at runtime. */ + // readonly access: { + // /** + // * Invokes the getter on the provided receiver. + // * + // * @example + // * let value = context.access.get.call(instance); + // */ + // get(this: This): Value; + + // /** + // * Invokes the setter on the provided receiver. + // * + // * @example + // * context.access.set.call(instance, value); + // */ + // set(this: This, value: Value): void; + // }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` member), or before instance initializers are run (when + * decorating a non-`static` member). + */ + addInitializer(initializer: (this: This) => void): void; +} + +/** + * Describes the target provided to class `accessor` field decorators. + * @template This The `this` type to which the target applies. + * @template Value The property type for the class `accessor` field. + */ +interface ClassAccessorDecoratorTarget { + /** + * Invokes the getter that was defined prior to decorator application. + * + * @example + * let value = target.get.call(instance); + */ + get(this: This): Value; + + /** + * Invokes the setter that was defined prior to decorator application. + * + * @example + * target.set.call(instance, value); + */ + set(this: This, value: Value): void; +} + +/** + * Describes the allowed return value from a class `accessor` field decorator. + * @template This The `this` type to which the target applies. + * @template Value The property type for the class `accessor` field. + */ +interface ClassAccessorDecoratorResult { + /** + * An optional replacement getter function. If not provided, the existing getter function is used instead. + */ + get?(this: This): Value; + + /** + * An optional replacement setter function. If not provided, the existing setter function is used instead. + */ + set?(this: This, value: Value): void; + + /** + * An optional initializer mutator that is invoked when the underlying field initializer is evaluated. + * @param value The incoming initializer value. + * @returns The replacement initializer value. + */ + init?(this: This, value: Value): Value; +} + +/** + * Context provided to a class field decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class field. + */ +interface ClassFieldDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class member that was decorated. */ + readonly kind: "field"; + + /** The name of the decorated class member. */ + readonly name: string | symbol; + + /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + readonly static: boolean; + + /** A value indicating whether the class member has a private name. */ + readonly private: boolean; + + // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 + // /** An object that can be used to access the current value of the class member at runtime. */ + // readonly access: { + // /** + // * Gets the value of the field on the provided receiver. + // */ + // get(this: This): Value; + + // /** + // * Sets the value of the field on the provided receiver. + // */ + // set(this: This, value: Value): void; + // }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` member), or before instance initializers are run (when + * decorating a non-`static` member). + */ + addInitializer(initializer: (this: This) => void): void; +} diff --git a/lib/lib.decorators.legacy.d.ts b/lib/lib.decorators.legacy.d.ts new file mode 100644 index 0000000000000..e8783bef48a15 --- /dev/null +++ b/lib/lib.decorators.legacy.d.ts @@ -0,0 +1,24 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts index 753f7673d8924..a1bc18a50cb5b 100644 --- a/lib/lib.dom.d.ts +++ b/lib/lib.dom.d.ts @@ -198,6 +198,11 @@ interface ChannelSplitterOptions extends AudioNodeOptions { numberOfOutputs?: number; } +interface CheckVisibilityOptions { + checkOpacity?: boolean; + checkVisibilityCSS?: boolean; +} + interface ClientQueryOptions { includeUncontrolled?: boolean; type?: ClientTypes; @@ -507,8 +512,11 @@ interface FocusOptions { } interface FontFaceDescriptors { - display?: string; + ascentOverride?: string; + descentOverride?: string; + display?: FontDisplay; featureSettings?: string; + lineGapOverride?: string; stretch?: string; style?: string; unicodeRange?: string; @@ -624,6 +632,11 @@ interface ImageDataSettings { colorSpace?: PredefinedColorSpace; } +interface ImageEncodeOptions { + quality?: number; + type?: string; +} + interface ImportMeta { url: string; } @@ -724,6 +737,19 @@ interface LockOptions { steal?: boolean; } +interface MIDIConnectionEventInit extends EventInit { + port?: MIDIPort; +} + +interface MIDIMessageEventInit extends EventInit { + data?: Uint8Array; +} + +interface MIDIOptions { + software?: boolean; + sysex?: boolean; +} + interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { configuration?: MediaDecodingConfiguration; } @@ -838,7 +864,6 @@ interface MediaTrackCapabilities { aspectRatio?: DoubleRange; autoGainControl?: boolean[]; channelCount?: ULongRange; - cursor?: string[]; deviceId?: string; displaySurface?: string; echoCancellation?: boolean[]; @@ -846,10 +871,7 @@ interface MediaTrackCapabilities { frameRate?: DoubleRange; groupId?: string; height?: ULongRange; - latency?: DoubleRange; - logicalSurface?: boolean; noiseSuppression?: boolean[]; - resizeMode?: string[]; sampleRate?: ULongRange; sampleSize?: ULongRange; width?: ULongRange; @@ -860,16 +882,15 @@ interface MediaTrackConstraintSet { autoGainControl?: ConstrainBoolean; channelCount?: ConstrainULong; deviceId?: ConstrainDOMString; + displaySurface?: ConstrainDOMString; echoCancellation?: ConstrainBoolean; facingMode?: ConstrainDOMString; frameRate?: ConstrainDouble; groupId?: ConstrainDOMString; height?: ConstrainULong; - latency?: ConstrainDouble; noiseSuppression?: ConstrainBoolean; sampleRate?: ConstrainULong; sampleSize?: ConstrainULong; - suppressLocalAudioPlayback?: ConstrainBoolean; width?: ConstrainULong; } @@ -880,14 +901,15 @@ interface MediaTrackConstraints extends MediaTrackConstraintSet { interface MediaTrackSettings { aspectRatio?: number; autoGainControl?: boolean; + channelCount?: number; deviceId?: string; + displaySurface?: string; echoCancellation?: boolean; facingMode?: string; frameRate?: number; groupId?: string; height?: number; noiseSuppression?: boolean; - restrictOwnAudio?: boolean; sampleRate?: number; sampleSize?: number; width?: number; @@ -896,7 +918,9 @@ interface MediaTrackSettings { interface MediaTrackSupportedConstraints { aspectRatio?: boolean; autoGainControl?: boolean; + channelCount?: boolean; deviceId?: boolean; + displaySurface?: boolean; echoCancellation?: boolean; facingMode?: boolean; frameRate?: boolean; @@ -905,7 +929,6 @@ interface MediaTrackSupportedConstraints { noiseSuppression?: boolean; sampleRate?: boolean; sampleSize?: boolean; - suppressLocalAudioPlayback?: boolean; width?: boolean; } @@ -1967,22 +1990,22 @@ interface WorkletOptions { type NodeFilter = ((node: Node) => number) | { acceptNode(node: Node): number; }; declare var NodeFilter: { - readonly FILTER_ACCEPT: number; - readonly FILTER_REJECT: number; - readonly FILTER_SKIP: number; - readonly SHOW_ALL: number; - readonly SHOW_ATTRIBUTE: number; - readonly SHOW_CDATA_SECTION: number; - readonly SHOW_COMMENT: number; - readonly SHOW_DOCUMENT: number; - readonly SHOW_DOCUMENT_FRAGMENT: number; - readonly SHOW_DOCUMENT_TYPE: number; - readonly SHOW_ELEMENT: number; - readonly SHOW_ENTITY: number; - readonly SHOW_ENTITY_REFERENCE: number; - readonly SHOW_NOTATION: number; - readonly SHOW_PROCESSING_INSTRUCTION: number; - readonly SHOW_TEXT: number; + readonly FILTER_ACCEPT: 1; + readonly FILTER_REJECT: 2; + readonly FILTER_SKIP: 3; + readonly SHOW_ALL: 0xFFFFFFFF; + readonly SHOW_ELEMENT: 0x1; + readonly SHOW_ATTRIBUTE: 0x2; + readonly SHOW_TEXT: 0x4; + readonly SHOW_CDATA_SECTION: 0x8; + readonly SHOW_ENTITY_REFERENCE: 0x10; + readonly SHOW_ENTITY: 0x20; + readonly SHOW_PROCESSING_INSTRUCTION: 0x40; + readonly SHOW_COMMENT: 0x80; + readonly SHOW_DOCUMENT: 0x100; + readonly SHOW_DOCUMENT_TYPE: 0x200; + readonly SHOW_DOCUMENT_FRAGMENT: 0x400; + readonly SHOW_NOTATION: 0x800; }; type XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; }; @@ -1992,7 +2015,7 @@ interface ANGLE_instanced_arrays { drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0x88FE; } interface ARIAMixin { @@ -2002,7 +2025,6 @@ interface ARIAMixin { ariaChecked: string | null; ariaColCount: string | null; ariaColIndex: string | null; - ariaColIndexText: string | null; ariaColSpan: string | null; ariaCurrent: string | null; ariaDisabled: string | null; @@ -2026,7 +2048,6 @@ interface ARIAMixin { ariaRoleDescription: string | null; ariaRowCount: string | null; ariaRowIndex: string | null; - ariaRowIndexText: string | null; ariaRowSpan: string | null; ariaSelected: string | null; ariaSetSize: string | null; @@ -2207,7 +2228,7 @@ declare var AnimationPlaybackEvent: { }; interface AnimationTimeline { - readonly currentTime: CSSNumberish | null; + readonly currentTime: number | null; } declare var AnimationTimeline: { @@ -2697,6 +2718,15 @@ declare var CSSFontFaceRule: { new(): CSSFontFaceRule; }; +interface CSSFontFeatureValuesRule extends CSSRule { + fontFamily: string; +} + +declare var CSSFontFeatureValuesRule: { + prototype: CSSFontFeatureValuesRule; + new(): CSSFontFeatureValuesRule; +}; + interface CSSFontPaletteValuesRule extends CSSRule { readonly basePalette: string; readonly fontFamily: string; @@ -2751,6 +2781,7 @@ interface CSSKeyframesRule extends CSSRule { appendRule(rule: string): void; deleteRule(select: string): void; findRule(select: string): CSSKeyframeRule | null; + [index: number]: CSSKeyframeRule; } declare var CSSKeyframesRule: { @@ -2815,31 +2846,31 @@ interface CSSRule { readonly parentStyleSheet: CSSStyleSheet | null; /** @deprecated */ readonly type: number; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; + readonly STYLE_RULE: 1; + readonly CHARSET_RULE: 2; + readonly IMPORT_RULE: 3; + readonly MEDIA_RULE: 4; + readonly FONT_FACE_RULE: 5; + readonly PAGE_RULE: 6; + readonly NAMESPACE_RULE: 10; + readonly KEYFRAMES_RULE: 7; + readonly KEYFRAME_RULE: 8; + readonly SUPPORTS_RULE: 12; } declare var CSSRule: { prototype: CSSRule; new(): CSSRule; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; + readonly STYLE_RULE: 1; + readonly CHARSET_RULE: 2; + readonly IMPORT_RULE: 3; + readonly MEDIA_RULE: 4; + readonly FONT_FACE_RULE: 5; + readonly PAGE_RULE: 6; + readonly NAMESPACE_RULE: 10; + readonly KEYFRAMES_RULE: 7; + readonly KEYFRAME_RULE: 8; + readonly SUPPORTS_RULE: 12; }; /** A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. */ @@ -2978,10 +3009,16 @@ interface CSSStyleDeclaration { columnWidth: string; columns: string; contain: string; + containIntrinsicBlockSize: string; + containIntrinsicHeight: string; + containIntrinsicInlineSize: string; + containIntrinsicSize: string; + containIntrinsicWidth: string; container: string; containerName: string; containerType: string; content: string; + contentVisibility: string; counterIncrement: string; counterReset: string; counterSet: string; @@ -3101,6 +3138,7 @@ interface CSSStyleDeclaration { maskRepeat: string; maskSize: string; maskType: string; + mathStyle: string; maxBlockSize: string; maxHeight: string; maxInlineSize: string; @@ -3754,6 +3792,7 @@ declare var ClipboardEvent: { /** Available only in secure contexts. */ interface ClipboardItem { + readonly presentationStyle: PresentationStyle; readonly types: ReadonlyArray; getType(type: string): Promise; } @@ -3864,7 +3903,7 @@ interface Crypto { readonly subtle: SubtleCrypto; getRandomValues(array: T): T; /** Available only in secure contexts. */ - randomUUID(): string; + randomUUID(): `${string}-${string}-${string}-${string}-${string}`; } declare var Crypto: { @@ -3918,61 +3957,61 @@ interface DOMException extends Error { readonly code: number; readonly message: string; readonly name: string; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; } declare var DOMException: { prototype: DOMException; new(message?: string, name?: string): DOMException; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; }; /** An object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. */ @@ -4430,7 +4469,7 @@ declare var DeviceOrientationEvent: { new(type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; }; -interface DocumentEventMap extends DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap { +interface DocumentEventMap extends GlobalEventHandlersEventMap { "DOMContentLoaded": Event; "fullscreenchange": Event; "fullscreenerror": Event; @@ -4441,7 +4480,7 @@ interface DocumentEventMap extends DocumentAndElementEventHandlersEventMap, Glob } /** Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. */ -interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase { +interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase { /** Sets or gets the URL for the current document. */ readonly URL: string; /** @@ -4637,6 +4676,8 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement; + createElementNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: K): MathMLElementTagNameMap[K]; + createElementNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: string): MathMLElement; createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element; createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element; createEvent(eventInterface: "AnimationEvent"): AnimationEvent; @@ -4662,6 +4703,8 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; createEvent(eventInterface: "InputEvent"): InputEvent; createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent; + createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent; createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; @@ -4752,6 +4795,9 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad */ getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + /** @deprecated */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: string): HTMLCollectionOf; /** * If namespace and localName are "*" returns a HTMLCollection of all descendant elements. @@ -4764,6 +4810,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad */ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; /** Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. */ getSelection(): Selection | null; @@ -4839,22 +4886,6 @@ declare var Document: { new(): Document; }; -interface DocumentAndElementEventHandlersEventMap { - "copy": ClipboardEvent; - "cut": ClipboardEvent; - "paste": ClipboardEvent; -} - -interface DocumentAndElementEventHandlers { - oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; - oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; - onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; - addEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - /** A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. */ interface DocumentFragment extends Node, NonElementParentNode, ParentNode { readonly ownerDocument: Document; @@ -4940,18 +4971,18 @@ declare var DynamicsCompressorNode: { }; interface EXT_blend_minmax { - readonly MAX_EXT: GLenum; - readonly MIN_EXT: GLenum; + readonly MIN_EXT: 0x8007; + readonly MAX_EXT: 0x8008; } interface EXT_color_buffer_float { } interface EXT_color_buffer_half_float { - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum; - readonly RGB16F_EXT: GLenum; - readonly RGBA16F_EXT: GLenum; - readonly UNSIGNED_NORMALIZED_EXT: GLenum; + readonly RGBA16F_EXT: 0x881A; + readonly RGB16F_EXT: 0x881B; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 0x8211; + readonly UNSIGNED_NORMALIZED_EXT: 0x8C17; } interface EXT_float_blend { @@ -4962,44 +4993,44 @@ interface EXT_frag_depth { } interface EXT_sRGB { - readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum; - readonly SRGB8_ALPHA8_EXT: GLenum; - readonly SRGB_ALPHA_EXT: GLenum; - readonly SRGB_EXT: GLenum; + readonly SRGB_EXT: 0x8C40; + readonly SRGB_ALPHA_EXT: 0x8C42; + readonly SRGB8_ALPHA8_EXT: 0x8C43; + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: 0x8210; } interface EXT_shader_texture_lod { } interface EXT_texture_compression_bptc { - readonly COMPRESSED_RGBA_BPTC_UNORM_EXT: GLenum; - readonly COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: GLenum; - readonly COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: GLenum; - readonly COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: GLenum; + readonly COMPRESSED_RGBA_BPTC_UNORM_EXT: 0x8E8C; + readonly COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: 0x8E8D; + readonly COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: 0x8E8E; + readonly COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: 0x8E8F; } interface EXT_texture_compression_rgtc { - readonly COMPRESSED_RED_GREEN_RGTC2_EXT: GLenum; - readonly COMPRESSED_RED_RGTC1_EXT: GLenum; - readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GLenum; - readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: GLenum; + readonly COMPRESSED_RED_RGTC1_EXT: 0x8DBB; + readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: 0x8DBC; + readonly COMPRESSED_RED_GREEN_RGTC2_EXT: 0x8DBD; + readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 0x8DBE; } /** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */ interface EXT_texture_filter_anisotropic { - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum; - readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum; + readonly TEXTURE_MAX_ANISOTROPY_EXT: 0x84FE; + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84FF; } interface EXT_texture_norm16 { - readonly R16_EXT: GLenum; - readonly R16_SNORM_EXT: GLenum; - readonly RG16_EXT: GLenum; - readonly RG16_SNORM_EXT: GLenum; - readonly RGB16_EXT: GLenum; - readonly RGB16_SNORM_EXT: GLenum; - readonly RGBA16_EXT: GLenum; - readonly RGBA16_SNORM_EXT: GLenum; + readonly R16_EXT: 0x822A; + readonly RG16_EXT: 0x822C; + readonly RGB16_EXT: 0x8054; + readonly RGBA16_EXT: 0x805B; + readonly R16_SNORM_EXT: 0x8F98; + readonly RG16_SNORM_EXT: 0x8F99; + readonly RGB16_SNORM_EXT: 0x8F9A; + readonly RGBA16_SNORM_EXT: 0x8F9B; } interface ElementEventMap { @@ -5043,9 +5074,11 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, InnerHTML, Non readonly tagName: string; /** Creates a shadow root for element and returns it. */ attachShadow(init: ShadowRootInit): ShadowRoot; + checkVisibility(options?: CheckVisibilityOptions): boolean; /** Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. */ closest(selector: K): HTMLElementTagNameMap[K] | null; closest(selector: K): SVGElementTagNameMap[K] | null; + closest(selector: K): MathMLElementTagNameMap[K] | null; closest(selectors: string): E | null; /** Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. */ getAttribute(qualifiedName: string): string | null; @@ -5061,9 +5094,13 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, InnerHTML, Non getElementsByClassName(classNames: string): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + /** @deprecated */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; /** Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. */ hasAttribute(qualifiedName: string): boolean; @@ -5218,19 +5255,19 @@ interface Event { stopImmediatePropagation(): void; /** When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. */ stopPropagation(): void; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; - readonly NONE: number; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; } declare var Event: { prototype: Event; new(type: string, eventInitDict?: EventInit): Event; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; - readonly NONE: number; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; }; interface EventCounts { @@ -5268,9 +5305,9 @@ interface EventSource extends EventTarget { readonly withCredentials: boolean; /** Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED. */ close(): void; - readonly CLOSED: number; - readonly CONNECTING: number; - readonly OPEN: number; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSED: 2; addEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -5282,9 +5319,9 @@ interface EventSource extends EventTarget { declare var EventSource: { prototype: EventSource; new(url: string | URL, eventSourceInitDict?: EventSourceInit): EventSource; - readonly CLOSED: number; - readonly CONNECTING: number; - readonly OPEN: number; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSED: 2; }; /** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */ @@ -5372,16 +5409,16 @@ interface FileReader extends EventTarget { onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null; onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null; onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null; - readonly readyState: number; + readonly readyState: typeof FileReader.EMPTY | typeof FileReader.LOADING | typeof FileReader.DONE; readonly result: string | ArrayBuffer | null; abort(): void; readAsArrayBuffer(blob: Blob): void; readAsBinaryString(blob: Blob): void; readAsDataURL(blob: Blob): void; readAsText(blob: Blob, encoding?: string): void; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; + readonly EMPTY: 0; + readonly LOADING: 1; + readonly DONE: 2; addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5391,9 +5428,9 @@ interface FileReader extends EventTarget { declare var FileReader: { prototype: FileReader; new(): FileReader; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; + readonly EMPTY: 0; + readonly LOADING: 1; + readonly DONE: 2; }; interface FileSystem { @@ -5499,7 +5536,7 @@ declare var FocusEvent: { interface FontFace { ascentOverride: string; descentOverride: string; - display: string; + display: FontDisplay; family: string; featureSettings: string; lineGapOverride: string; @@ -5509,7 +5546,6 @@ interface FontFace { style: string; unicodeRange: string; variant: string; - variationSettings: string; weight: string; load(): Promise; } @@ -5699,17 +5735,17 @@ declare var GeolocationPosition: { interface GeolocationPositionError { readonly code: number; readonly message: string; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; + readonly PERMISSION_DENIED: 1; + readonly POSITION_UNAVAILABLE: 2; + readonly TIMEOUT: 3; } declare var GeolocationPositionError: { prototype: GeolocationPositionError; new(): GeolocationPositionError; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; + readonly PERMISSION_DENIED: 1; + readonly POSITION_UNAVAILABLE: 2; + readonly TIMEOUT: 3; }; interface GlobalEventHandlersEventMap { @@ -5731,7 +5767,9 @@ interface GlobalEventHandlersEventMap { "compositionstart": CompositionEvent; "compositionupdate": CompositionEvent; "contextmenu": MouseEvent; + "copy": ClipboardEvent; "cuechange": Event; + "cut": ClipboardEvent; "dblclick": MouseEvent; "drag": DragEvent; "dragend": DragEvent; @@ -5766,6 +5804,7 @@ interface GlobalEventHandlersEventMap { "mouseout": MouseEvent; "mouseover": MouseEvent; "mouseup": MouseEvent; + "paste": ClipboardEvent; "pause": Event; "play": Event; "playing": Event; @@ -5851,7 +5890,9 @@ interface GlobalEventHandlers { * @param ev The mouse event. */ oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; /** * Fires when the user double-clicks the object. * @param ev The mouse event. @@ -5981,6 +6022,7 @@ interface GlobalEventHandlers { * @param ev The mouse event. */ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; /** * Occurs when playback is paused. * @param ev The event. @@ -6507,11 +6549,11 @@ declare var HTMLDocument: { new(): HTMLDocument; }; -interface HTMLElementEventMap extends ElementEventMap, DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap { +interface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap { } /** Any HTML element. Some elements directly implement this interface, while others implement it via an interface that inherits it. */ -interface HTMLElement extends Element, DocumentAndElementEventHandlers, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement { +interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement { accessKey: string; readonly accessKeyLabel: string; autocapitalize: string; @@ -6669,6 +6711,8 @@ interface HTMLFormElement extends HTMLElement { name: string; /** Designates a form that is not validated when submitted. */ noValidate: boolean; + rel: string; + readonly relList: DOMTokenList; /** Sets or retrieves the window or frame at which to target content. */ target: string; /** Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -7111,7 +7155,7 @@ interface HTMLInputElement extends HTMLElement { indeterminate: boolean; readonly labels: NodeListOf | null; /** Specifies the ID of a pre-defined datalist of options for an input element. */ - readonly list: HTMLElement | null; + readonly list: HTMLDataListElement | null; /** Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. */ max: string; /** Sets or retrieves the maximum number of characters that the user can enter in a text control. */ @@ -7435,15 +7479,15 @@ interface HTMLMediaElement extends HTMLElement { play(): Promise; /** Available only in secure contexts. */ setMediaKeys(mediaKeys: MediaKeys | null): Promise; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; + readonly NETWORK_EMPTY: 0; + readonly NETWORK_IDLE: 1; + readonly NETWORK_LOADING: 2; + readonly NETWORK_NO_SOURCE: 3; + readonly HAVE_NOTHING: 0; + readonly HAVE_METADATA: 1; + readonly HAVE_CURRENT_DATA: 2; + readonly HAVE_FUTURE_DATA: 3; + readonly HAVE_ENOUGH_DATA: 4; addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7453,15 +7497,15 @@ interface HTMLMediaElement extends HTMLElement { declare var HTMLMediaElement: { prototype: HTMLMediaElement; new(): HTMLMediaElement; - readonly HAVE_CURRENT_DATA: number; - readonly HAVE_ENOUGH_DATA: number; - readonly HAVE_FUTURE_DATA: number; - readonly HAVE_METADATA: number; - readonly HAVE_NOTHING: number; - readonly NETWORK_EMPTY: number; - readonly NETWORK_IDLE: number; - readonly NETWORK_LOADING: number; - readonly NETWORK_NO_SOURCE: number; + readonly NETWORK_EMPTY: 0; + readonly NETWORK_IDLE: 1; + readonly NETWORK_LOADING: 2; + readonly NETWORK_NO_SOURCE: 3; + readonly HAVE_NOTHING: 0; + readonly HAVE_METADATA: 1; + readonly HAVE_CURRENT_DATA: 2; + readonly HAVE_FUTURE_DATA: 3; + readonly HAVE_ENOUGH_DATA: 4; }; interface HTMLMenuElement extends HTMLElement { @@ -8488,10 +8532,10 @@ interface HTMLTrackElement extends HTMLElement { srclang: string; /** Returns the TextTrack object corresponding to the text track of the track element. */ readonly track: TextTrack; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; + readonly NONE: 0; + readonly LOADING: 1; + readonly LOADED: 2; + readonly ERROR: 3; addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -8501,10 +8545,10 @@ interface HTMLTrackElement extends HTMLElement { declare var HTMLTrackElement: { prototype: HTMLTrackElement; new(): HTMLTrackElement; - readonly ERROR: number; - readonly LOADED: number; - readonly LOADING: number; - readonly NONE: number; + readonly NONE: 0; + readonly LOADING: 1; + readonly LOADED: 2; + readonly ERROR: 3; }; /** Provides special properties (beyond those defined on the regular HTMLElement interface it also has available to it by inheritance) for manipulating unordered list elements. */ @@ -9143,7 +9187,7 @@ declare var IntersectionObserverEntry: { }; interface KHR_parallel_shader_compile { - readonly COMPLETION_STATUS_KHR: GLenum; + readonly COMPLETION_STATUS_KHR: 0x91B1; } /** KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard. */ @@ -9164,19 +9208,19 @@ interface KeyboardEvent extends UIEvent { getModifierState(keyArg: string): boolean; /** @deprecated */ initKeyboardEvent(typeArg: string, bubblesArg?: boolean, cancelableArg?: boolean, viewArg?: Window | null, keyArg?: string, locationArg?: number, ctrlKey?: boolean, altKey?: boolean, shiftKey?: boolean, metaKey?: boolean): void; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; + readonly DOM_KEY_LOCATION_STANDARD: 0x00; + readonly DOM_KEY_LOCATION_LEFT: 0x01; + readonly DOM_KEY_LOCATION_RIGHT: 0x02; + readonly DOM_KEY_LOCATION_NUMPAD: 0x03; } declare var KeyboardEvent: { prototype: KeyboardEvent; new(type: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; - readonly DOM_KEY_LOCATION_LEFT: number; - readonly DOM_KEY_LOCATION_NUMPAD: number; - readonly DOM_KEY_LOCATION_RIGHT: number; - readonly DOM_KEY_LOCATION_STANDARD: number; + readonly DOM_KEY_LOCATION_STANDARD: 0x00; + readonly DOM_KEY_LOCATION_LEFT: 0x01; + readonly DOM_KEY_LOCATION_RIGHT: 0x02; + readonly DOM_KEY_LOCATION_NUMPAD: 0x03; }; interface KeyframeEffect extends AnimationEffect { @@ -9289,10 +9333,130 @@ declare var LockManager: { new(): LockManager; }; -interface MathMLElementEventMap extends ElementEventMap, DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap { +interface MIDIAccessEventMap { + "statechange": Event; +} + +/** Available only in secure contexts. */ +interface MIDIAccess extends EventTarget { + readonly inputs: MIDIInputMap; + onstatechange: ((this: MIDIAccess, ev: Event) => any) | null; + readonly outputs: MIDIOutputMap; + readonly sysexEnabled: boolean; + addEventListener(type: K, listener: (this: MIDIAccess, ev: MIDIAccessEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: MIDIAccess, ev: MIDIAccessEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var MIDIAccess: { + prototype: MIDIAccess; + new(): MIDIAccess; +}; + +/** Available only in secure contexts. */ +interface MIDIConnectionEvent extends Event { + readonly port: MIDIPort; +} + +declare var MIDIConnectionEvent: { + prototype: MIDIConnectionEvent; + new(type: string, eventInitDict?: MIDIConnectionEventInit): MIDIConnectionEvent; +}; + +interface MIDIInputEventMap extends MIDIPortEventMap { + "midimessage": Event; +} + +/** Available only in secure contexts. */ +interface MIDIInput extends MIDIPort { + onmidimessage: ((this: MIDIInput, ev: Event) => any) | null; + addEventListener(type: K, listener: (this: MIDIInput, ev: MIDIInputEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: MIDIInput, ev: MIDIInputEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var MIDIInput: { + prototype: MIDIInput; + new(): MIDIInput; +}; + +/** Available only in secure contexts. */ +interface MIDIInputMap { + forEach(callbackfn: (value: MIDIInput, key: string, parent: MIDIInputMap) => void, thisArg?: any): void; +} + +declare var MIDIInputMap: { + prototype: MIDIInputMap; + new(): MIDIInputMap; +}; + +/** Available only in secure contexts. */ +interface MIDIMessageEvent extends Event { + readonly data: Uint8Array; +} + +declare var MIDIMessageEvent: { + prototype: MIDIMessageEvent; + new(type: string, eventInitDict?: MIDIMessageEventInit): MIDIMessageEvent; +}; + +/** Available only in secure contexts. */ +interface MIDIOutput extends MIDIPort { + send(data: number[], timestamp?: DOMHighResTimeStamp): void; + addEventListener(type: K, listener: (this: MIDIOutput, ev: MIDIPortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: MIDIOutput, ev: MIDIPortEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var MIDIOutput: { + prototype: MIDIOutput; + new(): MIDIOutput; +}; + +/** Available only in secure contexts. */ +interface MIDIOutputMap { + forEach(callbackfn: (value: MIDIOutput, key: string, parent: MIDIOutputMap) => void, thisArg?: any): void; +} + +declare var MIDIOutputMap: { + prototype: MIDIOutputMap; + new(): MIDIOutputMap; +}; + +interface MIDIPortEventMap { + "statechange": Event; +} + +/** Available only in secure contexts. */ +interface MIDIPort extends EventTarget { + readonly connection: MIDIPortConnectionState; + readonly id: string; + readonly manufacturer: string | null; + readonly name: string | null; + onstatechange: ((this: MIDIPort, ev: Event) => any) | null; + readonly state: MIDIPortDeviceState; + readonly type: MIDIPortType; + readonly version: string | null; + close(): Promise; + open(): Promise; + addEventListener(type: K, listener: (this: MIDIPort, ev: MIDIPortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: MIDIPort, ev: MIDIPortEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var MIDIPort: { + prototype: MIDIPort; + new(): MIDIPort; +}; + +interface MathMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap { } -interface MathMLElement extends Element, DocumentAndElementEventHandlers, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { addEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -9380,19 +9544,19 @@ declare var MediaEncryptedEvent: { interface MediaError { readonly code: number; readonly message: string; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; + readonly MEDIA_ERR_ABORTED: 1; + readonly MEDIA_ERR_NETWORK: 2; + readonly MEDIA_ERR_DECODE: 3; + readonly MEDIA_ERR_SRC_NOT_SUPPORTED: 4; } declare var MediaError: { prototype: MediaError; new(): MediaError; - readonly MEDIA_ERR_ABORTED: number; - readonly MEDIA_ERR_DECODE: number; - readonly MEDIA_ERR_NETWORK: number; - readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number; + readonly MEDIA_ERR_ABORTED: 1; + readonly MEDIA_ERR_NETWORK: 2; + readonly MEDIA_ERR_DECODE: 3; + readonly MEDIA_ERR_SRC_NOT_SUPPORTED: 4; }; /** @@ -9890,18 +10054,18 @@ interface MutationEvent extends Event { readonly relatedNode: Node | null; /** @deprecated */ initMutationEvent(typeArg: string, bubblesArg?: boolean, cancelableArg?: boolean, relatedNodeArg?: Node | null, prevValueArg?: string, newValueArg?: string, attrNameArg?: string, attrChangeArg?: number): void; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; + readonly MODIFICATION: 1; + readonly ADDITION: 2; + readonly REMOVAL: 3; } /** @deprecated */ declare var MutationEvent: { prototype: MutationEvent; new(): MutationEvent; - readonly ADDITION: number; - readonly MODIFICATION: number; - readonly REMOVAL: number; + readonly MODIFICATION: 1; + readonly ADDITION: 2; + readonly REMOVAL: 3; }; /** Provides the ability to watch for changes being made to the DOM tree. It is designed as a replacement for the older Mutation Events feature which was part of the DOM3 Events specification. */ @@ -10001,6 +10165,8 @@ interface Navigator extends NavigatorAutomationInformation, NavigatorConcurrentH canShare(data?: ShareData): boolean; getGamepads(): (Gamepad | null)[]; /** Available only in secure contexts. */ + requestMIDIAccess(options?: MIDIOptions): Promise; + /** Available only in secure contexts. */ requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise; sendBeacon(url: string | URL, data?: BodyInit | null): boolean; /** Available only in secure contexts. */ @@ -10129,73 +10295,73 @@ interface Node extends EventTarget { normalize(): void; removeChild(child: T): T; replaceChild(node: Node, child: T): T; - readonly ATTRIBUTE_NODE: number; + /** node is an element. */ + readonly ELEMENT_NODE: 1; + readonly ATTRIBUTE_NODE: 2; + /** node is a Text node. */ + readonly TEXT_NODE: 3; /** node is a CDATASection node. */ - readonly CDATA_SECTION_NODE: number; + readonly CDATA_SECTION_NODE: 4; + readonly ENTITY_REFERENCE_NODE: 5; + readonly ENTITY_NODE: 6; + /** node is a ProcessingInstruction node. */ + readonly PROCESSING_INSTRUCTION_NODE: 7; /** node is a Comment node. */ - readonly COMMENT_NODE: number; - /** node is a DocumentFragment node. */ - readonly DOCUMENT_FRAGMENT_NODE: number; + readonly COMMENT_NODE: 8; /** node is a document. */ - readonly DOCUMENT_NODE: number; - /** Set when other is a descendant of node. */ - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - /** Set when other is an ancestor of node. */ - readonly DOCUMENT_POSITION_CONTAINS: number; + readonly DOCUMENT_NODE: 9; + /** node is a doctype. */ + readonly DOCUMENT_TYPE_NODE: 10; + /** node is a DocumentFragment node. */ + readonly DOCUMENT_FRAGMENT_NODE: 11; + readonly NOTATION_NODE: 12; /** Set when node and other are not in the same tree. */ - readonly DOCUMENT_POSITION_DISCONNECTED: number; - /** Set when other is following node. */ - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + readonly DOCUMENT_POSITION_DISCONNECTED: 0x01; /** Set when other is preceding node. */ - readonly DOCUMENT_POSITION_PRECEDING: number; - /** node is a doctype. */ - readonly DOCUMENT_TYPE_NODE: number; - /** node is an element. */ - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - /** node is a ProcessingInstruction node. */ - readonly PROCESSING_INSTRUCTION_NODE: number; - /** node is a Text node. */ - readonly TEXT_NODE: number; + readonly DOCUMENT_POSITION_PRECEDING: 0x02; + /** Set when other is following node. */ + readonly DOCUMENT_POSITION_FOLLOWING: 0x04; + /** Set when other is an ancestor of node. */ + readonly DOCUMENT_POSITION_CONTAINS: 0x08; + /** Set when other is a descendant of node. */ + readonly DOCUMENT_POSITION_CONTAINED_BY: 0x10; + readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20; } declare var Node: { prototype: Node; new(): Node; - readonly ATTRIBUTE_NODE: number; + /** node is an element. */ + readonly ELEMENT_NODE: 1; + readonly ATTRIBUTE_NODE: 2; + /** node is a Text node. */ + readonly TEXT_NODE: 3; /** node is a CDATASection node. */ - readonly CDATA_SECTION_NODE: number; + readonly CDATA_SECTION_NODE: 4; + readonly ENTITY_REFERENCE_NODE: 5; + readonly ENTITY_NODE: 6; + /** node is a ProcessingInstruction node. */ + readonly PROCESSING_INSTRUCTION_NODE: 7; /** node is a Comment node. */ - readonly COMMENT_NODE: number; - /** node is a DocumentFragment node. */ - readonly DOCUMENT_FRAGMENT_NODE: number; + readonly COMMENT_NODE: 8; /** node is a document. */ - readonly DOCUMENT_NODE: number; - /** Set when other is a descendant of node. */ - readonly DOCUMENT_POSITION_CONTAINED_BY: number; - /** Set when other is an ancestor of node. */ - readonly DOCUMENT_POSITION_CONTAINS: number; + readonly DOCUMENT_NODE: 9; + /** node is a doctype. */ + readonly DOCUMENT_TYPE_NODE: 10; + /** node is a DocumentFragment node. */ + readonly DOCUMENT_FRAGMENT_NODE: 11; + readonly NOTATION_NODE: 12; /** Set when node and other are not in the same tree. */ - readonly DOCUMENT_POSITION_DISCONNECTED: number; - /** Set when other is following node. */ - readonly DOCUMENT_POSITION_FOLLOWING: number; - readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + readonly DOCUMENT_POSITION_DISCONNECTED: 0x01; /** Set when other is preceding node. */ - readonly DOCUMENT_POSITION_PRECEDING: number; - /** node is a doctype. */ - readonly DOCUMENT_TYPE_NODE: number; - /** node is an element. */ - readonly ELEMENT_NODE: number; - readonly ENTITY_NODE: number; - readonly ENTITY_REFERENCE_NODE: number; - readonly NOTATION_NODE: number; - /** node is a ProcessingInstruction node. */ - readonly PROCESSING_INSTRUCTION_NODE: number; - /** node is a Text node. */ - readonly TEXT_NODE: number; + readonly DOCUMENT_POSITION_PRECEDING: 0x02; + /** Set when other is following node. */ + readonly DOCUMENT_POSITION_FOLLOWING: 0x04; + /** Set when other is an ancestor of node. */ + readonly DOCUMENT_POSITION_CONTAINS: 0x08; + /** Set when other is a descendant of node. */ + readonly DOCUMENT_POSITION_CONTAINED_BY: 0x10; + readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20; }; /** An iterator over the members of a list of the nodes in a subtree of the DOM. The nodes will be returned in document order. */ @@ -10312,7 +10478,7 @@ interface OES_fbo_render_mipmap { /** The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth. */ interface OES_standard_derivatives { - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: 0x8B8B; } /** The OES_texture_float extension is part of the WebGL API and exposes floating-point pixel types for textures. */ @@ -10325,7 +10491,7 @@ interface OES_texture_float_linear { /** The OES_texture_half_float extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components. */ interface OES_texture_half_float { - readonly HALF_FLOAT_OES: GLenum; + readonly HALF_FLOAT_OES: 0x8D61; } /** The OES_texture_half_float_linear extension is part of the WebGL API and allows linear filtering with half floating-point pixel types for textures. */ @@ -10337,15 +10503,15 @@ interface OES_vertex_array_object { createVertexArrayOES(): WebGLVertexArrayObjectOES | null; deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void; isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): GLboolean; - readonly VERTEX_ARRAY_BINDING_OES: GLenum; + readonly VERTEX_ARRAY_BINDING_OES: 0x85B5; } interface OVR_multiview2 { framebufferTextureMultiviewOVR(target: GLenum, attachment: GLenum, texture: WebGLTexture | null, level: GLint, baseViewIndex: GLint, numViews: GLsizei): void; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: GLenum; - readonly MAX_VIEWS_OVR: GLenum; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: 0x9630; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: 0x9632; + readonly MAX_VIEWS_OVR: 0x9631; + readonly FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: 0x9633; } /** The Web Audio API OfflineAudioCompletionEvent interface represents events that occur when the processing of an OfflineAudioContext is terminated. The complete event implements this interface. */ @@ -10401,6 +10567,12 @@ interface OffscreenCanvas extends EventTarget { * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it). */ width: number; + /** + * Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object. + * + * The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of "image/png"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image. + */ + convertToBlob(options?: ImageEncodeOptions): Promise; /** * Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. * @@ -10408,6 +10580,10 @@ interface OffscreenCanvas extends EventTarget { * * Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context). */ + getContext(contextId: "2d", options?: any): OffscreenCanvasRenderingContext2D | null; + getContext(contextId: "bitmaprenderer", options?: any): ImageBitmapRenderingContext | null; + getContext(contextId: "webgl", options?: any): WebGLRenderingContext | null; + getContext(contextId: "webgl2", options?: any): WebGL2RenderingContext | null; getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null; /** Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image. */ transferToImageBitmap(): ImageBitmap; @@ -10530,10 +10706,16 @@ interface ParentNode extends Node { /** Returns the first element that is a descendant of node that matches selectors. */ querySelector(selectors: K): HTMLElementTagNameMap[K] | null; querySelector(selectors: K): SVGElementTagNameMap[K] | null; + querySelector(selectors: K): MathMLElementTagNameMap[K] | null; + /** @deprecated */ + querySelector(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null; querySelector(selectors: string): E | null; /** Returns all element descendants of node that match selectors. */ querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: K): NodeListOf; + querySelectorAll(selectors: K): NodeListOf; + /** @deprecated */ + querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: string): NodeListOf; /** * Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. @@ -10714,20 +10896,20 @@ interface PerformanceNavigation { readonly type: number; /** @deprecated */ toJSON(): any; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; + readonly TYPE_NAVIGATE: 0; + readonly TYPE_RELOAD: 1; + readonly TYPE_BACK_FORWARD: 2; + readonly TYPE_RESERVED: 255; } /** @deprecated */ declare var PerformanceNavigation: { prototype: PerformanceNavigation; new(): PerformanceNavigation; - readonly TYPE_BACK_FORWARD: number; - readonly TYPE_NAVIGATE: number; - readonly TYPE_RELOAD: number; - readonly TYPE_RESERVED: number; + readonly TYPE_NAVIGATE: 0; + readonly TYPE_RELOAD: 1; + readonly TYPE_BACK_FORWARD: 2; + readonly TYPE_RESERVED: 255; }; /** Provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. For example, this interface can be used to determine how much time it takes to load or unload a document. */ @@ -11084,6 +11266,7 @@ interface PublicKeyCredential extends Credential { declare var PublicKeyCredential: { prototype: PublicKeyCredential; new(): PublicKeyCredential; + isConditionalMediationAvailable(): Promise; isUserVerifyingPlatformAuthenticatorAvailable(): Promise; }; @@ -11576,19 +11759,19 @@ interface Range extends AbstractRange { setStartBefore(node: Node): void; surroundContents(newParent: Node): void; toString(): string; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; + readonly START_TO_START: 0; + readonly START_TO_END: 1; + readonly END_TO_END: 2; + readonly END_TO_START: 3; } declare var Range: { prototype: Range; new(): Range; - readonly END_TO_END: number; - readonly END_TO_START: number; - readonly START_TO_END: number; - readonly START_TO_START: number; + readonly START_TO_START: 0; + readonly START_TO_END: 1; + readonly END_TO_END: 2; + readonly END_TO_START: 3; toString(): string; }; @@ -11810,21 +11993,21 @@ interface SVGAngle { valueInSpecifiedUnits: number; convertToSpecifiedUnits(unitType: number): void; newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; + readonly SVG_ANGLETYPE_UNKNOWN: 0; + readonly SVG_ANGLETYPE_UNSPECIFIED: 1; + readonly SVG_ANGLETYPE_DEG: 2; + readonly SVG_ANGLETYPE_RAD: 3; + readonly SVG_ANGLETYPE_GRAD: 4; } declare var SVGAngle: { prototype: SVGAngle; new(): SVGAngle; - readonly SVG_ANGLETYPE_DEG: number; - readonly SVG_ANGLETYPE_GRAD: number; - readonly SVG_ANGLETYPE_RAD: number; - readonly SVG_ANGLETYPE_UNKNOWN: number; - readonly SVG_ANGLETYPE_UNSPECIFIED: number; + readonly SVG_ANGLETYPE_UNKNOWN: 0; + readonly SVG_ANGLETYPE_UNSPECIFIED: 1; + readonly SVG_ANGLETYPE_DEG: 2; + readonly SVG_ANGLETYPE_RAD: 3; + readonly SVG_ANGLETYPE_GRAD: 4; }; interface SVGAnimateElement extends SVGAnimationElement { @@ -12060,12 +12243,12 @@ interface SVGComponentTransferFunctionElement extends SVGElement { readonly slope: SVGAnimatedNumber; readonly tableValues: SVGAnimatedNumberList; readonly type: SVGAnimatedEnumeration; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: 0; + readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: 1; + readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: 2; + readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: 3; + readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: 4; + readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: 5; addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12075,12 +12258,12 @@ interface SVGComponentTransferFunctionElement extends SVGElement { declare var SVGComponentTransferFunctionElement: { prototype: SVGComponentTransferFunctionElement; new(): SVGComponentTransferFunctionElement; - readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: 0; + readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: 1; + readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: 2; + readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: 3; + readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: 4; + readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: 5; }; /** Corresponds to the element. */ @@ -12109,11 +12292,11 @@ declare var SVGDescElement: { new(): SVGDescElement; }; -interface SVGElementEventMap extends ElementEventMap, DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap { +interface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap { } /** All of the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the SVGElement interface. */ -interface SVGElement extends Element, DocumentAndElementEventHandlers, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { /** @deprecated */ readonly className: any; readonly ownerSVGElement: SVGSVGElement | null; @@ -12151,23 +12334,23 @@ interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttrib readonly in1: SVGAnimatedString; readonly in2: SVGAnimatedString; readonly mode: SVGAnimatedEnumeration; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; + readonly SVG_FEBLEND_MODE_UNKNOWN: 0; + readonly SVG_FEBLEND_MODE_NORMAL: 1; + readonly SVG_FEBLEND_MODE_MULTIPLY: 2; + readonly SVG_FEBLEND_MODE_SCREEN: 3; + readonly SVG_FEBLEND_MODE_DARKEN: 4; + readonly SVG_FEBLEND_MODE_LIGHTEN: 5; + readonly SVG_FEBLEND_MODE_OVERLAY: 6; + readonly SVG_FEBLEND_MODE_COLOR_DODGE: 7; + readonly SVG_FEBLEND_MODE_COLOR_BURN: 8; + readonly SVG_FEBLEND_MODE_HARD_LIGHT: 9; + readonly SVG_FEBLEND_MODE_SOFT_LIGHT: 10; + readonly SVG_FEBLEND_MODE_DIFFERENCE: 11; + readonly SVG_FEBLEND_MODE_EXCLUSION: 12; + readonly SVG_FEBLEND_MODE_HUE: 13; + readonly SVG_FEBLEND_MODE_SATURATION: 14; + readonly SVG_FEBLEND_MODE_COLOR: 15; + readonly SVG_FEBLEND_MODE_LUMINOSITY: 16; addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12177,23 +12360,23 @@ interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttrib declare var SVGFEBlendElement: { prototype: SVGFEBlendElement; new(): SVGFEBlendElement; - readonly SVG_FEBLEND_MODE_COLOR: number; - readonly SVG_FEBLEND_MODE_COLOR_BURN: number; - readonly SVG_FEBLEND_MODE_COLOR_DODGE: number; - readonly SVG_FEBLEND_MODE_DARKEN: number; - readonly SVG_FEBLEND_MODE_DIFFERENCE: number; - readonly SVG_FEBLEND_MODE_EXCLUSION: number; - readonly SVG_FEBLEND_MODE_HARD_LIGHT: number; - readonly SVG_FEBLEND_MODE_HUE: number; - readonly SVG_FEBLEND_MODE_LIGHTEN: number; - readonly SVG_FEBLEND_MODE_LUMINOSITY: number; - readonly SVG_FEBLEND_MODE_MULTIPLY: number; - readonly SVG_FEBLEND_MODE_NORMAL: number; - readonly SVG_FEBLEND_MODE_OVERLAY: number; - readonly SVG_FEBLEND_MODE_SATURATION: number; - readonly SVG_FEBLEND_MODE_SCREEN: number; - readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; - readonly SVG_FEBLEND_MODE_UNKNOWN: number; + readonly SVG_FEBLEND_MODE_UNKNOWN: 0; + readonly SVG_FEBLEND_MODE_NORMAL: 1; + readonly SVG_FEBLEND_MODE_MULTIPLY: 2; + readonly SVG_FEBLEND_MODE_SCREEN: 3; + readonly SVG_FEBLEND_MODE_DARKEN: 4; + readonly SVG_FEBLEND_MODE_LIGHTEN: 5; + readonly SVG_FEBLEND_MODE_OVERLAY: 6; + readonly SVG_FEBLEND_MODE_COLOR_DODGE: 7; + readonly SVG_FEBLEND_MODE_COLOR_BURN: 8; + readonly SVG_FEBLEND_MODE_HARD_LIGHT: 9; + readonly SVG_FEBLEND_MODE_SOFT_LIGHT: 10; + readonly SVG_FEBLEND_MODE_DIFFERENCE: 11; + readonly SVG_FEBLEND_MODE_EXCLUSION: 12; + readonly SVG_FEBLEND_MODE_HUE: 13; + readonly SVG_FEBLEND_MODE_SATURATION: 14; + readonly SVG_FEBLEND_MODE_COLOR: 15; + readonly SVG_FEBLEND_MODE_LUMINOSITY: 16; }; /** Corresponds to the element. */ @@ -12201,11 +12384,11 @@ interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandard readonly in1: SVGAnimatedString; readonly type: SVGAnimatedEnumeration; readonly values: SVGAnimatedNumberList; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: 0; + readonly SVG_FECOLORMATRIX_TYPE_MATRIX: 1; + readonly SVG_FECOLORMATRIX_TYPE_SATURATE: 2; + readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: 3; + readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: 4; addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12215,11 +12398,11 @@ interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandard declare var SVGFEColorMatrixElement: { prototype: SVGFEColorMatrixElement; new(): SVGFEColorMatrixElement; - readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number; - readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; - readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: 0; + readonly SVG_FECOLORMATRIX_TYPE_MATRIX: 1; + readonly SVG_FECOLORMATRIX_TYPE_SATURATE: 2; + readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: 3; + readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: 4; }; /** Corresponds to the element. */ @@ -12245,13 +12428,13 @@ interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAt readonly k3: SVGAnimatedNumber; readonly k4: SVGAnimatedNumber; readonly operator: SVGAnimatedEnumeration; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; + readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: 0; + readonly SVG_FECOMPOSITE_OPERATOR_OVER: 1; + readonly SVG_FECOMPOSITE_OPERATOR_IN: 2; + readonly SVG_FECOMPOSITE_OPERATOR_OUT: 3; + readonly SVG_FECOMPOSITE_OPERATOR_ATOP: 4; + readonly SVG_FECOMPOSITE_OPERATOR_XOR: 5; + readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: 6; addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12261,13 +12444,13 @@ interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAt declare var SVGFECompositeElement: { prototype: SVGFECompositeElement; new(): SVGFECompositeElement; - readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number; - readonly SVG_FECOMPOSITE_OPERATOR_IN: number; - readonly SVG_FECOMPOSITE_OPERATOR_OUT: number; - readonly SVG_FECOMPOSITE_OPERATOR_OVER: number; - readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; + readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: 0; + readonly SVG_FECOMPOSITE_OPERATOR_OVER: 1; + readonly SVG_FECOMPOSITE_OPERATOR_IN: 2; + readonly SVG_FECOMPOSITE_OPERATOR_OUT: 3; + readonly SVG_FECOMPOSITE_OPERATOR_ATOP: 4; + readonly SVG_FECOMPOSITE_OPERATOR_XOR: 5; + readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: 6; }; /** Corresponds to the element. */ @@ -12284,10 +12467,10 @@ interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStand readonly preserveAlpha: SVGAnimatedBoolean; readonly targetX: SVGAnimatedInteger; readonly targetY: SVGAnimatedInteger; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; + readonly SVG_EDGEMODE_UNKNOWN: 0; + readonly SVG_EDGEMODE_DUPLICATE: 1; + readonly SVG_EDGEMODE_WRAP: 2; + readonly SVG_EDGEMODE_NONE: 3; addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12297,10 +12480,10 @@ interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStand declare var SVGFEConvolveMatrixElement: { prototype: SVGFEConvolveMatrixElement; new(): SVGFEConvolveMatrixElement; - readonly SVG_EDGEMODE_DUPLICATE: number; - readonly SVG_EDGEMODE_NONE: number; - readonly SVG_EDGEMODE_UNKNOWN: number; - readonly SVG_EDGEMODE_WRAP: number; + readonly SVG_EDGEMODE_UNKNOWN: 0; + readonly SVG_EDGEMODE_DUPLICATE: 1; + readonly SVG_EDGEMODE_WRAP: 2; + readonly SVG_EDGEMODE_NONE: 3; }; /** Corresponds to the element. */ @@ -12328,11 +12511,11 @@ interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStan readonly scale: SVGAnimatedNumber; readonly xChannelSelector: SVGAnimatedEnumeration; readonly yChannelSelector: SVGAnimatedEnumeration; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; + readonly SVG_CHANNEL_UNKNOWN: 0; + readonly SVG_CHANNEL_R: 1; + readonly SVG_CHANNEL_G: 2; + readonly SVG_CHANNEL_B: 3; + readonly SVG_CHANNEL_A: 4; addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12342,11 +12525,11 @@ interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStan declare var SVGFEDisplacementMapElement: { prototype: SVGFEDisplacementMapElement; new(): SVGFEDisplacementMapElement; - readonly SVG_CHANNEL_A: number; - readonly SVG_CHANNEL_B: number; - readonly SVG_CHANNEL_G: number; - readonly SVG_CHANNEL_R: number; - readonly SVG_CHANNEL_UNKNOWN: number; + readonly SVG_CHANNEL_UNKNOWN: 0; + readonly SVG_CHANNEL_R: 1; + readonly SVG_CHANNEL_G: 2; + readonly SVG_CHANNEL_B: 3; + readonly SVG_CHANNEL_A: 4; }; /** Corresponds to the element. */ @@ -12511,9 +12694,9 @@ interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardA readonly operator: SVGAnimatedEnumeration; readonly radiusX: SVGAnimatedNumber; readonly radiusY: SVGAnimatedNumber; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: 0; + readonly SVG_MORPHOLOGY_OPERATOR_ERODE: 1; + readonly SVG_MORPHOLOGY_OPERATOR_DILATE: 2; addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12523,9 +12706,9 @@ interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardA declare var SVGFEMorphologyElement: { prototype: SVGFEMorphologyElement; new(): SVGFEMorphologyElement; - readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number; - readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; - readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: 0; + readonly SVG_MORPHOLOGY_OPERATOR_ERODE: 1; + readonly SVG_MORPHOLOGY_OPERATOR_DILATE: 2; }; /** Corresponds to the element. */ @@ -12622,12 +12805,12 @@ interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardA readonly seed: SVGAnimatedNumber; readonly stitchTiles: SVGAnimatedEnumeration; readonly type: SVGAnimatedEnumeration; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; + readonly SVG_TURBULENCE_TYPE_UNKNOWN: 0; + readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: 1; + readonly SVG_TURBULENCE_TYPE_TURBULENCE: 2; + readonly SVG_STITCHTYPE_UNKNOWN: 0; + readonly SVG_STITCHTYPE_STITCH: 1; + readonly SVG_STITCHTYPE_NOSTITCH: 2; addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12637,12 +12820,12 @@ interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardA declare var SVGFETurbulenceElement: { prototype: SVGFETurbulenceElement; new(): SVGFETurbulenceElement; - readonly SVG_STITCHTYPE_NOSTITCH: number; - readonly SVG_STITCHTYPE_STITCH: number; - readonly SVG_STITCHTYPE_UNKNOWN: number; - readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; - readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; + readonly SVG_TURBULENCE_TYPE_UNKNOWN: 0; + readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: 1; + readonly SVG_TURBULENCE_TYPE_TURBULENCE: 2; + readonly SVG_STITCHTYPE_UNKNOWN: 0; + readonly SVG_STITCHTYPE_STITCH: 1; + readonly SVG_STITCHTYPE_NOSTITCH: 2; }; /** Provides access to the properties of elements, as well as methods to manipulate them. */ @@ -12729,10 +12912,10 @@ interface SVGGradientElement extends SVGElement, SVGURIReference { readonly gradientTransform: SVGAnimatedTransformList; readonly gradientUnits: SVGAnimatedEnumeration; readonly spreadMethod: SVGAnimatedEnumeration; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; + readonly SVG_SPREADMETHOD_UNKNOWN: 0; + readonly SVG_SPREADMETHOD_PAD: 1; + readonly SVG_SPREADMETHOD_REFLECT: 2; + readonly SVG_SPREADMETHOD_REPEAT: 3; addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12742,10 +12925,10 @@ interface SVGGradientElement extends SVGElement, SVGURIReference { declare var SVGGradientElement: { prototype: SVGGradientElement; new(): SVGGradientElement; - readonly SVG_SPREADMETHOD_PAD: number; - readonly SVG_SPREADMETHOD_REFLECT: number; - readonly SVG_SPREADMETHOD_REPEAT: number; - readonly SVG_SPREADMETHOD_UNKNOWN: number; + readonly SVG_SPREADMETHOD_UNKNOWN: 0; + readonly SVG_SPREADMETHOD_PAD: 1; + readonly SVG_SPREADMETHOD_REFLECT: 2; + readonly SVG_SPREADMETHOD_REPEAT: 3; }; /** SVG elements whose primary purpose is to directly render graphics into a group. */ @@ -12791,33 +12974,33 @@ interface SVGLength { valueInSpecifiedUnits: number; convertToSpecifiedUnits(unitType: number): void; newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; + readonly SVG_LENGTHTYPE_UNKNOWN: 0; + readonly SVG_LENGTHTYPE_NUMBER: 1; + readonly SVG_LENGTHTYPE_PERCENTAGE: 2; + readonly SVG_LENGTHTYPE_EMS: 3; + readonly SVG_LENGTHTYPE_EXS: 4; + readonly SVG_LENGTHTYPE_PX: 5; + readonly SVG_LENGTHTYPE_CM: 6; + readonly SVG_LENGTHTYPE_MM: 7; + readonly SVG_LENGTHTYPE_IN: 8; + readonly SVG_LENGTHTYPE_PT: 9; + readonly SVG_LENGTHTYPE_PC: 10; } declare var SVGLength: { prototype: SVGLength; new(): SVGLength; - readonly SVG_LENGTHTYPE_CM: number; - readonly SVG_LENGTHTYPE_EMS: number; - readonly SVG_LENGTHTYPE_EXS: number; - readonly SVG_LENGTHTYPE_IN: number; - readonly SVG_LENGTHTYPE_MM: number; - readonly SVG_LENGTHTYPE_NUMBER: number; - readonly SVG_LENGTHTYPE_PC: number; - readonly SVG_LENGTHTYPE_PERCENTAGE: number; - readonly SVG_LENGTHTYPE_PT: number; - readonly SVG_LENGTHTYPE_PX: number; - readonly SVG_LENGTHTYPE_UNKNOWN: number; + readonly SVG_LENGTHTYPE_UNKNOWN: 0; + readonly SVG_LENGTHTYPE_NUMBER: 1; + readonly SVG_LENGTHTYPE_PERCENTAGE: 2; + readonly SVG_LENGTHTYPE_EMS: 3; + readonly SVG_LENGTHTYPE_EXS: 4; + readonly SVG_LENGTHTYPE_PX: 5; + readonly SVG_LENGTHTYPE_CM: 6; + readonly SVG_LENGTHTYPE_MM: 7; + readonly SVG_LENGTHTYPE_IN: 8; + readonly SVG_LENGTHTYPE_PT: 9; + readonly SVG_LENGTHTYPE_PC: 10; }; /** The SVGLengthList defines a list of SVGLength objects. */ @@ -12895,12 +13078,12 @@ interface SVGMarkerElement extends SVGElement, SVGFitToViewBox { readonly refY: SVGAnimatedLength; setOrientToAngle(angle: SVGAngle): void; setOrientToAuto(): void; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; + readonly SVG_MARKERUNITS_UNKNOWN: 0; + readonly SVG_MARKERUNITS_USERSPACEONUSE: 1; + readonly SVG_MARKERUNITS_STROKEWIDTH: 2; + readonly SVG_MARKER_ORIENT_UNKNOWN: 0; + readonly SVG_MARKER_ORIENT_AUTO: 1; + readonly SVG_MARKER_ORIENT_ANGLE: 2; addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12910,12 +13093,12 @@ interface SVGMarkerElement extends SVGElement, SVGFitToViewBox { declare var SVGMarkerElement: { prototype: SVGMarkerElement; new(): SVGMarkerElement; - readonly SVG_MARKERUNITS_STROKEWIDTH: number; - readonly SVG_MARKERUNITS_UNKNOWN: number; - readonly SVG_MARKERUNITS_USERSPACEONUSE: number; - readonly SVG_MARKER_ORIENT_ANGLE: number; - readonly SVG_MARKER_ORIENT_AUTO: number; - readonly SVG_MARKER_ORIENT_UNKNOWN: number; + readonly SVG_MARKERUNITS_UNKNOWN: 0; + readonly SVG_MARKERUNITS_USERSPACEONUSE: 1; + readonly SVG_MARKERUNITS_STROKEWIDTH: 2; + readonly SVG_MARKER_ORIENT_UNKNOWN: 0; + readonly SVG_MARKER_ORIENT_AUTO: 1; + readonly SVG_MARKER_ORIENT_ANGLE: 2; }; /** Provides access to the properties of elements, as well as methods to manipulate them. */ @@ -13060,39 +13243,39 @@ declare var SVGPolylineElement: { interface SVGPreserveAspectRatio { align: number; meetOrSlice: number; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: 0; + readonly SVG_PRESERVEASPECTRATIO_NONE: 1; + readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: 2; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: 3; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: 4; + readonly SVG_PRESERVEASPECTRATIO_XMINYMID: 5; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: 6; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: 7; + readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: 8; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: 9; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: 10; + readonly SVG_MEETORSLICE_UNKNOWN: 0; + readonly SVG_MEETORSLICE_MEET: 1; + readonly SVG_MEETORSLICE_SLICE: 2; } declare var SVGPreserveAspectRatio: { prototype: SVGPreserveAspectRatio; new(): SVGPreserveAspectRatio; - readonly SVG_MEETORSLICE_MEET: number; - readonly SVG_MEETORSLICE_SLICE: number; - readonly SVG_MEETORSLICE_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_NONE: number; - readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number; - readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: 0; + readonly SVG_PRESERVEASPECTRATIO_NONE: 1; + readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: 2; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: 3; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: 4; + readonly SVG_PRESERVEASPECTRATIO_XMINYMID: 5; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: 6; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: 7; + readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: 8; + readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: 9; + readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: 10; + readonly SVG_MEETORSLICE_UNKNOWN: 0; + readonly SVG_MEETORSLICE_MEET: 1; + readonly SVG_MEETORSLICE_SLICE: 2; }; /** Corresponds to the element. */ @@ -13317,9 +13500,9 @@ interface SVGTextContentElement extends SVGGraphicsElement { getSubStringLength(charnum: number, nchars: number): number; /** @deprecated */ selectSubString(charnum: number, nchars: number): void; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; + readonly LENGTHADJUST_UNKNOWN: 0; + readonly LENGTHADJUST_SPACING: 1; + readonly LENGTHADJUST_SPACINGANDGLYPHS: 2; addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -13329,9 +13512,9 @@ interface SVGTextContentElement extends SVGGraphicsElement { declare var SVGTextContentElement: { prototype: SVGTextContentElement; new(): SVGTextContentElement; - readonly LENGTHADJUST_SPACING: number; - readonly LENGTHADJUST_SPACINGANDGLYPHS: number; - readonly LENGTHADJUST_UNKNOWN: number; + readonly LENGTHADJUST_UNKNOWN: 0; + readonly LENGTHADJUST_SPACING: 1; + readonly LENGTHADJUST_SPACINGANDGLYPHS: 2; }; /** Corresponds to the elements. */ @@ -13352,12 +13535,12 @@ interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { readonly method: SVGAnimatedEnumeration; readonly spacing: SVGAnimatedEnumeration; readonly startOffset: SVGAnimatedLength; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; + readonly TEXTPATH_METHODTYPE_UNKNOWN: 0; + readonly TEXTPATH_METHODTYPE_ALIGN: 1; + readonly TEXTPATH_METHODTYPE_STRETCH: 2; + readonly TEXTPATH_SPACINGTYPE_UNKNOWN: 0; + readonly TEXTPATH_SPACINGTYPE_AUTO: 1; + readonly TEXTPATH_SPACINGTYPE_EXACT: 2; addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -13367,12 +13550,12 @@ interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { declare var SVGTextPathElement: { prototype: SVGTextPathElement; new(): SVGTextPathElement; - readonly TEXTPATH_METHODTYPE_ALIGN: number; - readonly TEXTPATH_METHODTYPE_STRETCH: number; - readonly TEXTPATH_METHODTYPE_UNKNOWN: number; - readonly TEXTPATH_SPACINGTYPE_AUTO: number; - readonly TEXTPATH_SPACINGTYPE_EXACT: number; - readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; + readonly TEXTPATH_METHODTYPE_UNKNOWN: 0; + readonly TEXTPATH_METHODTYPE_ALIGN: 1; + readonly TEXTPATH_METHODTYPE_STRETCH: 2; + readonly TEXTPATH_SPACINGTYPE_UNKNOWN: 0; + readonly TEXTPATH_SPACINGTYPE_AUTO: 1; + readonly TEXTPATH_SPACINGTYPE_EXACT: 2; }; /** Implemented by elements that support attributes that position individual text glyphs. It is inherited by SVGTextElement, SVGTSpanElement, SVGTRefElement and SVGAltGlyphElement. */ @@ -13417,25 +13600,25 @@ interface SVGTransform { setSkewX(angle: number): void; setSkewY(angle: number): void; setTranslate(tx: number, ty: number): void; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; + readonly SVG_TRANSFORM_UNKNOWN: 0; + readonly SVG_TRANSFORM_MATRIX: 1; + readonly SVG_TRANSFORM_TRANSLATE: 2; + readonly SVG_TRANSFORM_SCALE: 3; + readonly SVG_TRANSFORM_ROTATE: 4; + readonly SVG_TRANSFORM_SKEWX: 5; + readonly SVG_TRANSFORM_SKEWY: 6; } declare var SVGTransform: { prototype: SVGTransform; new(): SVGTransform; - readonly SVG_TRANSFORM_MATRIX: number; - readonly SVG_TRANSFORM_ROTATE: number; - readonly SVG_TRANSFORM_SCALE: number; - readonly SVG_TRANSFORM_SKEWX: number; - readonly SVG_TRANSFORM_SKEWY: number; - readonly SVG_TRANSFORM_TRANSLATE: number; - readonly SVG_TRANSFORM_UNKNOWN: number; + readonly SVG_TRANSFORM_UNKNOWN: 0; + readonly SVG_TRANSFORM_MATRIX: 1; + readonly SVG_TRANSFORM_TRANSLATE: 2; + readonly SVG_TRANSFORM_SCALE: 3; + readonly SVG_TRANSFORM_ROTATE: 4; + readonly SVG_TRANSFORM_SKEWX: 5; + readonly SVG_TRANSFORM_SKEWY: 6; }; /** The SVGTransformList defines a list of SVGTransform objects. */ @@ -13465,17 +13648,17 @@ interface SVGURIReference { /** A commonly used set of constants used for reflecting gradientUnits, patternContentUnits and other similar attributes. */ interface SVGUnitTypes { - readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - readonly SVG_UNIT_TYPE_UNKNOWN: number; - readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; + readonly SVG_UNIT_TYPE_UNKNOWN: 0; + readonly SVG_UNIT_TYPE_USERSPACEONUSE: 1; + readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: 2; } declare var SVGUnitTypes: { prototype: SVGUnitTypes; new(): SVGUnitTypes; - readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - readonly SVG_UNIT_TYPE_UNKNOWN: number; - readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; + readonly SVG_UNIT_TYPE_UNKNOWN: 0; + readonly SVG_UNIT_TYPE_USERSPACEONUSE: 1; + readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: 2; }; /** Corresponds to the element. */ @@ -14661,79 +14844,79 @@ declare var VisualViewport: { }; interface WEBGL_color_buffer_float { - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum; - readonly RGBA32F_EXT: GLenum; - readonly UNSIGNED_NORMALIZED_EXT: GLenum; + readonly RGBA32F_EXT: 0x8814; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 0x8211; + readonly UNSIGNED_NORMALIZED_EXT: 0x8C17; } interface WEBGL_compressed_texture_astc { getSupportedProfiles(): string[]; - readonly COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum; + readonly COMPRESSED_RGBA_ASTC_4x4_KHR: 0x93B0; + readonly COMPRESSED_RGBA_ASTC_5x4_KHR: 0x93B1; + readonly COMPRESSED_RGBA_ASTC_5x5_KHR: 0x93B2; + readonly COMPRESSED_RGBA_ASTC_6x5_KHR: 0x93B3; + readonly COMPRESSED_RGBA_ASTC_6x6_KHR: 0x93B4; + readonly COMPRESSED_RGBA_ASTC_8x5_KHR: 0x93B5; + readonly COMPRESSED_RGBA_ASTC_8x6_KHR: 0x93B6; + readonly COMPRESSED_RGBA_ASTC_8x8_KHR: 0x93B7; + readonly COMPRESSED_RGBA_ASTC_10x5_KHR: 0x93B8; + readonly COMPRESSED_RGBA_ASTC_10x6_KHR: 0x93B9; + readonly COMPRESSED_RGBA_ASTC_10x8_KHR: 0x93BA; + readonly COMPRESSED_RGBA_ASTC_10x10_KHR: 0x93BB; + readonly COMPRESSED_RGBA_ASTC_12x10_KHR: 0x93BC; + readonly COMPRESSED_RGBA_ASTC_12x12_KHR: 0x93BD; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: 0x93D0; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: 0x93D1; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: 0x93D2; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: 0x93D3; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: 0x93D4; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: 0x93D5; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: 0x93D6; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: 0x93D7; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: 0x93D8; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: 0x93D9; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: 0x93DA; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: 0x93DB; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: 0x93DC; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: 0x93DD; } interface WEBGL_compressed_texture_etc { - readonly COMPRESSED_R11_EAC: GLenum; - readonly COMPRESSED_RG11_EAC: GLenum; - readonly COMPRESSED_RGB8_ETC2: GLenum; - readonly COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum; - readonly COMPRESSED_RGBA8_ETC2_EAC: GLenum; - readonly COMPRESSED_SIGNED_R11_EAC: GLenum; - readonly COMPRESSED_SIGNED_RG11_EAC: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GLenum; - readonly COMPRESSED_SRGB8_ETC2: GLenum; - readonly COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum; + readonly COMPRESSED_R11_EAC: 0x9270; + readonly COMPRESSED_SIGNED_R11_EAC: 0x9271; + readonly COMPRESSED_RG11_EAC: 0x9272; + readonly COMPRESSED_SIGNED_RG11_EAC: 0x9273; + readonly COMPRESSED_RGB8_ETC2: 0x9274; + readonly COMPRESSED_SRGB8_ETC2: 0x9275; + readonly COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9276; + readonly COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9277; + readonly COMPRESSED_RGBA8_ETC2_EAC: 0x9278; + readonly COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9279; } interface WEBGL_compressed_texture_etc1 { - readonly COMPRESSED_RGB_ETC1_WEBGL: GLenum; + readonly COMPRESSED_RGB_ETC1_WEBGL: 0x8D64; } /** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */ interface WEBGL_compressed_texture_s3tc { - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum; + readonly COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83F0; + readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83F1; + readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83F2; + readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83F3; } interface WEBGL_compressed_texture_s3tc_srgb { - readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum; - readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum; - readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum; - readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum; + readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: 0x8C4C; + readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: 0x8C4D; + readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: 0x8C4E; + readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: 0x8C4F; } /** The WEBGL_debug_renderer_info extension is part of the WebGL API and exposes two constants with information about the graphics driver for debugging purposes. */ interface WEBGL_debug_renderer_info { - readonly UNMASKED_RENDERER_WEBGL: GLenum; - readonly UNMASKED_VENDOR_WEBGL: GLenum; + readonly UNMASKED_VENDOR_WEBGL: 0x9245; + readonly UNMASKED_RENDERER_WEBGL: 0x9246; } interface WEBGL_debug_shaders { @@ -14742,45 +14925,45 @@ interface WEBGL_debug_shaders { /** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */ interface WEBGL_depth_texture { - readonly UNSIGNED_INT_24_8_WEBGL: GLenum; + readonly UNSIGNED_INT_24_8_WEBGL: 0x84FA; } interface WEBGL_draw_buffers { drawBuffersWEBGL(buffers: GLenum[]): void; - readonly COLOR_ATTACHMENT0_WEBGL: GLenum; - readonly COLOR_ATTACHMENT10_WEBGL: GLenum; - readonly COLOR_ATTACHMENT11_WEBGL: GLenum; - readonly COLOR_ATTACHMENT12_WEBGL: GLenum; - readonly COLOR_ATTACHMENT13_WEBGL: GLenum; - readonly COLOR_ATTACHMENT14_WEBGL: GLenum; - readonly COLOR_ATTACHMENT15_WEBGL: GLenum; - readonly COLOR_ATTACHMENT1_WEBGL: GLenum; - readonly COLOR_ATTACHMENT2_WEBGL: GLenum; - readonly COLOR_ATTACHMENT3_WEBGL: GLenum; - readonly COLOR_ATTACHMENT4_WEBGL: GLenum; - readonly COLOR_ATTACHMENT5_WEBGL: GLenum; - readonly COLOR_ATTACHMENT6_WEBGL: GLenum; - readonly COLOR_ATTACHMENT7_WEBGL: GLenum; - readonly COLOR_ATTACHMENT8_WEBGL: GLenum; - readonly COLOR_ATTACHMENT9_WEBGL: GLenum; - readonly DRAW_BUFFER0_WEBGL: GLenum; - readonly DRAW_BUFFER10_WEBGL: GLenum; - readonly DRAW_BUFFER11_WEBGL: GLenum; - readonly DRAW_BUFFER12_WEBGL: GLenum; - readonly DRAW_BUFFER13_WEBGL: GLenum; - readonly DRAW_BUFFER14_WEBGL: GLenum; - readonly DRAW_BUFFER15_WEBGL: GLenum; - readonly DRAW_BUFFER1_WEBGL: GLenum; - readonly DRAW_BUFFER2_WEBGL: GLenum; - readonly DRAW_BUFFER3_WEBGL: GLenum; - readonly DRAW_BUFFER4_WEBGL: GLenum; - readonly DRAW_BUFFER5_WEBGL: GLenum; - readonly DRAW_BUFFER6_WEBGL: GLenum; - readonly DRAW_BUFFER7_WEBGL: GLenum; - readonly DRAW_BUFFER8_WEBGL: GLenum; - readonly DRAW_BUFFER9_WEBGL: GLenum; - readonly MAX_COLOR_ATTACHMENTS_WEBGL: GLenum; - readonly MAX_DRAW_BUFFERS_WEBGL: GLenum; + readonly COLOR_ATTACHMENT0_WEBGL: 0x8CE0; + readonly COLOR_ATTACHMENT1_WEBGL: 0x8CE1; + readonly COLOR_ATTACHMENT2_WEBGL: 0x8CE2; + readonly COLOR_ATTACHMENT3_WEBGL: 0x8CE3; + readonly COLOR_ATTACHMENT4_WEBGL: 0x8CE4; + readonly COLOR_ATTACHMENT5_WEBGL: 0x8CE5; + readonly COLOR_ATTACHMENT6_WEBGL: 0x8CE6; + readonly COLOR_ATTACHMENT7_WEBGL: 0x8CE7; + readonly COLOR_ATTACHMENT8_WEBGL: 0x8CE8; + readonly COLOR_ATTACHMENT9_WEBGL: 0x8CE9; + readonly COLOR_ATTACHMENT10_WEBGL: 0x8CEA; + readonly COLOR_ATTACHMENT11_WEBGL: 0x8CEB; + readonly COLOR_ATTACHMENT12_WEBGL: 0x8CEC; + readonly COLOR_ATTACHMENT13_WEBGL: 0x8CED; + readonly COLOR_ATTACHMENT14_WEBGL: 0x8CEE; + readonly COLOR_ATTACHMENT15_WEBGL: 0x8CEF; + readonly DRAW_BUFFER0_WEBGL: 0x8825; + readonly DRAW_BUFFER1_WEBGL: 0x8826; + readonly DRAW_BUFFER2_WEBGL: 0x8827; + readonly DRAW_BUFFER3_WEBGL: 0x8828; + readonly DRAW_BUFFER4_WEBGL: 0x8829; + readonly DRAW_BUFFER5_WEBGL: 0x882A; + readonly DRAW_BUFFER6_WEBGL: 0x882B; + readonly DRAW_BUFFER7_WEBGL: 0x882C; + readonly DRAW_BUFFER8_WEBGL: 0x882D; + readonly DRAW_BUFFER9_WEBGL: 0x882E; + readonly DRAW_BUFFER10_WEBGL: 0x882F; + readonly DRAW_BUFFER11_WEBGL: 0x8830; + readonly DRAW_BUFFER12_WEBGL: 0x8831; + readonly DRAW_BUFFER13_WEBGL: 0x8832; + readonly DRAW_BUFFER14_WEBGL: 0x8833; + readonly DRAW_BUFFER15_WEBGL: 0x8834; + readonly MAX_COLOR_ATTACHMENTS_WEBGL: 0x8CDF; + readonly MAX_DRAW_BUFFERS_WEBGL: 0x8824; } interface WEBGL_lose_context { @@ -14812,565 +14995,565 @@ interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2Rende declare var WebGL2RenderingContext: { prototype: WebGL2RenderingContext; new(): WebGL2RenderingContext; - readonly ACTIVE_UNIFORM_BLOCKS: GLenum; - readonly ALREADY_SIGNALED: GLenum; - readonly ANY_SAMPLES_PASSED: GLenum; - readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum; - readonly COLOR: GLenum; - readonly COLOR_ATTACHMENT1: GLenum; - readonly COLOR_ATTACHMENT10: GLenum; - readonly COLOR_ATTACHMENT11: GLenum; - readonly COLOR_ATTACHMENT12: GLenum; - readonly COLOR_ATTACHMENT13: GLenum; - readonly COLOR_ATTACHMENT14: GLenum; - readonly COLOR_ATTACHMENT15: GLenum; - readonly COLOR_ATTACHMENT2: GLenum; - readonly COLOR_ATTACHMENT3: GLenum; - readonly COLOR_ATTACHMENT4: GLenum; - readonly COLOR_ATTACHMENT5: GLenum; - readonly COLOR_ATTACHMENT6: GLenum; - readonly COLOR_ATTACHMENT7: GLenum; - readonly COLOR_ATTACHMENT8: GLenum; - readonly COLOR_ATTACHMENT9: GLenum; - readonly COMPARE_REF_TO_TEXTURE: GLenum; - readonly CONDITION_SATISFIED: GLenum; - readonly COPY_READ_BUFFER: GLenum; - readonly COPY_READ_BUFFER_BINDING: GLenum; - readonly COPY_WRITE_BUFFER: GLenum; - readonly COPY_WRITE_BUFFER_BINDING: GLenum; - readonly CURRENT_QUERY: GLenum; - readonly DEPTH: GLenum; - readonly DEPTH24_STENCIL8: GLenum; - readonly DEPTH32F_STENCIL8: GLenum; - readonly DEPTH_COMPONENT24: GLenum; - readonly DEPTH_COMPONENT32F: GLenum; - readonly DRAW_BUFFER0: GLenum; - readonly DRAW_BUFFER1: GLenum; - readonly DRAW_BUFFER10: GLenum; - readonly DRAW_BUFFER11: GLenum; - readonly DRAW_BUFFER12: GLenum; - readonly DRAW_BUFFER13: GLenum; - readonly DRAW_BUFFER14: GLenum; - readonly DRAW_BUFFER15: GLenum; - readonly DRAW_BUFFER2: GLenum; - readonly DRAW_BUFFER3: GLenum; - readonly DRAW_BUFFER4: GLenum; - readonly DRAW_BUFFER5: GLenum; - readonly DRAW_BUFFER6: GLenum; - readonly DRAW_BUFFER7: GLenum; - readonly DRAW_BUFFER8: GLenum; - readonly DRAW_BUFFER9: GLenum; - readonly DRAW_FRAMEBUFFER: GLenum; - readonly DRAW_FRAMEBUFFER_BINDING: GLenum; - readonly DYNAMIC_COPY: GLenum; - readonly DYNAMIC_READ: GLenum; - readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum; - readonly FLOAT_MAT2x3: GLenum; - readonly FLOAT_MAT2x4: GLenum; - readonly FLOAT_MAT3x2: GLenum; - readonly FLOAT_MAT3x4: GLenum; - readonly FLOAT_MAT4x2: GLenum; - readonly FLOAT_MAT4x3: GLenum; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum; - readonly FRAMEBUFFER_DEFAULT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum; - readonly HALF_FLOAT: GLenum; - readonly INTERLEAVED_ATTRIBS: GLenum; - readonly INT_2_10_10_10_REV: GLenum; - readonly INT_SAMPLER_2D: GLenum; - readonly INT_SAMPLER_2D_ARRAY: GLenum; - readonly INT_SAMPLER_3D: GLenum; - readonly INT_SAMPLER_CUBE: GLenum; - readonly INVALID_INDEX: GLenum; - readonly MAX: GLenum; - readonly MAX_3D_TEXTURE_SIZE: GLenum; - readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum; - readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum; - readonly MAX_COLOR_ATTACHMENTS: GLenum; - readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum; - readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum; - readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum; - readonly MAX_DRAW_BUFFERS: GLenum; - readonly MAX_ELEMENTS_INDICES: GLenum; - readonly MAX_ELEMENTS_VERTICES: GLenum; - readonly MAX_ELEMENT_INDEX: GLenum; - readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum; - readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum; - readonly MAX_SAMPLES: GLenum; - readonly MAX_SERVER_WAIT_TIMEOUT: GLenum; - readonly MAX_TEXTURE_LOD_BIAS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum; - readonly MAX_UNIFORM_BLOCK_SIZE: GLenum; - readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum; - readonly MAX_VARYING_COMPONENTS: GLenum; - readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum; - readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum; - readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum; - readonly MIN: GLenum; - readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum; - readonly OBJECT_TYPE: GLenum; - readonly PACK_ROW_LENGTH: GLenum; - readonly PACK_SKIP_PIXELS: GLenum; - readonly PACK_SKIP_ROWS: GLenum; - readonly PIXEL_PACK_BUFFER: GLenum; - readonly PIXEL_PACK_BUFFER_BINDING: GLenum; - readonly PIXEL_UNPACK_BUFFER: GLenum; - readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum; - readonly QUERY_RESULT: GLenum; - readonly QUERY_RESULT_AVAILABLE: GLenum; - readonly R11F_G11F_B10F: GLenum; - readonly R16F: GLenum; - readonly R16I: GLenum; - readonly R16UI: GLenum; - readonly R32F: GLenum; - readonly R32I: GLenum; - readonly R32UI: GLenum; - readonly R8: GLenum; - readonly R8I: GLenum; - readonly R8UI: GLenum; - readonly R8_SNORM: GLenum; - readonly RASTERIZER_DISCARD: GLenum; - readonly READ_BUFFER: GLenum; - readonly READ_FRAMEBUFFER: GLenum; - readonly READ_FRAMEBUFFER_BINDING: GLenum; - readonly RED: GLenum; - readonly RED_INTEGER: GLenum; - readonly RENDERBUFFER_SAMPLES: GLenum; - readonly RG: GLenum; - readonly RG16F: GLenum; - readonly RG16I: GLenum; - readonly RG16UI: GLenum; - readonly RG32F: GLenum; - readonly RG32I: GLenum; - readonly RG32UI: GLenum; - readonly RG8: GLenum; - readonly RG8I: GLenum; - readonly RG8UI: GLenum; - readonly RG8_SNORM: GLenum; - readonly RGB10_A2: GLenum; - readonly RGB10_A2UI: GLenum; - readonly RGB16F: GLenum; - readonly RGB16I: GLenum; - readonly RGB16UI: GLenum; - readonly RGB32F: GLenum; - readonly RGB32I: GLenum; - readonly RGB32UI: GLenum; - readonly RGB8: GLenum; - readonly RGB8I: GLenum; - readonly RGB8UI: GLenum; - readonly RGB8_SNORM: GLenum; - readonly RGB9_E5: GLenum; - readonly RGBA16F: GLenum; - readonly RGBA16I: GLenum; - readonly RGBA16UI: GLenum; - readonly RGBA32F: GLenum; - readonly RGBA32I: GLenum; - readonly RGBA32UI: GLenum; - readonly RGBA8: GLenum; - readonly RGBA8I: GLenum; - readonly RGBA8UI: GLenum; - readonly RGBA8_SNORM: GLenum; - readonly RGBA_INTEGER: GLenum; - readonly RGB_INTEGER: GLenum; - readonly RG_INTEGER: GLenum; - readonly SAMPLER_2D_ARRAY: GLenum; - readonly SAMPLER_2D_ARRAY_SHADOW: GLenum; - readonly SAMPLER_2D_SHADOW: GLenum; - readonly SAMPLER_3D: GLenum; - readonly SAMPLER_BINDING: GLenum; - readonly SAMPLER_CUBE_SHADOW: GLenum; - readonly SEPARATE_ATTRIBS: GLenum; - readonly SIGNALED: GLenum; - readonly SIGNED_NORMALIZED: GLenum; - readonly SRGB: GLenum; - readonly SRGB8: GLenum; - readonly SRGB8_ALPHA8: GLenum; - readonly STATIC_COPY: GLenum; - readonly STATIC_READ: GLenum; - readonly STENCIL: GLenum; - readonly STREAM_COPY: GLenum; - readonly STREAM_READ: GLenum; - readonly SYNC_CONDITION: GLenum; - readonly SYNC_FENCE: GLenum; - readonly SYNC_FLAGS: GLenum; - readonly SYNC_FLUSH_COMMANDS_BIT: GLenum; - readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum; - readonly SYNC_STATUS: GLenum; - readonly TEXTURE_2D_ARRAY: GLenum; - readonly TEXTURE_3D: GLenum; - readonly TEXTURE_BASE_LEVEL: GLenum; - readonly TEXTURE_BINDING_2D_ARRAY: GLenum; - readonly TEXTURE_BINDING_3D: GLenum; - readonly TEXTURE_COMPARE_FUNC: GLenum; - readonly TEXTURE_COMPARE_MODE: GLenum; - readonly TEXTURE_IMMUTABLE_FORMAT: GLenum; - readonly TEXTURE_IMMUTABLE_LEVELS: GLenum; - readonly TEXTURE_MAX_LEVEL: GLenum; - readonly TEXTURE_MAX_LOD: GLenum; - readonly TEXTURE_MIN_LOD: GLenum; - readonly TEXTURE_WRAP_R: GLenum; - readonly TIMEOUT_EXPIRED: GLenum; - readonly TIMEOUT_IGNORED: GLint64; - readonly TRANSFORM_FEEDBACK: GLenum; - readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum; - readonly TRANSFORM_FEEDBACK_BINDING: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum; - readonly TRANSFORM_FEEDBACK_PAUSED: GLenum; - readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum; - readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum; - readonly UNIFORM_ARRAY_STRIDE: GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum; - readonly UNIFORM_BLOCK_BINDING: GLenum; - readonly UNIFORM_BLOCK_DATA_SIZE: GLenum; - readonly UNIFORM_BLOCK_INDEX: GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum; - readonly UNIFORM_BUFFER: GLenum; - readonly UNIFORM_BUFFER_BINDING: GLenum; - readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum; - readonly UNIFORM_BUFFER_SIZE: GLenum; - readonly UNIFORM_BUFFER_START: GLenum; - readonly UNIFORM_IS_ROW_MAJOR: GLenum; - readonly UNIFORM_MATRIX_STRIDE: GLenum; - readonly UNIFORM_OFFSET: GLenum; - readonly UNIFORM_SIZE: GLenum; - readonly UNIFORM_TYPE: GLenum; - readonly UNPACK_IMAGE_HEIGHT: GLenum; - readonly UNPACK_ROW_LENGTH: GLenum; - readonly UNPACK_SKIP_IMAGES: GLenum; - readonly UNPACK_SKIP_PIXELS: GLenum; - readonly UNPACK_SKIP_ROWS: GLenum; - readonly UNSIGNALED: GLenum; - readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum; - readonly UNSIGNED_INT_24_8: GLenum; - readonly UNSIGNED_INT_2_10_10_10_REV: GLenum; - readonly UNSIGNED_INT_5_9_9_9_REV: GLenum; - readonly UNSIGNED_INT_SAMPLER_2D: GLenum; - readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum; - readonly UNSIGNED_INT_SAMPLER_3D: GLenum; - readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum; - readonly UNSIGNED_INT_VEC2: GLenum; - readonly UNSIGNED_INT_VEC3: GLenum; - readonly UNSIGNED_INT_VEC4: GLenum; - readonly UNSIGNED_NORMALIZED: GLenum; - readonly VERTEX_ARRAY_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum; - readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum; - readonly WAIT_FAILED: GLenum; - readonly ACTIVE_ATTRIBUTES: GLenum; - readonly ACTIVE_TEXTURE: GLenum; - readonly ACTIVE_UNIFORMS: GLenum; - readonly ALIASED_LINE_WIDTH_RANGE: GLenum; - readonly ALIASED_POINT_SIZE_RANGE: GLenum; - readonly ALPHA: GLenum; - readonly ALPHA_BITS: GLenum; - readonly ALWAYS: GLenum; - readonly ARRAY_BUFFER: GLenum; - readonly ARRAY_BUFFER_BINDING: GLenum; - readonly ATTACHED_SHADERS: GLenum; - readonly BACK: GLenum; - readonly BLEND: GLenum; - readonly BLEND_COLOR: GLenum; - readonly BLEND_DST_ALPHA: GLenum; - readonly BLEND_DST_RGB: GLenum; - readonly BLEND_EQUATION: GLenum; - readonly BLEND_EQUATION_ALPHA: GLenum; - readonly BLEND_EQUATION_RGB: GLenum; - readonly BLEND_SRC_ALPHA: GLenum; - readonly BLEND_SRC_RGB: GLenum; - readonly BLUE_BITS: GLenum; - readonly BOOL: GLenum; - readonly BOOL_VEC2: GLenum; - readonly BOOL_VEC3: GLenum; - readonly BOOL_VEC4: GLenum; - readonly BROWSER_DEFAULT_WEBGL: GLenum; - readonly BUFFER_SIZE: GLenum; - readonly BUFFER_USAGE: GLenum; - readonly BYTE: GLenum; - readonly CCW: GLenum; - readonly CLAMP_TO_EDGE: GLenum; - readonly COLOR_ATTACHMENT0: GLenum; - readonly COLOR_BUFFER_BIT: GLenum; - readonly COLOR_CLEAR_VALUE: GLenum; - readonly COLOR_WRITEMASK: GLenum; - readonly COMPILE_STATUS: GLenum; - readonly COMPRESSED_TEXTURE_FORMATS: GLenum; - readonly CONSTANT_ALPHA: GLenum; - readonly CONSTANT_COLOR: GLenum; - readonly CONTEXT_LOST_WEBGL: GLenum; - readonly CULL_FACE: GLenum; - readonly CULL_FACE_MODE: GLenum; - readonly CURRENT_PROGRAM: GLenum; - readonly CURRENT_VERTEX_ATTRIB: GLenum; - readonly CW: GLenum; - readonly DECR: GLenum; - readonly DECR_WRAP: GLenum; - readonly DELETE_STATUS: GLenum; - readonly DEPTH_ATTACHMENT: GLenum; - readonly DEPTH_BITS: GLenum; - readonly DEPTH_BUFFER_BIT: GLenum; - readonly DEPTH_CLEAR_VALUE: GLenum; - readonly DEPTH_COMPONENT: GLenum; - readonly DEPTH_COMPONENT16: GLenum; - readonly DEPTH_FUNC: GLenum; - readonly DEPTH_RANGE: GLenum; - readonly DEPTH_STENCIL: GLenum; - readonly DEPTH_STENCIL_ATTACHMENT: GLenum; - readonly DEPTH_TEST: GLenum; - readonly DEPTH_WRITEMASK: GLenum; - readonly DITHER: GLenum; - readonly DONT_CARE: GLenum; - readonly DST_ALPHA: GLenum; - readonly DST_COLOR: GLenum; - readonly DYNAMIC_DRAW: GLenum; - readonly ELEMENT_ARRAY_BUFFER: GLenum; - readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum; - readonly EQUAL: GLenum; - readonly FASTEST: GLenum; - readonly FLOAT: GLenum; - readonly FLOAT_MAT2: GLenum; - readonly FLOAT_MAT3: GLenum; - readonly FLOAT_MAT4: GLenum; - readonly FLOAT_VEC2: GLenum; - readonly FLOAT_VEC3: GLenum; - readonly FLOAT_VEC4: GLenum; - readonly FRAGMENT_SHADER: GLenum; - readonly FRAMEBUFFER: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum; - readonly FRAMEBUFFER_BINDING: GLenum; - readonly FRAMEBUFFER_COMPLETE: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_UNSUPPORTED: GLenum; - readonly FRONT: GLenum; - readonly FRONT_AND_BACK: GLenum; - readonly FRONT_FACE: GLenum; - readonly FUNC_ADD: GLenum; - readonly FUNC_REVERSE_SUBTRACT: GLenum; - readonly FUNC_SUBTRACT: GLenum; - readonly GENERATE_MIPMAP_HINT: GLenum; - readonly GEQUAL: GLenum; - readonly GREATER: GLenum; - readonly GREEN_BITS: GLenum; - readonly HIGH_FLOAT: GLenum; - readonly HIGH_INT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum; - readonly INCR: GLenum; - readonly INCR_WRAP: GLenum; - readonly INT: GLenum; - readonly INT_VEC2: GLenum; - readonly INT_VEC3: GLenum; - readonly INT_VEC4: GLenum; - readonly INVALID_ENUM: GLenum; - readonly INVALID_FRAMEBUFFER_OPERATION: GLenum; - readonly INVALID_OPERATION: GLenum; - readonly INVALID_VALUE: GLenum; - readonly INVERT: GLenum; - readonly KEEP: GLenum; - readonly LEQUAL: GLenum; - readonly LESS: GLenum; - readonly LINEAR: GLenum; - readonly LINEAR_MIPMAP_LINEAR: GLenum; - readonly LINEAR_MIPMAP_NEAREST: GLenum; - readonly LINES: GLenum; - readonly LINE_LOOP: GLenum; - readonly LINE_STRIP: GLenum; - readonly LINE_WIDTH: GLenum; - readonly LINK_STATUS: GLenum; - readonly LOW_FLOAT: GLenum; - readonly LOW_INT: GLenum; - readonly LUMINANCE: GLenum; - readonly LUMINANCE_ALPHA: GLenum; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum; - readonly MAX_RENDERBUFFER_SIZE: GLenum; - readonly MAX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_TEXTURE_SIZE: GLenum; - readonly MAX_VARYING_VECTORS: GLenum; - readonly MAX_VERTEX_ATTRIBS: GLenum; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum; - readonly MAX_VIEWPORT_DIMS: GLenum; - readonly MEDIUM_FLOAT: GLenum; - readonly MEDIUM_INT: GLenum; - readonly MIRRORED_REPEAT: GLenum; - readonly NEAREST: GLenum; - readonly NEAREST_MIPMAP_LINEAR: GLenum; - readonly NEAREST_MIPMAP_NEAREST: GLenum; - readonly NEVER: GLenum; - readonly NICEST: GLenum; - readonly NONE: GLenum; - readonly NOTEQUAL: GLenum; - readonly NO_ERROR: GLenum; - readonly ONE: GLenum; - readonly ONE_MINUS_CONSTANT_ALPHA: GLenum; - readonly ONE_MINUS_CONSTANT_COLOR: GLenum; - readonly ONE_MINUS_DST_ALPHA: GLenum; - readonly ONE_MINUS_DST_COLOR: GLenum; - readonly ONE_MINUS_SRC_ALPHA: GLenum; - readonly ONE_MINUS_SRC_COLOR: GLenum; - readonly OUT_OF_MEMORY: GLenum; - readonly PACK_ALIGNMENT: GLenum; - readonly POINTS: GLenum; - readonly POLYGON_OFFSET_FACTOR: GLenum; - readonly POLYGON_OFFSET_FILL: GLenum; - readonly POLYGON_OFFSET_UNITS: GLenum; - readonly RED_BITS: GLenum; - readonly RENDERBUFFER: GLenum; - readonly RENDERBUFFER_ALPHA_SIZE: GLenum; - readonly RENDERBUFFER_BINDING: GLenum; - readonly RENDERBUFFER_BLUE_SIZE: GLenum; - readonly RENDERBUFFER_DEPTH_SIZE: GLenum; - readonly RENDERBUFFER_GREEN_SIZE: GLenum; - readonly RENDERBUFFER_HEIGHT: GLenum; - readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum; - readonly RENDERBUFFER_RED_SIZE: GLenum; - readonly RENDERBUFFER_STENCIL_SIZE: GLenum; - readonly RENDERBUFFER_WIDTH: GLenum; - readonly RENDERER: GLenum; - readonly REPEAT: GLenum; - readonly REPLACE: GLenum; - readonly RGB: GLenum; - readonly RGB565: GLenum; - readonly RGB5_A1: GLenum; - readonly RGBA: GLenum; - readonly RGBA4: GLenum; - readonly SAMPLER_2D: GLenum; - readonly SAMPLER_CUBE: GLenum; - readonly SAMPLES: GLenum; - readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum; - readonly SAMPLE_BUFFERS: GLenum; - readonly SAMPLE_COVERAGE: GLenum; - readonly SAMPLE_COVERAGE_INVERT: GLenum; - readonly SAMPLE_COVERAGE_VALUE: GLenum; - readonly SCISSOR_BOX: GLenum; - readonly SCISSOR_TEST: GLenum; - readonly SHADER_TYPE: GLenum; - readonly SHADING_LANGUAGE_VERSION: GLenum; - readonly SHORT: GLenum; - readonly SRC_ALPHA: GLenum; - readonly SRC_ALPHA_SATURATE: GLenum; - readonly SRC_COLOR: GLenum; - readonly STATIC_DRAW: GLenum; - readonly STENCIL_ATTACHMENT: GLenum; - readonly STENCIL_BACK_FAIL: GLenum; - readonly STENCIL_BACK_FUNC: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_BACK_REF: GLenum; - readonly STENCIL_BACK_VALUE_MASK: GLenum; - readonly STENCIL_BACK_WRITEMASK: GLenum; - readonly STENCIL_BITS: GLenum; - readonly STENCIL_BUFFER_BIT: GLenum; - readonly STENCIL_CLEAR_VALUE: GLenum; - readonly STENCIL_FAIL: GLenum; - readonly STENCIL_FUNC: GLenum; - readonly STENCIL_INDEX8: GLenum; - readonly STENCIL_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_REF: GLenum; - readonly STENCIL_TEST: GLenum; - readonly STENCIL_VALUE_MASK: GLenum; - readonly STENCIL_WRITEMASK: GLenum; - readonly STREAM_DRAW: GLenum; - readonly SUBPIXEL_BITS: GLenum; - readonly TEXTURE: GLenum; - readonly TEXTURE0: GLenum; - readonly TEXTURE1: GLenum; - readonly TEXTURE10: GLenum; - readonly TEXTURE11: GLenum; - readonly TEXTURE12: GLenum; - readonly TEXTURE13: GLenum; - readonly TEXTURE14: GLenum; - readonly TEXTURE15: GLenum; - readonly TEXTURE16: GLenum; - readonly TEXTURE17: GLenum; - readonly TEXTURE18: GLenum; - readonly TEXTURE19: GLenum; - readonly TEXTURE2: GLenum; - readonly TEXTURE20: GLenum; - readonly TEXTURE21: GLenum; - readonly TEXTURE22: GLenum; - readonly TEXTURE23: GLenum; - readonly TEXTURE24: GLenum; - readonly TEXTURE25: GLenum; - readonly TEXTURE26: GLenum; - readonly TEXTURE27: GLenum; - readonly TEXTURE28: GLenum; - readonly TEXTURE29: GLenum; - readonly TEXTURE3: GLenum; - readonly TEXTURE30: GLenum; - readonly TEXTURE31: GLenum; - readonly TEXTURE4: GLenum; - readonly TEXTURE5: GLenum; - readonly TEXTURE6: GLenum; - readonly TEXTURE7: GLenum; - readonly TEXTURE8: GLenum; - readonly TEXTURE9: GLenum; - readonly TEXTURE_2D: GLenum; - readonly TEXTURE_BINDING_2D: GLenum; - readonly TEXTURE_BINDING_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum; - readonly TEXTURE_MAG_FILTER: GLenum; - readonly TEXTURE_MIN_FILTER: GLenum; - readonly TEXTURE_WRAP_S: GLenum; - readonly TEXTURE_WRAP_T: GLenum; - readonly TRIANGLES: GLenum; - readonly TRIANGLE_FAN: GLenum; - readonly TRIANGLE_STRIP: GLenum; - readonly UNPACK_ALIGNMENT: GLenum; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum; - readonly UNPACK_FLIP_Y_WEBGL: GLenum; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum; - readonly UNSIGNED_BYTE: GLenum; - readonly UNSIGNED_INT: GLenum; - readonly UNSIGNED_SHORT: GLenum; - readonly UNSIGNED_SHORT_4_4_4_4: GLenum; - readonly UNSIGNED_SHORT_5_5_5_1: GLenum; - readonly UNSIGNED_SHORT_5_6_5: GLenum; - readonly VALIDATE_STATUS: GLenum; - readonly VENDOR: GLenum; - readonly VERSION: GLenum; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum; - readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum; - readonly VERTEX_SHADER: GLenum; - readonly VIEWPORT: GLenum; - readonly ZERO: GLenum; + readonly READ_BUFFER: 0x0C02; + readonly UNPACK_ROW_LENGTH: 0x0CF2; + readonly UNPACK_SKIP_ROWS: 0x0CF3; + readonly UNPACK_SKIP_PIXELS: 0x0CF4; + readonly PACK_ROW_LENGTH: 0x0D02; + readonly PACK_SKIP_ROWS: 0x0D03; + readonly PACK_SKIP_PIXELS: 0x0D04; + readonly COLOR: 0x1800; + readonly DEPTH: 0x1801; + readonly STENCIL: 0x1802; + readonly RED: 0x1903; + readonly RGB8: 0x8051; + readonly RGBA8: 0x8058; + readonly RGB10_A2: 0x8059; + readonly TEXTURE_BINDING_3D: 0x806A; + readonly UNPACK_SKIP_IMAGES: 0x806D; + readonly UNPACK_IMAGE_HEIGHT: 0x806E; + readonly TEXTURE_3D: 0x806F; + readonly TEXTURE_WRAP_R: 0x8072; + readonly MAX_3D_TEXTURE_SIZE: 0x8073; + readonly UNSIGNED_INT_2_10_10_10_REV: 0x8368; + readonly MAX_ELEMENTS_VERTICES: 0x80E8; + readonly MAX_ELEMENTS_INDICES: 0x80E9; + readonly TEXTURE_MIN_LOD: 0x813A; + readonly TEXTURE_MAX_LOD: 0x813B; + readonly TEXTURE_BASE_LEVEL: 0x813C; + readonly TEXTURE_MAX_LEVEL: 0x813D; + readonly MIN: 0x8007; + readonly MAX: 0x8008; + readonly DEPTH_COMPONENT24: 0x81A6; + readonly MAX_TEXTURE_LOD_BIAS: 0x84FD; + readonly TEXTURE_COMPARE_MODE: 0x884C; + readonly TEXTURE_COMPARE_FUNC: 0x884D; + readonly CURRENT_QUERY: 0x8865; + readonly QUERY_RESULT: 0x8866; + readonly QUERY_RESULT_AVAILABLE: 0x8867; + readonly STREAM_READ: 0x88E1; + readonly STREAM_COPY: 0x88E2; + readonly STATIC_READ: 0x88E5; + readonly STATIC_COPY: 0x88E6; + readonly DYNAMIC_READ: 0x88E9; + readonly DYNAMIC_COPY: 0x88EA; + readonly MAX_DRAW_BUFFERS: 0x8824; + readonly DRAW_BUFFER0: 0x8825; + readonly DRAW_BUFFER1: 0x8826; + readonly DRAW_BUFFER2: 0x8827; + readonly DRAW_BUFFER3: 0x8828; + readonly DRAW_BUFFER4: 0x8829; + readonly DRAW_BUFFER5: 0x882A; + readonly DRAW_BUFFER6: 0x882B; + readonly DRAW_BUFFER7: 0x882C; + readonly DRAW_BUFFER8: 0x882D; + readonly DRAW_BUFFER9: 0x882E; + readonly DRAW_BUFFER10: 0x882F; + readonly DRAW_BUFFER11: 0x8830; + readonly DRAW_BUFFER12: 0x8831; + readonly DRAW_BUFFER13: 0x8832; + readonly DRAW_BUFFER14: 0x8833; + readonly DRAW_BUFFER15: 0x8834; + readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: 0x8B49; + readonly MAX_VERTEX_UNIFORM_COMPONENTS: 0x8B4A; + readonly SAMPLER_3D: 0x8B5F; + readonly SAMPLER_2D_SHADOW: 0x8B62; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8B8B; + readonly PIXEL_PACK_BUFFER: 0x88EB; + readonly PIXEL_UNPACK_BUFFER: 0x88EC; + readonly PIXEL_PACK_BUFFER_BINDING: 0x88ED; + readonly PIXEL_UNPACK_BUFFER_BINDING: 0x88EF; + readonly FLOAT_MAT2x3: 0x8B65; + readonly FLOAT_MAT2x4: 0x8B66; + readonly FLOAT_MAT3x2: 0x8B67; + readonly FLOAT_MAT3x4: 0x8B68; + readonly FLOAT_MAT4x2: 0x8B69; + readonly FLOAT_MAT4x3: 0x8B6A; + readonly SRGB: 0x8C40; + readonly SRGB8: 0x8C41; + readonly SRGB8_ALPHA8: 0x8C43; + readonly COMPARE_REF_TO_TEXTURE: 0x884E; + readonly RGBA32F: 0x8814; + readonly RGB32F: 0x8815; + readonly RGBA16F: 0x881A; + readonly RGB16F: 0x881B; + readonly VERTEX_ATTRIB_ARRAY_INTEGER: 0x88FD; + readonly MAX_ARRAY_TEXTURE_LAYERS: 0x88FF; + readonly MIN_PROGRAM_TEXEL_OFFSET: 0x8904; + readonly MAX_PROGRAM_TEXEL_OFFSET: 0x8905; + readonly MAX_VARYING_COMPONENTS: 0x8B4B; + readonly TEXTURE_2D_ARRAY: 0x8C1A; + readonly TEXTURE_BINDING_2D_ARRAY: 0x8C1D; + readonly R11F_G11F_B10F: 0x8C3A; + readonly UNSIGNED_INT_10F_11F_11F_REV: 0x8C3B; + readonly RGB9_E5: 0x8C3D; + readonly UNSIGNED_INT_5_9_9_9_REV: 0x8C3E; + readonly TRANSFORM_FEEDBACK_BUFFER_MODE: 0x8C7F; + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 0x8C80; + readonly TRANSFORM_FEEDBACK_VARYINGS: 0x8C83; + readonly TRANSFORM_FEEDBACK_BUFFER_START: 0x8C84; + readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: 0x8C85; + readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 0x8C88; + readonly RASTERIZER_DISCARD: 0x8C89; + readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 0x8C8A; + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 0x8C8B; + readonly INTERLEAVED_ATTRIBS: 0x8C8C; + readonly SEPARATE_ATTRIBS: 0x8C8D; + readonly TRANSFORM_FEEDBACK_BUFFER: 0x8C8E; + readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: 0x8C8F; + readonly RGBA32UI: 0x8D70; + readonly RGB32UI: 0x8D71; + readonly RGBA16UI: 0x8D76; + readonly RGB16UI: 0x8D77; + readonly RGBA8UI: 0x8D7C; + readonly RGB8UI: 0x8D7D; + readonly RGBA32I: 0x8D82; + readonly RGB32I: 0x8D83; + readonly RGBA16I: 0x8D88; + readonly RGB16I: 0x8D89; + readonly RGBA8I: 0x8D8E; + readonly RGB8I: 0x8D8F; + readonly RED_INTEGER: 0x8D94; + readonly RGB_INTEGER: 0x8D98; + readonly RGBA_INTEGER: 0x8D99; + readonly SAMPLER_2D_ARRAY: 0x8DC1; + readonly SAMPLER_2D_ARRAY_SHADOW: 0x8DC4; + readonly SAMPLER_CUBE_SHADOW: 0x8DC5; + readonly UNSIGNED_INT_VEC2: 0x8DC6; + readonly UNSIGNED_INT_VEC3: 0x8DC7; + readonly UNSIGNED_INT_VEC4: 0x8DC8; + readonly INT_SAMPLER_2D: 0x8DCA; + readonly INT_SAMPLER_3D: 0x8DCB; + readonly INT_SAMPLER_CUBE: 0x8DCC; + readonly INT_SAMPLER_2D_ARRAY: 0x8DCF; + readonly UNSIGNED_INT_SAMPLER_2D: 0x8DD2; + readonly UNSIGNED_INT_SAMPLER_3D: 0x8DD3; + readonly UNSIGNED_INT_SAMPLER_CUBE: 0x8DD4; + readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: 0x8DD7; + readonly DEPTH_COMPONENT32F: 0x8CAC; + readonly DEPTH32F_STENCIL8: 0x8CAD; + readonly FLOAT_32_UNSIGNED_INT_24_8_REV: 0x8DAD; + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 0x8210; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 0x8211; + readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: 0x8212; + readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 0x8213; + readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 0x8214; + readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 0x8215; + readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 0x8216; + readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 0x8217; + readonly FRAMEBUFFER_DEFAULT: 0x8218; + readonly UNSIGNED_INT_24_8: 0x84FA; + readonly DEPTH24_STENCIL8: 0x88F0; + readonly UNSIGNED_NORMALIZED: 0x8C17; + readonly DRAW_FRAMEBUFFER_BINDING: 0x8CA6; + readonly READ_FRAMEBUFFER: 0x8CA8; + readonly DRAW_FRAMEBUFFER: 0x8CA9; + readonly READ_FRAMEBUFFER_BINDING: 0x8CAA; + readonly RENDERBUFFER_SAMPLES: 0x8CAB; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 0x8CD4; + readonly MAX_COLOR_ATTACHMENTS: 0x8CDF; + readonly COLOR_ATTACHMENT1: 0x8CE1; + readonly COLOR_ATTACHMENT2: 0x8CE2; + readonly COLOR_ATTACHMENT3: 0x8CE3; + readonly COLOR_ATTACHMENT4: 0x8CE4; + readonly COLOR_ATTACHMENT5: 0x8CE5; + readonly COLOR_ATTACHMENT6: 0x8CE6; + readonly COLOR_ATTACHMENT7: 0x8CE7; + readonly COLOR_ATTACHMENT8: 0x8CE8; + readonly COLOR_ATTACHMENT9: 0x8CE9; + readonly COLOR_ATTACHMENT10: 0x8CEA; + readonly COLOR_ATTACHMENT11: 0x8CEB; + readonly COLOR_ATTACHMENT12: 0x8CEC; + readonly COLOR_ATTACHMENT13: 0x8CED; + readonly COLOR_ATTACHMENT14: 0x8CEE; + readonly COLOR_ATTACHMENT15: 0x8CEF; + readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8D56; + readonly MAX_SAMPLES: 0x8D57; + readonly HALF_FLOAT: 0x140B; + readonly RG: 0x8227; + readonly RG_INTEGER: 0x8228; + readonly R8: 0x8229; + readonly RG8: 0x822B; + readonly R16F: 0x822D; + readonly R32F: 0x822E; + readonly RG16F: 0x822F; + readonly RG32F: 0x8230; + readonly R8I: 0x8231; + readonly R8UI: 0x8232; + readonly R16I: 0x8233; + readonly R16UI: 0x8234; + readonly R32I: 0x8235; + readonly R32UI: 0x8236; + readonly RG8I: 0x8237; + readonly RG8UI: 0x8238; + readonly RG16I: 0x8239; + readonly RG16UI: 0x823A; + readonly RG32I: 0x823B; + readonly RG32UI: 0x823C; + readonly VERTEX_ARRAY_BINDING: 0x85B5; + readonly R8_SNORM: 0x8F94; + readonly RG8_SNORM: 0x8F95; + readonly RGB8_SNORM: 0x8F96; + readonly RGBA8_SNORM: 0x8F97; + readonly SIGNED_NORMALIZED: 0x8F9C; + readonly COPY_READ_BUFFER: 0x8F36; + readonly COPY_WRITE_BUFFER: 0x8F37; + readonly COPY_READ_BUFFER_BINDING: 0x8F36; + readonly COPY_WRITE_BUFFER_BINDING: 0x8F37; + readonly UNIFORM_BUFFER: 0x8A11; + readonly UNIFORM_BUFFER_BINDING: 0x8A28; + readonly UNIFORM_BUFFER_START: 0x8A29; + readonly UNIFORM_BUFFER_SIZE: 0x8A2A; + readonly MAX_VERTEX_UNIFORM_BLOCKS: 0x8A2B; + readonly MAX_FRAGMENT_UNIFORM_BLOCKS: 0x8A2D; + readonly MAX_COMBINED_UNIFORM_BLOCKS: 0x8A2E; + readonly MAX_UNIFORM_BUFFER_BINDINGS: 0x8A2F; + readonly MAX_UNIFORM_BLOCK_SIZE: 0x8A30; + readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 0x8A31; + readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 0x8A33; + readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: 0x8A34; + readonly ACTIVE_UNIFORM_BLOCKS: 0x8A36; + readonly UNIFORM_TYPE: 0x8A37; + readonly UNIFORM_SIZE: 0x8A38; + readonly UNIFORM_BLOCK_INDEX: 0x8A3A; + readonly UNIFORM_OFFSET: 0x8A3B; + readonly UNIFORM_ARRAY_STRIDE: 0x8A3C; + readonly UNIFORM_MATRIX_STRIDE: 0x8A3D; + readonly UNIFORM_IS_ROW_MAJOR: 0x8A3E; + readonly UNIFORM_BLOCK_BINDING: 0x8A3F; + readonly UNIFORM_BLOCK_DATA_SIZE: 0x8A40; + readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: 0x8A42; + readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 0x8A43; + readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 0x8A44; + readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 0x8A46; + readonly INVALID_INDEX: 0xFFFFFFFF; + readonly MAX_VERTEX_OUTPUT_COMPONENTS: 0x9122; + readonly MAX_FRAGMENT_INPUT_COMPONENTS: 0x9125; + readonly MAX_SERVER_WAIT_TIMEOUT: 0x9111; + readonly OBJECT_TYPE: 0x9112; + readonly SYNC_CONDITION: 0x9113; + readonly SYNC_STATUS: 0x9114; + readonly SYNC_FLAGS: 0x9115; + readonly SYNC_FENCE: 0x9116; + readonly SYNC_GPU_COMMANDS_COMPLETE: 0x9117; + readonly UNSIGNALED: 0x9118; + readonly SIGNALED: 0x9119; + readonly ALREADY_SIGNALED: 0x911A; + readonly TIMEOUT_EXPIRED: 0x911B; + readonly CONDITION_SATISFIED: 0x911C; + readonly WAIT_FAILED: 0x911D; + readonly SYNC_FLUSH_COMMANDS_BIT: 0x00000001; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR: 0x88FE; + readonly ANY_SAMPLES_PASSED: 0x8C2F; + readonly ANY_SAMPLES_PASSED_CONSERVATIVE: 0x8D6A; + readonly SAMPLER_BINDING: 0x8919; + readonly RGB10_A2UI: 0x906F; + readonly INT_2_10_10_10_REV: 0x8D9F; + readonly TRANSFORM_FEEDBACK: 0x8E22; + readonly TRANSFORM_FEEDBACK_PAUSED: 0x8E23; + readonly TRANSFORM_FEEDBACK_ACTIVE: 0x8E24; + readonly TRANSFORM_FEEDBACK_BINDING: 0x8E25; + readonly TEXTURE_IMMUTABLE_FORMAT: 0x912F; + readonly MAX_ELEMENT_INDEX: 0x8D6B; + readonly TEXTURE_IMMUTABLE_LEVELS: 0x82DF; + readonly TIMEOUT_IGNORED: -1; + readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: 0x9247; + readonly DEPTH_BUFFER_BIT: 0x00000100; + readonly STENCIL_BUFFER_BIT: 0x00000400; + readonly COLOR_BUFFER_BIT: 0x00004000; + readonly POINTS: 0x0000; + readonly LINES: 0x0001; + readonly LINE_LOOP: 0x0002; + readonly LINE_STRIP: 0x0003; + readonly TRIANGLES: 0x0004; + readonly TRIANGLE_STRIP: 0x0005; + readonly TRIANGLE_FAN: 0x0006; + readonly ZERO: 0; + readonly ONE: 1; + readonly SRC_COLOR: 0x0300; + readonly ONE_MINUS_SRC_COLOR: 0x0301; + readonly SRC_ALPHA: 0x0302; + readonly ONE_MINUS_SRC_ALPHA: 0x0303; + readonly DST_ALPHA: 0x0304; + readonly ONE_MINUS_DST_ALPHA: 0x0305; + readonly DST_COLOR: 0x0306; + readonly ONE_MINUS_DST_COLOR: 0x0307; + readonly SRC_ALPHA_SATURATE: 0x0308; + readonly FUNC_ADD: 0x8006; + readonly BLEND_EQUATION: 0x8009; + readonly BLEND_EQUATION_RGB: 0x8009; + readonly BLEND_EQUATION_ALPHA: 0x883D; + readonly FUNC_SUBTRACT: 0x800A; + readonly FUNC_REVERSE_SUBTRACT: 0x800B; + readonly BLEND_DST_RGB: 0x80C8; + readonly BLEND_SRC_RGB: 0x80C9; + readonly BLEND_DST_ALPHA: 0x80CA; + readonly BLEND_SRC_ALPHA: 0x80CB; + readonly CONSTANT_COLOR: 0x8001; + readonly ONE_MINUS_CONSTANT_COLOR: 0x8002; + readonly CONSTANT_ALPHA: 0x8003; + readonly ONE_MINUS_CONSTANT_ALPHA: 0x8004; + readonly BLEND_COLOR: 0x8005; + readonly ARRAY_BUFFER: 0x8892; + readonly ELEMENT_ARRAY_BUFFER: 0x8893; + readonly ARRAY_BUFFER_BINDING: 0x8894; + readonly ELEMENT_ARRAY_BUFFER_BINDING: 0x8895; + readonly STREAM_DRAW: 0x88E0; + readonly STATIC_DRAW: 0x88E4; + readonly DYNAMIC_DRAW: 0x88E8; + readonly BUFFER_SIZE: 0x8764; + readonly BUFFER_USAGE: 0x8765; + readonly CURRENT_VERTEX_ATTRIB: 0x8626; + readonly FRONT: 0x0404; + readonly BACK: 0x0405; + readonly FRONT_AND_BACK: 0x0408; + readonly CULL_FACE: 0x0B44; + readonly BLEND: 0x0BE2; + readonly DITHER: 0x0BD0; + readonly STENCIL_TEST: 0x0B90; + readonly DEPTH_TEST: 0x0B71; + readonly SCISSOR_TEST: 0x0C11; + readonly POLYGON_OFFSET_FILL: 0x8037; + readonly SAMPLE_ALPHA_TO_COVERAGE: 0x809E; + readonly SAMPLE_COVERAGE: 0x80A0; + readonly NO_ERROR: 0; + readonly INVALID_ENUM: 0x0500; + readonly INVALID_VALUE: 0x0501; + readonly INVALID_OPERATION: 0x0502; + readonly OUT_OF_MEMORY: 0x0505; + readonly CW: 0x0900; + readonly CCW: 0x0901; + readonly LINE_WIDTH: 0x0B21; + readonly ALIASED_POINT_SIZE_RANGE: 0x846D; + readonly ALIASED_LINE_WIDTH_RANGE: 0x846E; + readonly CULL_FACE_MODE: 0x0B45; + readonly FRONT_FACE: 0x0B46; + readonly DEPTH_RANGE: 0x0B70; + readonly DEPTH_WRITEMASK: 0x0B72; + readonly DEPTH_CLEAR_VALUE: 0x0B73; + readonly DEPTH_FUNC: 0x0B74; + readonly STENCIL_CLEAR_VALUE: 0x0B91; + readonly STENCIL_FUNC: 0x0B92; + readonly STENCIL_FAIL: 0x0B94; + readonly STENCIL_PASS_DEPTH_FAIL: 0x0B95; + readonly STENCIL_PASS_DEPTH_PASS: 0x0B96; + readonly STENCIL_REF: 0x0B97; + readonly STENCIL_VALUE_MASK: 0x0B93; + readonly STENCIL_WRITEMASK: 0x0B98; + readonly STENCIL_BACK_FUNC: 0x8800; + readonly STENCIL_BACK_FAIL: 0x8801; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802; + readonly STENCIL_BACK_PASS_DEPTH_PASS: 0x8803; + readonly STENCIL_BACK_REF: 0x8CA3; + readonly STENCIL_BACK_VALUE_MASK: 0x8CA4; + readonly STENCIL_BACK_WRITEMASK: 0x8CA5; + readonly VIEWPORT: 0x0BA2; + readonly SCISSOR_BOX: 0x0C10; + readonly COLOR_CLEAR_VALUE: 0x0C22; + readonly COLOR_WRITEMASK: 0x0C23; + readonly UNPACK_ALIGNMENT: 0x0CF5; + readonly PACK_ALIGNMENT: 0x0D05; + readonly MAX_TEXTURE_SIZE: 0x0D33; + readonly MAX_VIEWPORT_DIMS: 0x0D3A; + readonly SUBPIXEL_BITS: 0x0D50; + readonly RED_BITS: 0x0D52; + readonly GREEN_BITS: 0x0D53; + readonly BLUE_BITS: 0x0D54; + readonly ALPHA_BITS: 0x0D55; + readonly DEPTH_BITS: 0x0D56; + readonly STENCIL_BITS: 0x0D57; + readonly POLYGON_OFFSET_UNITS: 0x2A00; + readonly POLYGON_OFFSET_FACTOR: 0x8038; + readonly TEXTURE_BINDING_2D: 0x8069; + readonly SAMPLE_BUFFERS: 0x80A8; + readonly SAMPLES: 0x80A9; + readonly SAMPLE_COVERAGE_VALUE: 0x80AA; + readonly SAMPLE_COVERAGE_INVERT: 0x80AB; + readonly COMPRESSED_TEXTURE_FORMATS: 0x86A3; + readonly DONT_CARE: 0x1100; + readonly FASTEST: 0x1101; + readonly NICEST: 0x1102; + readonly GENERATE_MIPMAP_HINT: 0x8192; + readonly BYTE: 0x1400; + readonly UNSIGNED_BYTE: 0x1401; + readonly SHORT: 0x1402; + readonly UNSIGNED_SHORT: 0x1403; + readonly INT: 0x1404; + readonly UNSIGNED_INT: 0x1405; + readonly FLOAT: 0x1406; + readonly DEPTH_COMPONENT: 0x1902; + readonly ALPHA: 0x1906; + readonly RGB: 0x1907; + readonly RGBA: 0x1908; + readonly LUMINANCE: 0x1909; + readonly LUMINANCE_ALPHA: 0x190A; + readonly UNSIGNED_SHORT_4_4_4_4: 0x8033; + readonly UNSIGNED_SHORT_5_5_5_1: 0x8034; + readonly UNSIGNED_SHORT_5_6_5: 0x8363; + readonly FRAGMENT_SHADER: 0x8B30; + readonly VERTEX_SHADER: 0x8B31; + readonly MAX_VERTEX_ATTRIBS: 0x8869; + readonly MAX_VERTEX_UNIFORM_VECTORS: 0x8DFB; + readonly MAX_VARYING_VECTORS: 0x8DFC; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8B4D; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8B4C; + readonly MAX_TEXTURE_IMAGE_UNITS: 0x8872; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: 0x8DFD; + readonly SHADER_TYPE: 0x8B4F; + readonly DELETE_STATUS: 0x8B80; + readonly LINK_STATUS: 0x8B82; + readonly VALIDATE_STATUS: 0x8B83; + readonly ATTACHED_SHADERS: 0x8B85; + readonly ACTIVE_UNIFORMS: 0x8B86; + readonly ACTIVE_ATTRIBUTES: 0x8B89; + readonly SHADING_LANGUAGE_VERSION: 0x8B8C; + readonly CURRENT_PROGRAM: 0x8B8D; + readonly NEVER: 0x0200; + readonly LESS: 0x0201; + readonly EQUAL: 0x0202; + readonly LEQUAL: 0x0203; + readonly GREATER: 0x0204; + readonly NOTEQUAL: 0x0205; + readonly GEQUAL: 0x0206; + readonly ALWAYS: 0x0207; + readonly KEEP: 0x1E00; + readonly REPLACE: 0x1E01; + readonly INCR: 0x1E02; + readonly DECR: 0x1E03; + readonly INVERT: 0x150A; + readonly INCR_WRAP: 0x8507; + readonly DECR_WRAP: 0x8508; + readonly VENDOR: 0x1F00; + readonly RENDERER: 0x1F01; + readonly VERSION: 0x1F02; + readonly NEAREST: 0x2600; + readonly LINEAR: 0x2601; + readonly NEAREST_MIPMAP_NEAREST: 0x2700; + readonly LINEAR_MIPMAP_NEAREST: 0x2701; + readonly NEAREST_MIPMAP_LINEAR: 0x2702; + readonly LINEAR_MIPMAP_LINEAR: 0x2703; + readonly TEXTURE_MAG_FILTER: 0x2800; + readonly TEXTURE_MIN_FILTER: 0x2801; + readonly TEXTURE_WRAP_S: 0x2802; + readonly TEXTURE_WRAP_T: 0x2803; + readonly TEXTURE_2D: 0x0DE1; + readonly TEXTURE: 0x1702; + readonly TEXTURE_CUBE_MAP: 0x8513; + readonly TEXTURE_BINDING_CUBE_MAP: 0x8514; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851A; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: 0x851C; + readonly TEXTURE0: 0x84C0; + readonly TEXTURE1: 0x84C1; + readonly TEXTURE2: 0x84C2; + readonly TEXTURE3: 0x84C3; + readonly TEXTURE4: 0x84C4; + readonly TEXTURE5: 0x84C5; + readonly TEXTURE6: 0x84C6; + readonly TEXTURE7: 0x84C7; + readonly TEXTURE8: 0x84C8; + readonly TEXTURE9: 0x84C9; + readonly TEXTURE10: 0x84CA; + readonly TEXTURE11: 0x84CB; + readonly TEXTURE12: 0x84CC; + readonly TEXTURE13: 0x84CD; + readonly TEXTURE14: 0x84CE; + readonly TEXTURE15: 0x84CF; + readonly TEXTURE16: 0x84D0; + readonly TEXTURE17: 0x84D1; + readonly TEXTURE18: 0x84D2; + readonly TEXTURE19: 0x84D3; + readonly TEXTURE20: 0x84D4; + readonly TEXTURE21: 0x84D5; + readonly TEXTURE22: 0x84D6; + readonly TEXTURE23: 0x84D7; + readonly TEXTURE24: 0x84D8; + readonly TEXTURE25: 0x84D9; + readonly TEXTURE26: 0x84DA; + readonly TEXTURE27: 0x84DB; + readonly TEXTURE28: 0x84DC; + readonly TEXTURE29: 0x84DD; + readonly TEXTURE30: 0x84DE; + readonly TEXTURE31: 0x84DF; + readonly ACTIVE_TEXTURE: 0x84E0; + readonly REPEAT: 0x2901; + readonly CLAMP_TO_EDGE: 0x812F; + readonly MIRRORED_REPEAT: 0x8370; + readonly FLOAT_VEC2: 0x8B50; + readonly FLOAT_VEC3: 0x8B51; + readonly FLOAT_VEC4: 0x8B52; + readonly INT_VEC2: 0x8B53; + readonly INT_VEC3: 0x8B54; + readonly INT_VEC4: 0x8B55; + readonly BOOL: 0x8B56; + readonly BOOL_VEC2: 0x8B57; + readonly BOOL_VEC3: 0x8B58; + readonly BOOL_VEC4: 0x8B59; + readonly FLOAT_MAT2: 0x8B5A; + readonly FLOAT_MAT3: 0x8B5B; + readonly FLOAT_MAT4: 0x8B5C; + readonly SAMPLER_2D: 0x8B5E; + readonly SAMPLER_CUBE: 0x8B60; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622; + readonly VERTEX_ATTRIB_ARRAY_SIZE: 0x8623; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624; + readonly VERTEX_ATTRIB_ARRAY_TYPE: 0x8625; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886A; + readonly VERTEX_ATTRIB_ARRAY_POINTER: 0x8645; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889F; + readonly IMPLEMENTATION_COLOR_READ_TYPE: 0x8B9A; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: 0x8B9B; + readonly COMPILE_STATUS: 0x8B81; + readonly LOW_FLOAT: 0x8DF0; + readonly MEDIUM_FLOAT: 0x8DF1; + readonly HIGH_FLOAT: 0x8DF2; + readonly LOW_INT: 0x8DF3; + readonly MEDIUM_INT: 0x8DF4; + readonly HIGH_INT: 0x8DF5; + readonly FRAMEBUFFER: 0x8D40; + readonly RENDERBUFFER: 0x8D41; + readonly RGBA4: 0x8056; + readonly RGB5_A1: 0x8057; + readonly RGB565: 0x8D62; + readonly DEPTH_COMPONENT16: 0x81A5; + readonly STENCIL_INDEX8: 0x8D48; + readonly DEPTH_STENCIL: 0x84F9; + readonly RENDERBUFFER_WIDTH: 0x8D42; + readonly RENDERBUFFER_HEIGHT: 0x8D43; + readonly RENDERBUFFER_INTERNAL_FORMAT: 0x8D44; + readonly RENDERBUFFER_RED_SIZE: 0x8D50; + readonly RENDERBUFFER_GREEN_SIZE: 0x8D51; + readonly RENDERBUFFER_BLUE_SIZE: 0x8D52; + readonly RENDERBUFFER_ALPHA_SIZE: 0x8D53; + readonly RENDERBUFFER_DEPTH_SIZE: 0x8D54; + readonly RENDERBUFFER_STENCIL_SIZE: 0x8D55; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8CD0; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8CD1; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8CD2; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8CD3; + readonly COLOR_ATTACHMENT0: 0x8CE0; + readonly DEPTH_ATTACHMENT: 0x8D00; + readonly STENCIL_ATTACHMENT: 0x8D20; + readonly DEPTH_STENCIL_ATTACHMENT: 0x821A; + readonly NONE: 0; + readonly FRAMEBUFFER_COMPLETE: 0x8CD5; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8CD6; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8CD7; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8CD9; + readonly FRAMEBUFFER_UNSUPPORTED: 0x8CDD; + readonly FRAMEBUFFER_BINDING: 0x8CA6; + readonly RENDERBUFFER_BINDING: 0x8CA7; + readonly MAX_RENDERBUFFER_SIZE: 0x84E8; + readonly INVALID_FRAMEBUFFER_OPERATION: 0x0506; + readonly UNPACK_FLIP_Y_WEBGL: 0x9240; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241; + readonly CONTEXT_LOST_WEBGL: 0x9242; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243; + readonly BROWSER_DEFAULT_WEBGL: 0x9244; }; interface WebGL2RenderingContextBase { @@ -15469,269 +15652,269 @@ interface WebGL2RenderingContextBase { vertexAttribI4uiv(index: GLuint, values: Uint32List): void; vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr): void; waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void; - readonly ACTIVE_UNIFORM_BLOCKS: GLenum; - readonly ALREADY_SIGNALED: GLenum; - readonly ANY_SAMPLES_PASSED: GLenum; - readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum; - readonly COLOR: GLenum; - readonly COLOR_ATTACHMENT1: GLenum; - readonly COLOR_ATTACHMENT10: GLenum; - readonly COLOR_ATTACHMENT11: GLenum; - readonly COLOR_ATTACHMENT12: GLenum; - readonly COLOR_ATTACHMENT13: GLenum; - readonly COLOR_ATTACHMENT14: GLenum; - readonly COLOR_ATTACHMENT15: GLenum; - readonly COLOR_ATTACHMENT2: GLenum; - readonly COLOR_ATTACHMENT3: GLenum; - readonly COLOR_ATTACHMENT4: GLenum; - readonly COLOR_ATTACHMENT5: GLenum; - readonly COLOR_ATTACHMENT6: GLenum; - readonly COLOR_ATTACHMENT7: GLenum; - readonly COLOR_ATTACHMENT8: GLenum; - readonly COLOR_ATTACHMENT9: GLenum; - readonly COMPARE_REF_TO_TEXTURE: GLenum; - readonly CONDITION_SATISFIED: GLenum; - readonly COPY_READ_BUFFER: GLenum; - readonly COPY_READ_BUFFER_BINDING: GLenum; - readonly COPY_WRITE_BUFFER: GLenum; - readonly COPY_WRITE_BUFFER_BINDING: GLenum; - readonly CURRENT_QUERY: GLenum; - readonly DEPTH: GLenum; - readonly DEPTH24_STENCIL8: GLenum; - readonly DEPTH32F_STENCIL8: GLenum; - readonly DEPTH_COMPONENT24: GLenum; - readonly DEPTH_COMPONENT32F: GLenum; - readonly DRAW_BUFFER0: GLenum; - readonly DRAW_BUFFER1: GLenum; - readonly DRAW_BUFFER10: GLenum; - readonly DRAW_BUFFER11: GLenum; - readonly DRAW_BUFFER12: GLenum; - readonly DRAW_BUFFER13: GLenum; - readonly DRAW_BUFFER14: GLenum; - readonly DRAW_BUFFER15: GLenum; - readonly DRAW_BUFFER2: GLenum; - readonly DRAW_BUFFER3: GLenum; - readonly DRAW_BUFFER4: GLenum; - readonly DRAW_BUFFER5: GLenum; - readonly DRAW_BUFFER6: GLenum; - readonly DRAW_BUFFER7: GLenum; - readonly DRAW_BUFFER8: GLenum; - readonly DRAW_BUFFER9: GLenum; - readonly DRAW_FRAMEBUFFER: GLenum; - readonly DRAW_FRAMEBUFFER_BINDING: GLenum; - readonly DYNAMIC_COPY: GLenum; - readonly DYNAMIC_READ: GLenum; - readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum; - readonly FLOAT_MAT2x3: GLenum; - readonly FLOAT_MAT2x4: GLenum; - readonly FLOAT_MAT3x2: GLenum; - readonly FLOAT_MAT3x4: GLenum; - readonly FLOAT_MAT4x2: GLenum; - readonly FLOAT_MAT4x3: GLenum; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum; - readonly FRAMEBUFFER_DEFAULT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum; - readonly HALF_FLOAT: GLenum; - readonly INTERLEAVED_ATTRIBS: GLenum; - readonly INT_2_10_10_10_REV: GLenum; - readonly INT_SAMPLER_2D: GLenum; - readonly INT_SAMPLER_2D_ARRAY: GLenum; - readonly INT_SAMPLER_3D: GLenum; - readonly INT_SAMPLER_CUBE: GLenum; - readonly INVALID_INDEX: GLenum; - readonly MAX: GLenum; - readonly MAX_3D_TEXTURE_SIZE: GLenum; - readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum; - readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum; - readonly MAX_COLOR_ATTACHMENTS: GLenum; - readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum; - readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum; - readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum; - readonly MAX_DRAW_BUFFERS: GLenum; - readonly MAX_ELEMENTS_INDICES: GLenum; - readonly MAX_ELEMENTS_VERTICES: GLenum; - readonly MAX_ELEMENT_INDEX: GLenum; - readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum; - readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum; - readonly MAX_SAMPLES: GLenum; - readonly MAX_SERVER_WAIT_TIMEOUT: GLenum; - readonly MAX_TEXTURE_LOD_BIAS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum; - readonly MAX_UNIFORM_BLOCK_SIZE: GLenum; - readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum; - readonly MAX_VARYING_COMPONENTS: GLenum; - readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum; - readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum; - readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum; - readonly MIN: GLenum; - readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum; - readonly OBJECT_TYPE: GLenum; - readonly PACK_ROW_LENGTH: GLenum; - readonly PACK_SKIP_PIXELS: GLenum; - readonly PACK_SKIP_ROWS: GLenum; - readonly PIXEL_PACK_BUFFER: GLenum; - readonly PIXEL_PACK_BUFFER_BINDING: GLenum; - readonly PIXEL_UNPACK_BUFFER: GLenum; - readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum; - readonly QUERY_RESULT: GLenum; - readonly QUERY_RESULT_AVAILABLE: GLenum; - readonly R11F_G11F_B10F: GLenum; - readonly R16F: GLenum; - readonly R16I: GLenum; - readonly R16UI: GLenum; - readonly R32F: GLenum; - readonly R32I: GLenum; - readonly R32UI: GLenum; - readonly R8: GLenum; - readonly R8I: GLenum; - readonly R8UI: GLenum; - readonly R8_SNORM: GLenum; - readonly RASTERIZER_DISCARD: GLenum; - readonly READ_BUFFER: GLenum; - readonly READ_FRAMEBUFFER: GLenum; - readonly READ_FRAMEBUFFER_BINDING: GLenum; - readonly RED: GLenum; - readonly RED_INTEGER: GLenum; - readonly RENDERBUFFER_SAMPLES: GLenum; - readonly RG: GLenum; - readonly RG16F: GLenum; - readonly RG16I: GLenum; - readonly RG16UI: GLenum; - readonly RG32F: GLenum; - readonly RG32I: GLenum; - readonly RG32UI: GLenum; - readonly RG8: GLenum; - readonly RG8I: GLenum; - readonly RG8UI: GLenum; - readonly RG8_SNORM: GLenum; - readonly RGB10_A2: GLenum; - readonly RGB10_A2UI: GLenum; - readonly RGB16F: GLenum; - readonly RGB16I: GLenum; - readonly RGB16UI: GLenum; - readonly RGB32F: GLenum; - readonly RGB32I: GLenum; - readonly RGB32UI: GLenum; - readonly RGB8: GLenum; - readonly RGB8I: GLenum; - readonly RGB8UI: GLenum; - readonly RGB8_SNORM: GLenum; - readonly RGB9_E5: GLenum; - readonly RGBA16F: GLenum; - readonly RGBA16I: GLenum; - readonly RGBA16UI: GLenum; - readonly RGBA32F: GLenum; - readonly RGBA32I: GLenum; - readonly RGBA32UI: GLenum; - readonly RGBA8: GLenum; - readonly RGBA8I: GLenum; - readonly RGBA8UI: GLenum; - readonly RGBA8_SNORM: GLenum; - readonly RGBA_INTEGER: GLenum; - readonly RGB_INTEGER: GLenum; - readonly RG_INTEGER: GLenum; - readonly SAMPLER_2D_ARRAY: GLenum; - readonly SAMPLER_2D_ARRAY_SHADOW: GLenum; - readonly SAMPLER_2D_SHADOW: GLenum; - readonly SAMPLER_3D: GLenum; - readonly SAMPLER_BINDING: GLenum; - readonly SAMPLER_CUBE_SHADOW: GLenum; - readonly SEPARATE_ATTRIBS: GLenum; - readonly SIGNALED: GLenum; - readonly SIGNED_NORMALIZED: GLenum; - readonly SRGB: GLenum; - readonly SRGB8: GLenum; - readonly SRGB8_ALPHA8: GLenum; - readonly STATIC_COPY: GLenum; - readonly STATIC_READ: GLenum; - readonly STENCIL: GLenum; - readonly STREAM_COPY: GLenum; - readonly STREAM_READ: GLenum; - readonly SYNC_CONDITION: GLenum; - readonly SYNC_FENCE: GLenum; - readonly SYNC_FLAGS: GLenum; - readonly SYNC_FLUSH_COMMANDS_BIT: GLenum; - readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum; - readonly SYNC_STATUS: GLenum; - readonly TEXTURE_2D_ARRAY: GLenum; - readonly TEXTURE_3D: GLenum; - readonly TEXTURE_BASE_LEVEL: GLenum; - readonly TEXTURE_BINDING_2D_ARRAY: GLenum; - readonly TEXTURE_BINDING_3D: GLenum; - readonly TEXTURE_COMPARE_FUNC: GLenum; - readonly TEXTURE_COMPARE_MODE: GLenum; - readonly TEXTURE_IMMUTABLE_FORMAT: GLenum; - readonly TEXTURE_IMMUTABLE_LEVELS: GLenum; - readonly TEXTURE_MAX_LEVEL: GLenum; - readonly TEXTURE_MAX_LOD: GLenum; - readonly TEXTURE_MIN_LOD: GLenum; - readonly TEXTURE_WRAP_R: GLenum; - readonly TIMEOUT_EXPIRED: GLenum; - readonly TIMEOUT_IGNORED: GLint64; - readonly TRANSFORM_FEEDBACK: GLenum; - readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum; - readonly TRANSFORM_FEEDBACK_BINDING: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum; - readonly TRANSFORM_FEEDBACK_PAUSED: GLenum; - readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum; - readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum; - readonly UNIFORM_ARRAY_STRIDE: GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum; - readonly UNIFORM_BLOCK_BINDING: GLenum; - readonly UNIFORM_BLOCK_DATA_SIZE: GLenum; - readonly UNIFORM_BLOCK_INDEX: GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum; - readonly UNIFORM_BUFFER: GLenum; - readonly UNIFORM_BUFFER_BINDING: GLenum; - readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum; - readonly UNIFORM_BUFFER_SIZE: GLenum; - readonly UNIFORM_BUFFER_START: GLenum; - readonly UNIFORM_IS_ROW_MAJOR: GLenum; - readonly UNIFORM_MATRIX_STRIDE: GLenum; - readonly UNIFORM_OFFSET: GLenum; - readonly UNIFORM_SIZE: GLenum; - readonly UNIFORM_TYPE: GLenum; - readonly UNPACK_IMAGE_HEIGHT: GLenum; - readonly UNPACK_ROW_LENGTH: GLenum; - readonly UNPACK_SKIP_IMAGES: GLenum; - readonly UNPACK_SKIP_PIXELS: GLenum; - readonly UNPACK_SKIP_ROWS: GLenum; - readonly UNSIGNALED: GLenum; - readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum; - readonly UNSIGNED_INT_24_8: GLenum; - readonly UNSIGNED_INT_2_10_10_10_REV: GLenum; - readonly UNSIGNED_INT_5_9_9_9_REV: GLenum; - readonly UNSIGNED_INT_SAMPLER_2D: GLenum; - readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum; - readonly UNSIGNED_INT_SAMPLER_3D: GLenum; - readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum; - readonly UNSIGNED_INT_VEC2: GLenum; - readonly UNSIGNED_INT_VEC3: GLenum; - readonly UNSIGNED_INT_VEC4: GLenum; - readonly UNSIGNED_NORMALIZED: GLenum; - readonly VERTEX_ARRAY_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum; - readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum; - readonly WAIT_FAILED: GLenum; + readonly READ_BUFFER: 0x0C02; + readonly UNPACK_ROW_LENGTH: 0x0CF2; + readonly UNPACK_SKIP_ROWS: 0x0CF3; + readonly UNPACK_SKIP_PIXELS: 0x0CF4; + readonly PACK_ROW_LENGTH: 0x0D02; + readonly PACK_SKIP_ROWS: 0x0D03; + readonly PACK_SKIP_PIXELS: 0x0D04; + readonly COLOR: 0x1800; + readonly DEPTH: 0x1801; + readonly STENCIL: 0x1802; + readonly RED: 0x1903; + readonly RGB8: 0x8051; + readonly RGBA8: 0x8058; + readonly RGB10_A2: 0x8059; + readonly TEXTURE_BINDING_3D: 0x806A; + readonly UNPACK_SKIP_IMAGES: 0x806D; + readonly UNPACK_IMAGE_HEIGHT: 0x806E; + readonly TEXTURE_3D: 0x806F; + readonly TEXTURE_WRAP_R: 0x8072; + readonly MAX_3D_TEXTURE_SIZE: 0x8073; + readonly UNSIGNED_INT_2_10_10_10_REV: 0x8368; + readonly MAX_ELEMENTS_VERTICES: 0x80E8; + readonly MAX_ELEMENTS_INDICES: 0x80E9; + readonly TEXTURE_MIN_LOD: 0x813A; + readonly TEXTURE_MAX_LOD: 0x813B; + readonly TEXTURE_BASE_LEVEL: 0x813C; + readonly TEXTURE_MAX_LEVEL: 0x813D; + readonly MIN: 0x8007; + readonly MAX: 0x8008; + readonly DEPTH_COMPONENT24: 0x81A6; + readonly MAX_TEXTURE_LOD_BIAS: 0x84FD; + readonly TEXTURE_COMPARE_MODE: 0x884C; + readonly TEXTURE_COMPARE_FUNC: 0x884D; + readonly CURRENT_QUERY: 0x8865; + readonly QUERY_RESULT: 0x8866; + readonly QUERY_RESULT_AVAILABLE: 0x8867; + readonly STREAM_READ: 0x88E1; + readonly STREAM_COPY: 0x88E2; + readonly STATIC_READ: 0x88E5; + readonly STATIC_COPY: 0x88E6; + readonly DYNAMIC_READ: 0x88E9; + readonly DYNAMIC_COPY: 0x88EA; + readonly MAX_DRAW_BUFFERS: 0x8824; + readonly DRAW_BUFFER0: 0x8825; + readonly DRAW_BUFFER1: 0x8826; + readonly DRAW_BUFFER2: 0x8827; + readonly DRAW_BUFFER3: 0x8828; + readonly DRAW_BUFFER4: 0x8829; + readonly DRAW_BUFFER5: 0x882A; + readonly DRAW_BUFFER6: 0x882B; + readonly DRAW_BUFFER7: 0x882C; + readonly DRAW_BUFFER8: 0x882D; + readonly DRAW_BUFFER9: 0x882E; + readonly DRAW_BUFFER10: 0x882F; + readonly DRAW_BUFFER11: 0x8830; + readonly DRAW_BUFFER12: 0x8831; + readonly DRAW_BUFFER13: 0x8832; + readonly DRAW_BUFFER14: 0x8833; + readonly DRAW_BUFFER15: 0x8834; + readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: 0x8B49; + readonly MAX_VERTEX_UNIFORM_COMPONENTS: 0x8B4A; + readonly SAMPLER_3D: 0x8B5F; + readonly SAMPLER_2D_SHADOW: 0x8B62; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8B8B; + readonly PIXEL_PACK_BUFFER: 0x88EB; + readonly PIXEL_UNPACK_BUFFER: 0x88EC; + readonly PIXEL_PACK_BUFFER_BINDING: 0x88ED; + readonly PIXEL_UNPACK_BUFFER_BINDING: 0x88EF; + readonly FLOAT_MAT2x3: 0x8B65; + readonly FLOAT_MAT2x4: 0x8B66; + readonly FLOAT_MAT3x2: 0x8B67; + readonly FLOAT_MAT3x4: 0x8B68; + readonly FLOAT_MAT4x2: 0x8B69; + readonly FLOAT_MAT4x3: 0x8B6A; + readonly SRGB: 0x8C40; + readonly SRGB8: 0x8C41; + readonly SRGB8_ALPHA8: 0x8C43; + readonly COMPARE_REF_TO_TEXTURE: 0x884E; + readonly RGBA32F: 0x8814; + readonly RGB32F: 0x8815; + readonly RGBA16F: 0x881A; + readonly RGB16F: 0x881B; + readonly VERTEX_ATTRIB_ARRAY_INTEGER: 0x88FD; + readonly MAX_ARRAY_TEXTURE_LAYERS: 0x88FF; + readonly MIN_PROGRAM_TEXEL_OFFSET: 0x8904; + readonly MAX_PROGRAM_TEXEL_OFFSET: 0x8905; + readonly MAX_VARYING_COMPONENTS: 0x8B4B; + readonly TEXTURE_2D_ARRAY: 0x8C1A; + readonly TEXTURE_BINDING_2D_ARRAY: 0x8C1D; + readonly R11F_G11F_B10F: 0x8C3A; + readonly UNSIGNED_INT_10F_11F_11F_REV: 0x8C3B; + readonly RGB9_E5: 0x8C3D; + readonly UNSIGNED_INT_5_9_9_9_REV: 0x8C3E; + readonly TRANSFORM_FEEDBACK_BUFFER_MODE: 0x8C7F; + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 0x8C80; + readonly TRANSFORM_FEEDBACK_VARYINGS: 0x8C83; + readonly TRANSFORM_FEEDBACK_BUFFER_START: 0x8C84; + readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: 0x8C85; + readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 0x8C88; + readonly RASTERIZER_DISCARD: 0x8C89; + readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 0x8C8A; + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 0x8C8B; + readonly INTERLEAVED_ATTRIBS: 0x8C8C; + readonly SEPARATE_ATTRIBS: 0x8C8D; + readonly TRANSFORM_FEEDBACK_BUFFER: 0x8C8E; + readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: 0x8C8F; + readonly RGBA32UI: 0x8D70; + readonly RGB32UI: 0x8D71; + readonly RGBA16UI: 0x8D76; + readonly RGB16UI: 0x8D77; + readonly RGBA8UI: 0x8D7C; + readonly RGB8UI: 0x8D7D; + readonly RGBA32I: 0x8D82; + readonly RGB32I: 0x8D83; + readonly RGBA16I: 0x8D88; + readonly RGB16I: 0x8D89; + readonly RGBA8I: 0x8D8E; + readonly RGB8I: 0x8D8F; + readonly RED_INTEGER: 0x8D94; + readonly RGB_INTEGER: 0x8D98; + readonly RGBA_INTEGER: 0x8D99; + readonly SAMPLER_2D_ARRAY: 0x8DC1; + readonly SAMPLER_2D_ARRAY_SHADOW: 0x8DC4; + readonly SAMPLER_CUBE_SHADOW: 0x8DC5; + readonly UNSIGNED_INT_VEC2: 0x8DC6; + readonly UNSIGNED_INT_VEC3: 0x8DC7; + readonly UNSIGNED_INT_VEC4: 0x8DC8; + readonly INT_SAMPLER_2D: 0x8DCA; + readonly INT_SAMPLER_3D: 0x8DCB; + readonly INT_SAMPLER_CUBE: 0x8DCC; + readonly INT_SAMPLER_2D_ARRAY: 0x8DCF; + readonly UNSIGNED_INT_SAMPLER_2D: 0x8DD2; + readonly UNSIGNED_INT_SAMPLER_3D: 0x8DD3; + readonly UNSIGNED_INT_SAMPLER_CUBE: 0x8DD4; + readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: 0x8DD7; + readonly DEPTH_COMPONENT32F: 0x8CAC; + readonly DEPTH32F_STENCIL8: 0x8CAD; + readonly FLOAT_32_UNSIGNED_INT_24_8_REV: 0x8DAD; + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 0x8210; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 0x8211; + readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: 0x8212; + readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 0x8213; + readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 0x8214; + readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 0x8215; + readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 0x8216; + readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 0x8217; + readonly FRAMEBUFFER_DEFAULT: 0x8218; + readonly UNSIGNED_INT_24_8: 0x84FA; + readonly DEPTH24_STENCIL8: 0x88F0; + readonly UNSIGNED_NORMALIZED: 0x8C17; + readonly DRAW_FRAMEBUFFER_BINDING: 0x8CA6; + readonly READ_FRAMEBUFFER: 0x8CA8; + readonly DRAW_FRAMEBUFFER: 0x8CA9; + readonly READ_FRAMEBUFFER_BINDING: 0x8CAA; + readonly RENDERBUFFER_SAMPLES: 0x8CAB; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 0x8CD4; + readonly MAX_COLOR_ATTACHMENTS: 0x8CDF; + readonly COLOR_ATTACHMENT1: 0x8CE1; + readonly COLOR_ATTACHMENT2: 0x8CE2; + readonly COLOR_ATTACHMENT3: 0x8CE3; + readonly COLOR_ATTACHMENT4: 0x8CE4; + readonly COLOR_ATTACHMENT5: 0x8CE5; + readonly COLOR_ATTACHMENT6: 0x8CE6; + readonly COLOR_ATTACHMENT7: 0x8CE7; + readonly COLOR_ATTACHMENT8: 0x8CE8; + readonly COLOR_ATTACHMENT9: 0x8CE9; + readonly COLOR_ATTACHMENT10: 0x8CEA; + readonly COLOR_ATTACHMENT11: 0x8CEB; + readonly COLOR_ATTACHMENT12: 0x8CEC; + readonly COLOR_ATTACHMENT13: 0x8CED; + readonly COLOR_ATTACHMENT14: 0x8CEE; + readonly COLOR_ATTACHMENT15: 0x8CEF; + readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8D56; + readonly MAX_SAMPLES: 0x8D57; + readonly HALF_FLOAT: 0x140B; + readonly RG: 0x8227; + readonly RG_INTEGER: 0x8228; + readonly R8: 0x8229; + readonly RG8: 0x822B; + readonly R16F: 0x822D; + readonly R32F: 0x822E; + readonly RG16F: 0x822F; + readonly RG32F: 0x8230; + readonly R8I: 0x8231; + readonly R8UI: 0x8232; + readonly R16I: 0x8233; + readonly R16UI: 0x8234; + readonly R32I: 0x8235; + readonly R32UI: 0x8236; + readonly RG8I: 0x8237; + readonly RG8UI: 0x8238; + readonly RG16I: 0x8239; + readonly RG16UI: 0x823A; + readonly RG32I: 0x823B; + readonly RG32UI: 0x823C; + readonly VERTEX_ARRAY_BINDING: 0x85B5; + readonly R8_SNORM: 0x8F94; + readonly RG8_SNORM: 0x8F95; + readonly RGB8_SNORM: 0x8F96; + readonly RGBA8_SNORM: 0x8F97; + readonly SIGNED_NORMALIZED: 0x8F9C; + readonly COPY_READ_BUFFER: 0x8F36; + readonly COPY_WRITE_BUFFER: 0x8F37; + readonly COPY_READ_BUFFER_BINDING: 0x8F36; + readonly COPY_WRITE_BUFFER_BINDING: 0x8F37; + readonly UNIFORM_BUFFER: 0x8A11; + readonly UNIFORM_BUFFER_BINDING: 0x8A28; + readonly UNIFORM_BUFFER_START: 0x8A29; + readonly UNIFORM_BUFFER_SIZE: 0x8A2A; + readonly MAX_VERTEX_UNIFORM_BLOCKS: 0x8A2B; + readonly MAX_FRAGMENT_UNIFORM_BLOCKS: 0x8A2D; + readonly MAX_COMBINED_UNIFORM_BLOCKS: 0x8A2E; + readonly MAX_UNIFORM_BUFFER_BINDINGS: 0x8A2F; + readonly MAX_UNIFORM_BLOCK_SIZE: 0x8A30; + readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 0x8A31; + readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 0x8A33; + readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: 0x8A34; + readonly ACTIVE_UNIFORM_BLOCKS: 0x8A36; + readonly UNIFORM_TYPE: 0x8A37; + readonly UNIFORM_SIZE: 0x8A38; + readonly UNIFORM_BLOCK_INDEX: 0x8A3A; + readonly UNIFORM_OFFSET: 0x8A3B; + readonly UNIFORM_ARRAY_STRIDE: 0x8A3C; + readonly UNIFORM_MATRIX_STRIDE: 0x8A3D; + readonly UNIFORM_IS_ROW_MAJOR: 0x8A3E; + readonly UNIFORM_BLOCK_BINDING: 0x8A3F; + readonly UNIFORM_BLOCK_DATA_SIZE: 0x8A40; + readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: 0x8A42; + readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 0x8A43; + readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 0x8A44; + readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 0x8A46; + readonly INVALID_INDEX: 0xFFFFFFFF; + readonly MAX_VERTEX_OUTPUT_COMPONENTS: 0x9122; + readonly MAX_FRAGMENT_INPUT_COMPONENTS: 0x9125; + readonly MAX_SERVER_WAIT_TIMEOUT: 0x9111; + readonly OBJECT_TYPE: 0x9112; + readonly SYNC_CONDITION: 0x9113; + readonly SYNC_STATUS: 0x9114; + readonly SYNC_FLAGS: 0x9115; + readonly SYNC_FENCE: 0x9116; + readonly SYNC_GPU_COMMANDS_COMPLETE: 0x9117; + readonly UNSIGNALED: 0x9118; + readonly SIGNALED: 0x9119; + readonly ALREADY_SIGNALED: 0x911A; + readonly TIMEOUT_EXPIRED: 0x911B; + readonly CONDITION_SATISFIED: 0x911C; + readonly WAIT_FAILED: 0x911D; + readonly SYNC_FLUSH_COMMANDS_BIT: 0x00000001; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR: 0x88FE; + readonly ANY_SAMPLES_PASSED: 0x8C2F; + readonly ANY_SAMPLES_PASSED_CONSERVATIVE: 0x8D6A; + readonly SAMPLER_BINDING: 0x8919; + readonly RGB10_A2UI: 0x906F; + readonly INT_2_10_10_10_REV: 0x8D9F; + readonly TRANSFORM_FEEDBACK: 0x8E22; + readonly TRANSFORM_FEEDBACK_PAUSED: 0x8E23; + readonly TRANSFORM_FEEDBACK_ACTIVE: 0x8E24; + readonly TRANSFORM_FEEDBACK_BINDING: 0x8E25; + readonly TEXTURE_IMMUTABLE_FORMAT: 0x912F; + readonly MAX_ELEMENT_INDEX: 0x8D6B; + readonly TEXTURE_IMMUTABLE_LEVELS: 0x82DF; + readonly TIMEOUT_IGNORED: -1; + readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: 0x9247; } interface WebGL2RenderingContextOverloads { @@ -15843,302 +16026,302 @@ interface WebGLRenderingContext extends WebGLRenderingContextBase, WebGLRenderin declare var WebGLRenderingContext: { prototype: WebGLRenderingContext; new(): WebGLRenderingContext; - readonly ACTIVE_ATTRIBUTES: GLenum; - readonly ACTIVE_TEXTURE: GLenum; - readonly ACTIVE_UNIFORMS: GLenum; - readonly ALIASED_LINE_WIDTH_RANGE: GLenum; - readonly ALIASED_POINT_SIZE_RANGE: GLenum; - readonly ALPHA: GLenum; - readonly ALPHA_BITS: GLenum; - readonly ALWAYS: GLenum; - readonly ARRAY_BUFFER: GLenum; - readonly ARRAY_BUFFER_BINDING: GLenum; - readonly ATTACHED_SHADERS: GLenum; - readonly BACK: GLenum; - readonly BLEND: GLenum; - readonly BLEND_COLOR: GLenum; - readonly BLEND_DST_ALPHA: GLenum; - readonly BLEND_DST_RGB: GLenum; - readonly BLEND_EQUATION: GLenum; - readonly BLEND_EQUATION_ALPHA: GLenum; - readonly BLEND_EQUATION_RGB: GLenum; - readonly BLEND_SRC_ALPHA: GLenum; - readonly BLEND_SRC_RGB: GLenum; - readonly BLUE_BITS: GLenum; - readonly BOOL: GLenum; - readonly BOOL_VEC2: GLenum; - readonly BOOL_VEC3: GLenum; - readonly BOOL_VEC4: GLenum; - readonly BROWSER_DEFAULT_WEBGL: GLenum; - readonly BUFFER_SIZE: GLenum; - readonly BUFFER_USAGE: GLenum; - readonly BYTE: GLenum; - readonly CCW: GLenum; - readonly CLAMP_TO_EDGE: GLenum; - readonly COLOR_ATTACHMENT0: GLenum; - readonly COLOR_BUFFER_BIT: GLenum; - readonly COLOR_CLEAR_VALUE: GLenum; - readonly COLOR_WRITEMASK: GLenum; - readonly COMPILE_STATUS: GLenum; - readonly COMPRESSED_TEXTURE_FORMATS: GLenum; - readonly CONSTANT_ALPHA: GLenum; - readonly CONSTANT_COLOR: GLenum; - readonly CONTEXT_LOST_WEBGL: GLenum; - readonly CULL_FACE: GLenum; - readonly CULL_FACE_MODE: GLenum; - readonly CURRENT_PROGRAM: GLenum; - readonly CURRENT_VERTEX_ATTRIB: GLenum; - readonly CW: GLenum; - readonly DECR: GLenum; - readonly DECR_WRAP: GLenum; - readonly DELETE_STATUS: GLenum; - readonly DEPTH_ATTACHMENT: GLenum; - readonly DEPTH_BITS: GLenum; - readonly DEPTH_BUFFER_BIT: GLenum; - readonly DEPTH_CLEAR_VALUE: GLenum; - readonly DEPTH_COMPONENT: GLenum; - readonly DEPTH_COMPONENT16: GLenum; - readonly DEPTH_FUNC: GLenum; - readonly DEPTH_RANGE: GLenum; - readonly DEPTH_STENCIL: GLenum; - readonly DEPTH_STENCIL_ATTACHMENT: GLenum; - readonly DEPTH_TEST: GLenum; - readonly DEPTH_WRITEMASK: GLenum; - readonly DITHER: GLenum; - readonly DONT_CARE: GLenum; - readonly DST_ALPHA: GLenum; - readonly DST_COLOR: GLenum; - readonly DYNAMIC_DRAW: GLenum; - readonly ELEMENT_ARRAY_BUFFER: GLenum; - readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum; - readonly EQUAL: GLenum; - readonly FASTEST: GLenum; - readonly FLOAT: GLenum; - readonly FLOAT_MAT2: GLenum; - readonly FLOAT_MAT3: GLenum; - readonly FLOAT_MAT4: GLenum; - readonly FLOAT_VEC2: GLenum; - readonly FLOAT_VEC3: GLenum; - readonly FLOAT_VEC4: GLenum; - readonly FRAGMENT_SHADER: GLenum; - readonly FRAMEBUFFER: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum; - readonly FRAMEBUFFER_BINDING: GLenum; - readonly FRAMEBUFFER_COMPLETE: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_UNSUPPORTED: GLenum; - readonly FRONT: GLenum; - readonly FRONT_AND_BACK: GLenum; - readonly FRONT_FACE: GLenum; - readonly FUNC_ADD: GLenum; - readonly FUNC_REVERSE_SUBTRACT: GLenum; - readonly FUNC_SUBTRACT: GLenum; - readonly GENERATE_MIPMAP_HINT: GLenum; - readonly GEQUAL: GLenum; - readonly GREATER: GLenum; - readonly GREEN_BITS: GLenum; - readonly HIGH_FLOAT: GLenum; - readonly HIGH_INT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum; - readonly INCR: GLenum; - readonly INCR_WRAP: GLenum; - readonly INT: GLenum; - readonly INT_VEC2: GLenum; - readonly INT_VEC3: GLenum; - readonly INT_VEC4: GLenum; - readonly INVALID_ENUM: GLenum; - readonly INVALID_FRAMEBUFFER_OPERATION: GLenum; - readonly INVALID_OPERATION: GLenum; - readonly INVALID_VALUE: GLenum; - readonly INVERT: GLenum; - readonly KEEP: GLenum; - readonly LEQUAL: GLenum; - readonly LESS: GLenum; - readonly LINEAR: GLenum; - readonly LINEAR_MIPMAP_LINEAR: GLenum; - readonly LINEAR_MIPMAP_NEAREST: GLenum; - readonly LINES: GLenum; - readonly LINE_LOOP: GLenum; - readonly LINE_STRIP: GLenum; - readonly LINE_WIDTH: GLenum; - readonly LINK_STATUS: GLenum; - readonly LOW_FLOAT: GLenum; - readonly LOW_INT: GLenum; - readonly LUMINANCE: GLenum; - readonly LUMINANCE_ALPHA: GLenum; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum; - readonly MAX_RENDERBUFFER_SIZE: GLenum; - readonly MAX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_TEXTURE_SIZE: GLenum; - readonly MAX_VARYING_VECTORS: GLenum; - readonly MAX_VERTEX_ATTRIBS: GLenum; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum; - readonly MAX_VIEWPORT_DIMS: GLenum; - readonly MEDIUM_FLOAT: GLenum; - readonly MEDIUM_INT: GLenum; - readonly MIRRORED_REPEAT: GLenum; - readonly NEAREST: GLenum; - readonly NEAREST_MIPMAP_LINEAR: GLenum; - readonly NEAREST_MIPMAP_NEAREST: GLenum; - readonly NEVER: GLenum; - readonly NICEST: GLenum; - readonly NONE: GLenum; - readonly NOTEQUAL: GLenum; - readonly NO_ERROR: GLenum; - readonly ONE: GLenum; - readonly ONE_MINUS_CONSTANT_ALPHA: GLenum; - readonly ONE_MINUS_CONSTANT_COLOR: GLenum; - readonly ONE_MINUS_DST_ALPHA: GLenum; - readonly ONE_MINUS_DST_COLOR: GLenum; - readonly ONE_MINUS_SRC_ALPHA: GLenum; - readonly ONE_MINUS_SRC_COLOR: GLenum; - readonly OUT_OF_MEMORY: GLenum; - readonly PACK_ALIGNMENT: GLenum; - readonly POINTS: GLenum; - readonly POLYGON_OFFSET_FACTOR: GLenum; - readonly POLYGON_OFFSET_FILL: GLenum; - readonly POLYGON_OFFSET_UNITS: GLenum; - readonly RED_BITS: GLenum; - readonly RENDERBUFFER: GLenum; - readonly RENDERBUFFER_ALPHA_SIZE: GLenum; - readonly RENDERBUFFER_BINDING: GLenum; - readonly RENDERBUFFER_BLUE_SIZE: GLenum; - readonly RENDERBUFFER_DEPTH_SIZE: GLenum; - readonly RENDERBUFFER_GREEN_SIZE: GLenum; - readonly RENDERBUFFER_HEIGHT: GLenum; - readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum; - readonly RENDERBUFFER_RED_SIZE: GLenum; - readonly RENDERBUFFER_STENCIL_SIZE: GLenum; - readonly RENDERBUFFER_WIDTH: GLenum; - readonly RENDERER: GLenum; - readonly REPEAT: GLenum; - readonly REPLACE: GLenum; - readonly RGB: GLenum; - readonly RGB565: GLenum; - readonly RGB5_A1: GLenum; - readonly RGBA: GLenum; - readonly RGBA4: GLenum; - readonly SAMPLER_2D: GLenum; - readonly SAMPLER_CUBE: GLenum; - readonly SAMPLES: GLenum; - readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum; - readonly SAMPLE_BUFFERS: GLenum; - readonly SAMPLE_COVERAGE: GLenum; - readonly SAMPLE_COVERAGE_INVERT: GLenum; - readonly SAMPLE_COVERAGE_VALUE: GLenum; - readonly SCISSOR_BOX: GLenum; - readonly SCISSOR_TEST: GLenum; - readonly SHADER_TYPE: GLenum; - readonly SHADING_LANGUAGE_VERSION: GLenum; - readonly SHORT: GLenum; - readonly SRC_ALPHA: GLenum; - readonly SRC_ALPHA_SATURATE: GLenum; - readonly SRC_COLOR: GLenum; - readonly STATIC_DRAW: GLenum; - readonly STENCIL_ATTACHMENT: GLenum; - readonly STENCIL_BACK_FAIL: GLenum; - readonly STENCIL_BACK_FUNC: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_BACK_REF: GLenum; - readonly STENCIL_BACK_VALUE_MASK: GLenum; - readonly STENCIL_BACK_WRITEMASK: GLenum; - readonly STENCIL_BITS: GLenum; - readonly STENCIL_BUFFER_BIT: GLenum; - readonly STENCIL_CLEAR_VALUE: GLenum; - readonly STENCIL_FAIL: GLenum; - readonly STENCIL_FUNC: GLenum; - readonly STENCIL_INDEX8: GLenum; - readonly STENCIL_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_REF: GLenum; - readonly STENCIL_TEST: GLenum; - readonly STENCIL_VALUE_MASK: GLenum; - readonly STENCIL_WRITEMASK: GLenum; - readonly STREAM_DRAW: GLenum; - readonly SUBPIXEL_BITS: GLenum; - readonly TEXTURE: GLenum; - readonly TEXTURE0: GLenum; - readonly TEXTURE1: GLenum; - readonly TEXTURE10: GLenum; - readonly TEXTURE11: GLenum; - readonly TEXTURE12: GLenum; - readonly TEXTURE13: GLenum; - readonly TEXTURE14: GLenum; - readonly TEXTURE15: GLenum; - readonly TEXTURE16: GLenum; - readonly TEXTURE17: GLenum; - readonly TEXTURE18: GLenum; - readonly TEXTURE19: GLenum; - readonly TEXTURE2: GLenum; - readonly TEXTURE20: GLenum; - readonly TEXTURE21: GLenum; - readonly TEXTURE22: GLenum; - readonly TEXTURE23: GLenum; - readonly TEXTURE24: GLenum; - readonly TEXTURE25: GLenum; - readonly TEXTURE26: GLenum; - readonly TEXTURE27: GLenum; - readonly TEXTURE28: GLenum; - readonly TEXTURE29: GLenum; - readonly TEXTURE3: GLenum; - readonly TEXTURE30: GLenum; - readonly TEXTURE31: GLenum; - readonly TEXTURE4: GLenum; - readonly TEXTURE5: GLenum; - readonly TEXTURE6: GLenum; - readonly TEXTURE7: GLenum; - readonly TEXTURE8: GLenum; - readonly TEXTURE9: GLenum; - readonly TEXTURE_2D: GLenum; - readonly TEXTURE_BINDING_2D: GLenum; - readonly TEXTURE_BINDING_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum; - readonly TEXTURE_MAG_FILTER: GLenum; - readonly TEXTURE_MIN_FILTER: GLenum; - readonly TEXTURE_WRAP_S: GLenum; - readonly TEXTURE_WRAP_T: GLenum; - readonly TRIANGLES: GLenum; - readonly TRIANGLE_FAN: GLenum; - readonly TRIANGLE_STRIP: GLenum; - readonly UNPACK_ALIGNMENT: GLenum; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum; - readonly UNPACK_FLIP_Y_WEBGL: GLenum; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum; - readonly UNSIGNED_BYTE: GLenum; - readonly UNSIGNED_INT: GLenum; - readonly UNSIGNED_SHORT: GLenum; - readonly UNSIGNED_SHORT_4_4_4_4: GLenum; - readonly UNSIGNED_SHORT_5_5_5_1: GLenum; - readonly UNSIGNED_SHORT_5_6_5: GLenum; - readonly VALIDATE_STATUS: GLenum; - readonly VENDOR: GLenum; - readonly VERSION: GLenum; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum; - readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum; - readonly VERTEX_SHADER: GLenum; - readonly VIEWPORT: GLenum; - readonly ZERO: GLenum; + readonly DEPTH_BUFFER_BIT: 0x00000100; + readonly STENCIL_BUFFER_BIT: 0x00000400; + readonly COLOR_BUFFER_BIT: 0x00004000; + readonly POINTS: 0x0000; + readonly LINES: 0x0001; + readonly LINE_LOOP: 0x0002; + readonly LINE_STRIP: 0x0003; + readonly TRIANGLES: 0x0004; + readonly TRIANGLE_STRIP: 0x0005; + readonly TRIANGLE_FAN: 0x0006; + readonly ZERO: 0; + readonly ONE: 1; + readonly SRC_COLOR: 0x0300; + readonly ONE_MINUS_SRC_COLOR: 0x0301; + readonly SRC_ALPHA: 0x0302; + readonly ONE_MINUS_SRC_ALPHA: 0x0303; + readonly DST_ALPHA: 0x0304; + readonly ONE_MINUS_DST_ALPHA: 0x0305; + readonly DST_COLOR: 0x0306; + readonly ONE_MINUS_DST_COLOR: 0x0307; + readonly SRC_ALPHA_SATURATE: 0x0308; + readonly FUNC_ADD: 0x8006; + readonly BLEND_EQUATION: 0x8009; + readonly BLEND_EQUATION_RGB: 0x8009; + readonly BLEND_EQUATION_ALPHA: 0x883D; + readonly FUNC_SUBTRACT: 0x800A; + readonly FUNC_REVERSE_SUBTRACT: 0x800B; + readonly BLEND_DST_RGB: 0x80C8; + readonly BLEND_SRC_RGB: 0x80C9; + readonly BLEND_DST_ALPHA: 0x80CA; + readonly BLEND_SRC_ALPHA: 0x80CB; + readonly CONSTANT_COLOR: 0x8001; + readonly ONE_MINUS_CONSTANT_COLOR: 0x8002; + readonly CONSTANT_ALPHA: 0x8003; + readonly ONE_MINUS_CONSTANT_ALPHA: 0x8004; + readonly BLEND_COLOR: 0x8005; + readonly ARRAY_BUFFER: 0x8892; + readonly ELEMENT_ARRAY_BUFFER: 0x8893; + readonly ARRAY_BUFFER_BINDING: 0x8894; + readonly ELEMENT_ARRAY_BUFFER_BINDING: 0x8895; + readonly STREAM_DRAW: 0x88E0; + readonly STATIC_DRAW: 0x88E4; + readonly DYNAMIC_DRAW: 0x88E8; + readonly BUFFER_SIZE: 0x8764; + readonly BUFFER_USAGE: 0x8765; + readonly CURRENT_VERTEX_ATTRIB: 0x8626; + readonly FRONT: 0x0404; + readonly BACK: 0x0405; + readonly FRONT_AND_BACK: 0x0408; + readonly CULL_FACE: 0x0B44; + readonly BLEND: 0x0BE2; + readonly DITHER: 0x0BD0; + readonly STENCIL_TEST: 0x0B90; + readonly DEPTH_TEST: 0x0B71; + readonly SCISSOR_TEST: 0x0C11; + readonly POLYGON_OFFSET_FILL: 0x8037; + readonly SAMPLE_ALPHA_TO_COVERAGE: 0x809E; + readonly SAMPLE_COVERAGE: 0x80A0; + readonly NO_ERROR: 0; + readonly INVALID_ENUM: 0x0500; + readonly INVALID_VALUE: 0x0501; + readonly INVALID_OPERATION: 0x0502; + readonly OUT_OF_MEMORY: 0x0505; + readonly CW: 0x0900; + readonly CCW: 0x0901; + readonly LINE_WIDTH: 0x0B21; + readonly ALIASED_POINT_SIZE_RANGE: 0x846D; + readonly ALIASED_LINE_WIDTH_RANGE: 0x846E; + readonly CULL_FACE_MODE: 0x0B45; + readonly FRONT_FACE: 0x0B46; + readonly DEPTH_RANGE: 0x0B70; + readonly DEPTH_WRITEMASK: 0x0B72; + readonly DEPTH_CLEAR_VALUE: 0x0B73; + readonly DEPTH_FUNC: 0x0B74; + readonly STENCIL_CLEAR_VALUE: 0x0B91; + readonly STENCIL_FUNC: 0x0B92; + readonly STENCIL_FAIL: 0x0B94; + readonly STENCIL_PASS_DEPTH_FAIL: 0x0B95; + readonly STENCIL_PASS_DEPTH_PASS: 0x0B96; + readonly STENCIL_REF: 0x0B97; + readonly STENCIL_VALUE_MASK: 0x0B93; + readonly STENCIL_WRITEMASK: 0x0B98; + readonly STENCIL_BACK_FUNC: 0x8800; + readonly STENCIL_BACK_FAIL: 0x8801; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802; + readonly STENCIL_BACK_PASS_DEPTH_PASS: 0x8803; + readonly STENCIL_BACK_REF: 0x8CA3; + readonly STENCIL_BACK_VALUE_MASK: 0x8CA4; + readonly STENCIL_BACK_WRITEMASK: 0x8CA5; + readonly VIEWPORT: 0x0BA2; + readonly SCISSOR_BOX: 0x0C10; + readonly COLOR_CLEAR_VALUE: 0x0C22; + readonly COLOR_WRITEMASK: 0x0C23; + readonly UNPACK_ALIGNMENT: 0x0CF5; + readonly PACK_ALIGNMENT: 0x0D05; + readonly MAX_TEXTURE_SIZE: 0x0D33; + readonly MAX_VIEWPORT_DIMS: 0x0D3A; + readonly SUBPIXEL_BITS: 0x0D50; + readonly RED_BITS: 0x0D52; + readonly GREEN_BITS: 0x0D53; + readonly BLUE_BITS: 0x0D54; + readonly ALPHA_BITS: 0x0D55; + readonly DEPTH_BITS: 0x0D56; + readonly STENCIL_BITS: 0x0D57; + readonly POLYGON_OFFSET_UNITS: 0x2A00; + readonly POLYGON_OFFSET_FACTOR: 0x8038; + readonly TEXTURE_BINDING_2D: 0x8069; + readonly SAMPLE_BUFFERS: 0x80A8; + readonly SAMPLES: 0x80A9; + readonly SAMPLE_COVERAGE_VALUE: 0x80AA; + readonly SAMPLE_COVERAGE_INVERT: 0x80AB; + readonly COMPRESSED_TEXTURE_FORMATS: 0x86A3; + readonly DONT_CARE: 0x1100; + readonly FASTEST: 0x1101; + readonly NICEST: 0x1102; + readonly GENERATE_MIPMAP_HINT: 0x8192; + readonly BYTE: 0x1400; + readonly UNSIGNED_BYTE: 0x1401; + readonly SHORT: 0x1402; + readonly UNSIGNED_SHORT: 0x1403; + readonly INT: 0x1404; + readonly UNSIGNED_INT: 0x1405; + readonly FLOAT: 0x1406; + readonly DEPTH_COMPONENT: 0x1902; + readonly ALPHA: 0x1906; + readonly RGB: 0x1907; + readonly RGBA: 0x1908; + readonly LUMINANCE: 0x1909; + readonly LUMINANCE_ALPHA: 0x190A; + readonly UNSIGNED_SHORT_4_4_4_4: 0x8033; + readonly UNSIGNED_SHORT_5_5_5_1: 0x8034; + readonly UNSIGNED_SHORT_5_6_5: 0x8363; + readonly FRAGMENT_SHADER: 0x8B30; + readonly VERTEX_SHADER: 0x8B31; + readonly MAX_VERTEX_ATTRIBS: 0x8869; + readonly MAX_VERTEX_UNIFORM_VECTORS: 0x8DFB; + readonly MAX_VARYING_VECTORS: 0x8DFC; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8B4D; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8B4C; + readonly MAX_TEXTURE_IMAGE_UNITS: 0x8872; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: 0x8DFD; + readonly SHADER_TYPE: 0x8B4F; + readonly DELETE_STATUS: 0x8B80; + readonly LINK_STATUS: 0x8B82; + readonly VALIDATE_STATUS: 0x8B83; + readonly ATTACHED_SHADERS: 0x8B85; + readonly ACTIVE_UNIFORMS: 0x8B86; + readonly ACTIVE_ATTRIBUTES: 0x8B89; + readonly SHADING_LANGUAGE_VERSION: 0x8B8C; + readonly CURRENT_PROGRAM: 0x8B8D; + readonly NEVER: 0x0200; + readonly LESS: 0x0201; + readonly EQUAL: 0x0202; + readonly LEQUAL: 0x0203; + readonly GREATER: 0x0204; + readonly NOTEQUAL: 0x0205; + readonly GEQUAL: 0x0206; + readonly ALWAYS: 0x0207; + readonly KEEP: 0x1E00; + readonly REPLACE: 0x1E01; + readonly INCR: 0x1E02; + readonly DECR: 0x1E03; + readonly INVERT: 0x150A; + readonly INCR_WRAP: 0x8507; + readonly DECR_WRAP: 0x8508; + readonly VENDOR: 0x1F00; + readonly RENDERER: 0x1F01; + readonly VERSION: 0x1F02; + readonly NEAREST: 0x2600; + readonly LINEAR: 0x2601; + readonly NEAREST_MIPMAP_NEAREST: 0x2700; + readonly LINEAR_MIPMAP_NEAREST: 0x2701; + readonly NEAREST_MIPMAP_LINEAR: 0x2702; + readonly LINEAR_MIPMAP_LINEAR: 0x2703; + readonly TEXTURE_MAG_FILTER: 0x2800; + readonly TEXTURE_MIN_FILTER: 0x2801; + readonly TEXTURE_WRAP_S: 0x2802; + readonly TEXTURE_WRAP_T: 0x2803; + readonly TEXTURE_2D: 0x0DE1; + readonly TEXTURE: 0x1702; + readonly TEXTURE_CUBE_MAP: 0x8513; + readonly TEXTURE_BINDING_CUBE_MAP: 0x8514; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851A; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: 0x851C; + readonly TEXTURE0: 0x84C0; + readonly TEXTURE1: 0x84C1; + readonly TEXTURE2: 0x84C2; + readonly TEXTURE3: 0x84C3; + readonly TEXTURE4: 0x84C4; + readonly TEXTURE5: 0x84C5; + readonly TEXTURE6: 0x84C6; + readonly TEXTURE7: 0x84C7; + readonly TEXTURE8: 0x84C8; + readonly TEXTURE9: 0x84C9; + readonly TEXTURE10: 0x84CA; + readonly TEXTURE11: 0x84CB; + readonly TEXTURE12: 0x84CC; + readonly TEXTURE13: 0x84CD; + readonly TEXTURE14: 0x84CE; + readonly TEXTURE15: 0x84CF; + readonly TEXTURE16: 0x84D0; + readonly TEXTURE17: 0x84D1; + readonly TEXTURE18: 0x84D2; + readonly TEXTURE19: 0x84D3; + readonly TEXTURE20: 0x84D4; + readonly TEXTURE21: 0x84D5; + readonly TEXTURE22: 0x84D6; + readonly TEXTURE23: 0x84D7; + readonly TEXTURE24: 0x84D8; + readonly TEXTURE25: 0x84D9; + readonly TEXTURE26: 0x84DA; + readonly TEXTURE27: 0x84DB; + readonly TEXTURE28: 0x84DC; + readonly TEXTURE29: 0x84DD; + readonly TEXTURE30: 0x84DE; + readonly TEXTURE31: 0x84DF; + readonly ACTIVE_TEXTURE: 0x84E0; + readonly REPEAT: 0x2901; + readonly CLAMP_TO_EDGE: 0x812F; + readonly MIRRORED_REPEAT: 0x8370; + readonly FLOAT_VEC2: 0x8B50; + readonly FLOAT_VEC3: 0x8B51; + readonly FLOAT_VEC4: 0x8B52; + readonly INT_VEC2: 0x8B53; + readonly INT_VEC3: 0x8B54; + readonly INT_VEC4: 0x8B55; + readonly BOOL: 0x8B56; + readonly BOOL_VEC2: 0x8B57; + readonly BOOL_VEC3: 0x8B58; + readonly BOOL_VEC4: 0x8B59; + readonly FLOAT_MAT2: 0x8B5A; + readonly FLOAT_MAT3: 0x8B5B; + readonly FLOAT_MAT4: 0x8B5C; + readonly SAMPLER_2D: 0x8B5E; + readonly SAMPLER_CUBE: 0x8B60; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622; + readonly VERTEX_ATTRIB_ARRAY_SIZE: 0x8623; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624; + readonly VERTEX_ATTRIB_ARRAY_TYPE: 0x8625; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886A; + readonly VERTEX_ATTRIB_ARRAY_POINTER: 0x8645; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889F; + readonly IMPLEMENTATION_COLOR_READ_TYPE: 0x8B9A; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: 0x8B9B; + readonly COMPILE_STATUS: 0x8B81; + readonly LOW_FLOAT: 0x8DF0; + readonly MEDIUM_FLOAT: 0x8DF1; + readonly HIGH_FLOAT: 0x8DF2; + readonly LOW_INT: 0x8DF3; + readonly MEDIUM_INT: 0x8DF4; + readonly HIGH_INT: 0x8DF5; + readonly FRAMEBUFFER: 0x8D40; + readonly RENDERBUFFER: 0x8D41; + readonly RGBA4: 0x8056; + readonly RGB5_A1: 0x8057; + readonly RGB565: 0x8D62; + readonly DEPTH_COMPONENT16: 0x81A5; + readonly STENCIL_INDEX8: 0x8D48; + readonly DEPTH_STENCIL: 0x84F9; + readonly RENDERBUFFER_WIDTH: 0x8D42; + readonly RENDERBUFFER_HEIGHT: 0x8D43; + readonly RENDERBUFFER_INTERNAL_FORMAT: 0x8D44; + readonly RENDERBUFFER_RED_SIZE: 0x8D50; + readonly RENDERBUFFER_GREEN_SIZE: 0x8D51; + readonly RENDERBUFFER_BLUE_SIZE: 0x8D52; + readonly RENDERBUFFER_ALPHA_SIZE: 0x8D53; + readonly RENDERBUFFER_DEPTH_SIZE: 0x8D54; + readonly RENDERBUFFER_STENCIL_SIZE: 0x8D55; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8CD0; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8CD1; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8CD2; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8CD3; + readonly COLOR_ATTACHMENT0: 0x8CE0; + readonly DEPTH_ATTACHMENT: 0x8D00; + readonly STENCIL_ATTACHMENT: 0x8D20; + readonly DEPTH_STENCIL_ATTACHMENT: 0x821A; + readonly NONE: 0; + readonly FRAMEBUFFER_COMPLETE: 0x8CD5; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8CD6; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8CD7; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8CD9; + readonly FRAMEBUFFER_UNSUPPORTED: 0x8CDD; + readonly FRAMEBUFFER_BINDING: 0x8CA6; + readonly RENDERBUFFER_BINDING: 0x8CA7; + readonly MAX_RENDERBUFFER_SIZE: 0x84E8; + readonly INVALID_FRAMEBUFFER_OPERATION: 0x0506; + readonly UNPACK_FLIP_Y_WEBGL: 0x9240; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241; + readonly CONTEXT_LOST_WEBGL: 0x9242; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243; + readonly BROWSER_DEFAULT_WEBGL: 0x9244; }; interface WebGLRenderingContextBase { @@ -16296,302 +16479,302 @@ interface WebGLRenderingContextBase { vertexAttrib4fv(index: GLuint, values: Float32List): void; vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr): void; viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; - readonly ACTIVE_ATTRIBUTES: GLenum; - readonly ACTIVE_TEXTURE: GLenum; - readonly ACTIVE_UNIFORMS: GLenum; - readonly ALIASED_LINE_WIDTH_RANGE: GLenum; - readonly ALIASED_POINT_SIZE_RANGE: GLenum; - readonly ALPHA: GLenum; - readonly ALPHA_BITS: GLenum; - readonly ALWAYS: GLenum; - readonly ARRAY_BUFFER: GLenum; - readonly ARRAY_BUFFER_BINDING: GLenum; - readonly ATTACHED_SHADERS: GLenum; - readonly BACK: GLenum; - readonly BLEND: GLenum; - readonly BLEND_COLOR: GLenum; - readonly BLEND_DST_ALPHA: GLenum; - readonly BLEND_DST_RGB: GLenum; - readonly BLEND_EQUATION: GLenum; - readonly BLEND_EQUATION_ALPHA: GLenum; - readonly BLEND_EQUATION_RGB: GLenum; - readonly BLEND_SRC_ALPHA: GLenum; - readonly BLEND_SRC_RGB: GLenum; - readonly BLUE_BITS: GLenum; - readonly BOOL: GLenum; - readonly BOOL_VEC2: GLenum; - readonly BOOL_VEC3: GLenum; - readonly BOOL_VEC4: GLenum; - readonly BROWSER_DEFAULT_WEBGL: GLenum; - readonly BUFFER_SIZE: GLenum; - readonly BUFFER_USAGE: GLenum; - readonly BYTE: GLenum; - readonly CCW: GLenum; - readonly CLAMP_TO_EDGE: GLenum; - readonly COLOR_ATTACHMENT0: GLenum; - readonly COLOR_BUFFER_BIT: GLenum; - readonly COLOR_CLEAR_VALUE: GLenum; - readonly COLOR_WRITEMASK: GLenum; - readonly COMPILE_STATUS: GLenum; - readonly COMPRESSED_TEXTURE_FORMATS: GLenum; - readonly CONSTANT_ALPHA: GLenum; - readonly CONSTANT_COLOR: GLenum; - readonly CONTEXT_LOST_WEBGL: GLenum; - readonly CULL_FACE: GLenum; - readonly CULL_FACE_MODE: GLenum; - readonly CURRENT_PROGRAM: GLenum; - readonly CURRENT_VERTEX_ATTRIB: GLenum; - readonly CW: GLenum; - readonly DECR: GLenum; - readonly DECR_WRAP: GLenum; - readonly DELETE_STATUS: GLenum; - readonly DEPTH_ATTACHMENT: GLenum; - readonly DEPTH_BITS: GLenum; - readonly DEPTH_BUFFER_BIT: GLenum; - readonly DEPTH_CLEAR_VALUE: GLenum; - readonly DEPTH_COMPONENT: GLenum; - readonly DEPTH_COMPONENT16: GLenum; - readonly DEPTH_FUNC: GLenum; - readonly DEPTH_RANGE: GLenum; - readonly DEPTH_STENCIL: GLenum; - readonly DEPTH_STENCIL_ATTACHMENT: GLenum; - readonly DEPTH_TEST: GLenum; - readonly DEPTH_WRITEMASK: GLenum; - readonly DITHER: GLenum; - readonly DONT_CARE: GLenum; - readonly DST_ALPHA: GLenum; - readonly DST_COLOR: GLenum; - readonly DYNAMIC_DRAW: GLenum; - readonly ELEMENT_ARRAY_BUFFER: GLenum; - readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum; - readonly EQUAL: GLenum; - readonly FASTEST: GLenum; - readonly FLOAT: GLenum; - readonly FLOAT_MAT2: GLenum; - readonly FLOAT_MAT3: GLenum; - readonly FLOAT_MAT4: GLenum; - readonly FLOAT_VEC2: GLenum; - readonly FLOAT_VEC3: GLenum; - readonly FLOAT_VEC4: GLenum; - readonly FRAGMENT_SHADER: GLenum; - readonly FRAMEBUFFER: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum; - readonly FRAMEBUFFER_BINDING: GLenum; - readonly FRAMEBUFFER_COMPLETE: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_UNSUPPORTED: GLenum; - readonly FRONT: GLenum; - readonly FRONT_AND_BACK: GLenum; - readonly FRONT_FACE: GLenum; - readonly FUNC_ADD: GLenum; - readonly FUNC_REVERSE_SUBTRACT: GLenum; - readonly FUNC_SUBTRACT: GLenum; - readonly GENERATE_MIPMAP_HINT: GLenum; - readonly GEQUAL: GLenum; - readonly GREATER: GLenum; - readonly GREEN_BITS: GLenum; - readonly HIGH_FLOAT: GLenum; - readonly HIGH_INT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum; - readonly INCR: GLenum; - readonly INCR_WRAP: GLenum; - readonly INT: GLenum; - readonly INT_VEC2: GLenum; - readonly INT_VEC3: GLenum; - readonly INT_VEC4: GLenum; - readonly INVALID_ENUM: GLenum; - readonly INVALID_FRAMEBUFFER_OPERATION: GLenum; - readonly INVALID_OPERATION: GLenum; - readonly INVALID_VALUE: GLenum; - readonly INVERT: GLenum; - readonly KEEP: GLenum; - readonly LEQUAL: GLenum; - readonly LESS: GLenum; - readonly LINEAR: GLenum; - readonly LINEAR_MIPMAP_LINEAR: GLenum; - readonly LINEAR_MIPMAP_NEAREST: GLenum; - readonly LINES: GLenum; - readonly LINE_LOOP: GLenum; - readonly LINE_STRIP: GLenum; - readonly LINE_WIDTH: GLenum; - readonly LINK_STATUS: GLenum; - readonly LOW_FLOAT: GLenum; - readonly LOW_INT: GLenum; - readonly LUMINANCE: GLenum; - readonly LUMINANCE_ALPHA: GLenum; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum; - readonly MAX_RENDERBUFFER_SIZE: GLenum; - readonly MAX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_TEXTURE_SIZE: GLenum; - readonly MAX_VARYING_VECTORS: GLenum; - readonly MAX_VERTEX_ATTRIBS: GLenum; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum; - readonly MAX_VIEWPORT_DIMS: GLenum; - readonly MEDIUM_FLOAT: GLenum; - readonly MEDIUM_INT: GLenum; - readonly MIRRORED_REPEAT: GLenum; - readonly NEAREST: GLenum; - readonly NEAREST_MIPMAP_LINEAR: GLenum; - readonly NEAREST_MIPMAP_NEAREST: GLenum; - readonly NEVER: GLenum; - readonly NICEST: GLenum; - readonly NONE: GLenum; - readonly NOTEQUAL: GLenum; - readonly NO_ERROR: GLenum; - readonly ONE: GLenum; - readonly ONE_MINUS_CONSTANT_ALPHA: GLenum; - readonly ONE_MINUS_CONSTANT_COLOR: GLenum; - readonly ONE_MINUS_DST_ALPHA: GLenum; - readonly ONE_MINUS_DST_COLOR: GLenum; - readonly ONE_MINUS_SRC_ALPHA: GLenum; - readonly ONE_MINUS_SRC_COLOR: GLenum; - readonly OUT_OF_MEMORY: GLenum; - readonly PACK_ALIGNMENT: GLenum; - readonly POINTS: GLenum; - readonly POLYGON_OFFSET_FACTOR: GLenum; - readonly POLYGON_OFFSET_FILL: GLenum; - readonly POLYGON_OFFSET_UNITS: GLenum; - readonly RED_BITS: GLenum; - readonly RENDERBUFFER: GLenum; - readonly RENDERBUFFER_ALPHA_SIZE: GLenum; - readonly RENDERBUFFER_BINDING: GLenum; - readonly RENDERBUFFER_BLUE_SIZE: GLenum; - readonly RENDERBUFFER_DEPTH_SIZE: GLenum; - readonly RENDERBUFFER_GREEN_SIZE: GLenum; - readonly RENDERBUFFER_HEIGHT: GLenum; - readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum; - readonly RENDERBUFFER_RED_SIZE: GLenum; - readonly RENDERBUFFER_STENCIL_SIZE: GLenum; - readonly RENDERBUFFER_WIDTH: GLenum; - readonly RENDERER: GLenum; - readonly REPEAT: GLenum; - readonly REPLACE: GLenum; - readonly RGB: GLenum; - readonly RGB565: GLenum; - readonly RGB5_A1: GLenum; - readonly RGBA: GLenum; - readonly RGBA4: GLenum; - readonly SAMPLER_2D: GLenum; - readonly SAMPLER_CUBE: GLenum; - readonly SAMPLES: GLenum; - readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum; - readonly SAMPLE_BUFFERS: GLenum; - readonly SAMPLE_COVERAGE: GLenum; - readonly SAMPLE_COVERAGE_INVERT: GLenum; - readonly SAMPLE_COVERAGE_VALUE: GLenum; - readonly SCISSOR_BOX: GLenum; - readonly SCISSOR_TEST: GLenum; - readonly SHADER_TYPE: GLenum; - readonly SHADING_LANGUAGE_VERSION: GLenum; - readonly SHORT: GLenum; - readonly SRC_ALPHA: GLenum; - readonly SRC_ALPHA_SATURATE: GLenum; - readonly SRC_COLOR: GLenum; - readonly STATIC_DRAW: GLenum; - readonly STENCIL_ATTACHMENT: GLenum; - readonly STENCIL_BACK_FAIL: GLenum; - readonly STENCIL_BACK_FUNC: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_BACK_REF: GLenum; - readonly STENCIL_BACK_VALUE_MASK: GLenum; - readonly STENCIL_BACK_WRITEMASK: GLenum; - readonly STENCIL_BITS: GLenum; - readonly STENCIL_BUFFER_BIT: GLenum; - readonly STENCIL_CLEAR_VALUE: GLenum; - readonly STENCIL_FAIL: GLenum; - readonly STENCIL_FUNC: GLenum; - readonly STENCIL_INDEX8: GLenum; - readonly STENCIL_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_REF: GLenum; - readonly STENCIL_TEST: GLenum; - readonly STENCIL_VALUE_MASK: GLenum; - readonly STENCIL_WRITEMASK: GLenum; - readonly STREAM_DRAW: GLenum; - readonly SUBPIXEL_BITS: GLenum; - readonly TEXTURE: GLenum; - readonly TEXTURE0: GLenum; - readonly TEXTURE1: GLenum; - readonly TEXTURE10: GLenum; - readonly TEXTURE11: GLenum; - readonly TEXTURE12: GLenum; - readonly TEXTURE13: GLenum; - readonly TEXTURE14: GLenum; - readonly TEXTURE15: GLenum; - readonly TEXTURE16: GLenum; - readonly TEXTURE17: GLenum; - readonly TEXTURE18: GLenum; - readonly TEXTURE19: GLenum; - readonly TEXTURE2: GLenum; - readonly TEXTURE20: GLenum; - readonly TEXTURE21: GLenum; - readonly TEXTURE22: GLenum; - readonly TEXTURE23: GLenum; - readonly TEXTURE24: GLenum; - readonly TEXTURE25: GLenum; - readonly TEXTURE26: GLenum; - readonly TEXTURE27: GLenum; - readonly TEXTURE28: GLenum; - readonly TEXTURE29: GLenum; - readonly TEXTURE3: GLenum; - readonly TEXTURE30: GLenum; - readonly TEXTURE31: GLenum; - readonly TEXTURE4: GLenum; - readonly TEXTURE5: GLenum; - readonly TEXTURE6: GLenum; - readonly TEXTURE7: GLenum; - readonly TEXTURE8: GLenum; - readonly TEXTURE9: GLenum; - readonly TEXTURE_2D: GLenum; - readonly TEXTURE_BINDING_2D: GLenum; - readonly TEXTURE_BINDING_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum; - readonly TEXTURE_MAG_FILTER: GLenum; - readonly TEXTURE_MIN_FILTER: GLenum; - readonly TEXTURE_WRAP_S: GLenum; - readonly TEXTURE_WRAP_T: GLenum; - readonly TRIANGLES: GLenum; - readonly TRIANGLE_FAN: GLenum; - readonly TRIANGLE_STRIP: GLenum; - readonly UNPACK_ALIGNMENT: GLenum; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum; - readonly UNPACK_FLIP_Y_WEBGL: GLenum; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum; - readonly UNSIGNED_BYTE: GLenum; - readonly UNSIGNED_INT: GLenum; - readonly UNSIGNED_SHORT: GLenum; - readonly UNSIGNED_SHORT_4_4_4_4: GLenum; - readonly UNSIGNED_SHORT_5_5_5_1: GLenum; - readonly UNSIGNED_SHORT_5_6_5: GLenum; - readonly VALIDATE_STATUS: GLenum; - readonly VENDOR: GLenum; - readonly VERSION: GLenum; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum; - readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum; - readonly VERTEX_SHADER: GLenum; - readonly VIEWPORT: GLenum; - readonly ZERO: GLenum; + readonly DEPTH_BUFFER_BIT: 0x00000100; + readonly STENCIL_BUFFER_BIT: 0x00000400; + readonly COLOR_BUFFER_BIT: 0x00004000; + readonly POINTS: 0x0000; + readonly LINES: 0x0001; + readonly LINE_LOOP: 0x0002; + readonly LINE_STRIP: 0x0003; + readonly TRIANGLES: 0x0004; + readonly TRIANGLE_STRIP: 0x0005; + readonly TRIANGLE_FAN: 0x0006; + readonly ZERO: 0; + readonly ONE: 1; + readonly SRC_COLOR: 0x0300; + readonly ONE_MINUS_SRC_COLOR: 0x0301; + readonly SRC_ALPHA: 0x0302; + readonly ONE_MINUS_SRC_ALPHA: 0x0303; + readonly DST_ALPHA: 0x0304; + readonly ONE_MINUS_DST_ALPHA: 0x0305; + readonly DST_COLOR: 0x0306; + readonly ONE_MINUS_DST_COLOR: 0x0307; + readonly SRC_ALPHA_SATURATE: 0x0308; + readonly FUNC_ADD: 0x8006; + readonly BLEND_EQUATION: 0x8009; + readonly BLEND_EQUATION_RGB: 0x8009; + readonly BLEND_EQUATION_ALPHA: 0x883D; + readonly FUNC_SUBTRACT: 0x800A; + readonly FUNC_REVERSE_SUBTRACT: 0x800B; + readonly BLEND_DST_RGB: 0x80C8; + readonly BLEND_SRC_RGB: 0x80C9; + readonly BLEND_DST_ALPHA: 0x80CA; + readonly BLEND_SRC_ALPHA: 0x80CB; + readonly CONSTANT_COLOR: 0x8001; + readonly ONE_MINUS_CONSTANT_COLOR: 0x8002; + readonly CONSTANT_ALPHA: 0x8003; + readonly ONE_MINUS_CONSTANT_ALPHA: 0x8004; + readonly BLEND_COLOR: 0x8005; + readonly ARRAY_BUFFER: 0x8892; + readonly ELEMENT_ARRAY_BUFFER: 0x8893; + readonly ARRAY_BUFFER_BINDING: 0x8894; + readonly ELEMENT_ARRAY_BUFFER_BINDING: 0x8895; + readonly STREAM_DRAW: 0x88E0; + readonly STATIC_DRAW: 0x88E4; + readonly DYNAMIC_DRAW: 0x88E8; + readonly BUFFER_SIZE: 0x8764; + readonly BUFFER_USAGE: 0x8765; + readonly CURRENT_VERTEX_ATTRIB: 0x8626; + readonly FRONT: 0x0404; + readonly BACK: 0x0405; + readonly FRONT_AND_BACK: 0x0408; + readonly CULL_FACE: 0x0B44; + readonly BLEND: 0x0BE2; + readonly DITHER: 0x0BD0; + readonly STENCIL_TEST: 0x0B90; + readonly DEPTH_TEST: 0x0B71; + readonly SCISSOR_TEST: 0x0C11; + readonly POLYGON_OFFSET_FILL: 0x8037; + readonly SAMPLE_ALPHA_TO_COVERAGE: 0x809E; + readonly SAMPLE_COVERAGE: 0x80A0; + readonly NO_ERROR: 0; + readonly INVALID_ENUM: 0x0500; + readonly INVALID_VALUE: 0x0501; + readonly INVALID_OPERATION: 0x0502; + readonly OUT_OF_MEMORY: 0x0505; + readonly CW: 0x0900; + readonly CCW: 0x0901; + readonly LINE_WIDTH: 0x0B21; + readonly ALIASED_POINT_SIZE_RANGE: 0x846D; + readonly ALIASED_LINE_WIDTH_RANGE: 0x846E; + readonly CULL_FACE_MODE: 0x0B45; + readonly FRONT_FACE: 0x0B46; + readonly DEPTH_RANGE: 0x0B70; + readonly DEPTH_WRITEMASK: 0x0B72; + readonly DEPTH_CLEAR_VALUE: 0x0B73; + readonly DEPTH_FUNC: 0x0B74; + readonly STENCIL_CLEAR_VALUE: 0x0B91; + readonly STENCIL_FUNC: 0x0B92; + readonly STENCIL_FAIL: 0x0B94; + readonly STENCIL_PASS_DEPTH_FAIL: 0x0B95; + readonly STENCIL_PASS_DEPTH_PASS: 0x0B96; + readonly STENCIL_REF: 0x0B97; + readonly STENCIL_VALUE_MASK: 0x0B93; + readonly STENCIL_WRITEMASK: 0x0B98; + readonly STENCIL_BACK_FUNC: 0x8800; + readonly STENCIL_BACK_FAIL: 0x8801; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802; + readonly STENCIL_BACK_PASS_DEPTH_PASS: 0x8803; + readonly STENCIL_BACK_REF: 0x8CA3; + readonly STENCIL_BACK_VALUE_MASK: 0x8CA4; + readonly STENCIL_BACK_WRITEMASK: 0x8CA5; + readonly VIEWPORT: 0x0BA2; + readonly SCISSOR_BOX: 0x0C10; + readonly COLOR_CLEAR_VALUE: 0x0C22; + readonly COLOR_WRITEMASK: 0x0C23; + readonly UNPACK_ALIGNMENT: 0x0CF5; + readonly PACK_ALIGNMENT: 0x0D05; + readonly MAX_TEXTURE_SIZE: 0x0D33; + readonly MAX_VIEWPORT_DIMS: 0x0D3A; + readonly SUBPIXEL_BITS: 0x0D50; + readonly RED_BITS: 0x0D52; + readonly GREEN_BITS: 0x0D53; + readonly BLUE_BITS: 0x0D54; + readonly ALPHA_BITS: 0x0D55; + readonly DEPTH_BITS: 0x0D56; + readonly STENCIL_BITS: 0x0D57; + readonly POLYGON_OFFSET_UNITS: 0x2A00; + readonly POLYGON_OFFSET_FACTOR: 0x8038; + readonly TEXTURE_BINDING_2D: 0x8069; + readonly SAMPLE_BUFFERS: 0x80A8; + readonly SAMPLES: 0x80A9; + readonly SAMPLE_COVERAGE_VALUE: 0x80AA; + readonly SAMPLE_COVERAGE_INVERT: 0x80AB; + readonly COMPRESSED_TEXTURE_FORMATS: 0x86A3; + readonly DONT_CARE: 0x1100; + readonly FASTEST: 0x1101; + readonly NICEST: 0x1102; + readonly GENERATE_MIPMAP_HINT: 0x8192; + readonly BYTE: 0x1400; + readonly UNSIGNED_BYTE: 0x1401; + readonly SHORT: 0x1402; + readonly UNSIGNED_SHORT: 0x1403; + readonly INT: 0x1404; + readonly UNSIGNED_INT: 0x1405; + readonly FLOAT: 0x1406; + readonly DEPTH_COMPONENT: 0x1902; + readonly ALPHA: 0x1906; + readonly RGB: 0x1907; + readonly RGBA: 0x1908; + readonly LUMINANCE: 0x1909; + readonly LUMINANCE_ALPHA: 0x190A; + readonly UNSIGNED_SHORT_4_4_4_4: 0x8033; + readonly UNSIGNED_SHORT_5_5_5_1: 0x8034; + readonly UNSIGNED_SHORT_5_6_5: 0x8363; + readonly FRAGMENT_SHADER: 0x8B30; + readonly VERTEX_SHADER: 0x8B31; + readonly MAX_VERTEX_ATTRIBS: 0x8869; + readonly MAX_VERTEX_UNIFORM_VECTORS: 0x8DFB; + readonly MAX_VARYING_VECTORS: 0x8DFC; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8B4D; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8B4C; + readonly MAX_TEXTURE_IMAGE_UNITS: 0x8872; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: 0x8DFD; + readonly SHADER_TYPE: 0x8B4F; + readonly DELETE_STATUS: 0x8B80; + readonly LINK_STATUS: 0x8B82; + readonly VALIDATE_STATUS: 0x8B83; + readonly ATTACHED_SHADERS: 0x8B85; + readonly ACTIVE_UNIFORMS: 0x8B86; + readonly ACTIVE_ATTRIBUTES: 0x8B89; + readonly SHADING_LANGUAGE_VERSION: 0x8B8C; + readonly CURRENT_PROGRAM: 0x8B8D; + readonly NEVER: 0x0200; + readonly LESS: 0x0201; + readonly EQUAL: 0x0202; + readonly LEQUAL: 0x0203; + readonly GREATER: 0x0204; + readonly NOTEQUAL: 0x0205; + readonly GEQUAL: 0x0206; + readonly ALWAYS: 0x0207; + readonly KEEP: 0x1E00; + readonly REPLACE: 0x1E01; + readonly INCR: 0x1E02; + readonly DECR: 0x1E03; + readonly INVERT: 0x150A; + readonly INCR_WRAP: 0x8507; + readonly DECR_WRAP: 0x8508; + readonly VENDOR: 0x1F00; + readonly RENDERER: 0x1F01; + readonly VERSION: 0x1F02; + readonly NEAREST: 0x2600; + readonly LINEAR: 0x2601; + readonly NEAREST_MIPMAP_NEAREST: 0x2700; + readonly LINEAR_MIPMAP_NEAREST: 0x2701; + readonly NEAREST_MIPMAP_LINEAR: 0x2702; + readonly LINEAR_MIPMAP_LINEAR: 0x2703; + readonly TEXTURE_MAG_FILTER: 0x2800; + readonly TEXTURE_MIN_FILTER: 0x2801; + readonly TEXTURE_WRAP_S: 0x2802; + readonly TEXTURE_WRAP_T: 0x2803; + readonly TEXTURE_2D: 0x0DE1; + readonly TEXTURE: 0x1702; + readonly TEXTURE_CUBE_MAP: 0x8513; + readonly TEXTURE_BINDING_CUBE_MAP: 0x8514; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851A; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: 0x851C; + readonly TEXTURE0: 0x84C0; + readonly TEXTURE1: 0x84C1; + readonly TEXTURE2: 0x84C2; + readonly TEXTURE3: 0x84C3; + readonly TEXTURE4: 0x84C4; + readonly TEXTURE5: 0x84C5; + readonly TEXTURE6: 0x84C6; + readonly TEXTURE7: 0x84C7; + readonly TEXTURE8: 0x84C8; + readonly TEXTURE9: 0x84C9; + readonly TEXTURE10: 0x84CA; + readonly TEXTURE11: 0x84CB; + readonly TEXTURE12: 0x84CC; + readonly TEXTURE13: 0x84CD; + readonly TEXTURE14: 0x84CE; + readonly TEXTURE15: 0x84CF; + readonly TEXTURE16: 0x84D0; + readonly TEXTURE17: 0x84D1; + readonly TEXTURE18: 0x84D2; + readonly TEXTURE19: 0x84D3; + readonly TEXTURE20: 0x84D4; + readonly TEXTURE21: 0x84D5; + readonly TEXTURE22: 0x84D6; + readonly TEXTURE23: 0x84D7; + readonly TEXTURE24: 0x84D8; + readonly TEXTURE25: 0x84D9; + readonly TEXTURE26: 0x84DA; + readonly TEXTURE27: 0x84DB; + readonly TEXTURE28: 0x84DC; + readonly TEXTURE29: 0x84DD; + readonly TEXTURE30: 0x84DE; + readonly TEXTURE31: 0x84DF; + readonly ACTIVE_TEXTURE: 0x84E0; + readonly REPEAT: 0x2901; + readonly CLAMP_TO_EDGE: 0x812F; + readonly MIRRORED_REPEAT: 0x8370; + readonly FLOAT_VEC2: 0x8B50; + readonly FLOAT_VEC3: 0x8B51; + readonly FLOAT_VEC4: 0x8B52; + readonly INT_VEC2: 0x8B53; + readonly INT_VEC3: 0x8B54; + readonly INT_VEC4: 0x8B55; + readonly BOOL: 0x8B56; + readonly BOOL_VEC2: 0x8B57; + readonly BOOL_VEC3: 0x8B58; + readonly BOOL_VEC4: 0x8B59; + readonly FLOAT_MAT2: 0x8B5A; + readonly FLOAT_MAT3: 0x8B5B; + readonly FLOAT_MAT4: 0x8B5C; + readonly SAMPLER_2D: 0x8B5E; + readonly SAMPLER_CUBE: 0x8B60; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622; + readonly VERTEX_ATTRIB_ARRAY_SIZE: 0x8623; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624; + readonly VERTEX_ATTRIB_ARRAY_TYPE: 0x8625; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886A; + readonly VERTEX_ATTRIB_ARRAY_POINTER: 0x8645; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889F; + readonly IMPLEMENTATION_COLOR_READ_TYPE: 0x8B9A; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: 0x8B9B; + readonly COMPILE_STATUS: 0x8B81; + readonly LOW_FLOAT: 0x8DF0; + readonly MEDIUM_FLOAT: 0x8DF1; + readonly HIGH_FLOAT: 0x8DF2; + readonly LOW_INT: 0x8DF3; + readonly MEDIUM_INT: 0x8DF4; + readonly HIGH_INT: 0x8DF5; + readonly FRAMEBUFFER: 0x8D40; + readonly RENDERBUFFER: 0x8D41; + readonly RGBA4: 0x8056; + readonly RGB5_A1: 0x8057; + readonly RGB565: 0x8D62; + readonly DEPTH_COMPONENT16: 0x81A5; + readonly STENCIL_INDEX8: 0x8D48; + readonly DEPTH_STENCIL: 0x84F9; + readonly RENDERBUFFER_WIDTH: 0x8D42; + readonly RENDERBUFFER_HEIGHT: 0x8D43; + readonly RENDERBUFFER_INTERNAL_FORMAT: 0x8D44; + readonly RENDERBUFFER_RED_SIZE: 0x8D50; + readonly RENDERBUFFER_GREEN_SIZE: 0x8D51; + readonly RENDERBUFFER_BLUE_SIZE: 0x8D52; + readonly RENDERBUFFER_ALPHA_SIZE: 0x8D53; + readonly RENDERBUFFER_DEPTH_SIZE: 0x8D54; + readonly RENDERBUFFER_STENCIL_SIZE: 0x8D55; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8CD0; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8CD1; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8CD2; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8CD3; + readonly COLOR_ATTACHMENT0: 0x8CE0; + readonly DEPTH_ATTACHMENT: 0x8D00; + readonly STENCIL_ATTACHMENT: 0x8D20; + readonly DEPTH_STENCIL_ATTACHMENT: 0x821A; + readonly NONE: 0; + readonly FRAMEBUFFER_COMPLETE: 0x8CD5; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8CD6; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8CD7; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8CD9; + readonly FRAMEBUFFER_UNSUPPORTED: 0x8CDD; + readonly FRAMEBUFFER_BINDING: 0x8CA6; + readonly RENDERBUFFER_BINDING: 0x8CA7; + readonly MAX_RENDERBUFFER_SIZE: 0x84E8; + readonly INVALID_FRAMEBUFFER_OPERATION: 0x0506; + readonly UNPACK_FLIP_Y_WEBGL: 0x9240; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241; + readonly CONTEXT_LOST_WEBGL: 0x9242; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243; + readonly BROWSER_DEFAULT_WEBGL: 0x9244; } interface WebGLRenderingContextOverloads { @@ -16729,10 +16912,10 @@ interface WebSocket extends EventTarget { close(code?: number, reason?: string): void; /** Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView. */ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSING: 2; + readonly CLOSED: 3; addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -16742,10 +16925,10 @@ interface WebSocket extends EventTarget { declare var WebSocket: { prototype: WebSocket; new(url: string | URL, protocols?: string | string[]): WebSocket; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSING: 2; + readonly CLOSED: 3; }; /** Events that occur due to the user moving a mouse wheel or similar input device. */ @@ -16754,17 +16937,17 @@ interface WheelEvent extends MouseEvent { readonly deltaX: number; readonly deltaY: number; readonly deltaZ: number; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; + readonly DOM_DELTA_PIXEL: 0x00; + readonly DOM_DELTA_LINE: 0x01; + readonly DOM_DELTA_PAGE: 0x02; } declare var WheelEvent: { prototype: WheelEvent; new(type: string, eventInitDict?: WheelEventInit): WheelEvent; - readonly DOM_DELTA_LINE: number; - readonly DOM_DELTA_PAGE: number; - readonly DOM_DELTA_PIXEL: number; + readonly DOM_DELTA_PIXEL: 0x00; + readonly DOM_DELTA_LINE: 0x01; + readonly DOM_DELTA_PAGE: 0x02; }; interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandlersEventMap { @@ -17162,11 +17345,11 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { * Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value. */ setRequestHeader(name: string, value: string): void; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; + readonly UNSENT: 0; + readonly OPENED: 1; + readonly HEADERS_RECEIVED: 2; + readonly LOADING: 3; + readonly DONE: 4; addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -17176,11 +17359,11 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { declare var XMLHttpRequest: { prototype: XMLHttpRequest; new(): XMLHttpRequest; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; + readonly UNSENT: 0; + readonly OPENED: 1; + readonly HEADERS_RECEIVED: 2; + readonly LOADING: 3; + readonly DONE: 4; }; interface XMLHttpRequestEventTargetEventMap { @@ -17270,31 +17453,31 @@ interface XPathResult { readonly stringValue: string; iterateNext(): Node | null; snapshotItem(index: number): Node | null; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; + readonly ANY_TYPE: 0; + readonly NUMBER_TYPE: 1; + readonly STRING_TYPE: 2; + readonly BOOLEAN_TYPE: 3; + readonly UNORDERED_NODE_ITERATOR_TYPE: 4; + readonly ORDERED_NODE_ITERATOR_TYPE: 5; + readonly UNORDERED_NODE_SNAPSHOT_TYPE: 6; + readonly ORDERED_NODE_SNAPSHOT_TYPE: 7; + readonly ANY_UNORDERED_NODE_TYPE: 8; + readonly FIRST_ORDERED_NODE_TYPE: 9; } declare var XPathResult: { prototype: XPathResult; new(): XPathResult; - readonly ANY_TYPE: number; - readonly ANY_UNORDERED_NODE_TYPE: number; - readonly BOOLEAN_TYPE: number; - readonly FIRST_ORDERED_NODE_TYPE: number; - readonly NUMBER_TYPE: number; - readonly ORDERED_NODE_ITERATOR_TYPE: number; - readonly ORDERED_NODE_SNAPSHOT_TYPE: number; - readonly STRING_TYPE: number; - readonly UNORDERED_NODE_ITERATOR_TYPE: number; - readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; + readonly ANY_TYPE: 0; + readonly NUMBER_TYPE: 1; + readonly STRING_TYPE: 2; + readonly BOOLEAN_TYPE: 3; + readonly UNORDERED_NODE_ITERATOR_TYPE: 4; + readonly ORDERED_NODE_ITERATOR_TYPE: 5; + readonly UNORDERED_NODE_SNAPSHOT_TYPE: 6; + readonly ORDERED_NODE_SNAPSHOT_TYPE: 7; + readonly ANY_UNORDERED_NODE_TYPE: 8; + readonly FIRST_ORDERED_NODE_TYPE: 9; }; /** An XSLTProcessor applies an XSLT stylesheet transformation to an XML document to produce a new XML document as output. It has methods to load the XSLT stylesheet, to manipulate parameter values, and to apply the transformation to documents. */ @@ -17839,6 +18022,39 @@ interface SVGElementTagNameMap { "view": SVGViewElement; } +interface MathMLElementTagNameMap { + "annotation": MathMLElement; + "annotation-xml": MathMLElement; + "maction": MathMLElement; + "math": MathMLElement; + "merror": MathMLElement; + "mfrac": MathMLElement; + "mi": MathMLElement; + "mmultiscripts": MathMLElement; + "mn": MathMLElement; + "mo": MathMLElement; + "mover": MathMLElement; + "mpadded": MathMLElement; + "mphantom": MathMLElement; + "mprescripts": MathMLElement; + "mroot": MathMLElement; + "mrow": MathMLElement; + "ms": MathMLElement; + "mspace": MathMLElement; + "msqrt": MathMLElement; + "mstyle": MathMLElement; + "msub": MathMLElement; + "msubsup": MathMLElement; + "msup": MathMLElement; + "mtable": MathMLElement; + "mtd": MathMLElement; + "mtext": MathMLElement; + "mtr": MathMLElement; + "munder": MathMLElement; + "munderover": MathMLElement; + "semantics": MathMLElement; +} + /** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ type ElementTagNameMap = HTMLElementTagNameMap & Pick>; @@ -18008,7 +18224,9 @@ declare var onclose: ((this: Window, ev: Event) => any) | null; * @param ev The mouse event. */ declare var oncontextmenu: ((this: Window, ev: MouseEvent) => any) | null; +declare var oncopy: ((this: Window, ev: ClipboardEvent) => any) | null; declare var oncuechange: ((this: Window, ev: Event) => any) | null; +declare var oncut: ((this: Window, ev: ClipboardEvent) => any) | null; /** * Fires when the user double-clicks the object. * @param ev The mouse event. @@ -18138,6 +18356,7 @@ declare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null; * @param ev The mouse event. */ declare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null; +declare var onpaste: ((this: Window, ev: ClipboardEvent) => any) | null; /** * Occurs when playback is paused. * @param ev The event. @@ -18327,7 +18546,6 @@ type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; type ImageBitmapSource = CanvasImageSource | Blob | ImageData; -type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type Int32List = Int32Array | GLint[]; type LineAndPositionSetting = number | AutoKeyword; type MediaProvider = MediaStream | MediaSource | Blob; @@ -18392,6 +18610,7 @@ type EndOfStreamError = "decode" | "network"; type EndingType = "native" | "transparent"; type FileSystemHandleKind = "directory" | "file"; type FillMode = "auto" | "backwards" | "both" | "forwards" | "none"; +type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap"; type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FullscreenNavigationUI = "auto" | "hide" | "show"; @@ -18403,14 +18622,18 @@ type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; type IDBRequestReadyState = "done" | "pending"; type IDBTransactionDurability = "default" | "relaxed" | "strict"; type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; -type ImageOrientation = "flipY" | "none"; +type ImageOrientation = "flipY" | "from-image"; type ImageSmoothingQuality = "high" | "low" | "medium"; +type InsertPosition = "afterbegin" | "afterend" | "beforebegin" | "beforeend"; type IterationCompositeOperation = "accumulate" | "replace"; type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; type KeyType = "private" | "public" | "secret"; type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey"; type LineAlignSetting = "center" | "end" | "start"; type LockMode = "exclusive" | "shared"; +type MIDIPortConnectionState = "closed" | "open" | "pending"; +type MIDIPortDeviceState = "connected" | "disconnected"; +type MIDIPortType = "input" | "output"; type MediaDecodingType = "file" | "media-source" | "webrtc"; type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput"; type MediaEncodingType = "record" | "webrtc"; diff --git a/lib/lib.dom.iterable.d.ts b/lib/lib.dom.iterable.d.ts index 9cd574ca52d97..3e0340d61ea38 100644 --- a/lib/lib.dom.iterable.d.ts +++ b/lib/lib.dom.iterable.d.ts @@ -34,6 +34,10 @@ interface BaseAudioContext { createPeriodicWave(real: Iterable, imag: Iterable, constraints?: PeriodicWaveConstraints): PeriodicWave; } +interface CSSKeyframesRule { + [Symbol.iterator](): IterableIterator; +} + interface CSSRuleList { [Symbol.iterator](): IterableIterator; } @@ -137,6 +141,16 @@ interface IDBObjectStore { createIndex(name: string, keyPath: string | Iterable, options?: IDBIndexParameters): IDBIndex; } +interface MIDIInputMap extends ReadonlyMap { +} + +interface MIDIOutput { + send(data: Iterable, timestamp?: DOMHighResTimeStamp): void; +} + +interface MIDIOutputMap extends ReadonlyMap { +} + interface MediaKeyStatusMap { [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>; entries(): IterableIterator<[BufferSource, MediaKeyStatus]>; diff --git a/lib/lib.es2023.array.d.ts b/lib/lib.es2023.array.d.ts new file mode 100644 index 0000000000000..cd6dee2825211 --- /dev/null +++ b/lib/lib.es2023.array.d.ts @@ -0,0 +1,344 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +interface Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): number; +} + +interface ReadonlyArray { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): number; +} + +interface Int8Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Int8Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): number; +} + +interface Uint8Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Uint8Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number; +} + +interface Uint8ClampedArray { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Uint8ClampedArray) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): number; +} + +interface Int16Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Int16Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): number; +} + +interface Uint16Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Uint16Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): number; +} + +interface Int32Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Int32Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): number; +} + +interface Uint32Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Uint32Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): number; +} + +interface Float32Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Float32Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): number; +} + +interface Float64Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: number, index: number, array: Float64Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): number | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): number; +} + +interface BigInt64Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: bigint, index: number, array: BigInt64Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): bigint | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): number; +} + +interface BigUint64Array { + /** + * Returns the value of the last element in the array where predicate is true, and undefined + * otherwise. + * @param predicate findLast calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, findLast + * immediately returns that element value. Otherwise, findLast returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLast(predicate: (value: bigint, index: number, array: BigUint64Array) => value is S, thisArg?: any): S | undefined; + findLast(predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): bigint | undefined; + + /** + * Returns the index of the last element in the array where predicate is true, and -1 + * otherwise. + * @param predicate findLastIndex calls predicate once for each element of the array, in descending + * order, until it finds one where predicate returns true. If such an element is found, + * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findLastIndex(predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): number; +} diff --git a/lib/lib.es2023.d.ts b/lib/lib.es2023.d.ts new file mode 100644 index 0000000000000..3cd069499be71 --- /dev/null +++ b/lib/lib.es2023.d.ts @@ -0,0 +1,22 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +/// +/// diff --git a/lib/lib.es2023.full.d.ts b/lib/lib.es2023.full.d.ts new file mode 100644 index 0000000000000..66ee8a719a072 --- /dev/null +++ b/lib/lib.es2023.full.d.ts @@ -0,0 +1,25 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +/// +/// +/// +/// +/// diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index f4dedb4ebe570..7ce8e4a1b179c 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -18,6 +18,9 @@ and limitations under the License. /// +/// +/// + ///////////////////////////// /// ECMAScript APIs ///////////////////////////// @@ -1137,13 +1140,6 @@ interface JSON { * If a member contains nested objects, the nested objects are transformed before the parent object is. */ parse(text: string, reviver?: (this: any, key: string, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: Function | Symbol | undefined, replacer?: (number | string)[] | null, space?: string | number): undefined; /** * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. * @param value A JavaScript value, usually an object or array, to be converted. @@ -1510,11 +1506,6 @@ interface TypedPropertyDescriptor { set?: (value: T) => void; } -declare type ClassDecorator = (target: TFunction) => TFunction | void; -declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; -declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; - declare type PromiseConstructorLike = new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; interface PromiseLike { diff --git a/lib/lib.esnext.d.ts b/lib/lib.esnext.d.ts index d8935cccc00fd..822b0182f17a4 100644 --- a/lib/lib.esnext.d.ts +++ b/lib/lib.esnext.d.ts @@ -18,5 +18,5 @@ and limitations under the License. /// -/// +/// /// diff --git a/lib/lib.webworker.d.ts b/lib/lib.webworker.d.ts index 209f41cfdbddf..2329afedbc247 100644 --- a/lib/lib.webworker.d.ts +++ b/lib/lib.webworker.d.ts @@ -218,13 +218,20 @@ interface FileSystemGetFileOptions { create?: boolean; } +interface FileSystemReadWriteOptions { + at?: number; +} + interface FileSystemRemoveOptions { recursive?: boolean; } interface FontFaceDescriptors { - display?: string; + ascentOverride?: string; + descentOverride?: string; + display?: FontDisplay; featureSettings?: string; + lineGapOverride?: string; stretch?: string; style?: string; unicodeRange?: string; @@ -297,6 +304,11 @@ interface ImageDataSettings { colorSpace?: PredefinedColorSpace; } +interface ImageEncodeOptions { + quality?: number; + type?: string; +} + interface ImportMeta { url: string; } @@ -744,7 +756,7 @@ interface ANGLE_instanced_arrays { drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0x88FE; } /** A controller object that allows you to abort one or more DOM requests as and when desired. */ @@ -1101,7 +1113,7 @@ interface Crypto { readonly subtle: SubtleCrypto; getRandomValues(array: T): T; /** Available only in secure contexts. */ - randomUUID(): string; + randomUUID(): `${string}-${string}-${string}-${string}-${string}`; } declare var Crypto: { @@ -1143,61 +1155,61 @@ interface DOMException extends Error { readonly code: number; readonly message: string; readonly name: string; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; } declare var DOMException: { prototype: DOMException; new(message?: string, name?: string): DOMException; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; }; interface DOMMatrix extends DOMMatrixReadOnly { @@ -1416,18 +1428,18 @@ declare var DedicatedWorkerGlobalScope: { }; interface EXT_blend_minmax { - readonly MAX_EXT: GLenum; - readonly MIN_EXT: GLenum; + readonly MIN_EXT: 0x8007; + readonly MAX_EXT: 0x8008; } interface EXT_color_buffer_float { } interface EXT_color_buffer_half_float { - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum; - readonly RGB16F_EXT: GLenum; - readonly RGBA16F_EXT: GLenum; - readonly UNSIGNED_NORMALIZED_EXT: GLenum; + readonly RGBA16F_EXT: 0x881A; + readonly RGB16F_EXT: 0x881B; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 0x8211; + readonly UNSIGNED_NORMALIZED_EXT: 0x8C17; } interface EXT_float_blend { @@ -1438,44 +1450,44 @@ interface EXT_frag_depth { } interface EXT_sRGB { - readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum; - readonly SRGB8_ALPHA8_EXT: GLenum; - readonly SRGB_ALPHA_EXT: GLenum; - readonly SRGB_EXT: GLenum; + readonly SRGB_EXT: 0x8C40; + readonly SRGB_ALPHA_EXT: 0x8C42; + readonly SRGB8_ALPHA8_EXT: 0x8C43; + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: 0x8210; } interface EXT_shader_texture_lod { } interface EXT_texture_compression_bptc { - readonly COMPRESSED_RGBA_BPTC_UNORM_EXT: GLenum; - readonly COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: GLenum; - readonly COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: GLenum; - readonly COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: GLenum; + readonly COMPRESSED_RGBA_BPTC_UNORM_EXT: 0x8E8C; + readonly COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: 0x8E8D; + readonly COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: 0x8E8E; + readonly COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: 0x8E8F; } interface EXT_texture_compression_rgtc { - readonly COMPRESSED_RED_GREEN_RGTC2_EXT: GLenum; - readonly COMPRESSED_RED_RGTC1_EXT: GLenum; - readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GLenum; - readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: GLenum; + readonly COMPRESSED_RED_RGTC1_EXT: 0x8DBB; + readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: 0x8DBC; + readonly COMPRESSED_RED_GREEN_RGTC2_EXT: 0x8DBD; + readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 0x8DBE; } /** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */ interface EXT_texture_filter_anisotropic { - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum; - readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum; + readonly TEXTURE_MAX_ANISOTROPY_EXT: 0x84FE; + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84FF; } interface EXT_texture_norm16 { - readonly R16_EXT: GLenum; - readonly R16_SNORM_EXT: GLenum; - readonly RG16_EXT: GLenum; - readonly RG16_SNORM_EXT: GLenum; - readonly RGB16_EXT: GLenum; - readonly RGB16_SNORM_EXT: GLenum; - readonly RGBA16_EXT: GLenum; - readonly RGBA16_SNORM_EXT: GLenum; + readonly R16_EXT: 0x822A; + readonly RG16_EXT: 0x822C; + readonly RGB16_EXT: 0x8054; + readonly RGBA16_EXT: 0x805B; + readonly R16_SNORM_EXT: 0x8F98; + readonly RG16_SNORM_EXT: 0x8F99; + readonly RGB16_SNORM_EXT: 0x8F9A; + readonly RGBA16_SNORM_EXT: 0x8F9B; } /** Events providing information related to errors in scripts or in files. */ @@ -1530,19 +1542,19 @@ interface Event { stopImmediatePropagation(): void; /** When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. */ stopPropagation(): void; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; - readonly NONE: number; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; } declare var Event: { prototype: Event; new(type: string, eventInitDict?: EventInit): Event; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; - readonly NONE: number; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; }; interface EventListener { @@ -1571,9 +1583,9 @@ interface EventSource extends EventTarget { readonly withCredentials: boolean; /** Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED. */ close(): void; - readonly CLOSED: number; - readonly CONNECTING: number; - readonly OPEN: number; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSED: 2; addEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -1585,9 +1597,9 @@ interface EventSource extends EventTarget { declare var EventSource: { prototype: EventSource; new(url: string | URL, eventSourceInitDict?: EventSourceInit): EventSource; - readonly CLOSED: number; - readonly CONNECTING: number; - readonly OPEN: number; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSED: 2; }; /** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */ @@ -1700,16 +1712,16 @@ interface FileReader extends EventTarget { onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null; onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null; onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null; - readonly readyState: number; + readonly readyState: typeof FileReader.EMPTY | typeof FileReader.LOADING | typeof FileReader.DONE; readonly result: string | ArrayBuffer | null; abort(): void; readAsArrayBuffer(blob: Blob): void; readAsBinaryString(blob: Blob): void; readAsDataURL(blob: Blob): void; readAsText(blob: Blob, encoding?: string): void; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; + readonly EMPTY: 0; + readonly LOADING: 1; + readonly DONE: 2; addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -1719,9 +1731,9 @@ interface FileReader extends EventTarget { declare var FileReader: { prototype: FileReader; new(): FileReader; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; + readonly EMPTY: 0; + readonly LOADING: 1; + readonly DONE: 2; }; /** Allows to read File or Blob objects in a synchronous way. */ @@ -1755,6 +1767,7 @@ declare var FileSystemDirectoryHandle: { /** Available only in secure contexts. */ interface FileSystemFileHandle extends FileSystemHandle { readonly kind: "file"; + createSyncAccessHandle(): Promise; getFile(): Promise; } @@ -1775,10 +1788,25 @@ declare var FileSystemHandle: { new(): FileSystemHandle; }; +/** Available only in secure contexts. */ +interface FileSystemSyncAccessHandle { + close(): void; + flush(): void; + getSize(): number; + read(buffer: BufferSource, options?: FileSystemReadWriteOptions): number; + truncate(newSize: number): void; + write(buffer: BufferSource, options?: FileSystemReadWriteOptions): number; +} + +declare var FileSystemSyncAccessHandle: { + prototype: FileSystemSyncAccessHandle; + new(): FileSystemSyncAccessHandle; +}; + interface FontFace { ascentOverride: string; descentOverride: string; - display: string; + display: FontDisplay; family: string; featureSettings: string; lineGapOverride: string; @@ -1788,7 +1816,6 @@ interface FontFace { style: string; unicodeRange: string; variant: string; - variationSettings: string; weight: string; load(): Promise; } @@ -2317,7 +2344,7 @@ declare var ImageData: { }; interface KHR_parallel_shader_compile { - readonly COMPLETION_STATUS_KHR: GLenum; + readonly COMPLETION_STATUS_KHR: 0x91B1; } /** Available only in secure contexts. */ @@ -2531,7 +2558,7 @@ interface OES_fbo_render_mipmap { /** The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth. */ interface OES_standard_derivatives { - readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: 0x8B8B; } /** The OES_texture_float extension is part of the WebGL API and exposes floating-point pixel types for textures. */ @@ -2544,7 +2571,7 @@ interface OES_texture_float_linear { /** The OES_texture_half_float extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components. */ interface OES_texture_half_float { - readonly HALF_FLOAT_OES: GLenum; + readonly HALF_FLOAT_OES: 0x8D61; } /** The OES_texture_half_float_linear extension is part of the WebGL API and allows linear filtering with half floating-point pixel types for textures. */ @@ -2556,15 +2583,15 @@ interface OES_vertex_array_object { createVertexArrayOES(): WebGLVertexArrayObjectOES | null; deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void; isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): GLboolean; - readonly VERTEX_ARRAY_BINDING_OES: GLenum; + readonly VERTEX_ARRAY_BINDING_OES: 0x85B5; } interface OVR_multiview2 { framebufferTextureMultiviewOVR(target: GLenum, attachment: GLenum, texture: WebGLTexture | null, level: GLint, baseViewIndex: GLint, numViews: GLsizei): void; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: GLenum; - readonly MAX_VIEWS_OVR: GLenum; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: 0x9630; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: 0x9632; + readonly MAX_VIEWS_OVR: 0x9631; + readonly FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: 0x9633; } interface OffscreenCanvasEventMap { @@ -2587,6 +2614,12 @@ interface OffscreenCanvas extends EventTarget { * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it). */ width: number; + /** + * Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object. + * + * The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of "image/png"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image. + */ + convertToBlob(options?: ImageEncodeOptions): Promise; /** * Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. * @@ -2594,6 +2627,10 @@ interface OffscreenCanvas extends EventTarget { * * Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context). */ + getContext(contextId: "2d", options?: any): OffscreenCanvasRenderingContext2D | null; + getContext(contextId: "bitmaprenderer", options?: any): ImageBitmapRenderingContext | null; + getContext(contextId: "webgl", options?: any): WebGLRenderingContext | null; + getContext(contextId: "webgl2", options?: any): WebGL2RenderingContext | null; getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null; /** Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image. */ transferToImageBitmap(): ImageBitmap; @@ -3426,79 +3463,79 @@ declare var VideoColorSpace: { }; interface WEBGL_color_buffer_float { - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum; - readonly RGBA32F_EXT: GLenum; - readonly UNSIGNED_NORMALIZED_EXT: GLenum; + readonly RGBA32F_EXT: 0x8814; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 0x8211; + readonly UNSIGNED_NORMALIZED_EXT: 0x8C17; } interface WEBGL_compressed_texture_astc { getSupportedProfiles(): string[]; - readonly COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum; - readonly COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum; + readonly COMPRESSED_RGBA_ASTC_4x4_KHR: 0x93B0; + readonly COMPRESSED_RGBA_ASTC_5x4_KHR: 0x93B1; + readonly COMPRESSED_RGBA_ASTC_5x5_KHR: 0x93B2; + readonly COMPRESSED_RGBA_ASTC_6x5_KHR: 0x93B3; + readonly COMPRESSED_RGBA_ASTC_6x6_KHR: 0x93B4; + readonly COMPRESSED_RGBA_ASTC_8x5_KHR: 0x93B5; + readonly COMPRESSED_RGBA_ASTC_8x6_KHR: 0x93B6; + readonly COMPRESSED_RGBA_ASTC_8x8_KHR: 0x93B7; + readonly COMPRESSED_RGBA_ASTC_10x5_KHR: 0x93B8; + readonly COMPRESSED_RGBA_ASTC_10x6_KHR: 0x93B9; + readonly COMPRESSED_RGBA_ASTC_10x8_KHR: 0x93BA; + readonly COMPRESSED_RGBA_ASTC_10x10_KHR: 0x93BB; + readonly COMPRESSED_RGBA_ASTC_12x10_KHR: 0x93BC; + readonly COMPRESSED_RGBA_ASTC_12x12_KHR: 0x93BD; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: 0x93D0; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: 0x93D1; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: 0x93D2; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: 0x93D3; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: 0x93D4; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: 0x93D5; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: 0x93D6; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: 0x93D7; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: 0x93D8; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: 0x93D9; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: 0x93DA; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: 0x93DB; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: 0x93DC; + readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: 0x93DD; } interface WEBGL_compressed_texture_etc { - readonly COMPRESSED_R11_EAC: GLenum; - readonly COMPRESSED_RG11_EAC: GLenum; - readonly COMPRESSED_RGB8_ETC2: GLenum; - readonly COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum; - readonly COMPRESSED_RGBA8_ETC2_EAC: GLenum; - readonly COMPRESSED_SIGNED_R11_EAC: GLenum; - readonly COMPRESSED_SIGNED_RG11_EAC: GLenum; - readonly COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GLenum; - readonly COMPRESSED_SRGB8_ETC2: GLenum; - readonly COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum; + readonly COMPRESSED_R11_EAC: 0x9270; + readonly COMPRESSED_SIGNED_R11_EAC: 0x9271; + readonly COMPRESSED_RG11_EAC: 0x9272; + readonly COMPRESSED_SIGNED_RG11_EAC: 0x9273; + readonly COMPRESSED_RGB8_ETC2: 0x9274; + readonly COMPRESSED_SRGB8_ETC2: 0x9275; + readonly COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9276; + readonly COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9277; + readonly COMPRESSED_RGBA8_ETC2_EAC: 0x9278; + readonly COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9279; } interface WEBGL_compressed_texture_etc1 { - readonly COMPRESSED_RGB_ETC1_WEBGL: GLenum; + readonly COMPRESSED_RGB_ETC1_WEBGL: 0x8D64; } /** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */ interface WEBGL_compressed_texture_s3tc { - readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum; - readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum; - readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum; - readonly COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum; + readonly COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83F0; + readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83F1; + readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83F2; + readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83F3; } interface WEBGL_compressed_texture_s3tc_srgb { - readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum; - readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum; - readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum; - readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum; + readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: 0x8C4C; + readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: 0x8C4D; + readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: 0x8C4E; + readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: 0x8C4F; } /** The WEBGL_debug_renderer_info extension is part of the WebGL API and exposes two constants with information about the graphics driver for debugging purposes. */ interface WEBGL_debug_renderer_info { - readonly UNMASKED_RENDERER_WEBGL: GLenum; - readonly UNMASKED_VENDOR_WEBGL: GLenum; + readonly UNMASKED_VENDOR_WEBGL: 0x9245; + readonly UNMASKED_RENDERER_WEBGL: 0x9246; } interface WEBGL_debug_shaders { @@ -3507,45 +3544,45 @@ interface WEBGL_debug_shaders { /** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */ interface WEBGL_depth_texture { - readonly UNSIGNED_INT_24_8_WEBGL: GLenum; + readonly UNSIGNED_INT_24_8_WEBGL: 0x84FA; } interface WEBGL_draw_buffers { drawBuffersWEBGL(buffers: GLenum[]): void; - readonly COLOR_ATTACHMENT0_WEBGL: GLenum; - readonly COLOR_ATTACHMENT10_WEBGL: GLenum; - readonly COLOR_ATTACHMENT11_WEBGL: GLenum; - readonly COLOR_ATTACHMENT12_WEBGL: GLenum; - readonly COLOR_ATTACHMENT13_WEBGL: GLenum; - readonly COLOR_ATTACHMENT14_WEBGL: GLenum; - readonly COLOR_ATTACHMENT15_WEBGL: GLenum; - readonly COLOR_ATTACHMENT1_WEBGL: GLenum; - readonly COLOR_ATTACHMENT2_WEBGL: GLenum; - readonly COLOR_ATTACHMENT3_WEBGL: GLenum; - readonly COLOR_ATTACHMENT4_WEBGL: GLenum; - readonly COLOR_ATTACHMENT5_WEBGL: GLenum; - readonly COLOR_ATTACHMENT6_WEBGL: GLenum; - readonly COLOR_ATTACHMENT7_WEBGL: GLenum; - readonly COLOR_ATTACHMENT8_WEBGL: GLenum; - readonly COLOR_ATTACHMENT9_WEBGL: GLenum; - readonly DRAW_BUFFER0_WEBGL: GLenum; - readonly DRAW_BUFFER10_WEBGL: GLenum; - readonly DRAW_BUFFER11_WEBGL: GLenum; - readonly DRAW_BUFFER12_WEBGL: GLenum; - readonly DRAW_BUFFER13_WEBGL: GLenum; - readonly DRAW_BUFFER14_WEBGL: GLenum; - readonly DRAW_BUFFER15_WEBGL: GLenum; - readonly DRAW_BUFFER1_WEBGL: GLenum; - readonly DRAW_BUFFER2_WEBGL: GLenum; - readonly DRAW_BUFFER3_WEBGL: GLenum; - readonly DRAW_BUFFER4_WEBGL: GLenum; - readonly DRAW_BUFFER5_WEBGL: GLenum; - readonly DRAW_BUFFER6_WEBGL: GLenum; - readonly DRAW_BUFFER7_WEBGL: GLenum; - readonly DRAW_BUFFER8_WEBGL: GLenum; - readonly DRAW_BUFFER9_WEBGL: GLenum; - readonly MAX_COLOR_ATTACHMENTS_WEBGL: GLenum; - readonly MAX_DRAW_BUFFERS_WEBGL: GLenum; + readonly COLOR_ATTACHMENT0_WEBGL: 0x8CE0; + readonly COLOR_ATTACHMENT1_WEBGL: 0x8CE1; + readonly COLOR_ATTACHMENT2_WEBGL: 0x8CE2; + readonly COLOR_ATTACHMENT3_WEBGL: 0x8CE3; + readonly COLOR_ATTACHMENT4_WEBGL: 0x8CE4; + readonly COLOR_ATTACHMENT5_WEBGL: 0x8CE5; + readonly COLOR_ATTACHMENT6_WEBGL: 0x8CE6; + readonly COLOR_ATTACHMENT7_WEBGL: 0x8CE7; + readonly COLOR_ATTACHMENT8_WEBGL: 0x8CE8; + readonly COLOR_ATTACHMENT9_WEBGL: 0x8CE9; + readonly COLOR_ATTACHMENT10_WEBGL: 0x8CEA; + readonly COLOR_ATTACHMENT11_WEBGL: 0x8CEB; + readonly COLOR_ATTACHMENT12_WEBGL: 0x8CEC; + readonly COLOR_ATTACHMENT13_WEBGL: 0x8CED; + readonly COLOR_ATTACHMENT14_WEBGL: 0x8CEE; + readonly COLOR_ATTACHMENT15_WEBGL: 0x8CEF; + readonly DRAW_BUFFER0_WEBGL: 0x8825; + readonly DRAW_BUFFER1_WEBGL: 0x8826; + readonly DRAW_BUFFER2_WEBGL: 0x8827; + readonly DRAW_BUFFER3_WEBGL: 0x8828; + readonly DRAW_BUFFER4_WEBGL: 0x8829; + readonly DRAW_BUFFER5_WEBGL: 0x882A; + readonly DRAW_BUFFER6_WEBGL: 0x882B; + readonly DRAW_BUFFER7_WEBGL: 0x882C; + readonly DRAW_BUFFER8_WEBGL: 0x882D; + readonly DRAW_BUFFER9_WEBGL: 0x882E; + readonly DRAW_BUFFER10_WEBGL: 0x882F; + readonly DRAW_BUFFER11_WEBGL: 0x8830; + readonly DRAW_BUFFER12_WEBGL: 0x8831; + readonly DRAW_BUFFER13_WEBGL: 0x8832; + readonly DRAW_BUFFER14_WEBGL: 0x8833; + readonly DRAW_BUFFER15_WEBGL: 0x8834; + readonly MAX_COLOR_ATTACHMENTS_WEBGL: 0x8CDF; + readonly MAX_DRAW_BUFFERS_WEBGL: 0x8824; } interface WEBGL_lose_context { @@ -3566,565 +3603,565 @@ interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2Rende declare var WebGL2RenderingContext: { prototype: WebGL2RenderingContext; new(): WebGL2RenderingContext; - readonly ACTIVE_UNIFORM_BLOCKS: GLenum; - readonly ALREADY_SIGNALED: GLenum; - readonly ANY_SAMPLES_PASSED: GLenum; - readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum; - readonly COLOR: GLenum; - readonly COLOR_ATTACHMENT1: GLenum; - readonly COLOR_ATTACHMENT10: GLenum; - readonly COLOR_ATTACHMENT11: GLenum; - readonly COLOR_ATTACHMENT12: GLenum; - readonly COLOR_ATTACHMENT13: GLenum; - readonly COLOR_ATTACHMENT14: GLenum; - readonly COLOR_ATTACHMENT15: GLenum; - readonly COLOR_ATTACHMENT2: GLenum; - readonly COLOR_ATTACHMENT3: GLenum; - readonly COLOR_ATTACHMENT4: GLenum; - readonly COLOR_ATTACHMENT5: GLenum; - readonly COLOR_ATTACHMENT6: GLenum; - readonly COLOR_ATTACHMENT7: GLenum; - readonly COLOR_ATTACHMENT8: GLenum; - readonly COLOR_ATTACHMENT9: GLenum; - readonly COMPARE_REF_TO_TEXTURE: GLenum; - readonly CONDITION_SATISFIED: GLenum; - readonly COPY_READ_BUFFER: GLenum; - readonly COPY_READ_BUFFER_BINDING: GLenum; - readonly COPY_WRITE_BUFFER: GLenum; - readonly COPY_WRITE_BUFFER_BINDING: GLenum; - readonly CURRENT_QUERY: GLenum; - readonly DEPTH: GLenum; - readonly DEPTH24_STENCIL8: GLenum; - readonly DEPTH32F_STENCIL8: GLenum; - readonly DEPTH_COMPONENT24: GLenum; - readonly DEPTH_COMPONENT32F: GLenum; - readonly DRAW_BUFFER0: GLenum; - readonly DRAW_BUFFER1: GLenum; - readonly DRAW_BUFFER10: GLenum; - readonly DRAW_BUFFER11: GLenum; - readonly DRAW_BUFFER12: GLenum; - readonly DRAW_BUFFER13: GLenum; - readonly DRAW_BUFFER14: GLenum; - readonly DRAW_BUFFER15: GLenum; - readonly DRAW_BUFFER2: GLenum; - readonly DRAW_BUFFER3: GLenum; - readonly DRAW_BUFFER4: GLenum; - readonly DRAW_BUFFER5: GLenum; - readonly DRAW_BUFFER6: GLenum; - readonly DRAW_BUFFER7: GLenum; - readonly DRAW_BUFFER8: GLenum; - readonly DRAW_BUFFER9: GLenum; - readonly DRAW_FRAMEBUFFER: GLenum; - readonly DRAW_FRAMEBUFFER_BINDING: GLenum; - readonly DYNAMIC_COPY: GLenum; - readonly DYNAMIC_READ: GLenum; - readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum; - readonly FLOAT_MAT2x3: GLenum; - readonly FLOAT_MAT2x4: GLenum; - readonly FLOAT_MAT3x2: GLenum; - readonly FLOAT_MAT3x4: GLenum; - readonly FLOAT_MAT4x2: GLenum; - readonly FLOAT_MAT4x3: GLenum; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum; - readonly FRAMEBUFFER_DEFAULT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum; - readonly HALF_FLOAT: GLenum; - readonly INTERLEAVED_ATTRIBS: GLenum; - readonly INT_2_10_10_10_REV: GLenum; - readonly INT_SAMPLER_2D: GLenum; - readonly INT_SAMPLER_2D_ARRAY: GLenum; - readonly INT_SAMPLER_3D: GLenum; - readonly INT_SAMPLER_CUBE: GLenum; - readonly INVALID_INDEX: GLenum; - readonly MAX: GLenum; - readonly MAX_3D_TEXTURE_SIZE: GLenum; - readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum; - readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum; - readonly MAX_COLOR_ATTACHMENTS: GLenum; - readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum; - readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum; - readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum; - readonly MAX_DRAW_BUFFERS: GLenum; - readonly MAX_ELEMENTS_INDICES: GLenum; - readonly MAX_ELEMENTS_VERTICES: GLenum; - readonly MAX_ELEMENT_INDEX: GLenum; - readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum; - readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum; - readonly MAX_SAMPLES: GLenum; - readonly MAX_SERVER_WAIT_TIMEOUT: GLenum; - readonly MAX_TEXTURE_LOD_BIAS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum; - readonly MAX_UNIFORM_BLOCK_SIZE: GLenum; - readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum; - readonly MAX_VARYING_COMPONENTS: GLenum; - readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum; - readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum; - readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum; - readonly MIN: GLenum; - readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum; - readonly OBJECT_TYPE: GLenum; - readonly PACK_ROW_LENGTH: GLenum; - readonly PACK_SKIP_PIXELS: GLenum; - readonly PACK_SKIP_ROWS: GLenum; - readonly PIXEL_PACK_BUFFER: GLenum; - readonly PIXEL_PACK_BUFFER_BINDING: GLenum; - readonly PIXEL_UNPACK_BUFFER: GLenum; - readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum; - readonly QUERY_RESULT: GLenum; - readonly QUERY_RESULT_AVAILABLE: GLenum; - readonly R11F_G11F_B10F: GLenum; - readonly R16F: GLenum; - readonly R16I: GLenum; - readonly R16UI: GLenum; - readonly R32F: GLenum; - readonly R32I: GLenum; - readonly R32UI: GLenum; - readonly R8: GLenum; - readonly R8I: GLenum; - readonly R8UI: GLenum; - readonly R8_SNORM: GLenum; - readonly RASTERIZER_DISCARD: GLenum; - readonly READ_BUFFER: GLenum; - readonly READ_FRAMEBUFFER: GLenum; - readonly READ_FRAMEBUFFER_BINDING: GLenum; - readonly RED: GLenum; - readonly RED_INTEGER: GLenum; - readonly RENDERBUFFER_SAMPLES: GLenum; - readonly RG: GLenum; - readonly RG16F: GLenum; - readonly RG16I: GLenum; - readonly RG16UI: GLenum; - readonly RG32F: GLenum; - readonly RG32I: GLenum; - readonly RG32UI: GLenum; - readonly RG8: GLenum; - readonly RG8I: GLenum; - readonly RG8UI: GLenum; - readonly RG8_SNORM: GLenum; - readonly RGB10_A2: GLenum; - readonly RGB10_A2UI: GLenum; - readonly RGB16F: GLenum; - readonly RGB16I: GLenum; - readonly RGB16UI: GLenum; - readonly RGB32F: GLenum; - readonly RGB32I: GLenum; - readonly RGB32UI: GLenum; - readonly RGB8: GLenum; - readonly RGB8I: GLenum; - readonly RGB8UI: GLenum; - readonly RGB8_SNORM: GLenum; - readonly RGB9_E5: GLenum; - readonly RGBA16F: GLenum; - readonly RGBA16I: GLenum; - readonly RGBA16UI: GLenum; - readonly RGBA32F: GLenum; - readonly RGBA32I: GLenum; - readonly RGBA32UI: GLenum; - readonly RGBA8: GLenum; - readonly RGBA8I: GLenum; - readonly RGBA8UI: GLenum; - readonly RGBA8_SNORM: GLenum; - readonly RGBA_INTEGER: GLenum; - readonly RGB_INTEGER: GLenum; - readonly RG_INTEGER: GLenum; - readonly SAMPLER_2D_ARRAY: GLenum; - readonly SAMPLER_2D_ARRAY_SHADOW: GLenum; - readonly SAMPLER_2D_SHADOW: GLenum; - readonly SAMPLER_3D: GLenum; - readonly SAMPLER_BINDING: GLenum; - readonly SAMPLER_CUBE_SHADOW: GLenum; - readonly SEPARATE_ATTRIBS: GLenum; - readonly SIGNALED: GLenum; - readonly SIGNED_NORMALIZED: GLenum; - readonly SRGB: GLenum; - readonly SRGB8: GLenum; - readonly SRGB8_ALPHA8: GLenum; - readonly STATIC_COPY: GLenum; - readonly STATIC_READ: GLenum; - readonly STENCIL: GLenum; - readonly STREAM_COPY: GLenum; - readonly STREAM_READ: GLenum; - readonly SYNC_CONDITION: GLenum; - readonly SYNC_FENCE: GLenum; - readonly SYNC_FLAGS: GLenum; - readonly SYNC_FLUSH_COMMANDS_BIT: GLenum; - readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum; - readonly SYNC_STATUS: GLenum; - readonly TEXTURE_2D_ARRAY: GLenum; - readonly TEXTURE_3D: GLenum; - readonly TEXTURE_BASE_LEVEL: GLenum; - readonly TEXTURE_BINDING_2D_ARRAY: GLenum; - readonly TEXTURE_BINDING_3D: GLenum; - readonly TEXTURE_COMPARE_FUNC: GLenum; - readonly TEXTURE_COMPARE_MODE: GLenum; - readonly TEXTURE_IMMUTABLE_FORMAT: GLenum; - readonly TEXTURE_IMMUTABLE_LEVELS: GLenum; - readonly TEXTURE_MAX_LEVEL: GLenum; - readonly TEXTURE_MAX_LOD: GLenum; - readonly TEXTURE_MIN_LOD: GLenum; - readonly TEXTURE_WRAP_R: GLenum; - readonly TIMEOUT_EXPIRED: GLenum; - readonly TIMEOUT_IGNORED: GLint64; - readonly TRANSFORM_FEEDBACK: GLenum; - readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum; - readonly TRANSFORM_FEEDBACK_BINDING: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum; - readonly TRANSFORM_FEEDBACK_PAUSED: GLenum; - readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum; - readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum; - readonly UNIFORM_ARRAY_STRIDE: GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum; - readonly UNIFORM_BLOCK_BINDING: GLenum; - readonly UNIFORM_BLOCK_DATA_SIZE: GLenum; - readonly UNIFORM_BLOCK_INDEX: GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum; - readonly UNIFORM_BUFFER: GLenum; - readonly UNIFORM_BUFFER_BINDING: GLenum; - readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum; - readonly UNIFORM_BUFFER_SIZE: GLenum; - readonly UNIFORM_BUFFER_START: GLenum; - readonly UNIFORM_IS_ROW_MAJOR: GLenum; - readonly UNIFORM_MATRIX_STRIDE: GLenum; - readonly UNIFORM_OFFSET: GLenum; - readonly UNIFORM_SIZE: GLenum; - readonly UNIFORM_TYPE: GLenum; - readonly UNPACK_IMAGE_HEIGHT: GLenum; - readonly UNPACK_ROW_LENGTH: GLenum; - readonly UNPACK_SKIP_IMAGES: GLenum; - readonly UNPACK_SKIP_PIXELS: GLenum; - readonly UNPACK_SKIP_ROWS: GLenum; - readonly UNSIGNALED: GLenum; - readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum; - readonly UNSIGNED_INT_24_8: GLenum; - readonly UNSIGNED_INT_2_10_10_10_REV: GLenum; - readonly UNSIGNED_INT_5_9_9_9_REV: GLenum; - readonly UNSIGNED_INT_SAMPLER_2D: GLenum; - readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum; - readonly UNSIGNED_INT_SAMPLER_3D: GLenum; - readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum; - readonly UNSIGNED_INT_VEC2: GLenum; - readonly UNSIGNED_INT_VEC3: GLenum; - readonly UNSIGNED_INT_VEC4: GLenum; - readonly UNSIGNED_NORMALIZED: GLenum; - readonly VERTEX_ARRAY_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum; - readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum; - readonly WAIT_FAILED: GLenum; - readonly ACTIVE_ATTRIBUTES: GLenum; - readonly ACTIVE_TEXTURE: GLenum; - readonly ACTIVE_UNIFORMS: GLenum; - readonly ALIASED_LINE_WIDTH_RANGE: GLenum; - readonly ALIASED_POINT_SIZE_RANGE: GLenum; - readonly ALPHA: GLenum; - readonly ALPHA_BITS: GLenum; - readonly ALWAYS: GLenum; - readonly ARRAY_BUFFER: GLenum; - readonly ARRAY_BUFFER_BINDING: GLenum; - readonly ATTACHED_SHADERS: GLenum; - readonly BACK: GLenum; - readonly BLEND: GLenum; - readonly BLEND_COLOR: GLenum; - readonly BLEND_DST_ALPHA: GLenum; - readonly BLEND_DST_RGB: GLenum; - readonly BLEND_EQUATION: GLenum; - readonly BLEND_EQUATION_ALPHA: GLenum; - readonly BLEND_EQUATION_RGB: GLenum; - readonly BLEND_SRC_ALPHA: GLenum; - readonly BLEND_SRC_RGB: GLenum; - readonly BLUE_BITS: GLenum; - readonly BOOL: GLenum; - readonly BOOL_VEC2: GLenum; - readonly BOOL_VEC3: GLenum; - readonly BOOL_VEC4: GLenum; - readonly BROWSER_DEFAULT_WEBGL: GLenum; - readonly BUFFER_SIZE: GLenum; - readonly BUFFER_USAGE: GLenum; - readonly BYTE: GLenum; - readonly CCW: GLenum; - readonly CLAMP_TO_EDGE: GLenum; - readonly COLOR_ATTACHMENT0: GLenum; - readonly COLOR_BUFFER_BIT: GLenum; - readonly COLOR_CLEAR_VALUE: GLenum; - readonly COLOR_WRITEMASK: GLenum; - readonly COMPILE_STATUS: GLenum; - readonly COMPRESSED_TEXTURE_FORMATS: GLenum; - readonly CONSTANT_ALPHA: GLenum; - readonly CONSTANT_COLOR: GLenum; - readonly CONTEXT_LOST_WEBGL: GLenum; - readonly CULL_FACE: GLenum; - readonly CULL_FACE_MODE: GLenum; - readonly CURRENT_PROGRAM: GLenum; - readonly CURRENT_VERTEX_ATTRIB: GLenum; - readonly CW: GLenum; - readonly DECR: GLenum; - readonly DECR_WRAP: GLenum; - readonly DELETE_STATUS: GLenum; - readonly DEPTH_ATTACHMENT: GLenum; - readonly DEPTH_BITS: GLenum; - readonly DEPTH_BUFFER_BIT: GLenum; - readonly DEPTH_CLEAR_VALUE: GLenum; - readonly DEPTH_COMPONENT: GLenum; - readonly DEPTH_COMPONENT16: GLenum; - readonly DEPTH_FUNC: GLenum; - readonly DEPTH_RANGE: GLenum; - readonly DEPTH_STENCIL: GLenum; - readonly DEPTH_STENCIL_ATTACHMENT: GLenum; - readonly DEPTH_TEST: GLenum; - readonly DEPTH_WRITEMASK: GLenum; - readonly DITHER: GLenum; - readonly DONT_CARE: GLenum; - readonly DST_ALPHA: GLenum; - readonly DST_COLOR: GLenum; - readonly DYNAMIC_DRAW: GLenum; - readonly ELEMENT_ARRAY_BUFFER: GLenum; - readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum; - readonly EQUAL: GLenum; - readonly FASTEST: GLenum; - readonly FLOAT: GLenum; - readonly FLOAT_MAT2: GLenum; - readonly FLOAT_MAT3: GLenum; - readonly FLOAT_MAT4: GLenum; - readonly FLOAT_VEC2: GLenum; - readonly FLOAT_VEC3: GLenum; - readonly FLOAT_VEC4: GLenum; - readonly FRAGMENT_SHADER: GLenum; - readonly FRAMEBUFFER: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum; - readonly FRAMEBUFFER_BINDING: GLenum; - readonly FRAMEBUFFER_COMPLETE: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_UNSUPPORTED: GLenum; - readonly FRONT: GLenum; - readonly FRONT_AND_BACK: GLenum; - readonly FRONT_FACE: GLenum; - readonly FUNC_ADD: GLenum; - readonly FUNC_REVERSE_SUBTRACT: GLenum; - readonly FUNC_SUBTRACT: GLenum; - readonly GENERATE_MIPMAP_HINT: GLenum; - readonly GEQUAL: GLenum; - readonly GREATER: GLenum; - readonly GREEN_BITS: GLenum; - readonly HIGH_FLOAT: GLenum; - readonly HIGH_INT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum; - readonly INCR: GLenum; - readonly INCR_WRAP: GLenum; - readonly INT: GLenum; - readonly INT_VEC2: GLenum; - readonly INT_VEC3: GLenum; - readonly INT_VEC4: GLenum; - readonly INVALID_ENUM: GLenum; - readonly INVALID_FRAMEBUFFER_OPERATION: GLenum; - readonly INVALID_OPERATION: GLenum; - readonly INVALID_VALUE: GLenum; - readonly INVERT: GLenum; - readonly KEEP: GLenum; - readonly LEQUAL: GLenum; - readonly LESS: GLenum; - readonly LINEAR: GLenum; - readonly LINEAR_MIPMAP_LINEAR: GLenum; - readonly LINEAR_MIPMAP_NEAREST: GLenum; - readonly LINES: GLenum; - readonly LINE_LOOP: GLenum; - readonly LINE_STRIP: GLenum; - readonly LINE_WIDTH: GLenum; - readonly LINK_STATUS: GLenum; - readonly LOW_FLOAT: GLenum; - readonly LOW_INT: GLenum; - readonly LUMINANCE: GLenum; - readonly LUMINANCE_ALPHA: GLenum; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum; - readonly MAX_RENDERBUFFER_SIZE: GLenum; - readonly MAX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_TEXTURE_SIZE: GLenum; - readonly MAX_VARYING_VECTORS: GLenum; - readonly MAX_VERTEX_ATTRIBS: GLenum; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum; - readonly MAX_VIEWPORT_DIMS: GLenum; - readonly MEDIUM_FLOAT: GLenum; - readonly MEDIUM_INT: GLenum; - readonly MIRRORED_REPEAT: GLenum; - readonly NEAREST: GLenum; - readonly NEAREST_MIPMAP_LINEAR: GLenum; - readonly NEAREST_MIPMAP_NEAREST: GLenum; - readonly NEVER: GLenum; - readonly NICEST: GLenum; - readonly NONE: GLenum; - readonly NOTEQUAL: GLenum; - readonly NO_ERROR: GLenum; - readonly ONE: GLenum; - readonly ONE_MINUS_CONSTANT_ALPHA: GLenum; - readonly ONE_MINUS_CONSTANT_COLOR: GLenum; - readonly ONE_MINUS_DST_ALPHA: GLenum; - readonly ONE_MINUS_DST_COLOR: GLenum; - readonly ONE_MINUS_SRC_ALPHA: GLenum; - readonly ONE_MINUS_SRC_COLOR: GLenum; - readonly OUT_OF_MEMORY: GLenum; - readonly PACK_ALIGNMENT: GLenum; - readonly POINTS: GLenum; - readonly POLYGON_OFFSET_FACTOR: GLenum; - readonly POLYGON_OFFSET_FILL: GLenum; - readonly POLYGON_OFFSET_UNITS: GLenum; - readonly RED_BITS: GLenum; - readonly RENDERBUFFER: GLenum; - readonly RENDERBUFFER_ALPHA_SIZE: GLenum; - readonly RENDERBUFFER_BINDING: GLenum; - readonly RENDERBUFFER_BLUE_SIZE: GLenum; - readonly RENDERBUFFER_DEPTH_SIZE: GLenum; - readonly RENDERBUFFER_GREEN_SIZE: GLenum; - readonly RENDERBUFFER_HEIGHT: GLenum; - readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum; - readonly RENDERBUFFER_RED_SIZE: GLenum; - readonly RENDERBUFFER_STENCIL_SIZE: GLenum; - readonly RENDERBUFFER_WIDTH: GLenum; - readonly RENDERER: GLenum; - readonly REPEAT: GLenum; - readonly REPLACE: GLenum; - readonly RGB: GLenum; - readonly RGB565: GLenum; - readonly RGB5_A1: GLenum; - readonly RGBA: GLenum; - readonly RGBA4: GLenum; - readonly SAMPLER_2D: GLenum; - readonly SAMPLER_CUBE: GLenum; - readonly SAMPLES: GLenum; - readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum; - readonly SAMPLE_BUFFERS: GLenum; - readonly SAMPLE_COVERAGE: GLenum; - readonly SAMPLE_COVERAGE_INVERT: GLenum; - readonly SAMPLE_COVERAGE_VALUE: GLenum; - readonly SCISSOR_BOX: GLenum; - readonly SCISSOR_TEST: GLenum; - readonly SHADER_TYPE: GLenum; - readonly SHADING_LANGUAGE_VERSION: GLenum; - readonly SHORT: GLenum; - readonly SRC_ALPHA: GLenum; - readonly SRC_ALPHA_SATURATE: GLenum; - readonly SRC_COLOR: GLenum; - readonly STATIC_DRAW: GLenum; - readonly STENCIL_ATTACHMENT: GLenum; - readonly STENCIL_BACK_FAIL: GLenum; - readonly STENCIL_BACK_FUNC: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_BACK_REF: GLenum; - readonly STENCIL_BACK_VALUE_MASK: GLenum; - readonly STENCIL_BACK_WRITEMASK: GLenum; - readonly STENCIL_BITS: GLenum; - readonly STENCIL_BUFFER_BIT: GLenum; - readonly STENCIL_CLEAR_VALUE: GLenum; - readonly STENCIL_FAIL: GLenum; - readonly STENCIL_FUNC: GLenum; - readonly STENCIL_INDEX8: GLenum; - readonly STENCIL_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_REF: GLenum; - readonly STENCIL_TEST: GLenum; - readonly STENCIL_VALUE_MASK: GLenum; - readonly STENCIL_WRITEMASK: GLenum; - readonly STREAM_DRAW: GLenum; - readonly SUBPIXEL_BITS: GLenum; - readonly TEXTURE: GLenum; - readonly TEXTURE0: GLenum; - readonly TEXTURE1: GLenum; - readonly TEXTURE10: GLenum; - readonly TEXTURE11: GLenum; - readonly TEXTURE12: GLenum; - readonly TEXTURE13: GLenum; - readonly TEXTURE14: GLenum; - readonly TEXTURE15: GLenum; - readonly TEXTURE16: GLenum; - readonly TEXTURE17: GLenum; - readonly TEXTURE18: GLenum; - readonly TEXTURE19: GLenum; - readonly TEXTURE2: GLenum; - readonly TEXTURE20: GLenum; - readonly TEXTURE21: GLenum; - readonly TEXTURE22: GLenum; - readonly TEXTURE23: GLenum; - readonly TEXTURE24: GLenum; - readonly TEXTURE25: GLenum; - readonly TEXTURE26: GLenum; - readonly TEXTURE27: GLenum; - readonly TEXTURE28: GLenum; - readonly TEXTURE29: GLenum; - readonly TEXTURE3: GLenum; - readonly TEXTURE30: GLenum; - readonly TEXTURE31: GLenum; - readonly TEXTURE4: GLenum; - readonly TEXTURE5: GLenum; - readonly TEXTURE6: GLenum; - readonly TEXTURE7: GLenum; - readonly TEXTURE8: GLenum; - readonly TEXTURE9: GLenum; - readonly TEXTURE_2D: GLenum; - readonly TEXTURE_BINDING_2D: GLenum; - readonly TEXTURE_BINDING_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum; - readonly TEXTURE_MAG_FILTER: GLenum; - readonly TEXTURE_MIN_FILTER: GLenum; - readonly TEXTURE_WRAP_S: GLenum; - readonly TEXTURE_WRAP_T: GLenum; - readonly TRIANGLES: GLenum; - readonly TRIANGLE_FAN: GLenum; - readonly TRIANGLE_STRIP: GLenum; - readonly UNPACK_ALIGNMENT: GLenum; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum; - readonly UNPACK_FLIP_Y_WEBGL: GLenum; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum; - readonly UNSIGNED_BYTE: GLenum; - readonly UNSIGNED_INT: GLenum; - readonly UNSIGNED_SHORT: GLenum; - readonly UNSIGNED_SHORT_4_4_4_4: GLenum; - readonly UNSIGNED_SHORT_5_5_5_1: GLenum; - readonly UNSIGNED_SHORT_5_6_5: GLenum; - readonly VALIDATE_STATUS: GLenum; - readonly VENDOR: GLenum; - readonly VERSION: GLenum; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum; - readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum; - readonly VERTEX_SHADER: GLenum; - readonly VIEWPORT: GLenum; - readonly ZERO: GLenum; + readonly READ_BUFFER: 0x0C02; + readonly UNPACK_ROW_LENGTH: 0x0CF2; + readonly UNPACK_SKIP_ROWS: 0x0CF3; + readonly UNPACK_SKIP_PIXELS: 0x0CF4; + readonly PACK_ROW_LENGTH: 0x0D02; + readonly PACK_SKIP_ROWS: 0x0D03; + readonly PACK_SKIP_PIXELS: 0x0D04; + readonly COLOR: 0x1800; + readonly DEPTH: 0x1801; + readonly STENCIL: 0x1802; + readonly RED: 0x1903; + readonly RGB8: 0x8051; + readonly RGBA8: 0x8058; + readonly RGB10_A2: 0x8059; + readonly TEXTURE_BINDING_3D: 0x806A; + readonly UNPACK_SKIP_IMAGES: 0x806D; + readonly UNPACK_IMAGE_HEIGHT: 0x806E; + readonly TEXTURE_3D: 0x806F; + readonly TEXTURE_WRAP_R: 0x8072; + readonly MAX_3D_TEXTURE_SIZE: 0x8073; + readonly UNSIGNED_INT_2_10_10_10_REV: 0x8368; + readonly MAX_ELEMENTS_VERTICES: 0x80E8; + readonly MAX_ELEMENTS_INDICES: 0x80E9; + readonly TEXTURE_MIN_LOD: 0x813A; + readonly TEXTURE_MAX_LOD: 0x813B; + readonly TEXTURE_BASE_LEVEL: 0x813C; + readonly TEXTURE_MAX_LEVEL: 0x813D; + readonly MIN: 0x8007; + readonly MAX: 0x8008; + readonly DEPTH_COMPONENT24: 0x81A6; + readonly MAX_TEXTURE_LOD_BIAS: 0x84FD; + readonly TEXTURE_COMPARE_MODE: 0x884C; + readonly TEXTURE_COMPARE_FUNC: 0x884D; + readonly CURRENT_QUERY: 0x8865; + readonly QUERY_RESULT: 0x8866; + readonly QUERY_RESULT_AVAILABLE: 0x8867; + readonly STREAM_READ: 0x88E1; + readonly STREAM_COPY: 0x88E2; + readonly STATIC_READ: 0x88E5; + readonly STATIC_COPY: 0x88E6; + readonly DYNAMIC_READ: 0x88E9; + readonly DYNAMIC_COPY: 0x88EA; + readonly MAX_DRAW_BUFFERS: 0x8824; + readonly DRAW_BUFFER0: 0x8825; + readonly DRAW_BUFFER1: 0x8826; + readonly DRAW_BUFFER2: 0x8827; + readonly DRAW_BUFFER3: 0x8828; + readonly DRAW_BUFFER4: 0x8829; + readonly DRAW_BUFFER5: 0x882A; + readonly DRAW_BUFFER6: 0x882B; + readonly DRAW_BUFFER7: 0x882C; + readonly DRAW_BUFFER8: 0x882D; + readonly DRAW_BUFFER9: 0x882E; + readonly DRAW_BUFFER10: 0x882F; + readonly DRAW_BUFFER11: 0x8830; + readonly DRAW_BUFFER12: 0x8831; + readonly DRAW_BUFFER13: 0x8832; + readonly DRAW_BUFFER14: 0x8833; + readonly DRAW_BUFFER15: 0x8834; + readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: 0x8B49; + readonly MAX_VERTEX_UNIFORM_COMPONENTS: 0x8B4A; + readonly SAMPLER_3D: 0x8B5F; + readonly SAMPLER_2D_SHADOW: 0x8B62; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8B8B; + readonly PIXEL_PACK_BUFFER: 0x88EB; + readonly PIXEL_UNPACK_BUFFER: 0x88EC; + readonly PIXEL_PACK_BUFFER_BINDING: 0x88ED; + readonly PIXEL_UNPACK_BUFFER_BINDING: 0x88EF; + readonly FLOAT_MAT2x3: 0x8B65; + readonly FLOAT_MAT2x4: 0x8B66; + readonly FLOAT_MAT3x2: 0x8B67; + readonly FLOAT_MAT3x4: 0x8B68; + readonly FLOAT_MAT4x2: 0x8B69; + readonly FLOAT_MAT4x3: 0x8B6A; + readonly SRGB: 0x8C40; + readonly SRGB8: 0x8C41; + readonly SRGB8_ALPHA8: 0x8C43; + readonly COMPARE_REF_TO_TEXTURE: 0x884E; + readonly RGBA32F: 0x8814; + readonly RGB32F: 0x8815; + readonly RGBA16F: 0x881A; + readonly RGB16F: 0x881B; + readonly VERTEX_ATTRIB_ARRAY_INTEGER: 0x88FD; + readonly MAX_ARRAY_TEXTURE_LAYERS: 0x88FF; + readonly MIN_PROGRAM_TEXEL_OFFSET: 0x8904; + readonly MAX_PROGRAM_TEXEL_OFFSET: 0x8905; + readonly MAX_VARYING_COMPONENTS: 0x8B4B; + readonly TEXTURE_2D_ARRAY: 0x8C1A; + readonly TEXTURE_BINDING_2D_ARRAY: 0x8C1D; + readonly R11F_G11F_B10F: 0x8C3A; + readonly UNSIGNED_INT_10F_11F_11F_REV: 0x8C3B; + readonly RGB9_E5: 0x8C3D; + readonly UNSIGNED_INT_5_9_9_9_REV: 0x8C3E; + readonly TRANSFORM_FEEDBACK_BUFFER_MODE: 0x8C7F; + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 0x8C80; + readonly TRANSFORM_FEEDBACK_VARYINGS: 0x8C83; + readonly TRANSFORM_FEEDBACK_BUFFER_START: 0x8C84; + readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: 0x8C85; + readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 0x8C88; + readonly RASTERIZER_DISCARD: 0x8C89; + readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 0x8C8A; + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 0x8C8B; + readonly INTERLEAVED_ATTRIBS: 0x8C8C; + readonly SEPARATE_ATTRIBS: 0x8C8D; + readonly TRANSFORM_FEEDBACK_BUFFER: 0x8C8E; + readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: 0x8C8F; + readonly RGBA32UI: 0x8D70; + readonly RGB32UI: 0x8D71; + readonly RGBA16UI: 0x8D76; + readonly RGB16UI: 0x8D77; + readonly RGBA8UI: 0x8D7C; + readonly RGB8UI: 0x8D7D; + readonly RGBA32I: 0x8D82; + readonly RGB32I: 0x8D83; + readonly RGBA16I: 0x8D88; + readonly RGB16I: 0x8D89; + readonly RGBA8I: 0x8D8E; + readonly RGB8I: 0x8D8F; + readonly RED_INTEGER: 0x8D94; + readonly RGB_INTEGER: 0x8D98; + readonly RGBA_INTEGER: 0x8D99; + readonly SAMPLER_2D_ARRAY: 0x8DC1; + readonly SAMPLER_2D_ARRAY_SHADOW: 0x8DC4; + readonly SAMPLER_CUBE_SHADOW: 0x8DC5; + readonly UNSIGNED_INT_VEC2: 0x8DC6; + readonly UNSIGNED_INT_VEC3: 0x8DC7; + readonly UNSIGNED_INT_VEC4: 0x8DC8; + readonly INT_SAMPLER_2D: 0x8DCA; + readonly INT_SAMPLER_3D: 0x8DCB; + readonly INT_SAMPLER_CUBE: 0x8DCC; + readonly INT_SAMPLER_2D_ARRAY: 0x8DCF; + readonly UNSIGNED_INT_SAMPLER_2D: 0x8DD2; + readonly UNSIGNED_INT_SAMPLER_3D: 0x8DD3; + readonly UNSIGNED_INT_SAMPLER_CUBE: 0x8DD4; + readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: 0x8DD7; + readonly DEPTH_COMPONENT32F: 0x8CAC; + readonly DEPTH32F_STENCIL8: 0x8CAD; + readonly FLOAT_32_UNSIGNED_INT_24_8_REV: 0x8DAD; + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 0x8210; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 0x8211; + readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: 0x8212; + readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 0x8213; + readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 0x8214; + readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 0x8215; + readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 0x8216; + readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 0x8217; + readonly FRAMEBUFFER_DEFAULT: 0x8218; + readonly UNSIGNED_INT_24_8: 0x84FA; + readonly DEPTH24_STENCIL8: 0x88F0; + readonly UNSIGNED_NORMALIZED: 0x8C17; + readonly DRAW_FRAMEBUFFER_BINDING: 0x8CA6; + readonly READ_FRAMEBUFFER: 0x8CA8; + readonly DRAW_FRAMEBUFFER: 0x8CA9; + readonly READ_FRAMEBUFFER_BINDING: 0x8CAA; + readonly RENDERBUFFER_SAMPLES: 0x8CAB; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 0x8CD4; + readonly MAX_COLOR_ATTACHMENTS: 0x8CDF; + readonly COLOR_ATTACHMENT1: 0x8CE1; + readonly COLOR_ATTACHMENT2: 0x8CE2; + readonly COLOR_ATTACHMENT3: 0x8CE3; + readonly COLOR_ATTACHMENT4: 0x8CE4; + readonly COLOR_ATTACHMENT5: 0x8CE5; + readonly COLOR_ATTACHMENT6: 0x8CE6; + readonly COLOR_ATTACHMENT7: 0x8CE7; + readonly COLOR_ATTACHMENT8: 0x8CE8; + readonly COLOR_ATTACHMENT9: 0x8CE9; + readonly COLOR_ATTACHMENT10: 0x8CEA; + readonly COLOR_ATTACHMENT11: 0x8CEB; + readonly COLOR_ATTACHMENT12: 0x8CEC; + readonly COLOR_ATTACHMENT13: 0x8CED; + readonly COLOR_ATTACHMENT14: 0x8CEE; + readonly COLOR_ATTACHMENT15: 0x8CEF; + readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8D56; + readonly MAX_SAMPLES: 0x8D57; + readonly HALF_FLOAT: 0x140B; + readonly RG: 0x8227; + readonly RG_INTEGER: 0x8228; + readonly R8: 0x8229; + readonly RG8: 0x822B; + readonly R16F: 0x822D; + readonly R32F: 0x822E; + readonly RG16F: 0x822F; + readonly RG32F: 0x8230; + readonly R8I: 0x8231; + readonly R8UI: 0x8232; + readonly R16I: 0x8233; + readonly R16UI: 0x8234; + readonly R32I: 0x8235; + readonly R32UI: 0x8236; + readonly RG8I: 0x8237; + readonly RG8UI: 0x8238; + readonly RG16I: 0x8239; + readonly RG16UI: 0x823A; + readonly RG32I: 0x823B; + readonly RG32UI: 0x823C; + readonly VERTEX_ARRAY_BINDING: 0x85B5; + readonly R8_SNORM: 0x8F94; + readonly RG8_SNORM: 0x8F95; + readonly RGB8_SNORM: 0x8F96; + readonly RGBA8_SNORM: 0x8F97; + readonly SIGNED_NORMALIZED: 0x8F9C; + readonly COPY_READ_BUFFER: 0x8F36; + readonly COPY_WRITE_BUFFER: 0x8F37; + readonly COPY_READ_BUFFER_BINDING: 0x8F36; + readonly COPY_WRITE_BUFFER_BINDING: 0x8F37; + readonly UNIFORM_BUFFER: 0x8A11; + readonly UNIFORM_BUFFER_BINDING: 0x8A28; + readonly UNIFORM_BUFFER_START: 0x8A29; + readonly UNIFORM_BUFFER_SIZE: 0x8A2A; + readonly MAX_VERTEX_UNIFORM_BLOCKS: 0x8A2B; + readonly MAX_FRAGMENT_UNIFORM_BLOCKS: 0x8A2D; + readonly MAX_COMBINED_UNIFORM_BLOCKS: 0x8A2E; + readonly MAX_UNIFORM_BUFFER_BINDINGS: 0x8A2F; + readonly MAX_UNIFORM_BLOCK_SIZE: 0x8A30; + readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 0x8A31; + readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 0x8A33; + readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: 0x8A34; + readonly ACTIVE_UNIFORM_BLOCKS: 0x8A36; + readonly UNIFORM_TYPE: 0x8A37; + readonly UNIFORM_SIZE: 0x8A38; + readonly UNIFORM_BLOCK_INDEX: 0x8A3A; + readonly UNIFORM_OFFSET: 0x8A3B; + readonly UNIFORM_ARRAY_STRIDE: 0x8A3C; + readonly UNIFORM_MATRIX_STRIDE: 0x8A3D; + readonly UNIFORM_IS_ROW_MAJOR: 0x8A3E; + readonly UNIFORM_BLOCK_BINDING: 0x8A3F; + readonly UNIFORM_BLOCK_DATA_SIZE: 0x8A40; + readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: 0x8A42; + readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 0x8A43; + readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 0x8A44; + readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 0x8A46; + readonly INVALID_INDEX: 0xFFFFFFFF; + readonly MAX_VERTEX_OUTPUT_COMPONENTS: 0x9122; + readonly MAX_FRAGMENT_INPUT_COMPONENTS: 0x9125; + readonly MAX_SERVER_WAIT_TIMEOUT: 0x9111; + readonly OBJECT_TYPE: 0x9112; + readonly SYNC_CONDITION: 0x9113; + readonly SYNC_STATUS: 0x9114; + readonly SYNC_FLAGS: 0x9115; + readonly SYNC_FENCE: 0x9116; + readonly SYNC_GPU_COMMANDS_COMPLETE: 0x9117; + readonly UNSIGNALED: 0x9118; + readonly SIGNALED: 0x9119; + readonly ALREADY_SIGNALED: 0x911A; + readonly TIMEOUT_EXPIRED: 0x911B; + readonly CONDITION_SATISFIED: 0x911C; + readonly WAIT_FAILED: 0x911D; + readonly SYNC_FLUSH_COMMANDS_BIT: 0x00000001; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR: 0x88FE; + readonly ANY_SAMPLES_PASSED: 0x8C2F; + readonly ANY_SAMPLES_PASSED_CONSERVATIVE: 0x8D6A; + readonly SAMPLER_BINDING: 0x8919; + readonly RGB10_A2UI: 0x906F; + readonly INT_2_10_10_10_REV: 0x8D9F; + readonly TRANSFORM_FEEDBACK: 0x8E22; + readonly TRANSFORM_FEEDBACK_PAUSED: 0x8E23; + readonly TRANSFORM_FEEDBACK_ACTIVE: 0x8E24; + readonly TRANSFORM_FEEDBACK_BINDING: 0x8E25; + readonly TEXTURE_IMMUTABLE_FORMAT: 0x912F; + readonly MAX_ELEMENT_INDEX: 0x8D6B; + readonly TEXTURE_IMMUTABLE_LEVELS: 0x82DF; + readonly TIMEOUT_IGNORED: -1; + readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: 0x9247; + readonly DEPTH_BUFFER_BIT: 0x00000100; + readonly STENCIL_BUFFER_BIT: 0x00000400; + readonly COLOR_BUFFER_BIT: 0x00004000; + readonly POINTS: 0x0000; + readonly LINES: 0x0001; + readonly LINE_LOOP: 0x0002; + readonly LINE_STRIP: 0x0003; + readonly TRIANGLES: 0x0004; + readonly TRIANGLE_STRIP: 0x0005; + readonly TRIANGLE_FAN: 0x0006; + readonly ZERO: 0; + readonly ONE: 1; + readonly SRC_COLOR: 0x0300; + readonly ONE_MINUS_SRC_COLOR: 0x0301; + readonly SRC_ALPHA: 0x0302; + readonly ONE_MINUS_SRC_ALPHA: 0x0303; + readonly DST_ALPHA: 0x0304; + readonly ONE_MINUS_DST_ALPHA: 0x0305; + readonly DST_COLOR: 0x0306; + readonly ONE_MINUS_DST_COLOR: 0x0307; + readonly SRC_ALPHA_SATURATE: 0x0308; + readonly FUNC_ADD: 0x8006; + readonly BLEND_EQUATION: 0x8009; + readonly BLEND_EQUATION_RGB: 0x8009; + readonly BLEND_EQUATION_ALPHA: 0x883D; + readonly FUNC_SUBTRACT: 0x800A; + readonly FUNC_REVERSE_SUBTRACT: 0x800B; + readonly BLEND_DST_RGB: 0x80C8; + readonly BLEND_SRC_RGB: 0x80C9; + readonly BLEND_DST_ALPHA: 0x80CA; + readonly BLEND_SRC_ALPHA: 0x80CB; + readonly CONSTANT_COLOR: 0x8001; + readonly ONE_MINUS_CONSTANT_COLOR: 0x8002; + readonly CONSTANT_ALPHA: 0x8003; + readonly ONE_MINUS_CONSTANT_ALPHA: 0x8004; + readonly BLEND_COLOR: 0x8005; + readonly ARRAY_BUFFER: 0x8892; + readonly ELEMENT_ARRAY_BUFFER: 0x8893; + readonly ARRAY_BUFFER_BINDING: 0x8894; + readonly ELEMENT_ARRAY_BUFFER_BINDING: 0x8895; + readonly STREAM_DRAW: 0x88E0; + readonly STATIC_DRAW: 0x88E4; + readonly DYNAMIC_DRAW: 0x88E8; + readonly BUFFER_SIZE: 0x8764; + readonly BUFFER_USAGE: 0x8765; + readonly CURRENT_VERTEX_ATTRIB: 0x8626; + readonly FRONT: 0x0404; + readonly BACK: 0x0405; + readonly FRONT_AND_BACK: 0x0408; + readonly CULL_FACE: 0x0B44; + readonly BLEND: 0x0BE2; + readonly DITHER: 0x0BD0; + readonly STENCIL_TEST: 0x0B90; + readonly DEPTH_TEST: 0x0B71; + readonly SCISSOR_TEST: 0x0C11; + readonly POLYGON_OFFSET_FILL: 0x8037; + readonly SAMPLE_ALPHA_TO_COVERAGE: 0x809E; + readonly SAMPLE_COVERAGE: 0x80A0; + readonly NO_ERROR: 0; + readonly INVALID_ENUM: 0x0500; + readonly INVALID_VALUE: 0x0501; + readonly INVALID_OPERATION: 0x0502; + readonly OUT_OF_MEMORY: 0x0505; + readonly CW: 0x0900; + readonly CCW: 0x0901; + readonly LINE_WIDTH: 0x0B21; + readonly ALIASED_POINT_SIZE_RANGE: 0x846D; + readonly ALIASED_LINE_WIDTH_RANGE: 0x846E; + readonly CULL_FACE_MODE: 0x0B45; + readonly FRONT_FACE: 0x0B46; + readonly DEPTH_RANGE: 0x0B70; + readonly DEPTH_WRITEMASK: 0x0B72; + readonly DEPTH_CLEAR_VALUE: 0x0B73; + readonly DEPTH_FUNC: 0x0B74; + readonly STENCIL_CLEAR_VALUE: 0x0B91; + readonly STENCIL_FUNC: 0x0B92; + readonly STENCIL_FAIL: 0x0B94; + readonly STENCIL_PASS_DEPTH_FAIL: 0x0B95; + readonly STENCIL_PASS_DEPTH_PASS: 0x0B96; + readonly STENCIL_REF: 0x0B97; + readonly STENCIL_VALUE_MASK: 0x0B93; + readonly STENCIL_WRITEMASK: 0x0B98; + readonly STENCIL_BACK_FUNC: 0x8800; + readonly STENCIL_BACK_FAIL: 0x8801; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802; + readonly STENCIL_BACK_PASS_DEPTH_PASS: 0x8803; + readonly STENCIL_BACK_REF: 0x8CA3; + readonly STENCIL_BACK_VALUE_MASK: 0x8CA4; + readonly STENCIL_BACK_WRITEMASK: 0x8CA5; + readonly VIEWPORT: 0x0BA2; + readonly SCISSOR_BOX: 0x0C10; + readonly COLOR_CLEAR_VALUE: 0x0C22; + readonly COLOR_WRITEMASK: 0x0C23; + readonly UNPACK_ALIGNMENT: 0x0CF5; + readonly PACK_ALIGNMENT: 0x0D05; + readonly MAX_TEXTURE_SIZE: 0x0D33; + readonly MAX_VIEWPORT_DIMS: 0x0D3A; + readonly SUBPIXEL_BITS: 0x0D50; + readonly RED_BITS: 0x0D52; + readonly GREEN_BITS: 0x0D53; + readonly BLUE_BITS: 0x0D54; + readonly ALPHA_BITS: 0x0D55; + readonly DEPTH_BITS: 0x0D56; + readonly STENCIL_BITS: 0x0D57; + readonly POLYGON_OFFSET_UNITS: 0x2A00; + readonly POLYGON_OFFSET_FACTOR: 0x8038; + readonly TEXTURE_BINDING_2D: 0x8069; + readonly SAMPLE_BUFFERS: 0x80A8; + readonly SAMPLES: 0x80A9; + readonly SAMPLE_COVERAGE_VALUE: 0x80AA; + readonly SAMPLE_COVERAGE_INVERT: 0x80AB; + readonly COMPRESSED_TEXTURE_FORMATS: 0x86A3; + readonly DONT_CARE: 0x1100; + readonly FASTEST: 0x1101; + readonly NICEST: 0x1102; + readonly GENERATE_MIPMAP_HINT: 0x8192; + readonly BYTE: 0x1400; + readonly UNSIGNED_BYTE: 0x1401; + readonly SHORT: 0x1402; + readonly UNSIGNED_SHORT: 0x1403; + readonly INT: 0x1404; + readonly UNSIGNED_INT: 0x1405; + readonly FLOAT: 0x1406; + readonly DEPTH_COMPONENT: 0x1902; + readonly ALPHA: 0x1906; + readonly RGB: 0x1907; + readonly RGBA: 0x1908; + readonly LUMINANCE: 0x1909; + readonly LUMINANCE_ALPHA: 0x190A; + readonly UNSIGNED_SHORT_4_4_4_4: 0x8033; + readonly UNSIGNED_SHORT_5_5_5_1: 0x8034; + readonly UNSIGNED_SHORT_5_6_5: 0x8363; + readonly FRAGMENT_SHADER: 0x8B30; + readonly VERTEX_SHADER: 0x8B31; + readonly MAX_VERTEX_ATTRIBS: 0x8869; + readonly MAX_VERTEX_UNIFORM_VECTORS: 0x8DFB; + readonly MAX_VARYING_VECTORS: 0x8DFC; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8B4D; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8B4C; + readonly MAX_TEXTURE_IMAGE_UNITS: 0x8872; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: 0x8DFD; + readonly SHADER_TYPE: 0x8B4F; + readonly DELETE_STATUS: 0x8B80; + readonly LINK_STATUS: 0x8B82; + readonly VALIDATE_STATUS: 0x8B83; + readonly ATTACHED_SHADERS: 0x8B85; + readonly ACTIVE_UNIFORMS: 0x8B86; + readonly ACTIVE_ATTRIBUTES: 0x8B89; + readonly SHADING_LANGUAGE_VERSION: 0x8B8C; + readonly CURRENT_PROGRAM: 0x8B8D; + readonly NEVER: 0x0200; + readonly LESS: 0x0201; + readonly EQUAL: 0x0202; + readonly LEQUAL: 0x0203; + readonly GREATER: 0x0204; + readonly NOTEQUAL: 0x0205; + readonly GEQUAL: 0x0206; + readonly ALWAYS: 0x0207; + readonly KEEP: 0x1E00; + readonly REPLACE: 0x1E01; + readonly INCR: 0x1E02; + readonly DECR: 0x1E03; + readonly INVERT: 0x150A; + readonly INCR_WRAP: 0x8507; + readonly DECR_WRAP: 0x8508; + readonly VENDOR: 0x1F00; + readonly RENDERER: 0x1F01; + readonly VERSION: 0x1F02; + readonly NEAREST: 0x2600; + readonly LINEAR: 0x2601; + readonly NEAREST_MIPMAP_NEAREST: 0x2700; + readonly LINEAR_MIPMAP_NEAREST: 0x2701; + readonly NEAREST_MIPMAP_LINEAR: 0x2702; + readonly LINEAR_MIPMAP_LINEAR: 0x2703; + readonly TEXTURE_MAG_FILTER: 0x2800; + readonly TEXTURE_MIN_FILTER: 0x2801; + readonly TEXTURE_WRAP_S: 0x2802; + readonly TEXTURE_WRAP_T: 0x2803; + readonly TEXTURE_2D: 0x0DE1; + readonly TEXTURE: 0x1702; + readonly TEXTURE_CUBE_MAP: 0x8513; + readonly TEXTURE_BINDING_CUBE_MAP: 0x8514; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851A; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: 0x851C; + readonly TEXTURE0: 0x84C0; + readonly TEXTURE1: 0x84C1; + readonly TEXTURE2: 0x84C2; + readonly TEXTURE3: 0x84C3; + readonly TEXTURE4: 0x84C4; + readonly TEXTURE5: 0x84C5; + readonly TEXTURE6: 0x84C6; + readonly TEXTURE7: 0x84C7; + readonly TEXTURE8: 0x84C8; + readonly TEXTURE9: 0x84C9; + readonly TEXTURE10: 0x84CA; + readonly TEXTURE11: 0x84CB; + readonly TEXTURE12: 0x84CC; + readonly TEXTURE13: 0x84CD; + readonly TEXTURE14: 0x84CE; + readonly TEXTURE15: 0x84CF; + readonly TEXTURE16: 0x84D0; + readonly TEXTURE17: 0x84D1; + readonly TEXTURE18: 0x84D2; + readonly TEXTURE19: 0x84D3; + readonly TEXTURE20: 0x84D4; + readonly TEXTURE21: 0x84D5; + readonly TEXTURE22: 0x84D6; + readonly TEXTURE23: 0x84D7; + readonly TEXTURE24: 0x84D8; + readonly TEXTURE25: 0x84D9; + readonly TEXTURE26: 0x84DA; + readonly TEXTURE27: 0x84DB; + readonly TEXTURE28: 0x84DC; + readonly TEXTURE29: 0x84DD; + readonly TEXTURE30: 0x84DE; + readonly TEXTURE31: 0x84DF; + readonly ACTIVE_TEXTURE: 0x84E0; + readonly REPEAT: 0x2901; + readonly CLAMP_TO_EDGE: 0x812F; + readonly MIRRORED_REPEAT: 0x8370; + readonly FLOAT_VEC2: 0x8B50; + readonly FLOAT_VEC3: 0x8B51; + readonly FLOAT_VEC4: 0x8B52; + readonly INT_VEC2: 0x8B53; + readonly INT_VEC3: 0x8B54; + readonly INT_VEC4: 0x8B55; + readonly BOOL: 0x8B56; + readonly BOOL_VEC2: 0x8B57; + readonly BOOL_VEC3: 0x8B58; + readonly BOOL_VEC4: 0x8B59; + readonly FLOAT_MAT2: 0x8B5A; + readonly FLOAT_MAT3: 0x8B5B; + readonly FLOAT_MAT4: 0x8B5C; + readonly SAMPLER_2D: 0x8B5E; + readonly SAMPLER_CUBE: 0x8B60; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622; + readonly VERTEX_ATTRIB_ARRAY_SIZE: 0x8623; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624; + readonly VERTEX_ATTRIB_ARRAY_TYPE: 0x8625; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886A; + readonly VERTEX_ATTRIB_ARRAY_POINTER: 0x8645; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889F; + readonly IMPLEMENTATION_COLOR_READ_TYPE: 0x8B9A; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: 0x8B9B; + readonly COMPILE_STATUS: 0x8B81; + readonly LOW_FLOAT: 0x8DF0; + readonly MEDIUM_FLOAT: 0x8DF1; + readonly HIGH_FLOAT: 0x8DF2; + readonly LOW_INT: 0x8DF3; + readonly MEDIUM_INT: 0x8DF4; + readonly HIGH_INT: 0x8DF5; + readonly FRAMEBUFFER: 0x8D40; + readonly RENDERBUFFER: 0x8D41; + readonly RGBA4: 0x8056; + readonly RGB5_A1: 0x8057; + readonly RGB565: 0x8D62; + readonly DEPTH_COMPONENT16: 0x81A5; + readonly STENCIL_INDEX8: 0x8D48; + readonly DEPTH_STENCIL: 0x84F9; + readonly RENDERBUFFER_WIDTH: 0x8D42; + readonly RENDERBUFFER_HEIGHT: 0x8D43; + readonly RENDERBUFFER_INTERNAL_FORMAT: 0x8D44; + readonly RENDERBUFFER_RED_SIZE: 0x8D50; + readonly RENDERBUFFER_GREEN_SIZE: 0x8D51; + readonly RENDERBUFFER_BLUE_SIZE: 0x8D52; + readonly RENDERBUFFER_ALPHA_SIZE: 0x8D53; + readonly RENDERBUFFER_DEPTH_SIZE: 0x8D54; + readonly RENDERBUFFER_STENCIL_SIZE: 0x8D55; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8CD0; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8CD1; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8CD2; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8CD3; + readonly COLOR_ATTACHMENT0: 0x8CE0; + readonly DEPTH_ATTACHMENT: 0x8D00; + readonly STENCIL_ATTACHMENT: 0x8D20; + readonly DEPTH_STENCIL_ATTACHMENT: 0x821A; + readonly NONE: 0; + readonly FRAMEBUFFER_COMPLETE: 0x8CD5; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8CD6; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8CD7; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8CD9; + readonly FRAMEBUFFER_UNSUPPORTED: 0x8CDD; + readonly FRAMEBUFFER_BINDING: 0x8CA6; + readonly RENDERBUFFER_BINDING: 0x8CA7; + readonly MAX_RENDERBUFFER_SIZE: 0x84E8; + readonly INVALID_FRAMEBUFFER_OPERATION: 0x0506; + readonly UNPACK_FLIP_Y_WEBGL: 0x9240; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241; + readonly CONTEXT_LOST_WEBGL: 0x9242; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243; + readonly BROWSER_DEFAULT_WEBGL: 0x9244; }; interface WebGL2RenderingContextBase { @@ -4223,269 +4260,269 @@ interface WebGL2RenderingContextBase { vertexAttribI4uiv(index: GLuint, values: Uint32List): void; vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr): void; waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void; - readonly ACTIVE_UNIFORM_BLOCKS: GLenum; - readonly ALREADY_SIGNALED: GLenum; - readonly ANY_SAMPLES_PASSED: GLenum; - readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum; - readonly COLOR: GLenum; - readonly COLOR_ATTACHMENT1: GLenum; - readonly COLOR_ATTACHMENT10: GLenum; - readonly COLOR_ATTACHMENT11: GLenum; - readonly COLOR_ATTACHMENT12: GLenum; - readonly COLOR_ATTACHMENT13: GLenum; - readonly COLOR_ATTACHMENT14: GLenum; - readonly COLOR_ATTACHMENT15: GLenum; - readonly COLOR_ATTACHMENT2: GLenum; - readonly COLOR_ATTACHMENT3: GLenum; - readonly COLOR_ATTACHMENT4: GLenum; - readonly COLOR_ATTACHMENT5: GLenum; - readonly COLOR_ATTACHMENT6: GLenum; - readonly COLOR_ATTACHMENT7: GLenum; - readonly COLOR_ATTACHMENT8: GLenum; - readonly COLOR_ATTACHMENT9: GLenum; - readonly COMPARE_REF_TO_TEXTURE: GLenum; - readonly CONDITION_SATISFIED: GLenum; - readonly COPY_READ_BUFFER: GLenum; - readonly COPY_READ_BUFFER_BINDING: GLenum; - readonly COPY_WRITE_BUFFER: GLenum; - readonly COPY_WRITE_BUFFER_BINDING: GLenum; - readonly CURRENT_QUERY: GLenum; - readonly DEPTH: GLenum; - readonly DEPTH24_STENCIL8: GLenum; - readonly DEPTH32F_STENCIL8: GLenum; - readonly DEPTH_COMPONENT24: GLenum; - readonly DEPTH_COMPONENT32F: GLenum; - readonly DRAW_BUFFER0: GLenum; - readonly DRAW_BUFFER1: GLenum; - readonly DRAW_BUFFER10: GLenum; - readonly DRAW_BUFFER11: GLenum; - readonly DRAW_BUFFER12: GLenum; - readonly DRAW_BUFFER13: GLenum; - readonly DRAW_BUFFER14: GLenum; - readonly DRAW_BUFFER15: GLenum; - readonly DRAW_BUFFER2: GLenum; - readonly DRAW_BUFFER3: GLenum; - readonly DRAW_BUFFER4: GLenum; - readonly DRAW_BUFFER5: GLenum; - readonly DRAW_BUFFER6: GLenum; - readonly DRAW_BUFFER7: GLenum; - readonly DRAW_BUFFER8: GLenum; - readonly DRAW_BUFFER9: GLenum; - readonly DRAW_FRAMEBUFFER: GLenum; - readonly DRAW_FRAMEBUFFER_BINDING: GLenum; - readonly DYNAMIC_COPY: GLenum; - readonly DYNAMIC_READ: GLenum; - readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum; - readonly FLOAT_MAT2x3: GLenum; - readonly FLOAT_MAT2x4: GLenum; - readonly FLOAT_MAT3x2: GLenum; - readonly FLOAT_MAT3x4: GLenum; - readonly FLOAT_MAT4x2: GLenum; - readonly FLOAT_MAT4x3: GLenum; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum; - readonly FRAMEBUFFER_DEFAULT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum; - readonly HALF_FLOAT: GLenum; - readonly INTERLEAVED_ATTRIBS: GLenum; - readonly INT_2_10_10_10_REV: GLenum; - readonly INT_SAMPLER_2D: GLenum; - readonly INT_SAMPLER_2D_ARRAY: GLenum; - readonly INT_SAMPLER_3D: GLenum; - readonly INT_SAMPLER_CUBE: GLenum; - readonly INVALID_INDEX: GLenum; - readonly MAX: GLenum; - readonly MAX_3D_TEXTURE_SIZE: GLenum; - readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum; - readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum; - readonly MAX_COLOR_ATTACHMENTS: GLenum; - readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum; - readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum; - readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum; - readonly MAX_DRAW_BUFFERS: GLenum; - readonly MAX_ELEMENTS_INDICES: GLenum; - readonly MAX_ELEMENTS_VERTICES: GLenum; - readonly MAX_ELEMENT_INDEX: GLenum; - readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum; - readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum; - readonly MAX_SAMPLES: GLenum; - readonly MAX_SERVER_WAIT_TIMEOUT: GLenum; - readonly MAX_TEXTURE_LOD_BIAS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum; - readonly MAX_UNIFORM_BLOCK_SIZE: GLenum; - readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum; - readonly MAX_VARYING_COMPONENTS: GLenum; - readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum; - readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum; - readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum; - readonly MIN: GLenum; - readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum; - readonly OBJECT_TYPE: GLenum; - readonly PACK_ROW_LENGTH: GLenum; - readonly PACK_SKIP_PIXELS: GLenum; - readonly PACK_SKIP_ROWS: GLenum; - readonly PIXEL_PACK_BUFFER: GLenum; - readonly PIXEL_PACK_BUFFER_BINDING: GLenum; - readonly PIXEL_UNPACK_BUFFER: GLenum; - readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum; - readonly QUERY_RESULT: GLenum; - readonly QUERY_RESULT_AVAILABLE: GLenum; - readonly R11F_G11F_B10F: GLenum; - readonly R16F: GLenum; - readonly R16I: GLenum; - readonly R16UI: GLenum; - readonly R32F: GLenum; - readonly R32I: GLenum; - readonly R32UI: GLenum; - readonly R8: GLenum; - readonly R8I: GLenum; - readonly R8UI: GLenum; - readonly R8_SNORM: GLenum; - readonly RASTERIZER_DISCARD: GLenum; - readonly READ_BUFFER: GLenum; - readonly READ_FRAMEBUFFER: GLenum; - readonly READ_FRAMEBUFFER_BINDING: GLenum; - readonly RED: GLenum; - readonly RED_INTEGER: GLenum; - readonly RENDERBUFFER_SAMPLES: GLenum; - readonly RG: GLenum; - readonly RG16F: GLenum; - readonly RG16I: GLenum; - readonly RG16UI: GLenum; - readonly RG32F: GLenum; - readonly RG32I: GLenum; - readonly RG32UI: GLenum; - readonly RG8: GLenum; - readonly RG8I: GLenum; - readonly RG8UI: GLenum; - readonly RG8_SNORM: GLenum; - readonly RGB10_A2: GLenum; - readonly RGB10_A2UI: GLenum; - readonly RGB16F: GLenum; - readonly RGB16I: GLenum; - readonly RGB16UI: GLenum; - readonly RGB32F: GLenum; - readonly RGB32I: GLenum; - readonly RGB32UI: GLenum; - readonly RGB8: GLenum; - readonly RGB8I: GLenum; - readonly RGB8UI: GLenum; - readonly RGB8_SNORM: GLenum; - readonly RGB9_E5: GLenum; - readonly RGBA16F: GLenum; - readonly RGBA16I: GLenum; - readonly RGBA16UI: GLenum; - readonly RGBA32F: GLenum; - readonly RGBA32I: GLenum; - readonly RGBA32UI: GLenum; - readonly RGBA8: GLenum; - readonly RGBA8I: GLenum; - readonly RGBA8UI: GLenum; - readonly RGBA8_SNORM: GLenum; - readonly RGBA_INTEGER: GLenum; - readonly RGB_INTEGER: GLenum; - readonly RG_INTEGER: GLenum; - readonly SAMPLER_2D_ARRAY: GLenum; - readonly SAMPLER_2D_ARRAY_SHADOW: GLenum; - readonly SAMPLER_2D_SHADOW: GLenum; - readonly SAMPLER_3D: GLenum; - readonly SAMPLER_BINDING: GLenum; - readonly SAMPLER_CUBE_SHADOW: GLenum; - readonly SEPARATE_ATTRIBS: GLenum; - readonly SIGNALED: GLenum; - readonly SIGNED_NORMALIZED: GLenum; - readonly SRGB: GLenum; - readonly SRGB8: GLenum; - readonly SRGB8_ALPHA8: GLenum; - readonly STATIC_COPY: GLenum; - readonly STATIC_READ: GLenum; - readonly STENCIL: GLenum; - readonly STREAM_COPY: GLenum; - readonly STREAM_READ: GLenum; - readonly SYNC_CONDITION: GLenum; - readonly SYNC_FENCE: GLenum; - readonly SYNC_FLAGS: GLenum; - readonly SYNC_FLUSH_COMMANDS_BIT: GLenum; - readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum; - readonly SYNC_STATUS: GLenum; - readonly TEXTURE_2D_ARRAY: GLenum; - readonly TEXTURE_3D: GLenum; - readonly TEXTURE_BASE_LEVEL: GLenum; - readonly TEXTURE_BINDING_2D_ARRAY: GLenum; - readonly TEXTURE_BINDING_3D: GLenum; - readonly TEXTURE_COMPARE_FUNC: GLenum; - readonly TEXTURE_COMPARE_MODE: GLenum; - readonly TEXTURE_IMMUTABLE_FORMAT: GLenum; - readonly TEXTURE_IMMUTABLE_LEVELS: GLenum; - readonly TEXTURE_MAX_LEVEL: GLenum; - readonly TEXTURE_MAX_LOD: GLenum; - readonly TEXTURE_MIN_LOD: GLenum; - readonly TEXTURE_WRAP_R: GLenum; - readonly TIMEOUT_EXPIRED: GLenum; - readonly TIMEOUT_IGNORED: GLint64; - readonly TRANSFORM_FEEDBACK: GLenum; - readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum; - readonly TRANSFORM_FEEDBACK_BINDING: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum; - readonly TRANSFORM_FEEDBACK_PAUSED: GLenum; - readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum; - readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum; - readonly UNIFORM_ARRAY_STRIDE: GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum; - readonly UNIFORM_BLOCK_BINDING: GLenum; - readonly UNIFORM_BLOCK_DATA_SIZE: GLenum; - readonly UNIFORM_BLOCK_INDEX: GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum; - readonly UNIFORM_BUFFER: GLenum; - readonly UNIFORM_BUFFER_BINDING: GLenum; - readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum; - readonly UNIFORM_BUFFER_SIZE: GLenum; - readonly UNIFORM_BUFFER_START: GLenum; - readonly UNIFORM_IS_ROW_MAJOR: GLenum; - readonly UNIFORM_MATRIX_STRIDE: GLenum; - readonly UNIFORM_OFFSET: GLenum; - readonly UNIFORM_SIZE: GLenum; - readonly UNIFORM_TYPE: GLenum; - readonly UNPACK_IMAGE_HEIGHT: GLenum; - readonly UNPACK_ROW_LENGTH: GLenum; - readonly UNPACK_SKIP_IMAGES: GLenum; - readonly UNPACK_SKIP_PIXELS: GLenum; - readonly UNPACK_SKIP_ROWS: GLenum; - readonly UNSIGNALED: GLenum; - readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum; - readonly UNSIGNED_INT_24_8: GLenum; - readonly UNSIGNED_INT_2_10_10_10_REV: GLenum; - readonly UNSIGNED_INT_5_9_9_9_REV: GLenum; - readonly UNSIGNED_INT_SAMPLER_2D: GLenum; - readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum; - readonly UNSIGNED_INT_SAMPLER_3D: GLenum; - readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum; - readonly UNSIGNED_INT_VEC2: GLenum; - readonly UNSIGNED_INT_VEC3: GLenum; - readonly UNSIGNED_INT_VEC4: GLenum; - readonly UNSIGNED_NORMALIZED: GLenum; - readonly VERTEX_ARRAY_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum; - readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum; - readonly WAIT_FAILED: GLenum; + readonly READ_BUFFER: 0x0C02; + readonly UNPACK_ROW_LENGTH: 0x0CF2; + readonly UNPACK_SKIP_ROWS: 0x0CF3; + readonly UNPACK_SKIP_PIXELS: 0x0CF4; + readonly PACK_ROW_LENGTH: 0x0D02; + readonly PACK_SKIP_ROWS: 0x0D03; + readonly PACK_SKIP_PIXELS: 0x0D04; + readonly COLOR: 0x1800; + readonly DEPTH: 0x1801; + readonly STENCIL: 0x1802; + readonly RED: 0x1903; + readonly RGB8: 0x8051; + readonly RGBA8: 0x8058; + readonly RGB10_A2: 0x8059; + readonly TEXTURE_BINDING_3D: 0x806A; + readonly UNPACK_SKIP_IMAGES: 0x806D; + readonly UNPACK_IMAGE_HEIGHT: 0x806E; + readonly TEXTURE_3D: 0x806F; + readonly TEXTURE_WRAP_R: 0x8072; + readonly MAX_3D_TEXTURE_SIZE: 0x8073; + readonly UNSIGNED_INT_2_10_10_10_REV: 0x8368; + readonly MAX_ELEMENTS_VERTICES: 0x80E8; + readonly MAX_ELEMENTS_INDICES: 0x80E9; + readonly TEXTURE_MIN_LOD: 0x813A; + readonly TEXTURE_MAX_LOD: 0x813B; + readonly TEXTURE_BASE_LEVEL: 0x813C; + readonly TEXTURE_MAX_LEVEL: 0x813D; + readonly MIN: 0x8007; + readonly MAX: 0x8008; + readonly DEPTH_COMPONENT24: 0x81A6; + readonly MAX_TEXTURE_LOD_BIAS: 0x84FD; + readonly TEXTURE_COMPARE_MODE: 0x884C; + readonly TEXTURE_COMPARE_FUNC: 0x884D; + readonly CURRENT_QUERY: 0x8865; + readonly QUERY_RESULT: 0x8866; + readonly QUERY_RESULT_AVAILABLE: 0x8867; + readonly STREAM_READ: 0x88E1; + readonly STREAM_COPY: 0x88E2; + readonly STATIC_READ: 0x88E5; + readonly STATIC_COPY: 0x88E6; + readonly DYNAMIC_READ: 0x88E9; + readonly DYNAMIC_COPY: 0x88EA; + readonly MAX_DRAW_BUFFERS: 0x8824; + readonly DRAW_BUFFER0: 0x8825; + readonly DRAW_BUFFER1: 0x8826; + readonly DRAW_BUFFER2: 0x8827; + readonly DRAW_BUFFER3: 0x8828; + readonly DRAW_BUFFER4: 0x8829; + readonly DRAW_BUFFER5: 0x882A; + readonly DRAW_BUFFER6: 0x882B; + readonly DRAW_BUFFER7: 0x882C; + readonly DRAW_BUFFER8: 0x882D; + readonly DRAW_BUFFER9: 0x882E; + readonly DRAW_BUFFER10: 0x882F; + readonly DRAW_BUFFER11: 0x8830; + readonly DRAW_BUFFER12: 0x8831; + readonly DRAW_BUFFER13: 0x8832; + readonly DRAW_BUFFER14: 0x8833; + readonly DRAW_BUFFER15: 0x8834; + readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: 0x8B49; + readonly MAX_VERTEX_UNIFORM_COMPONENTS: 0x8B4A; + readonly SAMPLER_3D: 0x8B5F; + readonly SAMPLER_2D_SHADOW: 0x8B62; + readonly FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8B8B; + readonly PIXEL_PACK_BUFFER: 0x88EB; + readonly PIXEL_UNPACK_BUFFER: 0x88EC; + readonly PIXEL_PACK_BUFFER_BINDING: 0x88ED; + readonly PIXEL_UNPACK_BUFFER_BINDING: 0x88EF; + readonly FLOAT_MAT2x3: 0x8B65; + readonly FLOAT_MAT2x4: 0x8B66; + readonly FLOAT_MAT3x2: 0x8B67; + readonly FLOAT_MAT3x4: 0x8B68; + readonly FLOAT_MAT4x2: 0x8B69; + readonly FLOAT_MAT4x3: 0x8B6A; + readonly SRGB: 0x8C40; + readonly SRGB8: 0x8C41; + readonly SRGB8_ALPHA8: 0x8C43; + readonly COMPARE_REF_TO_TEXTURE: 0x884E; + readonly RGBA32F: 0x8814; + readonly RGB32F: 0x8815; + readonly RGBA16F: 0x881A; + readonly RGB16F: 0x881B; + readonly VERTEX_ATTRIB_ARRAY_INTEGER: 0x88FD; + readonly MAX_ARRAY_TEXTURE_LAYERS: 0x88FF; + readonly MIN_PROGRAM_TEXEL_OFFSET: 0x8904; + readonly MAX_PROGRAM_TEXEL_OFFSET: 0x8905; + readonly MAX_VARYING_COMPONENTS: 0x8B4B; + readonly TEXTURE_2D_ARRAY: 0x8C1A; + readonly TEXTURE_BINDING_2D_ARRAY: 0x8C1D; + readonly R11F_G11F_B10F: 0x8C3A; + readonly UNSIGNED_INT_10F_11F_11F_REV: 0x8C3B; + readonly RGB9_E5: 0x8C3D; + readonly UNSIGNED_INT_5_9_9_9_REV: 0x8C3E; + readonly TRANSFORM_FEEDBACK_BUFFER_MODE: 0x8C7F; + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 0x8C80; + readonly TRANSFORM_FEEDBACK_VARYINGS: 0x8C83; + readonly TRANSFORM_FEEDBACK_BUFFER_START: 0x8C84; + readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: 0x8C85; + readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 0x8C88; + readonly RASTERIZER_DISCARD: 0x8C89; + readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 0x8C8A; + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 0x8C8B; + readonly INTERLEAVED_ATTRIBS: 0x8C8C; + readonly SEPARATE_ATTRIBS: 0x8C8D; + readonly TRANSFORM_FEEDBACK_BUFFER: 0x8C8E; + readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: 0x8C8F; + readonly RGBA32UI: 0x8D70; + readonly RGB32UI: 0x8D71; + readonly RGBA16UI: 0x8D76; + readonly RGB16UI: 0x8D77; + readonly RGBA8UI: 0x8D7C; + readonly RGB8UI: 0x8D7D; + readonly RGBA32I: 0x8D82; + readonly RGB32I: 0x8D83; + readonly RGBA16I: 0x8D88; + readonly RGB16I: 0x8D89; + readonly RGBA8I: 0x8D8E; + readonly RGB8I: 0x8D8F; + readonly RED_INTEGER: 0x8D94; + readonly RGB_INTEGER: 0x8D98; + readonly RGBA_INTEGER: 0x8D99; + readonly SAMPLER_2D_ARRAY: 0x8DC1; + readonly SAMPLER_2D_ARRAY_SHADOW: 0x8DC4; + readonly SAMPLER_CUBE_SHADOW: 0x8DC5; + readonly UNSIGNED_INT_VEC2: 0x8DC6; + readonly UNSIGNED_INT_VEC3: 0x8DC7; + readonly UNSIGNED_INT_VEC4: 0x8DC8; + readonly INT_SAMPLER_2D: 0x8DCA; + readonly INT_SAMPLER_3D: 0x8DCB; + readonly INT_SAMPLER_CUBE: 0x8DCC; + readonly INT_SAMPLER_2D_ARRAY: 0x8DCF; + readonly UNSIGNED_INT_SAMPLER_2D: 0x8DD2; + readonly UNSIGNED_INT_SAMPLER_3D: 0x8DD3; + readonly UNSIGNED_INT_SAMPLER_CUBE: 0x8DD4; + readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: 0x8DD7; + readonly DEPTH_COMPONENT32F: 0x8CAC; + readonly DEPTH32F_STENCIL8: 0x8CAD; + readonly FLOAT_32_UNSIGNED_INT_24_8_REV: 0x8DAD; + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 0x8210; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 0x8211; + readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: 0x8212; + readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 0x8213; + readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 0x8214; + readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 0x8215; + readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 0x8216; + readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 0x8217; + readonly FRAMEBUFFER_DEFAULT: 0x8218; + readonly UNSIGNED_INT_24_8: 0x84FA; + readonly DEPTH24_STENCIL8: 0x88F0; + readonly UNSIGNED_NORMALIZED: 0x8C17; + readonly DRAW_FRAMEBUFFER_BINDING: 0x8CA6; + readonly READ_FRAMEBUFFER: 0x8CA8; + readonly DRAW_FRAMEBUFFER: 0x8CA9; + readonly READ_FRAMEBUFFER_BINDING: 0x8CAA; + readonly RENDERBUFFER_SAMPLES: 0x8CAB; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 0x8CD4; + readonly MAX_COLOR_ATTACHMENTS: 0x8CDF; + readonly COLOR_ATTACHMENT1: 0x8CE1; + readonly COLOR_ATTACHMENT2: 0x8CE2; + readonly COLOR_ATTACHMENT3: 0x8CE3; + readonly COLOR_ATTACHMENT4: 0x8CE4; + readonly COLOR_ATTACHMENT5: 0x8CE5; + readonly COLOR_ATTACHMENT6: 0x8CE6; + readonly COLOR_ATTACHMENT7: 0x8CE7; + readonly COLOR_ATTACHMENT8: 0x8CE8; + readonly COLOR_ATTACHMENT9: 0x8CE9; + readonly COLOR_ATTACHMENT10: 0x8CEA; + readonly COLOR_ATTACHMENT11: 0x8CEB; + readonly COLOR_ATTACHMENT12: 0x8CEC; + readonly COLOR_ATTACHMENT13: 0x8CED; + readonly COLOR_ATTACHMENT14: 0x8CEE; + readonly COLOR_ATTACHMENT15: 0x8CEF; + readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8D56; + readonly MAX_SAMPLES: 0x8D57; + readonly HALF_FLOAT: 0x140B; + readonly RG: 0x8227; + readonly RG_INTEGER: 0x8228; + readonly R8: 0x8229; + readonly RG8: 0x822B; + readonly R16F: 0x822D; + readonly R32F: 0x822E; + readonly RG16F: 0x822F; + readonly RG32F: 0x8230; + readonly R8I: 0x8231; + readonly R8UI: 0x8232; + readonly R16I: 0x8233; + readonly R16UI: 0x8234; + readonly R32I: 0x8235; + readonly R32UI: 0x8236; + readonly RG8I: 0x8237; + readonly RG8UI: 0x8238; + readonly RG16I: 0x8239; + readonly RG16UI: 0x823A; + readonly RG32I: 0x823B; + readonly RG32UI: 0x823C; + readonly VERTEX_ARRAY_BINDING: 0x85B5; + readonly R8_SNORM: 0x8F94; + readonly RG8_SNORM: 0x8F95; + readonly RGB8_SNORM: 0x8F96; + readonly RGBA8_SNORM: 0x8F97; + readonly SIGNED_NORMALIZED: 0x8F9C; + readonly COPY_READ_BUFFER: 0x8F36; + readonly COPY_WRITE_BUFFER: 0x8F37; + readonly COPY_READ_BUFFER_BINDING: 0x8F36; + readonly COPY_WRITE_BUFFER_BINDING: 0x8F37; + readonly UNIFORM_BUFFER: 0x8A11; + readonly UNIFORM_BUFFER_BINDING: 0x8A28; + readonly UNIFORM_BUFFER_START: 0x8A29; + readonly UNIFORM_BUFFER_SIZE: 0x8A2A; + readonly MAX_VERTEX_UNIFORM_BLOCKS: 0x8A2B; + readonly MAX_FRAGMENT_UNIFORM_BLOCKS: 0x8A2D; + readonly MAX_COMBINED_UNIFORM_BLOCKS: 0x8A2E; + readonly MAX_UNIFORM_BUFFER_BINDINGS: 0x8A2F; + readonly MAX_UNIFORM_BLOCK_SIZE: 0x8A30; + readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 0x8A31; + readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 0x8A33; + readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: 0x8A34; + readonly ACTIVE_UNIFORM_BLOCKS: 0x8A36; + readonly UNIFORM_TYPE: 0x8A37; + readonly UNIFORM_SIZE: 0x8A38; + readonly UNIFORM_BLOCK_INDEX: 0x8A3A; + readonly UNIFORM_OFFSET: 0x8A3B; + readonly UNIFORM_ARRAY_STRIDE: 0x8A3C; + readonly UNIFORM_MATRIX_STRIDE: 0x8A3D; + readonly UNIFORM_IS_ROW_MAJOR: 0x8A3E; + readonly UNIFORM_BLOCK_BINDING: 0x8A3F; + readonly UNIFORM_BLOCK_DATA_SIZE: 0x8A40; + readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: 0x8A42; + readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 0x8A43; + readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 0x8A44; + readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 0x8A46; + readonly INVALID_INDEX: 0xFFFFFFFF; + readonly MAX_VERTEX_OUTPUT_COMPONENTS: 0x9122; + readonly MAX_FRAGMENT_INPUT_COMPONENTS: 0x9125; + readonly MAX_SERVER_WAIT_TIMEOUT: 0x9111; + readonly OBJECT_TYPE: 0x9112; + readonly SYNC_CONDITION: 0x9113; + readonly SYNC_STATUS: 0x9114; + readonly SYNC_FLAGS: 0x9115; + readonly SYNC_FENCE: 0x9116; + readonly SYNC_GPU_COMMANDS_COMPLETE: 0x9117; + readonly UNSIGNALED: 0x9118; + readonly SIGNALED: 0x9119; + readonly ALREADY_SIGNALED: 0x911A; + readonly TIMEOUT_EXPIRED: 0x911B; + readonly CONDITION_SATISFIED: 0x911C; + readonly WAIT_FAILED: 0x911D; + readonly SYNC_FLUSH_COMMANDS_BIT: 0x00000001; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR: 0x88FE; + readonly ANY_SAMPLES_PASSED: 0x8C2F; + readonly ANY_SAMPLES_PASSED_CONSERVATIVE: 0x8D6A; + readonly SAMPLER_BINDING: 0x8919; + readonly RGB10_A2UI: 0x906F; + readonly INT_2_10_10_10_REV: 0x8D9F; + readonly TRANSFORM_FEEDBACK: 0x8E22; + readonly TRANSFORM_FEEDBACK_PAUSED: 0x8E23; + readonly TRANSFORM_FEEDBACK_ACTIVE: 0x8E24; + readonly TRANSFORM_FEEDBACK_BINDING: 0x8E25; + readonly TEXTURE_IMMUTABLE_FORMAT: 0x912F; + readonly MAX_ELEMENT_INDEX: 0x8D6B; + readonly TEXTURE_IMMUTABLE_LEVELS: 0x82DF; + readonly TIMEOUT_IGNORED: -1; + readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: 0x9247; } interface WebGL2RenderingContextOverloads { @@ -4597,302 +4634,302 @@ interface WebGLRenderingContext extends WebGLRenderingContextBase, WebGLRenderin declare var WebGLRenderingContext: { prototype: WebGLRenderingContext; new(): WebGLRenderingContext; - readonly ACTIVE_ATTRIBUTES: GLenum; - readonly ACTIVE_TEXTURE: GLenum; - readonly ACTIVE_UNIFORMS: GLenum; - readonly ALIASED_LINE_WIDTH_RANGE: GLenum; - readonly ALIASED_POINT_SIZE_RANGE: GLenum; - readonly ALPHA: GLenum; - readonly ALPHA_BITS: GLenum; - readonly ALWAYS: GLenum; - readonly ARRAY_BUFFER: GLenum; - readonly ARRAY_BUFFER_BINDING: GLenum; - readonly ATTACHED_SHADERS: GLenum; - readonly BACK: GLenum; - readonly BLEND: GLenum; - readonly BLEND_COLOR: GLenum; - readonly BLEND_DST_ALPHA: GLenum; - readonly BLEND_DST_RGB: GLenum; - readonly BLEND_EQUATION: GLenum; - readonly BLEND_EQUATION_ALPHA: GLenum; - readonly BLEND_EQUATION_RGB: GLenum; - readonly BLEND_SRC_ALPHA: GLenum; - readonly BLEND_SRC_RGB: GLenum; - readonly BLUE_BITS: GLenum; - readonly BOOL: GLenum; - readonly BOOL_VEC2: GLenum; - readonly BOOL_VEC3: GLenum; - readonly BOOL_VEC4: GLenum; - readonly BROWSER_DEFAULT_WEBGL: GLenum; - readonly BUFFER_SIZE: GLenum; - readonly BUFFER_USAGE: GLenum; - readonly BYTE: GLenum; - readonly CCW: GLenum; - readonly CLAMP_TO_EDGE: GLenum; - readonly COLOR_ATTACHMENT0: GLenum; - readonly COLOR_BUFFER_BIT: GLenum; - readonly COLOR_CLEAR_VALUE: GLenum; - readonly COLOR_WRITEMASK: GLenum; - readonly COMPILE_STATUS: GLenum; - readonly COMPRESSED_TEXTURE_FORMATS: GLenum; - readonly CONSTANT_ALPHA: GLenum; - readonly CONSTANT_COLOR: GLenum; - readonly CONTEXT_LOST_WEBGL: GLenum; - readonly CULL_FACE: GLenum; - readonly CULL_FACE_MODE: GLenum; - readonly CURRENT_PROGRAM: GLenum; - readonly CURRENT_VERTEX_ATTRIB: GLenum; - readonly CW: GLenum; - readonly DECR: GLenum; - readonly DECR_WRAP: GLenum; - readonly DELETE_STATUS: GLenum; - readonly DEPTH_ATTACHMENT: GLenum; - readonly DEPTH_BITS: GLenum; - readonly DEPTH_BUFFER_BIT: GLenum; - readonly DEPTH_CLEAR_VALUE: GLenum; - readonly DEPTH_COMPONENT: GLenum; - readonly DEPTH_COMPONENT16: GLenum; - readonly DEPTH_FUNC: GLenum; - readonly DEPTH_RANGE: GLenum; - readonly DEPTH_STENCIL: GLenum; - readonly DEPTH_STENCIL_ATTACHMENT: GLenum; - readonly DEPTH_TEST: GLenum; - readonly DEPTH_WRITEMASK: GLenum; - readonly DITHER: GLenum; - readonly DONT_CARE: GLenum; - readonly DST_ALPHA: GLenum; - readonly DST_COLOR: GLenum; - readonly DYNAMIC_DRAW: GLenum; - readonly ELEMENT_ARRAY_BUFFER: GLenum; - readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum; - readonly EQUAL: GLenum; - readonly FASTEST: GLenum; - readonly FLOAT: GLenum; - readonly FLOAT_MAT2: GLenum; - readonly FLOAT_MAT3: GLenum; - readonly FLOAT_MAT4: GLenum; - readonly FLOAT_VEC2: GLenum; - readonly FLOAT_VEC3: GLenum; - readonly FLOAT_VEC4: GLenum; - readonly FRAGMENT_SHADER: GLenum; - readonly FRAMEBUFFER: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum; - readonly FRAMEBUFFER_BINDING: GLenum; - readonly FRAMEBUFFER_COMPLETE: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_UNSUPPORTED: GLenum; - readonly FRONT: GLenum; - readonly FRONT_AND_BACK: GLenum; - readonly FRONT_FACE: GLenum; - readonly FUNC_ADD: GLenum; - readonly FUNC_REVERSE_SUBTRACT: GLenum; - readonly FUNC_SUBTRACT: GLenum; - readonly GENERATE_MIPMAP_HINT: GLenum; - readonly GEQUAL: GLenum; - readonly GREATER: GLenum; - readonly GREEN_BITS: GLenum; - readonly HIGH_FLOAT: GLenum; - readonly HIGH_INT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum; - readonly INCR: GLenum; - readonly INCR_WRAP: GLenum; - readonly INT: GLenum; - readonly INT_VEC2: GLenum; - readonly INT_VEC3: GLenum; - readonly INT_VEC4: GLenum; - readonly INVALID_ENUM: GLenum; - readonly INVALID_FRAMEBUFFER_OPERATION: GLenum; - readonly INVALID_OPERATION: GLenum; - readonly INVALID_VALUE: GLenum; - readonly INVERT: GLenum; - readonly KEEP: GLenum; - readonly LEQUAL: GLenum; - readonly LESS: GLenum; - readonly LINEAR: GLenum; - readonly LINEAR_MIPMAP_LINEAR: GLenum; - readonly LINEAR_MIPMAP_NEAREST: GLenum; - readonly LINES: GLenum; - readonly LINE_LOOP: GLenum; - readonly LINE_STRIP: GLenum; - readonly LINE_WIDTH: GLenum; - readonly LINK_STATUS: GLenum; - readonly LOW_FLOAT: GLenum; - readonly LOW_INT: GLenum; - readonly LUMINANCE: GLenum; - readonly LUMINANCE_ALPHA: GLenum; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum; - readonly MAX_RENDERBUFFER_SIZE: GLenum; - readonly MAX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_TEXTURE_SIZE: GLenum; - readonly MAX_VARYING_VECTORS: GLenum; - readonly MAX_VERTEX_ATTRIBS: GLenum; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum; - readonly MAX_VIEWPORT_DIMS: GLenum; - readonly MEDIUM_FLOAT: GLenum; - readonly MEDIUM_INT: GLenum; - readonly MIRRORED_REPEAT: GLenum; - readonly NEAREST: GLenum; - readonly NEAREST_MIPMAP_LINEAR: GLenum; - readonly NEAREST_MIPMAP_NEAREST: GLenum; - readonly NEVER: GLenum; - readonly NICEST: GLenum; - readonly NONE: GLenum; - readonly NOTEQUAL: GLenum; - readonly NO_ERROR: GLenum; - readonly ONE: GLenum; - readonly ONE_MINUS_CONSTANT_ALPHA: GLenum; - readonly ONE_MINUS_CONSTANT_COLOR: GLenum; - readonly ONE_MINUS_DST_ALPHA: GLenum; - readonly ONE_MINUS_DST_COLOR: GLenum; - readonly ONE_MINUS_SRC_ALPHA: GLenum; - readonly ONE_MINUS_SRC_COLOR: GLenum; - readonly OUT_OF_MEMORY: GLenum; - readonly PACK_ALIGNMENT: GLenum; - readonly POINTS: GLenum; - readonly POLYGON_OFFSET_FACTOR: GLenum; - readonly POLYGON_OFFSET_FILL: GLenum; - readonly POLYGON_OFFSET_UNITS: GLenum; - readonly RED_BITS: GLenum; - readonly RENDERBUFFER: GLenum; - readonly RENDERBUFFER_ALPHA_SIZE: GLenum; - readonly RENDERBUFFER_BINDING: GLenum; - readonly RENDERBUFFER_BLUE_SIZE: GLenum; - readonly RENDERBUFFER_DEPTH_SIZE: GLenum; - readonly RENDERBUFFER_GREEN_SIZE: GLenum; - readonly RENDERBUFFER_HEIGHT: GLenum; - readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum; - readonly RENDERBUFFER_RED_SIZE: GLenum; - readonly RENDERBUFFER_STENCIL_SIZE: GLenum; - readonly RENDERBUFFER_WIDTH: GLenum; - readonly RENDERER: GLenum; - readonly REPEAT: GLenum; - readonly REPLACE: GLenum; - readonly RGB: GLenum; - readonly RGB565: GLenum; - readonly RGB5_A1: GLenum; - readonly RGBA: GLenum; - readonly RGBA4: GLenum; - readonly SAMPLER_2D: GLenum; - readonly SAMPLER_CUBE: GLenum; - readonly SAMPLES: GLenum; - readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum; - readonly SAMPLE_BUFFERS: GLenum; - readonly SAMPLE_COVERAGE: GLenum; - readonly SAMPLE_COVERAGE_INVERT: GLenum; - readonly SAMPLE_COVERAGE_VALUE: GLenum; - readonly SCISSOR_BOX: GLenum; - readonly SCISSOR_TEST: GLenum; - readonly SHADER_TYPE: GLenum; - readonly SHADING_LANGUAGE_VERSION: GLenum; - readonly SHORT: GLenum; - readonly SRC_ALPHA: GLenum; - readonly SRC_ALPHA_SATURATE: GLenum; - readonly SRC_COLOR: GLenum; - readonly STATIC_DRAW: GLenum; - readonly STENCIL_ATTACHMENT: GLenum; - readonly STENCIL_BACK_FAIL: GLenum; - readonly STENCIL_BACK_FUNC: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_BACK_REF: GLenum; - readonly STENCIL_BACK_VALUE_MASK: GLenum; - readonly STENCIL_BACK_WRITEMASK: GLenum; - readonly STENCIL_BITS: GLenum; - readonly STENCIL_BUFFER_BIT: GLenum; - readonly STENCIL_CLEAR_VALUE: GLenum; - readonly STENCIL_FAIL: GLenum; - readonly STENCIL_FUNC: GLenum; - readonly STENCIL_INDEX8: GLenum; - readonly STENCIL_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_REF: GLenum; - readonly STENCIL_TEST: GLenum; - readonly STENCIL_VALUE_MASK: GLenum; - readonly STENCIL_WRITEMASK: GLenum; - readonly STREAM_DRAW: GLenum; - readonly SUBPIXEL_BITS: GLenum; - readonly TEXTURE: GLenum; - readonly TEXTURE0: GLenum; - readonly TEXTURE1: GLenum; - readonly TEXTURE10: GLenum; - readonly TEXTURE11: GLenum; - readonly TEXTURE12: GLenum; - readonly TEXTURE13: GLenum; - readonly TEXTURE14: GLenum; - readonly TEXTURE15: GLenum; - readonly TEXTURE16: GLenum; - readonly TEXTURE17: GLenum; - readonly TEXTURE18: GLenum; - readonly TEXTURE19: GLenum; - readonly TEXTURE2: GLenum; - readonly TEXTURE20: GLenum; - readonly TEXTURE21: GLenum; - readonly TEXTURE22: GLenum; - readonly TEXTURE23: GLenum; - readonly TEXTURE24: GLenum; - readonly TEXTURE25: GLenum; - readonly TEXTURE26: GLenum; - readonly TEXTURE27: GLenum; - readonly TEXTURE28: GLenum; - readonly TEXTURE29: GLenum; - readonly TEXTURE3: GLenum; - readonly TEXTURE30: GLenum; - readonly TEXTURE31: GLenum; - readonly TEXTURE4: GLenum; - readonly TEXTURE5: GLenum; - readonly TEXTURE6: GLenum; - readonly TEXTURE7: GLenum; - readonly TEXTURE8: GLenum; - readonly TEXTURE9: GLenum; - readonly TEXTURE_2D: GLenum; - readonly TEXTURE_BINDING_2D: GLenum; - readonly TEXTURE_BINDING_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum; - readonly TEXTURE_MAG_FILTER: GLenum; - readonly TEXTURE_MIN_FILTER: GLenum; - readonly TEXTURE_WRAP_S: GLenum; - readonly TEXTURE_WRAP_T: GLenum; - readonly TRIANGLES: GLenum; - readonly TRIANGLE_FAN: GLenum; - readonly TRIANGLE_STRIP: GLenum; - readonly UNPACK_ALIGNMENT: GLenum; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum; - readonly UNPACK_FLIP_Y_WEBGL: GLenum; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum; - readonly UNSIGNED_BYTE: GLenum; - readonly UNSIGNED_INT: GLenum; - readonly UNSIGNED_SHORT: GLenum; - readonly UNSIGNED_SHORT_4_4_4_4: GLenum; - readonly UNSIGNED_SHORT_5_5_5_1: GLenum; - readonly UNSIGNED_SHORT_5_6_5: GLenum; - readonly VALIDATE_STATUS: GLenum; - readonly VENDOR: GLenum; - readonly VERSION: GLenum; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum; - readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum; - readonly VERTEX_SHADER: GLenum; - readonly VIEWPORT: GLenum; - readonly ZERO: GLenum; + readonly DEPTH_BUFFER_BIT: 0x00000100; + readonly STENCIL_BUFFER_BIT: 0x00000400; + readonly COLOR_BUFFER_BIT: 0x00004000; + readonly POINTS: 0x0000; + readonly LINES: 0x0001; + readonly LINE_LOOP: 0x0002; + readonly LINE_STRIP: 0x0003; + readonly TRIANGLES: 0x0004; + readonly TRIANGLE_STRIP: 0x0005; + readonly TRIANGLE_FAN: 0x0006; + readonly ZERO: 0; + readonly ONE: 1; + readonly SRC_COLOR: 0x0300; + readonly ONE_MINUS_SRC_COLOR: 0x0301; + readonly SRC_ALPHA: 0x0302; + readonly ONE_MINUS_SRC_ALPHA: 0x0303; + readonly DST_ALPHA: 0x0304; + readonly ONE_MINUS_DST_ALPHA: 0x0305; + readonly DST_COLOR: 0x0306; + readonly ONE_MINUS_DST_COLOR: 0x0307; + readonly SRC_ALPHA_SATURATE: 0x0308; + readonly FUNC_ADD: 0x8006; + readonly BLEND_EQUATION: 0x8009; + readonly BLEND_EQUATION_RGB: 0x8009; + readonly BLEND_EQUATION_ALPHA: 0x883D; + readonly FUNC_SUBTRACT: 0x800A; + readonly FUNC_REVERSE_SUBTRACT: 0x800B; + readonly BLEND_DST_RGB: 0x80C8; + readonly BLEND_SRC_RGB: 0x80C9; + readonly BLEND_DST_ALPHA: 0x80CA; + readonly BLEND_SRC_ALPHA: 0x80CB; + readonly CONSTANT_COLOR: 0x8001; + readonly ONE_MINUS_CONSTANT_COLOR: 0x8002; + readonly CONSTANT_ALPHA: 0x8003; + readonly ONE_MINUS_CONSTANT_ALPHA: 0x8004; + readonly BLEND_COLOR: 0x8005; + readonly ARRAY_BUFFER: 0x8892; + readonly ELEMENT_ARRAY_BUFFER: 0x8893; + readonly ARRAY_BUFFER_BINDING: 0x8894; + readonly ELEMENT_ARRAY_BUFFER_BINDING: 0x8895; + readonly STREAM_DRAW: 0x88E0; + readonly STATIC_DRAW: 0x88E4; + readonly DYNAMIC_DRAW: 0x88E8; + readonly BUFFER_SIZE: 0x8764; + readonly BUFFER_USAGE: 0x8765; + readonly CURRENT_VERTEX_ATTRIB: 0x8626; + readonly FRONT: 0x0404; + readonly BACK: 0x0405; + readonly FRONT_AND_BACK: 0x0408; + readonly CULL_FACE: 0x0B44; + readonly BLEND: 0x0BE2; + readonly DITHER: 0x0BD0; + readonly STENCIL_TEST: 0x0B90; + readonly DEPTH_TEST: 0x0B71; + readonly SCISSOR_TEST: 0x0C11; + readonly POLYGON_OFFSET_FILL: 0x8037; + readonly SAMPLE_ALPHA_TO_COVERAGE: 0x809E; + readonly SAMPLE_COVERAGE: 0x80A0; + readonly NO_ERROR: 0; + readonly INVALID_ENUM: 0x0500; + readonly INVALID_VALUE: 0x0501; + readonly INVALID_OPERATION: 0x0502; + readonly OUT_OF_MEMORY: 0x0505; + readonly CW: 0x0900; + readonly CCW: 0x0901; + readonly LINE_WIDTH: 0x0B21; + readonly ALIASED_POINT_SIZE_RANGE: 0x846D; + readonly ALIASED_LINE_WIDTH_RANGE: 0x846E; + readonly CULL_FACE_MODE: 0x0B45; + readonly FRONT_FACE: 0x0B46; + readonly DEPTH_RANGE: 0x0B70; + readonly DEPTH_WRITEMASK: 0x0B72; + readonly DEPTH_CLEAR_VALUE: 0x0B73; + readonly DEPTH_FUNC: 0x0B74; + readonly STENCIL_CLEAR_VALUE: 0x0B91; + readonly STENCIL_FUNC: 0x0B92; + readonly STENCIL_FAIL: 0x0B94; + readonly STENCIL_PASS_DEPTH_FAIL: 0x0B95; + readonly STENCIL_PASS_DEPTH_PASS: 0x0B96; + readonly STENCIL_REF: 0x0B97; + readonly STENCIL_VALUE_MASK: 0x0B93; + readonly STENCIL_WRITEMASK: 0x0B98; + readonly STENCIL_BACK_FUNC: 0x8800; + readonly STENCIL_BACK_FAIL: 0x8801; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802; + readonly STENCIL_BACK_PASS_DEPTH_PASS: 0x8803; + readonly STENCIL_BACK_REF: 0x8CA3; + readonly STENCIL_BACK_VALUE_MASK: 0x8CA4; + readonly STENCIL_BACK_WRITEMASK: 0x8CA5; + readonly VIEWPORT: 0x0BA2; + readonly SCISSOR_BOX: 0x0C10; + readonly COLOR_CLEAR_VALUE: 0x0C22; + readonly COLOR_WRITEMASK: 0x0C23; + readonly UNPACK_ALIGNMENT: 0x0CF5; + readonly PACK_ALIGNMENT: 0x0D05; + readonly MAX_TEXTURE_SIZE: 0x0D33; + readonly MAX_VIEWPORT_DIMS: 0x0D3A; + readonly SUBPIXEL_BITS: 0x0D50; + readonly RED_BITS: 0x0D52; + readonly GREEN_BITS: 0x0D53; + readonly BLUE_BITS: 0x0D54; + readonly ALPHA_BITS: 0x0D55; + readonly DEPTH_BITS: 0x0D56; + readonly STENCIL_BITS: 0x0D57; + readonly POLYGON_OFFSET_UNITS: 0x2A00; + readonly POLYGON_OFFSET_FACTOR: 0x8038; + readonly TEXTURE_BINDING_2D: 0x8069; + readonly SAMPLE_BUFFERS: 0x80A8; + readonly SAMPLES: 0x80A9; + readonly SAMPLE_COVERAGE_VALUE: 0x80AA; + readonly SAMPLE_COVERAGE_INVERT: 0x80AB; + readonly COMPRESSED_TEXTURE_FORMATS: 0x86A3; + readonly DONT_CARE: 0x1100; + readonly FASTEST: 0x1101; + readonly NICEST: 0x1102; + readonly GENERATE_MIPMAP_HINT: 0x8192; + readonly BYTE: 0x1400; + readonly UNSIGNED_BYTE: 0x1401; + readonly SHORT: 0x1402; + readonly UNSIGNED_SHORT: 0x1403; + readonly INT: 0x1404; + readonly UNSIGNED_INT: 0x1405; + readonly FLOAT: 0x1406; + readonly DEPTH_COMPONENT: 0x1902; + readonly ALPHA: 0x1906; + readonly RGB: 0x1907; + readonly RGBA: 0x1908; + readonly LUMINANCE: 0x1909; + readonly LUMINANCE_ALPHA: 0x190A; + readonly UNSIGNED_SHORT_4_4_4_4: 0x8033; + readonly UNSIGNED_SHORT_5_5_5_1: 0x8034; + readonly UNSIGNED_SHORT_5_6_5: 0x8363; + readonly FRAGMENT_SHADER: 0x8B30; + readonly VERTEX_SHADER: 0x8B31; + readonly MAX_VERTEX_ATTRIBS: 0x8869; + readonly MAX_VERTEX_UNIFORM_VECTORS: 0x8DFB; + readonly MAX_VARYING_VECTORS: 0x8DFC; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8B4D; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8B4C; + readonly MAX_TEXTURE_IMAGE_UNITS: 0x8872; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: 0x8DFD; + readonly SHADER_TYPE: 0x8B4F; + readonly DELETE_STATUS: 0x8B80; + readonly LINK_STATUS: 0x8B82; + readonly VALIDATE_STATUS: 0x8B83; + readonly ATTACHED_SHADERS: 0x8B85; + readonly ACTIVE_UNIFORMS: 0x8B86; + readonly ACTIVE_ATTRIBUTES: 0x8B89; + readonly SHADING_LANGUAGE_VERSION: 0x8B8C; + readonly CURRENT_PROGRAM: 0x8B8D; + readonly NEVER: 0x0200; + readonly LESS: 0x0201; + readonly EQUAL: 0x0202; + readonly LEQUAL: 0x0203; + readonly GREATER: 0x0204; + readonly NOTEQUAL: 0x0205; + readonly GEQUAL: 0x0206; + readonly ALWAYS: 0x0207; + readonly KEEP: 0x1E00; + readonly REPLACE: 0x1E01; + readonly INCR: 0x1E02; + readonly DECR: 0x1E03; + readonly INVERT: 0x150A; + readonly INCR_WRAP: 0x8507; + readonly DECR_WRAP: 0x8508; + readonly VENDOR: 0x1F00; + readonly RENDERER: 0x1F01; + readonly VERSION: 0x1F02; + readonly NEAREST: 0x2600; + readonly LINEAR: 0x2601; + readonly NEAREST_MIPMAP_NEAREST: 0x2700; + readonly LINEAR_MIPMAP_NEAREST: 0x2701; + readonly NEAREST_MIPMAP_LINEAR: 0x2702; + readonly LINEAR_MIPMAP_LINEAR: 0x2703; + readonly TEXTURE_MAG_FILTER: 0x2800; + readonly TEXTURE_MIN_FILTER: 0x2801; + readonly TEXTURE_WRAP_S: 0x2802; + readonly TEXTURE_WRAP_T: 0x2803; + readonly TEXTURE_2D: 0x0DE1; + readonly TEXTURE: 0x1702; + readonly TEXTURE_CUBE_MAP: 0x8513; + readonly TEXTURE_BINDING_CUBE_MAP: 0x8514; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851A; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: 0x851C; + readonly TEXTURE0: 0x84C0; + readonly TEXTURE1: 0x84C1; + readonly TEXTURE2: 0x84C2; + readonly TEXTURE3: 0x84C3; + readonly TEXTURE4: 0x84C4; + readonly TEXTURE5: 0x84C5; + readonly TEXTURE6: 0x84C6; + readonly TEXTURE7: 0x84C7; + readonly TEXTURE8: 0x84C8; + readonly TEXTURE9: 0x84C9; + readonly TEXTURE10: 0x84CA; + readonly TEXTURE11: 0x84CB; + readonly TEXTURE12: 0x84CC; + readonly TEXTURE13: 0x84CD; + readonly TEXTURE14: 0x84CE; + readonly TEXTURE15: 0x84CF; + readonly TEXTURE16: 0x84D0; + readonly TEXTURE17: 0x84D1; + readonly TEXTURE18: 0x84D2; + readonly TEXTURE19: 0x84D3; + readonly TEXTURE20: 0x84D4; + readonly TEXTURE21: 0x84D5; + readonly TEXTURE22: 0x84D6; + readonly TEXTURE23: 0x84D7; + readonly TEXTURE24: 0x84D8; + readonly TEXTURE25: 0x84D9; + readonly TEXTURE26: 0x84DA; + readonly TEXTURE27: 0x84DB; + readonly TEXTURE28: 0x84DC; + readonly TEXTURE29: 0x84DD; + readonly TEXTURE30: 0x84DE; + readonly TEXTURE31: 0x84DF; + readonly ACTIVE_TEXTURE: 0x84E0; + readonly REPEAT: 0x2901; + readonly CLAMP_TO_EDGE: 0x812F; + readonly MIRRORED_REPEAT: 0x8370; + readonly FLOAT_VEC2: 0x8B50; + readonly FLOAT_VEC3: 0x8B51; + readonly FLOAT_VEC4: 0x8B52; + readonly INT_VEC2: 0x8B53; + readonly INT_VEC3: 0x8B54; + readonly INT_VEC4: 0x8B55; + readonly BOOL: 0x8B56; + readonly BOOL_VEC2: 0x8B57; + readonly BOOL_VEC3: 0x8B58; + readonly BOOL_VEC4: 0x8B59; + readonly FLOAT_MAT2: 0x8B5A; + readonly FLOAT_MAT3: 0x8B5B; + readonly FLOAT_MAT4: 0x8B5C; + readonly SAMPLER_2D: 0x8B5E; + readonly SAMPLER_CUBE: 0x8B60; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622; + readonly VERTEX_ATTRIB_ARRAY_SIZE: 0x8623; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624; + readonly VERTEX_ATTRIB_ARRAY_TYPE: 0x8625; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886A; + readonly VERTEX_ATTRIB_ARRAY_POINTER: 0x8645; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889F; + readonly IMPLEMENTATION_COLOR_READ_TYPE: 0x8B9A; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: 0x8B9B; + readonly COMPILE_STATUS: 0x8B81; + readonly LOW_FLOAT: 0x8DF0; + readonly MEDIUM_FLOAT: 0x8DF1; + readonly HIGH_FLOAT: 0x8DF2; + readonly LOW_INT: 0x8DF3; + readonly MEDIUM_INT: 0x8DF4; + readonly HIGH_INT: 0x8DF5; + readonly FRAMEBUFFER: 0x8D40; + readonly RENDERBUFFER: 0x8D41; + readonly RGBA4: 0x8056; + readonly RGB5_A1: 0x8057; + readonly RGB565: 0x8D62; + readonly DEPTH_COMPONENT16: 0x81A5; + readonly STENCIL_INDEX8: 0x8D48; + readonly DEPTH_STENCIL: 0x84F9; + readonly RENDERBUFFER_WIDTH: 0x8D42; + readonly RENDERBUFFER_HEIGHT: 0x8D43; + readonly RENDERBUFFER_INTERNAL_FORMAT: 0x8D44; + readonly RENDERBUFFER_RED_SIZE: 0x8D50; + readonly RENDERBUFFER_GREEN_SIZE: 0x8D51; + readonly RENDERBUFFER_BLUE_SIZE: 0x8D52; + readonly RENDERBUFFER_ALPHA_SIZE: 0x8D53; + readonly RENDERBUFFER_DEPTH_SIZE: 0x8D54; + readonly RENDERBUFFER_STENCIL_SIZE: 0x8D55; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8CD0; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8CD1; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8CD2; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8CD3; + readonly COLOR_ATTACHMENT0: 0x8CE0; + readonly DEPTH_ATTACHMENT: 0x8D00; + readonly STENCIL_ATTACHMENT: 0x8D20; + readonly DEPTH_STENCIL_ATTACHMENT: 0x821A; + readonly NONE: 0; + readonly FRAMEBUFFER_COMPLETE: 0x8CD5; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8CD6; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8CD7; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8CD9; + readonly FRAMEBUFFER_UNSUPPORTED: 0x8CDD; + readonly FRAMEBUFFER_BINDING: 0x8CA6; + readonly RENDERBUFFER_BINDING: 0x8CA7; + readonly MAX_RENDERBUFFER_SIZE: 0x84E8; + readonly INVALID_FRAMEBUFFER_OPERATION: 0x0506; + readonly UNPACK_FLIP_Y_WEBGL: 0x9240; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241; + readonly CONTEXT_LOST_WEBGL: 0x9242; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243; + readonly BROWSER_DEFAULT_WEBGL: 0x9244; }; interface WebGLRenderingContextBase { @@ -5049,302 +5086,302 @@ interface WebGLRenderingContextBase { vertexAttrib4fv(index: GLuint, values: Float32List): void; vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr): void; viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; - readonly ACTIVE_ATTRIBUTES: GLenum; - readonly ACTIVE_TEXTURE: GLenum; - readonly ACTIVE_UNIFORMS: GLenum; - readonly ALIASED_LINE_WIDTH_RANGE: GLenum; - readonly ALIASED_POINT_SIZE_RANGE: GLenum; - readonly ALPHA: GLenum; - readonly ALPHA_BITS: GLenum; - readonly ALWAYS: GLenum; - readonly ARRAY_BUFFER: GLenum; - readonly ARRAY_BUFFER_BINDING: GLenum; - readonly ATTACHED_SHADERS: GLenum; - readonly BACK: GLenum; - readonly BLEND: GLenum; - readonly BLEND_COLOR: GLenum; - readonly BLEND_DST_ALPHA: GLenum; - readonly BLEND_DST_RGB: GLenum; - readonly BLEND_EQUATION: GLenum; - readonly BLEND_EQUATION_ALPHA: GLenum; - readonly BLEND_EQUATION_RGB: GLenum; - readonly BLEND_SRC_ALPHA: GLenum; - readonly BLEND_SRC_RGB: GLenum; - readonly BLUE_BITS: GLenum; - readonly BOOL: GLenum; - readonly BOOL_VEC2: GLenum; - readonly BOOL_VEC3: GLenum; - readonly BOOL_VEC4: GLenum; - readonly BROWSER_DEFAULT_WEBGL: GLenum; - readonly BUFFER_SIZE: GLenum; - readonly BUFFER_USAGE: GLenum; - readonly BYTE: GLenum; - readonly CCW: GLenum; - readonly CLAMP_TO_EDGE: GLenum; - readonly COLOR_ATTACHMENT0: GLenum; - readonly COLOR_BUFFER_BIT: GLenum; - readonly COLOR_CLEAR_VALUE: GLenum; - readonly COLOR_WRITEMASK: GLenum; - readonly COMPILE_STATUS: GLenum; - readonly COMPRESSED_TEXTURE_FORMATS: GLenum; - readonly CONSTANT_ALPHA: GLenum; - readonly CONSTANT_COLOR: GLenum; - readonly CONTEXT_LOST_WEBGL: GLenum; - readonly CULL_FACE: GLenum; - readonly CULL_FACE_MODE: GLenum; - readonly CURRENT_PROGRAM: GLenum; - readonly CURRENT_VERTEX_ATTRIB: GLenum; - readonly CW: GLenum; - readonly DECR: GLenum; - readonly DECR_WRAP: GLenum; - readonly DELETE_STATUS: GLenum; - readonly DEPTH_ATTACHMENT: GLenum; - readonly DEPTH_BITS: GLenum; - readonly DEPTH_BUFFER_BIT: GLenum; - readonly DEPTH_CLEAR_VALUE: GLenum; - readonly DEPTH_COMPONENT: GLenum; - readonly DEPTH_COMPONENT16: GLenum; - readonly DEPTH_FUNC: GLenum; - readonly DEPTH_RANGE: GLenum; - readonly DEPTH_STENCIL: GLenum; - readonly DEPTH_STENCIL_ATTACHMENT: GLenum; - readonly DEPTH_TEST: GLenum; - readonly DEPTH_WRITEMASK: GLenum; - readonly DITHER: GLenum; - readonly DONT_CARE: GLenum; - readonly DST_ALPHA: GLenum; - readonly DST_COLOR: GLenum; - readonly DYNAMIC_DRAW: GLenum; - readonly ELEMENT_ARRAY_BUFFER: GLenum; - readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum; - readonly EQUAL: GLenum; - readonly FASTEST: GLenum; - readonly FLOAT: GLenum; - readonly FLOAT_MAT2: GLenum; - readonly FLOAT_MAT3: GLenum; - readonly FLOAT_MAT4: GLenum; - readonly FLOAT_VEC2: GLenum; - readonly FLOAT_VEC3: GLenum; - readonly FLOAT_VEC4: GLenum; - readonly FRAGMENT_SHADER: GLenum; - readonly FRAMEBUFFER: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum; - readonly FRAMEBUFFER_BINDING: GLenum; - readonly FRAMEBUFFER_COMPLETE: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_UNSUPPORTED: GLenum; - readonly FRONT: GLenum; - readonly FRONT_AND_BACK: GLenum; - readonly FRONT_FACE: GLenum; - readonly FUNC_ADD: GLenum; - readonly FUNC_REVERSE_SUBTRACT: GLenum; - readonly FUNC_SUBTRACT: GLenum; - readonly GENERATE_MIPMAP_HINT: GLenum; - readonly GEQUAL: GLenum; - readonly GREATER: GLenum; - readonly GREEN_BITS: GLenum; - readonly HIGH_FLOAT: GLenum; - readonly HIGH_INT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum; - readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum; - readonly INCR: GLenum; - readonly INCR_WRAP: GLenum; - readonly INT: GLenum; - readonly INT_VEC2: GLenum; - readonly INT_VEC3: GLenum; - readonly INT_VEC4: GLenum; - readonly INVALID_ENUM: GLenum; - readonly INVALID_FRAMEBUFFER_OPERATION: GLenum; - readonly INVALID_OPERATION: GLenum; - readonly INVALID_VALUE: GLenum; - readonly INVERT: GLenum; - readonly KEEP: GLenum; - readonly LEQUAL: GLenum; - readonly LESS: GLenum; - readonly LINEAR: GLenum; - readonly LINEAR_MIPMAP_LINEAR: GLenum; - readonly LINEAR_MIPMAP_NEAREST: GLenum; - readonly LINES: GLenum; - readonly LINE_LOOP: GLenum; - readonly LINE_STRIP: GLenum; - readonly LINE_WIDTH: GLenum; - readonly LINK_STATUS: GLenum; - readonly LOW_FLOAT: GLenum; - readonly LOW_INT: GLenum; - readonly LUMINANCE: GLenum; - readonly LUMINANCE_ALPHA: GLenum; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum; - readonly MAX_RENDERBUFFER_SIZE: GLenum; - readonly MAX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_TEXTURE_SIZE: GLenum; - readonly MAX_VARYING_VECTORS: GLenum; - readonly MAX_VERTEX_ATTRIBS: GLenum; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum; - readonly MAX_VIEWPORT_DIMS: GLenum; - readonly MEDIUM_FLOAT: GLenum; - readonly MEDIUM_INT: GLenum; - readonly MIRRORED_REPEAT: GLenum; - readonly NEAREST: GLenum; - readonly NEAREST_MIPMAP_LINEAR: GLenum; - readonly NEAREST_MIPMAP_NEAREST: GLenum; - readonly NEVER: GLenum; - readonly NICEST: GLenum; - readonly NONE: GLenum; - readonly NOTEQUAL: GLenum; - readonly NO_ERROR: GLenum; - readonly ONE: GLenum; - readonly ONE_MINUS_CONSTANT_ALPHA: GLenum; - readonly ONE_MINUS_CONSTANT_COLOR: GLenum; - readonly ONE_MINUS_DST_ALPHA: GLenum; - readonly ONE_MINUS_DST_COLOR: GLenum; - readonly ONE_MINUS_SRC_ALPHA: GLenum; - readonly ONE_MINUS_SRC_COLOR: GLenum; - readonly OUT_OF_MEMORY: GLenum; - readonly PACK_ALIGNMENT: GLenum; - readonly POINTS: GLenum; - readonly POLYGON_OFFSET_FACTOR: GLenum; - readonly POLYGON_OFFSET_FILL: GLenum; - readonly POLYGON_OFFSET_UNITS: GLenum; - readonly RED_BITS: GLenum; - readonly RENDERBUFFER: GLenum; - readonly RENDERBUFFER_ALPHA_SIZE: GLenum; - readonly RENDERBUFFER_BINDING: GLenum; - readonly RENDERBUFFER_BLUE_SIZE: GLenum; - readonly RENDERBUFFER_DEPTH_SIZE: GLenum; - readonly RENDERBUFFER_GREEN_SIZE: GLenum; - readonly RENDERBUFFER_HEIGHT: GLenum; - readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum; - readonly RENDERBUFFER_RED_SIZE: GLenum; - readonly RENDERBUFFER_STENCIL_SIZE: GLenum; - readonly RENDERBUFFER_WIDTH: GLenum; - readonly RENDERER: GLenum; - readonly REPEAT: GLenum; - readonly REPLACE: GLenum; - readonly RGB: GLenum; - readonly RGB565: GLenum; - readonly RGB5_A1: GLenum; - readonly RGBA: GLenum; - readonly RGBA4: GLenum; - readonly SAMPLER_2D: GLenum; - readonly SAMPLER_CUBE: GLenum; - readonly SAMPLES: GLenum; - readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum; - readonly SAMPLE_BUFFERS: GLenum; - readonly SAMPLE_COVERAGE: GLenum; - readonly SAMPLE_COVERAGE_INVERT: GLenum; - readonly SAMPLE_COVERAGE_VALUE: GLenum; - readonly SCISSOR_BOX: GLenum; - readonly SCISSOR_TEST: GLenum; - readonly SHADER_TYPE: GLenum; - readonly SHADING_LANGUAGE_VERSION: GLenum; - readonly SHORT: GLenum; - readonly SRC_ALPHA: GLenum; - readonly SRC_ALPHA_SATURATE: GLenum; - readonly SRC_COLOR: GLenum; - readonly STATIC_DRAW: GLenum; - readonly STENCIL_ATTACHMENT: GLenum; - readonly STENCIL_BACK_FAIL: GLenum; - readonly STENCIL_BACK_FUNC: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_BACK_REF: GLenum; - readonly STENCIL_BACK_VALUE_MASK: GLenum; - readonly STENCIL_BACK_WRITEMASK: GLenum; - readonly STENCIL_BITS: GLenum; - readonly STENCIL_BUFFER_BIT: GLenum; - readonly STENCIL_CLEAR_VALUE: GLenum; - readonly STENCIL_FAIL: GLenum; - readonly STENCIL_FUNC: GLenum; - readonly STENCIL_INDEX8: GLenum; - readonly STENCIL_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_REF: GLenum; - readonly STENCIL_TEST: GLenum; - readonly STENCIL_VALUE_MASK: GLenum; - readonly STENCIL_WRITEMASK: GLenum; - readonly STREAM_DRAW: GLenum; - readonly SUBPIXEL_BITS: GLenum; - readonly TEXTURE: GLenum; - readonly TEXTURE0: GLenum; - readonly TEXTURE1: GLenum; - readonly TEXTURE10: GLenum; - readonly TEXTURE11: GLenum; - readonly TEXTURE12: GLenum; - readonly TEXTURE13: GLenum; - readonly TEXTURE14: GLenum; - readonly TEXTURE15: GLenum; - readonly TEXTURE16: GLenum; - readonly TEXTURE17: GLenum; - readonly TEXTURE18: GLenum; - readonly TEXTURE19: GLenum; - readonly TEXTURE2: GLenum; - readonly TEXTURE20: GLenum; - readonly TEXTURE21: GLenum; - readonly TEXTURE22: GLenum; - readonly TEXTURE23: GLenum; - readonly TEXTURE24: GLenum; - readonly TEXTURE25: GLenum; - readonly TEXTURE26: GLenum; - readonly TEXTURE27: GLenum; - readonly TEXTURE28: GLenum; - readonly TEXTURE29: GLenum; - readonly TEXTURE3: GLenum; - readonly TEXTURE30: GLenum; - readonly TEXTURE31: GLenum; - readonly TEXTURE4: GLenum; - readonly TEXTURE5: GLenum; - readonly TEXTURE6: GLenum; - readonly TEXTURE7: GLenum; - readonly TEXTURE8: GLenum; - readonly TEXTURE9: GLenum; - readonly TEXTURE_2D: GLenum; - readonly TEXTURE_BINDING_2D: GLenum; - readonly TEXTURE_BINDING_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum; - readonly TEXTURE_MAG_FILTER: GLenum; - readonly TEXTURE_MIN_FILTER: GLenum; - readonly TEXTURE_WRAP_S: GLenum; - readonly TEXTURE_WRAP_T: GLenum; - readonly TRIANGLES: GLenum; - readonly TRIANGLE_FAN: GLenum; - readonly TRIANGLE_STRIP: GLenum; - readonly UNPACK_ALIGNMENT: GLenum; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum; - readonly UNPACK_FLIP_Y_WEBGL: GLenum; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum; - readonly UNSIGNED_BYTE: GLenum; - readonly UNSIGNED_INT: GLenum; - readonly UNSIGNED_SHORT: GLenum; - readonly UNSIGNED_SHORT_4_4_4_4: GLenum; - readonly UNSIGNED_SHORT_5_5_5_1: GLenum; - readonly UNSIGNED_SHORT_5_6_5: GLenum; - readonly VALIDATE_STATUS: GLenum; - readonly VENDOR: GLenum; - readonly VERSION: GLenum; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum; - readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum; - readonly VERTEX_SHADER: GLenum; - readonly VIEWPORT: GLenum; - readonly ZERO: GLenum; + readonly DEPTH_BUFFER_BIT: 0x00000100; + readonly STENCIL_BUFFER_BIT: 0x00000400; + readonly COLOR_BUFFER_BIT: 0x00004000; + readonly POINTS: 0x0000; + readonly LINES: 0x0001; + readonly LINE_LOOP: 0x0002; + readonly LINE_STRIP: 0x0003; + readonly TRIANGLES: 0x0004; + readonly TRIANGLE_STRIP: 0x0005; + readonly TRIANGLE_FAN: 0x0006; + readonly ZERO: 0; + readonly ONE: 1; + readonly SRC_COLOR: 0x0300; + readonly ONE_MINUS_SRC_COLOR: 0x0301; + readonly SRC_ALPHA: 0x0302; + readonly ONE_MINUS_SRC_ALPHA: 0x0303; + readonly DST_ALPHA: 0x0304; + readonly ONE_MINUS_DST_ALPHA: 0x0305; + readonly DST_COLOR: 0x0306; + readonly ONE_MINUS_DST_COLOR: 0x0307; + readonly SRC_ALPHA_SATURATE: 0x0308; + readonly FUNC_ADD: 0x8006; + readonly BLEND_EQUATION: 0x8009; + readonly BLEND_EQUATION_RGB: 0x8009; + readonly BLEND_EQUATION_ALPHA: 0x883D; + readonly FUNC_SUBTRACT: 0x800A; + readonly FUNC_REVERSE_SUBTRACT: 0x800B; + readonly BLEND_DST_RGB: 0x80C8; + readonly BLEND_SRC_RGB: 0x80C9; + readonly BLEND_DST_ALPHA: 0x80CA; + readonly BLEND_SRC_ALPHA: 0x80CB; + readonly CONSTANT_COLOR: 0x8001; + readonly ONE_MINUS_CONSTANT_COLOR: 0x8002; + readonly CONSTANT_ALPHA: 0x8003; + readonly ONE_MINUS_CONSTANT_ALPHA: 0x8004; + readonly BLEND_COLOR: 0x8005; + readonly ARRAY_BUFFER: 0x8892; + readonly ELEMENT_ARRAY_BUFFER: 0x8893; + readonly ARRAY_BUFFER_BINDING: 0x8894; + readonly ELEMENT_ARRAY_BUFFER_BINDING: 0x8895; + readonly STREAM_DRAW: 0x88E0; + readonly STATIC_DRAW: 0x88E4; + readonly DYNAMIC_DRAW: 0x88E8; + readonly BUFFER_SIZE: 0x8764; + readonly BUFFER_USAGE: 0x8765; + readonly CURRENT_VERTEX_ATTRIB: 0x8626; + readonly FRONT: 0x0404; + readonly BACK: 0x0405; + readonly FRONT_AND_BACK: 0x0408; + readonly CULL_FACE: 0x0B44; + readonly BLEND: 0x0BE2; + readonly DITHER: 0x0BD0; + readonly STENCIL_TEST: 0x0B90; + readonly DEPTH_TEST: 0x0B71; + readonly SCISSOR_TEST: 0x0C11; + readonly POLYGON_OFFSET_FILL: 0x8037; + readonly SAMPLE_ALPHA_TO_COVERAGE: 0x809E; + readonly SAMPLE_COVERAGE: 0x80A0; + readonly NO_ERROR: 0; + readonly INVALID_ENUM: 0x0500; + readonly INVALID_VALUE: 0x0501; + readonly INVALID_OPERATION: 0x0502; + readonly OUT_OF_MEMORY: 0x0505; + readonly CW: 0x0900; + readonly CCW: 0x0901; + readonly LINE_WIDTH: 0x0B21; + readonly ALIASED_POINT_SIZE_RANGE: 0x846D; + readonly ALIASED_LINE_WIDTH_RANGE: 0x846E; + readonly CULL_FACE_MODE: 0x0B45; + readonly FRONT_FACE: 0x0B46; + readonly DEPTH_RANGE: 0x0B70; + readonly DEPTH_WRITEMASK: 0x0B72; + readonly DEPTH_CLEAR_VALUE: 0x0B73; + readonly DEPTH_FUNC: 0x0B74; + readonly STENCIL_CLEAR_VALUE: 0x0B91; + readonly STENCIL_FUNC: 0x0B92; + readonly STENCIL_FAIL: 0x0B94; + readonly STENCIL_PASS_DEPTH_FAIL: 0x0B95; + readonly STENCIL_PASS_DEPTH_PASS: 0x0B96; + readonly STENCIL_REF: 0x0B97; + readonly STENCIL_VALUE_MASK: 0x0B93; + readonly STENCIL_WRITEMASK: 0x0B98; + readonly STENCIL_BACK_FUNC: 0x8800; + readonly STENCIL_BACK_FAIL: 0x8801; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802; + readonly STENCIL_BACK_PASS_DEPTH_PASS: 0x8803; + readonly STENCIL_BACK_REF: 0x8CA3; + readonly STENCIL_BACK_VALUE_MASK: 0x8CA4; + readonly STENCIL_BACK_WRITEMASK: 0x8CA5; + readonly VIEWPORT: 0x0BA2; + readonly SCISSOR_BOX: 0x0C10; + readonly COLOR_CLEAR_VALUE: 0x0C22; + readonly COLOR_WRITEMASK: 0x0C23; + readonly UNPACK_ALIGNMENT: 0x0CF5; + readonly PACK_ALIGNMENT: 0x0D05; + readonly MAX_TEXTURE_SIZE: 0x0D33; + readonly MAX_VIEWPORT_DIMS: 0x0D3A; + readonly SUBPIXEL_BITS: 0x0D50; + readonly RED_BITS: 0x0D52; + readonly GREEN_BITS: 0x0D53; + readonly BLUE_BITS: 0x0D54; + readonly ALPHA_BITS: 0x0D55; + readonly DEPTH_BITS: 0x0D56; + readonly STENCIL_BITS: 0x0D57; + readonly POLYGON_OFFSET_UNITS: 0x2A00; + readonly POLYGON_OFFSET_FACTOR: 0x8038; + readonly TEXTURE_BINDING_2D: 0x8069; + readonly SAMPLE_BUFFERS: 0x80A8; + readonly SAMPLES: 0x80A9; + readonly SAMPLE_COVERAGE_VALUE: 0x80AA; + readonly SAMPLE_COVERAGE_INVERT: 0x80AB; + readonly COMPRESSED_TEXTURE_FORMATS: 0x86A3; + readonly DONT_CARE: 0x1100; + readonly FASTEST: 0x1101; + readonly NICEST: 0x1102; + readonly GENERATE_MIPMAP_HINT: 0x8192; + readonly BYTE: 0x1400; + readonly UNSIGNED_BYTE: 0x1401; + readonly SHORT: 0x1402; + readonly UNSIGNED_SHORT: 0x1403; + readonly INT: 0x1404; + readonly UNSIGNED_INT: 0x1405; + readonly FLOAT: 0x1406; + readonly DEPTH_COMPONENT: 0x1902; + readonly ALPHA: 0x1906; + readonly RGB: 0x1907; + readonly RGBA: 0x1908; + readonly LUMINANCE: 0x1909; + readonly LUMINANCE_ALPHA: 0x190A; + readonly UNSIGNED_SHORT_4_4_4_4: 0x8033; + readonly UNSIGNED_SHORT_5_5_5_1: 0x8034; + readonly UNSIGNED_SHORT_5_6_5: 0x8363; + readonly FRAGMENT_SHADER: 0x8B30; + readonly VERTEX_SHADER: 0x8B31; + readonly MAX_VERTEX_ATTRIBS: 0x8869; + readonly MAX_VERTEX_UNIFORM_VECTORS: 0x8DFB; + readonly MAX_VARYING_VECTORS: 0x8DFC; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8B4D; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8B4C; + readonly MAX_TEXTURE_IMAGE_UNITS: 0x8872; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: 0x8DFD; + readonly SHADER_TYPE: 0x8B4F; + readonly DELETE_STATUS: 0x8B80; + readonly LINK_STATUS: 0x8B82; + readonly VALIDATE_STATUS: 0x8B83; + readonly ATTACHED_SHADERS: 0x8B85; + readonly ACTIVE_UNIFORMS: 0x8B86; + readonly ACTIVE_ATTRIBUTES: 0x8B89; + readonly SHADING_LANGUAGE_VERSION: 0x8B8C; + readonly CURRENT_PROGRAM: 0x8B8D; + readonly NEVER: 0x0200; + readonly LESS: 0x0201; + readonly EQUAL: 0x0202; + readonly LEQUAL: 0x0203; + readonly GREATER: 0x0204; + readonly NOTEQUAL: 0x0205; + readonly GEQUAL: 0x0206; + readonly ALWAYS: 0x0207; + readonly KEEP: 0x1E00; + readonly REPLACE: 0x1E01; + readonly INCR: 0x1E02; + readonly DECR: 0x1E03; + readonly INVERT: 0x150A; + readonly INCR_WRAP: 0x8507; + readonly DECR_WRAP: 0x8508; + readonly VENDOR: 0x1F00; + readonly RENDERER: 0x1F01; + readonly VERSION: 0x1F02; + readonly NEAREST: 0x2600; + readonly LINEAR: 0x2601; + readonly NEAREST_MIPMAP_NEAREST: 0x2700; + readonly LINEAR_MIPMAP_NEAREST: 0x2701; + readonly NEAREST_MIPMAP_LINEAR: 0x2702; + readonly LINEAR_MIPMAP_LINEAR: 0x2703; + readonly TEXTURE_MAG_FILTER: 0x2800; + readonly TEXTURE_MIN_FILTER: 0x2801; + readonly TEXTURE_WRAP_S: 0x2802; + readonly TEXTURE_WRAP_T: 0x2803; + readonly TEXTURE_2D: 0x0DE1; + readonly TEXTURE: 0x1702; + readonly TEXTURE_CUBE_MAP: 0x8513; + readonly TEXTURE_BINDING_CUBE_MAP: 0x8514; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851A; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: 0x851C; + readonly TEXTURE0: 0x84C0; + readonly TEXTURE1: 0x84C1; + readonly TEXTURE2: 0x84C2; + readonly TEXTURE3: 0x84C3; + readonly TEXTURE4: 0x84C4; + readonly TEXTURE5: 0x84C5; + readonly TEXTURE6: 0x84C6; + readonly TEXTURE7: 0x84C7; + readonly TEXTURE8: 0x84C8; + readonly TEXTURE9: 0x84C9; + readonly TEXTURE10: 0x84CA; + readonly TEXTURE11: 0x84CB; + readonly TEXTURE12: 0x84CC; + readonly TEXTURE13: 0x84CD; + readonly TEXTURE14: 0x84CE; + readonly TEXTURE15: 0x84CF; + readonly TEXTURE16: 0x84D0; + readonly TEXTURE17: 0x84D1; + readonly TEXTURE18: 0x84D2; + readonly TEXTURE19: 0x84D3; + readonly TEXTURE20: 0x84D4; + readonly TEXTURE21: 0x84D5; + readonly TEXTURE22: 0x84D6; + readonly TEXTURE23: 0x84D7; + readonly TEXTURE24: 0x84D8; + readonly TEXTURE25: 0x84D9; + readonly TEXTURE26: 0x84DA; + readonly TEXTURE27: 0x84DB; + readonly TEXTURE28: 0x84DC; + readonly TEXTURE29: 0x84DD; + readonly TEXTURE30: 0x84DE; + readonly TEXTURE31: 0x84DF; + readonly ACTIVE_TEXTURE: 0x84E0; + readonly REPEAT: 0x2901; + readonly CLAMP_TO_EDGE: 0x812F; + readonly MIRRORED_REPEAT: 0x8370; + readonly FLOAT_VEC2: 0x8B50; + readonly FLOAT_VEC3: 0x8B51; + readonly FLOAT_VEC4: 0x8B52; + readonly INT_VEC2: 0x8B53; + readonly INT_VEC3: 0x8B54; + readonly INT_VEC4: 0x8B55; + readonly BOOL: 0x8B56; + readonly BOOL_VEC2: 0x8B57; + readonly BOOL_VEC3: 0x8B58; + readonly BOOL_VEC4: 0x8B59; + readonly FLOAT_MAT2: 0x8B5A; + readonly FLOAT_MAT3: 0x8B5B; + readonly FLOAT_MAT4: 0x8B5C; + readonly SAMPLER_2D: 0x8B5E; + readonly SAMPLER_CUBE: 0x8B60; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622; + readonly VERTEX_ATTRIB_ARRAY_SIZE: 0x8623; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624; + readonly VERTEX_ATTRIB_ARRAY_TYPE: 0x8625; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886A; + readonly VERTEX_ATTRIB_ARRAY_POINTER: 0x8645; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889F; + readonly IMPLEMENTATION_COLOR_READ_TYPE: 0x8B9A; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: 0x8B9B; + readonly COMPILE_STATUS: 0x8B81; + readonly LOW_FLOAT: 0x8DF0; + readonly MEDIUM_FLOAT: 0x8DF1; + readonly HIGH_FLOAT: 0x8DF2; + readonly LOW_INT: 0x8DF3; + readonly MEDIUM_INT: 0x8DF4; + readonly HIGH_INT: 0x8DF5; + readonly FRAMEBUFFER: 0x8D40; + readonly RENDERBUFFER: 0x8D41; + readonly RGBA4: 0x8056; + readonly RGB5_A1: 0x8057; + readonly RGB565: 0x8D62; + readonly DEPTH_COMPONENT16: 0x81A5; + readonly STENCIL_INDEX8: 0x8D48; + readonly DEPTH_STENCIL: 0x84F9; + readonly RENDERBUFFER_WIDTH: 0x8D42; + readonly RENDERBUFFER_HEIGHT: 0x8D43; + readonly RENDERBUFFER_INTERNAL_FORMAT: 0x8D44; + readonly RENDERBUFFER_RED_SIZE: 0x8D50; + readonly RENDERBUFFER_GREEN_SIZE: 0x8D51; + readonly RENDERBUFFER_BLUE_SIZE: 0x8D52; + readonly RENDERBUFFER_ALPHA_SIZE: 0x8D53; + readonly RENDERBUFFER_DEPTH_SIZE: 0x8D54; + readonly RENDERBUFFER_STENCIL_SIZE: 0x8D55; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8CD0; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8CD1; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8CD2; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8CD3; + readonly COLOR_ATTACHMENT0: 0x8CE0; + readonly DEPTH_ATTACHMENT: 0x8D00; + readonly STENCIL_ATTACHMENT: 0x8D20; + readonly DEPTH_STENCIL_ATTACHMENT: 0x821A; + readonly NONE: 0; + readonly FRAMEBUFFER_COMPLETE: 0x8CD5; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8CD6; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8CD7; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8CD9; + readonly FRAMEBUFFER_UNSUPPORTED: 0x8CDD; + readonly FRAMEBUFFER_BINDING: 0x8CA6; + readonly RENDERBUFFER_BINDING: 0x8CA7; + readonly MAX_RENDERBUFFER_SIZE: 0x84E8; + readonly INVALID_FRAMEBUFFER_OPERATION: 0x0506; + readonly UNPACK_FLIP_Y_WEBGL: 0x9240; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241; + readonly CONTEXT_LOST_WEBGL: 0x9242; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243; + readonly BROWSER_DEFAULT_WEBGL: 0x9244; } interface WebGLRenderingContextOverloads { @@ -5482,10 +5519,10 @@ interface WebSocket extends EventTarget { close(code?: number, reason?: string): void; /** Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView. */ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSING: 2; + readonly CLOSED: 3; addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5495,10 +5532,10 @@ interface WebSocket extends EventTarget { declare var WebSocket: { prototype: WebSocket; new(url: string | URL, protocols?: string | string[]): WebSocket; - readonly CLOSED: number; - readonly CLOSING: number; - readonly CONNECTING: number; - readonly OPEN: number; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSING: 2; + readonly CLOSED: 3; }; /** This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */ @@ -5748,11 +5785,11 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { * Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value. */ setRequestHeader(name: string, value: string): void; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; + readonly UNSENT: 0; + readonly OPENED: 1; + readonly HEADERS_RECEIVED: 2; + readonly LOADING: 3; + readonly DONE: 4; addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5762,11 +5799,11 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { declare var XMLHttpRequest: { prototype: XMLHttpRequest; new(): XMLHttpRequest; - readonly DONE: number; - readonly HEADERS_RECEIVED: number; - readonly LOADING: number; - readonly OPENED: number; - readonly UNSENT: number; + readonly UNSENT: 0; + readonly OPENED: 1; + readonly HEADERS_RECEIVED: 2; + readonly LOADING: 3; + readonly DONE: 4; }; interface XMLHttpRequestEventTargetEventMap { @@ -6144,6 +6181,7 @@ type ColorSpaceConversion = "default" | "none"; type DocumentVisibilityState = "hidden" | "visible"; type EndingType = "native" | "transparent"; type FileSystemHandleKind = "directory" | "file"; +type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap"; type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; @@ -6153,7 +6191,7 @@ type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; type IDBRequestReadyState = "done" | "pending"; type IDBTransactionDurability = "default" | "relaxed" | "strict"; type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; -type ImageOrientation = "flipY" | "none"; +type ImageOrientation = "flipY" | "from-image"; type ImageSmoothingQuality = "high" | "low" | "medium"; type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; type KeyType = "private" | "public" | "secret"; diff --git a/lib/tsc.js b/lib/tsc.js index ed55980b61335..f572475b0eb04 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -23,7 +23,7 @@ var __export = (target, all) => { // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.0-dev.20230112`; +var version = `${versionMajorMinor}.0-beta`; // src/compiler/core.ts var emptyArray = []; @@ -767,6 +767,18 @@ function arrayToMultiMap(values, makeKey, makeValue = identity) { function group(values, getGroupId, resultSelector = identity) { return arrayFrom(arrayToMultiMap(values, getGroupId).values(), resultSelector); } +function groupBy(values, keySelector) { + var _a2; + const result = {}; + if (values) { + for (const value of values) { + const key = `${keySelector(value)}`; + const array = (_a2 = result[key]) != null ? _a2 : result[key] = []; + array.push(value); + } + } + return result; +} function clone(object) { const result = {}; for (const id in object) { @@ -1263,12 +1275,24 @@ function padRight(s, length2, padString = " ") { return length2 <= s.length ? s : s + padString.repeat(length2 - s.length); } function takeWhile(array, predicate) { - const len = array.length; - let index = 0; - while (index < len && predicate(array[index])) { - index++; + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(0, index); + } +} +function skipWhile(array, predicate) { + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(index); } - return array.slice(0, index); } var trimString = !!String.prototype.trim ? (s) => s.trim() : (s) => trimStringEnd(trimStringStart(s)); var trimStringEnd = !!String.prototype.trimEnd ? (s) => s.trimEnd() : trimEndImpl; @@ -3445,14 +3469,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => { SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 350] = "JSDocSeeTag"; SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 351] = "JSDocPropertyTag"; SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 352] = "JSDocThrowsTag"; - SyntaxKind4[SyntaxKind4["SyntaxList"] = 353] = "SyntaxList"; - SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 354] = "NotEmittedStatement"; - SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression"; - SyntaxKind4[SyntaxKind4["CommaListExpression"] = 356] = "CommaListExpression"; - SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 357] = "MergeDeclarationMarker"; - SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 358] = "EndOfDeclarationMarker"; - SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 359] = "SyntheticReferenceExpression"; - SyntaxKind4[SyntaxKind4["Count"] = 360] = "Count"; + SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag"; + SyntaxKind4[SyntaxKind4["SyntaxList"] = 354] = "SyntaxList"; + SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 355] = "NotEmittedStatement"; + SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression"; + SyntaxKind4[SyntaxKind4["CommaListExpression"] = 357] = "CommaListExpression"; + SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker"; + SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker"; + SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression"; + SyntaxKind4[SyntaxKind4["Count"] = 361] = "Count"; SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment"; SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment"; SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment"; @@ -3481,9 +3506,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => { SyntaxKind4[SyntaxKind4["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement"; SyntaxKind4[SyntaxKind4["FirstNode"] = 163 /* QualifiedName */] = "FirstNode"; SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocNode"; + SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocNode"; SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocTagNode"; + SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocTagNode"; SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword"; SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword"; return SyntaxKind4; @@ -3525,6 +3550,8 @@ var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { NodeFlags3[NodeFlags3["ContextFlags"] = 50720768] = "ContextFlags"; NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; + NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape"; + NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace"; return NodeFlags3; })(NodeFlags || {}); var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { @@ -3942,11 +3969,6 @@ var EmitFlags = /* @__PURE__ */ ((EmitFlags3) => { EmitFlags3[EmitFlags3["HasEndOfDeclarationMarker"] = 8388608] = "HasEndOfDeclarationMarker"; EmitFlags3[EmitFlags3["Iterator"] = 16777216] = "Iterator"; EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 33554432] = "NoAsciiEscaping"; - EmitFlags3[EmitFlags3["TypeScriptClassWrapper"] = 67108864] = "TypeScriptClassWrapper"; - EmitFlags3[EmitFlags3["NeverApplyImportHelper"] = 134217728] = "NeverApplyImportHelper"; - EmitFlags3[EmitFlags3["IgnoreSourceNewlines"] = 268435456] = "IgnoreSourceNewlines"; - EmitFlags3[EmitFlags3["Immutable"] = 536870912] = "Immutable"; - EmitFlags3[EmitFlags3["IndirectCall"] = 1073741824] = "IndirectCall"; return EmitFlags3; })(EmitFlags || {}); var commentPragmas = { @@ -5916,10 +5938,9 @@ var Diagnostics = { Line_terminator_not_permitted_before_arrow: diag(1200, 1 /* Error */, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, 1 /* Error */, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, 1 /* Error */, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), - Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), + Re_exporting_a_type_when_0_is_enabled_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205", "Re-exporting a type when '{0}' is enabled requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, 1 /* Error */, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, 1 /* Error */, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, 1 /* Error */, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, 1 /* Error */, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, 1 /* Error */, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, 1 /* Error */, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), @@ -5929,7 +5950,6 @@ var Diagnostics = { Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, 1 /* Error */, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, 1 /* Error */, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, 1 /* Error */, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, 1 /* Error */, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."), Generators_are_not_allowed_in_an_ambient_context: diag(1221, 1 /* Error */, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, 1 /* Error */, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), _0_tag_already_specified: diag(1223, 1 /* Error */, "_0_tag_already_specified_1223", "'{0}' tag already specified."), @@ -5976,7 +5996,7 @@ var Diagnostics = { An_optional_element_cannot_follow_a_rest_element: diag(1266, 1 /* Error */, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, 1 /* Error */, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, 1 /* Error */, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), - Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."), + Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269", "Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."), Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, 1 /* Error */, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, 1 /* Error */, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, 1 /* Error */, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), @@ -5985,6 +6005,17 @@ var Diagnostics = { accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1 /* Error */, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), An_accessor_property_cannot_be_declared_optional: diag(1276, 1 /* Error */, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), _0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: diag(1277, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0: diag(1278, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278", "The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0: diag(1279, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279", "The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."), + Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement: diag(1280, 1 /* Error */, "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280", "Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."), + Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead: diag(1281, 1 /* Error */, "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281", "Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."), + An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1282, 1 /* Error */, "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282", "An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), @@ -6056,7 +6087,6 @@ var Diagnostics = { An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), - Only_named_exports_may_use_export_type: diag(1383, 1 /* Error */, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."), Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), @@ -6104,7 +6134,7 @@ var Diagnostics = { The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."), - Decorators_may_not_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."), + Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."), Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, 1 /* Error */, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), @@ -6117,7 +6147,7 @@ var Diagnostics = { Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, 1 /* Error */, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), - _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."), Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"), Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"), @@ -6145,6 +6175,8 @@ var Diagnostics = { To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), + _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -6602,7 +6634,7 @@ var Diagnostics = { This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1 /* Error */, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), - Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), + Cannot_access_ambient_const_enums_when_0_is_enabled: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."), _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1 /* Error */, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, 1 /* Error */, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), @@ -6850,12 +6882,12 @@ var Diagnostics = { The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, 1 /* Error */, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, 1 /* Error */, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, 1 /* Error */, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), - Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."), + Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."), The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), - Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_eithe_5096", "Option 'allowImportingTsExtensions' can only be used when 'moduleResolution' is set to 'bundler' and either 'noEmit' or 'emitDeclarationOnly' is set."), + Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), @@ -6863,6 +6895,9 @@ var Diagnostics = { Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), + Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), + Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), + Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -7145,6 +7180,8 @@ var Diagnostics = { package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."), + Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."), + There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`), Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), @@ -7269,7 +7306,7 @@ var Diagnostics = { Filters_results_from_the_include_option: diag(6627, 3 /* Message */, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), Remove_a_list_of_directories_from_the_watch_process: diag(6628, 3 /* Message */, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, 3 /* Message */, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), - Enable_experimental_support_for_TC39_stage_2_draft_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630", "Enable experimental support for TC39 stage 2 draft decorators."), + Enable_experimental_support_for_legacy_experimental_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_legacy_experimental_decorators_6630", "Enable experimental support for legacy experimental decorators."), Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, 3 /* Message */, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), Output_more_detailed_compiler_performance_information_after_building: diag(6632, 3 /* Message */, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, 3 /* Message */, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), @@ -7355,6 +7392,7 @@ var Diagnostics = { Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), + Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."), one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"), one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"), type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"), @@ -7490,6 +7528,7 @@ var Diagnostics = { You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), + Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -7775,7 +7814,8 @@ var Diagnostics = { _0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), _0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), - The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here.") + The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."), + Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.") }; // src/compiler/scanner.ts @@ -8365,10 +8405,7 @@ function reduceEachTrailingCommentRange(text, pos, cb, state, initial) { initial ); } -function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) { - if (!comments) { - comments = []; - } +function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments = []) { comments.push({ kind, pos, end, hasTrailingNewLine }); return comments; } @@ -9979,7 +10016,7 @@ function createTextChangeRange(span, newLength) { } var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); function isParameterPropertyDeclaration(node, parent) { - return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 173 /* Constructor */; + return isParameter(node) && hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 173 /* Constructor */; } function walkUpBindingElementsAndPatterns(binding) { let node = binding.parent; @@ -10069,7 +10106,10 @@ function getOriginalNode(node, nodeTest) { node = node.original; } } - return !nodeTest || nodeTest(node) ? node : void 0; + if (!node || !nodeTest) { + return node; + } + return nodeTest(node) ? node : void 0; } function findAncestor(node, callback) { while (node) { @@ -10108,6 +10148,10 @@ function unescapeLeadingUnderscores(identifier) { function idText(identifierOrPrivateName) { return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); } +function identifierToKeywordKind(node) { + const token = stringToToken(node.escapedText); + return token ? tryCast(token, isKeyword) : void 0; +} function symbolName(symbol) { if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { return idText(symbol.valueDeclaration.name); @@ -10368,6 +10412,9 @@ function getJSDocThisTag(node) { function getJSDocReturnTag(node) { return getFirstJSDocTag(node, isJSDocReturnTag); } +function getJSDocSatisfiesTag(node) { + return getFirstJSDocTag(node, isJSDocSatisfiesTag); +} function getJSDocTypeTag(node) { const tag = getFirstJSDocTag(node, isJSDocTypeTag); if (tag && tag.typeExpression && tag.typeExpression.type) { @@ -10400,15 +10447,17 @@ function getJSDocReturnType(node) { } } function getJSDocTagsWorker(node, noCache) { + var _a2, _b; if (!canHaveJSDoc(node)) return emptyArray; - let tags = node.jsDocCache; + let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache; if (tags === void 0 || noCache) { const comments = getJSDocCommentsAndTags(node, noCache); Debug.assert(comments.length < 2 || comments[0] !== comments[1]); tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j); if (!noCache) { - node.jsDocCache = tags; + (_b = node.jsDoc) != null ? _b : node.jsDoc = []; + node.jsDoc.jsDocCache = tags; } } return tags; @@ -10534,9 +10583,6 @@ function isNodeKind(kind) { function isTokenKind(kind) { return kind >= 0 /* FirstToken */ && kind <= 162 /* LastToken */; } -function isToken(n) { - return isTokenKind(n.kind); -} function isNodeArray(array) { return hasProperty(array, "pos") && hasProperty(array, "end"); } @@ -10567,28 +10613,42 @@ function isTemplateMiddleOrTemplateTail(node) { function isImportOrExportSpecifier(node) { return isImportSpecifier(node) || isExportSpecifier(node); } -function isTypeOnlyImportOrExportDeclaration(node) { +function isTypeOnlyImportDeclaration(node) { switch (node.kind) { case 273 /* ImportSpecifier */: - case 278 /* ExportSpecifier */: return node.isTypeOnly || node.parent.parent.isTypeOnly; case 271 /* NamespaceImport */: return node.parent.isTypeOnly; case 270 /* ImportClause */: case 268 /* ImportEqualsDeclaration */: return node.isTypeOnly; - default: - return false; } + return false; +} +function isTypeOnlyExportDeclaration(node) { + switch (node.kind) { + case 278 /* ExportSpecifier */: + return node.isTypeOnly || node.parent.parent.isTypeOnly; + case 275 /* ExportDeclaration */: + return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; + case 277 /* NamespaceExport */: + return node.parent.isTypeOnly; + } + return false; +} +function isTypeOnlyImportOrExportDeclaration(node) { + return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node); } function isAssertionKey(node) { return isStringLiteral(node) || isIdentifier(node); } function isGeneratedIdentifier(node) { - return isIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isGeneratedPrivateIdentifier(node) { - return isPrivateIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isPrivateIdentifierClassElementDeclaration(node) { return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name); @@ -10702,6 +10762,17 @@ function isMethodOrAccessor(node) { return false; } } +function isNamedClassElement(node) { + switch (node.kind) { + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: + case 169 /* PropertyDeclaration */: + return true; + default: + return false; + } +} function isModifierLike(node) { return isModifier(node) || isDecorator(node); } @@ -10748,6 +10819,9 @@ function isDeclarationBindingElement(bindingElement) { } return false; } +function isBindingOrAssignmentElement(node) { + return isVariableDeclaration(node) || isParameter(node) || isObjectBindingOrAssignmentElement(node) || isArrayBindingOrAssignmentElement(node); +} function isBindingOrAssignmentPattern(node) { return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); } @@ -10777,6 +10851,24 @@ function isArrayBindingOrAssignmentPattern(node) { } return false; } +function isArrayBindingOrAssignmentElement(node) { + switch (node.kind) { + case 205 /* BindingElement */: + case 229 /* OmittedExpression */: + case 227 /* SpreadElement */: + case 206 /* ArrayLiteralExpression */: + case 207 /* ObjectLiteralExpression */: + case 79 /* Identifier */: + case 208 /* PropertyAccessExpression */: + case 209 /* ElementAccessExpression */: + return true; + } + return isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ); +} function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { const kind = node.kind; return kind === 208 /* PropertyAccessExpression */ || kind === 163 /* QualifiedName */ || kind === 202 /* ImportType */; @@ -10836,6 +10928,7 @@ function isLeftHandSideExpressionKind(kind) { case 230 /* ExpressionWithTypeArguments */: case 233 /* MetaProperty */: case 100 /* ImportKeyword */: + case 279 /* MissingDeclaration */: return true; default: return false; @@ -10858,6 +10951,17 @@ function isUnaryExpressionKind(kind) { return isLeftHandSideExpressionKind(kind); } } +function isLiteralTypeLiteral(node) { + switch (node.kind) { + case 104 /* NullKeyword */: + case 110 /* TrueKeyword */: + case 95 /* FalseKeyword */: + case 221 /* PrefixUnaryExpression */: + return true; + default: + return isLiteralExpression(node); + } +} function isExpression(node) { return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); } @@ -10870,8 +10974,8 @@ function isExpressionKind(kind) { case 227 /* SpreadElement */: case 231 /* AsExpression */: case 229 /* OmittedExpression */: - case 356 /* CommaListExpression */: - case 355 /* PartiallyEmittedExpression */: + case 357 /* CommaListExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: return true; default: @@ -11042,7 +11146,7 @@ function isDeclarationStatementKind(kind) { return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 354 /* NotEmittedStatement */ || kind === 358 /* EndOfDeclarationMarker */ || kind === 357 /* MergeDeclarationMarker */; + return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 355 /* NotEmittedStatement */ || kind === 359 /* EndOfDeclarationMarker */ || kind === 358 /* MergeDeclarationMarker */; } function isDeclaration(node) { if (node.kind === 165 /* TypeParameter */) { @@ -11103,10 +11207,10 @@ function isCaseOrDefaultClause(node) { return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */; } function isJSDocNode(node) { - return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */; + return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */; } function isJSDocTag(node) { - return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 352 /* LastJSDocTagNode */; + return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */; } function isSetAccessor(node) { return node.kind === 175 /* SetAccessor */; @@ -11139,9 +11243,6 @@ function hasOnlyExpressionInitializer(node) { return false; } } -function isObjectLiteralElement(node) { - return node.kind === 288 /* JsxAttribute */ || node.kind === 290 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); -} function isTypeReferenceType(node) { return node.kind === 180 /* TypeReference */ || node.kind === 230 /* ExpressionWithTypeArguments */; } @@ -11494,7 +11595,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (includeJsDoc && hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 353 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return skipTrivia( @@ -11539,6 +11640,10 @@ function getEmitFlags(node) { const emitNode = node.emitNode; return emitNode && emitNode.flags || 0; } +function getInternalEmitFlags(node) { + const emitNode = node.emitNode; + return emitNode && emitNode.internalFlags || 0; +} function getScriptTargetFeatures() { return { es2015: { @@ -11757,6 +11862,9 @@ function isEffectiveStrictModeSourceFile(node, compilerOptions) { } return false; } +function isAmbientPropertyDeclaration(node) { + return !!(node.flags & 16777216 /* Ambient */) || hasSyntacticModifier(node, 2 /* Ambient */); +} function isBlockScope(node, parentNode) { switch (node.kind) { case 308 /* SourceFile */: @@ -11832,10 +11940,11 @@ function isComputedNonLiteralName(name) { return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } function tryGetTextOfPropertyName(name) { + var _a2; switch (name.kind) { case 79 /* Identifier */: case 80 /* PrivateIdentifier */: - return name.autoGenerate ? void 0 : name.escapedText; + return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: @@ -11884,11 +11993,14 @@ function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, ar const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); } -function createDiagnosticForNodeFromMessageChain(node, messageChain, relatedInformation) { - const sourceFile = getSourceFileOfNode(node); +function createDiagnosticForNodeFromMessageChain(sourceFile, node, messageChain, relatedInformation) { const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation); } +function createDiagnosticForNodeArrayFromMessageChain(sourceFile, nodes, messageChain, relatedInformation) { + const start = skipTrivia(sourceFile.text, nodes.pos); + return createFileDiagnosticFromMessageChain(sourceFile, start, nodes.end - start, messageChain, relatedInformation); +} function assertDiagnosticLocation(file, start, length2) { Debug.assertGreaterThanOrEqual(start, 0); Debug.assertGreaterThanOrEqual(length2, 0); @@ -11953,6 +12065,20 @@ function getSpanOfTokenAtPosition(sourceFile, pos) { const start = scanner.getTokenPos(); return createTextSpanFromBounds(start, scanner.getTextPos()); } +function scanTokenAtPosition(sourceFile, pos) { + const scanner = createScanner( + sourceFile.languageVersion, + /*skipTrivia*/ + true, + sourceFile.languageVariant, + sourceFile.text, + /*onError:*/ + void 0, + pos + ); + scanner.scan(); + return scanner.getToken(); +} function getErrorSpanForArrowFunction(sourceFile, node) { const pos = skipTrivia(sourceFile.text, node.pos); if (node.body && node.body.kind === 238 /* Block */) { @@ -12528,47 +12654,90 @@ function getInvokedExpression(node) { return node.expression; } } -function nodeCanBeDecorated(node, parent, grandparent) { - if (isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { +function nodeCanBeDecorated(useLegacyDecorators, node, parent, grandparent) { + if (useLegacyDecorators && isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { return false; } switch (node.kind) { case 260 /* ClassDeclaration */: return true; + case 228 /* ClassExpression */: + return !useLegacyDecorators; case 169 /* PropertyDeclaration */: - return parent.kind === 260 /* ClassDeclaration */; + return parent !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent) : isClassLike(parent) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); case 174 /* GetAccessor */: case 175 /* SetAccessor */: case 171 /* MethodDeclaration */: - return node.body !== void 0 && parent.kind === 260 /* ClassDeclaration */; + return node.body !== void 0 && parent !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent) : isClassLike(parent)); case 166 /* Parameter */: - return parent.body !== void 0 && (parent.kind === 173 /* Constructor */ || parent.kind === 171 /* MethodDeclaration */ || parent.kind === 175 /* SetAccessor */) && grandparent.kind === 260 /* ClassDeclaration */; + if (!useLegacyDecorators) + return false; + return parent !== void 0 && parent.body !== void 0 && (parent.kind === 173 /* Constructor */ || parent.kind === 171 /* MethodDeclaration */ || parent.kind === 175 /* SetAccessor */) && getThisParameter(parent) !== node && grandparent !== void 0 && grandparent.kind === 260 /* ClassDeclaration */; } return false; } -function nodeIsDecorated(node, parent, grandparent) { - return hasDecorators(node) && nodeCanBeDecorated(node, parent, grandparent); +function nodeIsDecorated(useLegacyDecorators, node, parent, grandparent) { + return hasDecorators(node) && nodeCanBeDecorated(useLegacyDecorators, node, parent, grandparent); } -function nodeOrChildIsDecorated(node, parent, grandparent) { - return nodeIsDecorated(node, parent, grandparent) || childIsDecorated(node, parent); +function nodeOrChildIsDecorated(useLegacyDecorators, node, parent, grandparent) { + return nodeIsDecorated(useLegacyDecorators, node, parent, grandparent) || childIsDecorated(useLegacyDecorators, node, parent); } -function childIsDecorated(node, parent) { +function childIsDecorated(useLegacyDecorators, node, parent) { switch (node.kind) { case 260 /* ClassDeclaration */: - return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent)); + return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent)); + case 228 /* ClassExpression */: + return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent)); case 171 /* MethodDeclaration */: case 175 /* SetAccessor */: case 173 /* Constructor */: - return some(node.parameters, (p) => nodeIsDecorated(p, node, parent)); + return some(node.parameters, (p) => nodeIsDecorated(useLegacyDecorators, p, node, parent)); default: return false; } } -function classOrConstructorParameterIsDecorated(node) { - if (nodeIsDecorated(node)) +function classOrConstructorParameterIsDecorated(useLegacyDecorators, node) { + if (nodeIsDecorated(useLegacyDecorators, node)) return true; const constructor = getFirstConstructorWithBody(node); - return !!constructor && childIsDecorated(constructor, node); + return !!constructor && childIsDecorated(useLegacyDecorators, constructor, node); +} +function classElementOrClassElementParameterIsDecorated(useLegacyDecorators, node, parent) { + let parameters; + if (isAccessor(node)) { + const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(parent.members, node); + const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0; + if (!firstAccessorWithDecorators || node !== firstAccessorWithDecorators) { + return false; + } + parameters = setAccessor == null ? void 0 : setAccessor.parameters; + } else if (isMethodDeclaration(node)) { + parameters = node.parameters; + } + if (nodeIsDecorated(useLegacyDecorators, node, parent)) { + return true; + } + if (parameters) { + for (const parameter of parameters) { + if (parameterIsThisKeyword(parameter)) + continue; + if (nodeIsDecorated(useLegacyDecorators, parameter, node, parent)) + return true; + } + } + return false; +} +function isEmptyStringLiteral(node) { + if (node.textSourceNode) { + switch (node.textSourceNode.kind) { + case 10 /* StringLiteral */: + return isEmptyStringLiteral(node.textSourceNode); + case 14 /* NoSubstitutionTemplateLiteral */: + return node.text === ""; + } + return false; + } + return node.text === ""; } function isJSXTagName(node) { const { parent } = node; @@ -12762,6 +12931,9 @@ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) { true ); } +function isBindingElementOfBareOrAccessedRequire(node) { + return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); +} function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) { return isVariableDeclaration(node) && !!node.initializer && isRequireCall( allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, @@ -13006,7 +13178,7 @@ function isSpecialPropertyDeclaration(expr) { } function setValueDeclaration(symbol, node) { const { valueDeclaration } = symbol; - if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { + if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !isInJSFile(node) && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { symbol.valueDeclaration = node; } } @@ -13021,6 +13193,7 @@ function tryGetModuleSpecifierFromDeclaration(node) { var _a2, _b; switch (node.kind) { case 257 /* VariableDeclaration */: + case 205 /* BindingElement */: return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall( node2, /*requireStringLiteralLikeArgument*/ @@ -13030,6 +13203,14 @@ function tryGetModuleSpecifierFromDeclaration(node) { return tryCast(node.moduleSpecifier, isStringLiteralLike); case 268 /* ImportEqualsDeclaration */: return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); + case 270 /* ImportClause */: + case 277 /* NamespaceExport */: + return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); + case 271 /* NamespaceImport */: + case 278 /* ExportSpecifier */: + return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); + case 273 /* ImportSpecifier */: + return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); default: Debug.assertNever(node); } @@ -13252,7 +13433,7 @@ function filterOwnedJSDocTags(hostNode, jsDoc) { return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0; } function ownsJSDocTag(hostNode, tag) { - return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; + return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; } function getNextJSDocCommentLocation(node) { const parent = node.parent; @@ -13553,7 +13734,8 @@ function isStringANonContextualKeyword(name) { const token = stringToToken(name); return token !== void 0 && isNonContextualKeyword(token); } -function isIdentifierANonContextualKeyword({ originalKeywordKind }) { +function isIdentifierANonContextualKeyword(node) { + const originalKeywordKind = identifierToKeywordKind(node); return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind); } function getFunctionFlags(node) { @@ -13652,6 +13834,72 @@ function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) { function isKnownSymbol(symbol) { return startsWith(symbol.escapedName, "__@"); } +function isProtoSetter(node) { + return isIdentifier(node) ? idText(node) === "__proto__" : isStringLiteral(node) && node.text === "__proto__"; +} +function isAnonymousFunctionDefinition(node, cb) { + node = skipOuterExpressions(node); + switch (node.kind) { + case 228 /* ClassExpression */: + case 215 /* FunctionExpression */: + if (node.name) { + return false; + } + break; + case 216 /* ArrowFunction */: + break; + default: + return false; + } + return typeof cb === "function" ? cb(node) : true; +} +function isNamedEvaluationSource(node) { + switch (node.kind) { + case 299 /* PropertyAssignment */: + return !isProtoSetter(node.name); + case 300 /* ShorthandPropertyAssignment */: + return !!node.objectAssignmentInitializer; + case 257 /* VariableDeclaration */: + return isIdentifier(node.name) && !!node.initializer; + case 166 /* Parameter */: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 205 /* BindingElement */: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 169 /* PropertyDeclaration */: + return !!node.initializer; + case 223 /* BinaryExpression */: + switch (node.operatorToken.kind) { + case 63 /* EqualsToken */: + case 76 /* AmpersandAmpersandEqualsToken */: + case 75 /* BarBarEqualsToken */: + case 77 /* QuestionQuestionEqualsToken */: + return isIdentifier(node.left); + } + break; + case 274 /* ExportAssignment */: + return true; + } + return false; +} +function isNamedEvaluation(node, cb) { + if (!isNamedEvaluationSource(node)) + return false; + switch (node.kind) { + case 299 /* PropertyAssignment */: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 300 /* ShorthandPropertyAssignment */: + return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); + case 257 /* VariableDeclaration */: + case 166 /* Parameter */: + case 205 /* BindingElement */: + case 169 /* PropertyDeclaration */: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 223 /* BinaryExpression */: + return isAnonymousFunctionDefinition(node.right, cb); + case 274 /* ExportAssignment */: + return isAnonymousFunctionDefinition(node.expression, cb); + } +} function isPushOrUnshiftIdentifier(node) { return node.escapedText === "push" || node.escapedText === "unshift"; } @@ -13729,7 +13977,7 @@ function getOperator(expression) { } function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return 0 /* Comma */; case 227 /* SpreadElement */: return 1 /* Spread */; @@ -14365,7 +14613,7 @@ function isThisInTypeQuery(node) { return node.parent.kind === 183 /* TypeQuery */; } function identifierIsThisKeyword(id) { - return id.originalKeywordKind === 108 /* ThisKeyword */; + return id.escapedText === "this"; } function getAllAccessorDeclarations(declarations, accessor) { let firstAccessor; @@ -14664,7 +14912,7 @@ function getEffectiveModifierFlagsNoCache(node) { } function getSyntacticModifierFlagsNoCache(node) { let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */; - if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) { + if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { flags |= 1 /* Export */; } return flags; @@ -14715,14 +14963,23 @@ function modifierToFlag(token) { } return 0 /* None */; } +function isBinaryLogicalOperator(token) { + return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */; +} function isLogicalOperator(token) { - return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */ || token === 53 /* ExclamationToken */; + return isBinaryLogicalOperator(token) || token === 53 /* ExclamationToken */; } function isLogicalOrCoalescingAssignmentOperator(token) { return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */; } function isLogicalOrCoalescingAssignmentExpression(expr) { - return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); + return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); +} +function isLogicalOrCoalescingBinaryOperator(token) { + return isBinaryLogicalOperator(token) || token === 60 /* QuestionQuestionToken */; +} +function isLogicalOrCoalescingBinaryExpression(expr) { + return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind); } function isAssignmentOperator(token) { return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */; @@ -14901,14 +15158,14 @@ function directoryProbablyExists(directoryName, host) { } var carriageReturnLineFeed = "\r\n"; var lineFeed = "\n"; -function getNewLineCharacter(options, getNewLine) { +function getNewLineCharacter(options) { switch (options.newLine) { case 0 /* CarriageReturnLineFeed */: return carriageReturnLineFeed; case 1 /* LineFeed */: + case void 0: return lineFeed; } - return getNewLine ? getNewLine() : sys ? sys.newLine : carriageReturnLineFeed; } function createRange(pos, end = pos) { Debug.assert(end >= pos || end === -1); @@ -14925,6 +15182,9 @@ function moveRangePastDecorators(node) { return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; } function moveRangePastModifiers(node) { + if (isPropertyDeclaration(node) || isMethodDeclaration(node)) { + return moveRangePos(node, node.name.pos); + } const lastModifier = canHaveModifiers(node) ? lastOrUndefined(node.modifiers) : void 0; return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); } @@ -15029,7 +15289,7 @@ function getInitializedVariables(node) { return filter(node.declarations, isInitializedVariable); } function isInitializedVariable(node) { - return node.initializer !== void 0; + return isVariableDeclaration(node) && node.initializer !== void 0; } function isWatchSet(options) { return options.watch && hasProperty(options, "watch"); @@ -15190,7 +15450,7 @@ function getLastChild(node) { return lastChild; } function isTypeNodeKind(kind) { - return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; + return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 139 /* IntrinsicKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; } function isAccessExpression(node) { return node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */; @@ -15233,7 +15493,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) { case 209 /* ElementAccessExpression */: case 208 /* PropertyAccessExpression */: case 232 /* NonNullExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: node = node.expression; continue; @@ -15301,7 +15561,6 @@ function Identifier2(kind, pos, end) { this.parent = void 0; this.original = void 0; this.emitNode = void 0; - this.flowNode = void 0; } function SourceMapSource(fileName, text, skipTrivia2) { this.fileName = fileName; @@ -15599,6 +15858,9 @@ function hasJsonModuleEmitEnabled(options) { return false; } } +function getIsolatedModules(options) { + return !!(options.isolatedModules || options.verbatimModuleSyntax); +} function unreachableCodeIsError(options) { return options.allowUnreachableCode === false; } @@ -16451,7 +16713,7 @@ function getContainingNodeArray(node) { return node.parent.templateSpans; case 167 /* Decorator */: { const { parent: parent3 } = node; - return canHaveDecorators(parent3) ? parent3.modifiers : canHaveIllegalDecorators(parent3) ? parent3.illegalDecorators : void 0; + return canHaveDecorators(parent3) ? parent3.modifiers : void 0; } case 294 /* HeritageClause */: return node.parent.heritageClauses; @@ -16469,7 +16731,7 @@ function getContainingNodeArray(node) { return parent.types; case 186 /* TupleType */: case 206 /* ArrayLiteralExpression */: - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: case 272 /* NamedImports */: case 276 /* NamedExports */: return parent.elements; @@ -16643,6 +16905,16 @@ function isNonNullAccess(node) { const kind = node.kind; return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression); } +function isJSDocSatisfiesExpression(node) { + return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); +} +function getJSDocSatisfiesExpressionType(node) { + return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node)); +} +function tryGetJSDocSatisfiesTypeNode(node) { + const tag = getJSDocSatisfiesTag(node); + return tag && tag.typeExpression && tag.typeExpression.type; +} // src/compiler/factory/baseNodeFactory.ts function createBaseNodeFactory() { @@ -17108,7 +17380,7 @@ function createNodeConverters(factory2) { if (!node.body) return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); const updated = factory2.createFunctionExpression( - node.modifiers, + getModifiers(node), node.asteriskToken, node.name, node.typeParameters, @@ -17247,7 +17519,6 @@ function createNodeFactory(flags, baseFactory2) { createRegularExpressionLiteral, createLiteralLikeNode, createIdentifier, - updateIdentifier, createTempVariable, createLoopVariable, createUniqueName, @@ -17657,6 +17928,12 @@ function createNodeFactory(flags, baseFactory2) { get updateJSDocThrowsTag() { return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */); }, + get createJSDocSatisfiesTag() { + return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */); + }, + get updateJSDocSatisfiesTag() { + return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */); + }, createJSDocEnumTag, updateJSDocEnumTag, createJSDocUnknownTag, @@ -17838,6 +18115,7 @@ function createNodeFactory(flags, baseFactory2) { createArraySliceCall, createArrayConcatCall, createObjectDefinePropertyCall, + createObjectGetOwnPropertyDescriptorCall, createReflectGetCall, createReflectSetCall, createPropertyDescriptor, @@ -17990,55 +18268,43 @@ function createNodeFactory(flags, baseFactory2) { ); } } - function createBaseIdentifier(escapedText, originalKeywordKind) { + function createBaseIdentifier(escapedText) { const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */); - node.originalKeywordKind = originalKeywordKind; node.escapedText = escapedText; - node.autoGenerate = void 0; - node.typeArguments = void 0; - node.hasExtendedUnicodeEscape = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.symbol = void 0; return node; } function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { - const node = createBaseIdentifier( - escapeLeadingUnderscores(text), - /*originalKeywordKind*/ - void 0 - ); - node.autoGenerate = { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } - function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) { + function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) { if (originalKeywordKind === void 0 && text) { originalKeywordKind = stringToToken(text); } if (originalKeywordKind === 79 /* Identifier */) { originalKeywordKind = void 0; } - const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind); - node.typeArguments = asNodeArray(typeArguments); - node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; - if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + if (hasExtendedUnicodeEscape) + node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */; + if (node.escapedText === "await") { node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */; } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { node.transformFlags |= 1024 /* ContainsES2015 */; } return node; } - function updateIdentifier(node, typeArguments) { - return node.typeArguments !== typeArguments ? update(createIdentifier(idText(node), typeArguments), node) : node; - } function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { let flags2 = 1 /* Auto */; if (reservedInNestedScopes) @@ -18086,7 +18352,6 @@ function createNodeFactory(flags, baseFactory2) { function createBasePrivateIdentifier(escapedText) { const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */); node.escapedText = escapedText; - node.autoGenerate = void 0; node.transformFlags |= 16777216 /* ContainsClassFields */; return node; } @@ -18097,12 +18362,12 @@ function createNodeFactory(flags, baseFactory2) { } function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text)); - node.autoGenerate = { + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } @@ -18264,7 +18529,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.expression = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) { @@ -18285,7 +18549,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */); } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { @@ -18313,7 +18576,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.initializer = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertySignature(node, modifiers, name, questionToken, type) { @@ -18336,7 +18598,6 @@ function createNodeFactory(flags, baseFactory2) { const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertyDeclaration(node, modifiers, name, questionOrExclamationToken, type, initializer) { @@ -18352,7 +18613,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -18382,7 +18642,6 @@ function createNodeFactory(flags, baseFactory2) { } node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -18403,10 +18662,8 @@ function createNodeFactory(flags, baseFactory2) { const node = createBaseDeclaration(172 /* ClassStaticBlockDeclaration */); node.body = body; node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -18418,7 +18675,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateClassStaticBlockDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); @@ -18429,12 +18685,10 @@ function createNodeFactory(flags, baseFactory2) { node.parameters = createNodeArray(parameters); node.body = body; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */; - node.illegalDecorators = void 0; node.typeParameters = void 0; node.type = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -18446,7 +18700,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateConstructorDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.typeParameters = original.typeParameters; updated.type = original.type; } @@ -18467,7 +18720,6 @@ function createNodeFactory(flags, baseFactory2) { node.typeArguments = void 0; node.typeParameters = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -18499,7 +18751,6 @@ function createNodeFactory(flags, baseFactory2) { node.typeParameters = void 0; node.type = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -18524,7 +18775,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -18540,7 +18790,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -18555,9 +18804,7 @@ function createNodeFactory(flags, baseFactory2) { node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -18608,7 +18855,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -18634,7 +18880,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -18703,7 +18948,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) { @@ -18905,7 +19149,6 @@ function createNodeFactory(flags, baseFactory2) { node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateObjectLiteralExpression(node, properties) { @@ -18918,7 +19161,6 @@ function createNodeFactory(flags, baseFactory2) { node.name = name; node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -18969,7 +19211,6 @@ function createNodeFactory(flags, baseFactory2) { node.argumentExpression = argumentExpression; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19120,7 +19361,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParenthesizedExpression(node, expression) { @@ -19141,7 +19381,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -19164,7 +19403,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -19262,7 +19500,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */; } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function propagateAssignmentPatternFlags(node) { @@ -19404,7 +19641,6 @@ function createNodeFactory(flags, baseFactory2) { node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { @@ -19520,7 +19756,6 @@ function createNodeFactory(flags, baseFactory2) { node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; @@ -19536,9 +19771,7 @@ function createNodeFactory(flags, baseFactory2) { if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19548,7 +19781,6 @@ function createNodeFactory(flags, baseFactory2) { function createEmptyStatement() { const node = createBaseNode(239 /* EmptyStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function createExpressionStatement(expression) { @@ -19556,7 +19788,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19570,7 +19801,6 @@ function createNodeFactory(flags, baseFactory2) { node.elseStatement = asEmbeddedStatement(elseStatement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19583,7 +19813,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19596,7 +19825,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19611,7 +19839,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -19627,7 +19854,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -19646,7 +19872,6 @@ function createNodeFactory(flags, baseFactory2) { if (awaitModifier) node.transformFlags |= 128 /* ContainsES2018 */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -19660,7 +19885,6 @@ function createNodeFactory(flags, baseFactory2) { node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19672,7 +19896,6 @@ function createNodeFactory(flags, baseFactory2) { node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19684,7 +19907,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19697,7 +19919,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19710,7 +19931,6 @@ function createNodeFactory(flags, baseFactory2) { node.caseBlock = caseBlock; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.possiblyExhaustive = false; return node; @@ -19724,7 +19944,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19736,7 +19955,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19750,7 +19968,6 @@ function createNodeFactory(flags, baseFactory2) { node.finallyBlock = finallyBlock; node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19760,7 +19977,6 @@ function createNodeFactory(flags, baseFactory2) { function createDebuggerStatement() { const node = createBaseNode(256 /* DebuggerStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -19773,7 +19989,6 @@ function createNodeFactory(flags, baseFactory2) { node.initializer = asInitializer(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateVariableDeclaration(node, name, exclamationToken, type, initializer) { @@ -19809,10 +20024,8 @@ function createNodeFactory(flags, baseFactory2) { const isAsyncGenerator = isAsync && isGenerator; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; } - node.illegalDecorators = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -19824,7 +20037,9 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateFunctionDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return finishUpdateBaseSignatureDeclaration(updated, original); } @@ -19844,7 +20059,6 @@ function createNodeFactory(flags, baseFactory2) { } } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { @@ -19858,19 +20072,11 @@ function createNodeFactory(flags, baseFactory2) { node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? finishUpdateInterfaceDeclaration(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; - } - function finishUpdateInterfaceDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { const node = createBaseDeclaration(262 /* TypeAliasDeclaration */); @@ -19879,21 +20085,13 @@ function createNodeFactory(flags, baseFactory2) { node.typeParameters = asNodeArray(typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? finishUpdateTypeAliasDeclaration(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; - } - function finishUpdateTypeAliasDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? update(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; } function createEnumDeclaration(modifiers, name, members) { const node = createBaseDeclaration(263 /* EnumDeclaration */); @@ -19902,19 +20100,11 @@ function createNodeFactory(flags, baseFactory2) { node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateEnumDeclaration(node, modifiers, name, members) { - return node.modifiers !== modifiers || node.name !== name || node.members !== members ? finishUpdateEnumDeclaration(createEnumDeclaration(modifiers, name, members), node) : node; - } - function finishUpdateEnumDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createEnumDeclaration(modifiers, name, members), node) : node; } function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { const node = createBaseDeclaration(264 /* ModuleDeclaration */); @@ -19928,28 +20118,19 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } function updateModuleDeclaration(node, modifiers, name, body) { - return node.modifiers !== modifiers || node.name !== name || node.body !== body ? finishUpdateModuleDeclaration(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; - } - function finishUpdateModuleDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.name !== name || node.body !== body ? update(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; } function createModuleBlock(statements) { const node = createBaseNode(265 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateModuleBlock(node, statements) { @@ -19970,10 +20151,8 @@ function createNodeFactory(flags, baseFactory2) { const node = createBaseDeclaration(267 /* NamespaceExportDeclaration */); node.name = asName(name); node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateNamespaceExportDeclaration(node, name) { @@ -19981,7 +20160,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateNamespaceExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); @@ -19997,19 +20175,11 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? finishUpdateImportEqualsDeclaration(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; - } - function finishUpdateImportEqualsDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; } function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) { const node = createBaseNode(269 /* ImportDeclaration */); @@ -20019,19 +20189,11 @@ function createNodeFactory(flags, baseFactory2) { node.assertClause = assertClause; node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateImportDeclaration(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; - } - function finishUpdateImportDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; } function createImportClause(isTypeOnly, name, namedBindings) { const node = createBaseDeclaration(270 /* ImportClause */); @@ -20131,19 +20293,11 @@ function createNodeFactory(flags, baseFactory2) { ) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateExportAssignment(node, modifiers, expression) { - return node.modifiers !== modifiers || node.expression !== expression ? finishUpdateExportAssignment(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node; - } - function finishUpdateExportAssignment(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node; } function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { const node = createBaseDeclaration(275 /* ExportDeclaration */); @@ -20154,9 +20308,7 @@ function createNodeFactory(flags, baseFactory2) { node.assertClause = assertClause; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { @@ -20164,7 +20316,9 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return update(updated, original); } @@ -20186,7 +20340,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateExportSpecifier(node, isTypeOnly, propertyName, name) { @@ -20195,7 +20348,6 @@ function createNodeFactory(flags, baseFactory2) { function createMissingDeclaration() { const node = createBaseDeclaration(279 /* MissingDeclaration */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function createExternalModuleReference(expression) { @@ -20236,7 +20388,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -20268,7 +20419,6 @@ function createNodeFactory(flags, baseFactory2) { node.parameters = createNodeArray(parameters); node.type = type; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; @@ -20596,7 +20746,6 @@ function createNodeFactory(flags, baseFactory2) { node.statements = createNodeArray(statements); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateCaseClause(node, expression, statements) { @@ -20648,12 +20797,10 @@ function createNodeFactory(flags, baseFactory2) { node.name = asName(name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertyAssignment(node, name, initializer) { @@ -20661,7 +20808,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdatePropertyAssignment(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; @@ -20674,12 +20820,10 @@ function createNodeFactory(flags, baseFactory2) { node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; node.equalsToken = void 0; - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { @@ -20687,11 +20831,10 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateShorthandPropertyAssignment(updated, original) { if (updated !== original) { - updated.equalsToken = original.equalsToken; - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; + updated.equalsToken = original.equalsToken; } return update(updated, original); } @@ -20700,7 +20843,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateSpreadAssignment(node, expression) { @@ -20712,7 +20854,6 @@ function createNodeFactory(flags, baseFactory2) { node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateEnumMember(node, name, initializer) { @@ -20894,18 +21035,18 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createSyntaxList(children) { - const node = createBaseNode(353 /* SyntaxList */); + const node = createBaseNode(354 /* SyntaxList */); node._children = children; return node; } function createNotEmittedStatement(original) { - const node = createBaseNode(354 /* NotEmittedStatement */); + const node = createBaseNode(355 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; } function createPartiallyEmittedExpression(expression, original) { - const node = createBaseNode(355 /* PartiallyEmittedExpression */); + const node = createBaseNode(356 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; @@ -20927,7 +21068,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createCommaListExpression(elements) { - const node = createBaseNode(356 /* CommaListExpression */); + const node = createBaseNode(357 /* CommaListExpression */); node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -20936,19 +21077,19 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; } function createEndOfDeclarationMarker(original) { - const node = createBaseNode(358 /* EndOfDeclarationMarker */); + const node = createBaseNode(359 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createMergeDeclarationMarker(original) { - const node = createBaseNode(357 /* MergeDeclarationMarker */); + const node = createBaseNode(358 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(359 /* SyntheticReferenceExpression */); + const node = createBaseNode(360 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); @@ -20958,36 +21099,32 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node; } function cloneGeneratedIdentifier(node) { - const clone2 = createBaseIdentifier( - node.escapedText, - /*originalKeywordKind*/ - void 0 - ); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function cloneIdentifier(node) { - const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.typeArguments = node.typeArguments; - clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape; clone2.jsDoc = node.jsDoc; - clone2.jsDocCache = node.jsDocCache; clone2.flowNode = node.flowNode; clone2.symbol = node.symbol; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + const typeArguments = getIdentifierTypeArguments(node); + if (typeArguments) + setIdentifierTypeArguments(clone2, typeArguments); return clone2; } function cloneGeneratedPrivateIdentifier(node) { const clone2 = createBasePrivateIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function clonePrivateIdentifier(node) { @@ -21156,6 +21293,9 @@ function createNodeFactory(flags, baseFactory2) { function createObjectDefinePropertyCall(target, propertyName, attributes) { return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); } + function createObjectGetOwnPropertyDescriptorCall(target, propertyName) { + return createGlobalMethodCall("Object", "getOwnPropertyDescriptor", [target, asExpression(propertyName)]); + } function createReflectGetCall(target, propertyKey, receiver) { return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); } @@ -21192,7 +21332,7 @@ function createNodeFactory(flags, baseFactory2) { return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); case 232 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } @@ -21728,7 +21868,7 @@ function getTransformFlagsSubtreeExclusions(kind) { case 213 /* TypeAssertionExpression */: case 235 /* SatisfiesExpression */: case 231 /* AsExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 214 /* ParenthesizedExpression */: case 106 /* SuperKeyword */: return -2147483648 /* OuterExpressionExcludes */; @@ -21986,6 +22126,7 @@ function setOriginalNode(node, original) { function mergeEmitNode(sourceEmitNode, destEmitNode) { const { flags, + internalFlags, leadingComments, trailingComments, commentRange, @@ -22003,7 +22144,9 @@ function mergeEmitNode(sourceEmitNode, destEmitNode) { if (trailingComments) destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); if (flags) - destEmitNode.flags = flags & ~536870912 /* Immutable */; + destEmitNode.flags = flags; + if (internalFlags) + destEmitNode.internalFlags = internalFlags & ~8 /* Immutable */; if (commentRange) destEmitNode.commentRange = commentRange; if (sourceMapRange) @@ -22045,7 +22188,7 @@ function getOrCreateEmitNode(node) { } node.emitNode = {}; } else { - Debug.assert(!(node.emitNode.flags & 536870912 /* Immutable */), "Invalid attempt to mutate an immutable node."); + Debug.assert(!(node.emitNode.internalFlags & 8 /* Immutable */), "Invalid attempt to mutate an immutable node."); } return node.emitNode; } @@ -22074,6 +22217,15 @@ function addEmitFlags(node, emitFlags) { emitNode.flags = emitNode.flags | emitFlags; return node; } +function setInternalEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).internalFlags = emitFlags; + return node; +} +function addInternalEmitFlags(node, emitFlags) { + const emitNode = getOrCreateEmitNode(node); + emitNode.internalFlags = emitNode.internalFlags | emitFlags; + return node; +} function getSourceMapRange(node) { var _a2, _b; return (_b = (_a2 = node.emitNode) == null ? void 0 : _a2.sourceMapRange) != null ? _b : node; @@ -22195,18 +22347,41 @@ function getTypeNode(node) { var _a2; return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode; } +function setIdentifierTypeArguments(node, typeArguments) { + getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; + return node; +} +function getIdentifierTypeArguments(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments; +} +function setIdentifierAutoGenerate(node, autoGenerate) { + getOrCreateEmitNode(node).autoGenerate = autoGenerate; + return node; +} +function setIdentifierGeneratedImportReference(node, value) { + getOrCreateEmitNode(node).generatedImportReference = value; + return node; +} +function getIdentifierGeneratedImportReference(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference; +} // src/compiler/factory/emitHelpers.ts function createEmitHelperFactory(context) { const factory2 = context.factory; - const immutableTrue = memoize(() => setEmitFlags(factory2.createTrue(), 536870912 /* Immutable */)); - const immutableFalse = memoize(() => setEmitFlags(factory2.createFalse(), 536870912 /* Immutable */)); + const immutableTrue = memoize(() => setInternalEmitFlags(factory2.createTrue(), 8 /* Immutable */)); + const immutableFalse = memoize(() => setInternalEmitFlags(factory2.createFalse(), 8 /* Immutable */)); return { getUnscopedHelperName, // TypeScript Helpers createDecorateHelper, createMetadataHelper, createParamHelper, + // ES Decorators Helpers + createESDecorateHelper, + createRunInitializersHelper, // ES2018 Helpers createAssignHelper, createAwaitHelper, @@ -22221,6 +22396,8 @@ function createEmitHelperFactory(context) { createExtendsHelper, createTemplateObjectHelper, createSpreadArrayHelper, + createPropKeyHelper, + createSetFunctionNameHelper, // ES2015 Destructuring Helpers createValuesHelper, createReadHelper, @@ -22289,6 +22466,50 @@ function createEmitHelperFactory(context) { location ); } + function createESDecorateClassContextObject(contextIn) { + return factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral("class")), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) + ]); + } + function createESDecorateClassElementContextObject(contextIn) { + return factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), + factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()) + // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494 + // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) + ]); + } + function createESDecorateContextObject(contextIn) { + return contextIn.kind === "class" ? createESDecorateClassContextObject(contextIn) : createESDecorateClassElementContextObject(contextIn); + } + function createESDecorateHelper(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + context.requestEmitHelper(esDecorateHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__esDecorate"), + /*typeArguments*/ + void 0, + [ + ctor != null ? ctor : factory2.createNull(), + descriptorIn != null ? descriptorIn : factory2.createNull(), + decorators, + createESDecorateContextObject(contextIn), + initializers, + extraInitializers + ] + ); + } + function createRunInitializersHelper(thisArg, initializers, value) { + context.requestEmitHelper(runInitializersHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__runInitializers"), + /*typeArguments*/ + void 0, + value ? [thisArg, initializers, value] : [thisArg, initializers] + ); + } function createAssignHelper(attributesSegments) { if (getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { return factory2.createCallExpression( @@ -22445,6 +22666,24 @@ function createEmitHelperFactory(context) { [to, from, packFrom ? immutableTrue() : immutableFalse()] ); } + function createPropKeyHelper(expr) { + context.requestEmitHelper(propKeyHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__propKey"), + /*typeArguments*/ + void 0, + [expr] + ); + } + function createSetFunctionNameHelper(f, name, prefix) { + context.requestEmitHelper(setFunctionNameHelper); + return context.factory.createCallExpression( + getUnscopedHelperName("__setFunctionName"), + /*typeArguments*/ + void 0, + prefix ? [f, name, context.factory.createStringLiteral(prefix)] : [f, name] + ); + } function createValuesHelper(expression) { context.requestEmitHelper(valuesHelper); return factory2.createCallExpression( @@ -22608,6 +22847,54 @@ var paramHelper = { return function (target, key) { decorator(target, key, paramIndex); } };` }; +var esDecorateHelper = { + name: "typescript:esDecorate", + importName: "__esDecorate", + scoped: false, + priority: 2, + text: ` + var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.push(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.push(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + };` +}; +var runInitializersHelper = { + name: "typescript:runInitializers", + importName: "__runInitializers", + scoped: false, + priority: 2, + text: ` + var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + };` +}; var assignHelper = { name: "typescript:assign", importName: "__assign", @@ -22780,6 +23067,25 @@ var spreadArrayHelper = { return to.concat(ar || Array.prototype.slice.call(from)); };` }; +var propKeyHelper = { + name: "typescript:propKey", + importName: "__propKey", + scoped: false, + text: ` + var __propKey = (this && this.__propKey) || function (x) { + return typeof x === "symbol" ? x : "".concat(x); + };` +}; +var setFunctionNameHelper = { + name: "typescript:setFunctionName", + importName: "__setFunctionName", + scoped: false, + text: ` + var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + };` +}; var valuesHelper = { name: "typescript:values", importName: "__values", @@ -22935,6 +23241,8 @@ function getAllUnscopedEmitHelpers() { decorateHelper, metadataHelper, paramHelper, + esDecorateHelper, + runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, @@ -22947,6 +23255,8 @@ function getAllUnscopedEmitHelpers() { spreadArrayHelper, valuesHelper, readHelper, + propKeyHelper, + setFunctionNameHelper, generatorHelper, importStarHelper, importDefaultHelper, @@ -23035,6 +23345,9 @@ function isPrivateIdentifier(node) { function isExportModifier(node) { return node.kind === 93 /* ExportKeyword */; } +function isDefaultModifier(node) { + return node.kind === 88 /* DefaultKeyword */; +} function isAsyncModifier(node) { return node.kind === 132 /* AsyncKeyword */; } @@ -23255,10 +23568,10 @@ function isMetaProperty(node) { return node.kind === 233 /* MetaProperty */; } function isPartiallyEmittedExpression(node) { - return node.kind === 355 /* PartiallyEmittedExpression */; + return node.kind === 356 /* PartiallyEmittedExpression */; } function isCommaListExpression(node) { - return node.kind === 356 /* CommaListExpression */; + return node.kind === 357 /* CommaListExpression */; } function isTemplateSpan(node) { return node.kind === 236 /* TemplateSpan */; @@ -23381,10 +23694,10 @@ function isExportSpecifier(node) { return node.kind === 278 /* ExportSpecifier */; } function isNotEmittedStatement(node) { - return node.kind === 354 /* NotEmittedStatement */; + return node.kind === 355 /* NotEmittedStatement */; } function isSyntheticReference(node) { - return node.kind === 359 /* SyntheticReferenceExpression */; + return node.kind === 360 /* SyntheticReferenceExpression */; } function isExternalModuleReference(node) { return node.kind === 280 /* ExternalModuleReference */; @@ -23551,6 +23864,9 @@ function isJSDocPropertyTag(node) { function isJSDocImplementsTag(node) { return node.kind === 332 /* JSDocImplementsTag */; } +function isJSDocSatisfiesTag(node) { + return node.kind === 353 /* JSDocSatisfiesTag */; +} // src/compiler/factory/utilities.ts function createEmptyExports(factory2) { @@ -23572,7 +23888,7 @@ function createMemberAccessForPropertyName(factory2, target, memberName, locatio isMemberName(memberName) ? factory2.createPropertyAccessExpression(target, memberName) : factory2.createElementAccessExpression(target, memberName), memberName ); - getOrCreateEmitNode(expression).flags |= 128 /* NoNestedSourceMaps */; + addEmitFlags(expression, 128 /* NoNestedSourceMaps */); return expression; } } @@ -23905,8 +24221,11 @@ function startsWithUseStrict(statements) { const firstStatement = firstOrUndefined(statements); return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); } +function isCommaExpression(node) { + return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */; +} function isCommaSequence(node) { - return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 356 /* CommaListExpression */; + return isCommaExpression(node) || isCommaListExpression(node); } function isJSDocTypeAssertion(node) { return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node); @@ -23925,11 +24244,12 @@ function isOuterExpression(node, kinds = 15 /* All */) { return (kinds & 1 /* Parentheses */) !== 0; case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: + case 230 /* ExpressionWithTypeArguments */: case 235 /* SatisfiesExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; case 232 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -23940,6 +24260,14 @@ function skipOuterExpressions(node, kinds = 15 /* All */) { } return node; } +function walkUpOuterExpressions(node, kinds = 15 /* All */) { + let parent = node.parent; + while (isOuterExpression(parent, kinds)) { + parent = parent.parent; + Debug.assert(parent); + } + return parent; +} function startOnNewLine(node) { return setStartsOnNewLine( node, @@ -24018,7 +24346,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto /*assertClause*/ void 0 ); - addEmitFlags(externalHelpersImportDeclaration, 134217728 /* NeverApplyImportHelper */); + addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */); return externalHelpersImportDeclaration; } } @@ -24226,12 +24554,21 @@ function canHaveIllegalModifiers(node) { const kind = node.kind; return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; } -var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration); -var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken); -var isIdentifierOrThisTypeNode = or(isIdentifier, isThisTypeNode); -var isReadonlyKeywordOrPlusOrMinusToken = or(isReadonlyKeyword, isPlusToken, isMinusToken); -var isQuestionOrPlusOrMinusToken = or(isQuestionToken, isPlusToken, isMinusToken); -var isModuleName = or(isIdentifier, isStringLiteral); +function isQuestionOrExclamationToken(node) { + return isQuestionToken(node) || isExclamationToken(node); +} +function isIdentifierOrThisTypeNode(node) { + return isIdentifier(node) || isThisTypeNode(node); +} +function isReadonlyKeywordOrPlusOrMinusToken(node) { + return isReadonlyKeyword(node) || isPlusToken(node) || isMinusToken(node); +} +function isQuestionOrPlusOrMinusToken(node) { + return isQuestionToken(node) || isPlusToken(node) || isMinusToken(node); +} +function isModuleName(node) { + return isIdentifier(node) || isStringLiteral(node); +} function isExponentiationOperator(kind) { return kind === 42 /* AsteriskAsteriskToken */; } @@ -24413,6 +24750,13 @@ function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, return resultHolder.value; } } +function isExportOrDefaultKeywordKind(kind) { + return kind === 93 /* ExportKeyword */ || kind === 88 /* DefaultKeyword */; +} +function isExportOrDefaultModifier(node) { + const kind = node.kind; + return isExportOrDefaultKeywordKind(kind); +} function elideNodes(factory2, nodes) { if (nodes === void 0) return void 0; @@ -24421,13 +24765,16 @@ function elideNodes(factory2, nodes) { return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes); } function getNodeForGeneratedName(name) { - if (name.autoGenerate.flags & 4 /* Node */) { - const autoGenerateId = name.autoGenerate.id; + var _a2; + const autoGenerate = name.emitNode.autoGenerate; + if (autoGenerate.flags & 4 /* Node */) { + const autoGenerateId = autoGenerate.id; let node = name; let original = node.original; while (original) { node = original; - if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) { + const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) { break; } original = node.original; @@ -24526,6 +24873,50 @@ function createAccessorPropertySetRedirector(factory2, node, modifiers, name) { ]) ); } +function findComputedPropertyNameCacheAssignment(name) { + let node = name.expression; + while (true) { + node = skipOuterExpressions(node); + if (isCommaListExpression(node)) { + node = last(node.elements); + continue; + } + if (isCommaExpression(node)) { + node = node.right; + continue; + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ) && isGeneratedIdentifier(node.left)) { + return node; + } + break; + } +} +function isSyntheticParenthesizedExpression(node) { + return isParenthesizedExpression(node) && nodeIsSynthesized(node) && !node.emitNode; +} +function flattenCommaListWorker(node, expressions) { + if (isSyntheticParenthesizedExpression(node)) { + flattenCommaListWorker(node.expression, expressions); + } else if (isCommaExpression(node)) { + flattenCommaListWorker(node.left, expressions); + flattenCommaListWorker(node.right, expressions); + } else if (isCommaListExpression(node)) { + for (const child of node.elements) { + flattenCommaListWorker(child, expressions); + } + } else { + expressions.push(node); + } +} +function flattenCommaList(node) { + const expressions = []; + flattenCommaListWorker(node, expressions); + return expressions; +} // src/compiler/factory/utilitiesPublic.ts function setTextRange(range, location) { @@ -24599,7 +24990,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); }, [300 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); }, [301 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); @@ -24614,7 +25005,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, [299 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); }, [257 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); @@ -24623,7 +25014,7 @@ var forEachChildTable = { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [178 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [182 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -24640,7 +25031,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [173 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [174 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -24649,7 +25040,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [259 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [215 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -24658,7 +25049,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); }, [172 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); }, [180 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); @@ -24779,7 +25170,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); }, [240 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); }, [258 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.declarations); @@ -24843,25 +25234,25 @@ var forEachChildTable = { [260 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, [228 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, [261 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); }, [262 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); }, [263 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); }, [302 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [264 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); }, [268 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); }, [269 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [270 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); @@ -24873,7 +25264,7 @@ var forEachChildTable = { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); }, [267 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); }, [271 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); @@ -24884,12 +25275,12 @@ var forEachChildTable = { [272 /* NamedImports */]: forEachChildInNamedImportsOrExports, [276 /* NamedExports */]: forEachChildInNamedImportsOrExports, [275 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [273 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, [278 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, [274 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); }, [225 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); @@ -24916,9 +25307,9 @@ var forEachChildTable = { return visitNode2(cbNode, node.expression); }, [279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers); + return visitNodes(cbNode, cbNodes, node.modifiers); }, - [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, [281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { @@ -24990,6 +25381,7 @@ var forEachChildTable = { [347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, [346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, [343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, + [353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, [352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, [342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, [326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { @@ -25009,7 +25401,7 @@ var forEachChildTable = { [339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, [334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, [340 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression + [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -26026,8 +26418,6 @@ var Parser; const pos = getNodePos(); const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( "", - /*typeArguments*/ - void 0, /*originalKeywordKind*/ void 0 ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode( @@ -26062,13 +26452,7 @@ var Parser; const text = internIdentifier(scanner.getTokenValue()); const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind, - hasExtendedUnicodeEscape - ), pos); + return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); @@ -26179,7 +26563,7 @@ var Parser; } } function canFollowExportModifier() { - return token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); + return token() === 59 /* AtToken */ || token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); } function nextTokenCanFollowExportModifier() { nextToken(); @@ -26193,7 +26577,7 @@ var Parser; } function nextTokenCanFollowDefaultKeyword() { nextToken(); - return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); + return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 59 /* AtToken */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); } function isListElement(parsingContext2, inErrorRecovery) { const node = currentNode(parsingContext2); @@ -26410,6 +26794,7 @@ var Parser; return parseElement(); } function currentNode(parsingContext2, pos) { + var _a2; if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { return void 0; } @@ -26424,8 +26809,8 @@ var Parser; if (!canReuseNode(node, parsingContext2)) { return void 0; } - if (canHaveJSDoc(node) && node.jsDocCache) { - node.jsDocCache = void 0; + if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) { + node.jsDoc.jsDocCache = void 0; } return node; } @@ -26484,7 +26869,7 @@ var Parser; return true; case 171 /* MethodDeclaration */: const methodDeclaration = node; - const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 135 /* ConstructorKeyword */; + const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; } } @@ -26706,13 +27091,10 @@ var Parser; function parseEntityName(allowReservedWords, diagnosticMessage) { const pos = getNodePos(); let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); - let dotPos = getNodePos(); while (parseOptional(24 /* DotToken */)) { if (token() === 29 /* LessThanToken */) { - entity.jsdocDotPos = dotPos; break; } - dotPos = getNodePos(); entity = finishNode( factory2.createQualifiedName( entity, @@ -27042,6 +27424,8 @@ var Parser; function parseTypeParameter() { const pos = getNodePos(); const modifiers = parseModifiers( + /*allowDecorators*/ + false, /*permitConstAsModifier*/ true ); @@ -27094,10 +27478,16 @@ var Parser; function parseParameterWorker(inOuterAwaitContext, allowAmbiguity = true) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : doOutsideOfAwaitContext(parseDecorators); + const modifiers = inOuterAwaitContext ? doInAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )) : doOutsideOfAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )); if (token() === 108 /* ThisKeyword */) { const node2 = factory2.createParameterDeclaration( - decorators, + modifiers, /*dotDotDotToken*/ void 0, createIdentifier( @@ -27110,14 +27500,14 @@ var Parser; /*initializer*/ void 0 ); - if (decorators) { - parseErrorAtRange(decorators[0], Diagnostics.Decorators_may_not_be_applied_to_this_parameters); + const modifier = firstOrUndefined(modifiers); + if (modifier) { + parseErrorAtRange(modifier, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); } return withJSDoc(finishNode(node2, pos), hasJSDoc); } const savedTopLevel = topLevel; topLevel = false; - const modifiers = combineDecoratorsAndModifiers(decorators, parseModifiers()); const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); if (!allowAmbiguity && !isParameterNameStart()) { return void 0; @@ -27229,7 +27619,7 @@ var Parser; nextToken(); return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } - function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( /*inOuterAwaitContext*/ false @@ -27237,7 +27627,6 @@ var Parser; const type = parseTypeAnnotation(); parseTypeMemberSemicolon(); const node = factory2.createIndexSignature(modifiers, parameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { @@ -27292,37 +27681,18 @@ var Parser; } const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 174 /* GetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 4 /* Type */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 175 /* SetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 4 /* Type */); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers - ); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); } @@ -27802,7 +28172,10 @@ var Parser; } function skipParameterStart() { if (isModifierKind(token())) { - parseModifiers(); + parseModifiers( + /*allowDecorators*/ + false + ); } if (isIdentifier2() || token() === 108 /* ThisKeyword */) { nextToken(); @@ -27930,6 +28303,7 @@ var Parser; case 133 /* AwaitKeyword */: case 125 /* YieldKeyword */: case 80 /* PrivateIdentifier */: + case 59 /* AtToken */: return true; default: if (isBinaryOperator2()) { @@ -29021,6 +29395,8 @@ var Parser; break; } return parseFunctionExpression(); + case 59 /* AtToken */: + return parseDecoratedExpression(); case 84 /* ClassKeyword */: return parseClassExpression(); case 98 /* FunctionKeyword */: @@ -29088,13 +29464,15 @@ var Parser; ); return withJSDoc(finishNode(factory2.createSpreadAssignment(expression), pos), hasJSDoc); } - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const tokenIsIdentifier = isIdentifier2(); @@ -29102,7 +29480,7 @@ var Parser; const questionToken = parseOptionalToken(57 /* QuestionToken */); const exclamationToken = parseOptionalToken(53 /* ExclamationToken */); if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken); + return parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken); } let node; const isShorthandPropertyAssignment2 = tokenIsIdentifier && token() !== 58 /* ColonToken */; @@ -29122,7 +29500,6 @@ var Parser; )); node = factory2.createPropertyAssignment(name, initializer); } - node.illegalDecorators = decorators; node.modifiers = modifiers; node.questionToken = questionToken; node.exclamationToken = exclamationToken; @@ -29150,7 +29527,10 @@ var Parser; ); const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); parseExpected(98 /* FunctionKeyword */); const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; @@ -29522,7 +29902,7 @@ var Parser; if (currentToken2 === 154 /* TypeKeyword */) { currentToken2 = lookAhead(nextToken); } - if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */) { + if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */ || currentToken2 === 59 /* AtToken */) { return true; } continue; @@ -29606,8 +29986,6 @@ var Parser; return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -29616,8 +29994,6 @@ var Parser; return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -29627,8 +30003,6 @@ var Parser; return parseFunctionDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -29636,8 +30010,6 @@ var Parser; return parseClassDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -29700,8 +30072,10 @@ var Parser; function parseDeclaration() { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); const isAmbient = some(modifiers, isDeclareModifier); if (isAmbient) { const node = tryReuseAmbientDeclaration(pos); @@ -29711,9 +30085,9 @@ var Parser; for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); } else { - return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); + return parseDeclarationWorker(pos, hasJSDoc, modifiers); } } function tryReuseAmbientDeclaration(pos) { @@ -29724,41 +30098,41 @@ var Parser; } }); } - function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) { + function parseDeclarationWorker(pos, hasJSDoc, modifiersIn) { switch (token()) { case 113 /* VarKeyword */: case 119 /* LetKeyword */: case 85 /* ConstKeyword */: - return parseVariableStatement(pos, hasJSDoc, decorators, modifiers); + return parseVariableStatement(pos, hasJSDoc, modifiersIn); case 98 /* FunctionKeyword */: - return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseFunctionDeclaration(pos, hasJSDoc, modifiersIn); case 84 /* ClassKeyword */: - return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassDeclaration(pos, hasJSDoc, modifiersIn); case 118 /* InterfaceKeyword */: - return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseInterfaceDeclaration(pos, hasJSDoc, modifiersIn); case 154 /* TypeKeyword */: - return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseTypeAliasDeclaration(pos, hasJSDoc, modifiersIn); case 92 /* EnumKeyword */: - return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseEnumDeclaration(pos, hasJSDoc, modifiersIn); case 159 /* GlobalKeyword */: case 142 /* ModuleKeyword */: case 143 /* NamespaceKeyword */: - return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseModuleDeclaration(pos, hasJSDoc, modifiersIn); case 100 /* ImportKeyword */: - return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiersIn); case 93 /* ExportKeyword */: nextToken(); switch (token()) { case 88 /* DefaultKeyword */: case 63 /* EqualsToken */: - return parseExportAssignment(pos, hasJSDoc, decorators, modifiers); + return parseExportAssignment(pos, hasJSDoc, modifiersIn); case 128 /* AsKeyword */: - return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseNamespaceExportDeclaration(pos, hasJSDoc, modifiersIn); default: - return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseExportDeclaration(pos, hasJSDoc, modifiersIn); } default: - if (decorators || modifiers) { + if (modifiersIn) { const missing = createMissingNode( 279 /* MissingDeclaration */, /*reportAtCurrentPosition*/ @@ -29766,8 +30140,7 @@ var Parser; Diagnostics.Declaration_expected ); setTextRangePos(missing, pos); - missing.illegalDecorators = decorators; - missing.modifiers = modifiers; + missing.modifiers = modifiersIn; return missing; } return void 0; @@ -29900,17 +30273,16 @@ var Parser; function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } - function parseVariableStatement(pos, hasJSDoc, decorators, modifiers) { + function parseVariableStatement(pos, hasJSDoc, modifiers) { const declarationList = parseVariableDeclarationList( /*inForStatementInitializer*/ false ); parseSemicolon(); const node = factory2.createVariableStatement(modifiers, declarationList); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); const modifierFlags = modifiersToFlags(modifiers); parseExpected(98 /* FunctionKeyword */); @@ -29933,7 +30305,6 @@ var Parser; const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, Diagnostics.or_expected); setAwaitContext(savedAwaitContext); const node = factory2.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseConstructorName() { @@ -29947,7 +30318,7 @@ var Parser; }); } } - function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) { + function tryParseConstructorDeclaration(pos, hasJSDoc, modifiers) { return tryParse(() => { if (parseConstructorName()) { const typeParameters = parseTypeParameters(); @@ -29959,14 +30330,13 @@ var Parser; ); const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected); const node = factory2.createConstructorDeclaration(modifiers, parameters, body); - node.illegalDecorators = decorators; node.typeParameters = typeParameters; node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } }); } - function parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { + function parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; const typeParameters = parseTypeParameters(); @@ -29978,7 +30348,7 @@ var Parser; ); const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage); const node = factory2.createMethodDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, asteriskToken, name, questionToken, @@ -29990,13 +30360,13 @@ var Parser; node.exclamationToken = exclamationToken; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken) { + function parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken) { const exclamationToken = !questionToken && !scanner.hasPrecedingLineBreak() ? parseOptionalToken(53 /* ExclamationToken */) : void 0; const type = parseTypeAnnotation(); const initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer); parseSemicolonAfterPropertyName(name, type, initializer); const node = factory2.createPropertyDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, name, questionToken || exclamationToken, type, @@ -30004,7 +30374,7 @@ var Parser; ); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers) { const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const name = parsePropertyName(); const questionToken = parseOptionalToken(57 /* QuestionToken */); @@ -30012,7 +30382,6 @@ var Parser; return parseMethodDeclaration( pos, hasJSDoc, - decorators, modifiers, asteriskToken, name, @@ -30022,9 +30391,9 @@ var Parser; Diagnostics.or_expected ); } - return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken); + return parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken); } - function parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, kind, flags) { + function parseAccessorDeclaration(pos, hasJSDoc, modifiers, kind, flags) { const name = parsePropertyName(); const typeParameters = parseTypeParameters(); const parameters = parseParameters(0 /* None */); @@ -30034,7 +30403,7 @@ var Parser; false ); const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body); + const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); node.typeParameters = typeParameters; if (isSetAccessorDeclaration(node)) node.type = type; @@ -30080,11 +30449,10 @@ var Parser; } return false; } - function parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers) { parseExpectedToken(124 /* StaticKeyword */); const body = parseClassStaticBlockBody(); const node = withJSDoc(finishNode(factory2.createClassStaticBlockDeclaration(body), pos), hasJSDoc); - node.illegalDecorators = decorators; node.modifiers = modifiers; return node; } @@ -30124,15 +30492,7 @@ var Parser; const expression = doInDecoratorContext(parseDecoratorExpression); return finishNode(factory2.createDecorator(expression), pos); } - function parseDecorators() { - const pos = getNodePos(); - let list, decorator; - while (decorator = tryParseDecorator()) { - list = append(list, decorator); - } - return list && createNodeArray(list, pos); - } - function tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { + function tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); const kind = token(); if (token() === 85 /* ConstKeyword */ && permitConstAsModifier) { @@ -30150,23 +30510,26 @@ var Parser; } return finishNode(factory2.createToken(kind), pos); } - function combineDecoratorsAndModifiers(decorators, modifiers) { - if (!decorators) - return modifiers; - if (!modifiers) - return decorators; - const decoratorsAndModifiers = factory2.createNodeArray(concatenate(decorators, modifiers)); - setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end); - return decoratorsAndModifiers; - } - function parseModifiers(permitConstAsModifier, stopOnStartOfClassStaticBlock) { + function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); - let list, modifier, hasSeenStatic = false; - while (modifier = tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) { + let list; + let modifier, hasSeenStaticModifier = false; + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) - hasSeenStatic = true; + hasSeenStaticModifier = true; list = append(list, modifier); } + if (allowDecorators && token() === 59 /* AtToken */) { + let decorator; + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { + if (modifier.kind === 124 /* StaticKeyword */) + hasSeenStaticModifier = true; + list = append(list, modifier); + } + } return list && createNodeArray(list, pos); } function parseModifiersForArrowFunction() { @@ -30186,30 +30549,31 @@ var Parser; return finishNode(factory2.createSemicolonClassElement(), pos); } const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); const modifiers = parseModifiers( + /*allowDecorators*/ + true, /*permitConstAsModifier*/ true, /*stopOnStartOfClassStaticBlock*/ true ); if (token() === 124 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { - return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); } if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } if (token() === 135 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { - const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); + const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); if (constructorDeclaration) { return constructorDeclaration; } } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) { const isAmbient = some(modifiers, isDeclareModifier); @@ -30217,12 +30581,12 @@ var Parser; for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); } else { - return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); + return parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers); } } - if (decorators || modifiers) { + if (modifiers) { const name = createMissingNode( 79 /* Identifier */, /*reportAtCurrentPosition*/ @@ -30232,7 +30596,6 @@ var Parser; return parsePropertyDeclaration( pos, hasJSDoc, - decorators, modifiers, name, /*questionToken*/ @@ -30241,21 +30604,39 @@ var Parser; } return Debug.fail("Should not have attempted to parse class member declaration."); } + function parseDecoratedExpression() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); + if (token() === 84 /* ClassKeyword */) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 228 /* ClassExpression */); + } + const missing = createMissingNode( + 279 /* MissingDeclaration */, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Expression_expected + ); + setTextRangePos(missing, pos); + missing.modifiers = modifiers; + return missing; + } function parseClassExpression() { return parseClassDeclarationOrExpression( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0, 228 /* ClassExpression */ ); } - function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 260 /* ClassDeclaration */); + function parseClassDeclaration(pos, hasJSDoc, modifiers) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 260 /* ClassDeclaration */); } - function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { + function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { const savedAwaitContext = inAwaitContext(); parseExpected(84 /* ClassKeyword */); const name = parseNameOfClassDeclarationOrExpression(); @@ -30274,7 +30655,7 @@ var Parser; members = createMissingList(); } setAwaitContext(savedAwaitContext); - const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members); + const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseNameOfClassDeclarationOrExpression() { @@ -30315,17 +30696,16 @@ var Parser; function parseClassMembers() { return parseList(ParsingContext.ClassMembers, parseClassElement); } - function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); const heritageClauses = parseHeritageClauses(); const members = parseObjectTypeMembers(); const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) { parseExpected(154 /* TypeKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); @@ -30333,7 +30713,6 @@ var Parser; const type = token() === 139 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); parseSemicolon(); const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseEnumMember() { @@ -30343,7 +30722,7 @@ var Parser; const initializer = allowInAnd(parseInitializer); return withJSDoc(finishNode(factory2.createEnumMember(name, initializer), pos), hasJSDoc); } - function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseEnumDeclaration(pos, hasJSDoc, modifiers) { parseExpected(92 /* EnumKeyword */); const name = parseIdentifier(); let members; @@ -30354,7 +30733,6 @@ var Parser; members = createMissingList(); } const node = factory2.createEnumDeclaration(modifiers, name, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseModuleBlock() { @@ -30368,24 +30746,21 @@ var Parser; } return finishNode(factory2.createModuleBlock(statements), pos); } - function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags) { + function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) { const namespaceFlag = flags & 16 /* Namespace */; const name = parseIdentifier(); const body = parseOptional(24 /* DotToken */) ? parseModuleOrNamespaceDeclaration( getNodePos(), /*hasJSDoc*/ false, - /*decorators*/ - void 0, /*modifiers*/ void 0, 4 /* NestedNamespace */ | namespaceFlag ) : parseModuleBlock(); const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; let name; if (token() === 159 /* GlobalKeyword */) { @@ -30401,23 +30776,22 @@ var Parser; } else { parseSemicolon(); } - const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; + const node = factory2.createModuleDeclaration(modifiersIn, name, body, flags); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; if (token() === 159 /* GlobalKeyword */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } else if (parseOptional(143 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { parseExpected(142 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } } - return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); + return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiersIn, flags); } function isExternalModuleReference2() { return token() === 147 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); @@ -30431,17 +30805,16 @@ var Parser; function nextTokenIsSlash() { return nextToken() === 43 /* SlashToken */; } - function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseNamespaceExportDeclaration(pos, hasJSDoc, modifiers) { parseExpected(128 /* AsKeyword */); parseExpected(143 /* NamespaceKeyword */); const name = parseIdentifier(); parseSemicolon(); const node = factory2.createNamespaceExportDeclaration(name); - node.illegalDecorators = decorators; node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) { parseExpected(100 /* ImportKeyword */); const afterImportPos = scanner.getStartPos(); let identifier; @@ -30454,7 +30827,7 @@ var Parser; identifier = isIdentifier2() ? parseIdentifier() : void 0; } if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { - return parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly); + return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly); } let importClause; if (identifier || // import id @@ -30470,7 +30843,6 @@ var Parser; } parseSemicolon(); const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseAssertEntry() { @@ -30529,12 +30901,11 @@ var Parser; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { return token() === 27 /* CommaToken */ || token() === 158 /* FromKeyword */; } - function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { + function parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly) { parseExpected(63 /* EqualsToken */); const moduleReference = parseModuleReference(); parseSemicolon(); const node = factory2.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); - node.illegalDecorators = decorators; const finished = withJSDoc(finishNode(node, pos), hasJSDoc); return finished; } @@ -30644,7 +31015,7 @@ var Parser; function parseNamespaceExport(pos) { return finishNode(factory2.createNamespaceExport(parseIdentifierName()), pos); } - function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseExportDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -30674,10 +31045,9 @@ var Parser; parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) { + function parseExportAssignment(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -30696,7 +31066,6 @@ var Parser; parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportAssignment(modifiers, isExportEquals, expression); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } let ParsingContext; @@ -31080,6 +31449,9 @@ var Parser; case "overload": tag = parseOverloadTag(start2, tagName, margin, indentText); break; + case "satisfies": + tag = parseSatisfiesTag(start2, tagName, margin, indentText); + break; case "see": tag = parseSeeTag(start2, tagName, margin, indentText); break; @@ -31388,6 +31760,14 @@ var Parser; const className = parseExpressionWithTypeArgumentsForAugments(); return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); } + function parseSatisfiesTag(start2, tagName, margin, indentText) { + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + false + ); + const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0; + return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2); + } function parseExpressionWithTypeArgumentsForAugments() { const usedBrace = parseOptional(18 /* OpenBraceToken */); const pos = getNodePos(); @@ -31492,7 +31872,7 @@ var Parser; return finishNode(jsDocNamespaceNode, pos); } if (nested) { - typeNameOrNamespaceName.isInJSDocNamespace = true; + typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */; } return typeNameOrNamespaceName; } @@ -31696,12 +32076,7 @@ var Parser; const end2 = scanner.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner.getTokenValue()); - const result = finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind - ), pos, end2); + const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -32323,6 +32698,7 @@ var libEntries = [ ["es2020", "lib.es2020.d.ts"], ["es2021", "lib.es2021.d.ts"], ["es2022", "lib.es2022.d.ts"], + ["es2023", "lib.es2023.d.ts"], ["esnext", "lib.esnext.d.ts"], // Host only ["dom", "lib.dom.d.ts"], @@ -32376,14 +32752,17 @@ var libEntries = [ ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"], ["es2022.string", "lib.es2022.string.d.ts"], ["es2022.regexp", "lib.es2022.regexp.d.ts"], - ["esnext.array", "lib.es2022.array.d.ts"], + ["es2023.array", "lib.es2023.array.d.ts"], + ["esnext.array", "lib.es2023.array.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.es2022.string.d.ts"], ["esnext.promise", "lib.es2021.promise.d.ts"], - ["esnext.weakref", "lib.es2021.weakref.d.ts"] + ["esnext.weakref", "lib.es2021.weakref.d.ts"], + ["decorators", "lib.decorators.d.ts"], + ["decorators.legacy", "lib.decorators.legacy.d.ts"] ]; var libs = libEntries.map((entry) => entry[0]); var libMap = new Map(libEntries); @@ -32926,6 +33305,13 @@ var commandOptionsWithoutBuild = [ transpileOptionValue: true, defaultValueDescription: false }, + { + name: "verbatimModuleSyntax", + type: "boolean", + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting, + defaultValueDescription: false + }, // Strict Type Checks { name: "strict", @@ -33227,7 +33613,7 @@ var commandOptionsWithoutBuild = [ { name: "allowImportingTsExtensions", type: "boolean", - affectsModuleResolution: true, + affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, defaultValueDescription: false @@ -33291,10 +33677,11 @@ var commandOptionsWithoutBuild = [ { name: "experimentalDecorators", type: "boolean", + affectsEmit: true, affectsSemanticDiagnostics: true, affectsBuildInfo: true, category: Diagnostics.Language_and_Environment, - description: Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators, + description: Diagnostics.Enable_experimental_support_for_legacy_experimental_decorators, defaultValueDescription: false }, { @@ -33408,7 +33795,7 @@ var commandOptionsWithoutBuild = [ paramType: Diagnostics.NEWLINE, category: Diagnostics.Emit, description: Diagnostics.Set_the_newline_character_for_emitting_files, - defaultValueDescription: Diagnostics.Platform_specific + defaultValueDescription: "lf" }, { name: "noErrorTruncation", @@ -33584,7 +33971,7 @@ var commandOptionsWithoutBuild = [ affectsModuleResolution: true, category: Diagnostics.Interop_Constraints, description: Diagnostics.Ensure_that_casing_is_correct_in_imports, - defaultValueDescription: false + defaultValueDescription: true }, { name: "maxNodeModuleJsDepth", @@ -33708,14 +34095,6 @@ var buildOpts = [ ...optionsForBuild ]; var typeAcquisitionDeclarations = [ - { - /* @deprecated typingOptions.enableAutoDiscovery - * Use typeAcquisition.enable instead. - */ - name: "enableAutoDiscovery", - type: "boolean", - defaultValueDescription: false - }, { name: "enable", type: "boolean", @@ -33770,16 +34149,6 @@ var defaultInitCompilerOptions = { forceConsistentCasingInFileNames: true, skipLibCheck: true }; -function convertEnableAutoDiscoveryToEnable(typeAcquisition) { - if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== void 0 && typeAcquisition.enable === void 0) { - return { - enable: typeAcquisition.enableAutoDiscovery, - include: typeAcquisition.include || [], - exclude: typeAcquisition.exclude || [] - }; - } - return typeAcquisition; -} function createCompilerDiagnosticForInvalidCustomType(opt) { return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic); } @@ -34150,12 +34519,6 @@ function getTsconfigRootOptionsMap() { elementOptions: getCommandLineWatchOptionsMap(), extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics }, - { - name: "typingOptions", - type: "object", - elementOptions: getCommandLineTypeAcquisitionMap(), - extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics - }, { name: "typeAcquisition", type: "object", @@ -34988,11 +35351,11 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } const options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName); - const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName); + const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition, basePath, errors, configFileName); const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors); json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors); let extendedConfigPath; - if (json.extends) { + if (json.extends || json.extends === "") { if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) { errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration))); } else { @@ -35015,7 +35378,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { } function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { const options = getDefaultCompilerOptions(configFileName); - let typeAcquisition, typingOptionstypeAcquisition; + let typeAcquisition; let watchOptions; let extendedConfigPath; let rootCompilerOptions; @@ -35032,9 +35395,6 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa case "typeAcquisition": currentOption = typeAcquisition || (typeAcquisition = getDefaultTypeAcquisition(configFileName)); break; - case "typingOptions": - currentOption = typingOptionstypeAcquisition || (typingOptionstypeAcquisition = getDefaultTypeAcquisition(configFileName)); - break; default: Debug.fail("Unknown option"); } @@ -35087,15 +35447,7 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa optionsIterator ); if (!typeAcquisition) { - if (typingOptionstypeAcquisition) { - typeAcquisition = typingOptionstypeAcquisition.enableAutoDiscovery !== void 0 ? { - enable: typingOptionstypeAcquisition.enableAutoDiscovery, - include: typingOptionstypeAcquisition.include, - exclude: typingOptionstypeAcquisition.exclude - } : typingOptionstypeAcquisition; - } else { - typeAcquisition = getDefaultTypeAcquisition(configFileName); - } + typeAcquisition = getDefaultTypeAcquisition(configFileName); } if (rootCompilerOptions && json && json.compilerOptions === void 0) { errors.push(createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, getTextOfPropertyName(rootCompilerOptions[0]))); @@ -35119,7 +35471,11 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag if (resolved.resolvedModule) { return resolved.resolvedModule.resolvedFileName; } - errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); + if (extendedConfig === "") { + errors.push(createDiagnostic(Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends")); + } else { + errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); + } return void 0; } function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) { @@ -35187,8 +35543,7 @@ function getDefaultTypeAcquisition(configFileName) { } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { const options = getDefaultTypeAcquisition(configFileName); - const typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions); - convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), typeAcquisition, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); + convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), jsonOptions, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); return options; } function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) { @@ -35392,6 +35747,7 @@ function validateSpecs(specs, errors, disallowTrailingRecursion, jsonSourceFile, } } function specToDiagnostic(spec, disallowTrailingRecursion) { + Debug.assert(typeof spec === "string"); if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return [Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; } else if (invalidDotDotAfterRecursiveWildcard(spec)) { @@ -35561,7 +35917,7 @@ function resolvedTypeScriptOnly(resolved) { Debug.assert(extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } -function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) { +function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations); @@ -35579,7 +35935,8 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra }, failedLookupLocations: initializeResolutionField(failedLookupLocations), affectingLocations: initializeResolutionField(affectingLocations), - resolutionDiagnostics: initializeResolutionField(diagnostics) + resolutionDiagnostics: initializeResolutionField(diagnostics), + node10Result: legacyResult }; } function initializeResolutionField(value) { @@ -36609,7 +36966,7 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) { ); } function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) { - var _a2, _b; + var _a2, _b, _c, _d; const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations = []; const affectingLocations = []; @@ -36636,44 +36993,60 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) { const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */); const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */); - result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0; + result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0; } else { - result = tryResolve(extensions); + result = tryResolve(extensions, state); + } + let legacyResult; + if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) { + traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update); + const diagnosticState = { + ...state, + features: state.features & ~8 /* Exports */, + failedLookupLocations: [], + affectingLocations: [], + reportDiagnostic: noop + }; + const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState); + if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) { + legacyResult = diagnosticResult.value.resolved.path; + } } return createResolvedModuleWithFailedLookupLocations( - (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved, - (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport, + (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, + (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state.resultFromCache, + legacyResult ); - function tryResolve(extensions2) { - const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName( + function tryResolve(extensions2, state2) { + const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName( extensions3, candidate, onlyRecordFailures, - state2, + state3, /*considerPackageJson*/ true ); - const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state); + const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2); if (resolved) { return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) }); } if (!isExternalModuleNameRelative(moduleName)) { let resolved2; if (features & 2 /* Imports */ && startsWith(moduleName, "#")) { - resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2 && features & 4 /* SelfName */) { - resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) { if (traceEnabled) { trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2)); } - resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) return void 0; @@ -36692,7 +37065,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, candidate, /*onlyRecordFailures*/ false, - state, + state2, /*considerPackageJson*/ true ); @@ -37794,7 +38167,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host, } } function shouldAllowImportingTsExtension(compilerOptions, fromFileName) { - return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && (!!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName)); + return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName); } function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) { const traceEnabled = isTraceEnabled(compilerOptions, host); @@ -37925,7 +38298,7 @@ function getModuleInstanceStateWorker(node, visited) { case 264 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { return 0 /* NonInstantiated */; } } @@ -38362,6 +38735,7 @@ function createBinder() { } else if (containerFlags & 64 /* IsInterface */) { seenThisKeyword = false; bindChildren(node); + Debug.assertNotNode(node, isIdentifier); node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */; } else { bindChildren(node); @@ -38662,13 +39036,12 @@ function createBinder() { } else if (node.kind === 221 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 223 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); + return isLogicalOrCoalescingBinaryExpression(node); } } } function isLogicalAssignmentExpression(node) { - node = skipParentheses(node); - return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind); + return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node)); } function isTopLevelLogicalExpression(node) { while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) { @@ -39051,7 +39424,7 @@ function createBinder() { }; } const operator = node.operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */ || isLogicalOrCoalescingAssignmentOperator(operator)) { + if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) { if (isTopLevelLogicalExpression(node)) { const postExpressionLabel = createBranchLabel(); bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); @@ -39521,13 +39894,17 @@ function createBinder() { } function checkContextualIdentifier(node) { if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) { - if (inStrictMode && node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 125 /* LastFutureReservedWord */) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind === void 0) { + return; + } + if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, getStrictModeIdentifierMessage(node), declarationNameToString(node) )); - } else if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + } else if (originalKeywordKind === 133 /* AwaitKeyword */) { if (isExternalModule(file) && isInTopLevelContext(node)) { file.bindDiagnostics.push(createDiagnosticForNode2( node, @@ -39541,7 +39918,7 @@ function createBinder() { declarationNameToString(node) )); } - } else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { + } else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, @@ -39753,7 +40130,7 @@ function createBinder() { function bindWorker(node) { switch (node.kind) { case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { let parentNode = node.parent; while (parentNode && !isJSDocTypeAlias(parentNode)) { parentNode = parentNode.parent; @@ -41729,6 +42106,7 @@ function createTypeChecker(host) { deferredDiagnosticsCallbacks.push(arg); }; let cancellationToken; + const requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); let requestedExternalEmitHelpers; let externalHelpersModule; const Symbol12 = objectAllocator.getSymbolConstructor(); @@ -41747,6 +42125,7 @@ function createTypeChecker(host) { const compilerOptions = host.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); @@ -41771,6 +42150,7 @@ function createTypeChecker(host) { globals.set(globalThisSymbol.escapedName, globalThisSymbol); const argumentsSymbol = createSymbol(4 /* Property */, "arguments"); const requireSymbol = createSymbol(4 /* Property */, "require"); + const isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; let apparentArgumentCount; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), @@ -42191,6 +42571,7 @@ function createTypeChecker(host) { const stringMappingTypes = /* @__PURE__ */ new Map(); const substitutionTypes = /* @__PURE__ */ new Map(); const subtypeReductionCache = /* @__PURE__ */ new Map(); + const decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); const cachedTypes = /* @__PURE__ */ new Map(); const evolvingArrayTypes = []; const undefinedProperties = /* @__PURE__ */ new Map(); @@ -42430,6 +42811,14 @@ function createTypeChecker(host) { let deferredGlobalBigIntType; let deferredGlobalNaNSymbol; let deferredGlobalRecordSymbol; + let deferredGlobalClassDecoratorContextType; + let deferredGlobalClassMethodDecoratorContextType; + let deferredGlobalClassGetterDecoratorContextType; + let deferredGlobalClassSetterDecoratorContextType; + let deferredGlobalClassAccessorDecoratorContextType; + let deferredGlobalClassAccessorDecoratorTargetType; + let deferredGlobalClassAccessorDecoratorResultType; + let deferredGlobalClassFieldDecoratorContextType; const allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); let flowLoopStart = 0; let flowLoopCount = 0; @@ -42516,7 +42905,7 @@ function createTypeChecker(host) { if (jsxFragmentPragma) { const chosenPragma = isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma; file.localJsxFragmentFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFragmentFactory, markAsSynthetic); + visitNode(file.localJsxFragmentFactory, markAsSynthetic, isEntityName); if (file.localJsxFragmentFactory) { return file.localJsxFragmentNamespace = getFirstIdentifier(file.localJsxFragmentFactory).escapedText; } @@ -42559,7 +42948,7 @@ function createTypeChecker(host) { if (jsxPragma) { const chosenPragma = isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; file.localJsxFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFactory, markAsSynthetic); + visitNode(file.localJsxFactory, markAsSynthetic, isEntityName); if (file.localJsxFactory) { return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; } @@ -42612,7 +43001,7 @@ function createTypeChecker(host) { addErrorOrSuggestion(isError, "message" in message ? createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : createDiagnosticForFileFromMessageChain(file, message)); return; } - addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(location, message)); + addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(location), location, message)); } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { const diagnostic = error(location, message, arg0, arg1, arg2, arg3); @@ -42657,6 +43046,16 @@ function createTypeChecker(host) { symbol.links.checkFlags = checkFlags || 0 /* None */; return symbol; } + function createParameter(name, type) { + const symbol = createSymbol(1 /* FunctionScopedVariable */, name); + symbol.links.type = type; + return symbol; + } + function createProperty(name, type) { + const symbol = createSymbol(4 /* Property */, name); + symbol.links.type = type; + return symbol; + } function getExcludedSymbolFlags(flags) { let result = 0; if (flags & 2 /* BlockScopedVariable */) @@ -43203,6 +43602,15 @@ function createTypeChecker(host) { break; case 263 /* EnumDeclaration */: if (result = lookup(((_c = getSymbolOfDeclaration(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) { + if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 16777216 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { + error( + errorLocation, + Diagnostics.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead, + unescapeLeadingUnderscores(name), + isolatedModulesLikeFlagName, + `${unescapeLeadingUnderscores(getSymbolOfNode(location).escapedName)}.${unescapeLeadingUnderscores(name)}` + ); + } break loop; } break; @@ -43448,7 +43856,7 @@ function createTypeChecker(host) { if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */); if (typeOnlyDeclaration) { - const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; const unescapedName = unescapeLeadingUnderscores(name); addTypeOnlyDeclarationRelatedInfo( error(errorLocation, message, unescapedName), @@ -43468,7 +43876,7 @@ function createTypeChecker(host) { diagnostic, createDiagnosticForNode( typeOnlyDeclaration, - typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, + typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, unescapedName ) ); @@ -43847,10 +44255,10 @@ function createTypeChecker(host) { false ) && !node.isTypeOnly) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); - const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */; + const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */; const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here; - const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); + const name = typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); } } @@ -44070,6 +44478,7 @@ function createTypeChecker(host) { return valueSymbol; } const result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); + Debug.assert(valueSymbol.declarations || typeSymbol.declarations); result.declarations = deduplicate(concatenate(valueSymbol.declarations, typeSymbol.declarations), equateValues); result.parent = valueSymbol.parent || typeSymbol.parent; if (valueSymbol.valueDeclaration) @@ -44081,15 +44490,19 @@ function createTypeChecker(host) { return result; } function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + var _a2; if (symbol.flags & 1536 /* Module */) { const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); const resolved = resolveSymbol(exportSymbol, dontResolveAlias); + const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name.escapedText); markSymbolOfAliasDeclarationIfTypeOnly( specifier, exportSymbol, resolved, /*overwriteEmpty*/ - false + false, + exportStarDeclaration, + name.escapedText ); return resolved; } @@ -44416,7 +44829,7 @@ function createTypeChecker(host) { } return flags; } - function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { + function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) { if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration)) return false; const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration); @@ -44425,6 +44838,14 @@ function createTypeChecker(host) { links2.typeOnlyDeclaration = aliasDeclaration; return true; } + if (exportStarDeclaration) { + const links2 = getSymbolLinks(sourceSymbol); + links2.typeOnlyDeclaration = exportStarDeclaration; + if (sourceSymbol.escapedName !== exportStarName) { + links2.typeOnlyExportStarName = exportStarName; + } + return true; + } const links = getSymbolLinks(sourceSymbol); return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty); } @@ -44446,11 +44867,15 @@ function createTypeChecker(host) { return links.typeOnlyDeclaration || void 0; } if (links.typeOnlyDeclaration) { - return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : void 0; + const resolved = links.typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); + return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; } return void 0; } function markExportAsReferenced(node) { + if (compilerOptions.verbatimModuleSyntax) { + return; + } const symbol = getSymbolOfDeclaration(node); const target = resolveAlias(symbol); if (target) { @@ -44461,6 +44886,7 @@ function createTypeChecker(host) { } } function markAliasSymbolAsReferenced(symbol) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); const links = getSymbolLinks(symbol); if (!links.referenced) { links.referenced = true; @@ -44767,6 +45193,8 @@ function createTypeChecker(host) { /*isError*/ false, errorNode, + currentSourceFile, + mode, resolvedModule, moduleReference ); @@ -44818,7 +45246,7 @@ function createTypeChecker(host) { } } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chainDiagnosticMessages( + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chainDiagnosticMessages( diagnosticDetails, Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, moduleReference @@ -44852,6 +45280,8 @@ function createTypeChecker(host) { /*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, + currentSourceFile, + mode, resolvedModule, moduleReference ); @@ -44906,26 +45336,37 @@ function createTypeChecker(host) { return importSourceWithoutExtension; } } - function errorOnImplicitAnyModule(isError, errorNode, { packageId, resolvedFileName }, moduleReference) { - const errorInfo = !isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, - packageId.name, - mangleScopedPackageName(packageId.name) - ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, - packageId.name, - moduleReference - ) : chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, - moduleReference, - mangleScopedPackageName(packageId.name) - ) : void 0; + function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) { + var _a2, _b; + let errorInfo; + if (!isExternalModuleNameRelative(moduleReference) && packageId) { + const node10Result = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleReference, mode)) == null ? void 0 : _b.node10Result; + errorInfo = node10Result ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings, + node10Result, + node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageId.name)}` : packageId.name + ) : typesPackageExists(packageId.name) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, + packageId.name, + mangleScopedPackageName(packageId.name) + ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, + packageId.name, + moduleReference + ) : chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, + moduleReference, + mangleScopedPackageName(packageId.name) + ); + } errorOrSuggestion(isError, errorNode, chainDiagnosticMessages( errorInfo, Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, @@ -45085,7 +45526,12 @@ function createTypeChecker(host) { } function getExportsOfModule(moduleSymbol) { const links = getSymbolLinks(moduleSymbol); - return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol)); + if (!links.resolvedExports) { + const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol); + links.resolvedExports = exports; + links.typeOnlyExportStarMap = typeOnlyExportStarMap; + } + return links.resolvedExports; } function extendExportSymbols(target, source, lookupTable, exportNode) { if (!source) @@ -45113,9 +45559,21 @@ function createTypeChecker(host) { } function getExportsOfModuleWorker(moduleSymbol) { const visitedSymbols = []; + let typeOnlyExportStarMap; + const nonTypeOnlyNames = /* @__PURE__ */ new Set(); moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); - return visit(moduleSymbol) || emptySymbols; - function visit(symbol) { + const exports = visit(moduleSymbol) || emptySymbols; + if (typeOnlyExportStarMap) { + nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name)); + } + return { + exports, + typeOnlyExportStarMap + }; + function visit(symbol, exportStar, isTypeOnly) { + if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) { + symbol.exports.forEach((_, name) => nonTypeOnlyNames.add(name)); + } if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) { return; } @@ -45127,7 +45585,7 @@ function createTypeChecker(host) { if (exportStars.declarations) { for (const node of exportStars.declarations) { const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); - const exportedSymbols = visit(resolvedModule); + const exportedSymbols = visit(resolvedModule, node, isTypeOnly || node.isTypeOnly); extendExportSymbols( nestedSymbols, exportedSymbols, @@ -45151,6 +45609,13 @@ function createTypeChecker(host) { }); extendExportSymbols(symbols, nestedSymbols); } + if (exportStar == null ? void 0 : exportStar.isTypeOnly) { + typeOnlyExportStarMap != null ? typeOnlyExportStarMap : typeOnlyExportStarMap = /* @__PURE__ */ new Map(); + symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set( + escapedName, + exportStar + )); + } return symbols; } } @@ -46582,13 +47047,17 @@ function createTypeChecker(host) { let qualifier = root.qualifier; if (qualifier) { if (isIdentifier(qualifier)) { - qualifier = factory.updateIdentifier(qualifier, typeArguments); + if (typeArguments !== getIdentifierTypeArguments(qualifier)) { + qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments); + } } else { - qualifier = factory.updateQualifiedName( - qualifier, - qualifier.left, - factory.updateIdentifier(qualifier.right, typeArguments) - ); + if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) { + qualifier = factory.updateQualifiedName( + qualifier, + qualifier.left, + setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments) + ); + } } } typeArguments = ref.typeArguments; @@ -46608,13 +47077,17 @@ function createTypeChecker(host) { let typeArguments = root.typeArguments; let typeName = root.typeName; if (isIdentifier(typeName)) { - typeName = factory.updateIdentifier(typeName, typeArguments); + if (typeArguments !== getIdentifierTypeArguments(typeName)) { + typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments); + } } else { - typeName = factory.updateQualifiedName( - typeName, - typeName.left, - factory.updateIdentifier(typeName.right, typeArguments) - ); + if (typeArguments !== getIdentifierTypeArguments(typeName.right)) { + typeName = factory.updateQualifiedName( + typeName, + typeName.left, + setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments) + ); + } } typeArguments = ref.typeArguments; const ids = getAccessStack(ref); @@ -47328,7 +47801,11 @@ function createTypeChecker(host) { if (!nonRootParts || isEntityName(nonRootParts)) { if (nonRootParts) { const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; - lastId.typeArguments = void 0; + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); } return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf); } else { @@ -47345,8 +47822,12 @@ function createTypeChecker(host) { return factory.createTypeQueryNode(entityName); } else { const lastId = isIdentifier(entityName) ? entityName : entityName.right; - const lastTypeArgs = lastId.typeArguments; - lastId.typeArguments = void 0; + const lastTypeArgs = getIdentifierTypeArguments(lastId); + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); return factory.createTypeReferenceNode(entityName, lastTypeArgs); } function createAccessFromSymbolChain(chain2, index, stopper) { @@ -47390,7 +47871,9 @@ function createTypeChecker(host) { return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2))); } } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; if (index > stopper) { const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper); @@ -47448,7 +47931,9 @@ function createTypeChecker(host) { text = `${rawtext}_${i}`; } if (text !== rawtext) { - result = factory.createIdentifier(text, result.typeArguments); + const typeArguments = getIdentifierTypeArguments(result); + result = factory.createIdentifier(text); + setIdentifierTypeArguments(result, typeArguments); } (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i); (context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result); @@ -47472,7 +47957,9 @@ function createTypeChecker(host) { if (index === 0) { context.flags ^= 16777216 /* InInitialEntityName */; } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier; } @@ -47495,7 +47982,9 @@ function createTypeChecker(host) { return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context)); } if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) { - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier; } else { @@ -47510,8 +47999,11 @@ function createTypeChecker(host) { expression = factory.createNumericLiteral(+symbolName2); } if (!expression) { - expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); - expression.symbol = symbol2; + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); + identifier.symbol = symbol2; + expression = identifier; } return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression); } @@ -47667,7 +48159,7 @@ function createTypeChecker(host) { } let hadError = false; const file = getSourceFileOfNode(existing); - const transformed = visitNode(existing, visitExistingNodeTreeSymbols); + const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode); if (hadError) { return void 0; } @@ -47680,16 +48172,16 @@ function createTypeChecker(host) { return factory.createKeywordTypeNode(157 /* UnknownKeyword */); } if (isJSDocNullableType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), factory.createLiteralTypeNode(factory.createNull())]); + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createLiteralTypeNode(factory.createNull())]); } if (isJSDocOptionalType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), factory.createKeywordTypeNode(155 /* UndefinedKeyword */)]); + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createKeywordTypeNode(155 /* UndefinedKeyword */)]); } if (isJSDocNonNullableType(node)) { return visitNode(node.type, visitExistingNodeTreeSymbols); } if (isJSDocVariadicType(node)) { - return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols)); + return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode)); } if (isJSDocTypeLiteral(node)) { return factory.createTypeLiteralNode(map(node.jsDocPropertyTags, (t) => { @@ -47701,7 +48193,7 @@ function createTypeChecker(host) { void 0, name, t.isBracketed || t.typeExpression && isJSDocOptionalType(t.typeExpression.type) ? factory.createToken(57 /* QuestionToken */) : void 0, - overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); })); } @@ -47720,9 +48212,9 @@ function createTypeChecker(host) { "x", /*questionToken*/ void 0, - visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols) + visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols, isTypeNode) )], - visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols) + visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols, isTypeNode) )]); } if (isJSDocFunctionType(node)) { @@ -47731,33 +48223,33 @@ function createTypeChecker(host) { return factory.createConstructorTypeNode( /*modifiers*/ void 0, - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols), + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), mapDefined(node.parameters, (p, i) => p.name && isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode = p.type, void 0) : factory.createParameterDeclaration( /*modifiers*/ void 0, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, - visitNode(p.type, visitExistingNodeTreeSymbols), + visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), /*initializer*/ void 0 )), - visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); } else { return factory.createFunctionTypeNode( - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols), + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), map(node.parameters, (p, i) => factory.createParameterDeclaration( /*modifiers*/ void 0, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, - visitNode(p.type, visitExistingNodeTreeSymbols), + visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), /*initializer*/ void 0 )), - visitNode(node.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); } } @@ -48206,7 +48698,7 @@ function createTypeChecker(host) { /*modifiers*/ void 0, /*isTypeOnly*/ - false, + node.isTypeOnly, /*exportClause*/ void 0, factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context)) @@ -48679,7 +49171,7 @@ function createTypeChecker(host) { break; } case 268 /* ImportEqualsDeclaration */: - if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, isJsonSourceFile)) { + if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) { serializeMaybeAliasAssignment(symbol); break; } @@ -48920,7 +49412,7 @@ function createTypeChecker(host) { !!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => isIdentifierText(symbolName(p), languageVersion)); } - function makeSerializePropertySymbol(createProperty, methodKind, useAccessors) { + function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) { return function serializePropertySymbol(p, isStatic2, baseType) { var _a2, _b, _c, _d, _e; const modifierFlags = getDeclarationModifierFlagsFromSymbol(p); @@ -48967,7 +49459,7 @@ function createTypeChecker(host) { } return result; } else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { - return setTextRange(createProperty( + return setTextRange(createProperty2( factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? factory.createToken(57 /* QuestionToken */) : void 0, @@ -48982,7 +49474,7 @@ function createTypeChecker(host) { const type = getTypeOfSymbol(p); const signatures = getSignaturesOfType(type, 0 /* Call */); if (flag & 8 /* Private */) { - return setTextRange(createProperty( + return setTextRange(createProperty2( factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? factory.createToken(57 /* QuestionToken */) : void 0, @@ -49774,6 +50266,12 @@ function createTypeChecker(host) { const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration); const isOptional = includeOptionality && isOptionalDeclaration(declaration); const declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { + if (declaredType) { + return isTypeAny(declaredType) || declaredType === unknownType ? declaredType : errorType; + } + return useUnknownInCatchVariables ? unknownType : anyType; + } if (declaredType) { return addOptionality(declaredType, isProperty, isOptional); } @@ -50352,14 +50850,6 @@ function createTypeChecker(host) { } Debug.assertIsDefined(symbol.valueDeclaration); const declaration = symbol.valueDeclaration; - if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode === void 0) { - return useUnknownInCatchVariables ? unknownType : anyType; - } - const type2 = getTypeOfNode(typeNode); - return isTypeAny(type2) || type2 === unknownType ? type2 : errorType; - } if (isSourceFile(declaration) && isJsonSourceFile(declaration)) { if (!declaration.statements.length) { return emptyObjectType; @@ -50951,7 +51441,7 @@ function createTypeChecker(host) { baseType ); const diagnostic = chainDiagnosticMessages(elaboration, Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(reducedBaseType)); - diagnostics.add(createDiagnosticForNodeFromMessageChain(baseTypeNode.expression, diagnostic)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(baseTypeNode.expression), baseTypeNode.expression, diagnostic)); return type.resolvedBaseTypes = emptyArray; } if (type === reducedBaseType || hasBaseType(reducedBaseType, type)) { @@ -51352,7 +51842,7 @@ function createTypeChecker(host) { const links = getSymbolLinks(symbol); if (!links[resolutionKind]) { const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */; - const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) : symbol.exports; + const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol).exports : symbol.exports; links[resolutionKind] = earlySymbols || emptySymbols; const lateSymbols = createSymbolTable(); for (const decl of symbol.declarations || emptyArray) { @@ -52341,7 +52831,7 @@ function createTypeChecker(host) { } function isConstTypeVariable(type) { var _a2; - return !!(type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType)); + return !!(type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || isGenericTupleType(type) && findIndex(getTypeArguments(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t)) >= 0 || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType)); } function getConstraintOfIndexedAccess(type) { return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0; @@ -53565,6 +54055,12 @@ function createTypeChecker(host) { } return result & 458752 /* PropagatingFlags */; } + function tryCreateTypeReference(target, typeArguments) { + if (some(typeArguments) && target === emptyGenericType) { + return unknownType; + } + return createTypeReference(target, typeArguments); + } function createTypeReference(target, typeArguments) { const id = getTypeListId(typeArguments); let type = target.instantiations.get(id); @@ -54259,6 +54755,78 @@ function createTypeChecker(host) { false )) || emptyObjectType; } + function getGlobalClassDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassDecoratorContextType != null ? deferredGlobalClassDecoratorContextType : deferredGlobalClassDecoratorContextType = getGlobalType( + "ClassDecoratorContext", + /*arity*/ + 1, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassMethodDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassMethodDecoratorContextType != null ? deferredGlobalClassMethodDecoratorContextType : deferredGlobalClassMethodDecoratorContextType = getGlobalType( + "ClassMethodDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassGetterDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassGetterDecoratorContextType != null ? deferredGlobalClassGetterDecoratorContextType : deferredGlobalClassGetterDecoratorContextType = getGlobalType( + "ClassGetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassSetterDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassSetterDecoratorContextType != null ? deferredGlobalClassSetterDecoratorContextType : deferredGlobalClassSetterDecoratorContextType = getGlobalType( + "ClassSetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorContextType != null ? deferredGlobalClassAccessorDecoratorContextType : deferredGlobalClassAccessorDecoratorContextType = getGlobalType( + "ClassAccessorDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorTargetType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorTargetType != null ? deferredGlobalClassAccessorDecoratorTargetType : deferredGlobalClassAccessorDecoratorTargetType = getGlobalType( + "ClassAccessorDecoratorTarget", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorResultType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorResultType != null ? deferredGlobalClassAccessorDecoratorResultType : deferredGlobalClassAccessorDecoratorResultType = getGlobalType( + "ClassAccessorDecoratorResult", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassFieldDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassFieldDecoratorContextType != null ? deferredGlobalClassFieldDecoratorContextType : deferredGlobalClassFieldDecoratorContextType = getGlobalType( + "ClassFieldDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } function getGlobalNaNSymbol() { return deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol( "NaN", @@ -55569,7 +56137,7 @@ function createTypeChecker(host) { typeToString(fullIndexType), typeToString(objectType) ); - diagnostics.add(createDiagnosticForNodeFromMessageChain(accessExpression, errorInfo)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(accessExpression), accessExpression, errorInfo)); } } } @@ -57983,7 +58551,7 @@ function createTypeChecker(host) { } } } - const diag2 = createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, errorInfo, relatedInformation); if (relatedInfo) { addRelatedInfo(diag2, ...relatedInfo); } @@ -61026,19 +61594,22 @@ function createTypeChecker(host) { break; case 166 /* Parameter */: const param = declaration; - if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( - param, - param.name.escapedText, - 788968 /* Type */, - void 0, - param.name.escapedText, - /*isUse*/ - true - ) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) { - const newName = "arg" + param.parent.parameters.indexOf(param); - const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); - errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); - return; + if (isIdentifier(param.name)) { + const originalKeywordKind = identifierToKeywordKind(param.name); + if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( + param, + param.name.escapedText, + 788968 /* Type */, + void 0, + param.name.escapedText, + /*isUse*/ + true + ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) { + const newName = "arg" + param.parent.parameters.indexOf(param); + const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); + errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); + return; + } } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; @@ -61226,6 +61797,10 @@ function createTypeChecker(host) { function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); } + function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { + const typePredicate = getTypePredicateOfSignature(signature); + return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter); + } function createEmptyObjectTypeFromStringLiteral(type) { const members = createSymbolTable(); forEachType(type, (t) => { @@ -61949,7 +62524,7 @@ function createTypeChecker(host) { } else { const middleLength = targetArity - startLength - endLength; if (middleLength === 2) { - if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) { + if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */) { const targetInfo = getInferenceInfoForType(elementTypes[startLength]); if (targetInfo && targetInfo.impliedArity !== void 0) { inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]); @@ -61963,7 +62538,7 @@ function createTypeChecker(host) { inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]); inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]); } - } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) { + } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */) { const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter; const constraint = param && getBaseConstraintOfType(param); if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) { @@ -61983,10 +62558,10 @@ function createTypeChecker(host) { } } else if (middleLength === 1 && elementFlags[startLength] & 8 /* Variadic */) { const endsInOptional = target.target.elementFlags[targetArity - 1] & 2 /* Optional */; - const sourceSlice = isTupleType(source) ? sliceTupleType(source, startLength, endLength) : createArrayType(getTypeArguments(source)[0]); + const sourceSlice = sliceTupleType(source, startLength, endLength); inferWithPriority(sourceSlice, elementTypes[startLength], endsInOptional ? 2 /* SpeculativeTuple */ : 0); } else if (middleLength === 1 && elementFlags[startLength] & 4 /* Rest */) { - const restType = isTupleType(source) ? getElementTypeOfSliceOfTupleType(source, startLength, endLength) : getTypeArguments(source)[0]; + const restType = getElementTypeOfSliceOfTupleType(source, startLength, endLength); if (restType) { inferFromTypes(restType, elementTypes[startLength]); } @@ -62097,7 +62672,7 @@ function createTypeChecker(host) { function getCovariantInference(inference, signature) { const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates); const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter); - const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); + const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter)); const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates; const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates); return getWidenedType(unwidenedType); @@ -64152,7 +64727,7 @@ function createTypeChecker(host) { return getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */); } function isSymbolAssigned(symbol) { if (!symbol.valueDeclaration) { @@ -64234,6 +64809,9 @@ function createTypeChecker(host) { }); } function markAliasReferenced(symbol, location) { + if (compilerOptions.verbatimModuleSyntax) { + return; + } if (isNonLocalAlias( symbol, /*excludes*/ @@ -64241,7 +64819,7 @@ function createTypeChecker(host) { ) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) { const target = resolveAlias(symbol); if (getAllSymbolFlags(target) & (111551 /* Value */ | 1048576 /* ExportValue */)) { - if (compilerOptions.isolatedModules || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { + if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { markAliasSymbolAsReferenced(symbol); } else { markConstEnumAliasAsReferenced(symbol); @@ -64250,6 +64828,7 @@ function createTypeChecker(host) { } } function getNarrowedTypeOfSymbol(symbol, location) { + var _a2; const type = getTypeOfSymbol(symbol); const declaration = symbol.valueDeclaration; if (declaration) { @@ -64285,7 +64864,7 @@ function createTypeChecker(host) { if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) { const contextualSignature = getContextualSignature(func); if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) { - const restType = getReducedApparentType(getTypeOfSymbol(contextualSignature.parameters[0])); + const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a2 = getInferenceContext(func)) == null ? void 0 : _a2.nonFixingMapper)); if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) { const narrowedType = getFlowTypeOfReference( func, @@ -64338,7 +64917,7 @@ function createTypeChecker(host) { } let declaration = localOrExportSymbol.valueDeclaration; if (declaration && localOrExportSymbol.flags & 32 /* Class */) { - if (declaration.kind === 260 /* ClassDeclaration */ && nodeIsDecorated(declaration)) { + if (declaration.kind === 260 /* ClassDeclaration */ && nodeIsDecorated(legacyDecorators, declaration)) { let container = getContainingClass(node); while (container !== void 0) { if (container === declaration && container.name !== node) { @@ -64409,13 +64988,14 @@ function createTypeChecker(host) { const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); + const isCatch = flowContainer.kind === 295 /* CatchClause */; const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -64562,7 +65142,7 @@ function createTypeChecker(host) { } } function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) { - if (isPropertyDeclaration(container) && hasStaticModifier(container) && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { + if (isPropertyDeclaration(container) && hasStaticModifier(container) && legacyDecorators && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { error(thisExpression, Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); } } @@ -64940,7 +65520,7 @@ function createTypeChecker(host) { } } function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0); if (typeNode) { return getTypeFromTypeNode(typeNode); } @@ -65106,6 +65686,10 @@ function createTypeChecker(host) { const restIndex = signature.parameters.length - 1; return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex); } + function getContextualTypeForDecorator(decorator) { + const signature = getDecoratorCallSignature(decorator); + return signature ? getOrCreateTypeFromSignature(signature) : void 0; + } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { if (template.parent.kind === 212 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); @@ -65506,7 +66090,9 @@ function createTypeChecker(host) { } const index = findContextualNode(node); if (index >= 0) { - return contextualTypes[index]; + const cached = contextualTypes[index]; + if (cached || !contextFlags) + return cached; } const { parent } = node; switch (parent.kind) { @@ -65526,6 +66112,8 @@ function createTypeChecker(host) { case 210 /* CallExpression */: case 211 /* NewExpression */: return getContextualTypeForArgument(parent, node); + case 167 /* Decorator */: + return getContextualTypeForDecorator(parent); case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: return isConstTypeReference(parent.type) ? getContextualType(parent, contextFlags) : getTypeFromTypeNode(parent.type); @@ -65547,8 +66135,16 @@ function createTypeChecker(host) { Debug.assert(parent.parent.kind === 225 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); case 214 /* ParenthesizedExpression */: { - const tag = isInJSFile(parent) ? getJSDocTypeTag(parent) : void 0; - return !tag ? getContextualType(parent, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? getContextualType(parent, contextFlags) : getTypeFromTypeNode(tag.typeExpression.type); + if (isInJSFile(parent)) { + if (isJSDocSatisfiesExpression(parent)) { + return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent)); + } + const typeTag = getJSDocTypeTag(parent); + if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) { + return getTypeFromTypeNode(typeTag.typeExpression.type); + } + } + return getContextualType(parent, contextFlags); } case 232 /* NonNullExpression */: return getContextualType(parent, contextFlags); @@ -66700,7 +67296,7 @@ function createTypeChecker(host) { } if (jsxFactorySym) { jsxFactorySym.isReferenced = 67108863 /* All */; - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + if (!compilerOptions.verbatimModuleSyntax && jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { markAliasSymbolAsReferenced(jsxFactorySym); } } @@ -67157,7 +67753,7 @@ function createTypeChecker(host) { node.kind === 163 /* QualifiedName */ ); } - if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 302 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { + if (isIdentifier(left) && parentSymbol && (getIsolatedModules(compilerOptions) || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 302 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { markAliasReferenced(parentSymbol, node); } let propType; @@ -67366,7 +67962,7 @@ function createTypeChecker(host) { } } } - const resultDiagnostic = createDiagnosticForNodeFromMessageChain(propNode, errorInfo); + const resultDiagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(propNode), propNode, errorInfo); if (relatedInfo) { addRelatedInfo(resultDiagnostic, relatedInfo); } @@ -68228,35 +68824,22 @@ function createTypeChecker(host) { return args; } function getEffectiveDecoratorArguments(node) { - const parent = node.parent; const expr = node.expression; - switch (parent.kind) { - case 260 /* ClassDeclaration */: - case 228 /* ClassExpression */: - return [ - createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfDeclaration(parent))) - ]; - case 166 /* Parameter */: - const func = parent.parent; - return [ - createSyntheticExpression(expr, parent.parent.kind === 173 /* Constructor */ ? getTypeOfSymbol(getSymbolOfDeclaration(func)) : errorType), - createSyntheticExpression(expr, anyType), - createSyntheticExpression(expr, numberType) - ]; - case 169 /* PropertyDeclaration */: - case 171 /* MethodDeclaration */: - case 174 /* GetAccessor */: - case 175 /* SetAccessor */: - const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent) || hasAccessorModifier(parent)); - return [ - createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), - createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), - createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent)) : anyType) - ]; + const signature = getDecoratorCallSignature(node); + if (signature) { + const args = []; + for (const param of signature.parameters) { + const type = getTypeOfSymbol(param); + args.push(createSyntheticExpression(expr, type)); + } + return args; } return Debug.fail(); } function getDecoratorArgumentCount(node, signature) { + return compilerOptions.experimentalDecorators ? getLegacyDecoratorArgumentCount(node, signature) : 2; + } + function getLegacyDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { case 260 /* ClassDeclaration */: case 228 /* ClassExpression */: @@ -68291,9 +68874,15 @@ function createTypeChecker(host) { function getDiagnosticForCallNode(node, message, arg0, arg1, arg2, arg3) { if (isCallExpression(node)) { const { sourceFile, start, length: length2 } = getDiagnosticSpanForCallNode(node); - return createFileDiagnostic(sourceFile, start, length2, message, arg0, arg1, arg2, arg3); + if ("message" in message) { + return createFileDiagnostic(sourceFile, start, length2, message, arg0, arg1, arg2, arg3); + } + return createDiagnosticForFileFromMessageChain(sourceFile, message); } else { - return createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + if ("message" in message) { + return createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + } + return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, message); } } function isPromiseResolveArityError(node) { @@ -68317,7 +68906,7 @@ function createTypeChecker(host) { ); return constructorSymbol === globalPromiseSymbol; } - function getArgumentArityError(node, signatures, args) { + function getArgumentArityError(node, signatures, args, headMessage) { var _a2; const spreadIndex = getSpreadArgumentIndex(args); if (spreadIndex > -1) { @@ -68347,11 +68936,36 @@ function createTypeChecker(host) { if (isVoidPromiseError && isInJSFile(node)) { return getDiagnosticForCallNode(node, Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments); } - const error2 = hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; + const error2 = isDecorator(node) ? hasRestParameter2 ? Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 : Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 : hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; if (min2 < args.length && args.length < max) { + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, + args.length, + maxBelow, + minAbove + ); + chain = chainDiagnosticMessages(chain, headMessage); + return getDiagnosticForCallNode(node, chain); + } return getDiagnosticForCallNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove); } else if (args.length < min2) { - const diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + let diagnostic; + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + error2, + parameterRange, + args.length + ); + chain = chainDiagnosticMessages(chain, headMessage); + diagnostic = getDiagnosticForCallNode(node, chain); + } else { + diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + } const parameter = (_a2 = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a2.parameters[closestSignature.thisParameter ? args.length + 1 : args.length]; if (parameter) { const parameterError = createDiagnosticForNode( @@ -68370,15 +68984,37 @@ function createTypeChecker(host) { end++; } setTextRangePosEnd(errorSpan, pos, end); + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + error2, + parameterRange, + args.length + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), errorSpan, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error2, parameterRange, args.length); } } - function getTypeArgumentArityError(node, signatures, typeArguments) { + function getTypeArgumentArityError(node, signatures, typeArguments, headMessage) { const argCount = typeArguments.length; if (signatures.length === 1) { const sig = signatures[0]; const min2 = getMinTypeArgumentCount(sig.typeParameters); const max = length(sig.typeParameters); + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + min2 < max ? min2 + "-" + max : min2, + argCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min2 < max ? min2 + "-" + max : min2, argCount); } let belowArgCount = -Infinity; @@ -68393,11 +69029,34 @@ function createTypeChecker(host) { } } if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, + argCount, + belowArgCount, + aboveArgCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); } + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + belowArgCount === -Infinity ? aboveArgCount : belowArgCount, + argCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } - function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { + function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) { const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */; const isDecorator2 = node.kind === 167 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); @@ -68446,6 +69105,9 @@ function createTypeChecker(host) { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call); } + if (headMessage) { + chain = chainDiagnosticMessages(chain, headMessage); + } const diags = getSignatureApplicabilityError( node, args, @@ -68506,39 +69168,40 @@ function createTypeChecker(host) { } const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures"); - const chain = chainDiagnosticMessages( + let chain = chainDiagnosticMessages( map(diags, createDiagnosticMessageChainFromDiagnostic), Diagnostics.No_overload_matches_this_call ); + if (headMessage) { + chain = chainDiagnosticMessages(chain, headMessage); + } const related = [...flatMap(diags, (d) => d.relatedInformation)]; let diag2; if (every(diags, (d) => d.start === diags[0].start && d.length === diags[0].length && d.file === diags[0].file)) { const { file, start, length: length2 } = diags[0]; diag2 = { file, start, length: length2, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; } else { - diag2 = createDiagnosticForNodeFromMessageChain(node, chain, related); + diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, chain, related); } addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2); diagnostics.add(diag2); } } else if (candidateForArgumentArityError) { - diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args)); + diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args, headMessage)); } else if (candidateForTypeArgumentError) { checkTypeArguments( candidateForTypeArgumentError, node.typeArguments, /*reportErrors*/ true, - fallbackError + headMessage ); } else { const signaturesWithCorrectTypeArgumentArity = filter(signatures, (s) => hasCorrectTypeArgumentArity(s, typeArguments)); if (signaturesWithCorrectTypeArgumentArity.length === 0) { - diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments)); - } else if (!isDecorator2) { - diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args)); - } else if (fallbackError) { - diagnostics.add(getDiagnosticForCallNode(node, fallbackError)); + diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments, headMessage)); + } else { + diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args, headMessage)); } } } @@ -69041,7 +69704,7 @@ function createTypeChecker(host) { } function invocationError(errorTarget, apparentType, kind, relatedInformation) { const { messageChain, relatedMessage: relatedInfo } = invocationErrorDetails(errorTarget, apparentType, kind); - const diagnostic = createDiagnosticForNodeFromMessageChain(errorTarget, messageChain); + const diagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorTarget), errorTarget, messageChain); if (relatedInfo) { addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo)); } @@ -69122,7 +69785,7 @@ function createTypeChecker(host) { if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { return resolveUntypedCall(node); } - if (isPotentiallyUncalledDecorator(node, callSignatures)) { + if (isPotentiallyUncalledDecorator(node, callSignatures) && !isParenthesizedExpression(node.expression)) { const nodeStr = getTextOfNode( node.expression, /*includeTrivia*/ @@ -69135,7 +69798,7 @@ function createTypeChecker(host) { if (!callSignatures.length) { const errorDetails = invocationErrorDetails(node.expression, apparentType, 0 /* Call */); const messageChain = chainDiagnosticMessages(errorDetails.messageChain, headMessage); - const diag2 = createDiagnosticForNodeFromMessageChain(node.expression, messageChain); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node.expression), node.expression, messageChain); if (errorDetails.relatedMessage) { addRelatedInfo(diag2, createDiagnosticForNode(node.expression, errorDetails.relatedMessage)); } @@ -69752,12 +70415,15 @@ function createTypeChecker(host) { } function checkSatisfiesExpression(node) { checkSourceElement(node.type); - const exprType = checkExpression(node.expression); - const targetType = getTypeFromTypeNode(node.type); + return checkSatisfiesExpressionWorker(node.expression, node.type); + } + function checkSatisfiesExpressionWorker(expression, target, checkMode) { + const exprType = checkExpression(expression, checkMode); + const targetType = getTypeFromTypeNode(target); if (isErrorType(targetType)) { return targetType; } - checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); + checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); return exprType; } function checkMetaProperty(node) { @@ -70095,6 +70761,243 @@ function createTypeChecker(host) { } } } + function createClassDecoratorContextType(classType) { + return tryCreateTypeReference(getGlobalClassDecoratorContextType( + /*reportErrors*/ + true + ), [classType]); + } + function createClassMethodDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassMethodDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassGetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassGetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassSetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassSetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassFieldDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2) { + const key = `${isPrivate ? "p" : "P"}${isStatic2 ? "s" : "S"}${nameType.id}`; + let overrideType = decoratorContextOverrideTypeCache.get(key); + if (!overrideType) { + const members = createSymbolTable(); + members.set("name", createProperty("name", nameType)); + members.set("private", createProperty("private", isPrivate ? trueType : falseType)); + members.set("static", createProperty("static", isStatic2 ? trueType : falseType)); + overrideType = createAnonymousType( + /*symbol*/ + void 0, + members, + emptyArray, + emptyArray, + emptyArray + ); + decoratorContextOverrideTypeCache.set(key, overrideType); + } + return overrideType; + } + function createClassMemberDecoratorContextTypeForNode(node, thisType, valueType) { + const isStatic2 = hasStaticModifier(node); + const isPrivate = isPrivateIdentifier(node.name); + const nameType = isPrivate ? getStringLiteralType(idText(node.name)) : getLiteralTypeFromPropertyName(node.name); + const contextType = isMethodDeclaration(node) ? createClassMethodDecoratorContextType(thisType, valueType) : isGetAccessorDeclaration(node) ? createClassGetterDecoratorContextType(thisType, valueType) : isSetAccessorDeclaration(node) ? createClassSetterDecoratorContextType(thisType, valueType) : isAutoAccessorPropertyDeclaration(node) ? createClassAccessorDecoratorContextType(thisType, valueType) : isPropertyDeclaration(node) ? createClassFieldDecoratorContextType(thisType, valueType) : Debug.failBadSyntaxKind(node); + const overrideType = getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2); + return getIntersectionType([contextType, overrideType]); + } + function createClassAccessorDecoratorTargetType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorTargetType( + /*reportError*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorResultType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorResultType( + /*reportError*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorInitializerMutatorType(thisType, valueType) { + const thisParam = createParameter("this", thisType); + const valueParam = createParameter("value", valueType); + return createFunctionType( + /*typeParameters*/ + void 0, + thisParam, + [valueParam], + valueType, + /*typePredicate*/ + void 0, + 1 + ); + } + function createESDecoratorCallSignature(targetType, contextType, nonOptionalReturnType) { + const targetParam = createParameter("target", targetType); + const contextParam = createParameter("context", contextType); + const returnType = getUnionType([nonOptionalReturnType, voidType]); + return createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, contextParam], + returnType + ); + } + function getESDecoratorCallSignature(decorator) { + const { parent } = decorator; + const links = getNodeLinks(parent); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent.kind) { + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: { + const node = parent; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const contextType = createClassDecoratorContextType(targetType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); + break; + } + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: { + const node = parent; + if (!isClassLike(node.parent)) + break; + const valueType = isMethodDeclaration(node) ? getOrCreateTypeFromSignature(getSignatureFromDeclaration(node)) : getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + case 169 /* PropertyDeclaration */: { + const node = parent; + if (!isClassLike(node.parent)) + break; + const valueType = getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = hasAccessorModifier(node) ? createClassAccessorDecoratorTargetType(thisType, valueType) : undefinedType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = hasAccessorModifier(node) ? createClassAccessorDecoratorResultType(thisType, valueType) : createClassFieldDecoratorInitializerMutatorType(thisType, valueType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getLegacyDecoratorCallSignature(decorator) { + const { parent } = decorator; + const links = getNodeLinks(parent); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent.kind) { + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: { + const node = parent; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const targetParam = createParameter("target", targetType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam], + getUnionType([targetType, voidType]) + ); + break; + } + case 166 /* Parameter */: { + const node = parent; + if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { + break; + } + if (getThisParameter(node.parent) === node) { + break; + } + const index = getThisParameter(node.parent) ? node.parent.parameters.indexOf(node) - 1 : node.parent.parameters.indexOf(node); + Debug.assert(index >= 0); + const targetType = isConstructorDeclaration(node.parent) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent.parent)) : getParentTypeOfClassElement(node.parent); + const keyType = isConstructorDeclaration(node.parent) ? undefinedType : getClassElementPropertyKeyType(node.parent); + const indexType = getNumberLiteralType(index); + const targetParam = createParameter("target", targetType); + const keyParam = createParameter("propertyKey", keyType); + const indexParam = createParameter("parameterIndex", indexType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, indexParam], + voidType + ); + break; + } + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: + case 169 /* PropertyDeclaration */: { + const node = parent; + if (!isClassLike(node.parent)) + break; + const targetType = getParentTypeOfClassElement(node); + const targetParam = createParameter("target", targetType); + const keyType = getClassElementPropertyKeyType(node); + const keyParam = createParameter("propertyKey", keyType); + const returnType = isPropertyDeclaration(node) ? voidType : createTypedPropertyDescriptorType(getTypeOfNode(node)); + const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent) || hasAccessorModifier(parent)); + if (hasPropDesc) { + const descriptorType = createTypedPropertyDescriptorType(getTypeOfNode(node)); + const descriptorParam = createParameter("descriptor", descriptorType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, descriptorParam], + getUnionType([returnType, voidType]) + ); + } else { + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam], + getUnionType([returnType, voidType]) + ); + } + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getDecoratorCallSignature(decorator) { + return legacyDecorators ? getLegacyDecoratorCallSignature(decorator) : getESDecoratorCallSignature(decorator); + } function createPromiseType(promisedType) { const globalPromiseType = getGlobalPromiseType( /*reportErrors*/ @@ -71164,12 +72067,12 @@ function createTypeChecker(host) { void 0 ); const operator = operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) { - if (operator === 55 /* AmpersandAmpersandToken */) { - let parent = node.parent; - while (parent.kind === 214 /* ParenthesizedExpression */ || isBinaryExpression(parent) && (parent.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent.operatorToken.kind === 56 /* BarBarToken */)) { - parent = parent.parent; - } + if (isLogicalOrCoalescingBinaryOperator(operator)) { + let parent = node.parent; + while (parent.kind === 214 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent)) { + parent = parent.parent; + } + if (operator === 55 /* AmpersandAmpersandToken */ || isIfStatement(parent)) { checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent) ? parent.thenStatement : void 0); } checkTruthinessOfType(leftType, node.left); @@ -71246,7 +72149,7 @@ function createTypeChecker(host) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 108 /* ThisKeyword */); } let leftType; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) { + if (isLogicalOrCoalescingBinaryOperator(operator)) { leftType = checkTruthinessExpression(left, checkMode); } else { leftType = checkExpression(left, checkMode); @@ -71397,7 +72300,14 @@ function createTypeChecker(host) { if (checkForDisallowedESSymbolOperand(operator)) { leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); - reportOperatorErrorUnless((left2, right2) => isTypeComparableTo(left2, right2) || isTypeComparableTo(right2, left2) || isTypeAssignableTo(left2, numberOrBigIntType) && isTypeAssignableTo(right2, numberOrBigIntType)); + reportOperatorErrorUnless((left2, right2) => { + if (isTypeAny(left2) || isTypeAny(right2)) { + return true; + } + const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType); + const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType); + return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2); + }); } return booleanType; case 34 /* EqualsEqualsToken */: @@ -71530,7 +72440,7 @@ function createTypeChecker(host) { left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access - ) && (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) { + )) { let headMessage; if (exactOptionalPropertyTypes && isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768 /* Undefined */)) { const target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText); @@ -71789,6 +72699,12 @@ function createTypeChecker(host) { } function checkDeclarationInitializer(declaration, checkMode, contextualType) { const initializer = getEffectiveInitializer(declaration); + if (isInJSFile(declaration)) { + const typeNode = tryGetJSDocSatisfiesTypeNode(declaration); + if (typeNode) { + return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode); + } + } const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType( initializer, contextualType, @@ -72107,18 +73023,23 @@ function createTypeChecker(host) { if (!ok) { error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } - if (compilerOptions.isolatedModules) { + if (getIsolatedModules(compilerOptions)) { Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */)); const constEnumDeclaration = type.symbol.valueDeclaration; if (constEnumDeclaration.flags & 16777216 /* Ambient */) { - error(node, Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided); + error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } } } function checkParenthesizedExpression(node, checkMode) { - if (hasJSDocNodes(node) && isJSDocTypeAssertion(node)) { - const type = getJSDocTypeAssertionType(node); - return checkAssertionWorker(type, type, node.expression, checkMode); + if (hasJSDocNodes(node)) { + if (isJSDocSatisfiesExpression(node)) { + return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode); + } + if (isJSDocTypeAssertion(node)) { + const type = getJSDocTypeAssertionType(node); + return checkAssertionWorker(type, type, node.expression, checkMode); + } } return checkExpression(node.expression, checkMode); } @@ -72281,7 +73202,7 @@ function createTypeChecker(host) { } } function checkParameter(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkVariableLikeDeclaration(node); const func = getContainingFunction(node); if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) { @@ -72602,7 +73523,7 @@ function createTypeChecker(host) { } } function checkPropertyDeclaration(node) { - if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarProperty(node)) + if (!checkGrammarModifiers(node) && !checkGrammarProperty(node)) checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); setNodeLinksForPrivateIdentifierScope(node); @@ -72646,7 +73567,7 @@ function createTypeChecker(host) { } } function checkClassStaticBlockDeclaration(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); forEachChild(node, checkSourceElement); } function checkConstructorDeclaration(node) { @@ -72826,8 +73747,11 @@ function createTypeChecker(host) { } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 180 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) { - grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + if (node.kind === 180 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { + const sourceFile = getSourceFileOfNode(node); + if (scanTokenAtPosition(sourceFile, node.typeName.end) === 24 /* DotToken */) { + grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + } } forEach(node.typeArguments, checkSourceElement); const type = getTypeFromTypeReference(node); @@ -73520,7 +74444,7 @@ function createTypeChecker(host) { chain = chainDiagnosticMessages(chain, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForErrorOut.value)); } chain = chainDiagnosticMessages(chain, diagnosticMessage, arg0); - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chain)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chain)); } return void 0; } @@ -73611,36 +74535,66 @@ function createTypeChecker(host) { if (returnType.flags & 1 /* Any */) { return; } + const decoratorSignature = getDecoratorCallSignature(node); + if (!(decoratorSignature == null ? void 0 : decoratorSignature.resolvedReturnType)) + return; let headMessage; - let expectedReturnType; + const expectedReturnType = decoratorSignature.resolvedReturnType; switch (node.parent.kind) { case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - const classSymbol = getSymbolOfDeclaration(node.parent); - const classConstructorType = getTypeOfSymbol(classSymbol); - expectedReturnType = getUnionType([classConstructorType, voidType]); break; case 169 /* PropertyDeclaration */: + if (!legacyDecorators) { + headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + break; + } case 166 /* Parameter */: headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; - expectedReturnType = voidType; break; case 171 /* MethodDeclaration */: case 174 /* GetAccessor */: case 175 /* SetAccessor */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - const methodType = getTypeOfNode(node.parent); - const descriptorType = createTypedPropertyDescriptorType(methodType); - expectedReturnType = getUnionType([descriptorType, voidType]); break; default: - return Debug.fail(); + return Debug.failBadSyntaxKind(node.parent); } - checkTypeAssignableTo( - returnType, - expectedReturnType, - node, - headMessage + checkTypeAssignableTo(returnType, expectedReturnType, node.expression, headMessage); + } + function createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount = parameters.length, flags = 0 /* None */) { + const decl = factory.createFunctionTypeNode( + /*typeParameters*/ + void 0, + emptyArray, + factory.createKeywordTypeNode(131 /* AnyKeyword */) + ); + return createSignature(decl, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + } + function createFunctionType(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags) { + const signature = createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + return getOrCreateTypeFromSignature(signature); + } + function createGetterFunctionType(type) { + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + type + ); + } + function createSetterFunctionType(type) { + const valueParam = createParameter("value", type); + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [valueParam], + voidType ); } function markTypeNodeAsReferenced(node) { @@ -73667,9 +74621,9 @@ function createTypeChecker(host) { true ); if (rootSymbol && rootSymbol.flags & 2097152 /* Alias */) { - if (symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { + if (!compilerOptions.verbatimModuleSyntax && symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { markAliasSymbolAsReferenced(rootSymbol); - } else if (forDecoratorMetadata && compilerOptions.isolatedModules && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { + } else if (forDecoratorMetadata && getIsolatedModules(compilerOptions) && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { const diag2 = error(typeName, Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled); const aliasDeclaration = find(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration); if (aliasDeclaration) { @@ -73735,19 +74689,37 @@ function createTypeChecker(host) { return isRestParameter(node) ? getRestParameterElementType(typeNode) : typeNode; } function checkDecorators(node) { - if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(node, node.parent, node.parent.parent)) { + if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { return; } - if (!compilerOptions.experimentalDecorators) { - error(node, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning); - } const firstDecorator = find(node.modifiers, isDecorator); if (!firstDecorator) { return; } - checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 166 /* Parameter */) { - checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + if (legacyDecorators) { + checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); + if (node.kind === 166 /* Parameter */) { + checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + } + } else if (languageVersion < 99 /* ESNext */) { + checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */); + if (isClassDeclaration(node)) { + if (!node.name) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } else { + const member = getFirstTransformableStaticClassElement(node); + if (member) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } + } + } else if (!isClassExpression(node)) { + if (isPrivateIdentifier(node.name) && (isMethodDeclaration(node) || isAccessor(node) || isAutoAccessorPropertyDeclaration(node))) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } + if (isComputedPropertyName(node.name)) { + checkExternalEmitHelpers(firstDecorator, 16777216 /* PropKey */); + } + } } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); @@ -73817,6 +74789,19 @@ function createTypeChecker(host) { function checkJSDocTypeTag(node) { checkSourceElement(node.typeExpression); } + function checkJSDocSatisfiesTag(node) { + checkSourceElement(node.typeExpression); + const host2 = getEffectiveJSDocHost(node); + if (host2) { + const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag); + if (length(tags) > 1) { + for (let i = 1; i < length(tags); i++) { + const tagName = tags[i].tagName; + error(tagName, Diagnostics._0_tag_already_specified, idText(tagName)); + } + } + } + } function checkJSDocLinkLikeTag(node) { if (node.name) { resolveJSDocMemberName( @@ -74489,7 +75474,7 @@ function createTypeChecker(host) { return; } const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 205 /* BindingElement */ ? node.parent.parent : node)) { + if (symbol.flags & 2097152 /* Alias */ && (isVariableDeclarationInitializedToBareOrAccessedRequire(node) || isBindingElementOfBareOrAccessedRequire(node))) { checkAliasSymbol(node); return; } @@ -74581,7 +75566,7 @@ function createTypeChecker(host) { return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { - if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) + if (!checkGrammarModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) checkGrammarForDisallowedLetOrConstStatement(node); forEach(node.declarationList.declarations, checkSourceElement); } @@ -74602,15 +75587,24 @@ function createTypeChecker(host) { function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) { if (!strictNullChecks) return; - helper(condExpr, body); - while (isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56 /* BarBarToken */) { - condExpr = condExpr.left; - helper(condExpr, body); + bothHelper(condExpr, body); + function bothHelper(condExpr2, body2) { + condExpr2 = skipParentheses(condExpr2); + helper(condExpr2, body2); + while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 60 /* QuestionQuestionToken */)) { + condExpr2 = skipParentheses(condExpr2.left); + helper(condExpr2, body2); + } } function helper(condExpr2, body2) { - const location = isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 55 /* AmpersandAmpersandToken */) ? condExpr2.right : condExpr2; - if (isModuleExportsAccessExpression(location)) + const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2; + if (isModuleExportsAccessExpression(location)) { + return; + } + if (isLogicalOrCoalescingBinaryExpression(location)) { + bothHelper(location, body2); return; + } const type = location === condExpr2 ? condType : checkTruthinessExpression(location); const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression); if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast) @@ -74620,7 +75614,7 @@ function createTypeChecker(host) { if (callSignatures.length === 0 && !isPromise) { return; } - const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : isBinaryExpression(location) && isIdentifier(location.right) ? location.right : void 0; + const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0; const testedSymbol = testedNode && getSymbolAtLocation(testedNode); if (!testedSymbol && !isPromise) { return; @@ -75578,14 +76572,10 @@ function createTypeChecker(host) { if (catchClause) { if (catchClause.variableDeclaration) { const declaration = catchClause.variableDeclaration; - const typeNode = getEffectiveTypeAnnotationNode(getRootDeclaration(declaration)); + checkVariableLikeDeclaration(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration); if (typeNode) { - const type = getTypeForVariableLikeDeclaration( - declaration, - /*includeOptionality*/ - false, - 0 /* Normal */ - ); + const type = getTypeFromTypeNode(typeNode); if (type && !(type.flags & 3 /* AnyOrUnknown */)) { grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } @@ -75840,9 +76830,65 @@ function createTypeChecker(host) { } return true; } + function getFirstTransformableStaticClassElement(node) { + var _a2; + const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ESNext */ && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + ); + const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */; + const willTransformInitializers = !useDefineForClassFields || languageVersion < 9 /* ES2022 */; + if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) { + for (const member of node.members) { + if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated( + /*useLegacyDecorators*/ + false, + member, + node + )) { + return (_a2 = firstOrUndefined(getDecorators(node))) != null ? _a2 : node; + } else if (willTransformPrivateElementsOrClassStaticBlocks) { + if (isClassStaticBlockDeclaration(member)) { + return member; + } else if (isStatic(member)) { + if (isPrivateIdentifierClassElementDeclaration(member) || willTransformInitializers && isInitializedProperty(member)) { + return member; + } + } + } + } + } + } + function checkClassExpressionExternalHelpers(node) { + var _a2; + if (node.name) + return; + const parent = walkUpOuterExpressions(node); + if (!isNamedEvaluationSource(parent)) + return; + const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ESNext */; + let location; + if (willTransformESDecorators && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + )) { + location = (_a2 = firstOrUndefined(getDecorators(node))) != null ? _a2 : node; + } else { + location = getFirstTransformableStaticClassElement(node); + } + if (location) { + checkExternalEmitHelpers(location, 8388608 /* SetFunctionName */); + if ((isPropertyAssignment(parent) || isPropertyDeclaration(parent) || isBindingElement(parent)) && isComputedPropertyName(parent.name)) { + checkExternalEmitHelpers(location, 16777216 /* PropKey */); + } + } + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); + checkClassExpressionExternalHelpers(node); return getTypeOfSymbol(getSymbolOfDeclaration(node)); } function checkClassExpressionDeferred(node) { @@ -75851,7 +76897,7 @@ function createTypeChecker(host) { } function checkClassDeclaration(node) { const firstDecorator = find(node.modifiers, isDecorator); - if (firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { + if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator); } if (!node.name && !hasSyntacticModifier(node, 1024 /* Default */)) { @@ -76325,7 +77371,7 @@ function createTypeChecker(host) { typeName2 ); errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); - diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(typeNode), typeNode, errorInfo)); } } } @@ -76381,7 +77427,7 @@ function createTypeChecker(host) { return !containsUndefinedType(flowType); } function checkInterfaceDeclaration(node) { - if (!checkGrammarDecoratorsAndModifiers(node)) + if (!checkGrammarModifiers(node)) checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); addLazyDiagnostic(() => { @@ -76415,7 +77461,7 @@ function createTypeChecker(host) { }); } function checkTypeAliasDeclaration(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); @@ -76611,7 +77657,7 @@ function createTypeChecker(host) { addLazyDiagnostic(() => checkEnumDeclarationWorker(node)); } function checkEnumDeclarationWorker(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkCollisionsForDeclarationName(node, node.name); checkExportsOnMergedDeclarations(node); node.members.forEach(checkEnumMember); @@ -76686,6 +77732,7 @@ function createTypeChecker(host) { } addLazyDiagnostic(checkModuleDeclarationDiagnostics); function checkModuleDeclarationDiagnostics() { + var _a2, _b; const isGlobalAugmentation = isGlobalScopeAugmentation(node); const inAmbientContext = node.flags & 16777216 /* Ambient */; if (isGlobalAugmentation && !inAmbientContext) { @@ -76696,7 +77743,7 @@ function createTypeChecker(host) { if (checkGrammarModuleElementContext(node, contextErrorMessage)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node)) { + if (!checkGrammarModifiers(node)) { if (!inAmbientContext && node.name.kind === 10 /* StringLiteral */) { grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -76706,18 +77753,29 @@ function createTypeChecker(host) { } checkExportsOnMergedDeclarations(node); const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && symbol.declarations && symbol.declarations.length > 1 && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { - const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (firstNonAmbientClassOrFunc) { - if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { + if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) { + error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); + } + if (((_a2 = symbol.declarations) == null ? void 0 : _a2.length) > 1) { + const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + } else if (node.pos < firstNonAmbientClassOrFunc.pos) { + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + } + } + const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */); + if (mergedClass && inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */); - if (mergedClass && inSameLexicalScope(node, mergedClass)) { - getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */) { + const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 93 /* ExportKeyword */); + if (exportModifier) { + error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } } } if (isAmbientExternalModule) { @@ -76873,7 +77931,7 @@ function createTypeChecker(host) { const message = node.kind === 278 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } - if (compilerOptions.isolatedModules && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) { + if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) { const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol); const isType = !(targetFlags & 111551 /* Value */); if (isType || typeOnlyAlias) { @@ -76881,9 +77939,9 @@ function createTypeChecker(host) { case 270 /* ImportClause */: case 273 /* ImportSpecifier */: case 268 /* ImportEqualsDeclaration */: { - if (compilerOptions.preserveValueImports) { + if (compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) { Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); - const message = isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; + const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? compilerOptions.verbatimModuleSyntax ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : compilerOptions.verbatimModuleSyntax ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; const name = idText(node.kind === 273 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); addTypeOnlyDeclarationRelatedInfo( error(node, message, name), @@ -76892,24 +77950,23 @@ function createTypeChecker(host) { ); } if (isType && node.kind === 268 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) { - error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided); + error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); } break; } case 278 /* ExportSpecifier */: { - if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { - const message = isType ? Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled; + if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { const name = idText(node.propertyName || node.name); - addTypeOnlyDeclarationRelatedInfo( - error(node, message, name), - isType ? void 0 : typeOnlyAlias, - name - ); - return; + const diagnostic = isType ? error(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName); + addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name); + break; } } } } + if (compilerOptions.verbatimModuleSyntax && node.kind !== 268 /* ImportEqualsDeclaration */ && !isInJSFile(node) && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } } if (isImportSpecifier(node)) { const targetSymbol = checkDeprecatedAliasedSymbol(symbol, node); @@ -76989,7 +78046,7 @@ function createTypeChecker(host) { if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -77019,7 +78076,7 @@ function createTypeChecker(host) { if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (hasSyntacticModifier(node, 1 /* Export */)) { @@ -77055,7 +78112,7 @@ function createTypeChecker(host) { if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasSyntacticModifiers(node)) { + if (!checkGrammarModifiers(node) && hasSyntacticModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers); } if (node.moduleSpecifier && node.exportClause && isNamedExports(node.exportClause) && length(node.exportClause.elements) && languageVersion === 0 /* ES3 */) { @@ -77092,12 +78149,8 @@ function createTypeChecker(host) { } function checkGrammarExportDeclaration(node) { var _a2; - if (node.isTypeOnly) { - if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) { - return checkGrammarNamedImportsOrExports(node.exportClause); - } else { - return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type); - } + if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) { + return checkGrammarNamedImportsOrExports(node.exportClause); } return false; } @@ -77195,13 +78248,14 @@ function createTypeChecker(host) { } return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); } const typeAnnotationNode = getEffectiveTypeAnnotationNode(node); if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } + const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; const sym = resolveEntityName( @@ -77215,16 +78269,28 @@ function createTypeChecker(host) { ); if (sym) { markAliasReferenced(sym, id); - const target = sym.flags & 2097152 /* Alias */ ? resolveAlias(sym) : sym; - if (getAllSymbolFlags(target) & 111551 /* Value */) { - checkExpressionCached(node.expression); + if (getAllSymbolFlags(sym) & 111551 /* Value */) { + checkExpressionCached(id); + if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { + error( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, + idText(id) + ); + } + } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + error( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, + idText(id) + ); } } else { - checkExpressionCached(node.expression); + checkExpressionCached(id); } if (getEmitDeclarations(compilerOptions)) { collectLinkedAliases( - node.expression, + id, /*setVisibility*/ true ); @@ -77232,6 +78298,9 @@ function createTypeChecker(host) { } else { checkExpressionCached(node.expression); } + if (isIllegalExportDefaultInCJS) { + error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } checkExternalModuleExports(container); if (node.flags & 16777216 /* Ambient */ && !isEntityNameExpression(node.expression)) { grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context); @@ -77421,6 +78490,8 @@ function createTypeChecker(host) { case 338 /* JSDocProtectedTag */: case 337 /* JSDocPrivateTag */: return checkJSDocAccessibilityModifiers(node); + case 353 /* JSDocSatisfiesTag */: + return checkJSDocSatisfiesTag(node); case 196 /* IndexedAccessType */: return checkIndexedAccessType(node); case 197 /* MappedType */: @@ -78436,8 +79507,9 @@ function createTypeChecker(host) { } } function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; + const specifier = getIdentifierGeneratedImportReference(nodeIn); + if (specifier) { + return specifier; } const node = getParseTreeNode(nodeIn, isIdentifier); if (node) { @@ -78519,6 +79591,7 @@ function createTypeChecker(host) { return false; } function isValueAliasDeclaration(node) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); switch (node.kind) { case 268 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfDeclaration(node)); @@ -78559,6 +79632,7 @@ function createTypeChecker(host) { return isConstEnumSymbol(s) || !!s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); if (isAliasSymbolDeclaration(node)) { const symbol = getSymbolOfDeclaration(node); const links = symbol && getSymbolLinks(symbol); @@ -79275,23 +80349,27 @@ function createTypeChecker(host) { const helpersModule = resolveHelpersModule(sourceFile, location); if (helpersModule !== unknownSymbol) { const uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; - for (let helper = 1 /* FirstEmitHelper */; helper <= 4194304 /* LastEmitHelper */; helper <<= 1) { + for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) { if (uncheckedHelpers & helper) { - const name = getHelperName(helper); - const symbol = getSymbol(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */); - if (!symbol) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); - } else if (helper & 524288 /* ClassPrivateFieldGet */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); - } - } else if (helper & 1048576 /* ClassPrivateFieldSet */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); - } - } else if (helper & 1024 /* SpreadArray */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + for (const name of getHelperNames(helper)) { + if (requestedExternalEmitHelperNames.has(name)) + continue; + requestedExternalEmitHelperNames.add(name); + const symbol = getSymbol(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */); + if (!symbol) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); + } else if (helper & 524288 /* ClassPrivateFieldGet */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); + } + } else if (helper & 1048576 /* ClassPrivateFieldSet */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); + } + } else if (helper & 1024 /* SpreadArray */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + } } } } @@ -79301,54 +80379,58 @@ function createTypeChecker(host) { } } } - function getHelperName(helper) { + function getHelperNames(helper) { switch (helper) { case 1 /* Extends */: - return "__extends"; + return ["__extends"]; case 2 /* Assign */: - return "__assign"; + return ["__assign"]; case 4 /* Rest */: - return "__rest"; + return ["__rest"]; case 8 /* Decorate */: - return "__decorate"; + return legacyDecorators ? ["__decorate"] : ["__esDecorate", "__runInitializers"]; case 16 /* Metadata */: - return "__metadata"; + return ["__metadata"]; case 32 /* Param */: - return "__param"; + return ["__param"]; case 64 /* Awaiter */: - return "__awaiter"; + return ["__awaiter"]; case 128 /* Generator */: - return "__generator"; + return ["__generator"]; case 256 /* Values */: - return "__values"; + return ["__values"]; case 512 /* Read */: - return "__read"; + return ["__read"]; case 1024 /* SpreadArray */: - return "__spreadArray"; + return ["__spreadArray"]; case 2048 /* Await */: - return "__await"; + return ["__await"]; case 4096 /* AsyncGenerator */: - return "__asyncGenerator"; + return ["__asyncGenerator"]; case 8192 /* AsyncDelegator */: - return "__asyncDelegator"; + return ["__asyncDelegator"]; case 16384 /* AsyncValues */: - return "__asyncValues"; + return ["__asyncValues"]; case 32768 /* ExportStar */: - return "__exportStar"; + return ["__exportStar"]; case 65536 /* ImportStar */: - return "__importStar"; + return ["__importStar"]; case 131072 /* ImportDefault */: - return "__importDefault"; + return ["__importDefault"]; case 262144 /* MakeTemplateObject */: - return "__makeTemplateObject"; + return ["__makeTemplateObject"]; case 524288 /* ClassPrivateFieldGet */: - return "__classPrivateFieldGet"; + return ["__classPrivateFieldGet"]; case 1048576 /* ClassPrivateFieldSet */: - return "__classPrivateFieldSet"; + return ["__classPrivateFieldSet"]; case 2097152 /* ClassPrivateFieldIn */: - return "__classPrivateFieldIn"; + return ["__classPrivateFieldIn"]; case 4194304 /* CreateBinding */: - return "__createBinding"; + return ["__createBinding"]; + case 8388608 /* SetFunctionName */: + return ["__setFunctionName"]; + case 16777216 /* PropKey */: + return ["__propKey"]; default: return Debug.fail("Unrecognized helper"); } @@ -79359,257 +80441,264 @@ function createTypeChecker(host) { } return externalHelpersModule; } - function checkGrammarDecoratorsAndModifiers(node) { - return checkGrammarDecorators(node) || checkGrammarModifiers(node); - } - function checkGrammarDecorators(node) { - if (canHaveIllegalDecorators(node) && some(node.illegalDecorators)) { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); - } - if (!canHaveDecorators(node) || !hasDecorators(node)) { - return false; - } - if (!nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 171 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { - return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); - } else { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); - } - } else if (node.kind === 174 /* GetAccessor */ || node.kind === 175 /* SetAccessor */) { - const accessors = getAllAccessorDeclarations(node.parent.members, node); - if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); - } - } - return false; - } function checkGrammarModifiers(node) { - const quickResult = reportObviousModifierErrors(node); + const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node); if (quickResult !== void 0) { return quickResult; } - let lastStatic, lastDeclare, lastAsync, lastOverride; + if (isParameter(node) && parameterIsThisKeyword(node)) { + return grammarErrorOnFirstToken(node, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); + } + let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; + let sawExportBeforeDecorators = false; for (const modifier of node.modifiers) { - if (isDecorator(modifier)) - continue; - if (modifier.kind !== 146 /* ReadonlyKeyword */) { - if (node.kind === 168 /* PropertySignature */ || node.kind === 170 /* MethodSignature */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); + if (isDecorator(modifier)) { + if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { + if (node.kind === 171 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } else { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); + } + } else if (legacyDecorators && (node.kind === 174 /* GetAccessor */ || node.kind === 175 /* SetAccessor */)) { + const accessors = getAllAccessorDeclarations(node.parent.members, node); + if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } } - if (node.kind === 178 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !isClassLike(node.parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); + if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { + return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } - } - if (modifier.kind !== 101 /* InKeyword */ && modifier.kind !== 145 /* OutKeyword */ && modifier.kind !== 85 /* ConstKeyword */) { - if (node.kind === 165 /* TypeParameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); + flags |= 131072 /* Decorator */; + if (flags & 1 /* Export */) { + sawExportBeforeDecorators = true; } - } - switch (modifier.kind) { - case 85 /* ConstKeyword */: - if (node.kind !== 263 /* EnumDeclaration */ && node.kind !== 165 /* TypeParameter */) { - return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(85 /* ConstKeyword */)); - } - const parent = node.parent; - if (node.kind === 165 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent) || isClassLike(parent) || isFunctionTypeNode(parent) || isConstructorTypeNode(parent) || isCallSignatureDeclaration(parent) || isConstructSignatureDeclaration(parent) || isMethodSignature(parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); + firstDecorator != null ? firstDecorator : firstDecorator = modifier; + } else { + if (modifier.kind !== 146 /* ReadonlyKeyword */) { + if (node.kind === 168 /* PropertySignature */ || node.kind === 170 /* MethodSignature */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); } - break; - case 161 /* OverrideKeyword */: - if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); - } - flags |= 16384 /* Override */; - lastOverride = modifier; - break; - case 123 /* PublicKeyword */: - case 122 /* ProtectedKeyword */: - case 121 /* PrivateKeyword */: - const text = visibilityToString(modifierToFlag(modifier.kind)); - if (flags & 28 /* AccessibilityModifier */) { - return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); - } else if (flags & 32 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); - } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); - } else if (flags & 256 /* Abstract */) { - if (modifier.kind === 121 /* PrivateKeyword */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); - } else { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); - } - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + if (node.kind === 178 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !isClassLike(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); } - flags |= modifierToFlag(modifier.kind); - break; - case 124 /* StaticKeyword */: - if (flags & 32 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); - } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } else if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); - } - flags |= 32 /* Static */; - lastStatic = modifier; - break; - case 127 /* AccessorKeyword */: - if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); - } else if (node.kind !== 169 /* PropertyDeclaration */) { - return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); - } - flags |= 128 /* Accessor */; - break; - case 146 /* ReadonlyKeyword */: - if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); - } else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); - } - flags |= 64 /* Readonly */; - break; - case 93 /* ExportKeyword */: - if (flags & 1 /* Export */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } else if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); - } else if (isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 88 /* DefaultKeyword */: - const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 264 /* ModuleDeclaration */ && !isAmbientModule(container)) { - return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); - } else if (!(flags & 1 /* Export */)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); - } - flags |= 1024 /* Default */; - break; - case 136 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); - } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 265 /* ModuleBlock */) { - return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); - } - flags |= 2 /* Ambient */; - lastDeclare = modifier; - break; - case 126 /* AbstractKeyword */: - if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); + } + if (modifier.kind !== 101 /* InKeyword */ && modifier.kind !== 145 /* OutKeyword */ && modifier.kind !== 85 /* ConstKeyword */) { + if (node.kind === 165 /* TypeParameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); } - if (node.kind !== 260 /* ClassDeclaration */ && node.kind !== 182 /* ConstructorType */) { - if (node.kind !== 171 /* MethodDeclaration */ && node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 174 /* GetAccessor */ && node.kind !== 175 /* SetAccessor */) { - return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + switch (modifier.kind) { + case 85 /* ConstKeyword */: + if (node.kind !== 263 /* EnumDeclaration */ && node.kind !== 165 /* TypeParameter */) { + return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(85 /* ConstKeyword */)); + } + const parent = node.parent; + if (node.kind === 165 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent) || isClassLike(parent) || isFunctionTypeNode(parent) || isConstructorTypeNode(parent) || isCallSignatureDeclaration(parent) || isConstructSignatureDeclaration(parent) || isMethodSignature(parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); + } + break; + case 161 /* OverrideKeyword */: + if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); } - if (!(node.parent.kind === 260 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { - return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + flags |= 16384 /* Override */; + lastOverride = modifier; + break; + case 123 /* PublicKeyword */: + case 122 /* ProtectedKeyword */: + case 121 /* PrivateKeyword */: + const text = visibilityToString(modifierToFlag(modifier.kind)); + if (flags & 28 /* AccessibilityModifier */) { + return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); + } else if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); + } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); + } else if (flags & 256 /* Abstract */) { + if (modifier.kind === 121 /* PrivateKeyword */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); + } else { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); + } + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); } + flags |= modifierToFlag(modifier.kind); + break; + case 124 /* StaticKeyword */: if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); + } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } else if (flags & 256 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); } - if (flags & 8 /* Private */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + flags |= 32 /* Static */; + lastStatic = modifier; + break; + case 127 /* AccessorKeyword */: + if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); + } else if (node.kind !== 169 /* PropertyDeclaration */) { + return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); } - if (flags & 512 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + flags |= 128 /* Accessor */; + break; + case 146 /* ReadonlyKeyword */: + if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); + } else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); } - if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + flags |= 64 /* Readonly */; + break; + case 93 /* ExportKeyword */: + if (compilerOptions.verbatimModuleSyntax && !(node.flags & 16777216 /* Ambient */) && node.kind !== 262 /* TypeAliasDeclaration */ && node.kind !== 261 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later + node.kind !== 264 /* ModuleDeclaration */ && node.parent.kind === 308 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } - if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + if (flags & 1 /* Export */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } else if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); + } else if (isClassLike(node.parent)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } - } - if (isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); - } - flags |= 256 /* Abstract */; - break; - case 132 /* AsyncKeyword */: - if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); - } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); - } - if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } - flags |= 512 /* Async */; - lastAsync = modifier; - break; - case 101 /* InKeyword */: - case 145 /* OutKeyword */: - const inOutFlag = modifier.kind === 101 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; - const inOutText = modifier.kind === 101 /* InKeyword */ ? "in" : "out"; - if (node.kind !== 165 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); - } - if (flags & inOutFlag) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); - } - if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); - } - flags |= inOutFlag; - break; + flags |= 1 /* Export */; + break; + case 88 /* DefaultKeyword */: + const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 264 /* ModuleDeclaration */ && !isAmbientModule(container)) { + return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } else if (!(flags & 1 /* Export */)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); + } else if (sawExportBeforeDecorators) { + return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here); + } + flags |= 1024 /* Default */; + break; + case 136 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); + } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 265 /* ModuleBlock */) { + return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); + } + flags |= 2 /* Ambient */; + lastDeclare = modifier; + break; + case 126 /* AbstractKeyword */: + if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); + } + if (node.kind !== 260 /* ClassDeclaration */ && node.kind !== 182 /* ConstructorType */) { + if (node.kind !== 171 /* MethodDeclaration */ && node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 174 /* GetAccessor */ && node.kind !== 175 /* SetAccessor */) { + return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + if (!(node.parent.kind === 260 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { + return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + } + if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } + if (flags & 8 /* Private */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + } + if (flags & 512 /* Async */ && lastAsync) { + return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + } + if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + } + } + if (isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); + } + flags |= 256 /* Abstract */; + break; + case 132 /* AsyncKeyword */: + if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); + } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); + } + if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + flags |= 512 /* Async */; + lastAsync = modifier; + break; + case 101 /* InKeyword */: + case 145 /* OutKeyword */: + const inOutFlag = modifier.kind === 101 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; + const inOutText = modifier.kind === 101 /* InKeyword */ ? "in" : "out"; + if (node.kind !== 165 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); + } + if (flags & inOutFlag) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); + } + if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); + } + flags |= inOutFlag; + break; + } } } if (node.kind === 173 /* Constructor */) { @@ -79636,9 +80725,16 @@ function createTypeChecker(host) { return false; } function reportObviousModifierErrors(node) { - return !node.modifiers ? false : shouldReportBadModifier(node) ? grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here) : void 0; + if (!node.modifiers) + return false; + const modifier = findFirstIllegalModifier(node); + return modifier && grammarErrorOnFirstToken(modifier, Diagnostics.Modifiers_cannot_appear_here); } - function shouldReportBadModifier(node) { + function findFirstModifierExcept(node, allowedModifier) { + const modifier = find(node.modifiers, isModifier); + return modifier && modifier.kind !== allowedModifier ? modifier : void 0; + } + function findFirstIllegalModifier(node) { switch (node.kind) { case 174 /* GetAccessor */: case 175 /* SetAccessor */: @@ -79657,43 +80753,42 @@ function createTypeChecker(host) { case 216 /* ArrowFunction */: case 166 /* Parameter */: case 165 /* TypeParameter */: - return false; + return void 0; case 172 /* ClassStaticBlockDeclaration */: case 299 /* PropertyAssignment */: case 300 /* ShorthandPropertyAssignment */: case 267 /* NamespaceExportDeclaration */: case 181 /* FunctionType */: case 279 /* MissingDeclaration */: - return true; + return find(node.modifiers, isModifier); default: if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return false; + return void 0; } switch (node.kind) { case 259 /* FunctionDeclaration */: - return nodeHasAnyModifiersExcept(node, 132 /* AsyncKeyword */); + return findFirstModifierExcept(node, 132 /* AsyncKeyword */); case 260 /* ClassDeclaration */: case 182 /* ConstructorType */: - return nodeHasAnyModifiersExcept(node, 126 /* AbstractKeyword */); + return findFirstModifierExcept(node, 126 /* AbstractKeyword */); case 228 /* ClassExpression */: case 261 /* InterfaceDeclaration */: case 240 /* VariableStatement */: case 262 /* TypeAliasDeclaration */: - return true; + return find(node.modifiers, isModifier); case 263 /* EnumDeclaration */: - return nodeHasAnyModifiersExcept(node, 85 /* ConstKeyword */); + return findFirstModifierExcept(node, 85 /* ConstKeyword */); default: Debug.assertNever(node); } } } - function nodeHasAnyModifiersExcept(node, allowedModifier) { - for (const modifier of node.modifiers) { - if (isDecorator(modifier)) - continue; - return modifier.kind !== allowedModifier; - } - return false; + function reportObviousDecoratorErrors(node) { + const decorator = findFirstIllegalDecorator(node); + return decorator && grammarErrorOnFirstToken(decorator, Diagnostics.Decorators_are_not_valid_here); + } + function findFirstIllegalDecorator(node) { + return canHaveIllegalDecorators(node) ? find(node.modifiers, isDecorator) : void 0; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { @@ -79772,7 +80867,7 @@ function createTypeChecker(host) { } function checkGrammarFunctionLikeDeclaration(node) { const file = getSourceFileOfNode(node); - return checkGrammarDecoratorsAndModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); + return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); } function checkGrammarClassLikeDeclaration(node) { const file = getSourceFileOfNode(node); @@ -79830,7 +80925,7 @@ function createTypeChecker(host) { return false; } function checkGrammarIndexSignature(node) { - return checkGrammarDecoratorsAndModifiers(node) || checkGrammarIndexSignatureParameters(node); + return checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { if (typeArguments && typeArguments.length === 0) { @@ -79870,7 +80965,7 @@ function createTypeChecker(host) { function checkGrammarClassDeclarationHeritageClauses(node) { let seenExtendsClause = false; let seenImplementsClause = false; - if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) { + if (!checkGrammarModifiers(node) && node.heritageClauses) { for (const heritageClause of node.heritageClauses) { if (heritageClause.token === 94 /* ExtendsKeyword */) { if (seenExtendsClause) { @@ -79971,7 +81066,9 @@ function createTypeChecker(host) { } } else if (canHaveIllegalModifiers(prop) && prop.modifiers) { for (const mod of prop.modifiers) { - grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); + if (isModifier(mod)) { + grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); + } } } let currentKind; @@ -80415,7 +81512,7 @@ function createTypeChecker(host) { } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 79 /* Identifier */) { - if (name.originalKeywordKind === 119 /* LetKeyword */) { + if (name.escapedText === "let") { return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { @@ -80703,6 +81800,9 @@ function createTypeChecker(host) { }); } function checkGrammarImportCallExpression(node) { + if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) { + return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } if (moduleKind === 5 /* ES2015 */) { return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext); } @@ -80978,13 +82078,10 @@ var SymbolTrackerImpl = class { // src/compiler/visitorPublic.ts function visitNode(node, visitor, test, lift) { - if (node === void 0 || visitor === void 0) { + if (node === void 0) { return node; } const visited = visitor(node); - if (visited === node) { - return node; - } let visitedNode; if (visited === void 0) { return void 0; @@ -80997,7 +82094,7 @@ function visitNode(node, visitor, test, lift) { return visitedNode; } function visitNodes2(nodes, visitor, test, start, count) { - if (nodes === void 0 || visitor === void 0) { + if (nodes === void 0) { return nodes; } const length2 = nodes.length; @@ -81046,25 +82143,30 @@ function visitArrayWorker(nodes, visitor, test, start, count) { } for (let i = 0; i < count; i++) { const node = nodes[i + start]; - const visited = node !== void 0 ? visitor(node) : void 0; + const visited = node !== void 0 ? visitor ? visitor(node) : node : void 0; if (updated !== void 0 || visited === void 0 || visited !== node) { if (updated === void 0) { updated = nodes.slice(0, i); + Debug.assertEachNode(updated, test); } if (visited) { if (isArray(visited)) { for (const visitedNode of visited) { - void Debug.assertNode(visitedNode, test); + Debug.assertNode(visitedNode, test); updated.push(visitedNode); } } else { - void Debug.assertNode(visited, test); + Debug.assertNode(visited, test); updated.push(visited); } } } } - return updated != null ? updated : nodes; + if (updated) { + return updated; + } + Debug.assertEachNode(nodes, test); + return nodes; } function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict, nodesVisitor = visitNodes2) { context.startLexicalEnvironment(); @@ -81078,7 +82180,7 @@ function visitParameterList(nodes, visitor, context, nodesVisitor = visitNodes2) context.startLexicalEnvironment(); if (nodes) { context.setLexicalEnvironmentFlags(1 /* InParameters */, true); - updated = nodesVisitor(nodes, visitor, isParameterDeclaration); + updated = nodesVisitor(nodes, visitor, isParameter); if (context.getLexicalEnvironmentFlags() & 2 /* VariablesHoistedInParameters */ && getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { updated = addDefaultValueAssignmentsIfNeeded(updated, context); } @@ -81200,6 +82302,7 @@ function visitFunctionBody(node, visitor, context, nodeVisitor = visitNode) { function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { context.startBlockScope(); const updated = nodeVisitor(body, visitor, isStatement, context.factory.liftToBlock); + Debug.assert(updated); const declarations = context.endBlockScope(); if (some(declarations)) { if (isBlock(updated)) { @@ -81211,6 +82314,18 @@ function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { } return updated; } +function visitCommaListElements(elements, visitor, discardVisitor = visitor) { + if (discardVisitor === visitor || elements.length <= 1) { + return visitNodes2(elements, visitor, isExpression); + } + let i = 0; + const length2 = elements.length; + return visitNodes2(elements, (node) => { + const discarded = i < length2 - 1; + i++; + return discarded ? discardVisitor(node) : visitor(node); + }, isExpression); +} function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) { if (node === void 0) { return void 0; @@ -81219,23 +82334,17 @@ function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, toke return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor); } var visitEachChildTable = { - [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateIdentifier( - node, - nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration) - ); - }, [163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateQualifiedName( node, - nodeVisitor(node.left, visitor, isEntityName), - nodeVisitor(node.right, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), + Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) ); }, [164 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateComputedPropertyName( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Signature elements @@ -81243,7 +82352,7 @@ var visitEachChildTable = { return context.factory.updateTypeParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.constraint, visitor, isTypeNode), nodeVisitor(node.default, visitor, isTypeNode) ); @@ -81252,9 +82361,9 @@ var visitEachChildTable = { return context.factory.updateParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -81262,7 +82371,7 @@ var visitEachChildTable = { [167 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDecorator( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Type elements @@ -81270,19 +82379,19 @@ var visitEachChildTable = { return context.factory.updatePropertySignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode) ); }, [169 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - var _a2; + var _a2, _b; return context.factory.updatePropertyDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration - nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken), + tokenVisitor ? nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken) : (_b = node.questionToken) != null ? _b : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -81291,10 +82400,10 @@ var visitEachChildTable = { return context.factory.updateMethodSignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -81302,9 +82411,9 @@ var visitEachChildTable = { return context.factory.updateMethodDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), @@ -81314,7 +82423,7 @@ var visitEachChildTable = { [173 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -81323,7 +82432,7 @@ var visitEachChildTable = { return context.factory.updateGetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor) @@ -81333,7 +82442,7 @@ var visitEachChildTable = { return context.factory.updateSetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -81350,7 +82459,7 @@ var visitEachChildTable = { return context.factory.updateCallSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -81358,16 +82467,16 @@ var visitEachChildTable = { return context.factory.updateConstructSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, [178 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexSignature( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, // Types @@ -81375,14 +82484,14 @@ var visitEachChildTable = { return context.factory.updateTypePredicateNode( node, nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), - nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode), + Debug.checkDefined(nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode)), nodeVisitor(node.type, visitor, isTypeNode) ); }, [180 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeReferenceNode( node, - nodeVisitor(node.typeName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -81390,8 +82499,8 @@ var visitEachChildTable = { return context.factory.updateFunctionTypeNode( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [182 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -81399,14 +82508,14 @@ var visitEachChildTable = { node, nodesVisitor(node.modifiers, visitor, isModifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [183 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeQueryNode( node, - nodeVisitor(node.exprName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -81419,7 +82528,7 @@ var visitEachChildTable = { [185 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateArrayTypeNode( node, - nodeVisitor(node.elementType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) ); }, [186 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -81431,13 +82540,13 @@ var visitEachChildTable = { [187 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateOptionalTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [188 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateRestTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [189 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -81455,22 +82564,22 @@ var visitEachChildTable = { [191 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConditionalTypeNode( node, - nodeVisitor(node.checkType, visitor, isTypeNode), - nodeVisitor(node.extendsType, visitor, isTypeNode), - nodeVisitor(node.trueType, visitor, isTypeNode), - nodeVisitor(node.falseType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.extendsType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.trueType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) ); }, [192 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInferTypeNode( node, - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration) + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) ); }, [202 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeNode( node, - nodeVisitor(node.argument, visitor, isTypeNode), + Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer), nodeVisitor(node.qualifier, visitor, isEntityName), nodesVisitor(node.typeArguments, visitor, isTypeNode), @@ -81480,45 +82589,45 @@ var visitEachChildTable = { [298 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeAssertionContainer( node, - nodeVisitor(node.assertClause, visitor, isAssertClause), + Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), node.multiLine ); }, [199 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateNamedTupleMember( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.type, visitor, isTypeNode) + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [193 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedType( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [195 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOperatorNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [196 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexedAccessTypeNode( node, - nodeVisitor(node.objectType, visitor, isTypeNode), - nodeVisitor(node.indexType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) ); }, [197 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMappedTypeNode( node, - nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken), - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration), + tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)), nodeVisitor(node.nameType, visitor, isTypeNode), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodesVisitor(node.members, visitor, isTypeElement) ); @@ -81526,21 +82635,21 @@ var visitEachChildTable = { [198 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLiteralTypeNode( node, - nodeVisitor(node.literal, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) ); }, [200 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralType( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) ); }, [201 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralTypeSpan( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Binding patterns @@ -81559,9 +82668,9 @@ var visitEachChildTable = { [205 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBindingElement( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, nodeVisitor(node.propertyName, visitor, isPropertyName), - nodeVisitor(node.name, visitor, isBindingName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -81581,37 +82690,37 @@ var visitEachChildTable = { [208 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ) : context.factory.updatePropertyAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ); }, [209 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isElementAccessChain(node) ? context.factory.updateElementAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ) : context.factory.updateElementAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ); }, [210 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return isCallChain(node) ? context.factory.updateCallChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ) : context.factory.updateCallExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -81619,7 +82728,7 @@ var visitEachChildTable = { [211 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNewExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -81627,29 +82736,29 @@ var visitEachChildTable = { [212 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTaggedTemplateExpression( node, - nodeVisitor(node.tag, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.template, visitor, isTemplateLiteral) + Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) ); }, [213 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAssertion( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [214 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [215 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionExpression( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -81664,82 +82773,82 @@ var visitEachChildTable = { nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken)) : node.equalsGreaterThanToken, visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, [217 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDeleteExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [218 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOfExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [219 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVoidExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [220 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAwaitExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [221 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePrefixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [222 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePostfixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [223 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBinaryExpression( node, - nodeVisitor(node.left, visitor, isExpression), - nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken), - nodeVisitor(node.right, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken)) : node.operatorToken, + Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) ); }, [224 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateConditionalExpression( node, - nodeVisitor(node.condition, visitor, isExpression), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.whenTrue, visitor, isExpression), - nodeVisitor(node.colonToken, tokenVisitor, isColonToken), - nodeVisitor(node.whenFalse, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken)) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.whenTrue, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.colonToken, tokenVisitor, isColonToken)) : node.colonToken, + Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) ); }, [225 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateExpression( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateSpan) ); }, [226 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateYieldExpression( node, - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.expression, visitor, isExpression) ); }, [227 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadElement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [228 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -81755,45 +82864,45 @@ var visitEachChildTable = { [230 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionWithTypeArguments( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, [231 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAsExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [235 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSatisfiesExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [232 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return isOptionalChain(node) ? context.factory.updateNonNullChain( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ) : context.factory.updateNonNullExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [233 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateMetaProperty( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Misc [236 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateSpan( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Element @@ -81806,21 +82915,21 @@ var visitEachChildTable = { [240 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVariableStatement( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.declarationList, visitor, isVariableDeclarationList) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) ); }, [241 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [242 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIfStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock)), nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) ); }, @@ -81828,13 +82937,13 @@ var visitEachChildTable = { return context.factory.updateDoStatement( node, visitIterationBody(node.statement, visitor, context, nodeVisitor), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [244 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWhileStatement( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -81850,17 +82959,17 @@ var visitEachChildTable = { [246 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForInStatement( node, - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, [247 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateForOfStatement( node, - nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword), - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -81885,34 +82994,34 @@ var visitEachChildTable = { [251 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWithStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [252 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSwitchStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.caseBlock, visitor, isCaseBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) ); }, [253 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLabeledStatement( node, - nodeVisitor(node.label, visitor, isIdentifier), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [254 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateThrowStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [255 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTryStatement( node, - nodeVisitor(node.tryBlock, visitor, isBlock), + Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), nodeVisitor(node.catchClause, visitor, isCatchClause), nodeVisitor(node.finallyBlock, visitor, isBlock) ); @@ -81920,8 +83029,8 @@ var visitEachChildTable = { [257 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateVariableDeclaration( node, - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken) : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -81936,7 +83045,7 @@ var visitEachChildTable = { return context.factory.updateFunctionDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -81957,8 +83066,8 @@ var visitEachChildTable = { [261 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInterfaceDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, isHeritageClause), nodesVisitor(node.members, visitor, isTypeElement) @@ -81967,25 +83076,25 @@ var visitEachChildTable = { [262 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAliasDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [263 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.members, visitor, isEnumMember) ); }, [264 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateModuleDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isModuleName), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleName)), nodeVisitor(node.body, visitor, isModuleBody) ); }, @@ -82004,24 +83113,24 @@ var visitEachChildTable = { [267 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExportDeclaration( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [268 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportEqualsDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.moduleReference, visitor, isModuleReference) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) ); }, [269 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), nodeVisitor(node.importClause, visitor, isImportClause), - nodeVisitor(node.moduleSpecifier, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)), nodeVisitor(node.assertClause, visitor, isAssertClause) ); }, @@ -82035,8 +83144,8 @@ var visitEachChildTable = { [297 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAssertEntry( node, - nodeVisitor(node.name, visitor, isAssertionKey), - nodeVisitor(node.value, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)), + Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) ); }, [270 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -82050,13 +83159,13 @@ var visitEachChildTable = { [271 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceImport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [277 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [272 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -82070,20 +83179,20 @@ var visitEachChildTable = { node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [274 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportAssignment( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.expression, visitor, isExpression) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [275 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, isExpression), @@ -82101,59 +83210,59 @@ var visitEachChildTable = { node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Module references [280 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExternalModuleReference( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // JSX [281 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxElement( node, - nodeVisitor(node.openingElement, visitor, isJsxOpeningElement), + Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingElement, visitor, isJsxClosingElement) + Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) ); }, [282 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSelfClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [283 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxOpeningElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [284 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression) + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) ); }, [285 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxFragment( node, - nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment), + Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment) + Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) ); }, [288 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) ); }, @@ -82166,20 +83275,20 @@ var visitEachChildTable = { [290 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSpreadAttribute( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Clauses [292 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCaseClause( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.statements, visitor, isStatement) ); }, @@ -82199,35 +83308,35 @@ var visitEachChildTable = { return context.factory.updateCatchClause( node, nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), - nodeVisitor(node.block, visitor, isBlock) + Debug.checkDefined(nodeVisitor(node.block, visitor, isBlock)) ); }, // Property assignments [299 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePropertyAssignment( node, - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.initializer, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) ); }, [300 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateShorthandPropertyAssignment( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) ); }, [301 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadAssignment( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Enum [302 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumMember( node, - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -82239,13 +83348,13 @@ var visitEachChildTable = { ); }, // Transformation nodes - [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePartiallyEmittedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCommaListExpression( node, nodesVisitor(node.elements, visitor, isExpression) @@ -82964,10 +84073,13 @@ function getAllDecoratorsOfClass(node) { parameters }; } -function getAllDecoratorsOfClassElement(member, parent) { +function getAllDecoratorsOfClassElement(member, parent, useLegacyDecorators) { switch (member.kind) { case 174 /* GetAccessor */: case 175 /* SetAccessor */: + if (!useLegacyDecorators) { + return getAllDecoratorsOfMethod(member); + } return getAllDecoratorsOfAccessors(member, parent); case 171 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); @@ -83016,6 +84128,34 @@ function getAllDecoratorsOfProperty(property) { } return { decorators }; } +function walkUpLexicalEnvironments(env, cb) { + while (env) { + const result = cb(env); + if (result !== void 0) + return result; + env = env.previous; + } +} +function newPrivateEnvironment(data) { + return { data }; +} +function getPrivateIdentifier(privateEnv, name) { + var _a2, _b; + return isGeneratedPrivateIdentifier(name) ? (_a2 = privateEnv == null ? void 0 : privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(getNodeForGeneratedName(name)) : (_b = privateEnv == null ? void 0 : privateEnv.identifiers) == null ? void 0 : _b.get(name.escapedText); +} +function setPrivateIdentifier(privateEnv, name, entry) { + var _a2, _b; + if (isGeneratedPrivateIdentifier(name)) { + (_a2 = privateEnv.generatedIdentifiers) != null ? _a2 : privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map(); + privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), entry); + } else { + (_b = privateEnv.identifiers) != null ? _b : privateEnv.identifiers = /* @__PURE__ */ new Map(); + privateEnv.identifiers.set(name.escapedText, entry); + } +} +function accessPrivateIdentifier(env, name) { + return walkUpLexicalEnvironments(env, (env2) => getPrivateIdentifier(env2.privateEnv, name)); +} // src/compiler/transformers/destructuring.ts function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) { @@ -83028,7 +84168,7 @@ function flattenDestructuringAssignment(node, visitor, context, level, needsValu location = node = value; value = node.right; } else { - return visitNode(value, visitor, isExpression); + return Debug.checkDefined(visitNode(value, visitor, isExpression)); } } } @@ -83047,6 +84187,7 @@ function flattenDestructuringAssignment(node, visitor, context, level, needsValu }; if (value) { value = visitNode(value, visitor, isExpression); + Debug.assert(value); if (isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node)) { value = ensureIdentifier( flattenContext, @@ -83088,7 +84229,7 @@ function flattenDestructuringAssignment(node, visitor, context, level, needsValu function emitBindingOrAssignment(target, value2, location2, original) { Debug.assertNode(target, createAssignmentCallback ? isIdentifier : isExpression); const expression = createAssignmentCallback ? createAssignmentCallback(target, value2, location2) : setTextRange( - context.factory.createAssignment(visitNode(target, visitor, isExpression), value2), + context.factory.createAssignment(Debug.checkDefined(visitNode(target, visitor, isExpression)), value2), location2 ); expression.original = original; @@ -83145,7 +84286,7 @@ function flattenDestructuringBinding(node, visitor, context, level, rval, hoistT if (initializer && (isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node))) { initializer = ensureIdentifier( flattenContext, - visitNode(initializer, flattenContext.visitor), + Debug.checkDefined(visitNode(initializer, flattenContext.visitor, isExpression)), /*reuseIdentifierExpressions*/ false, initializer @@ -83266,7 +84407,7 @@ function flattenObjectBindingOrAssignmentPattern(flattenContext, parent, pattern if (!getRestIndicatorOfBindingOrAssignmentElement(element)) { const propertyName = getPropertyNameOfBindingOrAssignmentElement(element); if (flattenContext.level >= 1 /* ObjectRest */ && !(element.transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !(getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !isComputedPropertyName(propertyName)) { - bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor)); + bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor, isBindingOrAssignmentElement)); } else { if (bindingElements) { flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern); @@ -83404,7 +84545,7 @@ function createDestructuringPropertyAccess(flattenContext, value, propertyName) if (isComputedPropertyName(propertyName)) { const argumentExpression = ensureIdentifier( flattenContext, - visitNode(propertyName.expression, flattenContext.visitor), + Debug.checkDefined(visitNode(propertyName.expression, flattenContext.visitor, isExpression)), /*reuseIdentifierExpressions*/ false, /*location*/ @@ -83447,6 +84588,7 @@ function makeArrayBindingPattern(factory2, elements) { return factory2.createArrayBindingPattern(elements); } function makeArrayAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isArrayBindingOrAssignmentElement); return factory2.createArrayLiteralExpression(map(elements, factory2.converters.convertToArrayAssignmentElement)); } function makeObjectBindingPattern(factory2, elements) { @@ -83454,6 +84596,7 @@ function makeObjectBindingPattern(factory2, elements) { return factory2.createObjectBindingPattern(elements); } function makeObjectAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isObjectBindingOrAssignmentElement); return factory2.createObjectLiteralExpression(map(elements, factory2.converters.convertToObjectAssignmentElement)); } function makeBindingElement(factory2, name) { @@ -83472,6 +84615,7 @@ function makeAssignmentElement(name) { // src/compiler/transformers/taggedTemplate.ts function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) { const tag = visitNode(node.tag, visitor, isExpression); + Debug.assert(tag); const templateArguments = [void 0]; const cookedStrings = []; const rawStrings = []; @@ -83488,7 +84632,7 @@ function processTaggedTemplateExpression(context, node, visitor, currentSourceFi for (const templateSpan of template.templateSpans) { cookedStrings.push(createTemplateCooked(templateSpan.literal)); rawStrings.push(getRawLiteral(templateSpan.literal, currentSourceFile)); - templateArguments.push(visitNode(templateSpan.expression, visitor, isExpression)); + templateArguments.push(Debug.checkDefined(visitNode(templateSpan.expression, visitor, isExpression))); } } const helperCall = context.getEmitHelperFactory().createTemplateObjectHelper( @@ -83548,6 +84692,7 @@ function transformTypeScript(context) { const compilerOptions = context.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const typeSerializer = compilerOptions.emitDecoratorMetadata ? createRuntimeTypeSerializer(context) : void 0; const previousOnEmitNode = context.onEmitNode; const previousOnSubstituteNode = context.onSubstituteNode; @@ -83722,6 +84867,12 @@ function transformTypeScript(context) { return Debug.failBadSyntaxKind(node); } } + function decoratorElidingVisitor(node) { + return isDecorator(node) ? void 0 : visitor(node); + } + function modifierElidingVisitor(node) { + return isModifier(node) ? void 0 : visitor(node); + } function modifierVisitor(node) { if (isDecorator(node)) return void 0; @@ -83861,19 +85012,25 @@ function transformTypeScript(context) { function visitObjectLiteralExpression(node) { return factory2.updateObjectLiteralExpression( node, - visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElement) + visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElementLike) ); } - function getClassFacts(node, staticProperties) { + function getClassFacts(node) { let facts = 0 /* None */; - if (some(staticProperties)) + if (some(getProperties( + node, + /*requireInitialized*/ + true, + /*isStatic*/ + true + ))) facts |= 1 /* HasStaticInitializedProperties */; const extendsClauseElement = getEffectiveBaseTypeNode(node); if (extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */) facts |= 64 /* IsDerivedClass */; - if (classOrConstructorParameterIsDecorated(node)) - facts |= 2 /* HasConstructorDecorators */; - if (childIsDecorated(node)) + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) + facts |= 2 /* HasClassOrConstructorParameterDecorators */; + if (childIsDecorated(legacyDecorators, node)) facts |= 4 /* HasMemberDecorators */; if (isExportOfNamespace(node)) facts |= 8 /* IsExportOfNamespace */; @@ -83881,8 +85038,6 @@ function transformTypeScript(context) { facts |= 32 /* IsDefaultExternalExport */; else if (isNamedExternalModuleExport(node)) facts |= 16 /* IsNamedExternalExport */; - if (languageVersion <= 1 /* ES5 */ && facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */) - facts |= 128 /* UseImmediatelyInvokedFunctionExpression */; return facts; } function hasTypeScriptClassSyntax(node) { @@ -83892,7 +85047,10 @@ function transformTypeScript(context) { return hasDecorators(node) || some(node.typeParameters) || some(node.heritageClauses, hasTypeScriptClassSyntax) || some(node.members, hasTypeScriptClassSyntax); } function visitClassDeclaration(node) { - if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !(currentNamespace && hasSyntacticModifier(node, 1 /* Export */))) { + var _a2; + const facts = getClassFacts(node); + const promoteToIIFE = languageVersion <= 1 /* ES5 */ && !!(facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */); + if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !classOrConstructorParameterIsDecorated(legacyDecorators, node) && !isExportOfNamespace(node)) { return factory2.updateClassDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), @@ -83903,24 +85061,19 @@ function transformTypeScript(context) { visitNodes2(node.members, getClassElementVisitor(node), isClassElement) ); } - const staticProperties = getProperties( - node, - /*requireInitializer*/ - true, - /*isStatic*/ - true - ); - const facts = getClassFacts(node, staticProperties); - if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) { + if (promoteToIIFE) { context.startLexicalEnvironment(); } - const name = node.name || (facts & 5 /* NeedsName */ ? factory2.getGeneratedNameForNode(node) : void 0); - const allDecorators = getAllDecoratorsOfClass(node); - const decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); - const modifiers = !(facts & 128 /* UseImmediatelyInvokedFunctionExpression */) ? visitNodes2(node.modifiers, modifierVisitor, isModifier) : elideNodes(factory2, node.modifiers); - const classStatement = factory2.updateClassDeclaration( + const moveModifiers = promoteToIIFE || facts & 8 /* IsExportOfNamespace */ || facts & 2 /* HasClassOrConstructorParameterDecorators */ && legacyDecorators || facts & 1 /* HasStaticInitializedProperties */; + let modifiers = moveModifiers ? visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, visitor, isModifierLike); + if (facts & 2 /* HasClassOrConstructorParameterDecorators */) { + modifiers = injectClassTypeMetadata(modifiers, node); + } + const needsName = moveModifiers && !node.name || facts & 4 /* HasMemberDecorators */ || facts & 1 /* HasStaticInitializedProperties */; + const name = needsName ? (_a2 = node.name) != null ? _a2 : factory2.getGeneratedNameForNode(node) : node.name; + const classDeclaration = factory2.updateClassDeclaration( node, - concatenate(decorators, modifiers), + modifiers, name, /*typeParameters*/ void 0, @@ -83931,24 +85084,25 @@ function transformTypeScript(context) { if (facts & 1 /* HasStaticInitializedProperties */) { emitFlags |= 64 /* NoTrailingSourceMap */; } - setEmitFlags(classStatement, emitFlags); - let statements = [classStatement]; - if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) { + setEmitFlags(classDeclaration, emitFlags); + let statement; + if (promoteToIIFE) { + const statements = [classDeclaration]; const closingBraceLocation = createTokenRange(skipTrivia(currentSourceFile.text, node.members.end), 19 /* CloseBraceToken */); const localName = factory2.getInternalName(node); const outer = factory2.createPartiallyEmittedExpression(localName); setTextRangeEnd(outer, closingBraceLocation.end); setEmitFlags(outer, 3072 /* NoComments */); - const statement = factory2.createReturnStatement(outer); - setTextRangePos(statement, closingBraceLocation.pos); - setEmitFlags(statement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); - statements.push(statement); + const returnStatement = factory2.createReturnStatement(outer); + setTextRangePos(returnStatement, closingBraceLocation.pos); + setEmitFlags(returnStatement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); + statements.push(returnStatement); insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment()); const iife = factory2.createImmediatelyInvokedArrowFunction(statements); - setEmitFlags(iife, 67108864 /* TypeScriptClassWrapper */); + setInternalEmitFlags(iife, 1 /* TypeScriptClassWrapper */); + const modifiers2 = facts & 16 /* IsNamedExternalExport */ ? factory2.createModifiersFromModifierFlags(1 /* Export */) : void 0; const varStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, + modifiers2, factory2.createVariableDeclarationList([ factory2.createVariableDeclaration( factory2.getLocalName( @@ -83964,114 +85118,133 @@ function transformTypeScript(context) { void 0, iife ) - ]) + ], 1 /* Let */) ); setOriginalNode(varStatement, node); setCommentRange(varStatement, node); setSourceMapRange(varStatement, moveRangePastDecorators(node)); startOnNewLine(varStatement); - statements = [varStatement]; + statement = varStatement; + } else { + statement = classDeclaration; } - if (facts & 8 /* IsExportOfNamespace */) { - addExportMemberAssignment(statements, node); - } else if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) { + if (moveModifiers) { + if (facts & 8 /* IsExportOfNamespace */) { + return demarcateMultiStatementExport( + statement, + createExportMemberAssignmentStatement(node) + ); + } if (facts & 32 /* IsDefaultExternalExport */) { - statements.push(factory2.createExportDefault(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ))); - } else if (facts & 16 /* IsNamedExternalExport */) { - statements.push(factory2.createExternalModuleExport(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ))); + return demarcateMultiStatementExport( + statement, + factory2.createExportDefault(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ); + } + if (facts & 16 /* IsNamedExternalExport */ && !promoteToIIFE) { + return demarcateMultiStatementExport( + statement, + factory2.createExternalModuleExport(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ); } } - if (statements.length > 1) { - statements.push(factory2.createEndOfDeclarationMarker(node)); - setEmitFlags(classStatement, getEmitFlags(classStatement) | 8388608 /* HasEndOfDeclarationMarker */); - } - return singleOrMany(statements); + return statement; + } + function demarcateMultiStatementExport(declarationStatement, exportStatement) { + addEmitFlags(declarationStatement, 8388608 /* HasEndOfDeclarationMarker */); + return [ + declarationStatement, + exportStatement, + factory2.createEndOfDeclarationMarker(declarationStatement) + ]; } function visitClassExpression(node) { - const allDecorators = getAllDecoratorsOfClass(node); - const decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); + let modifiers = visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike); + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) { + modifiers = injectClassTypeMetadata(modifiers, node); + } return factory2.updateClassExpression( node, - decorators, + modifiers, node.name, /*typeParameters*/ void 0, visitNodes2(node.heritageClauses, visitor, isHeritageClause), - isClassLikeDeclarationWithTypeScriptSyntax(node) ? transformClassMembers(node) : visitNodes2(node.members, getClassElementVisitor(node), isClassElement) + transformClassMembers(node) ); } function transformClassMembers(node) { - const members = []; + const members = visitNodes2(node.members, getClassElementVisitor(node), isClassElement); + let newMembers; const constructor = getFirstConstructorWithBody(node); const parametersWithPropertyAssignments = constructor && filter(constructor.parameters, (p) => isParameterPropertyDeclaration(p, constructor)); if (parametersWithPropertyAssignments) { for (const parameter of parametersWithPropertyAssignments) { - if (isIdentifier(parameter.name)) { - members.push(setOriginalNode(factory2.createPropertyDeclaration( - /*modifiers*/ - void 0, - parameter.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ), parameter)); - } + const parameterProperty = factory2.createPropertyDeclaration( + /*modifiers*/ + void 0, + parameter.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + setOriginalNode(parameterProperty, parameter); + newMembers = append(newMembers, parameterProperty); } } - addRange(members, visitNodes2(node.members, getClassElementVisitor(node), isClassElement)); - return setTextRange( - factory2.createNodeArray(members), - /*location*/ - node.members - ); + if (newMembers) { + newMembers = addRange(newMembers, members); + return setTextRange( + factory2.createNodeArray(newMembers), + /*location*/ + node.members + ); + } + return members; } - function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { - var _a2, _b, _c, _d; - if (!allDecorators) { - return void 0; + function injectClassTypeMetadata(modifiers, node) { + const metadata = getTypeMetadata(node, node); + if (some(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, takeWhile(modifiers, isExportOrDefaultModifier)); + addRange(modifiersArray, filter(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter(skipWhile(modifiers, isExportOrDefaultModifier), isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); } - const decorators = visitArray(allDecorators.decorators, visitor, isDecorator); - const parameterDecorators = flatMap(allDecorators.parameters, transformDecoratorsOfParameter); - const metadataDecorators = some(decorators) || some(parameterDecorators) ? getTypeMetadata(node, container) : void 0; - const result = factory2.createNodeArray(concatenate(concatenate(decorators, parameterDecorators), metadataDecorators)); - const pos = (_b = (_a2 = firstOrUndefined(allDecorators.decorators)) == null ? void 0 : _a2.pos) != null ? _b : -1; - const end = (_d = (_c = lastOrUndefined(allDecorators.decorators)) == null ? void 0 : _c.end) != null ? _d : -1; - setTextRangePosEnd(result, pos, end); - return result; + return modifiers; } - function transformDecoratorsOfParameter(parameterDecorators, parameterOffset) { - if (parameterDecorators) { - const decorators = []; - for (const parameterDecorator of parameterDecorators) { - const expression = visitNode(parameterDecorator.expression, visitor, isExpression); - const helper = emitHelpers().createParamHelper(expression, parameterOffset); - setTextRange(helper, parameterDecorator.expression); - setEmitFlags(helper, 3072 /* NoComments */); - const decorator = factory2.createDecorator(helper); - setSourceMapRange(decorator, parameterDecorator.expression); - setCommentRange(decorator, parameterDecorator.expression); - setEmitFlags(decorator, 3072 /* NoComments */); - decorators.push(decorator); + function injectClassElementTypeMetadata(modifiers, node, container) { + if (isClassLike(container) && classElementOrClassElementParameterIsDecorated(legacyDecorators, node, container)) { + const metadata = getTypeMetadata(node, container); + if (some(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, filter(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter(modifiers, isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); } - return decorators; } + return modifiers; } function getTypeMetadata(node, container) { + if (!legacyDecorators) + return void 0; return USE_NEW_TYPE_METADATA_FORMAT ? getNewTypeMetadata(node, container) : getOldTypeMetadata(node, container); } function getOldTypeMetadata(node, container) { @@ -84180,8 +85353,9 @@ function transformTypeScript(context) { } function visitPropertyNameOfClassElement(member) { const name = member.name; - if (isComputedPropertyName(name) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member))) { + if (isComputedPropertyName(name) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member) && legacyDecorators)) { const expression = visitNode(name.expression, visitor, isExpression); + Debug.assert(expression); const innerExpression = skipPartiallyEmittedExpressions(expression); if (!isSimpleInlineableExpression(innerExpression)) { const generatedName = factory2.getGeneratedNameForNode(name); @@ -84189,7 +85363,7 @@ function transformTypeScript(context) { return factory2.updateComputedPropertyName(name, factory2.createAssignment(generatedName, expression)); } } - return visitNode(name, visitor, isPropertyName); + return Debug.checkDefined(visitNode(name, visitor, isPropertyName)); } function visitHeritageClause(node) { if (node.token === 117 /* ImplementsKeyword */) { @@ -84200,7 +85374,7 @@ function transformTypeScript(context) { function visitExpressionWithTypeArguments(node) { return factory2.updateExpressionWithTypeArguments( node, - visitNode(node.expression, visitor, isLeftHandSideExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression)), /*typeArguments*/ void 0 ); @@ -84210,16 +85384,16 @@ function transformTypeScript(context) { } function visitPropertyDeclaration(node, parent) { const isAmbient = node.flags & 16777216 /* Ambient */ || hasSyntacticModifier(node, 256 /* Abstract */); - if (isAmbient && !hasDecorators(node)) { + if (isAmbient && !(legacyDecorators && hasDecorators(node))) { return void 0; } - const allDecorators = getAllDecoratorsOfClassElement(node, parent); - const decorators = transformAllDecoratorsOfDeclaration(node, parent, allDecorators); + let modifiers = isClassLike(parent) ? !isAmbient ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent); if (isAmbient) { return factory2.updatePropertyDeclaration( node, - concatenate(decorators, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), - visitNode(node.name, visitor, isPropertyName), + concatenate(modifiers, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, /*type*/ @@ -84230,13 +85404,13 @@ function transformTypeScript(context) { } return factory2.updatePropertyDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), /*questionOrExclamationToken*/ void 0, /*type*/ void 0, - visitNode(node.initializer, visitor) + visitNode(node.initializer, visitor, isExpression) ); } function visitConstructor(node) { @@ -84337,11 +85511,11 @@ function transformTypeScript(context) { if (!shouldEmitFunctionLikeDeclaration(node)) { return void 0; } - const allDecorators = isClassLike(parent) ? getAllDecoratorsOfClassElement(node, parent) : void 0; - const decorators = isClassLike(parent) ? transformAllDecoratorsOfDeclaration(node, parent, allDecorators) : void 0; + let modifiers = isClassLike(parent) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent); return factory2.updateMethodDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, node.asteriskToken, visitPropertyNameOfClassElement(node), /*questionToken*/ @@ -84364,10 +85538,11 @@ function transformTypeScript(context) { if (!shouldEmitAccessorDeclaration(node)) { return void 0; } - const decorators = isClassLike(parent) ? transformAllDecoratorsOfDeclaration(node, parent, getAllDecoratorsOfClassElement(node, parent)) : void 0; + let modifiers = isClassLike(parent) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent); return factory2.updateGetAccessorDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), visitParameterList(node.parameters, visitor, context), /*type*/ @@ -84382,10 +85557,11 @@ function transformTypeScript(context) { if (!shouldEmitAccessorDeclaration(node)) { return void 0; } - const decorators = isClassLike(parent) ? transformAllDecoratorsOfDeclaration(node, parent, getAllDecoratorsOfClassElement(node, parent)) : void 0; + let modifiers = isClassLike(parent) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent); return factory2.updateSetAccessorDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context) || factory2.createBlock([]) @@ -84452,10 +85628,9 @@ function transformTypeScript(context) { } const updated = factory2.updateParameterDeclaration( node, - elideNodes(factory2, node.modifiers), - // preserve positions, if available + visitNodes2(node.modifiers, (node2) => isDecorator(node2) ? visitor(node2) : void 0, isModifierLike), node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*questionToken*/ void 0, /*type*/ @@ -84504,7 +85679,7 @@ function transformTypeScript(context) { return setTextRange( factory2.createAssignment( getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), - visitNode(node.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) ), /*location*/ node @@ -84514,7 +85689,7 @@ function transformTypeScript(context) { function visitVariableDeclaration(node) { const updated = factory2.updateVariableDeclaration( node, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*exclamationToken*/ void 0, /*type*/ @@ -84530,26 +85705,30 @@ function transformTypeScript(context) { const innerExpression = skipOuterExpressions(node.expression, ~6 /* Assertions */); if (isAssertionExpression(innerExpression)) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } return visitEachChild(node, visitor, context); } function visitAssertionExpression(node) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitNonNullExpression(node) { const expression = visitNode(node.expression, visitor, isLeftHandSideExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitSatisfiesExpression(node) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitCallExpression(node) { return factory2.updateCallExpression( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -84558,7 +85737,7 @@ function transformTypeScript(context) { function visitNewExpression(node) { return factory2.updateNewExpression( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -84567,28 +85746,28 @@ function transformTypeScript(context) { function visitTaggedTemplateExpression(node) { return factory2.updateTaggedTemplateExpression( node, - visitNode(node.tag, visitor, isExpression), + Debug.checkDefined(visitNode(node.tag, visitor, isExpression)), /*typeArguments*/ void 0, - visitNode(node.template, visitor, isExpression) + Debug.checkDefined(visitNode(node.template, visitor, isTemplateLiteral)) ); } function visitJsxSelfClosingElement(node) { return factory2.updateJsxSelfClosingElement( node, - visitNode(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), /*typeArguments*/ void 0, - visitNode(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) ); } function visitJsxJsxOpeningElement(node) { return factory2.updateJsxOpeningElement( node, - visitNode(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), /*typeArguments*/ void 0, - visitNode(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) ); } function shouldEmitEnumDeclaration(node) { @@ -84734,7 +85913,7 @@ function transformTypeScript(context) { } else { enableSubstitutionForNonQualifiedEnumMembers(); if (member.initializer) { - return visitNode(member.initializer, visitor, isExpression); + return Debug.checkDefined(visitNode(member.initializer, visitor, isExpression)); } else { return factory2.createVoidZero(); } @@ -84976,7 +86155,7 @@ function transformTypeScript(context) { if (node.kind === 271 /* NamespaceImport */) { return shouldEmitAliasDeclaration(node) ? node : void 0; } else { - const allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); + const allowEmpty = compilerOptions.verbatimModuleSyntax || compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); const elements = visitNodes2(node.elements, visitImportSpecifier, isImportSpecifier); return allowEmpty || some(elements) ? factory2.updateNamedImports(node, elements) : void 0; } @@ -84985,7 +86164,7 @@ function transformTypeScript(context) { return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : void 0; } function visitExportAssignment(node) { - return resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; + return compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; } function visitExportDeclaration(node) { if (node.isTypeOnly) { @@ -84994,7 +86173,7 @@ function transformTypeScript(context) { if (!node.exportClause || isNamespaceExport(node.exportClause)) { return node; } - const allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); + const allowEmpty = compilerOptions.verbatimModuleSyntax || !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); const exportClause = visitNode( node.exportClause, (bindings) => visitNamedExportBindings(bindings, allowEmpty), @@ -85015,13 +86194,13 @@ function transformTypeScript(context) { return allowEmpty || some(elements) ? factory2.updateNamedExports(node, elements) : void 0; } function visitNamespaceExports(node) { - return factory2.updateNamespaceExport(node, visitNode(node.name, visitor, isIdentifier)); + return factory2.updateNamespaceExport(node, Debug.checkDefined(visitNode(node.name, visitor, isIdentifier))); } function visitNamedExportBindings(node, allowEmpty) { return isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty); } function visitExportSpecifier(node) { - return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : void 0; + return !node.isTypeOnly && (compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node)) ? node : void 0; } function shouldEmitImportEqualsDeclaration(node) { return shouldEmitAliasDeclaration(node) || !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node); @@ -85102,7 +86281,7 @@ function transformTypeScript(context) { function isDefaultExternalModuleExport(node) { return isExternalModuleExport(node) && hasSyntacticModifier(node, 1024 /* Default */); } - function addExportMemberAssignment(statements, node) { + function createExportMemberAssignmentStatement(node) { const expression = factory2.createAssignment( factory2.getExternalModuleOrNamespaceExportName( currentNamespaceContainerName, @@ -85117,7 +86296,10 @@ function transformTypeScript(context) { setSourceMapRange(expression, createRange(node.name ? node.name.pos : node.pos, node.end)); const statement = factory2.createExpressionStatement(expression); setSourceMapRange(statement, createRange(-1, node.end)); - statements.push(statement); + return statement; + } + function addExportMemberAssignment(statements, node) { + statements.push(createExportMemberAssignmentStatement(node)); } function createNamespaceExport(exportName, exportValue, location) { return setTextRange( @@ -85280,7 +86462,7 @@ function transformTypeScript(context) { return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; } function shouldEmitAliasDeclaration(node) { - return isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); + return compilerOptions.verbatimModuleSyntax || isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); } } @@ -85288,6 +86470,7 @@ function transformTypeScript(context) { function transformClassFields(context) { const { factory: factory2, + getEmitHelperFactory: emitHelpers, hoistVariableDeclaration, endLexicalEnvironment, startLexicalEnvironment, @@ -85298,6 +86481,7 @@ function transformClassFields(context) { const compilerOptions = context.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const shouldTransformInitializersUsingSet = !useDefineForClassFields; const shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9 /* ES2022 */; const shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine; @@ -85310,42 +86494,69 @@ function transformClassFields(context) { context.onSubstituteNode = onSubstituteNode; const previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; + let shouldTransformPrivateStaticElementsInFile = false; let enabledSubstitutions; let classAliases; let pendingExpressions; let pendingStatements; - const classLexicalEnvironmentStack = []; - const classLexicalEnvironmentMap = /* @__PURE__ */ new Map(); - let currentClassLexicalEnvironment; + let lexicalEnvironment; + const lexicalEnvironmentMap = /* @__PURE__ */ new Map(); let currentClassContainer; - let currentComputedPropertyNameClassLexicalEnvironment; let currentStaticPropertyDeclarationOrStaticBlock; + let shouldSubstituteThisWithClassThis = false; + let previousShouldSubstituteThisWithClassThis = false; return chainBundle(context, transformSourceFile); function transformSourceFile(node) { - if (node.isDeclarationFile || !shouldTransformAnything) { + if (node.isDeclarationFile) { + return node; + } + lexicalEnvironment = void 0; + shouldTransformPrivateStaticElementsInFile = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); + if (!shouldTransformAnything && !shouldTransformPrivateStaticElementsInFile) { return node; } const visited = visitEachChild(node, visitor, context); addEmitHelpers(visited, context.readEmitHelpers()); return visited; } + function modifierVisitor(node) { + switch (node.kind) { + case 127 /* AccessorKeyword */: + return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + default: + return tryCast(node, isModifier); + } + } function visitor(node) { if (!(node.transformFlags & 16777216 /* ContainsClassFields */) && !(node.transformFlags & 134234112 /* ContainsLexicalThisOrSuper */)) { return node; } switch (node.kind) { case 127 /* AccessorKeyword */: - return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + return Debug.fail("Use `modifierVisitor` instead."); case 260 /* ClassDeclaration */: return visitClassDeclaration(node); case 228 /* ClassExpression */: - return visitClassExpression(node); + return visitClassExpression( + node, + /*referencedName*/ + void 0 + ); case 172 /* ClassStaticBlockDeclaration */: - return visitClassStaticBlockDeclaration(node); case 169 /* PropertyDeclaration */: - return visitPropertyDeclaration(node); + return Debug.fail("Use `classElementVisitor` instead."); + case 299 /* PropertyAssignment */: + return visitPropertyAssignment(node); case 240 /* VariableStatement */: return visitVariableStatement(node); + case 257 /* VariableDeclaration */: + return visitVariableDeclaration(node); + case 166 /* Parameter */: + return visitParameterDeclaration(node); + case 205 /* BindingElement */: + return visitBindingElement(node); + case 274 /* ExportAssignment */: + return visitExportAssignment(node); case 80 /* PrivateIdentifier */: return visitPrivateIdentifier(node); case 208 /* PropertyAccessExpression */: @@ -85356,15 +86567,23 @@ function transformClassFields(context) { case 222 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ false ); case 223 /* BinaryExpression */: return visitBinaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ false ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); case 210 /* CallExpression */: return visitCallExpression(node); case 241 /* ExpressionStatement */: @@ -85393,21 +86612,57 @@ function transformClassFields(context) { function fallbackVisitor(node) { return visitEachChild(node, visitor, context); } + function namedEvaluationVisitor(node, referencedName) { + switch (node.kind) { + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 228 /* ClassExpression */: + return visitClassExpression(node, referencedName); + default: + return visitor(node); + } + } function discardedValueVisitor(node) { switch (node.kind) { case 221 /* PrefixUnaryExpression */: case 222 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ true ); case 223 /* BinaryExpression */: return visitBinaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ + true + ); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ true ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + true, + /*referencedName*/ + void 0 + ); default: return visitor(node); } @@ -85451,10 +86706,20 @@ function transformClassFields(context) { visitPropertyDeclaration, node ); + case 172 /* ClassStaticBlockDeclaration */: + return visitClassStaticBlockDeclaration(node); case 164 /* ComputedPropertyName */: return visitComputedPropertyName(node); case 237 /* SemicolonClassElement */: return node; + default: + return isModifierLike(node) ? modifierVisitor(node) : visitor(node); + } + } + function propertyNameVisitor(node) { + switch (node.kind) { + case 164 /* ComputedPropertyName */: + return visitComputedPropertyName(node); default: return visitor(node); } @@ -85480,20 +86745,25 @@ function transformClassFields(context) { } return setOriginalNode(factory2.createIdentifier(""), node); } - function isPrivateIdentifierInExpression(node) { - return isPrivateIdentifier(node.left) && node.operatorToken.kind === 101 /* InKeyword */; - } function transformPrivateIdentifierInInExpression(node) { - const info = accessPrivateIdentifier(node.left); + const info = accessPrivateIdentifier2(node.left); if (info) { const receiver = visitNode(node.right, visitor, isExpression); return setOriginalNode( - context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), + emitHelpers().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node ); } return visitEachChild(node, visitor, context); } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updatePropertyAssignment(node, name, initializer); + } + return visitEachChild(node, visitor, context); + } function visitVariableStatement(node) { const savedPendingStatements = pendingStatements; pendingStatements = []; @@ -85502,17 +86772,90 @@ function transformClassFields(context) { pendingStatements = savedPendingStatements; return statement; } - function visitComputedPropertyName(node) { - let expression = visitNode(node.expression, visitor, isExpression); + function getAssignedNameOfIdentifier(name, initializer) { + const originalClass = getOriginalNode(initializer, isClassLike); + return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateVariableDeclaration( + node, + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitParameterDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const propertyName = visitNode(node.propertyName, visitor, isPropertyName); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBindingElement( + node, + /*dotDotDotToken*/ + void 0, + propertyName, + name, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateExportAssignment(node, modifiers, expression); + } + return visitEachChild(node, visitor, context); + } + function injectPendingExpressions(expression) { if (some(pendingExpressions)) { if (isParenthesizedExpression(expression)) { - expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions([...pendingExpressions, expression.expression])); + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); } else { - expression = factory2.inlineExpressions([...pendingExpressions, expression]); + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); } pendingExpressions = void 0; } - return factory2.updateComputedPropertyName(node, expression); + return expression; + } + function visitComputedPropertyName(node) { + const expression = visitNode(node.expression, visitor, isExpression); + return factory2.updateComputedPropertyName(node, injectPendingExpressions(expression)); } function visitConstructorDeclaration(node) { if (currentClassContainer) { @@ -85520,12 +86863,19 @@ function transformClassFields(context) { } return fallbackVisitor(node); } + function shouldTransformClassElementToWeakMap(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) + return true; + if (hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) + return true; + return false; + } function visitMethodOrAccessorDeclaration(node) { Debug.assert(!hasDecorators(node)); - if (!shouldTransformPrivateElementsOrClassStaticBlocks || !isPrivateIdentifier(node.name)) { + if (!isPrivateIdentifierClassElementDeclaration(node) || !shouldTransformClassElementToWeakMap(node)) { return visitEachChild(node, classElementVisitor, context); } - const info = accessPrivateIdentifier(node.name); + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); if (!info.isValid) { return node; @@ -85560,7 +86910,7 @@ function transformClassFields(context) { } function getHoistedFunctionName(node) { Debug.assert(isPrivateIdentifier(node.name)); - const info = accessPrivateIdentifier(node.name); + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); if (info.kind === "m" /* Method */) { return info.methodName; @@ -85575,42 +86925,61 @@ function transformClassFields(context) { } } function transformAutoAccessor(node) { - Debug.assertEachNode(node.modifiers, isModifier); const commentRange = getCommentRange(node); const sourceMapRange = getSourceMapRange(node); const name = node.name; let getterName = name; let setterName = name; if (isComputedPropertyName(name) && !isSimpleInlineableExpression(name.expression)) { - const temp = factory2.createTempVariable(hoistVariableDeclaration); - setSourceMapRange(temp, name.expression); - const expression = visitNode(name.expression, visitor, isExpression); - const assignment = factory2.createAssignment(temp, expression); - setSourceMapRange(assignment, name.expression); - getterName = factory2.updateComputedPropertyName(name, factory2.inlineExpressions([assignment, temp])); - setterName = factory2.updateComputedPropertyName(name, temp); + const cacheAssignment = findComputedPropertyNameCacheAssignment(name); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name, visitNode(name.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name.expression); + const expression = visitNode(name.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name.expression); + getterName = factory2.updateComputedPropertyName(name, assignment); + setterName = factory2.updateComputedPropertyName(name, temp); + } } - const backingField = createAccessorPropertyBackingField(factory2, node, node.modifiers, node.initializer); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiers, node.initializer); setOriginalNode(backingField, node); setEmitFlags(backingField, 3072 /* NoComments */); setSourceMapRange(backingField, sourceMapRange); - const getter = createAccessorPropertyGetRedirector(factory2, node, node.modifiers, getterName); + const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName); setOriginalNode(getter, node); setCommentRange(getter, commentRange); setSourceMapRange(getter, sourceMapRange); - const setter = createAccessorPropertySetRedirector(factory2, node, node.modifiers, setterName); + const setter = createAccessorPropertySetRedirector(factory2, node, modifiers, setterName); setOriginalNode(setter, node); setEmitFlags(setter, 3072 /* NoComments */); setSourceMapRange(setter, sourceMapRange); return visitArray([backingField, getter, setter], accessorFieldResultVisitor, isClassElement); } function transformPrivateFieldInitializer(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { - const info = accessPrivateIdentifier(node.name); + if (shouldTransformClassElementToWeakMap(node)) { + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); - return info.isValid ? void 0 : node; + if (!info.isValid) { + return node; + } + if (info.isStatic && !shouldTransformPrivateElementsOrClassStaticBlocks) { + const statement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); + if (statement) { + return factory2.createClassStaticBlockDeclaration(factory2.createBlock( + [statement], + /*multiLine*/ + true + )); + } + } + return void 0; } - if (shouldTransformInitializersUsingSet && !isStatic(node) && currentClassLexicalEnvironment && currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */) { + if (shouldTransformInitializersUsingSet && !isStatic(node) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */) { return factory2.updatePropertyDeclaration( node, visitNodes2(node.modifiers, visitor, isModifierLike), @@ -85623,6 +86992,19 @@ function transformClassFields(context) { void 0 ); } + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) + ); + } return visitEachChild(node, visitor, context); } function transformPublicFieldInitializer(node) { @@ -85630,10 +87012,12 @@ function transformClassFields(context) { const expr = getPropertyNameExpressionIfNeeded( node.name, /*shouldHoist*/ - !!node.initializer || useDefineForClassFields + !!node.initializer || useDefineForClassFields, + /*captureReferencedName*/ + isNamedEvaluation(node, isAnonymousClassNeedingAssignedName) ); if (expr) { - getPendingExpressions().push(expr); + getPendingExpressions().push(...flattenCommaList(expr)); } if (isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks) { const initializerStatement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); @@ -85651,17 +87035,26 @@ function transformClassFields(context) { } return void 0; } - return visitEachChild(node, classElementVisitor, context); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); } function transformFieldInitializer(node) { Debug.assert(!hasDecorators(node), "Decorators should already have been transformed and elided."); return isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node); } function shouldTransformAutoAccessorsInCurrentClass() { - return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!currentClassLexicalEnvironment && !!(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */); + return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !!(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */); } function visitPropertyDeclaration(node) { - if (shouldTransformAutoAccessorsInCurrentClass() && isAutoAccessorPropertyDeclaration(node)) { + if (isAutoAccessorPropertyDeclaration(node) && (shouldTransformAutoAccessorsInCurrentClass() || hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */)) { return transformAutoAccessor(node); } return transformFieldInitializer(node); @@ -85673,33 +87066,35 @@ function transformClassFields(context) { setCommentRange(receiver, moveRangePos(receiver, -1)); switch (info.kind) { case "a" /* Accessor */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, info.getterName ); case "m" /* Method */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, info.methodName ); case "f" /* Field */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, - info.variableName + info.isStatic ? info.variableName : void 0 ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); default: Debug.assertNever(info, "Unknown private element type"); } } function visitPropertyAccessExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(node.name)) { - const privateIdentifierInfo = accessPrivateIdentifier(node.name); + if (isPrivateIdentifier(node.name)) { + const privateIdentifierInfo = accessPrivateIdentifier2(node.name); if (privateIdentifierInfo) { return setTextRange( setOriginalNode( @@ -85710,8 +87105,8 @@ function transformClassFields(context) { ); } } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); } @@ -85729,8 +87124,8 @@ function transformClassFields(context) { return visitEachChild(node, visitor, context); } function visitElementAccessExpression(node) { - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); } @@ -85747,16 +87142,16 @@ function transformClassFields(context) { } return visitEachChild(node, visitor, context); } - function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) { + function visitPreOrPostfixUnaryExpression(node, discarded) { if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { const operand = skipParentheses(node.operand); - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(operand)) { + if (isPrivateIdentifierPropertyAccessExpression(operand)) { let info; - if (info = accessPrivateIdentifier(operand.name)) { + if (info = accessPrivateIdentifier2(operand.name)) { const receiver = visitNode(operand.expression, visitor, isExpression); const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver); let expression = createPrivateIdentifierAccess(info, readExpression); - const temp = isPrefixUnaryExpression(node) || valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = isPrefixUnaryExpression(node) || discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); expression = createPrivateIdentifierAssignment( info, @@ -85772,8 +87167,8 @@ function transformClassFields(context) { } return expression; } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { const expression = visitInvalidSuperProperty(operand); return isPrefixUnaryExpression(node) ? factory2.updatePrefixUnaryExpression(node, expression) : factory2.updatePostfixUnaryExpression(node, expression); @@ -85796,7 +87191,7 @@ function transformClassFields(context) { if (setterName && getterName) { let expression = factory2.createReflectGetCall(superClassReference, getterName, classConstructor); setTextRange(expression, operand); - const temp = valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); expression = factory2.createReflectSetCall(superClassReference, setterName, expression, classConstructor); setOriginalNode(expression, node); @@ -85837,12 +87232,13 @@ function transformClassFields(context) { return { readExpression, initializeExpression }; } function visitCallExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.expression)) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.expression) && accessPrivateIdentifier2(node.expression.name)) { const { thisArg, target } = factory2.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion); if (isCallChain(node)) { return factory2.updateCallChain( node, - factory2.createPropertyAccessChain(visitNode(target, visitor), node.questionDotToken, "call"), + factory2.createPropertyAccessChain(visitNode(target, visitor, isExpression), node.questionDotToken, "call"), /*questionDotToken*/ void 0, /*typeArguments*/ @@ -85852,16 +87248,16 @@ function transformClassFields(context) { } return factory2.updateCallExpression( node, - factory2.createPropertyAccessExpression(visitNode(target, visitor), "call"), + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "call"), /*typeArguments*/ void 0, [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { const invocation = factory2.createFunctionCallCall( visitNode(node.expression, visitor, isExpression), - currentClassLexicalEnvironment.classConstructor, + lexicalEnvironment.data.classConstructor, visitNodes2(node.arguments, visitor, isExpression) ); setOriginalNode(invocation, node); @@ -85871,12 +87267,13 @@ function transformClassFields(context) { return visitEachChild(node, visitor, context); } function visitTaggedTemplateExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.tag)) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.tag) && accessPrivateIdentifier2(node.tag.name)) { const { thisArg, target } = factory2.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion); return factory2.updateTaggedTemplateExpression( node, factory2.createCallExpression( - factory2.createPropertyAccessExpression(visitNode(target, visitor), "bind"), + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "bind"), /*typeArguments*/ void 0, [visitNode(thisArg, visitor, isExpression)] @@ -85886,10 +87283,10 @@ function transformClassFields(context) { visitNode(node.template, visitor, isTemplateLiteral) ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { const invocation = factory2.createFunctionBindCall( visitNode(node.tag, visitor, isExpression), - currentClassLexicalEnvironment.classConstructor, + lexicalEnvironment.data.classConstructor, [] ); setOriginalNode(invocation, node); @@ -85905,10 +87302,10 @@ function transformClassFields(context) { return visitEachChild(node, visitor, context); } function transformClassStaticBlockDeclaration(node) { + if (lexicalEnvironment) { + lexicalEnvironmentMap.set(getOriginalNode(node), lexicalEnvironment); + } if (shouldTransformPrivateElementsOrClassStaticBlocks) { - if (currentClassLexicalEnvironment) { - classLexicalEnvironmentMap.set(getOriginalNodeId(node), currentClassLexicalEnvironment); - } startLexicalEnvironment(); let statements = setCurrentStaticPropertyDeclarationOrStaticBlockAnd( node, @@ -85923,23 +87320,45 @@ function transformClassFields(context) { return iife; } } - function visitBinaryExpression(node, valueIsDiscarded) { + function isAnonymousClassNeedingAssignedName(node) { + if (isClassExpression(node) && !node.name) { + const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); + const classStaticBlock = find(staticPropertiesOrClassStaticBlocks, isClassStaticBlockDeclaration); + if (classStaticBlock) { + for (const statement of classStaticBlock.body.statements) { + if (isExpressionStatement(statement) && isCallToHelper(statement.expression, "___setFunctionName")) { + return false; + } + } + } + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || !!(getInternalEmitFlags(node) && 32 /* TransformPrivateStaticElements */)) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + return hasTransformableStatics; + } + return false; + } + function visitBinaryExpression(node, discarded) { if (isDestructuringAssignment(node)) { const savedPendingExpressions = pendingExpressions; pendingExpressions = void 0; node = factory2.updateBinaryExpression( node, - visitNode(node.left, assignmentTargetVisitor), + visitNode(node.left, assignmentTargetVisitor, isExpression), node.operatorToken, - visitNode(node.right, visitor) + visitNode(node.right, visitor, isExpression) ); const expr = some(pendingExpressions) ? factory2.inlineExpressions(compact([...pendingExpressions, node])) : node; pendingExpressions = savedPendingExpressions; return expr; } if (isAssignmentExpression(node)) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.left)) { - const info = accessPrivateIdentifier(node.left.name); + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isPrivateIdentifierPropertyAccessExpression(node.left)) { + const info = accessPrivateIdentifier2(node.left.name); if (info) { return setTextRange( setOriginalNode( @@ -85949,8 +87368,8 @@ function transformClassFields(context) { node ); } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return factory2.updateBinaryExpression( node, @@ -85983,7 +87402,7 @@ function transformClassFields(context) { ); setTextRange(expression, node); } - const temp = valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); if (temp) { expression = factory2.createAssignment(temp, expression); setTextRange(temp, node); @@ -86005,11 +87424,42 @@ function transformClassFields(context) { } } } - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierInExpression(node)) { + if (isPrivateIdentifierInExpression(node)) { return transformPrivateIdentifierInInExpression(node); } return visitEachChild(node, visitor, context); } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitParenthesizedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function visitPartiallyEmittedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + const referencedName = factory2.createTempVariable(hoistVariableDeclaration); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name }; + } function createPrivateIdentifierAssignment(info, receiver, right, operator) { receiver = visitNode(receiver, visitor, isExpression); right = visitNode(right, visitor, isExpression); @@ -86025,7 +87475,7 @@ function transformClassFields(context) { setCommentRange(receiver, moveRangePos(receiver, -1)); switch (info.kind) { case "a" /* Accessor */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, @@ -86033,7 +87483,7 @@ function transformClassFields(context) { info.setterName ); case "m" /* Method */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, @@ -86042,13 +87492,15 @@ function transformClassFields(context) { void 0 ); case "f" /* Field */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, info.kind, - info.variableName + info.isStatic ? info.variableName : void 0 ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); default: Debug.assertNever(info, "Unknown private element type"); } @@ -86059,7 +87511,7 @@ function transformClassFields(context) { function getClassFacts(node) { let facts = 0 /* None */; const original = getOriginalNode(node); - if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(original)) { + if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) { facts |= 1 /* ClassWasDecorated */; } let containsPublicInstanceFields = false; @@ -86103,7 +87555,8 @@ function transformClassFields(context) { return facts; } function visitExpressionWithTypeArgumentsInHeritageClause(node) { - const facts = (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts) || 0 /* None */; + var _a2; + const facts = ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts) || 0 /* None */; if (facts & 4 /* NeedsClassSuperReference */) { const temp = factory2.createTempVariable( hoistVariableDeclaration, @@ -86123,20 +87576,24 @@ function transformClassFields(context) { } return visitEachChild(node, visitor, context); } - function visitInNewClassLexicalEnvironment(node, visitor2) { + function visitInNewClassLexicalEnvironment(node, referencedName, visitor2) { const savedCurrentClassContainer = currentClassContainer; const savedPendingExpressions = pendingExpressions; + const savedLexicalEnvironment = lexicalEnvironment; currentClassContainer = node; pendingExpressions = void 0; startClassLexicalEnvironment(); - if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const shouldAlwaysTransformPrivateStaticElements = getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */; + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldAlwaysTransformPrivateStaticElements) { const name = getNameOfDeclaration(node); if (name && isIdentifier(name)) { - getPrivateIdentifierEnvironment().className = name; + getPrivateIdentifierEnvironment().data.className = name; } + } + if (shouldTransformPrivateElementsOrClassStaticBlocks) { const privateInstanceMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); if (some(privateInstanceMethodsAndAccessors)) { - getPrivateIdentifierEnvironment().weakSetName = createHoistedVariableForClass( + getPrivateIdentifierEnvironment().data.weakSetName = createHoistedVariableForClass( "instances", privateInstanceMethodsAndAccessors[0].name ); @@ -86149,27 +87606,42 @@ function transformClassFields(context) { if (facts & 8 /* NeedsSubstitutionForThisInClassStaticField */) { enableSubstitutionForClassStaticThisOrSuperReference(); } - const result = visitor2(node, facts); + const result = visitor2(node, facts, referencedName); endClassLexicalEnvironment(); + Debug.assert(lexicalEnvironment === savedLexicalEnvironment); currentClassContainer = savedCurrentClassContainer; pendingExpressions = savedPendingExpressions; return result; } function visitClassDeclaration(node) { - return visitInNewClassLexicalEnvironment(node, visitClassDeclarationInNewClassLexicalEnvironment); + return visitInNewClassLexicalEnvironment( + node, + /*referencedName*/ + void 0, + visitClassDeclarationInNewClassLexicalEnvironment + ); } function visitClassDeclarationInNewClassLexicalEnvironment(node, facts) { + var _a2, _b; let pendingClassReferenceAssignment; if (facts & 2 /* NeedsClassConstructorReference */) { - const temp = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); - pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) { + getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + pendingClassReferenceAssignment = factory2.createAssignment(node.emitNode.classThis, factory2.getInternalName(node)); + } else { + const temp = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + } + if ((_b = node.emitNode) == null ? void 0 : _b.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; + } } - const modifiers = visitNodes2(node.modifiers, visitor, isModifierLike); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); const classDecl = factory2.updateClassDeclaration( @@ -86192,7 +87664,7 @@ function transformClassFields(context) { if (some(pendingExpressions)) { statements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); } - if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks) { + if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) { const staticProperties = getStaticPropertiesAndClassStaticBlock(node); if (some(staticProperties)) { addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory2.getInternalName(node)); @@ -86200,28 +87672,37 @@ function transformClassFields(context) { } return statements; } - function visitClassExpression(node) { - return visitInNewClassLexicalEnvironment(node, visitClassExpressionInNewClassLexicalEnvironment); + function visitClassExpression(node, referencedName) { + return visitInNewClassLexicalEnvironment(node, referencedName, visitClassExpressionInNewClassLexicalEnvironment); } - function visitClassExpressionInNewClassLexicalEnvironment(node, facts) { + function visitClassExpressionInNewClassLexicalEnvironment(node, facts, referencedName) { + var _a2, _b, _c, _d, _e, _f; const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */); const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */; let temp; function createClassTempVar() { + var _a3; + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a3 = node.emitNode) == null ? void 0 : _a3.classThis)) { + return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + } const classCheckFlags = resolver.getNodeCheckFlags(node); const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */; const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */; - return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2); + return temp2; + } + if ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; } if (facts & 2 /* NeedsClassConstructorReference */) { - temp = createClassTempVar(); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + temp != null ? temp : temp = createClassTempVar(); } - const modifiers = visitNodes2(node.modifiers, visitor, isModifierLike); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); - const classExpression = factory2.updateClassExpression( + let classExpression = factory2.updateClassExpression( node, modifiers, node.name, @@ -86234,46 +87715,68 @@ function transformClassFields(context) { if (prologue) { expressions.push(prologue); } - const hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); - if (hasTransformableStatics || some(pendingExpressions)) { + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + if (hasTransformableStatics || some(pendingExpressions) || referencedName) { if (isDecoratedClassDeclaration) { Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration."); - if (pendingStatements && pendingExpressions && some(pendingExpressions)) { - pendingStatements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); + if (some(pendingExpressions)) { + addRange(pendingStatements, map(pendingExpressions, factory2.createExpressionStatement)); + } + if (referencedName) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const setNameExpression = emitHelpers().createSetFunctionNameHelper((_c = temp != null ? temp : (_b = node.emitNode) == null ? void 0 : _b.classThis) != null ? _c : factory2.getInternalName(node), referencedName); + pendingStatements.push(factory2.createExpressionStatement(setNameExpression)); + } else { + const setNameExpression = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), referencedName); + classExpression = factory2.updateClassExpression( + classExpression, + classExpression.modifiers, + classExpression.name, + classExpression.typeParameters, + classExpression.heritageClauses, + [ + factory2.createClassStaticBlockDeclaration( + factory2.createBlock([ + factory2.createExpressionStatement(setNameExpression) + ]) + ), + ...classExpression.members + ] + ); + } } - if (pendingStatements && some(staticPropertiesOrClassStaticBlocks)) { - addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, factory2.getInternalName(node)); + if (some(staticPropertiesOrClassStaticBlocks)) { + addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, (_e = (_d = node.emitNode) == null ? void 0 : _d.classThis) != null ? _e : factory2.getInternalName(node)); } if (temp) { - expressions.push( - startOnNewLine(factory2.createAssignment(temp, classExpression)), - startOnNewLine(temp) - ); + expressions.push(factory2.createAssignment(temp, classExpression)); + } else if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_f = node.emitNode) == null ? void 0 : _f.classThis)) { + expressions.push(factory2.createAssignment(node.emitNode.classThis, classExpression)); } else { expressions.push(classExpression); - if (prologue) { - startOnNewLine(classExpression); - } } } else { - temp || (temp = createClassTempVar()); + temp != null ? temp : temp = createClassTempVar(); if (isClassWithConstructorReference) { enableSubstitutionForClassAliases(); const alias = factory2.cloneNode(temp); - alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; + alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; classAliases[getOriginalNodeId(node)] = alias; } - setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression)); - expressions.push(startOnNewLine(factory2.createAssignment(temp, classExpression))); - addRange(expressions, map(pendingExpressions, startOnNewLine)); + expressions.push(factory2.createAssignment(temp, classExpression)); + addRange(expressions, pendingExpressions); + if (referencedName) { + expressions.push(emitHelpers().createSetFunctionNameHelper(temp, referencedName)); + } addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp)); - expressions.push(startOnNewLine(temp)); + expressions.push(factory2.cloneNode(temp)); } } else { expressions.push(classExpression); - if (prologue) { - startOnNewLine(classExpression); - } + } + if (expressions.length > 1) { + addEmitFlags(classExpression, 131072 /* Indented */); + expressions.forEach(startOnNewLine); } return factory2.inlineExpressions(expressions); } @@ -86284,16 +87787,24 @@ function transformClassFields(context) { return void 0; } function transformClassMembers(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const shouldTransformPrivateStaticElementsInClass = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInFile) { for (const member of node.members) { if (isPrivateIdentifierClassElementDeclaration(member)) { - addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + if (shouldTransformClassElementToWeakMap(member)) { + addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, member.name, { kind: "untransformed" }); + } } } - if (some(getPrivateInstanceMethodsAndAccessors(node))) { - createBrandCheckWeakSetForPrivateMethods(); + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + if (some(getPrivateInstanceMethodsAndAccessors(node))) { + createBrandCheckWeakSetForPrivateMethods(); + } } - if (shouldTransformAutoAccessors) { + if (shouldTransformAutoAccessorsInCurrentClass()) { for (const member of node.members) { if (isAutoAccessorPropertyDeclaration(member)) { const storageName = factory2.getGeneratedPrivateNameForNode( @@ -86302,7 +87813,12 @@ function transformClassFields(context) { void 0, "_accessor_storage" ); - addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInClass && hasStaticModifier(member)) { + addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, storageName, { kind: "untransformed" }); + } } } } @@ -86361,7 +87877,7 @@ function transformClassFields(context) { return { members, prologue }; } function createBrandCheckWeakSetForPrivateMethods() { - const { weakSetName } = getPrivateIdentifierEnvironment(); + const { weakSetName } = getPrivateIdentifierEnvironment().data; Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); getPendingExpressions().push( factory2.createAssignment( @@ -86377,7 +87893,7 @@ function transformClassFields(context) { } function transformConstructor(constructor, container) { constructor = visitNode(constructor, visitor, isConstructorDeclaration); - if (!currentClassLexicalEnvironment || !(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */)) { + if (!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) || !(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */)) { return constructor; } const extendsClauseElement = getEffectiveBaseTypeNode(container); @@ -86414,13 +87930,14 @@ function transformClassFields(context) { } function transformConstructorBody(node, constructor, isDerivedClass) { var _a2, _b; - let properties = getProperties( + const instanceProperties = getProperties( node, /*requireInitializer*/ false, /*isStatic*/ false ); + let properties = instanceProperties; if (!useDefineForClassFields) { properties = filter(properties, (property) => !!property.initializer || isPrivateIdentifier(property.name) || hasAccessorModifier(property)); } @@ -86474,37 +87991,30 @@ function transformClassFields(context) { } let parameterPropertyDeclarationCount = 0; if (constructor == null ? void 0 : constructor.body) { - if (useDefineForClassFields) { - statements = statements.filter((statement) => !isParameterPropertyDeclaration(getOriginalNode(statement), constructor)); - } else { - for (const statement of constructor.body.statements) { - if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - parameterPropertyDeclarationCount++; - } - } - if (parameterPropertyDeclarationCount > 0) { - const parameterProperties = visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount); - if (superStatementIndex >= 0) { - addRange(statements, parameterProperties); - } else { - let superAndPrologueStatementCount = prologueStatementCount; - if (needsSyntheticConstructor) - superAndPrologueStatementCount++; - statements = [ - ...statements.slice(0, superAndPrologueStatementCount), - ...parameterProperties, - ...statements.slice(superAndPrologueStatementCount) - ]; - } - indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + for (let i = indexOfFirstStatementAfterSuperAndPrologue; i < constructor.body.statements.length; i++) { + const statement = constructor.body.statements[i]; + if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { + parameterPropertyDeclarationCount++; + } else { + break; } } + if (parameterPropertyDeclarationCount > 0) { + indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + } } const receiver = factory2.createThis(); - addMethodStatements(statements, privateMethodsAndAccessors, receiver); - addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + addInstanceMethodStatements(statements, privateMethodsAndAccessors, receiver); + if (constructor) { + const parameterProperties = filter(instanceProperties, (prop) => isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + const nonParameterProperties = filter(properties, (prop) => !isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + addPropertyOrClassStaticBlockStatements(statements, parameterProperties, receiver); + addPropertyOrClassStaticBlockStatements(statements, nonParameterProperties, receiver); + } else { + addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + } if (constructor) { - addRange(statements, visitNodes2(constructor.body.statements, visitBodyStatement, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); + addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); } statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); if (statements.length === 0 && !constructor) { @@ -86523,16 +88033,10 @@ function transformClassFields(context) { /*location*/ constructor ? constructor.body : void 0 ); - function visitBodyStatement(statement) { - if (useDefineForClassFields && isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - return void 0; - } - return visitor(statement); - } } function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) { for (const property of properties) { - if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) { + if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks) { continue; } const statement = transformPropertyOrClassStaticBlock(property, receiver); @@ -86550,10 +88054,19 @@ function transformClassFields(context) { const statement = factory2.createExpressionStatement(expression); setOriginalNode(statement, property); addEmitFlags(statement, getEmitFlags(property) & 3072 /* NoComments */); - setSourceMapRange(statement, moveRangePastModifiers(property)); setCommentRange(statement, property); + const propertyOriginalNode = getOriginalNode(property); + if (isParameter(propertyOriginalNode)) { + setSourceMapRange(statement, propertyOriginalNode); + removeAllComments(statement); + } else { + setSourceMapRange(statement, moveRangePastModifiers(property)); + } setSyntheticLeadingComments(expression, void 0); setSyntheticTrailingComments(expression, void 0); + if (hasAccessorModifier(propertyOriginalNode)) { + addEmitFlags(statement, 3072 /* NoComments */); + } return statement; } function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) { @@ -86573,37 +88086,49 @@ function transformClassFields(context) { return expressions; } function transformProperty(property, receiver) { + var _a2; const savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock; const transformed = transformPropertyWorker(property, receiver); - if (transformed && hasStaticModifier(property) && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts)) { + if (transformed && hasStaticModifier(property) && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts)) { setOriginalNode(transformed, property); addEmitFlags(transformed, 4 /* AdviseOnEmitNode */); - classLexicalEnvironmentMap.set(getOriginalNodeId(transformed), currentClassLexicalEnvironment); + setSourceMapRange(transformed, getSourceMapRange(property.name)); + lexicalEnvironmentMap.set(getOriginalNode(property), lexicalEnvironment); } currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock; return transformed; } function transformPropertyWorker(property, receiver) { - var _a2; const emitAssignment = !useDefineForClassFields; + let referencedName; + if (isNamedEvaluation(property, isAnonymousClassNeedingAssignedName)) { + if (isPropertyNameLiteral(property.name) || isPrivateIdentifier(property.name)) { + referencedName = factory2.createStringLiteralFromNode(property.name); + } else if (isPropertyNameLiteral(property.name.expression) && !isIdentifier(property.name.expression)) { + referencedName = factory2.createStringLiteralFromNode(property.name.expression); + } else { + referencedName = factory2.getGeneratedNameForNode(property.name); + } + } const propertyName = hasAccessorModifier(property) ? factory2.getGeneratedPrivateNameForNode(property.name) : isComputedPropertyName(property.name) && !isSimpleInlineableExpression(property.name.expression) ? factory2.updateComputedPropertyName(property.name, factory2.getGeneratedNameForNode(property.name)) : property.name; if (hasStaticModifier(property)) { currentStaticPropertyDeclarationOrStaticBlock = property; } - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(propertyName)) { - const privateIdentifierInfo = accessPrivateIdentifier(propertyName); + const initializerVisitor = referencedName ? (child) => namedEvaluationVisitor(child, referencedName) : visitor; + if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property)) { + const privateIdentifierInfo = accessPrivateIdentifier2(propertyName); if (privateIdentifierInfo) { if (privateIdentifierInfo.kind === "f" /* Field */) { if (!privateIdentifierInfo.isStatic) { return createPrivateInstanceFieldInitializer( receiver, - visitNode(property.initializer, visitor, isExpression), + visitNode(property.initializer, initializerVisitor, isExpression), privateIdentifierInfo.brandCheckIdentifier ); } else { return createPrivateStaticFieldInitializer( privateIdentifierInfo.variableName, - visitNode(property.initializer, visitor, isExpression) + visitNode(property.initializer, initializerVisitor, isExpression) ); } } else { @@ -86620,7 +88145,23 @@ function transformClassFields(context) { if (hasSyntacticModifier(propertyOriginalNode, 256 /* Abstract */)) { return void 0; } - const initializer = property.initializer || emitAssignment ? (_a2 = visitNode(property.initializer, visitor, isExpression)) != null ? _a2 : factory2.createVoidZero() : isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName) ? propertyName : factory2.createVoidZero(); + let initializer = visitNode(property.initializer, initializerVisitor, isExpression); + if (isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName)) { + const localName = factory2.cloneNode(propertyName); + if (initializer) { + if (isParenthesizedExpression(initializer) && isCommaExpression(initializer.expression) && isCallToHelper(initializer.expression.left, "___runInitializers") && isVoidExpression(initializer.expression.right) && isNumericLiteral(initializer.expression.right.expression)) { + initializer = initializer.expression.left; + } + initializer = factory2.inlineExpressions([initializer, localName]); + } else { + initializer = localName; + } + setEmitFlags(propertyName, 3072 /* NoComments */ | 96 /* NoSourceMap */); + setSourceMapRange(localName, propertyOriginalNode.name); + setEmitFlags(localName, 3072 /* NoComments */); + } else { + initializer != null ? initializer : initializer = factory2.createVoidZero(); + } if (emitAssignment || isPrivateIdentifier(propertyName)) { const memberAccess = createMemberAccessForPropertyName( factory2, @@ -86629,7 +88170,9 @@ function transformClassFields(context) { /*location*/ propertyName ); - return factory2.createAssignment(memberAccess, initializer); + addEmitFlags(memberAccess, 1024 /* NoLeadingComments */); + const expression = factory2.createAssignment(memberAccess, initializer); + return expression; } else { const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; const descriptor = factory2.createPropertyDescriptor({ value: initializer, configurable: true, writable: true, enumerable: true }); @@ -86657,11 +88200,11 @@ function transformClassFields(context) { context.enableEmitNotification(164 /* ComputedPropertyName */); } } - function addMethodStatements(statements, methods, receiver) { + function addInstanceMethodStatements(statements, methods, receiver) { if (!shouldTransformPrivateElementsOrClassStaticBlocks || !some(methods)) { return; } - const { weakSetName } = getPrivateIdentifierEnvironment(); + const { weakSetName } = getPrivateIdentifierEnvironment().data; Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); statements.push( factory2.createExpressionStatement( @@ -86680,20 +88223,352 @@ function transformClassFields(context) { visitNode(node.argumentExpression, visitor, isExpression) ); } + function getPropertyNameExpressionIfNeeded(name, shouldHoist, captureReferencedName) { + if (isComputedPropertyName(name)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name); + let expression = visitNode(name.expression, visitor, isExpression); + const innerExpression = skipPartiallyEmittedExpressions(expression); + const inlinable = isSimpleInlineableExpression(innerExpression); + const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); + if (!alreadyTransformed && !inlinable && shouldHoist) { + const generatedName = factory2.getGeneratedNameForNode(name); + if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) { + addBlockScopedVariable(generatedName); + } else { + hoistVariableDeclaration(generatedName); + } + if (captureReferencedName) { + expression = emitHelpers().createPropKeyHelper(expression); + } + return factory2.createAssignment(generatedName, expression); + } + return inlinable || isIdentifier(innerExpression) ? void 0 : expression; + } + } + function startClassLexicalEnvironment() { + lexicalEnvironment = { previous: lexicalEnvironment, data: void 0 }; + } + function endClassLexicalEnvironment() { + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + } + function getClassLexicalEnvironment() { + var _a2; + Debug.assert(lexicalEnvironment); + return (_a2 = lexicalEnvironment.data) != null ? _a2 : lexicalEnvironment.data = { + facts: 0 /* None */, + classConstructor: void 0, + classThis: void 0, + superClassReference: void 0 + // privateIdentifierEnvironment: undefined, + }; + } + function getPrivateIdentifierEnvironment() { + var _a2; + Debug.assert(lexicalEnvironment); + return (_a2 = lexicalEnvironment.privateEnv) != null ? _a2 : lexicalEnvironment.privateEnv = newPrivateEnvironment({ + className: void 0, + weakSetName: void 0 + }); + } + function getPendingExpressions() { + return pendingExpressions != null ? pendingExpressions : pendingExpressions = []; + } + function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + if (isAutoAccessorPropertyDeclaration(node)) { + addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isPropertyDeclaration(node)) { + addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isMethodDeclaration(node)) { + addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isGetAccessorDeclaration(node)) { + addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isSetAccessorDeclaration(node)) { + addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } + } + function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + if (isStatic2) { + const brandCheckIdentifier = Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment"); + const variableName = createHoistedVariableForPrivateName(name); + setPrivateIdentifier(privateEnv, name, { + kind: "f" /* Field */, + isStatic: true, + brandCheckIdentifier, + variableName, + isValid + }); + } else { + const weakMapName = createHoistedVariableForPrivateName(name); + setPrivateIdentifier(privateEnv, name, { + kind: "f" /* Field */, + isStatic: false, + brandCheckIdentifier: weakMapName, + isValid + }); + getPendingExpressions().push(factory2.createAssignment( + weakMapName, + factory2.createNewExpression( + factory2.createIdentifier("WeakMap"), + /*typeArguments*/ + void 0, + [] + ) + )); + } + } + function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + const methodName = createHoistedVariableForPrivateName(name); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name, { + kind: "m" /* Method */, + methodName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + var _a2; + const getterName = createHoistedVariableForPrivateName(name, "_get"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { + previousInfo.getterName = getterName; + } else { + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName, + setterName: void 0, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + } + function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + var _a2; + const setterName = createHoistedVariableForPrivateName(name, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { + previousInfo.setterName = setterName; + } else { + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName: void 0, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + } + function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + const getterName = createHoistedVariableForPrivateName(name, "_get"); + const setterName = createHoistedVariableForPrivateName(name, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { + const lex = getClassLexicalEnvironment(); + const privateEnv = getPrivateIdentifierEnvironment(); + const previousInfo = getPrivateIdentifier(privateEnv, name); + const isStatic2 = hasStaticModifier(node); + const isValid = !isReservedPrivateName(name) && previousInfo === void 0; + addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } + function createHoistedVariableForClass(name, node, suffix) { + const { className } = getPrivateIdentifierEnvironment().data; + const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; + const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0, + /*reserveInNestedScopes*/ + true, + prefix, + suffix + ); + if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) { + addBlockScopedVariable(identifier); + } else { + hoistVariableDeclaration(identifier); + } + return identifier; + } + function createHoistedVariableForPrivateName(name, suffix) { + var _a2; + const text = tryGetTextOfPropertyName(name); + return createHoistedVariableForClass((_a2 = text == null ? void 0 : text.substring(1)) != null ? _a2 : name, name, suffix); + } + function accessPrivateIdentifier2(name) { + const info = accessPrivateIdentifier(lexicalEnvironment, name); + return (info == null ? void 0 : info.kind) === "untransformed" ? void 0 : info; + } + function wrapPrivateIdentifierForDestructuringTarget(node) { + const parameter = factory2.getGeneratedNameForNode(node); + const info = accessPrivateIdentifier2(node.name); + if (!info) { + return visitEachChild(node, visitor, context); + } + let receiver = node.expression; + if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { + receiver = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getPendingExpressions().push(factory2.createBinaryExpression(receiver, 63 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); + } + return factory2.createAssignmentTargetWrapper( + parameter, + createPrivateIdentifierAssignment( + info, + receiver, + parameter, + 63 /* EqualsToken */ + ) + ); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isPrivateIdentifierPropertyAccessExpression(node)) { + return wrapPrivateIdentifierForDestructuringTarget(node); + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1 /* ClassWasDecorated */) { + return visitInvalidSuperProperty(node); + } else if (classConstructor && superClassReference) { + const name = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (name) { + const temp = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + return factory2.createAssignmentTargetWrapper( + temp, + factory2.createReflectSetCall( + superClassReference, + name, + temp, + classConstructor + ) + ); + } + } + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const left = visitDestructuringAssignmentTarget(node.left); + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const left = visitDestructuringAssignmentTarget(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitDestructuringAssignmentTarget(node); + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentProperty(node) { + const name = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + return visitEachChild(node, visitor, context); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); + const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateShorthandPropertyAssignment(node, node.name, objectAssignmentInitializer); + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + return factory2.updateArrayLiteralExpression( + node, + visitNodes2(node.elements, visitArrayAssignmentElement, isExpression) + ); + } else { + return factory2.updateObjectLiteralExpression( + node, + visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike) + ); + } + } function onEmitNode(hint, node, emitCallback) { const original = getOriginalNode(node); - if (original.id) { - const classLexicalEnvironment = classLexicalEnvironmentMap.get(original.id); - if (classLexicalEnvironment) { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = classLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = classLexicalEnvironment; - previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; - return; - } + const lex = lexicalEnvironmentMap.get(original); + if (lex) { + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = lex; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = !isClassStaticBlockDeclaration(original) || !(getInternalEmitFlags(original) & 32 /* TransformPrivateStaticElements */); + previousOnEmitNode(hint, node, emitCallback); + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; + return; } switch (node.kind) { case 215 /* FunctionExpression */: @@ -86701,37 +88576,30 @@ function transformClassFields(context) { break; } case 259 /* FunctionDeclaration */: - case 173 /* Constructor */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = void 0; - currentComputedPropertyNameClassLexicalEnvironment = void 0; - previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; - return; - } + case 173 /* Constructor */: case 174 /* GetAccessor */: case 175 /* SetAccessor */: case 171 /* MethodDeclaration */: case 169 /* PropertyDeclaration */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment; - currentClassLexicalEnvironment = void 0; + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = void 0; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = false; previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; return; } case 164 /* ComputedPropertyName */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = void 0; + const savedLexicalEnvironment = lexicalEnvironment; + const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + shouldSubstituteThisWithClassThis = savedShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; return; } } @@ -86754,15 +88622,16 @@ function transformClassFields(context) { return node; } function substituteThisExpression(node) { - if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && currentClassLexicalEnvironment) { - const { facts, classConstructor } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { + if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { facts, classConstructor, classThis } = lexicalEnvironment.data; + if (facts & 1 /* ClassWasDecorated */ && legacyDecorators) { return factory2.createParenthesizedExpression(factory2.createVoidZero()); } - if (classConstructor) { + const substituteThis = shouldSubstituteThisWithClassThis ? classThis != null ? classThis : classConstructor : classConstructor; + if (substituteThis) { return setTextRange( setOriginalNode( - factory2.cloneNode(classConstructor), + factory2.cloneNode(substituteThis), node ), node @@ -86791,350 +88660,6 @@ function transformClassFields(context) { } return void 0; } - function getPropertyNameExpressionIfNeeded(name, shouldHoist) { - if (isComputedPropertyName(name)) { - const expression = visitNode(name.expression, visitor, isExpression); - const innerExpression = skipPartiallyEmittedExpressions(expression); - const inlinable = isSimpleInlineableExpression(innerExpression); - const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); - if (!alreadyTransformed && !inlinable && shouldHoist) { - const generatedName = factory2.getGeneratedNameForNode(name); - if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) { - addBlockScopedVariable(generatedName); - } else { - hoistVariableDeclaration(generatedName); - } - return factory2.createAssignment(generatedName, expression); - } - return inlinable || isIdentifier(innerExpression) ? void 0 : expression; - } - } - function startClassLexicalEnvironment() { - classLexicalEnvironmentStack.push(currentClassLexicalEnvironment); - currentClassLexicalEnvironment = void 0; - } - function endClassLexicalEnvironment() { - currentClassLexicalEnvironment = classLexicalEnvironmentStack.pop(); - } - function getClassLexicalEnvironment() { - return currentClassLexicalEnvironment || (currentClassLexicalEnvironment = { - facts: 0 /* None */, - classConstructor: void 0, - superClassReference: void 0, - privateIdentifierEnvironment: void 0 - }); - } - function getPrivateIdentifierEnvironment() { - const lex = getClassLexicalEnvironment(); - lex.privateIdentifierEnvironment || (lex.privateIdentifierEnvironment = { - className: void 0, - weakSetName: void 0, - identifiers: void 0, - generatedIdentifiers: void 0 - }); - return lex.privateIdentifierEnvironment; - } - function getPendingExpressions() { - return pendingExpressions != null ? pendingExpressions : pendingExpressions = []; - } - function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - if (isAutoAccessorPropertyDeclaration(node)) { - addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isPropertyDeclaration(node)) { - addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isMethodDeclaration(node)) { - addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isGetAccessorDeclaration(node)) { - addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isSetAccessorDeclaration(node)) { - addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - } - function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - if (isStatic2) { - Debug.assert(lex.classConstructor, "classConstructor should be set in private identifier environment"); - const variableName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - brandCheckIdentifier: lex.classConstructor, - variableName, - isStatic: true, - isValid - }); - } else { - const weakMapName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - brandCheckIdentifier: weakMapName, - variableName: void 0, - isStatic: false, - isValid - }); - getPendingExpressions().push(factory2.createAssignment( - weakMapName, - factory2.createNewExpression( - factory2.createIdentifier("WeakMap"), - /*typeArguments*/ - void 0, - [] - ) - )); - } - } - function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const methodName = createHoistedVariableForPrivateName(name); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "m" /* Method */, - methodName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { - previousInfo.getterName = getterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName: void 0, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { - previousInfo.setterName = setterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName: void 0, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { - const lex = getClassLexicalEnvironment(); - const privateEnv = getPrivateIdentifierEnvironment(); - const previousInfo = getPrivateIdentifier(privateEnv, name); - const isStatic2 = hasStaticModifier(node); - const isValid = !isReservedPrivateName(name) && previousInfo === void 0; - addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - function createHoistedVariableForClass(name, node, suffix) { - const { className } = getPrivateIdentifierEnvironment(); - const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; - const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0, - /*reserveInNestedScopes*/ - true, - prefix, - suffix - ); - if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) { - addBlockScopedVariable(identifier); - } else { - hoistVariableDeclaration(identifier); - } - return identifier; - } - function createHoistedVariableForPrivateName(name, suffix) { - var _a2; - const text = tryGetTextOfPropertyName(name); - return createHoistedVariableForClass((_a2 = text == null ? void 0 : text.substring(1)) != null ? _a2 : name, name, suffix); - } - function accessPrivateIdentifier(name) { - if (isGeneratedPrivateIdentifier(name)) { - return accessGeneratedPrivateIdentifier(name); - } else { - return accessPrivateIdentifierByText(name.escapedText); - } - } - function accessPrivateIdentifierByText(text) { - return accessPrivateIdentifierWorker(getPrivateIdentifierInfo, text); - } - function accessGeneratedPrivateIdentifier(name) { - return accessPrivateIdentifierWorker(getGeneratedPrivateIdentifierInfo, getNodeForGeneratedName(name)); - } - function accessPrivateIdentifierWorker(getPrivateIdentifierInfo2, privateIdentifierKey) { - if (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.privateIdentifierEnvironment) { - const info = getPrivateIdentifierInfo2(currentClassLexicalEnvironment.privateIdentifierEnvironment, privateIdentifierKey); - if (info) { - return info; - } - } - for (let i = classLexicalEnvironmentStack.length - 1; i >= 0; --i) { - const env = classLexicalEnvironmentStack[i]; - if (!env) { - continue; - } - if (env.privateIdentifierEnvironment) { - const info = getPrivateIdentifierInfo2(env.privateIdentifierEnvironment, privateIdentifierKey); - if (info) { - return info; - } - } - } - return void 0; - } - function wrapPrivateIdentifierForDestructuringTarget(node) { - const parameter = factory2.getGeneratedNameForNode(node); - const info = accessPrivateIdentifier(node.name); - if (!info) { - return visitEachChild(node, visitor, context); - } - let receiver = node.expression; - if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { - receiver = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getPendingExpressions().push(factory2.createBinaryExpression(receiver, 63 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); - } - return factory2.createAssignmentTargetWrapper( - parameter, - createPrivateIdentifierAssignment( - info, - receiver, - parameter, - 63 /* EqualsToken */ - ) - ); - } - function visitArrayAssignmentTarget(node) { - const target = getTargetOfBindingOrAssignmentElement(node); - if (target) { - let wrapped; - if (isPrivateIdentifierPropertyAccessExpression(target)) { - wrapped = wrapPrivateIdentifierForDestructuringTarget(target); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { - wrapped = visitInvalidSuperProperty(target); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(target) ? visitNode(target.argumentExpression, visitor, isExpression) : isIdentifier(target.name) ? factory2.createStringLiteralFromNode(target.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - wrapped = factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - if (wrapped) { - if (isAssignmentExpression(node)) { - return factory2.updateBinaryExpression( - node, - wrapped, - node.operatorToken, - visitNode(node.right, visitor, isExpression) - ); - } else if (isSpreadElement(node)) { - return factory2.updateSpreadElement(node, wrapped); - } else { - return wrapped; - } - } - } - return visitNode(node, assignmentTargetVisitor); - } - function visitObjectAssignmentTarget(node) { - if (isObjectBindingOrAssignmentElement(node) && !isShorthandPropertyAssignment(node)) { - const target = getTargetOfBindingOrAssignmentElement(node); - let wrapped; - if (target) { - if (isPrivateIdentifierPropertyAccessExpression(target)) { - wrapped = wrapPrivateIdentifierForDestructuringTarget(target); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { - wrapped = visitInvalidSuperProperty(target); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(target) ? visitNode(target.argumentExpression, visitor, isExpression) : isIdentifier(target.name) ? factory2.createStringLiteralFromNode(target.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - wrapped = factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - } - if (isPropertyAssignment(node)) { - const initializer = getInitializerOfBindingOrAssignmentElement(node); - return factory2.updatePropertyAssignment( - node, - visitNode(node.name, visitor, isPropertyName), - wrapped ? initializer ? factory2.createAssignment(wrapped, visitNode(initializer, visitor)) : wrapped : visitNode(node.initializer, assignmentTargetVisitor, isExpression) - ); - } - if (isSpreadAssignment(node)) { - return factory2.updateSpreadAssignment( - node, - wrapped || visitNode(node.expression, assignmentTargetVisitor, isExpression) - ); - } - Debug.assert(wrapped === void 0, "Should not have generated a wrapped target"); - } - return visitNode(node, visitor); - } - function visitAssignmentPattern(node) { - if (isArrayLiteralExpression(node)) { - return factory2.updateArrayLiteralExpression( - node, - visitNodes2(node.elements, visitArrayAssignmentTarget, isExpression) - ); - } else { - return factory2.updateObjectLiteralExpression( - node, - visitNodes2(node.properties, visitObjectAssignmentTarget, isObjectLiteralElementLike) - ); - } - } } function createPrivateStaticFieldInitializer(variableName, initializer) { return factory.createAssignment( @@ -87163,26 +88688,8 @@ function createPrivateInstanceMethodInitializer(receiver, weakSetName) { function isReservedPrivateName(node) { return !isGeneratedPrivateIdentifier(node) && node.escapedText === "#constructor"; } -function getPrivateIdentifier(privateEnv, name) { - return isGeneratedPrivateIdentifier(name) ? getGeneratedPrivateIdentifierInfo(privateEnv, getNodeForGeneratedName(name)) : getPrivateIdentifierInfo(privateEnv, name.escapedText); -} -function setPrivateIdentifier(privateEnv, name, info) { - var _a2, _b; - if (isGeneratedPrivateIdentifier(name)) { - (_a2 = privateEnv.generatedIdentifiers) != null ? _a2 : privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map(); - privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), info); - } else { - (_b = privateEnv.identifiers) != null ? _b : privateEnv.identifiers = /* @__PURE__ */ new Map(); - privateEnv.identifiers.set(name.escapedText, info); - } -} -function getPrivateIdentifierInfo(privateEnv, key) { - var _a2; - return (_a2 = privateEnv.identifiers) == null ? void 0 : _a2.get(key); -} -function getGeneratedPrivateIdentifierInfo(privateEnv, key) { - var _a2; - return (_a2 = privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(key); +function isPrivateIdentifierInExpression(node) { + return isPrivateIdentifier(node.left) && node.operatorToken.kind === 101 /* InKeyword */; } // src/compiler/transformers/typeSerializer.ts @@ -87588,9 +89095,22 @@ function transformLegacyDecorators(context) { } } function visitClassDeclaration(node) { - if (!(classOrConstructorParameterIsDecorated(node) || childIsDecorated(node))) + if (!(classOrConstructorParameterIsDecorated( + /*legacyDecorators*/ + true, + node + ) || childIsDecorated( + /*legacyDecorators*/ + true, + node + ))) { return visitEachChild(node, visitor, context); - const statements = hasDecorators(node) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); + } + const statements = classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + true, + node + ) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); if (statements.length > 1) { statements.push(factory2.createEndOfDeclarationMarker(node)); setEmitFlags(statements[0], getEmitFlags(statements[0]) | 8388608 /* HasEndOfDeclarationMarker */); @@ -87607,7 +89127,12 @@ function transformLegacyDecorators(context) { for (const member of node.members) { if (!canHaveDecorators(member)) continue; - const allDecorators = getAllDecoratorsOfClassElement(member, node); + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); if (some(allDecorators == null ? void 0 : allDecorators.decorators, decoratorContainsPrivateIdentifierInExpression)) return true; if (some(allDecorators == null ? void 0 : allDecorators.parameters, parameterDecoratorsContainPrivateIdentifierInExpression)) @@ -87684,7 +89209,7 @@ function transformLegacyDecorators(context) { const classExpression = factory2.createClassExpression( /*modifiers*/ void 0, - name, + name && isGeneratedIdentifier(name) ? void 0 : name, /*typeParameters*/ void 0, heritageClauses, @@ -87729,7 +89254,7 @@ function transformLegacyDecorators(context) { return factory2.updateConstructorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), visitNode(node.body, visitor, isBlock) ); } @@ -87745,12 +89270,12 @@ function transformLegacyDecorators(context) { node, visitNodes2(node.modifiers, modifierVisitor, isModifier), node.asteriskToken, - visitNode(node.name, visitor, isPropertyName), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionToken*/ void 0, /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -87760,8 +89285,8 @@ function transformLegacyDecorators(context) { return finishClassElement(factory2.updateGetAccessorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -87771,8 +89296,8 @@ function transformLegacyDecorators(context) { return finishClassElement(factory2.updateSetAccessorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), visitNode(node.body, visitor, isBlock) ), node); } @@ -87783,7 +89308,7 @@ function transformLegacyDecorators(context) { return finishClassElement(factory2.updatePropertyDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, /*type*/ @@ -87796,7 +89321,7 @@ function transformLegacyDecorators(context) { node, elideNodes(factory2, node.modifiers), node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*questionToken*/ void 0, /*type*/ @@ -87809,175 +89334,1897 @@ function transformLegacyDecorators(context) { setSourceMapRange(updated, moveRangePastModifiers(node)); setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */); } - return updated; + return updated; + } + function isSyntheticMetadataDecorator(node) { + return isCallToHelper(node.expression, "___metadata"); + } + function transformAllDecoratorsOfDeclaration(allDecorators) { + if (!allDecorators) { + return void 0; + } + const { false: decorators, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator); + const decoratorExpressions = []; + addRange(decoratorExpressions, map(decorators, transformDecorator)); + addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); + addRange(decoratorExpressions, map(metadata, transformDecorator)); + return decoratorExpressions; + } + function addClassElementDecorationStatements(statements, node, isStatic2) { + addRange(statements, map(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr))); + } + function isDecoratedClassElement(member, isStaticElement, parent) { + return nodeOrChildIsDecorated( + /*legacyDecorators*/ + true, + member, + parent + ) && isStaticElement === isStatic(member); + } + function getDecoratedClassElements(node, isStatic2) { + return filter(node.members, (m) => isDecoratedClassElement(m, isStatic2, node)); + } + function generateClassElementDecorationExpressions(node, isStatic2) { + const members = getDecoratedClassElements(node, isStatic2); + let expressions; + for (const member of members) { + expressions = append(expressions, generateClassElementDecorationExpression(node, member)); + } + return expressions; + } + function generateClassElementDecorationExpression(node, member) { + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); + const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); + if (!decoratorExpressions) { + return void 0; + } + const prefix = getClassMemberPrefix(node, member); + const memberName = getExpressionForPropertyName( + member, + /*generateNameForComputedPropertyName*/ + !hasSyntacticModifier(member, 2 /* Ambient */) + ); + const descriptor = languageVersion > 0 /* ES3 */ ? isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull() : void 0; + const helper = emitHelpers().createDecorateHelper( + decoratorExpressions, + prefix, + memberName, + descriptor + ); + setEmitFlags(helper, 3072 /* NoComments */); + setSourceMapRange(helper, moveRangePastModifiers(member)); + return helper; + } + function addConstructorDecorationStatement(statements, node) { + const expression = generateConstructorDecorationExpression(node); + if (expression) { + statements.push(setOriginalNode(factory2.createExpressionStatement(expression), node)); + } + } + function generateConstructorDecorationExpression(node) { + const allDecorators = getAllDecoratorsOfClass(node); + const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); + if (!decoratorExpressions) { + return void 0; + } + const classAlias = classAliases && classAliases[getOriginalNodeId(node)]; + const localName = languageVersion <= 2 /* ES2015 */ ? factory2.getInternalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + const decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName); + const expression = factory2.createAssignment(localName, classAlias ? factory2.createAssignment(classAlias, decorate) : decorate); + setEmitFlags(expression, 3072 /* NoComments */); + setSourceMapRange(expression, moveRangePastModifiers(node)); + return expression; + } + function transformDecorator(decorator) { + return Debug.checkDefined(visitNode(decorator.expression, visitor, isExpression)); + } + function transformDecoratorsOfParameter(decorators, parameterOffset) { + let expressions; + if (decorators) { + expressions = []; + for (const decorator of decorators) { + const helper = emitHelpers().createParamHelper( + transformDecorator(decorator), + parameterOffset + ); + setTextRange(helper, decorator.expression); + setEmitFlags(helper, 3072 /* NoComments */); + expressions.push(helper); + } + } + return expressions; + } + function getExpressionForPropertyName(member, generateNameForComputedPropertyName) { + const name = member.name; + if (isPrivateIdentifier(name)) { + return factory2.createIdentifier(""); + } else if (isComputedPropertyName(name)) { + return generateNameForComputedPropertyName && !isSimpleInlineableExpression(name.expression) ? factory2.getGeneratedNameForNode(name) : name.expression; + } else if (isIdentifier(name)) { + return factory2.createStringLiteral(idText(name)); + } else { + return factory2.cloneNode(name); + } + } + function enableSubstitutionForClassAliases() { + if (!classAliases) { + context.enableSubstitution(79 /* Identifier */); + classAliases = []; + } + } + function getClassAliasIfNeeded(node) { + if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) { + enableSubstitutionForClassAliases(); + const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default"); + classAliases[getOriginalNodeId(node)] = classAlias; + hoistVariableDeclaration(classAlias); + return classAlias; + } + } + function getClassPrototype(node) { + return factory2.createPropertyAccessExpression(factory2.getDeclarationName(node), "prototype"); + } + function getClassMemberPrefix(node, member) { + return isStatic(member) ? factory2.getDeclarationName(node) : getClassPrototype(node); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 /* Expression */) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 79 /* Identifier */: + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + var _a2; + return (_a2 = trySubstituteClassAlias(node)) != null ? _a2 : node; + } + function trySubstituteClassAlias(node) { + if (classAliases) { + if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) { + const declaration = resolver.getReferencedValueDeclaration(node); + if (declaration) { + const classAlias = classAliases[declaration.id]; + if (classAlias) { + const clone2 = factory2.cloneNode(classAlias); + setSourceMapRange(clone2, node); + setCommentRange(clone2, node); + return clone2; + } + } + } + } + return void 0; + } +} + +// src/compiler/transformers/esDecorators.ts +function transformESDecorators(context) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + startLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context; + let top; + let classInfo; + let classThis; + let classSuper; + let pendingExpressions; + let shouldTransformPrivateStaticElementsInFile; + return chainBundle(context, transformSourceFile); + function transformSourceFile(node) { + top = void 0; + shouldTransformPrivateStaticElementsInFile = false; + const visited = visitEachChild(node, visitor, context); + addEmitHelpers(visited, context.readEmitHelpers()); + if (shouldTransformPrivateStaticElementsInFile) { + addInternalEmitFlags(visited, 32 /* TransformPrivateStaticElements */); + shouldTransformPrivateStaticElementsInFile = false; + } + return visited; + } + function updateState() { + classInfo = void 0; + classThis = void 0; + classSuper = void 0; + switch (top == null ? void 0 : top.kind) { + case "class": + classInfo = top.classInfo; + break; + case "class-element": + classInfo = top.next.classInfo; + classThis = top.classThis; + classSuper = top.classSuper; + break; + case "name": + const grandparent = top.next.next.next; + if ((grandparent == null ? void 0 : grandparent.kind) === "class-element") { + classInfo = grandparent.next.classInfo; + classThis = grandparent.classThis; + classSuper = grandparent.classSuper; + } + break; + } + } + function enterClass(classInfo2) { + top = { kind: "class", next: top, classInfo: classInfo2, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + function exitClass() { + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + function enterClassElement(node) { + var _a2, _b; + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "class-element", next: top }; + if (isClassStaticBlockDeclaration(node) || isPropertyDeclaration(node) && hasStaticModifier(node)) { + top.classThis = (_a2 = top.next.classInfo) == null ? void 0 : _a2.classThis; + top.classSuper = (_b = top.next.classInfo) == null ? void 0 : _b.classSuper; + } + updateState(); + } + function exitClassElement() { + var _a2; + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + Debug.assert(((_a2 = top.next) == null ? void 0 : _a2.kind) === "class", "Incorrect value for top.next.kind.", () => { + var _a3; + return `Expected top.next.kind to be 'class' but got '${(_a3 = top.next) == null ? void 0 : _a3.kind}' instead.`; + }); + top = top.next; + updateState(); + } + function enterName() { + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "name", next: top }; + updateState(); + } + function exitName() { + Debug.assert((top == null ? void 0 : top.kind) === "name", "Incorrect value for top.kind.", () => `Expected top.kind to be 'name' but got '${top == null ? void 0 : top.kind}' instead.`); + top = top.next; + updateState(); + } + function enterOther() { + if ((top == null ? void 0 : top.kind) === "other") { + Debug.assert(!pendingExpressions); + top.depth++; + } else { + top = { kind: "other", next: top, depth: 0, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + } + function exitOther() { + Debug.assert((top == null ? void 0 : top.kind) === "other", "Incorrect value for top.kind.", () => `Expected top.kind to be 'other' but got '${top == null ? void 0 : top.kind}' instead.`); + if (top.depth > 0) { + Debug.assert(!pendingExpressions); + top.depth--; + } else { + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + } + function shouldVisitNode(node) { + return !!(node.transformFlags & 33554432 /* ContainsDecorators */) || !!classThis && !!(node.transformFlags & 16384 /* ContainsLexicalThis */) || !!classThis && !!classSuper && !!(node.transformFlags & 134217728 /* ContainsLexicalSuper */); + } + function visitor(node) { + if (!shouldVisitNode(node)) { + return node; + } + switch (node.kind) { + case 167 /* Decorator */: + return Debug.fail("Use `modifierVisitor` instead."); + case 260 /* ClassDeclaration */: + return visitClassDeclaration(node); + case 228 /* ClassExpression */: + return visitClassExpression( + node, + /*referencedName*/ + void 0 + ); + case 173 /* Constructor */: + case 169 /* PropertyDeclaration */: + case 172 /* ClassStaticBlockDeclaration */: + return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); + case 166 /* Parameter */: + return visitParameterDeclaration(node); + case 223 /* BinaryExpression */: + return visitBinaryExpression( + node, + /*discarded*/ + false + ); + case 299 /* PropertyAssignment */: + return visitPropertyAssignment(node); + case 257 /* VariableDeclaration */: + return visitVariableDeclaration(node); + case 205 /* BindingElement */: + return visitBindingElement(node); + case 274 /* ExportAssignment */: + return visitExportAssignment(node); + case 108 /* ThisKeyword */: + return visitThisExpression(node); + case 245 /* ForStatement */: + return visitForStatement(node); + case 241 /* ExpressionStatement */: + return visitExpressionStatement(node); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ + false + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); + case 210 /* CallExpression */: + return visitCallExpression(node); + case 212 /* TaggedTemplateExpression */: + return visitTaggedTemplateExpression(node); + case 221 /* PrefixUnaryExpression */: + case 222 /* PostfixUnaryExpression */: + return visitPreOrPostfixUnaryExpression( + node, + /*discard*/ + false + ); + case 208 /* PropertyAccessExpression */: + return visitPropertyAccessExpression(node); + case 209 /* ElementAccessExpression */: + return visitElementAccessExpression(node); + case 164 /* ComputedPropertyName */: + return visitComputedPropertyName(node); + case 171 /* MethodDeclaration */: + case 175 /* SetAccessor */: + case 174 /* GetAccessor */: + case 215 /* FunctionExpression */: + case 259 /* FunctionDeclaration */: { + enterOther(); + const result = visitEachChild(node, fallbackVisitor, context); + exitOther(); + return result; + } + default: + return visitEachChild(node, fallbackVisitor, context); + } + } + function fallbackVisitor(node) { + switch (node.kind) { + case 167 /* Decorator */: + return void 0; + default: + return visitor(node); + } + } + function modifierVisitor(node) { + switch (node.kind) { + case 167 /* Decorator */: + return void 0; + default: + return node; + } + } + function classElementVisitor(node) { + switch (node.kind) { + case 173 /* Constructor */: + return visitConstructorDeclaration(node); + case 171 /* MethodDeclaration */: + return visitMethodDeclaration(node); + case 174 /* GetAccessor */: + return visitGetAccessorDeclaration(node); + case 175 /* SetAccessor */: + return visitSetAccessorDeclaration(node); + case 169 /* PropertyDeclaration */: + return visitPropertyDeclaration(node); + case 172 /* ClassStaticBlockDeclaration */: + return visitClassStaticBlockDeclaration(node); + default: + return visitor(node); + } + } + function namedEvaluationVisitor(node, referencedName) { + switch (node.kind) { + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 228 /* ClassExpression */: + return visitClassExpression(node, referencedName); + default: + return visitor(node); + } + } + function discardedValueVisitor(node) { + switch (node.kind) { + case 221 /* PrefixUnaryExpression */: + case 222 /* PostfixUnaryExpression */: + return visitPreOrPostfixUnaryExpression( + node, + /*discarded*/ + true + ); + case 223 /* BinaryExpression */: + return visitBinaryExpression( + node, + /*discarded*/ + true + ); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ + true + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + true, + /*referencedName*/ + void 0 + ); + default: + return visitor(node); + } + } + function getHelperVariableName(node) { + let declarationName = node.name && isIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name) : node.name && isPrivateIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name).slice(1) : node.name && isStringLiteral(node.name) && isIdentifierText(node.name.text, 99 /* ESNext */) ? node.name.text : isClassLike(node) ? "class" : "member"; + if (isGetAccessor(node)) + declarationName = `get_${declarationName}`; + if (isSetAccessor(node)) + declarationName = `set_${declarationName}`; + if (node.name && isPrivateIdentifier(node.name)) + declarationName = `private_${declarationName}`; + if (isStatic(node)) + declarationName = `static_${declarationName}`; + return "_" + declarationName; + } + function createHelperVariable(node, suffix) { + return factory2.createUniqueName(`${getHelperVariableName(node)}_${suffix}`, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */); + } + function createLet(name, initializer) { + return factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ) + ], 1 /* Let */) + ); + } + function createClassInfo(node) { + let instanceExtraInitializersName; + let staticExtraInitializersName; + let hasStaticInitializers = false; + let hasNonAmbientInstanceFields = false; + let hasStaticPrivateClassElements = false; + for (const member of node.members) { + if (isNamedClassElement(member) && nodeOrChildIsDecorated( + /*legacyDecorators*/ + false, + member, + node + )) { + if (hasStaticModifier(member)) { + staticExtraInitializersName != null ? staticExtraInitializersName : staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */); + } else { + instanceExtraInitializersName != null ? instanceExtraInitializersName : instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */); + } + } + if (isClassStaticBlockDeclaration(member)) { + hasStaticInitializers = true; + } else if (isPropertyDeclaration(member)) { + if (hasStaticModifier(member)) { + hasStaticInitializers || (hasStaticInitializers = !!member.initializer || hasDecorators(member)); + } else { + hasNonAmbientInstanceFields || (hasNonAmbientInstanceFields = !isAmbientPropertyDeclaration(member)); + } + } + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + hasStaticPrivateClassElements = true; + } + if (staticExtraInitializersName && instanceExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) { + break; + } + } + return { + class: node, + instanceExtraInitializersName, + staticExtraInitializersName, + hasStaticInitializers, + hasNonAmbientInstanceFields, + hasStaticPrivateClassElements + }; + } + function containsLexicalSuperInStaticInitializer(node) { + for (const member of node.members) { + if (isClassStaticBlockDeclaration(member) || isPropertyDeclaration(member) && hasStaticModifier(member)) { + if (member.transformFlags & 134217728 /* ContainsLexicalSuper */) { + return true; + } + } + } + return false; + } + function transformClassLike(node, className) { + var _a2, _b, _c, _d, _e; + startLexicalEnvironment(); + const classReference = (_a2 = node.name) != null ? _a2 : factory2.getGeneratedNameForNode(node); + const classInfo2 = createClassInfo(node); + const classDefinitionStatements = []; + let leadingBlockStatements; + let trailingBlockStatements; + let syntheticConstructor; + let heritageClauses; + let shouldTransformPrivateStaticElementsInClass = false; + const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(node)); + if (classDecorators) { + classInfo2.classDecoratorsName = factory2.createUniqueName("_classDecorators", 16 /* Optimistic */); + classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */); + classInfo2.classExtraInitializersName = factory2.createUniqueName("_classExtraInitializers", 16 /* Optimistic */); + classInfo2.classThis = factory2.createUniqueName("_classThis", 16 /* Optimistic */); + classDefinitionStatements.push( + createLet(classInfo2.classDecoratorsName, factory2.createArrayLiteralExpression(classDecorators)), + createLet(classInfo2.classDescriptorName), + createLet(classInfo2.classExtraInitializersName, factory2.createArrayLiteralExpression()), + createLet(classInfo2.classThis) + ); + if (classInfo2.hasStaticPrivateClassElements) { + shouldTransformPrivateStaticElementsInClass = true; + shouldTransformPrivateStaticElementsInFile = true; + } + } + if (classDecorators && containsLexicalSuperInStaticInitializer(node)) { + const extendsClause = getHeritageClause(node.heritageClauses, 94 /* ExtendsKeyword */); + const extendsElement = extendsClause && firstOrUndefined(extendsClause.types); + const extendsExpression = extendsElement && visitNode(extendsElement.expression, visitor, isExpression); + if (extendsExpression) { + classInfo2.classSuper = factory2.createUniqueName("_classSuper", 16 /* Optimistic */); + const unwrapped = skipOuterExpressions(extendsExpression); + const safeExtendsExpression = isClassExpression(unwrapped) && !unwrapped.name || isFunctionExpression(unwrapped) && !unwrapped.name || isArrowFunction(unwrapped) ? factory2.createComma(factory2.createNumericLiteral(0), extendsExpression) : extendsExpression; + classDefinitionStatements.push(createLet(classInfo2.classSuper, safeExtendsExpression)); + const updatedExtendsElement = factory2.updateExpressionWithTypeArguments( + extendsElement, + classInfo2.classSuper, + /*typeArguments*/ + void 0 + ); + const updatedExtendsClause = factory2.updateHeritageClause(extendsClause, [updatedExtendsElement]); + heritageClauses = factory2.createNodeArray([updatedExtendsClause]); + } + } else { + heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + } + const renamedClassThis = (_b = classInfo2.classThis) != null ? _b : factory2.createThis(); + const needsSetNameHelper = !((_c = getOriginalNode(node, isClassLike)) == null ? void 0 : _c.name) && (classDecorators || !isStringLiteral(className) || !isEmptyStringLiteral(className)); + if (needsSetNameHelper) { + const setNameExpr = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), className); + leadingBlockStatements = append(leadingBlockStatements, factory2.createExpressionStatement(setNameExpr)); + } + enterClass(classInfo2); + let members = visitNodes2(node.members, classElementVisitor, isClassElement); + if (pendingExpressions) { + let outerThis; + for (let expression of pendingExpressions) { + expression = visitNode(expression, function thisVisitor(node2) { + if (!(node2.transformFlags & 16384 /* ContainsLexicalThis */)) { + return node2; + } + switch (node2.kind) { + case 108 /* ThisKeyword */: + if (!outerThis) { + outerThis = factory2.createUniqueName("_outerThis", 16 /* Optimistic */); + classDefinitionStatements.unshift(createLet(outerThis, factory2.createThis())); + } + return outerThis; + default: + return visitEachChild(node2, thisVisitor, context); + } + }, isExpression); + const statement = factory2.createExpressionStatement(expression); + leadingBlockStatements = append(leadingBlockStatements, statement); + } + pendingExpressions = void 0; + } + exitClass(); + if (classInfo2.instanceExtraInitializersName && !getFirstConstructorWithBody(node)) { + const initializerStatements = prepareConstructor(node, classInfo2); + if (initializerStatements) { + const extendsClauseElement = getEffectiveBaseTypeNode(node); + const isDerivedClass = !!(extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */); + const constructorStatements = []; + if (isDerivedClass) { + const spreadArguments = factory2.createSpreadElement(factory2.createIdentifier("arguments")); + const superCall = factory2.createCallExpression( + factory2.createSuper(), + /*typeArguments*/ + void 0, + [spreadArguments] + ); + constructorStatements.push(factory2.createExpressionStatement(superCall)); + } + addRange(constructorStatements, initializerStatements); + const constructorBody = factory2.createBlock( + constructorStatements, + /*multiLine*/ + true + ); + syntheticConstructor = factory2.createConstructorDeclaration( + /*modifiers*/ + void 0, + [], + constructorBody + ); + } + } + if (classInfo2.staticExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.staticExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.instanceExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.instanceExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (!isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticFieldDecorationStatements); + if (classInfo2.classDescriptorName && classInfo2.classDecoratorsName && classInfo2.classExtraInitializersName && classInfo2.classThis) { + leadingBlockStatements != null ? leadingBlockStatements : leadingBlockStatements = []; + const valueProperty = factory2.createPropertyAssignment("value", factory2.createThis()); + const classDescriptor = factory2.createObjectLiteralExpression([valueProperty]); + const classDescriptorAssignment = factory2.createAssignment(classInfo2.classDescriptorName, classDescriptor); + const classNameReference = factory2.createPropertyAccessExpression(factory2.createThis(), "name"); + const esDecorateHelper2 = emitHelpers().createESDecorateHelper( + factory2.createNull(), + classDescriptorAssignment, + classInfo2.classDecoratorsName, + { kind: "class", name: classNameReference }, + factory2.createNull(), + classInfo2.classExtraInitializersName + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateHelper2); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(node)); + leadingBlockStatements.push(esDecorateStatement); + const classDescriptorValueReference = factory2.createPropertyAccessExpression(classInfo2.classDescriptorName, "value"); + const classThisAssignment = factory2.createAssignment(classInfo2.classThis, classDescriptorValueReference); + const classReferenceAssignment = factory2.createAssignment(classReference, classThisAssignment); + leadingBlockStatements.push(factory2.createExpressionStatement(classReferenceAssignment)); + } + if (classInfo2.staticExtraInitializersName) { + const runStaticInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.staticExtraInitializersName); + const runStaticInitializersStatement = factory2.createExpressionStatement(runStaticInitializersHelper); + setSourceMapRange(runStaticInitializersStatement, (_d = node.name) != null ? _d : moveRangePastDecorators(node)); + leadingBlockStatements = append(leadingBlockStatements, runStaticInitializersStatement); + } + if (classInfo2.classExtraInitializersName) { + const runClassInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.classExtraInitializersName); + const runClassInitializersStatement = factory2.createExpressionStatement(runClassInitializersHelper); + setSourceMapRange(runClassInitializersStatement, (_e = node.name) != null ? _e : moveRangePastDecorators(node)); + trailingBlockStatements = append(trailingBlockStatements, runClassInitializersStatement); + } + if (leadingBlockStatements && trailingBlockStatements && !classInfo2.hasStaticInitializers) { + addRange(leadingBlockStatements, trailingBlockStatements); + trailingBlockStatements = void 0; + } + let newMembers = members; + if (leadingBlockStatements) { + const leadingStaticBlockBody = factory2.createBlock( + leadingBlockStatements, + /*multiline*/ + true + ); + const leadingStaticBlock = factory2.createClassStaticBlockDeclaration(leadingStaticBlockBody); + if (shouldTransformPrivateStaticElementsInClass) { + setInternalEmitFlags(leadingStaticBlock, 32 /* TransformPrivateStaticElements */); + } + newMembers = [leadingStaticBlock, ...newMembers]; + } + if (syntheticConstructor) { + newMembers = [...newMembers, syntheticConstructor]; + } + if (trailingBlockStatements) { + const trailingStaticBlockBody = factory2.createBlock( + trailingBlockStatements, + /*multiline*/ + true + ); + const trailingStaticBlock = factory2.createClassStaticBlockDeclaration(trailingStaticBlockBody); + newMembers = [...newMembers, trailingStaticBlock]; + } + if (newMembers !== members) { + members = setTextRange(factory2.createNodeArray(newMembers), members); + } + const lexicalEnvironment = endLexicalEnvironment(); + let classExpression; + if (classDecorators) { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + const classReferenceDeclaration = factory2.createVariableDeclaration( + classReference, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + classExpression + ); + const classReferenceVarDeclList = factory2.createVariableDeclarationList([classReferenceDeclaration]); + const returnExpr = classInfo2.classThis ? factory2.createAssignment(classReference, classInfo2.classThis) : classReference; + classDefinitionStatements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + classReferenceVarDeclList + ), + factory2.createReturnStatement(returnExpr) + ); + } else { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + classDefinitionStatements.push(factory2.createReturnStatement(classExpression)); + } + if (shouldTransformPrivateStaticElementsInClass) { + addInternalEmitFlags(classExpression, 32 /* TransformPrivateStaticElements */); + for (const member of classExpression.members) { + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + addInternalEmitFlags(member, 32 /* TransformPrivateStaticElements */); + } + } + } + setOriginalNode(classExpression, node); + getOrCreateEmitNode(classExpression).classThis = classInfo2.classThis; + return factory2.createImmediatelyInvokedArrowFunction(factory2.mergeLexicalEnvironment(classDefinitionStatements, lexicalEnvironment)); + } + function isDecoratedClassLike(node) { + return classOrConstructorParameterIsDecorated( + /*legacyDecorators*/ + false, + node + ) || childIsDecorated( + /*legacyDecorators*/ + false, + node + ); + } + function visitClassDeclaration(node) { + var _a2; + if (isDecoratedClassLike(node)) { + if (hasSyntacticModifier(node, 1 /* Export */) && hasSyntacticModifier(node, 1024 /* Default */)) { + const originalClass = (_a2 = getOriginalNode(node, isClassLike)) != null ? _a2 : node; + const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default"); + const iife = transformClassLike(node, className); + const statement = factory2.createExportDefault(iife); + setOriginalNode(statement, node); + setCommentRange(statement, getCommentRange(node)); + setSourceMapRange(statement, moveRangePastDecorators(node)); + return statement; + } else { + Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name."); + const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name)); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const varDecl = factory2.createVariableDeclaration( + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + const varDecls = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); + const statement = factory2.createVariableStatement(modifiers, varDecls); + setOriginalNode(statement, node); + setCommentRange(statement, getCommentRange(node)); + return statement; + } + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassDeclaration( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function visitClassExpression(node, referencedName) { + if (isDecoratedClassLike(node)) { + const className = node.name ? factory2.createStringLiteralFromNode(node.name) : referencedName != null ? referencedName : factory2.createStringLiteral(""); + const iife = transformClassLike(node, className); + setOriginalNode(iife, node); + return iife; + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassExpression( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function prepareConstructor(_parent, classInfo2) { + if (classInfo2.instanceExtraInitializersName && !classInfo2.hasNonAmbientInstanceFields) { + const statements = []; + statements.push( + factory2.createExpressionStatement( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + classInfo2.instanceExtraInitializersName + ) + ) + ); + return statements; + } + } + function visitConstructorDeclaration(node) { + enterClassElement(node); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const parameters = visitNodes2(node.parameters, visitor, isParameter); + let body; + if (node.body && classInfo) { + const initializerStatements = prepareConstructor(classInfo.class, classInfo); + if (initializerStatements) { + const statements = []; + const nonPrologueStart = factory2.copyPrologue( + node.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart)); + body = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + setOriginalNode(body, node.body); + setTextRange(body, node.body); + } + } + body != null ? body : body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return factory2.updateConstructorDeclaration(node, modifiers, parameters, body); + } + function finishClassElement(updated, original) { + if (updated !== original) { + setCommentRange(updated, original); + setSourceMapRange(updated, moveRangePastDecorators(original)); + } + return updated; + } + function partialTransformClassElement(member, useNamedEvaluation, classInfo2, createDescriptor) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let referencedName; + let name; + let initializersName; + let thisArg; + let descriptorName; + if (!classInfo2) { + const modifiers2 = visitNodes2(member.modifiers, modifierVisitor, isModifier); + enterName(); + if (useNamedEvaluation) { + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + } else { + name = visitPropertyName(member.name); + } + exitName(); + return { modifiers: modifiers2, referencedName, name, initializersName, descriptorName, thisArg }; + } + const memberDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClassElement( + member, + classInfo2.class, + /*useLegacyDecorators*/ + false + )); + const modifiers = visitNodes2(member.modifiers, modifierVisitor, isModifier); + if (memberDecorators) { + const memberDecoratorsName = createHelperVariable(member, "decorators"); + const memberDecoratorsArray = factory2.createArrayLiteralExpression(memberDecorators); + const memberDecoratorsAssignment = factory2.createAssignment(memberDecoratorsName, memberDecoratorsArray); + const memberInfo = { memberDecoratorsName }; + (_a2 = classInfo2.memberInfos) != null ? _a2 : classInfo2.memberInfos = /* @__PURE__ */ new Map(); + classInfo2.memberInfos.set(member, memberInfo); + pendingExpressions != null ? pendingExpressions : pendingExpressions = []; + pendingExpressions.push(memberDecoratorsAssignment); + const statements = isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? (_b = classInfo2.staticNonFieldDecorationStatements) != null ? _b : classInfo2.staticNonFieldDecorationStatements = [] : (_c = classInfo2.nonStaticNonFieldDecorationStatements) != null ? _c : classInfo2.nonStaticNonFieldDecorationStatements = [] : isPropertyDeclaration(member) && !isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? (_d = classInfo2.staticFieldDecorationStatements) != null ? _d : classInfo2.staticFieldDecorationStatements = [] : (_e = classInfo2.nonStaticFieldDecorationStatements) != null ? _e : classInfo2.nonStaticFieldDecorationStatements = [] : Debug.fail(); + const kind = isGetAccessorDeclaration(member) ? "getter" : isSetAccessorDeclaration(member) ? "setter" : isMethodDeclaration(member) ? "method" : isAutoAccessorPropertyDeclaration(member) ? "accessor" : isPropertyDeclaration(member) ? "field" : Debug.fail(); + let propertyName; + if (isIdentifier(member.name) || isPrivateIdentifier(member.name)) { + propertyName = { computed: false, name: member.name }; + } else if (isPropertyNameLiteral(member.name)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(member.name) }; + } else { + const expression = member.name.expression; + if (isPropertyNameLiteral(expression) && !isIdentifier(expression)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(expression) }; + } else { + enterName(); + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + propertyName = { computed: true, name: referencedName }; + exitName(); + } + } + const context2 = { + kind, + name: propertyName, + static: isStatic(member), + private: isPrivateIdentifier(member.name), + access: { + // 15.7.3 CreateDecoratorAccessObject (kind, name) + // 2. If _kind_ is ~field~, ~method~, ~accessor~, or ~getter~, then ... + get: isPropertyDeclaration(member) || isGetAccessorDeclaration(member) || isMethodDeclaration(member), + // 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ... + set: isPropertyDeclaration(member) || isSetAccessorDeclaration(member) + } + }; + const extraInitializers = isStatic(member) ? (_f = classInfo2.staticExtraInitializersName) != null ? _f : classInfo2.staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */) : (_g = classInfo2.instanceExtraInitializersName) != null ? _g : classInfo2.instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */); + if (isMethodOrAccessor(member)) { + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && createDescriptor) { + descriptor = createDescriptor(member, visitNodes2(modifiers, (node) => tryCast(node, isAsyncModifier), isModifier)); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper(factory2.createThis(), descriptor != null ? descriptor : factory2.createNull(), memberDecoratorsName, context2, factory2.createNull(), extraInitializers); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } else if (isPropertyDeclaration(member)) { + initializersName = (_h = memberInfo.memberInitializersName) != null ? _h : memberInfo.memberInitializersName = createHelperVariable(member, "initializers"); + if (isStatic(member)) { + thisArg = classInfo2.classThis; + } + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && hasAccessorModifier(member) && createDescriptor) { + descriptor = createDescriptor( + member, + /*modifiers*/ + void 0 + ); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper( + isAutoAccessorPropertyDeclaration(member) ? factory2.createThis() : factory2.createNull(), + descriptor != null ? descriptor : factory2.createNull(), + memberDecoratorsName, + context2, + initializersName, + extraInitializers + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } + } + if (name === void 0) { + enterName(); + if (useNamedEvaluation) { + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + } else { + name = visitPropertyName(member.name); + } + exitName(); + } + if (!some(modifiers) && (isMethodDeclaration(member) || isPropertyDeclaration(member))) { + setEmitFlags(name, 1024 /* NoLeadingComments */); + } + return { modifiers, referencedName, name, initializersName, descriptorName, thisArg }; + } + function visitMethodDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createMethodDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createMethodDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateMethodDeclaration( + node, + modifiers, + node.asteriskToken, + name, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitGetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createGetAccessorDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createGetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateGetAccessorDeclaration( + node, + modifiers, + name, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitSetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createSetAccessorDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createSetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateSetAccessorDeclaration(node, modifiers, name, parameters, body), node); + } + } + function visitClassStaticBlockDeclaration(node) { + enterClassElement(node); + if (classInfo) + classInfo.hasStaticInitializers = true; + const result = visitEachChild(node, visitor, context); + exitClassElement(); + return result; + } + function visitPropertyDeclaration(node) { + enterClassElement(node); + Debug.assert(!isAmbientPropertyDeclaration(node), "Not yet implemented."); + const useNamedEvaluation = isNamedEvaluation(node, isAnonymousClassNeedingAssignedName); + const { modifiers, name, referencedName, initializersName, descriptorName, thisArg } = partialTransformClassElement(node, useNamedEvaluation, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0); + startLexicalEnvironment(); + let initializer = referencedName ? visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression) : visitNode(node.initializer, visitor, isExpression); + if (initializersName) { + initializer = emitHelpers().createRunInitializersHelper( + thisArg != null ? thisArg : factory2.createThis(), + initializersName, + initializer != null ? initializer : factory2.createVoidZero() + ); + } + if (!isStatic(node) && (classInfo == null ? void 0 : classInfo.instanceExtraInitializersName) && !(classInfo == null ? void 0 : classInfo.hasInjectedInstanceInitializers)) { + classInfo.hasInjectedInstanceInitializers = true; + initializer != null ? initializer : initializer = factory2.createVoidZero(); + initializer = factory2.createParenthesizedExpression(factory2.createComma( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + classInfo.instanceExtraInitializersName + ), + initializer + )); + } + if (isStatic(node) && classInfo && initializer) { + classInfo.hasStaticInitializers = true; + } + const declarations = endLexicalEnvironment(); + if (some(declarations)) { + initializer = factory2.createImmediatelyInvokedArrowFunction([ + ...declarations, + factory2.createReturnStatement(initializer) + ]); + } + exitClassElement(); + if (hasAccessorModifier(node) && descriptorName) { + const commentRange = getCommentRange(node); + const sourceMapRange = getSourceMapRange(node); + const name2 = node.name; + let getterName = name2; + let setterName = name2; + if (isComputedPropertyName(name2) && !isSimpleInlineableExpression(name2.expression)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name2); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name2, visitNode(name2.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name2, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name2.expression); + const expression = visitNode(name2.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name2.expression); + getterName = factory2.updateComputedPropertyName(name2, assignment); + setterName = factory2.updateComputedPropertyName(name2, temp); + } + } + const modifiersWithoutAccessor = visitNodes2(modifiers, (node2) => node2.kind !== 127 /* AccessorKeyword */ ? node2 : void 0, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiersWithoutAccessor, initializer); + setOriginalNode(backingField, node); + setEmitFlags(backingField, 3072 /* NoComments */); + setSourceMapRange(backingField, sourceMapRange); + setSourceMapRange(backingField.name, node.name); + const getter = createGetAccessorDescriptorForwarder(modifiersWithoutAccessor, getterName, descriptorName); + setOriginalNode(getter, node); + setCommentRange(getter, commentRange); + setSourceMapRange(getter, sourceMapRange); + const setter = createSetAccessorDescriptorForwarder(modifiersWithoutAccessor, setterName, descriptorName); + setOriginalNode(setter, node); + setEmitFlags(setter, 3072 /* NoComments */); + setSourceMapRange(setter, sourceMapRange); + return [backingField, getter, setter]; + } + return finishClassElement(factory2.updatePropertyDeclaration( + node, + modifiers, + name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node); + } + function visitThisExpression(node) { + return classThis != null ? classThis : node; + } + function visitCallExpression(node) { + if (isSuperProperty(node.expression) && classThis) { + const expression = visitNode(node.expression, visitor, isExpression); + const argumentsList = visitNodes2(node.arguments, visitor, isExpression); + const invocation = factory2.createFunctionCallCall(expression, classThis, argumentsList); + setOriginalNode(invocation, node); + setTextRange(invocation, node); + return invocation; + } + return visitEachChild(node, visitor, context); + } + function visitTaggedTemplateExpression(node) { + if (isSuperProperty(node.tag) && classThis) { + const tag = visitNode(node.tag, visitor, isExpression); + const boundTag = factory2.createFunctionBindCall(tag, classThis, []); + setOriginalNode(boundTag, node); + setTextRange(boundTag, node); + const template = visitNode(node.template, visitor, isTemplateLiteral); + return factory2.updateTaggedTemplateExpression( + node, + boundTag, + /*typeArguments*/ + void 0, + template + ); + } + return visitEachChild(node, visitor, context); + } + function visitPropertyAccessExpression(node) { + if (isSuperProperty(node) && isIdentifier(node.name) && classThis && classSuper) { + const propertyName = factory2.createStringLiteralFromNode(node.name); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context); + } + function visitElementAccessExpression(node) { + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = visitNode(node.argumentExpression, visitor, isExpression); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context); + } + function visitParameterDeclaration(node) { + let updated; + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } else { + updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + visitNode(node.name, visitor, isBindingName), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + } + if (updated !== node) { + setCommentRange(updated, node); + setTextRange(updated, moveRangePastModifiers(node)); + setSourceMapRange(updated, moveRangePastModifiers(node)); + setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */); + } + return updated; + } + function isAnonymousClassNeedingAssignedName(node) { + return isClassExpression(node) && !node.name && isDecoratedClassLike(node); + } + function visitForStatement(node) { + return factory2.updateForStatement( + node, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, discardedValueVisitor, isExpression), + visitIterationBody(node.statement, visitor, context) + ); + } + function visitExpressionStatement(node) { + return visitEachChild(node, discardedValueVisitor, context); + } + function visitBinaryExpression(node, discarded) { + if (isDestructuringAssignment(node)) { + const left = visitAssignmentPattern(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression(node)) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isSuperProperty(node.left) && classThis && classSuper) { + let setterName = isElementAccessExpression(node.left) ? visitNode(node.left.argumentExpression, visitor, isExpression) : isIdentifier(node.left.name) ? factory2.createStringLiteralFromNode(node.left.name) : void 0; + if (setterName) { + let expression = visitNode(node.right, visitor, isExpression); + if (isCompoundAssignment(node.operatorToken.kind)) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + const superPropertyGet = factory2.createReflectGetCall( + classSuper, + getterName, + classThis + ); + setOriginalNode(superPropertyGet, node.left); + setTextRange(superPropertyGet, node.left); + expression = factory2.createBinaryExpression( + superPropertyGet, + getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), + expression + ); + setTextRange(expression, node); + } + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + if (temp) { + expression = factory2.createAssignment(temp, expression); + setTextRange(temp, node); + } + expression = factory2.createReflectSetCall( + classSuper, + setterName, + expression, + classThis + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + if (node.operatorToken.kind === 27 /* CommaToken */) { + const left = visitNode(node.left, discardedValueVisitor, isExpression); + const right = visitNode(node.right, discarded ? discardedValueVisitor : visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitEachChild(node, visitor, context); + } + function visitPreOrPostfixUnaryExpression(node, discarded) { + if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { + const operand = skipParentheses(node.operand); + if (isSuperProperty(operand) && classThis && classSuper) { + let setterName = isElementAccessExpression(operand) ? visitNode(operand.argumentExpression, visitor, isExpression) : isIdentifier(operand.name) ? factory2.createStringLiteralFromNode(operand.name) : void 0; + if (setterName) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + let expression = factory2.createReflectGetCall(classSuper, getterName, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); + expression = factory2.createReflectSetCall(classSuper, setterName, expression, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + return visitEachChild(node, visitor, context); + } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + const referencedName = factory2.getGeneratedNameForNode(node); + hoistVariableDeclaration(referencedName); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name }; + } + function visitPropertyName(node) { + if (isComputedPropertyName(node)) { + return visitComputedPropertyName(node); + } + return visitNode(node, visitor, isPropertyName); + } + function visitComputedPropertyName(node) { + let expression = visitNode(node.expression, visitor, isExpression); + if (!isSimpleInlineableExpression(expression)) { + expression = injectPendingExpressions(expression); + } + return factory2.updateComputedPropertyName(node, expression); + } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updatePropertyAssignment(node, name, initializer); + } + return visitEachChild(node, visitor, context); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateVariableDeclaration( + node, + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const propertyName = visitNode(node.propertyName, visitor, isPropertyName); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBindingElement( + node, + /*dotDotDotToken*/ + void 0, + propertyName, + name, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (propertyName) { + const paramName = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const expression = factory2.createAssignmentTargetWrapper( + paramName, + factory2.createReflectSetCall( + classSuper, + propertyName, + paramName, + classThis + ) + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + return expression; + } + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentElement(node) { + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentTarget = visitDestructuringAssignmentTarget(node.left); + let initializer; + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + initializer = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + } else { + initializer = visitNode(node.right, visitor, isExpression); + } + return factory2.updateBinaryExpression(node, assignmentTarget, node.operatorToken, initializer); + } else { + return visitDestructuringAssignmentTarget(node); + } } - function transformAllDecoratorsOfDeclaration(allDecorators) { - if (!allDecorators) { - return void 0; + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); } - const decoratorExpressions = []; - addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); - addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); - return decoratorExpressions; - } - function addClassElementDecorationStatements(statements, node, isStatic2) { - addRange(statements, map(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr))); + return visitEachChild(node, visitor, context); } - function isDecoratedClassElement(member, isStaticElement, parent) { - return nodeOrChildIsDecorated(member, parent) && isStaticElement === isStatic(member); + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context); } - function getDecoratedClassElements(node, isStatic2) { - return filter(node.members, (m) => isDecoratedClassElement(m, isStatic2, node)); + function visitAssignmentProperty(node) { + const name = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + return visitEachChild(node, visitor, context); } - function generateClassElementDecorationExpressions(node, isStatic2) { - const members = getDecoratedClassElements(node, isStatic2); - let expressions; - for (const member of members) { - expressions = append(expressions, generateClassElementDecorationExpression(node, member)); + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); + const name = visitNode(node.name, visitor, isIdentifier); + const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer); } - return expressions; + return visitEachChild(node, visitor, context); } - function generateClassElementDecorationExpression(node, member) { - const allDecorators = getAllDecoratorsOfClassElement(member, node); - const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); - if (!decoratorExpressions) { - return void 0; + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); } - const prefix = getClassMemberPrefix(node, member); - const memberName = getExpressionForPropertyName( - member, - /*generateNameForComputedPropertyName*/ - !hasSyntacticModifier(member, 2 /* Ambient */) - ); - const descriptor = languageVersion > 0 /* ES3 */ ? isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull() : void 0; - const helper = emitHelpers().createDecorateHelper( - decoratorExpressions, - prefix, - memberName, - descriptor - ); - setEmitFlags(helper, 3072 /* NoComments */); - setSourceMapRange(helper, moveRangePastModifiers(member)); - return helper; + return visitEachChild(node, visitor, context); } - function addConstructorDecorationStatement(statements, node) { - const expression = generateConstructorDecorationExpression(node); - if (expression) { - statements.push(setOriginalNode(factory2.createExpressionStatement(expression), node)); + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + const elements = visitNodes2(node.elements, visitArrayAssignmentElement, isExpression); + return factory2.updateArrayLiteralExpression(node, elements); + } else { + const properties = visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike); + return factory2.updateObjectLiteralExpression(node, properties); } } - function generateConstructorDecorationExpression(node) { - const allDecorators = getAllDecoratorsOfClass(node); - const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); - if (!decoratorExpressions) { - return void 0; + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const referencedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updateExportAssignment(node, modifiers, expression); } - const classAlias = classAliases && classAliases[getOriginalNodeId(node)]; - const localName = languageVersion <= 2 /* ES2015 */ ? factory2.getInternalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ) : factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ); - const decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName); - const expression = factory2.createAssignment(localName, classAlias ? factory2.createAssignment(classAlias, decorate) : decorate); - setEmitFlags(expression, 3072 /* NoComments */); - setSourceMapRange(expression, moveRangePastModifiers(node)); - return expression; + return visitEachChild(node, visitor, context); } - function transformDecorator(decorator) { - return visitNode(decorator.expression, visitor, isExpression); + function visitParenthesizedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); } - function transformDecoratorsOfParameter(decorators, parameterOffset) { - let expressions; - if (decorators) { - expressions = []; - for (const decorator of decorators) { - const helper = emitHelpers().createParamHelper( - transformDecorator(decorator), - parameterOffset - ); - setTextRange(helper, decorator.expression); - setEmitFlags(helper, 3072 /* NoComments */); - expressions.push(helper); + function visitPartiallyEmittedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function injectPendingExpressions(expression) { + if (some(pendingExpressions)) { + if (isParenthesizedExpression(expression)) { + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); + } else { + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); } + pendingExpressions = void 0; } - return expressions; + return expression; } - function getExpressionForPropertyName(member, generateNameForComputedPropertyName) { - const name = member.name; - if (isPrivateIdentifier(name)) { - return factory2.createIdentifier(""); - } else if (isComputedPropertyName(name)) { - return generateNameForComputedPropertyName && !isSimpleInlineableExpression(name.expression) ? factory2.getGeneratedNameForNode(name) : name.expression; - } else if (isIdentifier(name)) { - return factory2.createStringLiteral(idText(name)); - } else { - return factory2.cloneNode(name); + function transformAllDecoratorsOfDeclaration(allDecorators) { + if (!allDecorators) { + return void 0; } + const decoratorExpressions = []; + addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); + return decoratorExpressions; } - function enableSubstitutionForClassAliases() { - if (!classAliases) { - context.enableSubstitution(79 /* Identifier */); - classAliases = []; - } + function transformDecorator(decorator) { + const expression = visitNode(decorator.expression, visitor, isExpression); + setEmitFlags(expression, 3072 /* NoComments */); + return expression; } - function getClassAliasIfNeeded(node) { - if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) { - enableSubstitutionForClassAliases(); - const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default"); - classAliases[getOriginalNodeId(node)] = classAlias; - hoistVariableDeclaration(classAlias); - return classAlias; - } + function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) { + const func = factory2.createFunctionExpression( + modifiers, + asteriskToken, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body != null ? body : factory2.createBlock([]) + ); + setOriginalNode(func, original); + setSourceMapRange(func, moveRangePastDecorators(original)); + setEmitFlags(func, 3072 /* NoComments */); + const prefix = kind === "get" || kind === "set" ? kind : void 0; + const functionName = factory2.createStringLiteralFromNode( + name, + /*isSingleQuote*/ + void 0 + ); + const namedFunction = emitHelpers().createSetFunctionNameHelper(func, functionName, prefix); + const method = factory2.createPropertyAssignment(factory2.createIdentifier(kind), namedFunction); + setOriginalNode(method, original); + setSourceMapRange(method, moveRangePastDecorators(original)); + setEmitFlags(method, 3072 /* NoComments */); + return method; } - function getClassPrototype(node) { - return factory2.createPropertyAccessExpression(factory2.getDeclarationName(node), "prototype"); + function createMethodDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + node.asteriskToken, + "value", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ) + ]); } - function getClassMemberPrefix(node, member) { - return isStatic(member) ? factory2.getDeclarationName(node) : getClassPrototype(node); + function createGetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + visitNode(node.body, visitor, isBlock) + ) + ]); } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (hint === 1 /* Expression */) { - return substituteExpression(node); - } - return node; + function createSetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ) + ]); } - function substituteExpression(node) { - switch (node.kind) { - case 79 /* Identifier */: - return substituteExpressionIdentifier(node); - } - return node; + function createAccessorPropertyDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ) + ) + ]) + ), + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ), + factory2.createIdentifier("value") + ) + ) + ]) + ) + ]); } - function substituteExpressionIdentifier(node) { - var _a2; - return (_a2 = trySubstituteClassAlias(node)) != null ? _a2 : node; + function createMethodDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("value") + ) + ) + ]) + ); } - function trySubstituteClassAlias(node) { - if (classAliases) { - if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) { - const declaration = resolver.getReferencedValueDeclaration(node); - if (declaration) { - const classAlias = classAliases[declaration.id]; - if (classAlias) { - const clone2 = factory2.cloneNode(classAlias); - setSourceMapRange(clone2, node); - setCommentRange(clone2, node); - return clone2; - } - } - } - } - return void 0; + function createGetAccessorDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("get") + ), + factory2.createThis(), + [] + ) + ) + ]) + ); + } + function createSetAccessorDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createSetAccessorDeclaration( + modifiers, + name, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("set") + ), + factory2.createThis(), + [factory2.createIdentifier("value")] + ) + ) + ]) + ); + } + function getAssignedNameOfIdentifier(name, initializer) { + const originalClass = getOriginalNode(initializer, isClassLike); + return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); } } @@ -88159,21 +91406,21 @@ function transformES2017(context) { node.initializer, /*hasReceiver*/ true - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), visitIterationBody(node.statement, asyncBodyVisitor, context) ); } function visitForOfStatementInAsyncBody(node) { return factory2.updateForOfStatement( node, - visitNode(node.awaitModifier, visitor, isToken), + visitNode(node.awaitModifier, visitor, isAwaitKeyword), isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( node.initializer, /*hasReceiver*/ true - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), visitIterationBody(node.statement, asyncBodyVisitor, context) ); } @@ -88210,7 +91457,7 @@ function transformES2017(context) { function visitConstructorDeclaration(node) { return factory2.updateConstructorDeclaration( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), visitParameterList(node.parameters, visitor, context), transformMethodBody(node) ); @@ -88268,7 +91515,7 @@ function transformES2017(context) { function visitFunctionExpression(node) { return factory2.updateFunctionExpression( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), node.asteriskToken, node.name, /*typeParameters*/ @@ -88282,7 +91529,7 @@ function transformES2017(context) { function visitArrowFunction(node) { return factory2.updateArrowFunction( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), /*typeParameters*/ void 0, visitParameterList(node.parameters, visitor, context), @@ -88339,7 +91586,7 @@ function transformES2017(context) { ), node ); - return visitNode(converted, visitor, isExpression); + return Debug.checkDefined(visitNode(converted, visitor, isExpression)); } function collidesWithParameterName({ name }) { if (isIdentifier(name)) { @@ -88471,7 +91718,7 @@ function transformES2017(context) { if (isBlock(body)) { return factory2.updateBlock(body, visitNodes2(body.statements, asyncBodyVisitor, isStatement, start)); } else { - return factory2.converters.convertToFunctionBlock(visitNode(body, asyncBodyVisitor, isConciseBody)); + return factory2.converters.convertToFunctionBlock(Debug.checkDefined(visitNode(body, asyncBodyVisitor, isConciseBody))); } } function getPromiseConstructor(type) { @@ -88826,7 +92073,7 @@ function transformES2018(context) { return visitObjectLiteralExpression(node); case 223 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 295 /* CatchClause */: return visitCatchClause(node); @@ -89584,7 +92831,7 @@ function transformES2018(context) { /*questionToken*/ void 0, visitor, - isToken + isQuestionToken ), /*typeParameters*/ void 0, @@ -90258,15 +93505,10 @@ function transformES2021(context) { if ((node.transformFlags & 16 /* ContainsES2021 */) === 0) { return node; } - switch (node.kind) { - case 223 /* BinaryExpression */: - const binaryExpression = node; - if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { - return transformLogicalAssignment(binaryExpression); - } - default: - return visitEachChild(node, visitor, context); + if (isLogicalOrCoalescingAssignmentExpression(node)) { + return transformLogicalAssignment(node); } + return visitEachChild(node, visitor, context); } function transformLogicalAssignment(binaryExpression) { const operator = binaryExpression.operatorToken; @@ -90396,7 +93638,7 @@ function transformJsx(context) { factory2.createIdentifier(name), generatedName ); - generatedName.generatedImportReference = specifier; + setIdentifierGeneratedImportReference(generatedName, specifier); specifierSourceImports.set(name, specifier); return generatedName; } @@ -90712,7 +93954,7 @@ function transformJsx(context) { return element; } function transformJsxSpreadAttributeToSpreadAssignment(node) { - return factory2.createSpreadAssignment(visitNode(node.expression, visitor, isExpression)); + return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); } function transformJsxAttributesToObjectProps(attrs, children) { const target = getEmitScriptTarget(compilerOptions); @@ -90742,7 +93984,7 @@ function transformJsx(context) { return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions); } function transformJsxSpreadAttributeToExpression(node) { - return visitNode(node.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); } function transformJsxAttributeToObjectLiteralElement(node) { const name = getAttributeName(node); @@ -90762,7 +94004,7 @@ function transformJsx(context) { if (node.expression === void 0) { return factory2.createTrue(); } - return visitNode(node.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); } if (isJsxElement(node)) { return visitJsxElement( @@ -91273,7 +94515,7 @@ function transformES2015(context) { node, /*lookInLabeledStatements*/ false - ) && shouldConvertIterationStatement(node) || (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) !== 0; + ) && shouldConvertIterationStatement(node) || (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { return shouldVisitNode(node) ? visitorWorker( @@ -91404,7 +94646,7 @@ function transformES2015(context) { return visitParenthesizedExpression(node, expressionResultIsUnused2); case 223 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -91507,7 +94749,7 @@ function transformES2015(context) { [ factory2.createPropertyAssignment( factory2.createIdentifier("value"), - node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() + node.expression ? Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) : factory2.createVoidZero() ) ] ) @@ -91539,7 +94781,7 @@ function transformES2015(context) { return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments")); } } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { return setOriginalNode(setTextRange( factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)), node @@ -91678,7 +94920,7 @@ function transformES2015(context) { outer, /*typeArguments*/ void 0, - extendsClauseElement ? [visitNode(extendsClauseElement.expression, visitor, isExpression)] : [] + extendsClauseElement ? [Debug.checkDefined(visitNode(extendsClauseElement.expression, visitor, isExpression))] : [] ) ); addSyntheticLeadingComment(result, 3 /* MultiLineCommentTrivia */, "* @class "); @@ -92020,7 +95262,7 @@ function transformES2015(context) { factory2.createExpressionStatement( factory2.createAssignment( factory2.getGeneratedNameForNode(parameter), - visitNode(initializer, visitor, isExpression) + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) ) ), 2097152 /* CustomPrologue */ @@ -92031,7 +95273,7 @@ function transformES2015(context) { return false; } function insertDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { - initializer = visitNode(initializer, visitor, isExpression); + initializer = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); const statement = factory2.createIfStatement( factory2.createTypeCheck(factory2.cloneNode(name), "undefined"), setEmitFlags( @@ -92307,6 +95549,7 @@ function transformES2015(context) { container ); const propertyName = visitNode(member.name, visitor, isPropertyName); + Debug.assert(propertyName); let e; if (!isPrivateIdentifier(propertyName) && getUseDefineForClassFields(context.getCompilerOptions())) { const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; @@ -92350,6 +95593,7 @@ function transformES2015(context) { setEmitFlags(target, 3072 /* NoComments */ | 64 /* NoTrailingSourceMap */); setSourceMapRange(target, firstAccessor.name); const visitedAccessorName = visitNode(firstAccessor.name, visitor, isPropertyName); + Debug.assert(visitedAccessorName); if (isPrivateIdentifier(visitedAccessorName)) { return Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015."); } @@ -92622,9 +95866,9 @@ function transformES2015(context) { if (node.operatorToken.kind === 27 /* CommaToken */) { return factory2.updateBinaryExpression( node, - visitNode(node.left, visitorWithUnusedExpressionResult, isExpression), + Debug.checkDefined(visitNode(node.left, visitorWithUnusedExpressionResult, isExpression)), node.operatorToken, - visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression) + Debug.checkDefined(visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -92639,6 +95883,7 @@ function transformES2015(context) { const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression); if (result || visited !== element) { result || (result = node.elements.slice(0, i)); + Debug.assert(visited); result.push(visited); } } @@ -92646,7 +95891,7 @@ function transformES2015(context) { return factory2.updateCommaListExpression(node, elements); } function isVariableStatementOfTypeScriptClassWrapper(node) { - return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getEmitFlags(node.declarationList.declarations[0].initializer) & 67108864 /* TypeScriptClassWrapper */); + return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */); } function visitVariableStatement(node) { const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); @@ -92665,7 +95910,7 @@ function transformES2015(context) { 0 /* All */ ); } else { - assignment = factory2.createBinaryExpression(decl.name, 63 /* EqualsToken */, visitNode(decl.initializer, visitor, isExpression)); + assignment = factory2.createBinaryExpression(decl.name, 63 /* EqualsToken */, Debug.checkDefined(visitNode(decl.initializer, visitor, isExpression))); setTextRange(assignment, decl); } assignments = append(assignments, assignment); @@ -92687,7 +95932,7 @@ function transformES2015(context) { if (node.flags & 3 /* BlockScoped */) { enableSubstitutionsForBlockScopedBindings(); } - const declarations = flatMap(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration); + const declarations = visitNodes2(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration, isVariableDeclaration); const declarationList = factory2.createVariableDeclarationList(declarations); setOriginalNode(declarationList, node); setTextRange(declarationList, node); @@ -92771,7 +96016,7 @@ function transformES2015(context) { statement, /*outermostLabeledStatement*/ node - ) : factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node, convertedLoopState && resetLabel); + ) : factory2.restoreEnclosingLabel(Debug.checkDefined(visitNode(statement, visitor, isStatement, factory2.liftToBlock)), node, convertedLoopState && resetLabel); } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { @@ -92814,7 +96059,7 @@ function transformES2015(context) { visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer), visitNode(node.condition, visitor, isExpression), visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression), - visitNode(node.statement, visitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) ); } function visitForInStatement(node, outermostLabeledStatement) { @@ -92900,13 +96145,14 @@ function transformES2015(context) { ))); } else { setTextRangeEnd(assignment, initializer.end); - statements.push(setTextRange(factory2.createExpressionStatement(visitNode(assignment, visitor, isExpression)), moveRangeEnd(initializer, -1))); + statements.push(setTextRange(factory2.createExpressionStatement(Debug.checkDefined(visitNode(assignment, visitor, isExpression))), moveRangeEnd(initializer, -1))); } } if (convertedLoopBodyStatements) { return createSyntheticBlockForConvertedStatements(addRange(statements, convertedLoopBodyStatements)); } else { const statement = visitNode(node.statement, visitor, isStatement, factory2.liftToBlock); + Debug.assert(statement); if (isBlock(statement)) { return factory2.updateBlock(statement, setTextRange(factory2.createNodeArray(concatenate(statements, statement.statements)), statement.statements)); } else { @@ -92927,6 +96173,7 @@ function transformES2015(context) { } function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const counter = factory2.createLoopVariable(); const rhsReference = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( /*recordTempVariable*/ @@ -92986,6 +96233,7 @@ function transformES2015(context) { } function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const iterator = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( /*recordTempVariable*/ void 0 @@ -93243,7 +96491,7 @@ function transformES2015(context) { loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); } } else { - const clone2 = convertIterationStatementCore(node, initializerFunction, visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)); + const clone2 = convertIterationStatementCore(node, initializerFunction, Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))); loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); } statements.push(loop); @@ -93281,16 +96529,16 @@ function transformES2015(context) { node, /*awaitModifier*/ void 0, - visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } function convertForInStatement(node, convertedLoopBody) { return factory2.updateForInStatement( node, - visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } @@ -93298,13 +96546,13 @@ function transformES2015(context) { return factory2.updateDoStatement( node, convertedLoopBody, - visitNode(node.expression, visitor, isExpression) + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) ); } function convertWhileStatement(node, convertedLoopBody) { return factory2.updateWhileStatement( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } @@ -93466,7 +96714,7 @@ function transformES2015(context) { void 0, /*type*/ void 0, - visitNode( + Debug.checkDefined(visitNode( factory2.createBlock( statements, /*multiLine*/ @@ -93474,7 +96722,7 @@ function transformES2015(context) { ), visitor, isBlock - ) + )) ), emitFlags ) @@ -93497,7 +96745,7 @@ function transformES2015(context) { if (node.incrementor) { statements.push(factory2.createIfStatement( currentState.conditionVariable, - factory2.createExpressionStatement(visitNode(node.incrementor, visitor, isExpression)), + factory2.createExpressionStatement(Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression))), factory2.createExpressionStatement(factory2.createAssignment(currentState.conditionVariable, factory2.createTrue())) )); } else { @@ -93508,11 +96756,12 @@ function transformES2015(context) { } if (shouldConvertConditionOfForStatement(node)) { statements.push(factory2.createIfStatement( - factory2.createPrefixUnaryExpression(53 /* ExclamationToken */, visitNode(node.condition, visitor, isExpression)), - visitNode(factory2.createBreakStatement(), visitor, isStatement) + factory2.createPrefixUnaryExpression(53 /* ExclamationToken */, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))), + Debug.checkDefined(visitNode(factory2.createBreakStatement(), visitor, isStatement)) )); } } + Debug.assert(statement); if (isBlock(statement)) { addRange(statements, statement.statements); } else { @@ -93780,9 +97029,9 @@ function transformES2015(context) { createMemberAccessForPropertyName( factory2, receiver, - visitNode(property.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) ), - visitNode(property.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(property.initializer, visitor, isExpression)) ); setTextRange(expression, property); if (startsOnNewLine) { @@ -93795,7 +97044,7 @@ function transformES2015(context) { createMemberAccessForPropertyName( factory2, receiver, - visitNode(property.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) ), factory2.cloneNode(property.name) ); @@ -93810,7 +97059,7 @@ function transformES2015(context) { createMemberAccessForPropertyName( factory2, receiver, - visitNode(method.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(method.name, visitor, isPropertyName)) ), transformFunctionLikeToExpression( method, @@ -93931,7 +97180,7 @@ function transformES2015(context) { return visitEachChild(node, visitor, context); } function visitCallExpression(node) { - if (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) { + if (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) { return visitTypeScriptClassWrapper(node); } const expression = skipOuterExpressions(node.expression); @@ -93944,7 +97193,7 @@ function transformES2015(context) { } return factory2.updateCallExpression( node, - visitNode(node.expression, callExpressionVisitor, isExpression), + Debug.checkDefined(visitNode(node.expression, callExpressionVisitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -93996,7 +97245,14 @@ function transformES2015(context) { if (classBodyEnd < -1) { addRange(statements, funcStatements, classBodyEnd + 1); } - addRange(statements, remainingStatements); + const returnStatement = tryCast(elementAt(funcStatements, classBodyEnd), isReturnStatement); + for (const statement of remainingStatements) { + if (isReturnStatement(statement) && (returnStatement == null ? void 0 : returnStatement.expression) && !isIdentifier(returnStatement.expression)) { + statements.push(returnStatement); + } else { + statements.push(statement); + } + } addRange( statements, classStatements, @@ -94056,8 +97312,8 @@ function transformES2015(context) { let resultingCall; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { resultingCall = factory2.createFunctionApplyCall( - visitNode(target, callExpressionVisitor, isExpression), - node.expression.kind === 106 /* SuperKeyword */ ? thisArg : visitNode(thisArg, visitor, isExpression), + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 106 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), transformAndSpreadElements( node.arguments, /*isArgumentList*/ @@ -94071,8 +97327,8 @@ function transformES2015(context) { } else { resultingCall = setTextRange( factory2.createFunctionCallCall( - visitNode(target, callExpressionVisitor, isExpression), - node.expression.kind === 106 /* SuperKeyword */ ? thisArg : visitNode(thisArg, visitor, isExpression), + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 106 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), visitNodes2(node.arguments, visitor, isExpression) ), node @@ -94094,7 +97350,7 @@ function transformES2015(context) { const { target, thisArg } = factory2.createCallBinding(factory2.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration); return factory2.createNewExpression( factory2.createFunctionApplyCall( - visitNode(target, visitor, isExpression), + Debug.checkDefined(visitNode(target, visitor, isExpression)), thisArg, transformAndSpreadElements( factory2.createNodeArray([factory2.createVoidZero(), ...node.arguments]), @@ -94151,7 +97407,9 @@ function transformES2015(context) { return map(chunk, visitExpressionOfSpread); } function visitExpressionOfSpread(node) { + Debug.assertNode(node, isSpreadElement); let expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const isCallToReadHelper = isCallToHelper(expression, "___read"); let kind = isCallToReadHelper || isPackedArrayLiteral(expression) ? 2 /* PackedSpread */ : 1 /* UnpackedSpread */; if (compilerOptions.downlevelIteration && kind === 1 /* UnpackedSpread */ && !isArrayLiteralExpression(expression) && !isCallToReadHelper) { @@ -94202,7 +97460,7 @@ function transformES2015(context) { function visitTemplateExpression(node) { let expression = factory2.createStringLiteral(node.head.text); for (const span of node.templateSpans) { - const args = [visitNode(span.expression, visitor, isExpression)]; + const args = [Debug.checkDefined(visitNode(span.expression, visitor, isExpression))]; if (span.literal.text.length > 0) { args.push(factory2.createStringLiteral(span.literal.text)); } @@ -94420,7 +97678,7 @@ function transformES5(context) { return node; } function trySubstituteReservedName(name) { - const token = name.originalKeywordKind || (nodeIsSynthesized(name) ? stringToToken(idText(name)) : void 0); + const token = identifierToKeywordKind(name); if (token !== void 0 && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) { return setTextRange(factory2.createStringLiteralFromNode(name), name); } @@ -94556,7 +97814,7 @@ function transformGenerators(context) { switch (node.kind) { case 223 /* BinaryExpression */: return visitBinaryExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node); case 224 /* ConditionalExpression */: return visitConditionalExpression(node); @@ -94768,19 +98026,19 @@ function transformGenerators(context) { case 208 /* PropertyAccessExpression */: target = factory2.updatePropertyAccessExpression( left, - cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)), + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), left.name ); break; case 209 /* ElementAccessExpression */: target = factory2.updateElementAccessExpression( left, - cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)), - cacheExpression(visitNode(left.argumentExpression, visitor, isExpression)) + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), + cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression))) ); break; default: - target = visitNode(left, visitor, isExpression); + target = Debug.checkDefined(visitNode(left, visitor, isExpression)); break; } const operator = node.operatorToken.kind; @@ -94792,7 +98050,7 @@ function transformGenerators(context) { factory2.createBinaryExpression( cacheExpression(target), getNonAssignmentOperatorForCompoundAssignment(operator), - visitNode(right, visitor, isExpression) + Debug.checkDefined(visitNode(right, visitor, isExpression)) ), node ) @@ -94800,7 +98058,7 @@ function transformGenerators(context) { node ); } else { - return factory2.updateBinaryExpression(node, target, node.operatorToken, visitNode(right, visitor, isExpression)); + return factory2.updateBinaryExpression(node, target, node.operatorToken, Debug.checkDefined(visitNode(right, visitor, isExpression))); } } return visitEachChild(node, visitor, context); @@ -94814,9 +98072,9 @@ function transformGenerators(context) { } return factory2.updateBinaryExpression( node, - cacheExpression(visitNode(node.left, visitor, isExpression)), + cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))), node.operatorToken, - visitNode(node.right, visitor, isExpression) + Debug.checkDefined(visitNode(node.right, visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -94835,7 +98093,7 @@ function transformGenerators(context) { emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); pendingExpressions = []; } - pendingExpressions.push(visitNode(node2, visitor, isExpression)); + pendingExpressions.push(Debug.checkDefined(visitNode(node2, visitor, isExpression))); } } } @@ -94849,7 +98107,7 @@ function transformGenerators(context) { emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); pendingExpressions = []; } - pendingExpressions.push(visitNode(elem, visitor, isExpression)); + pendingExpressions.push(Debug.checkDefined(visitNode(elem, visitor, isExpression))); } } return factory2.inlineExpressions(pendingExpressions); @@ -94859,7 +98117,7 @@ function transformGenerators(context) { const resultLocal = declareLocal(); emitAssignment( resultLocal, - visitNode(node.left, visitor, isExpression), + Debug.checkDefined(visitNode(node.left, visitor, isExpression)), /*location*/ node.left ); @@ -94880,7 +98138,7 @@ function transformGenerators(context) { } emitAssignment( resultLocal, - visitNode(node.right, visitor, isExpression), + Debug.checkDefined(visitNode(node.right, visitor, isExpression)), /*location*/ node.right ); @@ -94894,13 +98152,13 @@ function transformGenerators(context) { const resultLocal = declareLocal(); emitBreakWhenFalse( whenFalseLabel, - visitNode(node.condition, visitor, isExpression), + Debug.checkDefined(visitNode(node.condition, visitor, isExpression)), /*location*/ node.condition ); emitAssignment( resultLocal, - visitNode(node.whenTrue, visitor, isExpression), + Debug.checkDefined(visitNode(node.whenTrue, visitor, isExpression)), /*location*/ node.whenTrue ); @@ -94908,7 +98166,7 @@ function transformGenerators(context) { markLabel(whenFalseLabel); emitAssignment( resultLocal, - visitNode(node.whenFalse, visitor, isExpression), + Debug.checkDefined(visitNode(node.whenFalse, visitor, isExpression)), /*location*/ node.whenFalse ); @@ -94988,7 +98246,7 @@ function transformGenerators(context) { leadingElement = void 0; expressions2 = []; } - expressions2.push(visitNode(element, visitor, isExpression)); + expressions2.push(Debug.checkDefined(visitNode(element, visitor, isExpression))); return expressions2; } } @@ -95027,8 +98285,8 @@ function transformGenerators(context) { if (containsYield(node.argumentExpression)) { return factory2.updateElementAccessExpression( node, - cacheExpression(visitNode(node.expression, visitor, isLeftHandSideExpression)), - visitNode(node.argumentExpression, visitor, isExpression) + cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))), + Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -95045,7 +98303,7 @@ function transformGenerators(context) { return setOriginalNode( setTextRange( factory2.createFunctionApplyCall( - cacheExpression(visitNode(target, visitor, isLeftHandSideExpression)), + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isLeftHandSideExpression))), thisArg, visitElements(node.arguments) ), @@ -95063,7 +98321,7 @@ function transformGenerators(context) { setTextRange( factory2.createNewExpression( factory2.createFunctionApplyCall( - cacheExpression(visitNode(target, visitor, isExpression)), + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isExpression))), thisArg, visitElements( node.arguments, @@ -95179,7 +98437,7 @@ function transformGenerators(context) { return setSourceMapRange( factory2.createAssignment( setSourceMapRange(factory2.cloneNode(node.name), node.name), - visitNode(node.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) ), node ); @@ -95191,7 +98449,7 @@ function transformGenerators(context) { const elseLabel = node.elseStatement ? defineLabel() : void 0; emitBreakWhenFalse( node.elseStatement ? elseLabel : endLabel, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*location*/ node.expression ); @@ -95220,7 +98478,7 @@ function transformGenerators(context) { markLabel(loopLabel); transformAndEmitEmbeddedStatement(node.statement); markLabel(conditionLabel); - emitBreakWhenTrue(loopLabel, visitNode(node.expression, visitor, isExpression)); + emitBreakWhenTrue(loopLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); endLoopBlock(); } else { emitStatement(visitNode(node, visitor, isStatement)); @@ -95241,7 +98499,7 @@ function transformGenerators(context) { const loopLabel = defineLabel(); const endLabel = beginLoopBlock(loopLabel); markLabel(loopLabel); - emitBreakWhenFalse(endLabel, visitNode(node.expression, visitor, isExpression)); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); transformAndEmitEmbeddedStatement(node.statement); emitBreak(loopLabel); endLoopBlock(); @@ -95272,7 +98530,7 @@ function transformGenerators(context) { emitStatement( setTextRange( factory2.createExpressionStatement( - visitNode(initializer, visitor, isExpression) + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) ), initializer ) @@ -95281,7 +98539,7 @@ function transformGenerators(context) { } markLabel(conditionLabel); if (node.condition) { - emitBreakWhenFalse(endLabel, visitNode(node.condition, visitor, isExpression)); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))); } transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); @@ -95289,7 +98547,7 @@ function transformGenerators(context) { emitStatement( setTextRange( factory2.createExpressionStatement( - visitNode(node.incrementor, visitor, isExpression) + Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression)) ), node.incrementor ) @@ -95334,7 +98592,7 @@ function transformGenerators(context) { const keysIndex = factory2.createLoopVariable(); const initializer = node.initializer; hoistVariableDeclaration(keysIndex); - emitAssignment(obj, visitNode(node.expression, visitor, isExpression)); + emitAssignment(obj, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); emitAssignment(keysArray, factory2.createArrayLiteralExpression()); emitStatement( factory2.createForInStatement( @@ -95365,7 +98623,7 @@ function transformGenerators(context) { } variable = factory2.cloneNode(initializer.declarations[0].name); } else { - variable = visitNode(initializer, visitor, isExpression); + variable = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); Debug.assert(isLeftHandSideExpression(variable)); } emitAssignment(variable, key); @@ -95390,8 +98648,8 @@ function transformGenerators(context) { node = factory2.updateForInStatement( node, initializer.declarations[0].name, - visitNode(node.expression, visitor, isExpression), - visitNode(node.statement, visitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) ); } else { node = visitEachChild(node, visitor, context); @@ -95467,7 +98725,7 @@ function transformGenerators(context) { } function transformAndEmitWithStatement(node) { if (containsYield(node)) { - beginWithBlock(cacheExpression(visitNode(node.expression, visitor, isExpression))); + beginWithBlock(cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)))); transformAndEmitEmbeddedStatement(node.statement); endWithBlock(); } else { @@ -95479,7 +98737,7 @@ function transformGenerators(context) { const caseBlock = node.caseBlock; const numClauses = caseBlock.clauses.length; const endLabel = beginSwitchBlock(); - const expression = cacheExpression(visitNode(node.expression, visitor, isExpression)); + const expression = cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); const clauseLabels = []; let defaultClauseIndex = -1; for (let i = 0; i < numClauses; i++) { @@ -95501,7 +98759,7 @@ function transformGenerators(context) { } pendingClauses.push( factory2.createCaseClause( - visitNode(clause.expression, visitor, isExpression), + Debug.checkDefined(visitNode(clause.expression, visitor, isExpression)), [ createInlineBreak( clauseLabels[i], @@ -95571,7 +98829,7 @@ function transformGenerators(context) { function transformAndEmitThrowStatement(node) { var _a2; emitThrow( - visitNode((_a2 = node.expression) != null ? _a2 : factory2.createVoidZero(), visitor, isExpression), + Debug.checkDefined(visitNode((_a2 = node.expression) != null ? _a2 : factory2.createVoidZero(), visitor, isExpression)), /*location*/ node ); @@ -96855,7 +100113,7 @@ function transformModule(context) { } function addExportEqualsIfNeeded(statements, emitAsReturn) { if (currentModuleInfo.exportEquals) { - const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor); + const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor, isExpression); if (expressionResult) { if (emitAsReturn) { const statement = factory2.createReturnStatement(expressionResult); @@ -96895,9 +100153,9 @@ function transformModule(context) { return visitFunctionDeclaration(node); case 260 /* ClassDeclaration */: return visitClassDeclaration(node); - case 357 /* MergeDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 358 /* EndOfDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return visitor(node); @@ -96914,7 +100172,7 @@ function transformModule(context) { return visitExpressionStatement(node); case 214 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); case 210 /* CallExpression */: if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) { @@ -97050,7 +100308,7 @@ function transformModule(context) { } function visitImportCallExpression(node) { const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; const containsLexicalThis = !!(node.transformFlags & 16384 /* ContainsLexicalThis */); switch (compilerOptions.module) { @@ -97259,7 +100517,7 @@ function transformModule(context) { return downleveledImport; } function getHelperExpressionForExport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { return innerExpr; } if (getExportNeedsImportStarHelper(node)) { @@ -97268,7 +100526,7 @@ function transformModule(context) { return innerExpr; } function getHelperExpressionForImport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { return innerExpr; } if (getImportNeedsImportStarHelper(node)) { @@ -97513,7 +100771,7 @@ function transformModule(context) { ) ); } else { - const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default"; + const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default"; const exportedValue = factory2.createPropertyAccessExpression( exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, specifier.propertyName || specifier.name @@ -97579,7 +100837,7 @@ function transformModule(context) { deferredExports[id] = appendExportStatement( deferredExports[id], factory2.createIdentifier("default"), - visitNode(node.expression, visitor), + visitNode(node.expression, visitor, isExpression), /*location*/ node, /*allowComments*/ @@ -97589,7 +100847,7 @@ function transformModule(context) { statements = appendExportStatement( statements, factory2.createIdentifier("default"), - visitNode(node.expression, visitor), + visitNode(node.expression, visitor, isExpression), /*location*/ node, /*allowComments*/ @@ -97617,7 +100875,7 @@ function transformModule(context) { ), /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitEachChild(node.body, visitor, context) @@ -97658,8 +100916,8 @@ function transformModule(context) { ), /*typeParameters*/ void 0, - visitNodes2(node.heritageClauses, visitor), - visitNodes2(node.members, visitor) + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + visitNodes2(node.members, visitor, isClassElement) ), node ), @@ -97689,7 +100947,23 @@ function transformModule(context) { if (!modifiers) { modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); } - variables = append(variables, variable); + if (variable.initializer) { + const updatedVariable = factory2.updateVariableDeclaration( + variable, + variable.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createExportExpression( + variable.name, + visitNode(variable.initializer, visitor, isExpression) + ) + ); + variables = append(variables, updatedVariable); + } else { + variables = append(variables, variable); + } } else if (variable.initializer) { if (!isBindingPattern(variable.name) && (isArrowFunction(variable.initializer) || isFunctionExpression(variable.initializer) || isClassExpression(variable.initializer))) { const expression = factory2.createAssignment( @@ -97707,7 +100981,7 @@ function transformModule(context) { variable.name, variable.exclamationToken, variable.type, - visitNode(variable.initializer, visitor) + visitNode(variable.initializer, visitor, isExpression) ); variables = append(variables, updatedVariable); expressions = append(expressions, expression); @@ -97758,9 +101032,8 @@ function transformModule(context) { function transformInitializedVariable(node) { if (isBindingPattern(node.name)) { return flattenDestructuringAssignment( - visitNode(node, visitor), - /*visitor*/ - void 0, + visitNode(node, visitor, isInitializedVariable), + visitor, context, 0 /* All */, /*needsValue*/ @@ -97777,7 +101050,7 @@ function transformModule(context) { /*location*/ node.name ), - node.initializer ? visitNode(node.initializer, visitor) : factory2.createVoidZero() + node.initializer ? visitNode(node.initializer, visitor, isExpression) : factory2.createVoidZero() ); } } @@ -98047,7 +101320,7 @@ function transformModule(context) { const expression = substituteExpressionIdentifier(node.expression); noSubstitution[getNodeId(expression)] = true; if (!isIdentifier(expression) && !(getEmitFlags(node.expression) & 8192 /* HelperName */)) { - return addEmitFlags( + return addInternalEmitFlags( factory2.updateCallExpression( node, expression, @@ -98055,7 +101328,7 @@ function transformModule(context) { void 0, node.arguments ), - 1073741824 /* IndirectCall */ + 16 /* IndirectCall */ ); } } @@ -98066,7 +101339,7 @@ function transformModule(context) { const tag = substituteExpressionIdentifier(node.tag); noSubstitution[getNodeId(tag)] = true; if (!isIdentifier(tag) && !(getEmitFlags(node.tag) & 8192 /* HelperName */)) { - return addEmitFlags( + return addInternalEmitFlags( factory2.updateTaggedTemplateExpression( node, tag, @@ -98074,7 +101347,7 @@ function transformModule(context) { void 0, node.template ), - 1073741824 /* IndirectCall */ + 16 /* IndirectCall */ ); } } @@ -98088,7 +101361,7 @@ function transformModule(context) { return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); } return node; - } else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { + } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node)); if (exportContainer && exportContainer.kind === 308 /* SourceFile */) { return setTextRange( @@ -98720,7 +101993,7 @@ function transformSystemModule(context) { ), /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -99030,9 +102303,9 @@ function transformSystemModule(context) { return visitCatchClause(node); case 238 /* Block */: return visitBlock(node); - case 357 /* MergeDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 358 /* EndOfDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return visitor(node); @@ -99094,7 +102367,7 @@ function transformSystemModule(context) { } return expressions ? factory2.inlineExpressions(expressions) : factory2.createOmittedExpression(); } else { - return visitNode(node, discardedValueVisitor, isExpression); + return visitNode(node, discardedValueVisitor, isForInitializer); } } function visitDoStatement(node) { @@ -99115,21 +102388,21 @@ function transformSystemModule(context) { return factory2.updateLabeledStatement( node, node.label, - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) ); } function visitWithStatement(node) { return factory2.updateWithStatement( node, visitNode(node.expression, visitor, isExpression), - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) ); } function visitSwitchStatement(node) { return factory2.updateSwitchStatement( node, visitNode(node.expression, visitor, isExpression), - visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock) + Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock)) ); } function visitCaseBlock(node) { @@ -99161,7 +102434,7 @@ function transformSystemModule(context) { node = factory2.updateCatchClause( node, node.variableDeclaration, - visitNode(node.block, topLevelNestedVisitor, isBlock) + Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock)) ); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; @@ -99188,7 +102461,7 @@ function transformSystemModule(context) { return visitExpressionStatement(node); case 214 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); case 223 /* BinaryExpression */: if (isDestructuringAssignment(node)) { @@ -99231,7 +102504,7 @@ function transformSystemModule(context) { } function visitImportCallExpression(node) { const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; return factory2.createCallExpression( factory2.createPropertyAccessExpression( @@ -100352,7 +103625,7 @@ function transformDeclarations(context) { sourceFile, /*bundled*/ true - )) : visitNodes2(sourceFile.statements, visitDeclarationStatements); + )) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); const newFile = factory2.updateSourceFile( sourceFile, [factory2.createModuleDeclaration( @@ -100374,7 +103647,7 @@ function transformDeclarations(context) { return newFile; } needsDeclare = true; - const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements); + const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); return factory2.updateSourceFile( sourceFile, transformAndReplaceLatePaintedStatements(updated2), @@ -100443,7 +103716,7 @@ function transformDeclarations(context) { refs.forEach(referenceVisitor); emittedImports = filter(combinedStatements, isAnyImportSyntax); } else { - const statements = visitNodes2(node.statements, visitDeclarationStatements); + const statements = visitNodes2(node.statements, visitDeclarationStatements, isStatement); combinedStatements = setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements); refs.forEach(referenceVisitor); emittedImports = filter(combinedStatements, isAnyImportSyntax); @@ -100560,9 +103833,9 @@ function transformDeclarations(context) { return name; } else { if (name.kind === 204 /* ArrayBindingPattern */) { - return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement)); + return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement)); } else { - return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement)); + return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement)); } } function visitBindingElement(elem) { @@ -100632,10 +103905,10 @@ function transformDeclarations(context) { } const shouldUseResolverType = node.kind === 166 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { - return visitNode(type, visitDeclarationSubtree); + return visitNode(type, visitDeclarationSubtree, isTypeNode); } if (!getParseTreeNode(node)) { - return type ? visitNode(type, visitDeclarationSubtree) : factory2.createKeywordTypeNode(131 /* AnyKeyword */); + return type ? visitNode(type, visitDeclarationSubtree, isTypeNode) : factory2.createKeywordTypeNode(131 /* AnyKeyword */); } if (node.kind === 175 /* SetAccessor */) { return factory2.createKeywordTypeNode(131 /* AnyKeyword */); @@ -100705,11 +103978,11 @@ function transformDeclarations(context) { } function updateParamsList(node, params, modifierMask) { if (hasEffectiveModifier(node, 8 /* Private */)) { - return void 0; + return factory2.createNodeArray(); } const newParams = map(params, (p) => ensureParameter(p, modifierMask)); if (!newParams) { - return void 0; + return factory2.createNodeArray(); } return factory2.createNodeArray(newParams, params.hasTrailingComma); } @@ -100749,7 +104022,7 @@ function transformDeclarations(context) { return factory2.createNodeArray(newParams || emptyArray); } function ensureTypeParams(node, params) { - return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree); + return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration); } function isEnclosingDeclaration(node) { return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node); @@ -100884,7 +104157,7 @@ function transformDeclarations(context) { needsDeclare = priorNeedsDeclare; lateStatementReplacementMap.set(getOriginalNodeId(i), result); } - return visitNodes2(statements, visitLateVisibilityMarkedStatements); + return visitNodes2(statements, visitLateVisibilityMarkedStatements, isStatement); function visitLateVisibilityMarkedStatements(statement) { if (isLateVisibilityPaintedStatement(statement)) { const key = getOriginalNodeId(statement); @@ -101098,7 +104371,7 @@ function transformDeclarations(context) { input, ensureModifiers(input), updateParamsList(input, input.parameters), - visitNode(input.type, visitDeclarationSubtree) || factory2.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode(131 /* AnyKeyword */) )); } case 257 /* VariableDeclaration */: { @@ -101131,20 +104404,24 @@ function transformDeclarations(context) { return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); } case 191 /* ConditionalType */: { - const checkType = visitNode(input.checkType, visitDeclarationSubtree); - const extendsType = visitNode(input.extendsType, visitDeclarationSubtree); + const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); + const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); const oldEnclosingDecl = enclosingDeclaration; enclosingDeclaration = input.trueType; - const trueType = visitNode(input.trueType, visitDeclarationSubtree); + const trueType = visitNode(input.trueType, visitDeclarationSubtree, isTypeNode); enclosingDeclaration = oldEnclosingDecl; - const falseType = visitNode(input.falseType, visitDeclarationSubtree); + const falseType = visitNode(input.falseType, visitDeclarationSubtree, isTypeNode); + Debug.assert(checkType); + Debug.assert(extendsType); + Debug.assert(trueType); + Debug.assert(falseType); return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } case 181 /* FunctionType */: { - return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree))); + return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); } case 182 /* ConstructorType */: { - return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree))); + return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); } case 202 /* ImportType */: { if (!isLiteralImportTypeNode(input)) @@ -101288,7 +104565,7 @@ function transformDeclarations(context) { ensureModifiers(input), input.name, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), - visitNode(input.type, visitDeclarationSubtree, isTypeNode) + Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) )); needsDeclare = previousNeedsDeclare; return clean2; @@ -101300,7 +104577,7 @@ function transformDeclarations(context) { input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), - visitNodes2(input.members, visitDeclarationSubtree) + visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) )); } case 259 /* FunctionDeclaration */: { @@ -101417,7 +104694,7 @@ function transformDeclarations(context) { const oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; needsScopeFixMarker = false; - const statements = visitNodes2(inner.statements, visitDeclarationStatements); + const statements = visitNodes2(inner.statements, visitDeclarationStatements, isStatement); let lateStatements = transformAndReplaceLatePaintedStatements(statements); if (input.flags & 16777216 /* Ambient */) { needsScopeFixMarker = false; @@ -101426,7 +104703,7 @@ function transformDeclarations(context) { if (needsScopeFixMarker) { lateStatements = factory2.createNodeArray([...lateStatements, createEmptyExports(factory2)]); } else { - lateStatements = visitNodes2(lateStatements, stripExportModifiers); + lateStatements = visitNodes2(lateStatements, stripExportModifiers, isStatement); } } const body = factory2.updateModuleBlock(inner, lateStatements); @@ -101522,7 +104799,7 @@ function transformDeclarations(context) { void 0 ) ] : void 0; - const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree)); + const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement)); const members = factory2.createNodeArray(memberNodes); const extendsClause = getEffectiveBaseTypeNode(input); if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 104 /* NullKeyword */) { @@ -101546,11 +104823,11 @@ function transformDeclarations(context) { if (clause.token === 94 /* ExtendsKeyword */) { const oldDiag2 = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]); - const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree)))); + const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree, isTypeNode)))); getSymbolAccessibilityDiagnostic = oldDiag2; return newClause; } - return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */)), visitDeclarationSubtree)); + return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */)), visitDeclarationSubtree, isExpressionWithTypeArguments)); })); return [statement, cleanup(factory2.updateClassDeclaration( input, @@ -101606,7 +104883,7 @@ function transformDeclarations(context) { function transformVariableStatement(input) { if (!forEach(input.declarationList.declarations, getBindingNameVisible)) return; - const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree); + const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree, isVariableDeclaration); if (!length(nodes)) return; return factory2.updateVariableStatement(input, factory2.createNodeArray(ensureModifiers(input)), factory2.updateVariableDeclarationList(input.declarationList, nodes)); @@ -101697,7 +104974,7 @@ function transformDeclarations(context) { function transformHeritageClauses(nodes) { return factory2.createNodeArray(filter(map(nodes, (clause) => factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => { return isEntityNameExpression(t.expression) || clause.token === 94 /* ExtendsKeyword */ && t.expression.kind === 104 /* NullKeyword */; - })), visitDeclarationSubtree))), (clause) => clause.types && !!clause.types.length)); + })), visitDeclarationSubtree, isExpressionWithTypeArguments))), (clause) => clause.types && !!clause.types.length)); } } function isAlwaysType(node) { @@ -101806,10 +105083,15 @@ function getScriptTransformers(compilerOptions, customTransformers, emitOnly) { return emptyArray; const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); const transformers = []; addRange(transformers, customTransformers && map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(transformTypeScript); - transformers.push(transformLegacyDecorators); + if (compilerOptions.experimentalDecorators) { + transformers.push(transformLegacyDecorators); + } else if (languageVersion < 99 /* ESNext */ || !useDefineForClassFields) { + transformers.push(transformESDecorators); + } transformers.push(transformClassFields); if (getJSXTransformEnabled(compilerOptions)) { transformers.push(transformJsx); @@ -101875,7 +105157,7 @@ function noEmitNotification(hint, node, callback) { } function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { var _a2, _b; - const enabledSyntaxKindFeatures = new Array(360 /* Count */); + const enabledSyntaxKindFeatures = new Array(361 /* Count */); let lexicalEnvironmentVariableDeclarations; let lexicalEnvironmentFunctionDeclarations; let lexicalEnvironmentStatements; @@ -102426,7 +105708,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; const emitterDiagnostics = createDiagnosticCollection(); - const newLine = getNewLineCharacter(compilerOptions, () => host.getNewLine()); + const newLine = getNewLineCharacter(compilerOptions); const writer = createTextWriter(newLine); const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); let bundleBuildInfo; @@ -102926,7 +106208,6 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory), getCompilerOptions: () => config.options, getCurrentDirectory: () => host.getCurrentDirectory(), - getNewLine: () => host.getNewLine(), getSourceFile: returnUndefined, getSourceFileByPath: returnUndefined, getSourceFiles: () => sourceFilesForJsEmit, @@ -103012,6 +106293,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { const bundledHelpers = /* @__PURE__ */ new Map(); let currentSourceFile; let nodeIdToGeneratedName; + let nodeIdToGeneratedPrivateName; let autoGeneratedIdToGeneratedName; let generatedNames; let formattedNameTempFlagsStack; @@ -103308,6 +106590,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function reset() { nodeIdToGeneratedName = []; + nodeIdToGeneratedPrivateName = []; autoGeneratedIdToGeneratedName = []; generatedNames = /* @__PURE__ */ new Set(); formattedNameTempFlagsStack = []; @@ -103359,7 +106642,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node); } function beforeEmitNode(node) { - if (preserveSourceNewlines && getEmitFlags(node) & 268435456 /* IgnoreSourceNewlines */) { + if (preserveSourceNewlines && getInternalEmitFlags(node) & 4 /* IgnoreSourceNewlines */) { preserveSourceNewlines = false; } } @@ -103749,6 +107032,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { case 346 /* JSDocThisTag */: case 347 /* JSDocTypeTag */: case 352 /* JSDocThrowsTag */: + case 353 /* JSDocSatisfiesTag */: return emitJSDocSimpleTypedTag(node); case 348 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); @@ -103756,9 +107040,9 @@ function createPrinter(printerOptions = {}, handlers = {}) { return emitJSDocTypedefTag(node); case 350 /* JSDocSeeTag */: return emitJSDocSeeTag(node); - case 354 /* NotEmittedStatement */: - case 358 /* EndOfDeclarationMarker */: - case 357 /* MergeDeclarationMarker */: + case 355 /* NotEmittedStatement */: + case 359 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return; } if (isExpression(node)) { @@ -103851,24 +107135,26 @@ function createPrinter(printerOptions = {}, handlers = {}) { return emitMetaProperty(node); case 234 /* SyntheticExpression */: return Debug.fail("SyntheticExpression should never be printed."); + case 279 /* MissingDeclaration */: + return; case 281 /* JsxElement */: return emitJsxElement(node); case 282 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); case 285 /* JsxFragment */: return emitJsxFragment(node); - case 353 /* SyntaxList */: + case 354 /* SyntaxList */: return Debug.fail("SyntaxList should not be printed"); - case 354 /* NotEmittedStatement */: + case 355 /* NotEmittedStatement */: return; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return emitCommaList(node); - case 357 /* MergeDeclarationMarker */: - case 358 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return; - case 359 /* SyntheticReferenceExpression */: + case 360 /* SyntheticReferenceExpression */: return Debug.fail("SyntheticReferenceExpression should not be printed"); } } @@ -104041,7 +107327,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { /*includeTrivia*/ false ), node.symbol); - emitList(node, node.typeArguments, 53776 /* TypeParameters */); + emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */); } function emitPrivateIdentifier(node) { write(getTextOfNode2( @@ -104072,7 +107358,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames); } function emitTypeParameter(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emit(node.name); if (node.constraint) { writeSpace(); @@ -104088,7 +107374,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } function emitParameter(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); @@ -104104,14 +107395,19 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); } function emitPropertySignature(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emitNodeWithWriter(node.name, writeProperty); emit(node.questionToken); emitTypeAnnotation(node.type); writeTrailingSemicolon(); } function emitPropertyDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.name); emit(node.questionToken); emit(node.exclamationToken); @@ -104121,7 +107417,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitMethodSignature(node) { pushNameGenerationScope(node); - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emit(node.name); emit(node.questionToken); emitTypeParameters(node, node.typeParameters); @@ -104131,7 +107427,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { popNameGenerationScope(node); } function emitMethodDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.asteriskToken); emit(node.name); emit(node.questionToken); @@ -104142,13 +107443,24 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitBlockFunctionBody(node.body); } function emitConstructor(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); - writeKeyword(node.kind === 174 /* GetAccessor */ ? "get" : "set"); + const pos = emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + const token = node.kind === 174 /* GetAccessor */ ? 137 /* GetKeyword */ : 151 /* SetKeyword */; + emitTokenWithComment(token, pos, writeKeyword, node); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -104172,7 +107484,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { popNameGenerationScope(node); } function emitIndexSignature(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitParametersForIndexSignature(node, node.parameters); emitTypeAnnotation(node.type); writeTrailingSemicolon(); @@ -104231,7 +107548,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitConstructorType(node) { pushNameGenerationScope(node); - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); writeKeyword("new"); writeSpace(); emitTypeParameters(node, node.typeParameters); @@ -104507,7 +107824,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node); } function emitCallExpression(node) { - const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */; + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; if (indirectCall) { writePunctuation("("); writeLiteral("0"); @@ -104530,7 +107847,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); } function emitTaggedTemplateExpression(node) { - const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */; + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; if (indirectCall) { writePunctuation("("); writeLiteral("0"); @@ -104568,7 +107885,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitFunctionDeclarationOrExpression(node); } function emitArrowFunction(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emitSignatureAndBody(node, emitArrowFunctionHead); } function emitArrowFunctionHead(node) { @@ -104834,7 +108151,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { ); } function emitVariableStatement(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emit(node.declarationList); writeTrailingSemicolon(); } @@ -105092,7 +108414,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitFunctionDeclarationOrExpression(node); } function emitFunctionDeclarationOrExpression(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("function"); emit(node.asteriskToken); writeSpace(); @@ -105200,8 +108527,13 @@ function createPrinter(printerOptions = {}, handlers = {}) { void 0 ); forEach(node.members, generateMemberNames); - emitDecoratorsAndModifiers(node, node.modifiers); - writeKeyword("class"); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emitTokenWithComment(84 /* ClassKeyword */, moveRangePastModifiers(node).pos, writeKeyword, node); if (node.name) { writeSpace(); emitIdentifierName(node.name); @@ -105227,7 +108559,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { /*newReservedMemberNames*/ void 0 ); - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("interface"); writeSpace(); emit(node.name); @@ -105240,7 +108577,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { popPrivateNameGenerationScope(); } function emitTypeAliasDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("type"); writeSpace(); emit(node.name); @@ -105252,7 +108594,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { writeTrailingSemicolon(); } function emitEnumDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("enum"); writeSpace(); emit(node.name); @@ -105262,7 +108609,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { writePunctuation("}"); } function emitModuleDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); if (~node.flags & 1024 /* GlobalAugmentation */) { writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); writeSpace(); @@ -105302,7 +108654,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { ); } function emitImportEqualsDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { @@ -105324,7 +108681,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } function emitImportDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.importClause) { @@ -105377,7 +108739,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { writeTrailingSemicolon(); } function emitExportDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); let nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { @@ -106000,23 +109367,27 @@ function createPrinter(printerOptions = {}, handlers = {}) { emit(node); write = savedWrite; } - function emitDecoratorsAndModifiers(node, modifiers) { + function emitDecoratorsAndModifiers(node, modifiers, allowDecorators) { if (modifiers == null ? void 0 : modifiers.length) { if (every(modifiers, isModifier)) { - return emitModifiers(node, modifiers); + return emitModifierList(node, modifiers); } if (every(modifiers, isDecorator)) { - return emitDecorators(node, modifiers); + if (allowDecorators) { + return emitDecoratorList(node, modifiers); + } + return node.pos; } onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); let lastMode; let mode; let start = 0; let pos = 0; + let lastModifier; while (start < modifiers.length) { while (pos < modifiers.length) { - const modifier = modifiers[pos]; - mode = isDecorator(modifier) ? "decorators" : "modifiers"; + lastModifier = modifiers[pos]; + mode = isDecorator(lastModifier) ? "decorators" : "modifiers"; if (lastMode === void 0) { lastMode = mode; } else if (mode !== lastMode) { @@ -106029,28 +109400,36 @@ function createPrinter(printerOptions = {}, handlers = {}) { textRange.pos = modifiers.pos; if (pos === modifiers.length - 1) textRange.end = modifiers.end; - emitNodeListItems( - emit, - node, - modifiers, - lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, - /*parenthesizerRule*/ - void 0, - start, - pos - start, - /*hasTrailingComma*/ - false, - textRange - ); + if (lastMode === "modifiers" || allowDecorators) { + emitNodeListItems( + emit, + node, + modifiers, + lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, + /*parenthesizerRule*/ + void 0, + start, + pos - start, + /*hasTrailingComma*/ + false, + textRange + ); + } start = pos; lastMode = mode; pos++; } onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); + if (lastModifier && !positionIsSynthesized(lastModifier.end)) { + return lastModifier.end; + } } + return node.pos; } - function emitModifiers(node, modifiers) { + function emitModifierList(node, modifiers) { emitList(node, modifiers, 2359808 /* Modifiers */); + const lastModifier = lastOrUndefined(modifiers); + return lastModifier && !positionIsSynthesized(lastModifier.end) ? lastModifier.end : node.pos; } function emitTypeAnnotation(node) { if (node) { @@ -106106,8 +109485,10 @@ function createPrinter(printerOptions = {}, handlers = {}) { decreaseIndent(); } } - function emitDecorators(parentNode, decorators) { + function emitDecoratorList(parentNode, decorators) { emitList(parentNode, decorators, 2146305 /* Decorators */); + const lastDecorator = lastOrUndefined(decorators); + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos; } function emitTypeArguments(parentNode, typeArguments) { emitList(parentNode, typeArguments, 53776 /* TypeArguments */, typeArgumentParenthesizerRuleSelector); @@ -106234,7 +109615,10 @@ function createPrinter(printerOptions = {}, handlers = {}) { writeDelimiter(format); } else if (previousSibling) { if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) { - emitLeadingCommentsOfPosition(previousSibling.end); + const previousSiblingEmitFlags = getEmitFlags(previousSibling); + if (!(previousSiblingEmitFlags & 2048 /* NoTrailingComments */)) { + emitLeadingCommentsOfPosition(previousSibling.end); + } } writeDelimiter(format); recordBundleFileInternalSectionEnd(previousSourceFileTextKind); @@ -106759,16 +110143,18 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } function generateName(name) { - if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { - return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix); + const autoGenerate = name.emitNode.autoGenerate; + if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { + return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix); } else { - const autoGenerateId = name.autoGenerate.id; + const autoGenerateId = autoGenerate.id; return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name)); } } function generateNameCached(node, privateName, flags, prefix, suffix) { const nodeId = getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); + const cache = privateName ? nodeIdToGeneratedPrivateName : nodeIdToGeneratedName; + return cache[nodeId] || (cache[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); } function isUniqueName(name, privateName) { return isFileLevelUniqueName2(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name); @@ -107010,7 +110396,21 @@ function createPrinter(printerOptions = {}, handlers = {}) { Debug.assert(!prefix && !suffix && !privateName); return generateNameForImportOrExportDeclaration(node); case 259 /* FunctionDeclaration */: - case 260 /* ClassDeclaration */: + case 260 /* ClassDeclaration */: { + Debug.assert(!prefix && !suffix && !privateName); + const name = node.name; + if (name && !isGeneratedIdentifier(name)) { + return generateNameForNode( + name, + /*privateName*/ + false, + flags, + prefix, + suffix + ); + } + return generateNameForExportDefault(); + } case 274 /* ExportAssignment */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForExportDefault(); @@ -107042,16 +110442,17 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } function makeName(name) { - const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName); - const suffix = formatGeneratedNamePart(name.autoGenerate.suffix); - switch (name.autoGenerate.flags & 7 /* KindMask */) { + const autoGenerate = name.emitNode.autoGenerate; + const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName); + const suffix = formatGeneratedNamePart(autoGenerate.suffix); + switch (autoGenerate.flags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); case 2 /* Loop */: Debug.assertNode(name, isIdentifier); return makeTempVariableName( TempFlags._i, - !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), /*privateName*/ false, prefix, @@ -107060,16 +110461,16 @@ function createPrinter(printerOptions = {}, handlers = {}) { case 3 /* Unique */: return makeUniqueName( idText(name), - name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, - !!(name.autoGenerate.flags & 16 /* Optimistic */), - !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), + autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, + !!(autoGenerate.flags & 16 /* Optimistic */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix ); } return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum( - name.autoGenerate.flags & 7 /* KindMask */, + autoGenerate.flags & 7 /* KindMask */, GeneratedIdentifierFlags, /*isFlags*/ true @@ -107114,7 +110515,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitLeadingComments( pos, /*isEmittedNode*/ - node.kind !== 354 /* NotEmittedStatement */ + node.kind !== 355 /* NotEmittedStatement */ ); } if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { @@ -107138,7 +110539,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { containerPos = savedContainerPos; containerEnd = savedContainerEnd; declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 354 /* NotEmittedStatement */) { + if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) { emitTrailingComments(end); } } @@ -107410,7 +110811,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } else { const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); } if (emitFlags & 128 /* NoNestedSourceMaps */) { @@ -107425,7 +110826,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { if (emitFlags & 128 /* NoNestedSourceMaps */) { sourceMapsDisabled = false; } - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); } } @@ -108112,7 +111513,7 @@ function createCompilerHostWorker(options, setParentNodes, system = sys) { function getDefaultLibLocation() { return getDirectoryPath(normalizePath(system.getExecutingFilePath())); } - const newLine = getNewLineCharacter(options, () => system.newLine); + const newLine = getNewLineCharacter(options); const realpath = system.realpath && ((path) => system.realpath(path)); const compilerHost = { getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes), @@ -109605,7 +113006,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: () => currentDirectory, - getNewLine: () => host.getNewLine(), getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, @@ -109984,8 +113384,26 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } function walkArray(nodes, parent) { - if (canHaveModifiers(parent) && parent.modifiers === nodes && some(nodes, isDecorator) && !options.experimentalDecorators) { - diagnostics.push(createDiagnosticForNode2(parent, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); + if (canHaveIllegalDecorators(parent)) { + const decorator = find(parent.modifiers, isDecorator); + if (decorator) { + diagnostics.push(createDiagnosticForNode2(decorator, Diagnostics.Decorators_are_not_valid_here)); + } + } else if (canHaveDecorators(parent) && parent.modifiers) { + const decoratorIndex = findIndex(parent.modifiers, isDecorator); + if (decoratorIndex >= 0) { + if (isParameter(parent) && !options.experimentalDecorators) { + diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (isClassDeclaration(parent)) { + const exportIndex = findIndex(parent.modifiers, isExportModifier); + const defaultIndex = findIndex(parent.modifiers, isDefaultModifier); + if (exportIndex >= 0 && decoratorIndex < exportIndex) { + diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files)); + } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } + } + } } switch (parent.kind) { case 260 /* ClassDeclaration */: @@ -110144,7 +113562,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config /*assertClause*/ void 0 ); - addEmitFlags(importDecl, 134217728 /* NeverApplyImportHelper */); + addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */); setParent(externalHelpersModuleReference, importDecl); setParent(importDecl, file); externalHelpersModuleReference.flags &= ~8 /* Synthesized */; @@ -110411,7 +113829,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (filesByName.has(path)) { const file2 = filesByName.get(path); addFileIncludeReason(file2 || void 0, reason); - if (file2 && options.forceConsistentCasingInFileNames) { + if (file2 && !(options.forceConsistentCasingInFileNames === false)) { const checkedName = file2.fileName; const isRedirect = toPath3(checkedName) !== toPath3(fileName); if (isRedirect) { @@ -111010,24 +114428,12 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } const languageVersion = getEmitScriptTarget(options); const firstNonAmbientExternalModuleSourceFile = find(files, (f) => isExternalModule(f) && !f.isDeclarationFile); - if (options.isolatedModules) { - if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */) { + if (options.isolatedModules || options.verbatimModuleSyntax) { + if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */ && options.isolatedModules) { createDiagnosticForOptionName(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"); } if (options.preserveConstEnums === false) { - createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules"); - } - for (const file of files) { - if (!isExternalModule(file) && !isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* JSON */) { - const span = getErrorSpanForNode(file, file); - programDiagnostics.add(createFileDiagnostic( - file, - span.start, - span.length, - Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, - getBaseFileName(file.fileName) - )); - } + createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled, options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", "preserveConstEnums"); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === 0 /* None */) { const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); @@ -111109,10 +114515,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) { - createOptionValueDiagnostic("importsNotUsedAsValues", Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later); + createDiagnosticForOptionName(Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); + } + if (options.verbatimModuleSyntax) { + const moduleKind = getEmitModuleKind(options); + if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { + createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); + } + if (options.isolatedModules) { + createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); + } + if (options.preserveValueImports) { + createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); + } + if (options.importsNotUsedAsValues) { + createRedundantOptionDiagnostic("importsNotUsedAsValues", "verbatimModuleSyntax"); + } } if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) { - createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set); + createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set); } const moduleResolution = getEmitModuleResolutionKind(options); if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { @@ -111158,16 +114579,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } } - function verifyDeprecatedCompilerOptions() { + function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) { const version2 = typeScriptVersion2 || versionMajorMinor; const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) { return; - } else { + } else if (reportInvalidIgnoreDeprecations) { createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); } } + return version2; + } + function verifyDeprecatedCompilerOptions() { + const version2 = getVersionForDeprecationDiagnostics( + /*reportInvalidIgnoreDeprecations*/ + true + ); + if (!version2) + return; if (options.target === 0 /* ES3 */) { createDeprecatedDiagnosticForOption(version2, "target", "ES3"); } @@ -111192,30 +114622,83 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (options.out) { createDeprecatedDiagnosticForOption(version2, "out"); } - } - function createDeprecatedDiagnosticForOption(version2, name, value) { - if (version2 === "6.0" /* v6_0 */) { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnosticForOption( + version2, + "importsNotUsedAsValues", + /*value*/ void 0, - Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, - value || name + "verbatimModuleSyntax" ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ + } + if (options.preserveValueImports) { + createDeprecatedDiagnosticForOption( + version2, + "preserveValueImports", + /*value*/ void 0, - Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, - value || name, - "5.5" /* v5_5 */, - "5.0" /* v5_0 */ + "verbatimModuleSyntax" + ); + } + } + function verifyDeprecatedProjectReference(ref, parentFile, index) { + if (ref.prepend) { + const version2 = getVersionForDeprecationDiagnostics( + /*reportInvalidIgnoreDeprecations*/ + false ); + if (version2) { + createDeprecatedOptionForVersionDiagnostic( + version2, + (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), + "prepend" + ); + } + } + } + function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) { + return createDeprecatedOptionForVersionDiagnostic( + version2, + (message, arg0, arg1, arg2) => { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + chain + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + message, + arg0, + arg1, + arg2 + ); + } + }, + name, + value + ); + } + function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) { + if (version2 === "6.0" /* v6_0 */) { + createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); + } else { + createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); } } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { @@ -111361,6 +114844,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index) => { const ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; const parentFile = parent && parent.sourceFile; + verifyDeprecatedProjectReference(ref, parentFile, index); if (!resolvedRef) { createDiagnosticForReference(parentFile, index, Diagnostics.File_0_not_found, ref.path); return; @@ -111468,22 +114952,26 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config arg1 ); } - function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) { + function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) { const referencesSyntax = firstDefined( getTsConfigPropArray(sourceFile || options.configFile, "references"), (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 ); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); } } function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); if (needCompilerDiagnostic) { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + if ("messageText" in message) { + programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); + } else { + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + } } } function getCompilerOptionsObjectLiteralSyntax() { @@ -111504,10 +114992,32 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + if ("messageText" in message) { + programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); + } else { + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + } } return !!props.length; } + function createRedundantOptionDiagnostic(errorOnOption, redundantWithOption) { + const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + if (compilerOptionsObjectLiteralSyntax) { + createOptionDiagnosticInObjectLiteralSyntax( + compilerOptionsObjectLiteralSyntax, + /*onKey*/ + true, + errorOnOption, + /*key2*/ + void 0, + Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, + errorOnOption, + redundantWithOption + ); + } else { + createDiagnosticForOptionName(Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, errorOnOption, redundantWithOption); + } + } function blockEmittingOfFile(emitFileName, diag2) { hasEmitBlockingDiagnostics.set(toPath3(emitFileName), true); programDiagnostics.add(diag2); @@ -111759,9 +115269,8 @@ function createPrependNodes(projectReferences, getCommandLine, readFile, host) { } return nodes || emptyArray; } -function resolveProjectReferencePath(hostOrRef, ref) { - const passedInRef = ref ? ref : hostOrRef; - return resolveConfigFileProjectName(passedInRef.path); +function resolveProjectReferencePath(ref) { + return resolveConfigFileProjectName(ref.path); } function getResolutionDiagnostic(options, { extension }, { isDeclarationFile }) { switch (extension) { @@ -114341,6 +117850,9 @@ function getFilesInErrorForSummary(diagnostics) { } ); return filesInError.map((fileName) => { + if (fileName === void 0) { + return void 0; + } const diagnosticForFileName = find( diagnostics, (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName @@ -114734,7 +118246,6 @@ function createWatchFactory(host, options) { } function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) { const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); - const hostGetNewLine = memoize(() => host.getNewLine()); const compilerHost = { getSourceFile: createGetSourceFile( (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding), @@ -114752,7 +118263,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt getCurrentDirectory: memoize(() => host.getCurrentDirectory()), useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames), - getNewLine: () => getNewLineCharacter(getCompilerOptions(), hostGetNewLine), + getNewLine: () => getNewLineCharacter(getCompilerOptions()), fileExists: (f) => host.fileExists(f), readFile: (f) => host.readFile(f), trace: maybeBind(host, host.trace), @@ -114838,7 +118349,7 @@ function createWatchCompilerHost(system = sys, createProgram2, reportDiagnostic, copyProperties(result, createWatchHost(system, reportWatchStatus2)); result.afterProgramCreate = (builderProgram) => { const compilerOptions = builderProgram.getCompilerOptions(); - const newLine = getNewLineCharacter(compilerOptions, () => system.newLine); + const newLine = getNewLineCharacter(compilerOptions); emitFilesAndReportErrors( builderProgram, reportDiagnostic, @@ -114984,11 +118495,13 @@ function createWatchProgram(host) { } reportWatchDiagnostic(Diagnostics.Starting_compilation_in_watch_mode); if (configFileName && !host.configFileParsingResult) { - newLine = getNewLineCharacter(optionsToExtendForConfigFile, () => host.getNewLine()); + newLine = getNewLineCharacter(optionsToExtendForConfigFile); Debug.assert(!rootFileNames); parseConfigFile2(); newLine = updateNewLine(); } + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions); const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`); @@ -115091,6 +118604,8 @@ function createWatchProgram(host) { } function synchronizeProgram() { writeLog(`Synchronizing program`); + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); clearInvalidateResolutionsOfFailedLookupLocations(); const program = getCurrentBuilderProgram(); if (hasChangedCompilerOptions) { @@ -115176,7 +118691,7 @@ function createWatchProgram(host) { scheduleProgramUpdate(); } function updateNewLine() { - return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile, () => host.getNewLine()); + return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile); } function toPath3(fileName) { return toPath(fileName, currentDirectory, getCanonicalFileName); @@ -115330,6 +118845,8 @@ function createWatchProgram(host) { } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); + Debug.assert(configFileName); reloadLevel = 0 /* None */; rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { @@ -115338,6 +118855,7 @@ function createWatchProgram(host) { synchronizeProgram(); } function reloadConfigFile() { + Debug.assert(configFileName); writeLog(`Reloading config file: ${configFileName}`); reloadLevel = 0 /* None */; if (cachedDirectoryStructureHost) { @@ -115350,6 +118868,7 @@ function createWatchProgram(host) { updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile); } function parseConfigFile2() { + Debug.assert(configFileName); setConfigFileParsingResult(getParsedCommandLineOfConfigFile( configFileName, optionsToExtendForConfigFile, @@ -115377,6 +118896,7 @@ function createWatchProgram(host) { return config.parsedCommandLine; if (config.parsedCommandLine && config.reloadLevel === 1 /* Partial */ && !host.getParsedCommandLine) { writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); const fileNames = getFileNamesFromConfigSpecs( config.parsedCommandLine.options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName2), currentDirectory), @@ -115468,7 +118988,8 @@ function createWatchProgram(host) { return watchDirectory( directory, (fileOrDirectory) => { - Debug.assert(!!configFileName); + Debug.assert(configFileName); + Debug.assert(compilerOptions); const fileOrDirectoryPath = toPath3(fileOrDirectory); if (cachedDirectoryStructureHost) { cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); @@ -115499,6 +119020,7 @@ function createWatchProgram(host) { ); } function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { + Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, diff --git a/lib/tsserver.js b/lib/tsserver.js index f96b6f32fd07f..ec5cf96a87517 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -97,6 +97,7 @@ __export(server_exports, { InferencePriority: () => InferencePriority, InlayHintKind: () => InlayHintKind, InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, InternalSymbolName: () => InternalSymbolName, InvalidatedProjectKind: () => InvalidatedProjectKind, JsDoc: () => ts_JsDoc_exports, @@ -140,7 +141,7 @@ __export(server_exports, { PollingInterval: () => PollingInterval, PollingWatchKind: () => PollingWatchKind, PragmaKindFlags: () => PragmaKindFlags, - PrivateIdentifierKind: () => PrivateIdentifierKind2, + PrivateIdentifierKind: () => PrivateIdentifierKind, ProcessLevel: () => ProcessLevel, QuotePreference: () => QuotePreference, RelationComparisonResult: () => RelationComparisonResult, @@ -190,10 +191,13 @@ __export(server_exports, { WatchFileKind: () => WatchFileKind, WatchLogLevel: () => WatchLogLevel, WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, addEmitFlags: () => addEmitFlags, addEmitHelper: () => addEmitHelper, addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, addRange: () => addRange, addRelatedInfo: () => addRelatedInfo, addSyntheticLeadingComment: () => addSyntheticLeadingComment, @@ -264,6 +268,7 @@ __export(server_exports, { changesAffectModuleResolution: () => changesAffectModuleResolution, changesAffectingProgramStructure: () => changesAffectingProgramStructure, childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, classPrivateFieldInHelper: () => classPrivateFieldInHelper, @@ -312,6 +317,7 @@ __export(server_exports, { compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, computeLineOfPosition: () => computeLineOfPosition, @@ -329,7 +335,6 @@ __export(server_exports, { containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, - convertEnableAutoDiscoveryToEnable: () => convertEnableAutoDiscoveryToEnable, convertJsonOption: () => convertJsonOption, convertToBase64: () => convertToBase64, convertToObject: () => convertToObject, @@ -350,41 +355,17 @@ __export(server_exports, { createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, - createAdd: () => createAdd, - createArrayBindingPattern: () => createArrayBindingPattern, - createArrayLiteral: () => createArrayLiteral, - createArrayTypeNode: () => createArrayTypeNode, - createArrowFunction: () => createArrowFunction, - createAsExpression: () => createAsExpression, - createAssignment: () => createAssignment, - createAwait: () => createAwait, createBaseNodeFactory: () => createBaseNodeFactory, - createBigIntLiteral: () => createBigIntLiteral, - createBinary: () => createBinary, createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, - createBindingElement: () => createBindingElement, createBindingHelper: () => createBindingHelper, - createBlock: () => createBlock, - createBreak: () => createBreak, createBuildInfo: () => createBuildInfo, createBuilderProgram: () => createBuilderProgram, createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, createBuilderStatusReporter: () => createBuilderStatusReporter, - createBundle: () => createBundle, createCacheWithRedirects: () => createCacheWithRedirects, createCacheableExportInfoMap: () => createCacheableExportInfoMap, createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, - createCall: () => createCall, - createCallChain: () => createCallChain, - createCallSignature: () => createCallSignature, - createCaseBlock: () => createCaseBlock, - createCaseClause: () => createCaseClause, - createCatchClause: () => createCatchClause, - createClassDeclaration: () => createClassDeclaration, - createClassExpression: () => createClassExpression, createClassifier: () => createClassifier, - createComma: () => createComma, - createCommaList: () => createCommaList, createCommentDirectivesMap: () => createCommentDirectivesMap, createCompilerDiagnostic: () => createCompilerDiagnostic, createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, @@ -392,212 +373,73 @@ __export(server_exports, { createCompilerHost: () => createCompilerHost, createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, createCompilerHostWorker: () => createCompilerHostWorker, - createComputedPropertyName: () => createComputedPropertyName, - createConditional: () => createConditional, - createConditionalTypeNode: () => createConditionalTypeNode, - createConstructSignature: () => createConstructSignature, - createConstructor: () => createConstructor, - createConstructorTypeNode: () => createConstructorTypeNode, - createContinue: () => createContinue, - createDebuggerStatement: () => createDebuggerStatement, - createDecorator: () => createDecorator, - createDefaultClause: () => createDefaultClause, - createDelete: () => createDelete, createDetachedDiagnostic: () => createDetachedDiagnostic, createDiagnosticCollection: () => createDiagnosticCollection, createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, createDiagnosticForNode: () => createDiagnosticForNode, createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, createDiagnosticForRange: () => createDiagnosticForRange, createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, createDiagnosticReporter: () => createDiagnosticReporter, - createDo: () => createDo, createDocumentPositionMapper: () => createDocumentPositionMapper, createDocumentRegistry: () => createDocumentRegistry, createDocumentRegistryInternal: () => createDocumentRegistryInternal, - createElementAccess: () => createElementAccess, - createElementAccessChain: () => createElementAccessChain, createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, createEmitHelperFactory: () => createEmitHelperFactory, createEmptyExports: () => createEmptyExports, - createEmptyStatement: () => createEmptyStatement, - createEnumDeclaration: () => createEnumDeclaration, - createEnumMember: () => createEnumMember, - createExportAssignment: () => createExportAssignment2, - createExportDeclaration: () => createExportDeclaration, - createExportDefault: () => createExportDefault, - createExportSpecifier: () => createExportSpecifier, createExpressionForJsxElement: () => createExpressionForJsxElement, createExpressionForJsxFragment: () => createExpressionForJsxFragment, createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, createExpressionForPropertyName: () => createExpressionForPropertyName, createExpressionFromEntityName: () => createExpressionFromEntityName, - createExpressionStatement: () => createExpressionStatement, - createExpressionWithTypeArguments: () => createExpressionWithTypeArguments, createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createExternalModuleExport: () => createExternalModuleExport, - createExternalModuleReference: () => createExternalModuleReference, - createFalse: () => createFalse, createFileDiagnostic: () => createFileDiagnostic, createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createFileLevelUniqueName: () => createFileLevelUniqueName, - createFor: () => createFor, - createForIn: () => createForIn, - createForOf: () => createForOf, createForOfBindingStatement: () => createForOfBindingStatement, - createFunctionDeclaration: () => createFunctionDeclaration, - createFunctionExpression: () => createFunctionExpression, - createFunctionTypeNode: () => createFunctionTypeNode, - createGetAccessor: () => createGetAccessor, createGetCanonicalFileName: () => createGetCanonicalFileName, createGetSourceFile: () => createGetSourceFile, createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, createGetSymbolWalker: () => createGetSymbolWalker, - createHeritageClause: () => createHeritageClause, - createIdentifier: () => createIdentifier, - createIf: () => createIf, - createImmediatelyInvokedArrowFunction: () => createImmediatelyInvokedArrowFunction, - createImmediatelyInvokedFunctionExpression: () => createImmediatelyInvokedFunctionExpression, - createImportClause: () => createImportClause, - createImportDeclaration: () => createImportDeclaration, - createImportEqualsDeclaration: () => createImportEqualsDeclaration, - createImportSpecifier: () => createImportSpecifier, - createImportTypeNode: () => createImportTypeNode, createIncrementalCompilerHost: () => createIncrementalCompilerHost, createIncrementalProgram: () => createIncrementalProgram, - createIndexSignature: () => createIndexSignature, - createIndexedAccessTypeNode: () => createIndexedAccessTypeNode, - createInferTypeNode: () => createInferTypeNode, createInputFiles: () => createInputFiles, createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, - createInterfaceDeclaration: () => createInterfaceDeclaration, - createIntersectionTypeNode: () => createIntersectionTypeNode, - createJSDocAugmentsTag: () => createJSDocAugmentsTag, - createJSDocAuthorTag: () => createJSDocAuthorTag, - createJSDocCallbackTag: () => createJSDocCallbackTag, - createJSDocClassTag: () => createJSDocClassTag, - createJSDocComment: () => createJSDocComment, - createJSDocEnumTag: () => createJSDocEnumTag, - createJSDocImplementsTag: () => createJSDocImplementsTag, - createJSDocParamTag: () => createJSDocParamTag, - createJSDocParameterTag: () => createJSDocParameterTag, - createJSDocPrivateTag: () => createJSDocPrivateTag, - createJSDocPropertyTag: () => createJSDocPropertyTag, - createJSDocProtectedTag: () => createJSDocProtectedTag, - createJSDocPublicTag: () => createJSDocPublicTag, - createJSDocReadonlyTag: () => createJSDocReadonlyTag, - createJSDocReturnTag: () => createJSDocReturnTag, - createJSDocSignature: () => createJSDocSignature, - createJSDocTag: () => createJSDocTag, - createJSDocTemplateTag: () => createJSDocTemplateTag, - createJSDocThisTag: () => createJSDocThisTag, - createJSDocTypeExpression: () => createJSDocTypeExpression, - createJSDocTypeLiteral: () => createJSDocTypeLiteral, - createJSDocTypeTag: () => createJSDocTypeTag, - createJSDocTypedefTag: () => createJSDocTypedefTag, - createJsxAttribute: () => createJsxAttribute, - createJsxAttributes: () => createJsxAttributes, - createJsxClosingElement: () => createJsxClosingElement, - createJsxElement: () => createJsxElement, - createJsxExpression: () => createJsxExpression, createJsxFactoryExpression: () => createJsxFactoryExpression, - createJsxFragment: () => createJsxFragment, - createJsxJsxClosingFragment: () => createJsxJsxClosingFragment, - createJsxOpeningElement: () => createJsxOpeningElement, - createJsxOpeningFragment: () => createJsxOpeningFragment, - createJsxSelfClosingElement: () => createJsxSelfClosingElement, - createJsxSpreadAttribute: () => createJsxSpreadAttribute, - createJsxText: () => createJsxText, - createKeywordTypeNode: () => createKeywordTypeNode, - createLabel: () => createLabel, createLanguageService: () => createLanguageService, createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createLessThan: () => createLessThan, - createLiteral: () => createLiteral, - createLiteralTypeNode: () => createLiteralTypeNode, - createLogicalAnd: () => createLogicalAnd, - createLogicalNot: () => createLogicalNot, - createLogicalOr: () => createLogicalOr, - createLoopVariable: () => createLoopVariable, - createMappedTypeNode: () => createMappedTypeNode, createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createMetaProperty: () => createMetaProperty, - createMethod: () => createMethod, - createMethodSignature: () => createMethodSignature, createModeAwareCache: () => createModeAwareCache, createModeAwareCacheKey: () => createModeAwareCacheKey, - createModifier: () => createModifier, - createModifiersFromModifierFlags: () => createModifiersFromModifierFlags, - createModuleBlock: () => createModuleBlock, - createModuleDeclaration: () => createModuleDeclaration, createModuleResolutionCache: () => createModuleResolutionCache, createModuleResolutionLoader: () => createModuleResolutionLoader, createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, createMultiMap: () => createMultiMap, - createNamedExports: () => createNamedExports, - createNamedImports: () => createNamedImports, - createNamespaceExport: () => createNamespaceExport, - createNamespaceExportDeclaration: () => createNamespaceExportDeclaration, - createNamespaceImport: () => createNamespaceImport, - createNew: () => createNew, - createNoSubstitutionTemplateLiteral: () => createNoSubstitutionTemplateLiteral, - createNode: () => createNode2, - createNodeArray: () => createNodeArray, createNodeConverters: () => createNodeConverters, createNodeFactory: () => createNodeFactory, - createNonNullChain: () => createNonNullChain, - createNonNullExpression: () => createNonNullExpression, - createNotEmittedStatement: () => createNotEmittedStatement, - createNull: () => createNull, - createNumericLiteral: () => createNumericLiteral, - createObjectBindingPattern: () => createObjectBindingPattern, - createObjectLiteral: () => createObjectLiteral, - createOmittedExpression: () => createOmittedExpression, - createOptimisticUniqueName: () => createOptimisticUniqueName, createOptionNameMap: () => createOptionNameMap, - createOptionalTypeNode: () => createOptionalTypeNode, createOverload: () => createOverload, createPackageJsonImportFilter: () => createPackageJsonImportFilter, createPackageJsonInfo: () => createPackageJsonInfo, - createParameter: () => createParameter, - createParen: () => createParen, - createParenthesizedType: () => createParenthesizedType, createParenthesizerRules: () => createParenthesizerRules, - createPartiallyEmittedExpression: () => createPartiallyEmittedExpression, createPatternMatcher: () => createPatternMatcher, - createPostfix: () => createPostfix, - createPostfixIncrement: () => createPostfixIncrement, - createPrefix: () => createPrefix, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, - createPrivateIdentifier: () => createPrivateIdentifier, createProgram: () => createProgram, createProgramHost: () => createProgramHost, - createProperty: () => createProperty, - createPropertyAccess: () => createPropertyAccess, - createPropertyAccessChain: () => createPropertyAccessChain, - createPropertyAssignment: () => createPropertyAssignment, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, - createPropertySignature: () => createPropertySignature, - createQualifiedName: () => createQualifiedName, createQueue: () => createQueue, createRange: () => createRange, createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, - createRegularExpressionLiteral: () => createRegularExpressionLiteral, createResolutionCache: () => createResolutionCache, - createRestTypeNode: () => createRestTypeNode, - createReturn: () => createReturn, createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, createScanner: () => createScanner, createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, - createSemicolonClassElement: () => createSemicolonClassElement, createSet: () => createSet, - createSetAccessor: () => createSetAccessor, - createShorthandPropertyAssignment: () => createShorthandPropertyAssignment, createSolutionBuilder: () => createSolutionBuilder, createSolutionBuilderHost: () => createSolutionBuilderHost, createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, @@ -606,27 +448,10 @@ __export(server_exports, { createSourceFile: () => createSourceFile, createSourceMapGenerator: () => createSourceMapGenerator, createSourceMapSource: () => createSourceMapSource, - createSpread: () => createSpread, - createSpreadAssignment: () => createSpreadAssignment, - createStatement: () => createStatement, - createStrictEquality: () => createStrictEquality, - createStrictInequality: () => createStrictInequality, - createStringLiteral: () => createStringLiteral, - createStringLiteralFromNode: () => createStringLiteralFromNode, - createSubtract: () => createSubtract, - createSuper: () => createSuper, createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, - createSwitch: () => createSwitch, createSymbolTable: () => createSymbolTable, createSymlinkCache: () => createSymlinkCache, createSystemWatchFunctions: () => createSystemWatchFunctions, - createTaggedTemplate: () => createTaggedTemplate, - createTempVariable: () => createTempVariable, - createTemplateExpression: () => createTemplateExpression, - createTemplateHead: () => createTemplateHead, - createTemplateMiddle: () => createTemplateMiddle, - createTemplateSpan: () => createTemplateSpan, - createTemplateTail: () => createTemplateTail, createTextChange: () => createTextChange, createTextChangeFromStartLength: () => createTextChangeFromStartLength, createTextChangeRange: () => createTextChangeRange, @@ -638,36 +463,12 @@ __export(server_exports, { createTextSpanFromRange: () => createTextSpanFromRange, createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, createTextWriter: () => createTextWriter, - createThis: () => createThis, - createThisTypeNode: () => createThisTypeNode, - createThrow: () => createThrow, - createToken: () => createToken, createTokenRange: () => createTokenRange, - createTrue: () => createTrue, - createTry: () => createTry, - createTupleTypeNode: () => createTupleTypeNode, - createTypeAliasDeclaration: () => createTypeAliasDeclaration, - createTypeAssertion: () => createTypeAssertion, createTypeChecker: () => createTypeChecker, - createTypeLiteralNode: () => createTypeLiteralNode, - createTypeOf: () => createTypeOf, - createTypeOperatorNode: () => createTypeOperatorNode, - createTypeParameterDeclaration: () => createTypeParameterDeclaration, - createTypePredicateNode: () => createTypePredicateNode, - createTypePredicateNodeWithModifier: () => createTypePredicateNodeWithModifier, - createTypeQueryNode: () => createTypeQueryNode, createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, - createTypeReferenceNode: () => createTypeReferenceNode, createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap, - createUnionTypeNode: () => createUnionTypeNode, - createUniqueName: () => createUniqueName, createUnparsedSourceFile: () => createUnparsedSourceFile, - createVariableDeclaration: () => createVariableDeclaration, - createVariableDeclarationList: () => createVariableDeclarationList, - createVariableStatement: () => createVariableStatement, - createVoid: () => createVoid, - createVoidZero: () => createVoidZero, createWatchCompilerHost: () => createWatchCompilerHost2, createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, @@ -675,10 +476,7 @@ __export(server_exports, { createWatchHost: () => createWatchHost, createWatchProgram: () => createWatchProgram, createWatchStatusReporter: () => createWatchStatusReporter, - createWhile: () => createWhile, - createWith: () => createWith, createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - createYield: () => createYield, declarationNameToString: () => declarationNameToString, decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, @@ -725,6 +523,7 @@ __export(server_exports, { equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, equateStringsCaseSensitive: () => equateStringsCaseSensitive, equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, escapeJsxAttributeString: () => escapeJsxAttributeString, escapeLeadingUnderscores: () => escapeLeadingUnderscores, escapeNonAsciiString: () => escapeNonAsciiString, @@ -753,6 +552,7 @@ __export(server_exports, { findAncestor: () => findAncestor, findBestPatternMatch: () => findBestPatternMatch, findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, findConfigFile: () => findConfigFile, findContainingList: () => findContainingList, findDiagnosticForNode: () => findDiagnosticForNode, @@ -783,6 +583,7 @@ __export(server_exports, { flatMapIterator: () => flatMapIterator, flatMapToMutable: () => flatMapToMutable, flatten: () => flatten, + flattenCommaList: () => flattenCommaList, flattenDestructuringAssignment: () => flattenDestructuringAssignment, flattenDestructuringBinding: () => flattenDestructuringBinding, flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, @@ -888,6 +689,7 @@ __export(server_exports, { getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, getDecorators: () => getDecorators, getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, getDefaultLibFileName: () => getDefaultLibFileName, getDefaultLibFilePath: () => getDefaultLibFilePath, @@ -959,9 +761,11 @@ __export(server_exports, { getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, getFullWidth: () => getFullWidth, getFunctionFlags: () => getFunctionFlags, - getGeneratedNameForNode: () => getGeneratedNameForNode, getHeritageClause: () => getHeritageClause, getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, @@ -973,7 +777,9 @@ __export(server_exports, { getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, getJSDocAugmentsTag: () => getJSDocAugmentsTag, getJSDocClassTag: () => getJSDocClassTag, getJSDocCommentRanges: () => getJSDocCommentRanges, @@ -997,6 +803,8 @@ __export(server_exports, { getJSDocReturnTag: () => getJSDocReturnTag, getJSDocReturnType: () => getJSDocReturnType, getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, getJSDocTags: () => getJSDocTags, getJSDocTagsNoCache: () => getJSDocTagsNoCache, getJSDocTemplateTag: () => getJSDocTemplateTag, @@ -1051,7 +859,6 @@ __export(server_exports, { getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, - getMutableClone: () => getMutableClone, getNameForExportedSymbol: () => getNameForExportedSymbol, getNameFromIndexInfo: () => getNameFromIndexInfo, getNameFromPropertyName: () => getNameFromPropertyName, @@ -1125,6 +932,7 @@ __export(server_exports, { getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, getPreEmitDiagnostics: () => getPreEmitDiagnostics, getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, getProperties: () => getProperties, getProperty: () => getProperty, getPropertyArrayElementValue: () => getPropertyArrayElementValue, @@ -1250,6 +1058,7 @@ __export(server_exports, { getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, getWatchFactory: () => getWatchFactory, group: () => group, + groupBy: () => groupBy, guessIndentation: () => guessIndentation, handleNoEmitOptions: () => handleNoEmitOptions, hasAbstractModifier: () => hasAbstractModifier, @@ -1295,12 +1104,14 @@ __export(server_exports, { hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, idText: () => idText, identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, identity: () => identity, identitySourceMapConsumer: () => identitySourceMapConsumer, ignoreSourceNewlines: () => ignoreSourceNewlines, ignoredPaths: () => ignoredPaths, importDefaultHelper: () => importDefaultHelper, importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, importStarHelper: () => importStarHelper, indexOfAnyCharCode: () => indexOfAnyCharCode, indexOfNode: () => indexOfNode, @@ -1326,6 +1137,7 @@ __export(server_exports, { isAliasableExpression: () => isAliasableExpression, isAmbientModule: () => isAmbientModule, isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, isAnyDirectorySeparator: () => isAnyDirectorySeparator, isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, isAnyImportOrReExport: () => isAnyImportOrReExport, @@ -1335,6 +1147,7 @@ __export(server_exports, { isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, isArray: () => isArray, isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, isArrayBindingPattern: () => isArrayBindingPattern, isArrayLiteralExpression: () => isArrayLiteralExpression, @@ -1366,7 +1179,9 @@ __export(server_exports, { isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, isBindableStaticNameExpression: () => isBindableStaticNameExpression, isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, isBindingPattern: () => isBindingPattern, isBlock: () => isBlock, @@ -1407,6 +1222,7 @@ __export(server_exports, { isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, isCollapsedRange: () => isCollapsedRange, isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, isCommaListExpression: () => isCommaListExpression, isCommaSequence: () => isCommaSequence, isCommaToken: () => isCommaToken, @@ -1440,6 +1256,7 @@ __export(server_exports, { isDecoratorTarget: () => isDecoratorTarget, isDefaultClause: () => isDefaultClause, isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, isDeleteExpression: () => isDeleteExpression, isDeleteTarget: () => isDeleteTarget, @@ -1463,6 +1280,7 @@ __export(server_exports, { isEmptyBindingPattern: () => isEmptyBindingPattern, isEmptyObjectLiteral: () => isEmptyObjectLiteral, isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, isEndOfDeclarationMarker: () => isEndOfDeclarationMarker, isEntityName: () => isEntityName, isEntityNameExpression: () => isEntityNameExpression, @@ -1479,6 +1297,7 @@ __export(server_exports, { isExportModifier: () => isExportModifier, isExportName: () => isExportName, isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, isExportSpecifier: () => isExportSpecifier, isExportsIdentifier: () => isExportsIdentifier, isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, @@ -1533,7 +1352,6 @@ __export(server_exports, { isIdentifier: () => isIdentifier, isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, isIdentifierName: () => isIdentifierName, - isIdentifierOrPrivateIdentifier: () => isIdentifierOrPrivateIdentifier, isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, isIdentifierPart: () => isIdentifierPart, isIdentifierStart: () => isIdentifierStart, @@ -1573,6 +1391,7 @@ __export(server_exports, { isInferTypeNode: () => isInferTypeNode, isInfinityOrNaNString: () => isInfinityOrNaNString, isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, isInsideJsxElement: () => isInsideJsxElement, isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, isInsideNodeModules: () => isInsideNodeModules, @@ -1622,6 +1441,8 @@ __export(server_exports, { isJSDocPublicTag: () => isJSDocPublicTag, isJSDocReadonlyTag: () => isJSDocReadonlyTag, isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, isJSDocSeeTag: () => isJSDocSeeTag, isJSDocSignature: () => isJSDocSignature, isJSDocTag: () => isJSDocTag, @@ -1677,11 +1498,14 @@ __export(server_exports, { isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, isLiteralTypeNode: () => isLiteralTypeNode, isLocalName: () => isLocalName, isLogicalOperator: () => isLogicalOperator, isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, isMappedTypeNode: () => isMappedTypeNode, isMemberName: () => isMemberName, isMergeDeclarationMarker: () => isMergeDeclarationMarker, @@ -1709,6 +1533,8 @@ __export(server_exports, { isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, isNamedClassElement: () => isNamedClassElement, isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, isNamedExportBindings: () => isNamedExportBindings, isNamedExports: () => isNamedExports, isNamedImportBindings: () => isNamedImportBindings, @@ -1733,6 +1559,7 @@ __export(server_exports, { isNodeModulesDirectory: () => isNodeModulesDirectory, isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, isNonGlobalDeclaration: () => isNonGlobalDeclaration, isNonNullAccess: () => isNonNullAccess, @@ -1801,6 +1628,7 @@ __export(server_exports, { isPropertyName: () => isPropertyName, isPropertyNameLiteral: () => isPropertyNameLiteral, isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, isPrototypeAccess: () => isPrototypeAccess, isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, isPunctuation: () => isPunctuation, @@ -1912,7 +1740,6 @@ __export(server_exports, { isTupleTypeNode: () => isTupleTypeNode, isTypeAlias: () => isTypeAlias, isTypeAliasDeclaration: () => isTypeAliasDeclaration, - isTypeAssertion: () => isTypeAssertion, isTypeAssertionExpression: () => isTypeAssertionExpression, isTypeDeclaration: () => isTypeDeclaration, isTypeElement: () => isTypeElement, @@ -1922,8 +1749,9 @@ __export(server_exports, { isTypeLiteralNode: () => isTypeLiteralNode, isTypeNode: () => isTypeNode, isTypeNodeKind: () => isTypeNodeKind, - isTypeNodeOrTypeParameterDeclaration: () => isTypeNodeOrTypeParameterDeclaration, isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, isTypeOperatorNode: () => isTypeOperatorNode, isTypeParameterDeclaration: () => isTypeParameterDeclaration, @@ -1998,6 +1826,7 @@ __export(server_exports, { maybeBind: () => maybeBind, maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, memoize: () => memoize, + memoizeCached: () => memoizeCached, memoizeOne: () => memoizeOne, memoizeWeak: () => memoizeWeak, metadataHelper: () => metadataHelper, @@ -2023,6 +1852,7 @@ __export(server_exports, { mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, noTransformers: () => noTransformers, @@ -2116,6 +1946,7 @@ __export(server_exports, { programContainsEsModules: () => programContainsEsModules, programContainsModules: () => programContainsModules, projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, propertyNamePart: () => propertyNamePart, pseudoBigIntToString: () => pseudoBigIntToString, punctuationPart: () => punctuationPart, @@ -2180,10 +2011,12 @@ __export(server_exports, { returnTrue: () => returnTrue, returnUndefined: () => returnUndefined, returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, sameFlatMap: () => sameFlatMap, sameMap: () => sameMap, sameMapping: () => sameMapping, scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, scanner: () => scanner, screenStartingMessageCodes: () => screenStartingMessageCodes, semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, @@ -2195,7 +2028,12 @@ __export(server_exports, { setConstantValue: () => setConstantValue, setEachParent: () => setEachParent, setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, setModuleDefaultHelper: () => setModuleDefaultHelper, setNodeFlags: () => setNodeFlags, @@ -2203,6 +2041,7 @@ __export(server_exports, { setOriginalNode: () => setOriginalNode, setParent: () => setParent, setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, setResolvedModule: () => setResolvedModule, setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective, setSnippetElement: () => setSnippetElement, @@ -2243,6 +2082,7 @@ __export(server_exports, { skipTrivia: () => skipTrivia, skipTypeChecking: () => skipTypeChecking, skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, sliceAfter: () => sliceAfter, some: () => some, sort: () => sort, @@ -2337,6 +2177,7 @@ __export(server_exports, { transformES2020: () => transformES2020, transformES2021: () => transformES2021, transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, transformESNext: () => transformESNext, transformGenerators: () => transformGenerators, transformJsx: () => transformJsx, @@ -2363,6 +2204,7 @@ __export(server_exports, { tryGetDirectories: () => tryGetDirectories, tryGetExtensionFromPath: () => tryGetExtensionFromPath2, tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, @@ -2397,148 +2239,14 @@ __export(server_exports, { unreachableCodeIsError: () => unreachableCodeIsError, unusedLabelIsError: () => unusedLabelIsError, unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, - updateArrayBindingPattern: () => updateArrayBindingPattern, - updateArrayLiteral: () => updateArrayLiteral, - updateArrayTypeNode: () => updateArrayTypeNode, - updateArrowFunction: () => updateArrowFunction, - updateAsExpression: () => updateAsExpression, - updateAwait: () => updateAwait, - updateBinary: () => updateBinary, - updateBindingElement: () => updateBindingElement, - updateBlock: () => updateBlock, - updateBreak: () => updateBreak, - updateBundle: () => updateBundle, - updateCall: () => updateCall, - updateCallChain: () => updateCallChain, - updateCallSignature: () => updateCallSignature, - updateCaseBlock: () => updateCaseBlock, - updateCaseClause: () => updateCaseClause, - updateCatchClause: () => updateCatchClause, - updateClassDeclaration: () => updateClassDeclaration, - updateClassExpression: () => updateClassExpression, - updateCommaList: () => updateCommaList, - updateComputedPropertyName: () => updateComputedPropertyName, - updateConditional: () => updateConditional, - updateConditionalTypeNode: () => updateConditionalTypeNode, - updateConstructSignature: () => updateConstructSignature, - updateConstructor: () => updateConstructor, - updateConstructorTypeNode: () => updateConstructorTypeNode, - updateContinue: () => updateContinue, - updateDecorator: () => updateDecorator, - updateDefaultClause: () => updateDefaultClause, - updateDelete: () => updateDelete, - updateDo: () => updateDo, - updateElementAccess: () => updateElementAccess, - updateElementAccessChain: () => updateElementAccessChain, - updateEnumDeclaration: () => updateEnumDeclaration, - updateEnumMember: () => updateEnumMember, updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, - updateExportAssignment: () => updateExportAssignment, - updateExportDeclaration: () => updateExportDeclaration, - updateExportSpecifier: () => updateExportSpecifier, - updateExpressionStatement: () => updateExpressionStatement, - updateExpressionWithTypeArguments: () => updateExpressionWithTypeArguments, - updateExternalModuleReference: () => updateExternalModuleReference, - updateFor: () => updateFor, - updateForIn: () => updateForIn, - updateForOf: () => updateForOf, - updateFunctionDeclaration: () => updateFunctionDeclaration, - updateFunctionExpression: () => updateFunctionExpression, - updateFunctionTypeNode: () => updateFunctionTypeNode, - updateGetAccessor: () => updateGetAccessor, - updateHeritageClause: () => updateHeritageClause, - updateIf: () => updateIf, - updateImportClause: () => updateImportClause, - updateImportDeclaration: () => updateImportDeclaration, - updateImportEqualsDeclaration: () => updateImportEqualsDeclaration, - updateImportSpecifier: () => updateImportSpecifier, - updateImportTypeNode: () => updateImportTypeNode, - updateIndexSignature: () => updateIndexSignature, - updateIndexedAccessTypeNode: () => updateIndexedAccessTypeNode, - updateInferTypeNode: () => updateInferTypeNode, - updateInterfaceDeclaration: () => updateInterfaceDeclaration, - updateIntersectionTypeNode: () => updateIntersectionTypeNode, - updateJsxAttribute: () => updateJsxAttribute, - updateJsxAttributes: () => updateJsxAttributes, - updateJsxClosingElement: () => updateJsxClosingElement, - updateJsxElement: () => updateJsxElement, - updateJsxExpression: () => updateJsxExpression, - updateJsxFragment: () => updateJsxFragment, - updateJsxOpeningElement: () => updateJsxOpeningElement, - updateJsxSelfClosingElement: () => updateJsxSelfClosingElement, - updateJsxSpreadAttribute: () => updateJsxSpreadAttribute, - updateJsxText: () => updateJsxText, - updateLabel: () => updateLabel, updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, - updateLiteralTypeNode: () => updateLiteralTypeNode, - updateMappedTypeNode: () => updateMappedTypeNode, - updateMetaProperty: () => updateMetaProperty, - updateMethod: () => updateMethod, - updateMethodSignature: () => updateMethodSignature, updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updateModuleBlock: () => updateModuleBlock, - updateModuleDeclaration: () => updateModuleDeclaration, - updateNamedExports: () => updateNamedExports, - updateNamedImports: () => updateNamedImports, - updateNamespaceExport: () => updateNamespaceExport, - updateNamespaceExportDeclaration: () => updateNamespaceExportDeclaration, - updateNamespaceImport: () => updateNamespaceImport, - updateNew: () => updateNew, - updateNonNullChain: () => updateNonNullChain, - updateNonNullExpression: () => updateNonNullExpression, - updateObjectBindingPattern: () => updateObjectBindingPattern, - updateObjectLiteral: () => updateObjectLiteral, - updateOptionalTypeNode: () => updateOptionalTypeNode, updatePackageJsonWatch: () => updatePackageJsonWatch, - updateParameter: () => updateParameter, - updateParen: () => updateParen, - updateParenthesizedType: () => updateParenthesizedType, - updatePartiallyEmittedExpression: () => updatePartiallyEmittedExpression, - updatePostfix: () => updatePostfix, - updatePrefix: () => updatePrefix, - updateProperty: () => updateProperty, - updatePropertyAccess: () => updatePropertyAccess, - updatePropertyAccessChain: () => updatePropertyAccessChain, - updatePropertyAssignment: () => updatePropertyAssignment, - updatePropertySignature: () => updatePropertySignature, - updateQualifiedName: () => updateQualifiedName, updateResolutionField: () => updateResolutionField, - updateRestTypeNode: () => updateRestTypeNode, - updateReturn: () => updateReturn, - updateSetAccessor: () => updateSetAccessor, updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, - updateShorthandPropertyAssignment: () => updateShorthandPropertyAssignment, updateSourceFile: () => updateSourceFile, - updateSourceFileNode: () => updateSourceFileNode, - updateSpread: () => updateSpread, - updateSpreadAssignment: () => updateSpreadAssignment, - updateStatement: () => updateStatement, - updateSwitch: () => updateSwitch, - updateTaggedTemplate: () => updateTaggedTemplate, - updateTemplateExpression: () => updateTemplateExpression, - updateTemplateSpan: () => updateTemplateSpan, - updateThrow: () => updateThrow, - updateTry: () => updateTry, - updateTupleTypeNode: () => updateTupleTypeNode, - updateTypeAliasDeclaration: () => updateTypeAliasDeclaration, - updateTypeAssertion: () => updateTypeAssertion, - updateTypeLiteralNode: () => updateTypeLiteralNode, - updateTypeOf: () => updateTypeOf, - updateTypeOperatorNode: () => updateTypeOperatorNode, - updateTypeParameterDeclaration: () => updateTypeParameterDeclaration, - updateTypePredicateNode: () => updateTypePredicateNode, - updateTypePredicateNodeWithModifier: () => updateTypePredicateNodeWithModifier, - updateTypeQueryNode: () => updateTypeQueryNode, - updateTypeReferenceNode: () => updateTypeReferenceNode, - updateUnionTypeNode: () => updateUnionTypeNode, - updateVariableDeclaration: () => updateVariableDeclaration, - updateVariableDeclarationList: () => updateVariableDeclarationList, - updateVariableStatement: () => updateVariableStatement, - updateVoid: () => updateVoid, updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, - updateWhile: () => updateWhile, - updateWith: () => updateWith, - updateYield: () => updateYield, usesExtensionsOnImports: () => usesExtensionsOnImports, usingSingleLineStringWriter: () => usingSingleLineStringWriter, utf16EncodeAsString: () => utf16EncodeAsString, @@ -2547,6 +2255,7 @@ __export(server_exports, { version: () => version, versionMajorMinor: () => versionMajorMinor, visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, visitEachChild: () => visitEachChild, visitFunctionBody: () => visitFunctionBody, visitIterationBody: () => visitIterationBody, @@ -2555,6 +2264,8 @@ __export(server_exports, { visitNodes: () => visitNodes2, visitParameterList: () => visitParameterList, walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, @@ -2662,7 +2373,7 @@ __export(ts_server_exports3, { // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.0-dev.20230112`; +var version = `${versionMajorMinor}.0-beta`; var Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -3218,25 +2929,20 @@ var SortKind = /* @__PURE__ */ ((SortKind2) => { SortKind2[SortKind2["Both"] = 3] = "Both"; return SortKind2; })(SortKind || {}); -function detectSortCaseSensitivity(array, useEslintOrdering, getString) { +function detectSortCaseSensitivity(array, getString, compareStringsCaseSensitive2, compareStringsCaseInsensitive2) { let kind = 3 /* Both */; if (array.length < 2) return kind; - const caseSensitiveComparer = getString ? (a, b) => compareStringsCaseSensitive(getString(a), getString(b)) : compareStringsCaseSensitive; - const compareCaseInsensitive = useEslintOrdering ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseInsensitive; - const caseInsensitiveComparer = getString ? (a, b) => compareCaseInsensitive(getString(a), getString(b)) : compareCaseInsensitive; - for (let i = 1, len = array.length; i < len; i++) { - const prevElement = array[i - 1]; - const element = array[i]; - if (kind & 1 /* CaseSensitive */ && caseSensitiveComparer(prevElement, element) === 1 /* GreaterThan */) { + let prevElement = getString(array[0]); + for (let i = 1, len = array.length; i < len && kind !== 0 /* None */; i++) { + const element = getString(array[i]); + if (kind & 1 /* CaseSensitive */ && compareStringsCaseSensitive2(prevElement, element) > 0) { kind &= ~1 /* CaseSensitive */; } - if (kind & 2 /* CaseInsensitive */ && caseInsensitiveComparer(prevElement, element) === 1 /* GreaterThan */) { + if (kind & 2 /* CaseInsensitive */ && compareStringsCaseInsensitive2(prevElement, element) > 0) { kind &= ~2 /* CaseInsensitive */; } - if (kind === 0 /* None */) { - return kind; - } + prevElement = element; } return kind; } @@ -3581,6 +3287,18 @@ function arrayToMultiMap(values, makeKey, makeValue = identity) { function group(values, getGroupId, resultSelector = identity) { return arrayFrom(arrayToMultiMap(values, getGroupId).values(), resultSelector); } +function groupBy(values, keySelector) { + var _a2; + const result = {}; + if (values) { + for (const value of values) { + const key = `${keySelector(value)}`; + const array = (_a2 = result[key]) != null ? _a2 : result[key] = []; + array.push(value); + } + } + return result; +} function clone(object) { const result = {}; for (const id in object) { @@ -3872,6 +3590,35 @@ function memoizeWeak(callback) { return value; }; } +function memoizeCached(callback, cache) { + return (...args) => { + let value = cache.get(args); + if (value === void 0 && !cache.has(args)) { + value = callback(...args); + cache.set(args, value); + } + return value; + }; +} +function compose(a, b, c, d, e) { + if (!!e) { + const args = []; + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + return (t) => reduceLeft(args, (u, f) => f(u), t); + } else if (d) { + return (t) => d(c(b(a(t)))); + } else if (c) { + return (t) => c(b(a(t))); + } else if (b) { + return (t) => b(a(t)); + } else if (a) { + return (t) => a(t); + } else { + return (t) => t; + } +} var AssertionLevel = /* @__PURE__ */ ((AssertionLevel2) => { AssertionLevel2[AssertionLevel2["None"] = 0] = "None"; AssertionLevel2[AssertionLevel2["Normal"] = 1] = "Normal"; @@ -4272,12 +4019,24 @@ function padRight(s, length2, padString = " ") { return length2 <= s.length ? s : s + padString.repeat(length2 - s.length); } function takeWhile(array, predicate) { - const len = array.length; - let index = 0; - while (index < len && predicate(array[index])) { - index++; + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(0, index); + } +} +function skipWhile(array, predicate) { + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(index); } - return array.slice(0, index); } var trimString = !!String.prototype.trim ? (s) => s.trim() : (s) => trimStringEnd(trimStringStart(s)); var trimStringEnd = !!String.prototype.trimEnd ? (s) => s.trimEnd() : trimEndImpl; @@ -6462,14 +6221,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 350] = "JSDocSeeTag"; SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 351] = "JSDocPropertyTag"; SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 352] = "JSDocThrowsTag"; - SyntaxKind5[SyntaxKind5["SyntaxList"] = 353] = "SyntaxList"; - SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 354] = "NotEmittedStatement"; - SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression"; - SyntaxKind5[SyntaxKind5["CommaListExpression"] = 356] = "CommaListExpression"; - SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 357] = "MergeDeclarationMarker"; - SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 358] = "EndOfDeclarationMarker"; - SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 359] = "SyntheticReferenceExpression"; - SyntaxKind5[SyntaxKind5["Count"] = 360] = "Count"; + SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag"; + SyntaxKind5[SyntaxKind5["SyntaxList"] = 354] = "SyntaxList"; + SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 355] = "NotEmittedStatement"; + SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression"; + SyntaxKind5[SyntaxKind5["CommaListExpression"] = 357] = "CommaListExpression"; + SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker"; + SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker"; + SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression"; + SyntaxKind5[SyntaxKind5["Count"] = 361] = "Count"; SyntaxKind5[SyntaxKind5["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment"; SyntaxKind5[SyntaxKind5["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment"; SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment"; @@ -6498,51 +6258,53 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { SyntaxKind5[SyntaxKind5["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement"; SyntaxKind5[SyntaxKind5["FirstNode"] = 163 /* QualifiedName */] = "FirstNode"; SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocNode"; + SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocNode"; SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocTagNode"; + SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocTagNode"; SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword"; SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword"; return SyntaxKind5; })(SyntaxKind || {}); -var NodeFlags = /* @__PURE__ */ ((NodeFlags4) => { - NodeFlags4[NodeFlags4["None"] = 0] = "None"; - NodeFlags4[NodeFlags4["Let"] = 1] = "Let"; - NodeFlags4[NodeFlags4["Const"] = 2] = "Const"; - NodeFlags4[NodeFlags4["NestedNamespace"] = 4] = "NestedNamespace"; - NodeFlags4[NodeFlags4["Synthesized"] = 8] = "Synthesized"; - NodeFlags4[NodeFlags4["Namespace"] = 16] = "Namespace"; - NodeFlags4[NodeFlags4["OptionalChain"] = 32] = "OptionalChain"; - NodeFlags4[NodeFlags4["ExportContext"] = 64] = "ExportContext"; - NodeFlags4[NodeFlags4["ContainsThis"] = 128] = "ContainsThis"; - NodeFlags4[NodeFlags4["HasImplicitReturn"] = 256] = "HasImplicitReturn"; - NodeFlags4[NodeFlags4["HasExplicitReturn"] = 512] = "HasExplicitReturn"; - NodeFlags4[NodeFlags4["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; - NodeFlags4[NodeFlags4["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; - NodeFlags4[NodeFlags4["DisallowInContext"] = 4096] = "DisallowInContext"; - NodeFlags4[NodeFlags4["YieldContext"] = 8192] = "YieldContext"; - NodeFlags4[NodeFlags4["DecoratorContext"] = 16384] = "DecoratorContext"; - NodeFlags4[NodeFlags4["AwaitContext"] = 32768] = "AwaitContext"; - NodeFlags4[NodeFlags4["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; - NodeFlags4[NodeFlags4["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; - NodeFlags4[NodeFlags4["JavaScriptFile"] = 262144] = "JavaScriptFile"; - NodeFlags4[NodeFlags4["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; - NodeFlags4[NodeFlags4["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; - NodeFlags4[NodeFlags4["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; - NodeFlags4[NodeFlags4["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; - NodeFlags4[NodeFlags4["JSDoc"] = 8388608] = "JSDoc"; - NodeFlags4[NodeFlags4["Ambient"] = 16777216] = "Ambient"; - NodeFlags4[NodeFlags4["InWithStatement"] = 33554432] = "InWithStatement"; - NodeFlags4[NodeFlags4["JsonFile"] = 67108864] = "JsonFile"; - NodeFlags4[NodeFlags4["TypeCached"] = 134217728] = "TypeCached"; - NodeFlags4[NodeFlags4["Deprecated"] = 268435456] = "Deprecated"; - NodeFlags4[NodeFlags4["BlockScoped"] = 3] = "BlockScoped"; - NodeFlags4[NodeFlags4["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; - NodeFlags4[NodeFlags4["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; - NodeFlags4[NodeFlags4["ContextFlags"] = 50720768] = "ContextFlags"; - NodeFlags4[NodeFlags4["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; - NodeFlags4[NodeFlags4["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; - return NodeFlags4; +var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { + NodeFlags3[NodeFlags3["None"] = 0] = "None"; + NodeFlags3[NodeFlags3["Let"] = 1] = "Let"; + NodeFlags3[NodeFlags3["Const"] = 2] = "Const"; + NodeFlags3[NodeFlags3["NestedNamespace"] = 4] = "NestedNamespace"; + NodeFlags3[NodeFlags3["Synthesized"] = 8] = "Synthesized"; + NodeFlags3[NodeFlags3["Namespace"] = 16] = "Namespace"; + NodeFlags3[NodeFlags3["OptionalChain"] = 32] = "OptionalChain"; + NodeFlags3[NodeFlags3["ExportContext"] = 64] = "ExportContext"; + NodeFlags3[NodeFlags3["ContainsThis"] = 128] = "ContainsThis"; + NodeFlags3[NodeFlags3["HasImplicitReturn"] = 256] = "HasImplicitReturn"; + NodeFlags3[NodeFlags3["HasExplicitReturn"] = 512] = "HasExplicitReturn"; + NodeFlags3[NodeFlags3["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; + NodeFlags3[NodeFlags3["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; + NodeFlags3[NodeFlags3["DisallowInContext"] = 4096] = "DisallowInContext"; + NodeFlags3[NodeFlags3["YieldContext"] = 8192] = "YieldContext"; + NodeFlags3[NodeFlags3["DecoratorContext"] = 16384] = "DecoratorContext"; + NodeFlags3[NodeFlags3["AwaitContext"] = 32768] = "AwaitContext"; + NodeFlags3[NodeFlags3["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; + NodeFlags3[NodeFlags3["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; + NodeFlags3[NodeFlags3["JavaScriptFile"] = 262144] = "JavaScriptFile"; + NodeFlags3[NodeFlags3["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags3[NodeFlags3["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; + NodeFlags3[NodeFlags3["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; + NodeFlags3[NodeFlags3["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; + NodeFlags3[NodeFlags3["JSDoc"] = 8388608] = "JSDoc"; + NodeFlags3[NodeFlags3["Ambient"] = 16777216] = "Ambient"; + NodeFlags3[NodeFlags3["InWithStatement"] = 33554432] = "InWithStatement"; + NodeFlags3[NodeFlags3["JsonFile"] = 67108864] = "JsonFile"; + NodeFlags3[NodeFlags3["TypeCached"] = 134217728] = "TypeCached"; + NodeFlags3[NodeFlags3["Deprecated"] = 268435456] = "Deprecated"; + NodeFlags3[NodeFlags3["BlockScoped"] = 3] = "BlockScoped"; + NodeFlags3[NodeFlags3["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; + NodeFlags3[NodeFlags3["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; + NodeFlags3[NodeFlags3["ContextFlags"] = 50720768] = "ContextFlags"; + NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; + NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; + NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape"; + NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace"; + return NodeFlags3; })(NodeFlags || {}); var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { ModifierFlags3[ModifierFlags3["None"] = 0] = "None"; @@ -6682,7 +6444,6 @@ var ExitStatus = /* @__PURE__ */ ((ExitStatus2) => { ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; ExitStatus2[ExitStatus2["InvalidProject_OutputsSkipped"] = 3] = "InvalidProject_OutputsSkipped"; ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkipped"] = 4] = "ProjectReferenceCycle_OutputsSkipped"; - ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkupped"] = 4] = "ProjectReferenceCycle_OutputsSkupped"; return ExitStatus2; })(ExitStatus || {}); var MemberOverrideStatus = /* @__PURE__ */ ((MemberOverrideStatus2) => { @@ -6727,7 +6488,6 @@ var NodeBuilderFlags = /* @__PURE__ */ ((NodeBuilderFlags2) => { NodeBuilderFlags2[NodeBuilderFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; NodeBuilderFlags2[NodeBuilderFlags2["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifiedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifiedNameInPlaceOfIdentifier"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifedNameInPlaceOfIdentifier"] = 65536 /* AllowQualifiedNameInPlaceOfIdentifier */] = "AllowQualifedNameInPlaceOfIdentifier"; NodeBuilderFlags2[NodeBuilderFlags2["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; @@ -6765,7 +6525,6 @@ var TypeFormatFlags = /* @__PURE__ */ ((TypeFormatFlags2) => { TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType"; TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; - TypeFormatFlags2[TypeFormatFlags2["WriteOwnNameForAnyLike"] = 0] = "WriteOwnNameForAnyLike"; TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330091] = "NodeBuilderFlagsMask"; return TypeFormatFlags2; })(TypeFormatFlags || {}); @@ -7561,18 +7320,24 @@ var EmitFlags = /* @__PURE__ */ ((EmitFlags3) => { EmitFlags3[EmitFlags3["HasEndOfDeclarationMarker"] = 8388608] = "HasEndOfDeclarationMarker"; EmitFlags3[EmitFlags3["Iterator"] = 16777216] = "Iterator"; EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 33554432] = "NoAsciiEscaping"; - EmitFlags3[EmitFlags3["TypeScriptClassWrapper"] = 67108864] = "TypeScriptClassWrapper"; - EmitFlags3[EmitFlags3["NeverApplyImportHelper"] = 134217728] = "NeverApplyImportHelper"; - EmitFlags3[EmitFlags3["IgnoreSourceNewlines"] = 268435456] = "IgnoreSourceNewlines"; - EmitFlags3[EmitFlags3["Immutable"] = 536870912] = "Immutable"; - EmitFlags3[EmitFlags3["IndirectCall"] = 1073741824] = "IndirectCall"; return EmitFlags3; })(EmitFlags || {}); +var InternalEmitFlags = /* @__PURE__ */ ((InternalEmitFlags3) => { + InternalEmitFlags3[InternalEmitFlags3["None"] = 0] = "None"; + InternalEmitFlags3[InternalEmitFlags3["TypeScriptClassWrapper"] = 1] = "TypeScriptClassWrapper"; + InternalEmitFlags3[InternalEmitFlags3["NeverApplyImportHelper"] = 2] = "NeverApplyImportHelper"; + InternalEmitFlags3[InternalEmitFlags3["IgnoreSourceNewlines"] = 4] = "IgnoreSourceNewlines"; + InternalEmitFlags3[InternalEmitFlags3["Immutable"] = 8] = "Immutable"; + InternalEmitFlags3[InternalEmitFlags3["IndirectCall"] = 16] = "IndirectCall"; + InternalEmitFlags3[InternalEmitFlags3["TransformPrivateStaticElements"] = 32] = "TransformPrivateStaticElements"; + return InternalEmitFlags3; +})(InternalEmitFlags || {}); var ExternalEmitHelpers = /* @__PURE__ */ ((ExternalEmitHelpers2) => { ExternalEmitHelpers2[ExternalEmitHelpers2["Extends"] = 1] = "Extends"; ExternalEmitHelpers2[ExternalEmitHelpers2["Assign"] = 2] = "Assign"; ExternalEmitHelpers2[ExternalEmitHelpers2["Rest"] = 4] = "Rest"; ExternalEmitHelpers2[ExternalEmitHelpers2["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ESDecorateAndRunInitializers"] = 8 /* Decorate */] = "ESDecorateAndRunInitializers"; ExternalEmitHelpers2[ExternalEmitHelpers2["Metadata"] = 16] = "Metadata"; ExternalEmitHelpers2[ExternalEmitHelpers2["Param"] = 32] = "Param"; ExternalEmitHelpers2[ExternalEmitHelpers2["Awaiter"] = 64] = "Awaiter"; @@ -7592,8 +7357,10 @@ var ExternalEmitHelpers = /* @__PURE__ */ ((ExternalEmitHelpers2) => { ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldSet"] = 1048576] = "ClassPrivateFieldSet"; ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldIn"] = 2097152] = "ClassPrivateFieldIn"; ExternalEmitHelpers2[ExternalEmitHelpers2["CreateBinding"] = 4194304] = "CreateBinding"; + ExternalEmitHelpers2[ExternalEmitHelpers2["SetFunctionName"] = 8388608] = "SetFunctionName"; + ExternalEmitHelpers2[ExternalEmitHelpers2["PropKey"] = 16777216] = "PropKey"; ExternalEmitHelpers2[ExternalEmitHelpers2["FirstEmitHelper"] = 1 /* Extends */] = "FirstEmitHelper"; - ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 4194304 /* CreateBinding */] = "LastEmitHelper"; + ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 16777216 /* PropKey */] = "LastEmitHelper"; ExternalEmitHelpers2[ExternalEmitHelpers2["ForOfIncludes"] = 256 /* Values */] = "ForOfIncludes"; ExternalEmitHelpers2[ExternalEmitHelpers2["ForAwaitOfIncludes"] = 16384 /* AsyncValues */] = "ForAwaitOfIncludes"; ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; @@ -9721,10 +9488,9 @@ var Diagnostics = { Line_terminator_not_permitted_before_arrow: diag(1200, 1 /* Error */, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, 1 /* Error */, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, 1 /* Error */, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), - Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), + Re_exporting_a_type_when_0_is_enabled_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205", "Re-exporting a type when '{0}' is enabled requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, 1 /* Error */, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, 1 /* Error */, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, 1 /* Error */, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, 1 /* Error */, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, 1 /* Error */, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, 1 /* Error */, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), @@ -9734,7 +9500,6 @@ var Diagnostics = { Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, 1 /* Error */, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, 1 /* Error */, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, 1 /* Error */, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, 1 /* Error */, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."), Generators_are_not_allowed_in_an_ambient_context: diag(1221, 1 /* Error */, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, 1 /* Error */, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), _0_tag_already_specified: diag(1223, 1 /* Error */, "_0_tag_already_specified_1223", "'{0}' tag already specified."), @@ -9781,7 +9546,7 @@ var Diagnostics = { An_optional_element_cannot_follow_a_rest_element: diag(1266, 1 /* Error */, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, 1 /* Error */, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, 1 /* Error */, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), - Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."), + Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269", "Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."), Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, 1 /* Error */, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, 1 /* Error */, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, 1 /* Error */, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), @@ -9790,6 +9555,17 @@ var Diagnostics = { accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1 /* Error */, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), An_accessor_property_cannot_be_declared_optional: diag(1276, 1 /* Error */, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), _0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: diag(1277, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0: diag(1278, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278", "The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0: diag(1279, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279", "The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."), + Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement: diag(1280, 1 /* Error */, "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280", "Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."), + Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead: diag(1281, 1 /* Error */, "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281", "Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."), + An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1282, 1 /* Error */, "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282", "An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), @@ -9861,7 +9637,6 @@ var Diagnostics = { An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), - Only_named_exports_may_use_export_type: diag(1383, 1 /* Error */, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."), Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), @@ -9909,7 +9684,7 @@ var Diagnostics = { The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."), - Decorators_may_not_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."), + Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."), Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, 1 /* Error */, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), @@ -9922,7 +9697,7 @@ var Diagnostics = { Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, 1 /* Error */, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), - _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."), Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"), Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"), @@ -9950,6 +9725,8 @@ var Diagnostics = { To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), + _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -10407,7 +10184,7 @@ var Diagnostics = { This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1 /* Error */, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), - Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), + Cannot_access_ambient_const_enums_when_0_is_enabled: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."), _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1 /* Error */, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, 1 /* Error */, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), @@ -10655,12 +10432,12 @@ var Diagnostics = { The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, 1 /* Error */, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, 1 /* Error */, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, 1 /* Error */, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), - Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."), + Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."), The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), - Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_eithe_5096", "Option 'allowImportingTsExtensions' can only be used when 'moduleResolution' is set to 'bundler' and either 'noEmit' or 'emitDeclarationOnly' is set."), + Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), @@ -10668,6 +10445,9 @@ var Diagnostics = { Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), + Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), + Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), + Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -10950,6 +10730,8 @@ var Diagnostics = { package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."), + Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."), + There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`), Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), @@ -11074,7 +10856,7 @@ var Diagnostics = { Filters_results_from_the_include_option: diag(6627, 3 /* Message */, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), Remove_a_list_of_directories_from_the_watch_process: diag(6628, 3 /* Message */, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, 3 /* Message */, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), - Enable_experimental_support_for_TC39_stage_2_draft_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630", "Enable experimental support for TC39 stage 2 draft decorators."), + Enable_experimental_support_for_legacy_experimental_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_legacy_experimental_decorators_6630", "Enable experimental support for legacy experimental decorators."), Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, 3 /* Message */, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), Output_more_detailed_compiler_performance_information_after_building: diag(6632, 3 /* Message */, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, 3 /* Message */, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), @@ -11160,6 +10942,7 @@ var Diagnostics = { Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), + Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."), one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"), one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"), type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"), @@ -11295,6 +11078,7 @@ var Diagnostics = { You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), + Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -11580,7 +11364,8 @@ var Diagnostics = { _0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), _0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), - The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here.") + The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."), + Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.") }; // src/compiler/scanner.ts @@ -12191,10 +11976,7 @@ function reduceEachTrailingCommentRange(text, pos, cb, state, initial) { initial ); } -function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) { - if (!comments) { - comments = []; - } +function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments = []) { comments.push({ kind, pos, end, hasTrailingNewLine }); return comments; } @@ -13872,7 +13654,7 @@ function getTypeParameterOwner(d) { } } function isParameterPropertyDeclaration(node, parent2) { - return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 173 /* Constructor */; + return isParameter(node) && hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 173 /* Constructor */; } function isEmptyBindingPattern(node) { if (isBindingPattern(node)) { @@ -13977,7 +13759,10 @@ function getOriginalNode(node, nodeTest) { node = node.original; } } - return !nodeTest || nodeTest(node) ? node : void 0; + if (!node || !nodeTest) { + return node; + } + return nodeTest(node) ? node : void 0; } function findAncestor(node, callback) { while (node) { @@ -14016,6 +13801,10 @@ function unescapeLeadingUnderscores(identifier) { function idText(identifierOrPrivateName) { return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); } +function identifierToKeywordKind(node) { + const token = stringToToken(node.escapedText); + return token ? tryCast(token, isKeyword) : void 0; +} function symbolName(symbol) { if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { return idText(symbol.valueDeclaration.name); @@ -14291,6 +14080,9 @@ function getJSDocReturnTag(node) { function getJSDocTemplateTag(node) { return getFirstJSDocTag(node, isJSDocTemplateTag); } +function getJSDocSatisfiesTag(node) { + return getFirstJSDocTag(node, isJSDocSatisfiesTag); +} function getJSDocTypeTag(node) { const tag = getFirstJSDocTag(node, isJSDocTypeTag); if (tag && tag.typeExpression && tag.typeExpression.type) { @@ -14323,15 +14115,17 @@ function getJSDocReturnType(node) { } } function getJSDocTagsWorker(node, noCache) { + var _a2, _b; if (!canHaveJSDoc(node)) return emptyArray; - let tags = node.jsDocCache; + let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache; if (tags === void 0 || noCache) { const comments = getJSDocCommentsAndTags(node, noCache); Debug.assert(comments.length < 2 || comments[0] !== comments[1]); tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j); if (!noCache) { - node.jsDocCache = tags; + (_b = node.jsDoc) != null ? _b : node.jsDoc = []; + node.jsDoc.jsDocCache = tags; } } return tags; @@ -14509,19 +14303,31 @@ function isTemplateMiddleOrTemplateTail(node) { function isImportOrExportSpecifier(node) { return isImportSpecifier(node) || isExportSpecifier(node); } -function isTypeOnlyImportOrExportDeclaration(node) { +function isTypeOnlyImportDeclaration(node) { switch (node.kind) { case 273 /* ImportSpecifier */: - case 278 /* ExportSpecifier */: return node.isTypeOnly || node.parent.parent.isTypeOnly; case 271 /* NamespaceImport */: return node.parent.isTypeOnly; case 270 /* ImportClause */: case 268 /* ImportEqualsDeclaration */: return node.isTypeOnly; - default: - return false; } + return false; +} +function isTypeOnlyExportDeclaration(node) { + switch (node.kind) { + case 278 /* ExportSpecifier */: + return node.isTypeOnly || node.parent.parent.isTypeOnly; + case 275 /* ExportDeclaration */: + return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; + case 277 /* NamespaceExport */: + return node.parent.isTypeOnly; + } + return false; +} +function isTypeOnlyImportOrExportDeclaration(node) { + return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node); } function isAssertionKey(node) { return isStringLiteral(node) || isIdentifier(node); @@ -14530,10 +14336,12 @@ function isStringTextContainingNode(node) { return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } function isGeneratedIdentifier(node) { - return isIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isGeneratedPrivateIdentifier(node) { - return isPrivateIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isPrivateIdentifierClassElementDeclaration(node) { return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name); @@ -14710,6 +14518,9 @@ function isDeclarationBindingElement(bindingElement) { } return false; } +function isBindingOrAssignmentElement(node) { + return isVariableDeclaration(node) || isParameter(node) || isObjectBindingOrAssignmentElement(node) || isArrayBindingOrAssignmentElement(node); +} function isBindingOrAssignmentPattern(node) { return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); } @@ -14739,6 +14550,24 @@ function isArrayBindingOrAssignmentPattern(node) { } return false; } +function isArrayBindingOrAssignmentElement(node) { + switch (node.kind) { + case 205 /* BindingElement */: + case 229 /* OmittedExpression */: + case 227 /* SpreadElement */: + case 206 /* ArrayLiteralExpression */: + case 207 /* ObjectLiteralExpression */: + case 79 /* Identifier */: + case 208 /* PropertyAccessExpression */: + case 209 /* ElementAccessExpression */: + return true; + } + return isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ); +} function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { const kind = node.kind; return kind === 208 /* PropertyAccessExpression */ || kind === 163 /* QualifiedName */ || kind === 202 /* ImportType */; @@ -14802,6 +14631,7 @@ function isLeftHandSideExpressionKind(kind) { case 230 /* ExpressionWithTypeArguments */: case 233 /* MetaProperty */: case 100 /* ImportKeyword */: + case 279 /* MissingDeclaration */: return true; default: return false; @@ -14834,6 +14664,17 @@ function isUnaryExpressionWithWrite(expr) { return false; } } +function isLiteralTypeLiteral(node) { + switch (node.kind) { + case 104 /* NullKeyword */: + case 110 /* TrueKeyword */: + case 95 /* FalseKeyword */: + case 221 /* PrefixUnaryExpression */: + return true; + default: + return isLiteralExpression(node); + } +} function isExpression(node) { return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); } @@ -14846,8 +14687,8 @@ function isExpressionKind(kind) { case 227 /* SpreadElement */: case 231 /* AsExpression */: case 229 /* OmittedExpression */: - case 356 /* CommaListExpression */: - case 355 /* PartiallyEmittedExpression */: + case 357 /* CommaListExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: return true; default: @@ -15032,7 +14873,7 @@ function isDeclarationStatementKind(kind) { return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 354 /* NotEmittedStatement */ || kind === 358 /* EndOfDeclarationMarker */ || kind === 357 /* MergeDeclarationMarker */; + return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 355 /* NotEmittedStatement */ || kind === 359 /* EndOfDeclarationMarker */ || kind === 358 /* MergeDeclarationMarker */; } function isDeclaration(node) { if (node.kind === 165 /* TypeParameter */) { @@ -15093,13 +14934,13 @@ function isCaseOrDefaultClause(node) { return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */; } function isJSDocNode(node) { - return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */; + return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */; } function isJSDocCommentContainingNode(node) { return node.kind === 323 /* JSDoc */ || node.kind === 322 /* JSDocNamepathType */ || node.kind === 324 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } function isJSDocTag(node) { - return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 352 /* LastJSDocTagNode */; + return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */; } function isSetAccessor(node) { return node.kind === 175 /* SetAccessor */; @@ -15515,7 +15356,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (includeJsDoc && hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 353 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return skipTrivia( @@ -15567,6 +15408,10 @@ function getEmitFlags(node) { const emitNode = node.emitNode; return emitNode && emitNode.flags || 0; } +function getInternalEmitFlags(node) { + const emitNode = node.emitNode; + return emitNode && emitNode.internalFlags || 0; +} function getScriptTargetFeatures() { return { es2015: { @@ -15824,6 +15669,7 @@ function isBlockScope(node, parentNode) { return false; } function isDeclarationWithTypeParameters(node) { + Debug.type(node); switch (node.kind) { case 341 /* JSDocCallbackTag */: case 349 /* JSDocTypedefTag */: @@ -15835,6 +15681,7 @@ function isDeclarationWithTypeParameters(node) { } } function isDeclarationWithTypeParameterChildren(node) { + Debug.type(node); switch (node.kind) { case 176 /* CallSignature */: case 177 /* ConstructSignature */: @@ -15915,10 +15762,11 @@ function isComputedNonLiteralName(name) { return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } function tryGetTextOfPropertyName(name) { + var _a2; switch (name.kind) { case 79 /* Identifier */: case 80 /* PrivateIdentifier */: - return name.autoGenerate ? void 0 : name.escapedText; + return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: @@ -15967,11 +15815,14 @@ function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, ar const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); } -function createDiagnosticForNodeFromMessageChain(node, messageChain, relatedInformation) { - const sourceFile = getSourceFileOfNode(node); +function createDiagnosticForNodeFromMessageChain(sourceFile, node, messageChain, relatedInformation) { const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation); } +function createDiagnosticForNodeArrayFromMessageChain(sourceFile, nodes, messageChain, relatedInformation) { + const start2 = skipTrivia(sourceFile.text, nodes.pos); + return createFileDiagnosticFromMessageChain(sourceFile, start2, nodes.end - start2, messageChain, relatedInformation); +} function assertDiagnosticLocation(file, start2, length2) { Debug.assertGreaterThanOrEqual(start2, 0); Debug.assertGreaterThanOrEqual(length2, 0); @@ -16036,6 +15887,20 @@ function getSpanOfTokenAtPosition(sourceFile, pos) { const start2 = scanner2.getTokenPos(); return createTextSpanFromBounds(start2, scanner2.getTextPos()); } +function scanTokenAtPosition(sourceFile, pos) { + const scanner2 = createScanner( + sourceFile.languageVersion, + /*skipTrivia*/ + true, + sourceFile.languageVariant, + sourceFile.text, + /*onError:*/ + void 0, + pos + ); + scanner2.scan(); + return scanner2.getToken(); +} function getErrorSpanForArrowFunction(sourceFile, node) { const pos = skipTrivia(sourceFile.text, node.pos); if (node.body && node.body.kind === 238 /* Block */) { @@ -16628,47 +16493,90 @@ function getInvokedExpression(node) { return node.expression; } } -function nodeCanBeDecorated(node, parent2, grandparent) { - if (isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { +function nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent) { + if (useLegacyDecorators && isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { return false; } switch (node.kind) { case 260 /* ClassDeclaration */: return true; + case 228 /* ClassExpression */: + return !useLegacyDecorators; case 169 /* PropertyDeclaration */: - return parent2.kind === 260 /* ClassDeclaration */; + return parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); case 174 /* GetAccessor */: case 175 /* SetAccessor */: case 171 /* MethodDeclaration */: - return node.body !== void 0 && parent2.kind === 260 /* ClassDeclaration */; + return node.body !== void 0 && parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2)); case 166 /* Parameter */: - return parent2.body !== void 0 && (parent2.kind === 173 /* Constructor */ || parent2.kind === 171 /* MethodDeclaration */ || parent2.kind === 175 /* SetAccessor */) && grandparent.kind === 260 /* ClassDeclaration */; + if (!useLegacyDecorators) + return false; + return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 173 /* Constructor */ || parent2.kind === 171 /* MethodDeclaration */ || parent2.kind === 175 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 260 /* ClassDeclaration */; } return false; } -function nodeIsDecorated(node, parent2, grandparent) { - return hasDecorators(node) && nodeCanBeDecorated(node, parent2, grandparent); +function nodeIsDecorated(useLegacyDecorators, node, parent2, grandparent) { + return hasDecorators(node) && nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent); } -function nodeOrChildIsDecorated(node, parent2, grandparent) { - return nodeIsDecorated(node, parent2, grandparent) || childIsDecorated(node, parent2); +function nodeOrChildIsDecorated(useLegacyDecorators, node, parent2, grandparent) { + return nodeIsDecorated(useLegacyDecorators, node, parent2, grandparent) || childIsDecorated(useLegacyDecorators, node, parent2); } -function childIsDecorated(node, parent2) { +function childIsDecorated(useLegacyDecorators, node, parent2) { switch (node.kind) { case 260 /* ClassDeclaration */: - return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2)); + return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); + case 228 /* ClassExpression */: + return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); case 171 /* MethodDeclaration */: case 175 /* SetAccessor */: case 173 /* Constructor */: - return some(node.parameters, (p) => nodeIsDecorated(p, node, parent2)); + return some(node.parameters, (p) => nodeIsDecorated(useLegacyDecorators, p, node, parent2)); default: return false; } } -function classOrConstructorParameterIsDecorated(node) { - if (nodeIsDecorated(node)) +function classOrConstructorParameterIsDecorated(useLegacyDecorators, node) { + if (nodeIsDecorated(useLegacyDecorators, node)) return true; const constructor = getFirstConstructorWithBody(node); - return !!constructor && childIsDecorated(constructor, node); + return !!constructor && childIsDecorated(useLegacyDecorators, constructor, node); +} +function classElementOrClassElementParameterIsDecorated(useLegacyDecorators, node, parent2) { + let parameters; + if (isAccessor(node)) { + const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(parent2.members, node); + const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0; + if (!firstAccessorWithDecorators || node !== firstAccessorWithDecorators) { + return false; + } + parameters = setAccessor == null ? void 0 : setAccessor.parameters; + } else if (isMethodDeclaration(node)) { + parameters = node.parameters; + } + if (nodeIsDecorated(useLegacyDecorators, node, parent2)) { + return true; + } + if (parameters) { + for (const parameter of parameters) { + if (parameterIsThisKeyword(parameter)) + continue; + if (nodeIsDecorated(useLegacyDecorators, parameter, node, parent2)) + return true; + } + } + return false; +} +function isEmptyStringLiteral(node) { + if (node.textSourceNode) { + switch (node.textSourceNode.kind) { + case 10 /* StringLiteral */: + return isEmptyStringLiteral(node.textSourceNode); + case 14 /* NoSubstitutionTemplateLiteral */: + return node.text === ""; + } + return false; + } + return node.text === ""; } function isJSXTagName(node) { const { parent: parent2 } = node; @@ -16865,6 +16773,9 @@ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) { true ); } +function isBindingElementOfBareOrAccessedRequire(node) { + return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); +} function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) { return isVariableDeclaration(node) && !!node.initializer && isRequireCall( allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, @@ -17109,7 +17020,7 @@ function isSpecialPropertyDeclaration(expr) { } function setValueDeclaration(symbol, node) { const { valueDeclaration } = symbol; - if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { + if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !isInJSFile(node) && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { symbol.valueDeclaration = node; } } @@ -17124,6 +17035,7 @@ function tryGetModuleSpecifierFromDeclaration(node) { var _a2, _b; switch (node.kind) { case 257 /* VariableDeclaration */: + case 205 /* BindingElement */: return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall( node2, /*requireStringLiteralLikeArgument*/ @@ -17133,6 +17045,14 @@ function tryGetModuleSpecifierFromDeclaration(node) { return tryCast(node.moduleSpecifier, isStringLiteralLike); case 268 /* ImportEqualsDeclaration */: return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); + case 270 /* ImportClause */: + case 277 /* NamespaceExport */: + return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); + case 271 /* NamespaceImport */: + case 278 /* ExportSpecifier */: + return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); + case 273 /* ImportSpecifier */: + return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); default: Debug.assertNever(node); } @@ -17378,7 +17298,7 @@ function filterOwnedJSDocTags(hostNode, jsDoc) { return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0; } function ownsJSDocTag(hostNode, tag) { - return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; + return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; } function getNextJSDocCommentLocation(node) { const parent2 = node.parent; @@ -17728,7 +17648,8 @@ function isStringAKeyword(name) { const token = stringToToken(name); return token !== void 0 && isKeyword(token); } -function isIdentifierANonContextualKeyword({ originalKeywordKind }) { +function isIdentifierANonContextualKeyword(node) { + const originalKeywordKind = identifierToKeywordKind(node); return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind); } function isTrivia(token) { @@ -17847,6 +17768,72 @@ function isPrivateIdentifierSymbol(symbol) { function isESSymbolIdentifier(node) { return node.kind === 79 /* Identifier */ && node.escapedText === "Symbol"; } +function isProtoSetter(node) { + return isIdentifier(node) ? idText(node) === "__proto__" : isStringLiteral(node) && node.text === "__proto__"; +} +function isAnonymousFunctionDefinition(node, cb) { + node = skipOuterExpressions(node); + switch (node.kind) { + case 228 /* ClassExpression */: + case 215 /* FunctionExpression */: + if (node.name) { + return false; + } + break; + case 216 /* ArrowFunction */: + break; + default: + return false; + } + return typeof cb === "function" ? cb(node) : true; +} +function isNamedEvaluationSource(node) { + switch (node.kind) { + case 299 /* PropertyAssignment */: + return !isProtoSetter(node.name); + case 300 /* ShorthandPropertyAssignment */: + return !!node.objectAssignmentInitializer; + case 257 /* VariableDeclaration */: + return isIdentifier(node.name) && !!node.initializer; + case 166 /* Parameter */: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 205 /* BindingElement */: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 169 /* PropertyDeclaration */: + return !!node.initializer; + case 223 /* BinaryExpression */: + switch (node.operatorToken.kind) { + case 63 /* EqualsToken */: + case 76 /* AmpersandAmpersandEqualsToken */: + case 75 /* BarBarEqualsToken */: + case 77 /* QuestionQuestionEqualsToken */: + return isIdentifier(node.left); + } + break; + case 274 /* ExportAssignment */: + return true; + } + return false; +} +function isNamedEvaluation(node, cb) { + if (!isNamedEvaluationSource(node)) + return false; + switch (node.kind) { + case 299 /* PropertyAssignment */: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 300 /* ShorthandPropertyAssignment */: + return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); + case 257 /* VariableDeclaration */: + case 166 /* Parameter */: + case 205 /* BindingElement */: + case 169 /* PropertyDeclaration */: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 223 /* BinaryExpression */: + return isAnonymousFunctionDefinition(node.right, cb); + case 274 /* ExportAssignment */: + return isAnonymousFunctionDefinition(node.expression, cb); + } +} function isPushOrUnshiftIdentifier(node) { return node.escapedText === "push" || node.escapedText === "unshift"; } @@ -17960,7 +17947,7 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => { })(OperatorPrecedence || {}); function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return 0 /* Comma */; case 227 /* SpreadElement */: return 1 /* Spread */; @@ -18600,7 +18587,7 @@ function isThisInTypeQuery(node) { return node.parent.kind === 183 /* TypeQuery */; } function identifierIsThisKeyword(id) { - return id.originalKeywordKind === 108 /* ThisKeyword */; + return id.escapedText === "this"; } function getAllAccessorDeclarations(declarations, accessor) { let firstAccessor; @@ -18911,7 +18898,7 @@ function getEffectiveModifierFlagsNoCache(node) { } function getSyntacticModifierFlagsNoCache(node) { let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */; - if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) { + if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { flags |= 1 /* Export */; } return flags; @@ -18962,14 +18949,23 @@ function modifierToFlag(token) { } return 0 /* None */; } +function isBinaryLogicalOperator(token) { + return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */; +} function isLogicalOperator(token) { - return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */ || token === 53 /* ExclamationToken */; + return isBinaryLogicalOperator(token) || token === 53 /* ExclamationToken */; } function isLogicalOrCoalescingAssignmentOperator(token) { return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */; } function isLogicalOrCoalescingAssignmentExpression(expr) { - return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); + return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); +} +function isLogicalOrCoalescingBinaryOperator(token) { + return isBinaryLogicalOperator(token) || token === 60 /* QuestionQuestionToken */; +} +function isLogicalOrCoalescingBinaryExpression(expr) { + return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind); } function isAssignmentOperator(token) { return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */; @@ -19209,14 +19205,14 @@ function directoryProbablyExists(directoryName, host) { } var carriageReturnLineFeed = "\r\n"; var lineFeed = "\n"; -function getNewLineCharacter(options, getNewLine) { +function getNewLineCharacter(options) { switch (options.newLine) { case 0 /* CarriageReturnLineFeed */: return carriageReturnLineFeed; case 1 /* LineFeed */: + case void 0: return lineFeed; } - return getNewLine ? getNewLine() : sys ? sys.newLine : carriageReturnLineFeed; } function createRange(pos, end = pos) { Debug.assert(end >= pos || end === -1); @@ -19233,6 +19229,9 @@ function moveRangePastDecorators(node) { return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; } function moveRangePastModifiers(node) { + if (isPropertyDeclaration(node) || isMethodDeclaration(node)) { + return moveRangePos(node, node.name.pos); + } const lastModifier = canHaveModifiers(node) ? lastOrUndefined(node.modifiers) : void 0; return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); } @@ -19346,7 +19345,7 @@ function getInitializedVariables(node) { return filter(node.declarations, isInitializedVariable); } function isInitializedVariable(node) { - return node.initializer !== void 0; + return isVariableDeclaration(node) && node.initializer !== void 0; } function isWatchSet(options) { return options.watch && hasProperty(options, "watch"); @@ -19533,7 +19532,7 @@ function isObjectTypeDeclaration(node) { return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node); } function isTypeNodeKind(kind) { - return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; + return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 139 /* IntrinsicKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; } function isAccessExpression(node) { return node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */; @@ -19615,7 +19614,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) { case 209 /* ElementAccessExpression */: case 208 /* PropertyAccessExpression */: case 232 /* NonNullExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: node = node.expression; continue; @@ -19683,7 +19682,6 @@ function Identifier2(kind, pos, end) { this.parent = void 0; this.original = void 0; this.emitNode = void 0; - this.flowNode = void 0; } function SourceMapSource(fileName, text, skipTrivia2) { this.fileName = fileName; @@ -19701,8 +19699,14 @@ var objectAllocator = { getSignatureConstructor: () => Signature2, getSourceMapSourceConstructor: () => SourceMapSource }; +var objectAllocatorPatchers = []; +function addObjectAllocatorPatcher(fn) { + objectAllocatorPatchers.push(fn); + fn(objectAllocator); +} function setObjectAllocator(alloc) { Object.assign(objectAllocator, alloc); + forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator)); } function formatStringFromArgs(text, args, baseIndex = 0) { return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index + baseIndex])); @@ -19989,6 +19993,12 @@ function hasJsonModuleEmitEnabled(options) { return false; } } +function getIsolatedModules(options) { + return !!(options.isolatedModules || options.verbatimModuleSyntax); +} +function importNameElisionDisabled(options) { + return options.verbatimModuleSyntax || options.isolatedModules && options.preserveValueImports; +} function unreachableCodeIsError(options) { return options.allowUnreachableCode === false; } @@ -20906,7 +20916,7 @@ function getContainingNodeArray(node) { return node.parent.templateSpans; case 167 /* Decorator */: { const { parent: parent4 } = node; - return canHaveDecorators(parent4) ? parent4.modifiers : canHaveIllegalDecorators(parent4) ? parent4.illegalDecorators : void 0; + return canHaveDecorators(parent4) ? parent4.modifiers : void 0; } case 294 /* HeritageClause */: return node.parent.heritageClauses; @@ -20924,7 +20934,7 @@ function getContainingNodeArray(node) { return parent2.types; case 186 /* TupleType */: case 206 /* ArrayLiteralExpression */: - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: case 272 /* NamedImports */: case 276 /* NamedExports */: return parent2.elements; @@ -21109,6 +21119,16 @@ function isNonNullAccess(node) { const kind = node.kind; return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression); } +function isJSDocSatisfiesExpression(node) { + return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); +} +function getJSDocSatisfiesExpressionType(node) { + return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node)); +} +function tryGetJSDocSatisfiesTypeNode(node) { + const tag = getJSDocSatisfiesTag(node); + return tag && tag.typeExpression && tag.typeExpression.type; +} // src/compiler/factory/baseNodeFactory.ts function createBaseNodeFactory() { @@ -21574,7 +21594,7 @@ function createNodeConverters(factory2) { if (!node.body) return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); const updated = factory2.createFunctionExpression( - node.modifiers, + getModifiers(node), node.asteriskToken, node.name, node.typeParameters, @@ -21716,46 +21736,45 @@ function createNodeFactory(flags, baseFactory2) { }, baseFactory: baseFactory2, flags, - createNodeArray: createNodeArray2, - createNumericLiteral: createNumericLiteral2, - createBigIntLiteral: createBigIntLiteral2, - createStringLiteral: createStringLiteral2, - createStringLiteralFromNode: createStringLiteralFromNode2, - createRegularExpressionLiteral: createRegularExpressionLiteral2, + createNodeArray, + createNumericLiteral, + createBigIntLiteral, + createStringLiteral, + createStringLiteralFromNode, + createRegularExpressionLiteral, createLiteralLikeNode, - createIdentifier: createIdentifier3, - updateIdentifier, - createTempVariable: createTempVariable3, - createLoopVariable: createLoopVariable2, - createUniqueName: createUniqueName2, - getGeneratedNameForNode: getGeneratedNameForNode3, - createPrivateIdentifier: createPrivateIdentifier2, + createIdentifier, + createTempVariable, + createLoopVariable, + createUniqueName, + getGeneratedNameForNode, + createPrivateIdentifier, createUniquePrivateName, getGeneratedPrivateNameForNode, - createToken: createToken3, - createSuper: createSuper2, - createThis: createThis2, - createNull: createNull2, - createTrue: createTrue2, - createFalse: createFalse2, - createModifier: createModifier2, - createModifiersFromModifierFlags: createModifiersFromModifierFlags2, - createQualifiedName: createQualifiedName2, - updateQualifiedName: updateQualifiedName2, - createComputedPropertyName: createComputedPropertyName2, - updateComputedPropertyName: updateComputedPropertyName2, - createTypeParameterDeclaration: createTypeParameterDeclaration2, - updateTypeParameterDeclaration: updateTypeParameterDeclaration2, + createToken, + createSuper, + createThis, + createNull, + createTrue, + createFalse, + createModifier, + createModifiersFromModifierFlags, + createQualifiedName, + updateQualifiedName, + createComputedPropertyName, + updateComputedPropertyName, + createTypeParameterDeclaration, + updateTypeParameterDeclaration, createParameterDeclaration, updateParameterDeclaration, - createDecorator: createDecorator2, - updateDecorator: updateDecorator2, - createPropertySignature: createPropertySignature3, - updatePropertySignature: updatePropertySignature3, + createDecorator, + updateDecorator, + createPropertySignature, + updatePropertySignature, createPropertyDeclaration, updatePropertyDeclaration: updatePropertyDeclaration2, - createMethodSignature: createMethodSignature3, - updateMethodSignature: updateMethodSignature3, + createMethodSignature, + updateMethodSignature, createMethodDeclaration, updateMethodDeclaration, createConstructorDeclaration, @@ -21764,96 +21783,96 @@ function createNodeFactory(flags, baseFactory2) { updateGetAccessorDeclaration, createSetAccessorDeclaration, updateSetAccessorDeclaration, - createCallSignature: createCallSignature2, - updateCallSignature: updateCallSignature2, - createConstructSignature: createConstructSignature2, - updateConstructSignature: updateConstructSignature2, - createIndexSignature: createIndexSignature3, - updateIndexSignature: updateIndexSignature2, + createCallSignature, + updateCallSignature, + createConstructSignature, + updateConstructSignature, + createIndexSignature, + updateIndexSignature, createClassStaticBlockDeclaration, updateClassStaticBlockDeclaration, createTemplateLiteralTypeSpan, updateTemplateLiteralTypeSpan, - createKeywordTypeNode: createKeywordTypeNode2, - createTypePredicateNode: createTypePredicateNode3, - updateTypePredicateNode: updateTypePredicateNode3, - createTypeReferenceNode: createTypeReferenceNode2, - updateTypeReferenceNode: updateTypeReferenceNode2, - createFunctionTypeNode: createFunctionTypeNode2, - updateFunctionTypeNode: updateFunctionTypeNode2, - createConstructorTypeNode: createConstructorTypeNode2, - updateConstructorTypeNode: updateConstructorTypeNode2, - createTypeQueryNode: createTypeQueryNode2, - updateTypeQueryNode: updateTypeQueryNode2, - createTypeLiteralNode: createTypeLiteralNode2, - updateTypeLiteralNode: updateTypeLiteralNode2, - createArrayTypeNode: createArrayTypeNode2, - updateArrayTypeNode: updateArrayTypeNode2, - createTupleTypeNode: createTupleTypeNode2, - updateTupleTypeNode: updateTupleTypeNode2, + createKeywordTypeNode, + createTypePredicateNode, + updateTypePredicateNode, + createTypeReferenceNode, + updateTypeReferenceNode, + createFunctionTypeNode, + updateFunctionTypeNode, + createConstructorTypeNode, + updateConstructorTypeNode, + createTypeQueryNode, + updateTypeQueryNode, + createTypeLiteralNode, + updateTypeLiteralNode, + createArrayTypeNode, + updateArrayTypeNode, + createTupleTypeNode, + updateTupleTypeNode, createNamedTupleMember, updateNamedTupleMember, - createOptionalTypeNode: createOptionalTypeNode2, - updateOptionalTypeNode: updateOptionalTypeNode2, - createRestTypeNode: createRestTypeNode2, - updateRestTypeNode: updateRestTypeNode2, - createUnionTypeNode: createUnionTypeNode2, - updateUnionTypeNode: updateUnionTypeNode2, - createIntersectionTypeNode: createIntersectionTypeNode2, - updateIntersectionTypeNode: updateIntersectionTypeNode2, - createConditionalTypeNode: createConditionalTypeNode2, - updateConditionalTypeNode: updateConditionalTypeNode2, - createInferTypeNode: createInferTypeNode2, - updateInferTypeNode: updateInferTypeNode2, - createImportTypeNode: createImportTypeNode2, - updateImportTypeNode: updateImportTypeNode2, - createParenthesizedType: createParenthesizedType2, - updateParenthesizedType: updateParenthesizedType2, - createThisTypeNode: createThisTypeNode2, - createTypeOperatorNode: createTypeOperatorNode3, - updateTypeOperatorNode: updateTypeOperatorNode2, - createIndexedAccessTypeNode: createIndexedAccessTypeNode2, - updateIndexedAccessTypeNode: updateIndexedAccessTypeNode2, - createMappedTypeNode: createMappedTypeNode2, - updateMappedTypeNode: updateMappedTypeNode2, - createLiteralTypeNode: createLiteralTypeNode2, - updateLiteralTypeNode: updateLiteralTypeNode2, + createOptionalTypeNode, + updateOptionalTypeNode, + createRestTypeNode, + updateRestTypeNode, + createUnionTypeNode, + updateUnionTypeNode, + createIntersectionTypeNode, + updateIntersectionTypeNode, + createConditionalTypeNode, + updateConditionalTypeNode, + createInferTypeNode, + updateInferTypeNode, + createImportTypeNode, + updateImportTypeNode, + createParenthesizedType, + updateParenthesizedType, + createThisTypeNode, + createTypeOperatorNode, + updateTypeOperatorNode, + createIndexedAccessTypeNode, + updateIndexedAccessTypeNode, + createMappedTypeNode, + updateMappedTypeNode, + createLiteralTypeNode, + updateLiteralTypeNode, createTemplateLiteralType, updateTemplateLiteralType, - createObjectBindingPattern: createObjectBindingPattern2, - updateObjectBindingPattern: updateObjectBindingPattern2, - createArrayBindingPattern: createArrayBindingPattern2, - updateArrayBindingPattern: updateArrayBindingPattern2, - createBindingElement: createBindingElement2, - updateBindingElement: updateBindingElement2, + createObjectBindingPattern, + updateObjectBindingPattern, + createArrayBindingPattern, + updateArrayBindingPattern, + createBindingElement, + updateBindingElement, createArrayLiteralExpression, updateArrayLiteralExpression, createObjectLiteralExpression, updateObjectLiteralExpression, createPropertyAccessExpression: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, name) => setEmitFlags(createPropertyAccessExpression(expression, name), 262144 /* NoIndentation */) : createPropertyAccessExpression, updatePropertyAccessExpression, - createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain2(expression, questionDotToken, name), 262144 /* NoIndentation */) : createPropertyAccessChain2, - updatePropertyAccessChain: updatePropertyAccessChain2, + createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain(expression, questionDotToken, name), 262144 /* NoIndentation */) : createPropertyAccessChain, + updatePropertyAccessChain, createElementAccessExpression, updateElementAccessExpression, - createElementAccessChain: createElementAccessChain2, - updateElementAccessChain: updateElementAccessChain2, + createElementAccessChain, + updateElementAccessChain, createCallExpression, updateCallExpression, - createCallChain: createCallChain2, - updateCallChain: updateCallChain2, + createCallChain, + updateCallChain, createNewExpression, updateNewExpression, createTaggedTemplateExpression, updateTaggedTemplateExpression, - createTypeAssertion: createTypeAssertion2, - updateTypeAssertion: updateTypeAssertion2, + createTypeAssertion, + updateTypeAssertion, createParenthesizedExpression, updateParenthesizedExpression, - createFunctionExpression: createFunctionExpression2, - updateFunctionExpression: updateFunctionExpression2, - createArrowFunction: createArrowFunction3, - updateArrowFunction: updateArrowFunction3, + createFunctionExpression, + updateFunctionExpression, + createArrowFunction, + updateArrowFunction, createDeleteExpression, updateDeleteExpression, createTypeOfExpression, @@ -21870,42 +21889,42 @@ function createNodeFactory(flags, baseFactory2) { updateBinaryExpression, createConditionalExpression, updateConditionalExpression, - createTemplateExpression: createTemplateExpression2, - updateTemplateExpression: updateTemplateExpression2, - createTemplateHead: createTemplateHead2, - createTemplateMiddle: createTemplateMiddle2, - createTemplateTail: createTemplateTail2, - createNoSubstitutionTemplateLiteral: createNoSubstitutionTemplateLiteral2, + createTemplateExpression, + updateTemplateExpression, + createTemplateHead, + createTemplateMiddle, + createTemplateTail, + createNoSubstitutionTemplateLiteral, createTemplateLiteralLikeNode, createYieldExpression, updateYieldExpression, createSpreadElement, updateSpreadElement, - createClassExpression: createClassExpression3, - updateClassExpression: updateClassExpression3, - createOmittedExpression: createOmittedExpression2, - createExpressionWithTypeArguments: createExpressionWithTypeArguments3, - updateExpressionWithTypeArguments: updateExpressionWithTypeArguments3, - createAsExpression: createAsExpression2, - updateAsExpression: updateAsExpression2, - createNonNullExpression: createNonNullExpression2, - updateNonNullExpression: updateNonNullExpression2, + createClassExpression, + updateClassExpression, + createOmittedExpression, + createExpressionWithTypeArguments, + updateExpressionWithTypeArguments, + createAsExpression, + updateAsExpression, + createNonNullExpression, + updateNonNullExpression, createSatisfiesExpression, updateSatisfiesExpression, - createNonNullChain: createNonNullChain2, - updateNonNullChain: updateNonNullChain2, - createMetaProperty: createMetaProperty2, - updateMetaProperty: updateMetaProperty2, - createTemplateSpan: createTemplateSpan2, - updateTemplateSpan: updateTemplateSpan2, - createSemicolonClassElement: createSemicolonClassElement2, - createBlock: createBlock2, - updateBlock: updateBlock2, - createVariableStatement: createVariableStatement2, - updateVariableStatement: updateVariableStatement2, - createEmptyStatement: createEmptyStatement2, - createExpressionStatement: createExpressionStatement2, - updateExpressionStatement: updateExpressionStatement2, + createNonNullChain, + updateNonNullChain, + createMetaProperty, + updateMetaProperty, + createTemplateSpan, + updateTemplateSpan, + createSemicolonClassElement, + createBlock, + updateBlock, + createVariableStatement, + updateVariableStatement, + createEmptyStatement, + createExpressionStatement, + updateExpressionStatement, createIfStatement, updateIfStatement, createDoStatement, @@ -21934,60 +21953,60 @@ function createNodeFactory(flags, baseFactory2) { updateThrowStatement, createTryStatement, updateTryStatement, - createDebuggerStatement: createDebuggerStatement2, - createVariableDeclaration: createVariableDeclaration3, - updateVariableDeclaration: updateVariableDeclaration3, - createVariableDeclarationList: createVariableDeclarationList2, - updateVariableDeclarationList: updateVariableDeclarationList2, - createFunctionDeclaration: createFunctionDeclaration2, - updateFunctionDeclaration: updateFunctionDeclaration2, - createClassDeclaration: createClassDeclaration2, - updateClassDeclaration: updateClassDeclaration2, - createInterfaceDeclaration: createInterfaceDeclaration2, - updateInterfaceDeclaration: updateInterfaceDeclaration2, - createTypeAliasDeclaration: createTypeAliasDeclaration2, - updateTypeAliasDeclaration: updateTypeAliasDeclaration2, - createEnumDeclaration: createEnumDeclaration2, - updateEnumDeclaration: updateEnumDeclaration2, - createModuleDeclaration: createModuleDeclaration2, - updateModuleDeclaration: updateModuleDeclaration2, - createModuleBlock: createModuleBlock2, - updateModuleBlock: updateModuleBlock2, - createCaseBlock: createCaseBlock2, - updateCaseBlock: updateCaseBlock2, - createNamespaceExportDeclaration: createNamespaceExportDeclaration2, - updateNamespaceExportDeclaration: updateNamespaceExportDeclaration2, - createImportEqualsDeclaration: createImportEqualsDeclaration2, - updateImportEqualsDeclaration: updateImportEqualsDeclaration2, - createImportDeclaration: createImportDeclaration2, - updateImportDeclaration: updateImportDeclaration2, - createImportClause: createImportClause3, - updateImportClause: updateImportClause3, + createDebuggerStatement, + createVariableDeclaration, + updateVariableDeclaration, + createVariableDeclarationList, + updateVariableDeclarationList, + createFunctionDeclaration, + updateFunctionDeclaration, + createClassDeclaration, + updateClassDeclaration, + createInterfaceDeclaration, + updateInterfaceDeclaration, + createTypeAliasDeclaration, + updateTypeAliasDeclaration, + createEnumDeclaration, + updateEnumDeclaration, + createModuleDeclaration, + updateModuleDeclaration, + createModuleBlock, + updateModuleBlock, + createCaseBlock, + updateCaseBlock, + createNamespaceExportDeclaration, + updateNamespaceExportDeclaration, + createImportEqualsDeclaration, + updateImportEqualsDeclaration, + createImportDeclaration, + updateImportDeclaration, + createImportClause, + updateImportClause, createAssertClause, updateAssertClause, createAssertEntry, updateAssertEntry, createImportTypeAssertionContainer, updateImportTypeAssertionContainer, - createNamespaceImport: createNamespaceImport2, - updateNamespaceImport: updateNamespaceImport2, - createNamespaceExport: createNamespaceExport2, - updateNamespaceExport: updateNamespaceExport2, - createNamedImports: createNamedImports2, - updateNamedImports: updateNamedImports2, - createImportSpecifier: createImportSpecifier2, - updateImportSpecifier: updateImportSpecifier2, - createExportAssignment: createExportAssignment3, - updateExportAssignment: updateExportAssignment2, - createExportDeclaration: createExportDeclaration3, - updateExportDeclaration: updateExportDeclaration3, - createNamedExports: createNamedExports2, - updateNamedExports: updateNamedExports2, - createExportSpecifier: createExportSpecifier2, - updateExportSpecifier: updateExportSpecifier2, + createNamespaceImport, + updateNamespaceImport, + createNamespaceExport, + updateNamespaceExport, + createNamedImports, + updateNamedImports, + createImportSpecifier, + updateImportSpecifier, + createExportAssignment: createExportAssignment2, + updateExportAssignment, + createExportDeclaration, + updateExportDeclaration, + createNamedExports, + updateNamedExports, + createExportSpecifier, + updateExportSpecifier, createMissingDeclaration, - createExternalModuleReference: createExternalModuleReference2, - updateExternalModuleReference: updateExternalModuleReference2, + createExternalModuleReference, + updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(315 /* JSDocAllType */); @@ -22027,27 +22046,27 @@ function createNodeFactory(flags, baseFactory2) { }, createJSDocFunctionType, updateJSDocFunctionType, - createJSDocTypeLiteral: createJSDocTypeLiteral2, + createJSDocTypeLiteral, updateJSDocTypeLiteral, - createJSDocTypeExpression: createJSDocTypeExpression2, + createJSDocTypeExpression, updateJSDocTypeExpression, - createJSDocSignature: createJSDocSignature2, + createJSDocSignature, updateJSDocSignature, - createJSDocTemplateTag: createJSDocTemplateTag2, + createJSDocTemplateTag, updateJSDocTemplateTag, - createJSDocTypedefTag: createJSDocTypedefTag2, + createJSDocTypedefTag, updateJSDocTypedefTag, - createJSDocParameterTag: createJSDocParameterTag2, + createJSDocParameterTag, updateJSDocParameterTag, - createJSDocPropertyTag: createJSDocPropertyTag2, + createJSDocPropertyTag, updateJSDocPropertyTag, - createJSDocCallbackTag: createJSDocCallbackTag2, + createJSDocCallbackTag, updateJSDocCallbackTag, createJSDocOverloadTag, updateJSDocOverloadTag, - createJSDocAugmentsTag: createJSDocAugmentsTag2, + createJSDocAugmentsTag, updateJSDocAugmentsTag, - createJSDocImplementsTag: createJSDocImplementsTag2, + createJSDocImplementsTag, updateJSDocImplementsTag, createJSDocSeeTag, updateJSDocSeeTag, @@ -22134,57 +22153,63 @@ function createNodeFactory(flags, baseFactory2) { get updateJSDocThrowsTag() { return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */); }, - createJSDocEnumTag: createJSDocEnumTag2, + get createJSDocSatisfiesTag() { + return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */); + }, + get updateJSDocSatisfiesTag() { + return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */); + }, + createJSDocEnumTag, updateJSDocEnumTag, createJSDocUnknownTag, updateJSDocUnknownTag, createJSDocText, updateJSDocText, - createJSDocComment: createJSDocComment2, + createJSDocComment, updateJSDocComment, - createJsxElement: createJsxElement2, - updateJsxElement: updateJsxElement2, - createJsxSelfClosingElement: createJsxSelfClosingElement2, - updateJsxSelfClosingElement: updateJsxSelfClosingElement2, - createJsxOpeningElement: createJsxOpeningElement2, - updateJsxOpeningElement: updateJsxOpeningElement2, - createJsxClosingElement: createJsxClosingElement2, - updateJsxClosingElement: updateJsxClosingElement2, - createJsxFragment: createJsxFragment2, - createJsxText: createJsxText2, - updateJsxText: updateJsxText2, - createJsxOpeningFragment: createJsxOpeningFragment2, - createJsxJsxClosingFragment: createJsxJsxClosingFragment2, - updateJsxFragment: updateJsxFragment2, - createJsxAttribute: createJsxAttribute2, - updateJsxAttribute: updateJsxAttribute2, - createJsxAttributes: createJsxAttributes2, - updateJsxAttributes: updateJsxAttributes2, - createJsxSpreadAttribute: createJsxSpreadAttribute2, - updateJsxSpreadAttribute: updateJsxSpreadAttribute2, - createJsxExpression: createJsxExpression2, - updateJsxExpression: updateJsxExpression2, - createCaseClause: createCaseClause2, - updateCaseClause: updateCaseClause2, - createDefaultClause: createDefaultClause2, - updateDefaultClause: updateDefaultClause2, - createHeritageClause: createHeritageClause2, - updateHeritageClause: updateHeritageClause2, - createCatchClause: createCatchClause2, - updateCatchClause: updateCatchClause2, - createPropertyAssignment: createPropertyAssignment2, - updatePropertyAssignment: updatePropertyAssignment2, - createShorthandPropertyAssignment: createShorthandPropertyAssignment2, - updateShorthandPropertyAssignment: updateShorthandPropertyAssignment2, - createSpreadAssignment: createSpreadAssignment2, - updateSpreadAssignment: updateSpreadAssignment2, - createEnumMember: createEnumMember2, - updateEnumMember: updateEnumMember2, + createJsxElement, + updateJsxElement, + createJsxSelfClosingElement, + updateJsxSelfClosingElement, + createJsxOpeningElement, + updateJsxOpeningElement, + createJsxClosingElement, + updateJsxClosingElement, + createJsxFragment, + createJsxText, + updateJsxText, + createJsxOpeningFragment, + createJsxJsxClosingFragment, + updateJsxFragment, + createJsxAttribute, + updateJsxAttribute, + createJsxAttributes, + updateJsxAttributes, + createJsxSpreadAttribute, + updateJsxSpreadAttribute, + createJsxExpression, + updateJsxExpression, + createCaseClause, + updateCaseClause, + createDefaultClause, + updateDefaultClause, + createHeritageClause, + updateHeritageClause, + createCatchClause, + updateCatchClause, + createPropertyAssignment, + updatePropertyAssignment, + createShorthandPropertyAssignment, + updateShorthandPropertyAssignment, + createSpreadAssignment, + updateSpreadAssignment, + createEnumMember, + updateEnumMember, createSourceFile: createSourceFile2, updateSourceFile: updateSourceFile2, createRedirectedSourceFile, - createBundle: createBundle2, - updateBundle: updateBundle2, + createBundle, + updateBundle, createUnparsedSource, createUnparsedPrologue, createUnparsedPrepend, @@ -22193,9 +22218,9 @@ function createNodeFactory(flags, baseFactory2) { createInputFiles: createInputFiles2, createSyntheticExpression, createSyntaxList: createSyntaxList3, - createNotEmittedStatement: createNotEmittedStatement2, - createPartiallyEmittedExpression: createPartiallyEmittedExpression2, - updatePartiallyEmittedExpression: updatePartiallyEmittedExpression2, + createNotEmittedStatement, + createPartiallyEmittedExpression, + updatePartiallyEmittedExpression, createCommaListExpression, updateCommaListExpression, createEndOfDeclarationMarker, @@ -22301,11 +22326,11 @@ function createNodeFactory(flags, baseFactory2) { return getPostfixUnaryCreateFunction(46 /* MinusMinusToken */); }, // Compound nodes - createImmediatelyInvokedFunctionExpression: createImmediatelyInvokedFunctionExpression2, - createImmediatelyInvokedArrowFunction: createImmediatelyInvokedArrowFunction2, - createVoidZero: createVoidZero2, - createExportDefault: createExportDefault2, - createExternalModuleExport: createExternalModuleExport2, + createImmediatelyInvokedFunctionExpression, + createImmediatelyInvokedArrowFunction, + createVoidZero, + createExportDefault, + createExternalModuleExport, createTypeCheck, createMethodCall, createGlobalMethodCall, @@ -22315,6 +22340,7 @@ function createNodeFactory(flags, baseFactory2) { createArraySliceCall, createArrayConcatCall, createObjectDefinePropertyCall, + createObjectGetOwnPropertyDescriptorCall, createReflectGetCall, createReflectSetCall, createPropertyDescriptor, @@ -22341,7 +22367,7 @@ function createNodeFactory(flags, baseFactory2) { }; forEach(nodeFactoryPatchers, (fn) => fn(factory2)); return factory2; - function createNodeArray2(elements, hasTrailingComma) { + function createNodeArray(elements, hasTrailingComma) { if (elements === void 0 || elements === emptyArray) { elements = []; } else if (isNodeArray(elements)) { @@ -22385,7 +22411,7 @@ function createNodeFactory(flags, baseFactory2) { } return update(updated, original); } - function createNumericLiteral2(value, numericLiteralFlags = 0 /* None */) { + function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) { const node = createBaseDeclaration(8 /* NumericLiteral */); node.text = typeof value === "number" ? value + "" : value; node.numericLiteralFlags = numericLiteralFlags; @@ -22393,7 +22419,7 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createBigIntLiteral2(value) { + function createBigIntLiteral(value) { const node = createBaseToken(9 /* BigIntLiteral */); node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n"; node.transformFlags |= 4 /* ContainsESNext */; @@ -22405,14 +22431,14 @@ function createNodeFactory(flags, baseFactory2) { node.singleQuote = isSingleQuote; return node; } - function createStringLiteral2(text, isSingleQuote, hasExtendedUnicodeEscape) { + function createStringLiteral(text, isSingleQuote, hasExtendedUnicodeEscape) { const node = createBaseStringLiteral(text, isSingleQuote); node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; if (hasExtendedUnicodeEscape) node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createStringLiteralFromNode2(sourceNode) { + function createStringLiteralFromNode(sourceNode) { const node = createBaseStringLiteral( getTextOfIdentifierOrLiteral(sourceNode), /*isSingleQuote*/ @@ -22421,7 +22447,7 @@ function createNodeFactory(flags, baseFactory2) { node.textSourceNode = sourceNode; return node; } - function createRegularExpressionLiteral2(text) { + function createRegularExpressionLiteral(text) { const node = createBaseToken(13 /* RegularExpressionLiteral */); node.text = text; return node; @@ -22429,33 +22455,33 @@ function createNodeFactory(flags, baseFactory2) { function createLiteralLikeNode(kind, text) { switch (kind) { case 8 /* NumericLiteral */: - return createNumericLiteral2( + return createNumericLiteral( text, /*numericLiteralFlags*/ 0 ); case 9 /* BigIntLiteral */: - return createBigIntLiteral2(text); + return createBigIntLiteral(text); case 10 /* StringLiteral */: - return createStringLiteral2( + return createStringLiteral( text, /*isSingleQuote*/ void 0 ); case 11 /* JsxText */: - return createJsxText2( + return createJsxText( text, /*containsOnlyTriviaWhiteSpaces*/ false ); case 12 /* JsxTextAllWhiteSpaces */: - return createJsxText2( + return createJsxText( text, /*containsOnlyTriviaWhiteSpaces*/ true ); case 13 /* RegularExpressionLiteral */: - return createRegularExpressionLiteral2(text); + return createRegularExpressionLiteral(text); case 14 /* NoSubstitutionTemplateLiteral */: return createTemplateLiteralLikeNode( kind, @@ -22467,56 +22493,44 @@ function createNodeFactory(flags, baseFactory2) { ); } } - function createBaseIdentifier(escapedText, originalKeywordKind) { + function createBaseIdentifier(escapedText) { const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */); - node.originalKeywordKind = originalKeywordKind; node.escapedText = escapedText; - node.autoGenerate = void 0; - node.typeArguments = void 0; - node.hasExtendedUnicodeEscape = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.symbol = void 0; return node; } function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { - const node = createBaseIdentifier( - escapeLeadingUnderscores(text), - /*originalKeywordKind*/ - void 0 - ); - node.autoGenerate = { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } - function createIdentifier3(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) { + function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) { if (originalKeywordKind === void 0 && text) { originalKeywordKind = stringToToken(text); } if (originalKeywordKind === 79 /* Identifier */) { originalKeywordKind = void 0; } - const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind); - node.typeArguments = asNodeArray(typeArguments); - node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; - if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + if (hasExtendedUnicodeEscape) + node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */; + if (node.escapedText === "await") { node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */; } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { node.transformFlags |= 1024 /* ContainsES2015 */; } return node; } - function updateIdentifier(node, typeArguments) { - return node.typeArguments !== typeArguments ? update(createIdentifier3(idText(node), typeArguments), node) : node; - } - function createTempVariable3(recordTempVariable, reservedInNestedScopes, prefix, suffix) { + function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { let flags2 = 1 /* Auto */; if (reservedInNestedScopes) flags2 |= 8 /* ReservedInNestedScopes */; @@ -22526,7 +22540,7 @@ function createNodeFactory(flags, baseFactory2) { } return name; } - function createLoopVariable2(reservedInNestedScopes) { + function createLoopVariable(reservedInNestedScopes) { let flags2 = 2 /* Loop */; if (reservedInNestedScopes) flags2 |= 8 /* ReservedInNestedScopes */; @@ -22539,12 +22553,12 @@ function createNodeFactory(flags, baseFactory2) { void 0 ); } - function createUniqueName2(text, flags2 = 0 /* None */, prefix, suffix) { + function createUniqueName(text, flags2 = 0 /* None */, prefix, suffix) { Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); Debug.assert((flags2 & (16 /* Optimistic */ | 32 /* FileLevel */)) !== 32 /* FileLevel */, "GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"); return createBaseGeneratedIdentifier(text, 3 /* Unique */ | flags2, prefix, suffix); } - function getGeneratedNameForNode3(node, flags2 = 0, prefix, suffix) { + function getGeneratedNameForNode(node, flags2 = 0, prefix, suffix) { Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); const text = !node ? "" : isMemberName(node) ? formatGeneratedName( /*privateName*/ @@ -22563,23 +22577,22 @@ function createNodeFactory(flags, baseFactory2) { function createBasePrivateIdentifier(escapedText) { const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */); node.escapedText = escapedText; - node.autoGenerate = void 0; node.transformFlags |= 16777216 /* ContainsClassFields */; return node; } - function createPrivateIdentifier2(text) { + function createPrivateIdentifier(text) { if (!startsWith(text, "#")) Debug.fail("First character of private identifier must be #: " + text); return createBasePrivateIdentifier(escapeLeadingUnderscores(text)); } function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text)); - node.autoGenerate = { + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } @@ -22606,7 +22619,7 @@ function createNodeFactory(flags, baseFactory2) { function createBaseToken(kind) { return baseFactory2.createBaseTokenNode(kind); } - function createToken3(token) { + function createToken(token) { Debug.assert(token >= 0 /* FirstToken */ && token <= 162 /* LastToken */, "Invalid token"); Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); @@ -22660,59 +22673,59 @@ function createNodeFactory(flags, baseFactory2) { } return node; } - function createSuper2() { - return createToken3(106 /* SuperKeyword */); + function createSuper() { + return createToken(106 /* SuperKeyword */); } - function createThis2() { - return createToken3(108 /* ThisKeyword */); + function createThis() { + return createToken(108 /* ThisKeyword */); } - function createNull2() { - return createToken3(104 /* NullKeyword */); + function createNull() { + return createToken(104 /* NullKeyword */); } - function createTrue2() { - return createToken3(110 /* TrueKeyword */); + function createTrue() { + return createToken(110 /* TrueKeyword */); } - function createFalse2() { - return createToken3(95 /* FalseKeyword */); + function createFalse() { + return createToken(95 /* FalseKeyword */); } - function createModifier2(kind) { - return createToken3(kind); + function createModifier(kind) { + return createToken(kind); } - function createModifiersFromModifierFlags2(flags2) { + function createModifiersFromModifierFlags(flags2) { const result = []; if (flags2 & 1 /* Export */) - result.push(createModifier2(93 /* ExportKeyword */)); + result.push(createModifier(93 /* ExportKeyword */)); if (flags2 & 2 /* Ambient */) - result.push(createModifier2(136 /* DeclareKeyword */)); + result.push(createModifier(136 /* DeclareKeyword */)); if (flags2 & 1024 /* Default */) - result.push(createModifier2(88 /* DefaultKeyword */)); + result.push(createModifier(88 /* DefaultKeyword */)); if (flags2 & 2048 /* Const */) - result.push(createModifier2(85 /* ConstKeyword */)); + result.push(createModifier(85 /* ConstKeyword */)); if (flags2 & 4 /* Public */) - result.push(createModifier2(123 /* PublicKeyword */)); + result.push(createModifier(123 /* PublicKeyword */)); if (flags2 & 8 /* Private */) - result.push(createModifier2(121 /* PrivateKeyword */)); + result.push(createModifier(121 /* PrivateKeyword */)); if (flags2 & 16 /* Protected */) - result.push(createModifier2(122 /* ProtectedKeyword */)); + result.push(createModifier(122 /* ProtectedKeyword */)); if (flags2 & 256 /* Abstract */) - result.push(createModifier2(126 /* AbstractKeyword */)); + result.push(createModifier(126 /* AbstractKeyword */)); if (flags2 & 32 /* Static */) - result.push(createModifier2(124 /* StaticKeyword */)); + result.push(createModifier(124 /* StaticKeyword */)); if (flags2 & 16384 /* Override */) - result.push(createModifier2(161 /* OverrideKeyword */)); + result.push(createModifier(161 /* OverrideKeyword */)); if (flags2 & 64 /* Readonly */) - result.push(createModifier2(146 /* ReadonlyKeyword */)); + result.push(createModifier(146 /* ReadonlyKeyword */)); if (flags2 & 128 /* Accessor */) - result.push(createModifier2(127 /* AccessorKeyword */)); + result.push(createModifier(127 /* AccessorKeyword */)); if (flags2 & 512 /* Async */) - result.push(createModifier2(132 /* AsyncKeyword */)); + result.push(createModifier(132 /* AsyncKeyword */)); if (flags2 & 32768 /* In */) - result.push(createModifier2(101 /* InKeyword */)); + result.push(createModifier(101 /* InKeyword */)); if (flags2 & 65536 /* Out */) - result.push(createModifier2(145 /* OutKeyword */)); + result.push(createModifier(145 /* OutKeyword */)); return result.length ? result : void 0; } - function createQualifiedName2(left, right) { + function createQualifiedName(left, right) { const node = createBaseNode(163 /* QualifiedName */); node.left = left; node.right = asName(right); @@ -22720,19 +22733,19 @@ function createNodeFactory(flags, baseFactory2) { node.flowNode = void 0; return node; } - function updateQualifiedName2(node, left, right) { - return node.left !== left || node.right !== right ? update(createQualifiedName2(left, right), node) : node; + function updateQualifiedName(node, left, right) { + return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node; } - function createComputedPropertyName2(expression) { + function createComputedPropertyName(expression) { const node = createBaseNode(164 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */; return node; } - function updateComputedPropertyName2(node, expression) { - return node.expression !== expression ? update(createComputedPropertyName2(expression), node) : node; + function updateComputedPropertyName(node, expression) { + return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node; } - function createTypeParameterDeclaration2(modifiers, name, constraint, defaultType) { + function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) { const node = createBaseDeclaration(165 /* TypeParameter */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -22741,11 +22754,10 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.expression = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateTypeParameterDeclaration2(node, modifiers, name, constraint, defaultType) { - return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration2(modifiers, name, constraint, defaultType), node) : node; + function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) { + return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node; } function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) { var _a2, _b; @@ -22762,13 +22774,12 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */); } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node; } - function createDecorator2(expression) { + function createDecorator(expression) { const node = createBaseNode(167 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -22778,10 +22789,10 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */; return node; } - function updateDecorator2(node, expression) { - return node.expression !== expression ? update(createDecorator2(expression), node) : node; + function updateDecorator(node, expression) { + return node.expression !== expression ? update(createDecorator(expression), node) : node; } - function createPropertySignature3(modifiers, name, questionToken, type) { + function createPropertySignature(modifiers, name, questionToken, type) { const node = createBaseDeclaration(168 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -22790,11 +22801,10 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.initializer = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updatePropertySignature3(node, modifiers, name, questionToken, type) { - return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature3(modifiers, name, questionToken, type), node) : node; + function updatePropertySignature(node, modifiers, name, questionToken, type) { + return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature(modifiers, name, questionToken, type), node) : node; } function finishUpdatePropertySignature(updated, original) { if (updated !== original) { @@ -22813,13 +22823,12 @@ function createNodeFactory(flags, baseFactory2) { const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer) { return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } - function createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type) { + function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { const node = createBaseDeclaration(170 /* MethodSignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -22829,14 +22838,13 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateMethodSignature3(node, modifiers, name, questionToken, typeParameters, parameters, type) { - return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; + function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) { + return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; } function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { const node = createBaseDeclaration(171 /* MethodDeclaration */); @@ -22846,7 +22854,7 @@ function createNodeFactory(flags, baseFactory2) { node.questionToken = questionToken; node.exclamationToken = void 0; node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body) { @@ -22859,7 +22867,6 @@ function createNodeFactory(flags, baseFactory2) { } node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -22880,10 +22887,8 @@ function createNodeFactory(flags, baseFactory2) { const node = createBaseDeclaration(172 /* ClassStaticBlockDeclaration */); node.body = body; node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -22895,7 +22900,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateClassStaticBlockDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); @@ -22903,15 +22907,13 @@ function createNodeFactory(flags, baseFactory2) { function createConstructorDeclaration(modifiers, parameters, body) { const node = createBaseDeclaration(173 /* Constructor */); node.modifiers = asNodeArray(modifiers); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.body = body; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */; - node.illegalDecorators = void 0; node.typeParameters = void 0; node.type = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -22923,7 +22925,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateConstructorDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.typeParameters = original.typeParameters; updated.type = original.type; } @@ -22933,7 +22934,7 @@ function createNodeFactory(flags, baseFactory2) { const node = createBaseDeclaration(174 /* GetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body) { @@ -22944,7 +22945,6 @@ function createNodeFactory(flags, baseFactory2) { node.typeArguments = void 0; node.typeParameters = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -22965,7 +22965,7 @@ function createNodeFactory(flags, baseFactory2) { const node = createBaseDeclaration(175 /* SetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.body = body; if (!node.body) { node.transformFlags = 1 /* ContainsTypeScript */; @@ -22976,7 +22976,6 @@ function createNodeFactory(flags, baseFactory2) { node.typeParameters = void 0; node.type = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -22994,54 +22993,50 @@ function createNodeFactory(flags, baseFactory2) { } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createCallSignature2(typeParameters, parameters, type) { + function createCallSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(176 /* CallSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateCallSignature2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature2(typeParameters, parameters, type), node) : node; + function updateCallSignature(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node; } - function createConstructSignature2(typeParameters, parameters, type) { + function createConstructSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(177 /* ConstructSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateConstructSignature2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature2(typeParameters, parameters, type), node) : node; + function updateConstructSignature(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node; } - function createIndexSignature3(modifiers, parameters, type) { + function createIndexSignature(modifiers, parameters, type) { const node = createBaseDeclaration(178 /* IndexSignature */); node.modifiers = asNodeArray(modifiers); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateIndexSignature2(node, modifiers, parameters, type) { - return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature3(modifiers, parameters, type), node) : node; + function updateIndexSignature(node, modifiers, parameters, type) { + return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node; } function createTemplateLiteralTypeSpan(type, literal) { const node = createBaseNode(201 /* TemplateLiteralTypeSpan */); @@ -23053,10 +23048,10 @@ function createNodeFactory(flags, baseFactory2) { function updateTemplateLiteralTypeSpan(node, type, literal) { return node.type !== type || node.literal !== literal ? update(createTemplateLiteralTypeSpan(type, literal), node) : node; } - function createKeywordTypeNode2(kind) { - return createToken3(kind); + function createKeywordTypeNode(kind) { + return createToken(kind); } - function createTypePredicateNode3(assertsModifier, parameterName, type) { + function createTypePredicateNode(assertsModifier, parameterName, type) { const node = createBaseNode(179 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); @@ -23064,20 +23059,20 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypePredicateNode3(node, assertsModifier, parameterName, type) { - return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode3(assertsModifier, parameterName, type), node) : node; + function updateTypePredicateNode(node, assertsModifier, parameterName, type) { + return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node; } - function createTypeReferenceNode2(typeName, typeArguments) { + function createTypeReferenceNode(typeName, typeArguments) { const node = createBaseNode(180 /* TypeReference */); node.typeName = asName(typeName); - node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray2(typeArguments)); + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeReferenceNode2(node, typeName, typeArguments) { - return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode2(typeName, typeArguments), node) : node; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node; } - function createFunctionTypeNode2(typeParameters, parameters, type) { + function createFunctionTypeNode(typeParameters, parameters, type) { const node = createBaseDeclaration(181 /* FunctionType */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); @@ -23085,14 +23080,13 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateFunctionTypeNode2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(typeParameters, parameters, type), node) : node; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type), node) : node; } function finishUpdateFunctionTypeNode(updated, original) { if (updated !== original) { @@ -23100,8 +23094,8 @@ function createNodeFactory(flags, baseFactory2) { } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createConstructorTypeNode2(...args) { - return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode22(...args) : Debug.fail("Incorrect number of arguments specified."); + function createConstructorTypeNode(...args) { + return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) { const node = createBaseDeclaration(182 /* ConstructorType */); @@ -23111,13 +23105,12 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function createConstructorTypeNode22(typeParameters, parameters, type) { + function createConstructorTypeNode2(typeParameters, parameters, type) { return createConstructorTypeNode1( /*modifiers*/ void 0, @@ -23126,51 +23119,51 @@ function createNodeFactory(flags, baseFactory2) { type ); } - function updateConstructorTypeNode2(...args) { - return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode22(...args) : Debug.fail("Incorrect number of arguments specified."); + function updateConstructorTypeNode(...args) { + return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function updateConstructorTypeNode1(node, modifiers, typeParameters, parameters, type) { - return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode2(modifiers, typeParameters, parameters, type), node) : node; + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode(modifiers, typeParameters, parameters, type), node) : node; } - function updateConstructorTypeNode22(node, typeParameters, parameters, type) { + function updateConstructorTypeNode2(node, typeParameters, parameters, type) { return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type); } - function createTypeQueryNode2(exprName, typeArguments) { + function createTypeQueryNode(exprName, typeArguments) { const node = createBaseNode(183 /* TypeQuery */); node.exprName = exprName; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeQueryNode2(node, exprName, typeArguments) { - return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode2(exprName, typeArguments), node) : node; + function updateTypeQueryNode(node, exprName, typeArguments) { + return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node; } - function createTypeLiteralNode2(members) { + function createTypeLiteralNode(members) { const node = createBaseDeclaration(184 /* TypeLiteral */); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeLiteralNode2(node, members) { - return node.members !== members ? update(createTypeLiteralNode2(members), node) : node; + function updateTypeLiteralNode(node, members) { + return node.members !== members ? update(createTypeLiteralNode(members), node) : node; } - function createArrayTypeNode2(elementType) { + function createArrayTypeNode(elementType) { const node = createBaseNode(185 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateArrayTypeNode2(node, elementType) { - return node.elementType !== elementType ? update(createArrayTypeNode2(elementType), node) : node; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node; } - function createTupleTypeNode2(elements) { + function createTupleTypeNode(elements) { const node = createBaseNode(186 /* TupleType */); - node.elements = createNodeArray2(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); + node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTupleTypeNode2(node, elements) { - return node.elements !== elements ? update(createTupleTypeNode2(elements), node) : node; + function updateTupleTypeNode(node, elements) { + return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node; } function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { const node = createBaseDeclaration(199 /* NamedTupleMember */); @@ -23180,29 +23173,28 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) { return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node; } - function createOptionalTypeNode2(type) { + function createOptionalTypeNode(type) { const node = createBaseNode(187 /* OptionalType */); node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateOptionalTypeNode2(node, type) { - return node.type !== type ? update(createOptionalTypeNode2(type), node) : node; + function updateOptionalTypeNode(node, type) { + return node.type !== type ? update(createOptionalTypeNode(type), node) : node; } - function createRestTypeNode2(type) { + function createRestTypeNode(type) { const node = createBaseNode(188 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateRestTypeNode2(node, type) { - return node.type !== type ? update(createRestTypeNode2(type), node) : node; + function updateRestTypeNode(node, type) { + return node.type !== type ? update(createRestTypeNode(type), node) : node; } function createUnionOrIntersectionTypeNode(kind, types, parenthesize) { const node = createBaseNode(kind); @@ -23213,19 +23205,19 @@ function createNodeFactory(flags, baseFactory2) { function updateUnionOrIntersectionTypeNode(node, types, parenthesize) { return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node; } - function createUnionTypeNode2(types) { + function createUnionTypeNode(types) { return createUnionOrIntersectionTypeNode(189 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } - function updateUnionTypeNode2(node, types) { + function updateUnionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } - function createIntersectionTypeNode2(types) { + function createIntersectionTypeNode(types) { return createUnionOrIntersectionTypeNode(190 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } - function updateIntersectionTypeNode2(node, types) { + function updateIntersectionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } - function createConditionalTypeNode2(checkType, extendsType, trueType, falseType) { + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { const node = createBaseNode(191 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); @@ -23236,29 +23228,29 @@ function createNodeFactory(flags, baseFactory2) { node.nextContainer = void 0; return node; } - function updateConditionalTypeNode2(node, checkType, extendsType, trueType, falseType) { - return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode2(checkType, extendsType, trueType, falseType), node) : node; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; } - function createInferTypeNode2(typeParameter) { + function createInferTypeNode(typeParameter) { const node = createBaseNode(192 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateInferTypeNode2(node, typeParameter) { - return node.typeParameter !== typeParameter ? update(createInferTypeNode2(typeParameter), node) : node; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node; } function createTemplateLiteralType(head, templateSpans) { const node = createBaseNode(200 /* TemplateLiteralType */); node.head = head; - node.templateSpans = createNodeArray2(templateSpans); + node.templateSpans = createNodeArray(templateSpans); node.transformFlags = 1 /* ContainsTypeScript */; return node; } function updateTemplateLiteralType(node, head, templateSpans) { return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node; } - function createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf = false) { + function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) { const node = createBaseNode(202 /* ImportType */); node.argument = argument; node.assertions = assertions; @@ -23268,90 +23260,90 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateImportTypeNode2(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) { - return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; + function updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) { + return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; } - function createParenthesizedType2(type) { + function createParenthesizedType(type) { const node = createBaseNode(193 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateParenthesizedType2(node, type) { - return node.type !== type ? update(createParenthesizedType2(type), node) : node; + function updateParenthesizedType(node, type) { + return node.type !== type ? update(createParenthesizedType(type), node) : node; } - function createThisTypeNode2() { + function createThisTypeNode() { const node = createBaseNode(194 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function createTypeOperatorNode3(operator, type) { + function createTypeOperatorNode(operator, type) { const node = createBaseNode(195 /* TypeOperator */); node.operator = operator; node.type = operator === 146 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeOperatorNode2(node, type) { - return node.type !== type ? update(createTypeOperatorNode3(node.operator, type), node) : node; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node; } - function createIndexedAccessTypeNode2(objectType, indexType) { + function createIndexedAccessTypeNode(objectType, indexType) { const node = createBaseNode(196 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateIndexedAccessTypeNode2(node, objectType, indexType) { - return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode2(objectType, indexType), node) : node; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; } - function createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members) { + function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) { const node = createBaseDeclaration(197 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.nameType = nameType; node.questionToken = questionToken; node.type = type; - node.members = members && createNodeArray2(members); + node.members = members && createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateMappedTypeNode2(node, readonlyToken, typeParameter, nameType, questionToken, type, members) { - return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; + function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) { + return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; } - function createLiteralTypeNode2(literal) { + function createLiteralTypeNode(literal) { const node = createBaseNode(198 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateLiteralTypeNode2(node, literal) { - return node.literal !== literal ? update(createLiteralTypeNode2(literal), node) : node; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node; } - function createObjectBindingPattern2(elements) { + function createObjectBindingPattern(elements) { const node = createBaseNode(203 /* ObjectBindingPattern */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { node.transformFlags |= 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; } return node; } - function updateObjectBindingPattern2(node, elements) { - return node.elements !== elements ? update(createObjectBindingPattern2(elements), node) : node; + function updateObjectBindingPattern(node, elements) { + return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node; } - function createArrayBindingPattern2(elements) { + function createArrayBindingPattern(elements) { const node = createBaseNode(204 /* ArrayBindingPattern */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; return node; } - function updateArrayBindingPattern2(node, elements) { - return node.elements !== elements ? update(createArrayBindingPattern2(elements), node) : node; + function updateArrayBindingPattern(node, elements) { + return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node; } - function createBindingElement2(dotDotDotToken, propertyName, name, initializer) { + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { const node = createBaseDeclaration(205 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); @@ -23361,13 +23353,13 @@ function createNodeFactory(flags, baseFactory2) { node.flowNode = void 0; return node; } - function updateBindingElement2(node, dotDotDotToken, propertyName, name, initializer) { - return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement2(dotDotDotToken, propertyName, name, initializer), node) : node; + function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { + return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node; } function createArrayLiteralExpression(elements, multiLine) { const node = createBaseNode(206 /* ArrayLiteralExpression */); const lastElement = elements && lastOrUndefined(elements); - const elementsArray = createNodeArray2(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); + const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -23378,11 +23370,10 @@ function createNodeFactory(flags, baseFactory2) { } function createObjectLiteralExpression(properties, multiLine) { const node = createBaseDeclaration(207 /* ObjectLiteralExpression */); - node.properties = createNodeArray2(properties); + node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateObjectLiteralExpression(node, properties) { @@ -23395,7 +23386,6 @@ function createNodeFactory(flags, baseFactory2) { node.name = name; node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -23417,11 +23407,11 @@ function createNodeFactory(flags, baseFactory2) { } function updatePropertyAccessExpression(node, expression, name) { if (isPropertyAccessChain(node)) { - return updatePropertyAccessChain2(node, expression, node.questionDotToken, cast(name, isIdentifier)); + return updatePropertyAccessChain(node, expression, node.questionDotToken, cast(name, isIdentifier)); } return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node; } - function createPropertyAccessChain2(expression, questionDotToken, name) { + function createPropertyAccessChain(expression, questionDotToken, name) { const node = createBasePropertyAccessExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -23435,9 +23425,9 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updatePropertyAccessChain2(node, expression, questionDotToken, name) { + function updatePropertyAccessChain(node, expression, questionDotToken, name) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain2(expression, questionDotToken, name), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node; } function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) { const node = createBaseDeclaration(209 /* ElementAccessExpression */); @@ -23446,7 +23436,6 @@ function createNodeFactory(flags, baseFactory2) { node.argumentExpression = argumentExpression; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -23468,11 +23457,11 @@ function createNodeFactory(flags, baseFactory2) { } function updateElementAccessExpression(node, expression, argumentExpression) { if (isElementAccessChain(node)) { - return updateElementAccessChain2(node, expression, node.questionDotToken, argumentExpression); + return updateElementAccessChain(node, expression, node.questionDotToken, argumentExpression); } return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node; } - function createElementAccessChain2(expression, questionDotToken, index) { + function createElementAccessChain(expression, questionDotToken, index) { const node = createBaseElementAccessExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -23486,9 +23475,9 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updateElementAccessChain2(node, expression, questionDotToken, argumentExpression) { + function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain2(expression, questionDotToken, argumentExpression), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; } function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) { const node = createBaseDeclaration(210 /* CallExpression */); @@ -23515,7 +23504,7 @@ function createNodeFactory(flags, baseFactory2) { /*questionDotToken*/ void 0, asNodeArray(typeArguments), - parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray)) + parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) ); if (isImportKeyword(node.expression)) { node.transformFlags |= 8388608 /* ContainsDynamicImport */; @@ -23524,11 +23513,11 @@ function createNodeFactory(flags, baseFactory2) { } function updateCallExpression(node, expression, typeArguments, argumentsArray) { if (isCallChain(node)) { - return updateCallChain2(node, expression, node.questionDotToken, typeArguments, argumentsArray); + return updateCallChain(node, expression, node.questionDotToken, typeArguments, argumentsArray); } return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node; } - function createCallChain2(expression, questionDotToken, typeArguments, argumentsArray) { + function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { const node = createBaseCallExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -23537,15 +23526,15 @@ function createNodeFactory(flags, baseFactory2) { ), questionDotToken, asNodeArray(typeArguments), - parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray)) + parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) ); node.flags |= 32 /* OptionalChain */; node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updateCallChain2(node, expression, questionDotToken, typeArguments, argumentsArray) { + function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain2(expression, questionDotToken, typeArguments, argumentsArray), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; } function createNewExpression(expression, typeArguments, argumentsArray) { const node = createBaseDeclaration(211 /* NewExpression */); @@ -23582,34 +23571,33 @@ function createNodeFactory(flags, baseFactory2) { function updateTaggedTemplateExpression(node, tag, typeArguments, template) { return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node; } - function createTypeAssertion2(type, expression) { + function createTypeAssertion(type, expression) { const node = createBaseNode(213 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; return node; } - function updateTypeAssertion2(node, type, expression) { - return node.type !== type || node.expression !== expression ? update(createTypeAssertion2(type, expression), node) : node; + function updateTypeAssertion(node, type, expression) { + return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node; } function createParenthesizedExpression(expression) { const node = createBaseNode(214 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParenthesizedExpression(node, expression) { return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node; } - function createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { const node = createBaseDeclaration(215 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; @@ -23618,7 +23606,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -23626,22 +23613,21 @@ function createNodeFactory(flags, baseFactory2) { node.returnFlowNode = void 0; return node; } - function updateFunctionExpression2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } - function createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { const node = createBaseDeclaration(216 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; - node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken3(38 /* EqualsGreaterThanToken */); + node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body); const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -23649,8 +23635,8 @@ function createNodeFactory(flags, baseFactory2) { node.returnFlowNode = void 0; return node; } - function updateArrowFunction3(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; + function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; } function createDeleteExpression(expression) { const node = createBaseNode(217 /* DeleteExpression */); @@ -23739,7 +23725,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */; } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function propagateAssignmentPatternFlags(node) { @@ -23768,9 +23753,9 @@ function createNodeFactory(flags, baseFactory2) { function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { const node = createBaseNode(224 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); - node.questionToken = questionToken != null ? questionToken : createToken3(57 /* QuestionToken */); + node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); - node.colonToken = colonToken != null ? colonToken : createToken3(58 /* ColonToken */); + node.colonToken = colonToken != null ? colonToken : createToken(58 /* ColonToken */); node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse); node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse); return node; @@ -23778,15 +23763,15 @@ function createNodeFactory(flags, baseFactory2) { function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) { return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; } - function createTemplateExpression2(head, templateSpans) { + function createTemplateExpression(head, templateSpans) { const node = createBaseNode(225 /* TemplateExpression */); node.head = head; - node.templateSpans = createNodeArray2(templateSpans); + node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */; return node; } - function updateTemplateExpression2(node, head, templateSpans) { - return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression2(head, templateSpans), node) : node; + function updateTemplateExpression(node, head, templateSpans) { + return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression(head, templateSpans), node) : node; } function checkTemplateLiteralLikeNode(kind, text, rawText, templateFlags = 0 /* None */) { Debug.assert(!(templateFlags & ~2048 /* TemplateLiteralLikeFlags */), "Unsupported template flags."); @@ -23836,19 +23821,19 @@ function createNodeFactory(flags, baseFactory2) { } return createTemplateLiteralLikeToken(kind, text, rawText, templateFlags); } - function createTemplateHead2(text, rawText, templateFlags) { + function createTemplateHead(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); } - function createTemplateMiddle2(text, rawText, templateFlags) { + function createTemplateMiddle(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(16 /* TemplateMiddle */, text, rawText, templateFlags); } - function createTemplateTail2(text, rawText, templateFlags) { + function createTemplateTail(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(17 /* TemplateTail */, text, rawText, templateFlags); } - function createNoSubstitutionTemplateLiteral2(text, rawText, templateFlags) { + function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeDeclaration(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags); } @@ -23872,25 +23857,24 @@ function createNodeFactory(flags, baseFactory2) { function updateSpreadElement(node, expression) { return node.expression !== expression ? update(createSpreadElement(expression), node) : node; } - function createClassExpression3(modifiers, name, typeParameters, heritageClauses, members) { + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(228 /* ClassExpression */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateClassExpression3(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression3(modifiers, name, typeParameters, heritageClauses, members), node) : node; + function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function createOmittedExpression2() { + function createOmittedExpression() { return createBaseNode(229 /* OmittedExpression */); } - function createExpressionWithTypeArguments3(expression, typeArguments) { + function createExpressionWithTypeArguments(expression, typeArguments) { const node = createBaseNode(230 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -23901,20 +23885,20 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */; return node; } - function updateExpressionWithTypeArguments3(node, expression, typeArguments) { - return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments3(expression, typeArguments), node) : node; + function updateExpressionWithTypeArguments(node, expression, typeArguments) { + return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node; } - function createAsExpression2(expression, type) { + function createAsExpression(expression, type) { const node = createBaseNode(231 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; return node; } - function updateAsExpression2(node, expression, type) { - return node.expression !== expression || node.type !== type ? update(createAsExpression2(expression, type), node) : node; + function updateAsExpression(node, expression, type) { + return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node; } - function createNonNullExpression2(expression) { + function createNonNullExpression(expression) { const node = createBaseNode(232 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -23924,11 +23908,11 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; return node; } - function updateNonNullExpression2(node, expression) { + function updateNonNullExpression(node, expression) { if (isNonNullChain(node)) { - return updateNonNullChain2(node, expression); + return updateNonNullChain(node, expression); } - return node.expression !== expression ? update(createNonNullExpression2(expression), node) : node; + return node.expression !== expression ? update(createNonNullExpression(expression), node) : node; } function createSatisfiesExpression(expression, type) { const node = createBaseNode(235 /* SatisfiesExpression */); @@ -23940,7 +23924,7 @@ function createNodeFactory(flags, baseFactory2) { function updateSatisfiesExpression(node, expression, type) { return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node; } - function createNonNullChain2(expression) { + function createNonNullChain(expression) { const node = createBaseNode(232 /* NonNullExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( @@ -23951,11 +23935,11 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; return node; } - function updateNonNullChain2(node, expression) { + function updateNonNullChain(node, expression) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); - return node.expression !== expression ? update(createNonNullChain2(expression), node) : node; + return node.expression !== expression ? update(createNonNullChain(expression), node) : node; } - function createMetaProperty2(keywordToken, name) { + function createMetaProperty(keywordToken, name) { const node = createBaseNode(233 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; @@ -23973,72 +23957,67 @@ function createNodeFactory(flags, baseFactory2) { node.flowNode = void 0; return node; } - function updateMetaProperty2(node, name) { - return node.name !== name ? update(createMetaProperty2(node.keywordToken, name), node) : node; + function updateMetaProperty(node, name) { + return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node; } - function createTemplateSpan2(expression, literal) { + function createTemplateSpan(expression, literal) { const node = createBaseNode(236 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */; return node; } - function updateTemplateSpan2(node, expression, literal) { - return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan2(expression, literal), node) : node; + function updateTemplateSpan(node, expression, literal) { + return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node; } - function createSemicolonClassElement2() { + function createSemicolonClassElement() { const node = createBaseNode(237 /* SemicolonClassElement */); node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createBlock2(statements, multiLine) { + function createBlock(statements, multiLine) { const node = createBaseNode(238 /* Block */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateBlock2(node, statements) { - return node.statements !== statements ? update(createBlock2(statements, node.multiLine), node) : node; + function updateBlock(node, statements) { + return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node; } - function createVariableStatement2(modifiers, declarationList) { + function createVariableStatement(modifiers, declarationList) { const node = createBaseNode(240 /* VariableStatement */); node.modifiers = asNodeArray(modifiers); - node.declarationList = isArray(declarationList) ? createVariableDeclarationList2(declarationList) : declarationList; + node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function updateVariableStatement2(node, modifiers, declarationList) { - return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement2(modifiers, declarationList), node) : node; + function updateVariableStatement(node, modifiers, declarationList) { + return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node; } - function createEmptyStatement2() { + function createEmptyStatement() { const node = createBaseNode(239 /* EmptyStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function createExpressionStatement2(expression) { + function createExpressionStatement(expression) { const node = createBaseNode(241 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function updateExpressionStatement2(node, expression) { - return node.expression !== expression ? update(createExpressionStatement2(expression), node) : node; + function updateExpressionStatement(node, expression) { + return node.expression !== expression ? update(createExpressionStatement(expression), node) : node; } function createIfStatement(expression, thenStatement, elseStatement) { const node = createBaseNode(242 /* IfStatement */); @@ -24047,7 +24026,6 @@ function createNodeFactory(flags, baseFactory2) { node.elseStatement = asEmbeddedStatement(elseStatement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24060,7 +24038,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24073,7 +24050,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24088,7 +24064,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -24104,7 +24079,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -24123,7 +24097,6 @@ function createNodeFactory(flags, baseFactory2) { if (awaitModifier) node.transformFlags |= 128 /* ContainsES2018 */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -24137,7 +24110,6 @@ function createNodeFactory(flags, baseFactory2) { node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24149,7 +24121,6 @@ function createNodeFactory(flags, baseFactory2) { node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24161,7 +24132,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24174,7 +24144,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24187,7 +24156,6 @@ function createNodeFactory(flags, baseFactory2) { node.caseBlock = caseBlock; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.possiblyExhaustive = false; return node; @@ -24201,7 +24169,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24213,7 +24180,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -24227,21 +24193,19 @@ function createNodeFactory(flags, baseFactory2) { node.finallyBlock = finallyBlock; node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } function updateTryStatement(node, tryBlock, catchClause, finallyBlock) { return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; } - function createDebuggerStatement2() { + function createDebuggerStatement() { const node = createBaseNode(256 /* DebuggerStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function createVariableDeclaration3(name, exclamationToken, type, initializer) { + function createVariableDeclaration(name, exclamationToken, type, initializer) { var _a2; const node = createBaseDeclaration(257 /* VariableDeclaration */); node.name = asName(name); @@ -24250,32 +24214,31 @@ function createNodeFactory(flags, baseFactory2) { node.initializer = asInitializer(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateVariableDeclaration3(node, name, exclamationToken, type, initializer) { - return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration3(name, exclamationToken, type, initializer), node) : node; + function updateVariableDeclaration(node, name, exclamationToken, type, initializer) { + return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node; } - function createVariableDeclarationList2(declarations, flags2 = 0 /* None */) { + function createVariableDeclarationList(declarations, flags2 = 0 /* None */) { const node = createBaseNode(258 /* VariableDeclarationList */); node.flags |= flags2 & 3 /* BlockScoped */; - node.declarations = createNodeArray2(declarations); + node.declarations = createNodeArray(declarations); node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; if (flags2 & 3 /* BlockScoped */) { node.transformFlags |= 1024 /* ContainsES2015 */ | 262144 /* ContainsBlockScopedBinding */; } return node; } - function updateVariableDeclarationList2(node, declarations) { - return node.declarations !== declarations ? update(createVariableDeclarationList2(declarations, node.flags), node) : node; + function updateVariableDeclarationList(node, declarations) { + return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node; } - function createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { const node = createBaseDeclaration(259 /* FunctionDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body || modifiersToFlags(node.modifiers) & 2 /* Ambient */) { @@ -24286,32 +24249,32 @@ function createNodeFactory(flags, baseFactory2) { const isAsyncGenerator = isAsync && isGenerator; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; } - node.illegalDecorators = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; node.returnFlowNode = void 0; return node; } - function updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; + function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } function finishUpdateFunctionDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members) { + function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(260 /* ClassDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } else { @@ -24321,79 +24284,54 @@ function createNodeFactory(flags, baseFactory2) { } } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateClassDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members), node) : node; + function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members) { + function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(261 /* InterfaceDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? finishUpdateInterfaceDeclaration(createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members), node) : node; + function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function finishUpdateInterfaceDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createTypeAliasDeclaration2(modifiers, name, typeParameters, type) { + function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { const node = createBaseDeclaration(262 /* TypeAliasDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? finishUpdateTypeAliasDeclaration(createTypeAliasDeclaration2(modifiers, name, typeParameters, type), node) : node; - } - function finishUpdateTypeAliasDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? update(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; } - function createEnumDeclaration2(modifiers, name, members) { + function createEnumDeclaration(modifiers, name, members) { const node = createBaseDeclaration(263 /* EnumDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateEnumDeclaration2(node, modifiers, name, members) { - return node.modifiers !== modifiers || node.name !== name || node.members !== members ? finishUpdateEnumDeclaration(createEnumDeclaration2(modifiers, name, members), node) : node; - } - function finishUpdateEnumDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateEnumDeclaration(node, modifiers, name, members) { + return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createEnumDeclaration(modifiers, name, members), node) : node; } - function createModuleDeclaration2(modifiers, name, body, flags2 = 0 /* None */) { + function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { const node = createBaseDeclaration(264 /* ModuleDeclaration */); node.modifiers = asNodeArray(modifiers); node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); @@ -24405,65 +24343,53 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateModuleDeclaration2(node, modifiers, name, body) { - return node.modifiers !== modifiers || node.name !== name || node.body !== body ? finishUpdateModuleDeclaration(createModuleDeclaration2(modifiers, name, body, node.flags), node) : node; + function updateModuleDeclaration(node, modifiers, name, body) { + return node.modifiers !== modifiers || node.name !== name || node.body !== body ? update(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; } - function finishUpdateModuleDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createModuleBlock2(statements) { + function createModuleBlock(statements) { const node = createBaseNode(265 /* ModuleBlock */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateModuleBlock2(node, statements) { - return node.statements !== statements ? update(createModuleBlock2(statements), node) : node; + function updateModuleBlock(node, statements) { + return node.statements !== statements ? update(createModuleBlock(statements), node) : node; } - function createCaseBlock2(clauses) { + function createCaseBlock(clauses) { const node = createBaseNode(266 /* CaseBlock */); - node.clauses = createNodeArray2(clauses); + node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); node.locals = void 0; node.nextContainer = void 0; return node; } - function updateCaseBlock2(node, clauses) { - return node.clauses !== clauses ? update(createCaseBlock2(clauses), node) : node; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node; } - function createNamespaceExportDeclaration2(name) { + function createNamespaceExportDeclaration(name) { const node = createBaseDeclaration(267 /* NamespaceExportDeclaration */); node.name = asName(name); node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateNamespaceExportDeclaration2(node, name) { - return node.name !== name ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration2(name), node) : node; + function updateNamespaceExportDeclaration(node, name) { + return node.name !== name ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration(name), node) : node; } function finishUpdateNamespaceExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); } - function createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference) { + function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) { const node = createBaseDeclaration(268 /* ImportEqualsDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -24474,21 +24400,13 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? finishUpdateImportEqualsDeclaration(createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference), node) : node; - } - function finishUpdateImportEqualsDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; } - function createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause) { + function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) { const node = createBaseNode(269 /* ImportDeclaration */); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -24496,21 +24414,13 @@ function createNodeFactory(flags, baseFactory2) { node.assertClause = assertClause; node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateImportDeclaration(createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause), node) : node; + function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) { + return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; } - function finishUpdateImportDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createImportClause3(isTypeOnly, name, namedBindings) { + function createImportClause(isTypeOnly, name, namedBindings) { const node = createBaseDeclaration(270 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; @@ -24522,12 +24432,12 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateImportClause3(node, isTypeOnly, name, namedBindings) { - return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause3(isTypeOnly, name, namedBindings), node) : node; + function updateImportClause(node, isTypeOnly, name, namedBindings) { + return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause(isTypeOnly, name, namedBindings), node) : node; } function createAssertClause(elements, multiLine) { const node = createBaseNode(296 /* AssertClause */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.multiLine = multiLine; node.transformFlags |= 4 /* ContainsESNext */; return node; @@ -24554,37 +24464,37 @@ function createNodeFactory(flags, baseFactory2) { function updateImportTypeAssertionContainer(node, clause, multiLine) { return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node; } - function createNamespaceImport2(name) { + function createNamespaceImport(name) { const node = createBaseDeclaration(271 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamespaceImport2(node, name) { - return node.name !== name ? update(createNamespaceImport2(name), node) : node; + function updateNamespaceImport(node, name) { + return node.name !== name ? update(createNamespaceImport(name), node) : node; } - function createNamespaceExport2(name) { + function createNamespaceExport(name) { const node = createBaseDeclaration(277 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamespaceExport2(node, name) { - return node.name !== name ? update(createNamespaceExport2(name), node) : node; + function updateNamespaceExport(node, name) { + return node.name !== name ? update(createNamespaceExport(name), node) : node; } - function createNamedImports2(elements) { + function createNamedImports(elements) { const node = createBaseNode(272 /* NamedImports */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamedImports2(node, elements) { - return node.elements !== elements ? update(createNamedImports2(elements), node) : node; + function updateNamedImports(node, elements) { + return node.elements !== elements ? update(createNamedImports(elements), node) : node; } - function createImportSpecifier2(isTypeOnly, propertyName, name) { + function createImportSpecifier(isTypeOnly, propertyName, name) { const node = createBaseDeclaration(273 /* ImportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = propertyName; @@ -24593,10 +24503,10 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateImportSpecifier2(node, isTypeOnly, propertyName, name) { - return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier2(isTypeOnly, propertyName, name), node) : node; + function updateImportSpecifier(node, isTypeOnly, propertyName, name) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node; } - function createExportAssignment3(modifiers, isExportEquals, expression) { + function createExportAssignment2(modifiers, isExportEquals, expression) { const node = createBaseDeclaration(274 /* ExportAssignment */); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -24608,21 +24518,13 @@ function createNodeFactory(flags, baseFactory2) { ) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportAssignment2(node, modifiers, expression) { - return node.modifiers !== modifiers || node.expression !== expression ? finishUpdateExportAssignment(createExportAssignment3(modifiers, node.isExportEquals, expression), node) : node; + function updateExportAssignment(node, modifiers, expression) { + return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node; } - function finishUpdateExportAssignment(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { const node = createBaseDeclaration(275 /* ExportDeclaration */); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -24631,31 +24533,31 @@ function createNodeFactory(flags, baseFactory2) { node.assertClause = assertClause; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; + function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; } function finishUpdateExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return update(updated, original); } - function createNamedExports2(elements) { + function createNamedExports(elements) { const node = createBaseNode(276 /* NamedExports */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamedExports2(node, elements) { - return node.elements !== elements ? update(createNamedExports2(elements), node) : node; + function updateNamedExports(node, elements) { + return node.elements !== elements ? update(createNamedExports(elements), node) : node; } - function createExportSpecifier2(isTypeOnly, propertyName, name) { + function createExportSpecifier(isTypeOnly, propertyName, name) { const node = createBaseNode(278 /* ExportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = asName(propertyName); @@ -24663,27 +24565,25 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportSpecifier2(node, isTypeOnly, propertyName, name) { - return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier2(isTypeOnly, propertyName, name), node) : node; + function updateExportSpecifier(node, isTypeOnly, propertyName, name) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createMissingDeclaration() { const node = createBaseDeclaration(279 /* MissingDeclaration */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function createExternalModuleReference2(expression) { + function createExternalModuleReference(expression) { const node = createBaseNode(280 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateExternalModuleReference2(node, expression) { - return node.expression !== expression ? update(createExternalModuleReference2(expression), node) : node; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression ? update(createExternalModuleReference(expression), node) : node; } function createJSDocPrimaryTypeWorker(kind) { return createBaseNode(kind); @@ -24713,7 +24613,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -24722,40 +24621,39 @@ function createNodeFactory(flags, baseFactory2) { function updateJSDocFunctionType(node, parameters, type) { return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node; } - function createJSDocTypeLiteral2(propertyTags, isArrayType = false) { + function createJSDocTypeLiteral(propertyTags, isArrayType = false) { const node = createBaseDeclaration(325 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; } function updateJSDocTypeLiteral(node, propertyTags, isArrayType) { - return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral2(propertyTags, isArrayType), node) : node; + return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; } - function createJSDocTypeExpression2(type) { + function createJSDocTypeExpression(type) { const node = createBaseNode(312 /* JSDocTypeExpression */); node.type = type; return node; } function updateJSDocTypeExpression(node, type) { - return node.type !== type ? update(createJSDocTypeExpression2(type), node) : node; + return node.type !== type ? update(createJSDocTypeExpression(type), node) : node; } - function createJSDocSignature2(typeParameters, parameters, type) { + function createJSDocSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(326 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } function updateJSDocSignature(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? update(createJSDocSignature2(typeParameters, parameters, type), node) : node; + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? update(createJSDocSignature(typeParameters, parameters, type), node) : node; } function getDefaultTagName(node) { const defaultTagName = getDefaultTagNameForKind(node.kind); - return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier3(defaultTagName); + return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier(defaultTagName); } function createBaseJSDocTag(kind, tagName, comment) { const node = createBaseNode(kind); @@ -24769,17 +24667,17 @@ function createNodeFactory(flags, baseFactory2) { node.comment = comment; return node; } - function createJSDocTemplateTag2(tagName, constraint, typeParameters, comment) { - const node = createBaseJSDocTag(348 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment); + function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { + const node = createBaseJSDocTag(348 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment); node.constraint = constraint; - node.typeParameters = createNodeArray2(typeParameters); + node.typeParameters = createNodeArray(typeParameters); return node; } function updateJSDocTemplateTag(node, tagName = getDefaultTagName(node), constraint, typeParameters, comment) { - return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag2(tagName, constraint, typeParameters, comment), node) : node; + return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; } - function createJSDocTypedefTag2(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(349 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment); + function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { + const node = createBaseJSDocTagDeclaration(349 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -24788,10 +24686,10 @@ function createNodeFactory(flags, baseFactory2) { return node; } function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag2(tagName, typeExpression, fullName, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; } - function createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(344 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment); + function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { + const node = createBaseJSDocTagDeclaration(344 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -24799,10 +24697,10 @@ function createNodeFactory(flags, baseFactory2) { return node; } function updateJSDocParameterTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { - return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; + return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } - function createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(351 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment); + function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { + const node = createBaseJSDocTagDeclaration(351 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -24810,10 +24708,10 @@ function createNodeFactory(flags, baseFactory2) { return node; } function updateJSDocPropertyTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { - return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; + return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } - function createJSDocCallbackTag2(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment); + function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { + const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -24822,31 +24720,31 @@ function createNodeFactory(flags, baseFactory2) { return node; } function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag2(tagName, typeExpression, fullName, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocOverloadTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTag(342 /* JSDocOverloadTag */, tagName != null ? tagName : createIdentifier3("overload"), comment); + const node = createBaseJSDocTag(342 /* JSDocOverloadTag */, tagName != null ? tagName : createIdentifier("overload"), comment); node.typeExpression = typeExpression; return node; } function updateJSDocOverloadTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocOverloadTag(tagName, typeExpression, comment), node) : node; } - function createJSDocAugmentsTag2(tagName, className, comment) { - const node = createBaseJSDocTag(331 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment); + function createJSDocAugmentsTag(tagName, className, comment) { + const node = createBaseJSDocTag(331 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } function updateJSDocAugmentsTag(node, tagName = getDefaultTagName(node), className, comment) { - return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag2(tagName, className, comment), node) : node; + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node; } - function createJSDocImplementsTag2(tagName, className, comment) { - const node = createBaseJSDocTag(332 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment); + function createJSDocImplementsTag(tagName, className, comment) { + const node = createBaseJSDocTag(332 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } function createJSDocSeeTag(tagName, name, comment) { - const node = createBaseJSDocTag(350 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment); + const node = createBaseJSDocTag(350 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment); node.name = name; return node; } @@ -24899,17 +24797,17 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createJSDocLinkPlain(name, text), node) : node; } function updateJSDocImplementsTag(node, tagName = getDefaultTagName(node), className, comment) { - return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocImplementsTag2(tagName, className, comment), node) : node; + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocImplementsTag(tagName, className, comment), node) : node; } function createJSDocSimpleTagWorker(kind, tagName, comment) { - const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(kind)), comment); + const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); return node; } function updateJSDocSimpleTagWorker(kind, node, tagName = getDefaultTagName(node), comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocSimpleTagWorker(kind, tagName, comment), node) : node; } function createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment) { - const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(kind)), comment); + const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); node.typeExpression = typeExpression; return node; } @@ -24923,15 +24821,15 @@ function createNodeFactory(flags, baseFactory2) { function updateJSDocUnknownTag(node, tagName, comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node; } - function createJSDocEnumTag2(tagName, typeExpression, comment) { - const node = createBaseJSDocTagDeclaration(343 /* JSDocEnumTag */, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(343 /* JSDocEnumTag */)), comment); + function createJSDocEnumTag(tagName, typeExpression, comment) { + const node = createBaseJSDocTagDeclaration(343 /* JSDocEnumTag */, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(343 /* JSDocEnumTag */)), comment); node.typeExpression = typeExpression; node.locals = void 0; node.nextContainer = void 0; return node; } function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag2(tagName, typeExpression, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node; } function createJSDocText(text) { const node = createBaseNode(324 /* JSDocText */); @@ -24941,27 +24839,27 @@ function createNodeFactory(flags, baseFactory2) { function updateJSDocText(node, text) { return node.text !== text ? update(createJSDocText(text), node) : node; } - function createJSDocComment2(comment, tags) { + function createJSDocComment(comment, tags) { const node = createBaseNode(323 /* JSDoc */); node.comment = comment; node.tags = asNodeArray(tags); return node; } function updateJSDocComment(node, comment, tags) { - return node.comment !== comment || node.tags !== tags ? update(createJSDocComment2(comment, tags), node) : node; + return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node; } - function createJsxElement2(openingElement, children, closingElement) { + function createJsxElement(openingElement, children, closingElement) { const node = createBaseNode(281 /* JsxElement */); node.openingElement = openingElement; - node.children = createNodeArray2(children); + node.children = createNodeArray(children); node.closingElement = closingElement; node.transformFlags |= propagateChildFlags(node.openingElement) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingElement) | 2 /* ContainsJsx */; return node; } - function updateJsxElement2(node, openingElement, children, closingElement) { - return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement2(openingElement, children, closingElement), node) : node; + function updateJsxElement(node, openingElement, children, closingElement) { + return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node; } - function createJsxSelfClosingElement2(tagName, typeArguments, attributes) { + function createJsxSelfClosingElement(tagName, typeArguments, attributes) { const node = createBaseNode(282 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); @@ -24972,10 +24870,10 @@ function createNodeFactory(flags, baseFactory2) { } return node; } - function updateJsxSelfClosingElement2(node, tagName, typeArguments, attributes) { - return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement2(tagName, typeArguments, attributes), node) : node; + function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; } - function createJsxOpeningElement2(tagName, typeArguments, attributes) { + function createJsxOpeningElement(tagName, typeArguments, attributes) { const node = createBaseNode(283 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); @@ -24986,112 +24884,111 @@ function createNodeFactory(flags, baseFactory2) { } return node; } - function updateJsxOpeningElement2(node, tagName, typeArguments, attributes) { - return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement2(tagName, typeArguments, attributes), node) : node; + function updateJsxOpeningElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; } - function createJsxClosingElement2(tagName) { + function createJsxClosingElement(tagName) { const node = createBaseNode(284 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */; return node; } - function updateJsxClosingElement2(node, tagName) { - return node.tagName !== tagName ? update(createJsxClosingElement2(tagName), node) : node; + function updateJsxClosingElement(node, tagName) { + return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node; } - function createJsxFragment2(openingFragment, children, closingFragment) { + function createJsxFragment(openingFragment, children, closingFragment) { const node = createBaseNode(285 /* JsxFragment */); node.openingFragment = openingFragment; - node.children = createNodeArray2(children); + node.children = createNodeArray(children); node.closingFragment = closingFragment; node.transformFlags |= propagateChildFlags(node.openingFragment) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingFragment) | 2 /* ContainsJsx */; return node; } - function updateJsxFragment2(node, openingFragment, children, closingFragment) { - return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update(createJsxFragment2(openingFragment, children, closingFragment), node) : node; + function updateJsxFragment(node, openingFragment, children, closingFragment) { + return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update(createJsxFragment(openingFragment, children, closingFragment), node) : node; } - function createJsxText2(text, containsOnlyTriviaWhiteSpaces) { + function createJsxText(text, containsOnlyTriviaWhiteSpaces) { const node = createBaseNode(11 /* JsxText */); node.text = text; node.containsOnlyTriviaWhiteSpaces = !!containsOnlyTriviaWhiteSpaces; node.transformFlags |= 2 /* ContainsJsx */; return node; } - function updateJsxText2(node, text, containsOnlyTriviaWhiteSpaces) { - return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText2(text, containsOnlyTriviaWhiteSpaces), node) : node; + function updateJsxText(node, text, containsOnlyTriviaWhiteSpaces) { + return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; } - function createJsxOpeningFragment2() { + function createJsxOpeningFragment() { const node = createBaseNode(286 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } - function createJsxJsxClosingFragment2() { + function createJsxJsxClosingFragment() { const node = createBaseNode(287 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } - function createJsxAttribute2(name, initializer) { + function createJsxAttribute(name, initializer) { const node = createBaseDeclaration(288 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */; return node; } - function updateJsxAttribute2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute2(name, initializer), node) : node; + function updateJsxAttribute(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node; } - function createJsxAttributes2(properties) { + function createJsxAttributes(properties) { const node = createBaseDeclaration(289 /* JsxAttributes */); - node.properties = createNodeArray2(properties); + node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */; return node; } - function updateJsxAttributes2(node, properties) { - return node.properties !== properties ? update(createJsxAttributes2(properties), node) : node; + function updateJsxAttributes(node, properties) { + return node.properties !== properties ? update(createJsxAttributes(properties), node) : node; } - function createJsxSpreadAttribute2(expression) { + function createJsxSpreadAttribute(expression) { const node = createBaseNode(290 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; } - function updateJsxSpreadAttribute2(node, expression) { - return node.expression !== expression ? update(createJsxSpreadAttribute2(expression), node) : node; + function updateJsxSpreadAttribute(node, expression) { + return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node; } - function createJsxExpression2(dotDotDotToken, expression) { + function createJsxExpression(dotDotDotToken, expression) { const node = createBaseNode(291 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; } - function updateJsxExpression2(node, expression) { - return node.expression !== expression ? update(createJsxExpression2(node.dotDotDotToken, expression), node) : node; + function updateJsxExpression(node, expression) { + return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node; } - function createCaseClause2(expression, statements) { + function createCaseClause(expression, statements) { const node = createBaseNode(292 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateCaseClause2(node, expression, statements) { - return node.expression !== expression || node.statements !== statements ? update(createCaseClause2(expression, statements), node) : node; + function updateCaseClause(node, expression, statements) { + return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node; } - function createDefaultClause2(statements) { + function createDefaultClause(statements) { const node = createBaseNode(293 /* DefaultClause */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; } - function updateDefaultClause2(node, statements) { - return node.statements !== statements ? update(createDefaultClause2(statements), node) : node; + function updateDefaultClause(node, statements) { + return node.statements !== statements ? update(createDefaultClause(statements), node) : node; } - function createHeritageClause2(token, types) { + function createHeritageClause(token, types) { const node = createBaseNode(294 /* HeritageClause */); node.token = token; - node.types = createNodeArray2(types); + node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); switch (token) { case 94 /* ExtendsKeyword */: @@ -25105,10 +25002,10 @@ function createNodeFactory(flags, baseFactory2) { } return node; } - function updateHeritageClause2(node, types) { - return node.types !== types ? update(createHeritageClause2(node.token, types), node) : node; + function updateHeritageClause(node, types) { + return node.types !== types ? update(createHeritageClause(node.token, types), node) : node; } - function createCatchClause2(variableDeclaration, block) { + function createCatchClause(variableDeclaration, block) { const node = createBaseNode(295 /* CatchClause */); node.variableDeclaration = asVariableDeclaration(variableDeclaration); node.block = block; @@ -25117,87 +25014,79 @@ function createNodeFactory(flags, baseFactory2) { node.nextContainer = void 0; return node; } - function updateCatchClause2(node, variableDeclaration, block) { - return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause2(variableDeclaration, block), node) : node; + function updateCatchClause(node, variableDeclaration, block) { + return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node; } - function createPropertyAssignment2(name, initializer) { + function createPropertyAssignment(name, initializer) { const node = createBaseDeclaration(299 /* PropertyAssignment */); node.name = asName(name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updatePropertyAssignment2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment2(name, initializer), node) : node; + function updatePropertyAssignment(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment(name, initializer), node) : node; } function finishUpdatePropertyAssignment(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; } return update(updated, original); } - function createShorthandPropertyAssignment2(name, objectAssignmentInitializer) { + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { const node = createBaseDeclaration(300 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; node.equalsToken = void 0; - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateShorthandPropertyAssignment2(node, name, objectAssignmentInitializer) { - return node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment2(name, objectAssignmentInitializer), node) : node; + function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { + return node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node) : node; } function finishUpdateShorthandPropertyAssignment(updated, original) { if (updated !== original) { - updated.equalsToken = original.equalsToken; - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; + updated.equalsToken = original.equalsToken; } return update(updated, original); } - function createSpreadAssignment2(expression) { + function createSpreadAssignment(expression) { const node = createBaseDeclaration(301 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateSpreadAssignment2(node, expression) { - return node.expression !== expression ? update(createSpreadAssignment2(expression), node) : node; + function updateSpreadAssignment(node, expression) { + return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node; } - function createEnumMember2(name, initializer) { + function createEnumMember(name, initializer) { const node = createBaseDeclaration(302 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateEnumMember2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? update(createEnumMember2(name, initializer), node) : node; + function updateEnumMember(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node; } function createSourceFile2(statements, endOfFileToken, flags2) { const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags2; node.text = ""; @@ -25298,7 +25187,7 @@ function createNodeFactory(flags, baseFactory2) { } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { const node = cloneSourceFile(source); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.isDeclarationFile = isDeclarationFile; node.referencedFiles = referencedFiles; node.typeReferenceDirectives = typeReferences; @@ -25310,7 +25199,7 @@ function createNodeFactory(flags, baseFactory2) { function updateSourceFile2(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) { return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; } - function createBundle2(sourceFiles, prepends = emptyArray) { + function createBundle(sourceFiles, prepends = emptyArray) { const node = createBaseNode(309 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; @@ -25320,8 +25209,8 @@ function createNodeFactory(flags, baseFactory2) { node.hasNoDefaultLib = void 0; return node; } - function updateBundle2(node, sourceFiles, prepends = emptyArray) { - return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle2(sourceFiles, prepends), node) : node; + function updateBundle(node, sourceFiles, prepends = emptyArray) { + return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle(sourceFiles, prepends), node) : node; } function createUnparsedSource(prologues, syntheticReferences, texts) { const node = createBaseNode(310 /* UnparsedSource */); @@ -25371,26 +25260,26 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createSyntaxList3(children) { - const node = createBaseNode(353 /* SyntaxList */); + const node = createBaseNode(354 /* SyntaxList */); node._children = children; return node; } - function createNotEmittedStatement2(original) { - const node = createBaseNode(354 /* NotEmittedStatement */); + function createNotEmittedStatement(original) { + const node = createBaseNode(355 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; } - function createPartiallyEmittedExpression2(expression, original) { - const node = createBaseNode(355 /* PartiallyEmittedExpression */); + function createPartiallyEmittedExpression(expression, original) { + const node = createBaseNode(356 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; setTextRange(node, original); return node; } - function updatePartiallyEmittedExpression2(node, expression) { - return node.expression !== expression ? update(createPartiallyEmittedExpression2(expression, node.original), node) : node; + function updatePartiallyEmittedExpression(node, expression) { + return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node; } function flattenCommaElements(node) { if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { @@ -25404,8 +25293,8 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createCommaListExpression(elements) { - const node = createBaseNode(356 /* CommaListExpression */); - node.elements = createNodeArray2(sameFlatMap(elements, flattenCommaElements)); + const node = createBaseNode(357 /* CommaListExpression */); + node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; } @@ -25413,19 +25302,19 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; } function createEndOfDeclarationMarker(original) { - const node = createBaseNode(358 /* EndOfDeclarationMarker */); + const node = createBaseNode(359 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createMergeDeclarationMarker(original) { - const node = createBaseNode(357 /* MergeDeclarationMarker */); + const node = createBaseNode(358 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(359 /* SyntheticReferenceExpression */); + const node = createBaseNode(360 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); @@ -25435,36 +25324,32 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node; } function cloneGeneratedIdentifier(node) { - const clone2 = createBaseIdentifier( - node.escapedText, - /*originalKeywordKind*/ - void 0 - ); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function cloneIdentifier(node) { - const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.typeArguments = node.typeArguments; - clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape; clone2.jsDoc = node.jsDoc; - clone2.jsDocCache = node.jsDocCache; clone2.flowNode = node.flowNode; clone2.symbol = node.symbol; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + const typeArguments = getIdentifierTypeArguments(node); + if (typeArguments) + setIdentifierTypeArguments(clone2, typeArguments); return clone2; } function cloneGeneratedPrivateIdentifier(node) { const clone2 = createBasePrivateIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function clonePrivateIdentifier(node) { @@ -25505,9 +25390,9 @@ function createNodeFactory(flags, baseFactory2) { } return clone2; } - function createImmediatelyInvokedFunctionExpression2(statements, param, paramValue) { + function createImmediatelyInvokedFunctionExpression(statements, param, paramValue) { return createCallExpression( - createFunctionExpression2( + createFunctionExpression( /*modifiers*/ void 0, /*asteriskToken*/ @@ -25520,7 +25405,7 @@ function createNodeFactory(flags, baseFactory2) { param ? [param] : [], /*type*/ void 0, - createBlock2( + createBlock( statements, /*multiLine*/ true @@ -25532,9 +25417,9 @@ function createNodeFactory(flags, baseFactory2) { paramValue ? [paramValue] : [] ); } - function createImmediatelyInvokedArrowFunction2(statements, param, paramValue) { + function createImmediatelyInvokedArrowFunction(statements, param, paramValue) { return createCallExpression( - createArrowFunction3( + createArrowFunction( /*modifiers*/ void 0, /*typeParameters*/ @@ -25545,7 +25430,7 @@ function createNodeFactory(flags, baseFactory2) { void 0, /*equalsGreaterThanToken*/ void 0, - createBlock2( + createBlock( statements, /*multiLine*/ true @@ -25557,11 +25442,11 @@ function createNodeFactory(flags, baseFactory2) { paramValue ? [paramValue] : [] ); } - function createVoidZero2() { - return createVoidExpression(createNumericLiteral2("0")); + function createVoidZero() { + return createVoidExpression(createNumericLiteral("0")); } - function createExportDefault2(expression) { - return createExportAssignment3( + function createExportDefault(expression) { + return createExportAssignment2( /*modifiers*/ void 0, /*isExportEquals*/ @@ -25569,14 +25454,14 @@ function createNodeFactory(flags, baseFactory2) { expression ); } - function createExternalModuleExport2(exportName) { - return createExportDeclaration3( + function createExternalModuleExport(exportName) { + return createExportDeclaration( /*modifiers*/ void 0, /*isTypeOnly*/ false, - createNamedExports2([ - createExportSpecifier2( + createNamedExports([ + createExportSpecifier( /*isTypeOnly*/ false, /*propertyName*/ @@ -25587,12 +25472,12 @@ function createNodeFactory(flags, baseFactory2) { ); } function createTypeCheck(value, tag) { - return tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero2()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral2(tag)); + return tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral(tag)); } function createMethodCall(object, methodName, argumentsList) { if (isCallChain(object)) { - return createCallChain2( - createPropertyAccessChain2( + return createCallChain( + createPropertyAccessChain( object, /*questionDotToken*/ void 0, @@ -25622,7 +25507,7 @@ function createNodeFactory(flags, baseFactory2) { return createMethodCall(target, "apply", [thisArg, argumentsExpression]); } function createGlobalMethodCall(globalObjectName, methodName, argumentsList) { - return createMethodCall(createIdentifier3(globalObjectName), methodName, argumentsList); + return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList); } function createArraySliceCall(array, start2) { return createMethodCall(array, "slice", start2 === void 0 ? [] : [asExpression(start2)]); @@ -25633,6 +25518,9 @@ function createNodeFactory(flags, baseFactory2) { function createObjectDefinePropertyCall(target, propertyName, attributes) { return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); } + function createObjectGetOwnPropertyDescriptorCall(target, propertyName) { + return createGlobalMethodCall("Object", "getOwnPropertyDescriptor", [target, asExpression(propertyName)]); + } function createReflectGetCall(target, propertyKey, receiver) { return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); } @@ -25641,7 +25529,7 @@ function createNodeFactory(flags, baseFactory2) { } function tryAddPropertyAssignment(properties, propertyName, expression) { if (expression) { - properties.push(createPropertyAssignment2(propertyName, expression)); + properties.push(createPropertyAssignment(propertyName, expression)); return true; } return false; @@ -25662,15 +25550,15 @@ function createNodeFactory(flags, baseFactory2) { case 214 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); case 213 /* TypeAssertionExpression */: - return updateTypeAssertion2(outerExpression, outerExpression.type, expression); + return updateTypeAssertion(outerExpression, outerExpression.type, expression); case 231 /* AsExpression */: - return updateAsExpression2(outerExpression, expression, outerExpression.type); + return updateAsExpression(outerExpression, expression, outerExpression.type); case 235 /* SatisfiesExpression */: return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); case 232 /* NonNullExpression */: - return updateNonNullExpression2(outerExpression, expression); - case 355 /* PartiallyEmittedExpression */: - return updatePartiallyEmittedExpression2(outerExpression, expression); + return updateNonNullExpression(outerExpression, expression); + case 356 /* PartiallyEmittedExpression */: + return updatePartiallyEmittedExpression(outerExpression, expression); } } function isIgnorableParen(node) { @@ -25726,13 +25614,13 @@ function createNodeFactory(flags, baseFactory2) { let thisArg; let target; if (isSuperProperty(callee)) { - thisArg = createThis2(); + thisArg = createThis(); target = callee; } else if (isSuperKeyword(callee)) { - thisArg = createThis2(); - target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier3("_super"), callee) : callee; + thisArg = createThis(); + target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier("_super"), callee) : callee; } else if (getEmitFlags(callee) & 8192 /* HelperName */) { - thisArg = createVoidZero2(); + thisArg = createVoidZero(); target = parenthesizerRules().parenthesizeLeftSideOfAccess( callee, /*optionalChain*/ @@ -25740,7 +25628,7 @@ function createNodeFactory(flags, baseFactory2) { ); } else if (isPropertyAccessExpression(callee)) { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable3(recordTempVariable); + thisArg = createTempVariable(recordTempVariable); target = createPropertyAccessExpression( setTextRange( factory2.createAssignment( @@ -25758,7 +25646,7 @@ function createNodeFactory(flags, baseFactory2) { } } else if (isElementAccessExpression(callee)) { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable3(recordTempVariable); + thisArg = createTempVariable(recordTempVariable); target = createElementAccessExpression( setTextRange( factory2.createAssignment( @@ -25775,7 +25663,7 @@ function createNodeFactory(flags, baseFactory2) { target = callee; } } else { - thisArg = createVoidZero2(); + thisArg = createVoidZero(); target = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -25806,8 +25694,8 @@ function createNodeFactory(flags, baseFactory2) { /*initializer*/ void 0 )], - createBlock2([ - createExpressionStatement2(expression) + createBlock([ + createExpressionStatement(expression) ]) ) ]) @@ -25831,7 +25719,7 @@ function createNodeFactory(flags, baseFactory2) { setEmitFlags(name, emitFlags); return name; } - return getGeneratedNameForNode3(node); + return getGeneratedNameForNode(node); } function getInternalName(node, allowComments, allowSourceMaps) { return getName(node, allowComments, allowSourceMaps, 32768 /* LocalName */ | 65536 /* InternalName */); @@ -25871,7 +25759,7 @@ function createNodeFactory(flags, baseFactory2) { return isStringLiteral(node.expression) && node.expression.text === "use strict"; } function createUseStrictPrologue() { - return startOnNewLine(createExpressionStatement2(createStringLiteral2("use strict"))); + return startOnNewLine(createExpressionStatement(createStringLiteral("use strict"))); } function copyStandardPrologue(source, target, statementOffset = 0, ensureUseStrict2) { Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); @@ -25910,13 +25798,13 @@ function createNodeFactory(flags, baseFactory2) { function ensureUseStrict(statements) { const foundUseStrict = findUseStrictPrologue(statements); if (!foundUseStrict) { - return setTextRange(createNodeArray2([createUseStrictPrologue(), ...statements]), statements); + return setTextRange(createNodeArray([createUseStrictPrologue(), ...statements]), statements); } return statements; } function liftToBlock(nodes) { Debug.assert(every(nodes, isStatementOrBlock), "Cannot lift nodes to a Block."); - return singleOrUndefined(nodes) || createBlock2(nodes); + return singleOrUndefined(nodes) || createBlock(nodes); } function findSpanEnd(array, test, start2) { let i = start2; @@ -25965,7 +25853,7 @@ function createNodeFactory(flags, baseFactory2) { } } if (isNodeArray(statements)) { - return setTextRange(createNodeArray2(left, statements.hasTrailingComma), statements); + return setTextRange(createNodeArray(left, statements.hasTrailingComma), statements); } return statements; } @@ -25973,33 +25861,33 @@ function createNodeFactory(flags, baseFactory2) { var _a2; let modifierArray; if (typeof modifiers === "number") { - modifierArray = createModifiersFromModifierFlags2(modifiers); + modifierArray = createModifiersFromModifierFlags(modifiers); } else { modifierArray = modifiers; } - return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node); + return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node); } function asNodeArray(array) { - return array ? createNodeArray2(array) : void 0; + return array ? createNodeArray(array) : void 0; } function asName(name) { - return typeof name === "string" ? createIdentifier3(name) : name; + return typeof name === "string" ? createIdentifier(name) : name; } function asExpression(value) { - return typeof value === "string" ? createStringLiteral2(value) : typeof value === "number" ? createNumericLiteral2(value) : typeof value === "boolean" ? value ? createTrue2() : createFalse2() : value; + return typeof value === "string" ? createStringLiteral(value) : typeof value === "number" ? createNumericLiteral(value) : typeof value === "boolean" ? value ? createTrue() : createFalse() : value; } function asInitializer(node) { return node && parenthesizerRules().parenthesizeExpressionForDisallowedComma(node); } function asToken(value) { - return typeof value === "number" ? createToken3(value) : value; + return typeof value === "number" ? createToken(value) : value; } function asEmbeddedStatement(statement) { - return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement2(), statement), statement) : statement; + return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement; } function asVariableDeclaration(variableDeclaration) { if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) { - return createVariableDeclaration3( + return createVariableDeclaration( variableDeclaration, /*exclamationToken*/ void 0, @@ -26205,7 +26093,7 @@ function getTransformFlagsSubtreeExclusions(kind) { case 213 /* TypeAssertionExpression */: case 235 /* SatisfiesExpression */: case 231 /* AsExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 214 /* ParenthesizedExpression */: case 106 /* SuperKeyword */: return -2147483648 /* OuterExpressionExcludes */; @@ -26488,6 +26376,7 @@ function setOriginalNode(node, original) { function mergeEmitNode(sourceEmitNode, destEmitNode) { const { flags, + internalFlags, leadingComments, trailingComments, commentRange, @@ -26505,7 +26394,9 @@ function mergeEmitNode(sourceEmitNode, destEmitNode) { if (trailingComments) destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); if (flags) - destEmitNode.flags = flags & ~536870912 /* Immutable */; + destEmitNode.flags = flags; + if (internalFlags) + destEmitNode.internalFlags = internalFlags & ~8 /* Immutable */; if (commentRange) destEmitNode.commentRange = commentRange; if (sourceMapRange) @@ -26547,7 +26438,7 @@ function getOrCreateEmitNode(node) { } node.emitNode = {}; } else { - Debug.assert(!(node.emitNode.flags & 536870912 /* Immutable */), "Invalid attempt to mutate an immutable node."); + Debug.assert(!(node.emitNode.internalFlags & 8 /* Immutable */), "Invalid attempt to mutate an immutable node."); } return node.emitNode; } @@ -26576,6 +26467,15 @@ function addEmitFlags(node, emitFlags) { emitNode.flags = emitNode.flags | emitFlags; return node; } +function setInternalEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).internalFlags = emitFlags; + return node; +} +function addInternalEmitFlags(node, emitFlags) { + const emitNode = getOrCreateEmitNode(node); + emitNode.internalFlags = emitNode.internalFlags | emitFlags; + return node; +} function getSourceMapRange(node) { var _a2, _b; return (_b = (_a2 = node.emitNode) == null ? void 0 : _a2.sourceMapRange) != null ? _b : node; @@ -26706,7 +26606,7 @@ function setSnippetElement(node, snippet) { return node; } function ignoreSourceNewlines(node) { - getOrCreateEmitNode(node).flags |= 268435456 /* IgnoreSourceNewlines */; + getOrCreateEmitNode(node).internalFlags |= 4 /* IgnoreSourceNewlines */; return node; } function setTypeNode(node, type) { @@ -26718,18 +26618,51 @@ function getTypeNode(node) { var _a2; return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode; } +function setIdentifierTypeArguments(node, typeArguments) { + getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; + return node; +} +function getIdentifierTypeArguments(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments; +} +function setIdentifierAutoGenerate(node, autoGenerate) { + getOrCreateEmitNode(node).autoGenerate = autoGenerate; + return node; +} +function getIdentifierAutoGenerate(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; +} +function setIdentifierGeneratedImportReference(node, value) { + getOrCreateEmitNode(node).generatedImportReference = value; + return node; +} +function getIdentifierGeneratedImportReference(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference; +} // src/compiler/factory/emitHelpers.ts +var PrivateIdentifierKind = /* @__PURE__ */ ((PrivateIdentifierKind2) => { + PrivateIdentifierKind2["Field"] = "f"; + PrivateIdentifierKind2["Method"] = "m"; + PrivateIdentifierKind2["Accessor"] = "a"; + return PrivateIdentifierKind2; +})(PrivateIdentifierKind || {}); function createEmitHelperFactory(context) { const factory2 = context.factory; - const immutableTrue = memoize(() => setEmitFlags(factory2.createTrue(), 536870912 /* Immutable */)); - const immutableFalse = memoize(() => setEmitFlags(factory2.createFalse(), 536870912 /* Immutable */)); + const immutableTrue = memoize(() => setInternalEmitFlags(factory2.createTrue(), 8 /* Immutable */)); + const immutableFalse = memoize(() => setInternalEmitFlags(factory2.createFalse(), 8 /* Immutable */)); return { getUnscopedHelperName, // TypeScript Helpers createDecorateHelper, createMetadataHelper, createParamHelper, + // ES Decorators Helpers + createESDecorateHelper, + createRunInitializersHelper, // ES2018 Helpers createAssignHelper, createAwaitHelper, @@ -26744,6 +26677,8 @@ function createEmitHelperFactory(context) { createExtendsHelper, createTemplateObjectHelper, createSpreadArrayHelper, + createPropKeyHelper, + createSetFunctionNameHelper, // ES2015 Destructuring Helpers createValuesHelper, createReadHelper, @@ -26812,6 +26747,50 @@ function createEmitHelperFactory(context) { location ); } + function createESDecorateClassContextObject(contextIn) { + return factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral("class")), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) + ]); + } + function createESDecorateClassElementContextObject(contextIn) { + return factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), + factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()) + // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494 + // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) + ]); + } + function createESDecorateContextObject(contextIn) { + return contextIn.kind === "class" ? createESDecorateClassContextObject(contextIn) : createESDecorateClassElementContextObject(contextIn); + } + function createESDecorateHelper(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + context.requestEmitHelper(esDecorateHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__esDecorate"), + /*typeArguments*/ + void 0, + [ + ctor != null ? ctor : factory2.createNull(), + descriptorIn != null ? descriptorIn : factory2.createNull(), + decorators, + createESDecorateContextObject(contextIn), + initializers, + extraInitializers + ] + ); + } + function createRunInitializersHelper(thisArg, initializers, value) { + context.requestEmitHelper(runInitializersHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__runInitializers"), + /*typeArguments*/ + void 0, + value ? [thisArg, initializers, value] : [thisArg, initializers] + ); + } function createAssignHelper(attributesSegments) { if (getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { return factory2.createCallExpression( @@ -26968,6 +26947,24 @@ function createEmitHelperFactory(context) { [to, from, packFrom ? immutableTrue() : immutableFalse()] ); } + function createPropKeyHelper(expr) { + context.requestEmitHelper(propKeyHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__propKey"), + /*typeArguments*/ + void 0, + [expr] + ); + } + function createSetFunctionNameHelper(f, name, prefix) { + context.requestEmitHelper(setFunctionNameHelper); + return context.factory.createCallExpression( + getUnscopedHelperName("__setFunctionName"), + /*typeArguments*/ + void 0, + prefix ? [f, name, context.factory.createStringLiteral(prefix)] : [f, name] + ); + } function createValuesHelper(expression) { context.requestEmitHelper(valuesHelper); return factory2.createCallExpression( @@ -27131,6 +27128,54 @@ var paramHelper = { return function (target, key) { decorator(target, key, paramIndex); } };` }; +var esDecorateHelper = { + name: "typescript:esDecorate", + importName: "__esDecorate", + scoped: false, + priority: 2, + text: ` + var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.push(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.push(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + };` +}; +var runInitializersHelper = { + name: "typescript:runInitializers", + importName: "__runInitializers", + scoped: false, + priority: 2, + text: ` + var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + };` +}; var assignHelper = { name: "typescript:assign", importName: "__assign", @@ -27303,6 +27348,25 @@ var spreadArrayHelper = { return to.concat(ar || Array.prototype.slice.call(from)); };` }; +var propKeyHelper = { + name: "typescript:propKey", + importName: "__propKey", + scoped: false, + text: ` + var __propKey = (this && this.__propKey) || function (x) { + return typeof x === "symbol" ? x : "".concat(x); + };` +}; +var setFunctionNameHelper = { + name: "typescript:setFunctionName", + importName: "__setFunctionName", + scoped: false, + text: ` + var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + };` +}; var valuesHelper = { name: "typescript:values", importName: "__values", @@ -27458,6 +27522,8 @@ function getAllUnscopedEmitHelpers() { decorateHelper, metadataHelper, paramHelper, + esDecorateHelper, + runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, @@ -27470,6 +27536,8 @@ function getAllUnscopedEmitHelpers() { spreadArrayHelper, valuesHelper, readHelper, + propKeyHelper, + setFunctionNameHelper, generatorHelper, importStarHelper, importDefaultHelper, @@ -27567,6 +27635,9 @@ function isPrivateIdentifier(node) { function isExportModifier(node) { return node.kind === 93 /* ExportKeyword */; } +function isDefaultModifier(node) { + return node.kind === 88 /* DefaultKeyword */; +} function isAsyncModifier(node) { return node.kind === 132 /* AsyncKeyword */; } @@ -27820,10 +27891,10 @@ function isSyntheticExpression(node) { return node.kind === 234 /* SyntheticExpression */; } function isPartiallyEmittedExpression(node) { - return node.kind === 355 /* PartiallyEmittedExpression */; + return node.kind === 356 /* PartiallyEmittedExpression */; } function isCommaListExpression(node) { - return node.kind === 356 /* CommaListExpression */; + return node.kind === 357 /* CommaListExpression */; } function isTemplateSpan(node) { return node.kind === 236 /* TemplateSpan */; @@ -27967,16 +28038,16 @@ function isMissingDeclaration(node) { return node.kind === 279 /* MissingDeclaration */; } function isNotEmittedStatement(node) { - return node.kind === 354 /* NotEmittedStatement */; + return node.kind === 355 /* NotEmittedStatement */; } function isSyntheticReference(node) { - return node.kind === 359 /* SyntheticReferenceExpression */; + return node.kind === 360 /* SyntheticReferenceExpression */; } function isMergeDeclarationMarker(node) { - return node.kind === 357 /* MergeDeclarationMarker */; + return node.kind === 358 /* MergeDeclarationMarker */; } function isEndOfDeclarationMarker(node) { - return node.kind === 358 /* EndOfDeclarationMarker */; + return node.kind === 359 /* EndOfDeclarationMarker */; } function isExternalModuleReference(node) { return node.kind === 280 /* ExternalModuleReference */; @@ -28167,11 +28238,14 @@ function isJSDocPropertyTag(node) { function isJSDocImplementsTag(node) { return node.kind === 332 /* JSDocImplementsTag */; } +function isJSDocSatisfiesTag(node) { + return node.kind === 353 /* JSDocSatisfiesTag */; +} function isJSDocThrowsTag(node) { return node.kind === 352 /* JSDocThrowsTag */; } function isSyntaxList(n) { - return n.kind === 353 /* SyntaxList */; + return n.kind === 354 /* SyntaxList */; } // src/compiler/factory/utilities.ts @@ -28194,7 +28268,7 @@ function createMemberAccessForPropertyName(factory2, target, memberName, locatio isMemberName(memberName) ? factory2.createPropertyAccessExpression(target, memberName) : factory2.createElementAccessExpression(target, memberName), memberName ); - getOrCreateEmitNode(expression).flags |= 128 /* NoNestedSourceMaps */; + addEmitFlags(expression, 128 /* NoNestedSourceMaps */); return expression; } } @@ -28538,8 +28612,11 @@ function startsWithUseStrict(statements) { const firstStatement = firstOrUndefined(statements); return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); } +function isCommaExpression(node) { + return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */; +} function isCommaSequence(node) { - return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 356 /* CommaListExpression */; + return isCommaExpression(node) || isCommaListExpression(node); } function isJSDocTypeAssertion(node) { return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node); @@ -28558,11 +28635,12 @@ function isOuterExpression(node, kinds = 15 /* All */) { return (kinds & 1 /* Parentheses */) !== 0; case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: + case 230 /* ExpressionWithTypeArguments */: case 235 /* SatisfiesExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; case 232 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -28573,6 +28651,14 @@ function skipOuterExpressions(node, kinds = 15 /* All */) { } return node; } +function walkUpOuterExpressions(node, kinds = 15 /* All */) { + let parent2 = node.parent; + while (isOuterExpression(parent2, kinds)) { + parent2 = parent2.parent; + Debug.assert(parent2); + } + return parent2; +} function skipAssertions(node) { return skipOuterExpressions(node, 6 /* Assertions */); } @@ -28654,7 +28740,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto /*assertClause*/ void 0 ); - addEmitFlags(externalHelpersImportDeclaration, 134217728 /* NeverApplyImportHelper */); + addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */); return externalHelpersImportDeclaration; } } @@ -28866,12 +28952,21 @@ function canHaveIllegalModifiers(node) { const kind = node.kind; return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; } -var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration); -var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken); -var isIdentifierOrThisTypeNode = or(isIdentifier, isThisTypeNode); -var isReadonlyKeywordOrPlusOrMinusToken = or(isReadonlyKeyword, isPlusToken, isMinusToken); -var isQuestionOrPlusOrMinusToken = or(isQuestionToken, isPlusToken, isMinusToken); -var isModuleName = or(isIdentifier, isStringLiteral); +function isQuestionOrExclamationToken(node) { + return isQuestionToken(node) || isExclamationToken(node); +} +function isIdentifierOrThisTypeNode(node) { + return isIdentifier(node) || isThisTypeNode(node); +} +function isReadonlyKeywordOrPlusOrMinusToken(node) { + return isReadonlyKeyword(node) || isPlusToken(node) || isMinusToken(node); +} +function isQuestionOrPlusOrMinusToken(node) { + return isQuestionToken(node) || isPlusToken(node) || isMinusToken(node); +} +function isModuleName(node) { + return isIdentifier(node) || isStringLiteral(node); +} function isLiteralTypeLikeExpression(node) { const kind = node.kind; return kind === 104 /* NullKeyword */ || kind === 110 /* TrueKeyword */ || kind === 95 /* FalseKeyword */ || isLiteralExpression(node) || isPrefixUnaryExpression(node); @@ -29057,6 +29152,17 @@ function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, return resultHolder.value; } } +function isExportOrDefaultKeywordKind(kind) { + return kind === 93 /* ExportKeyword */ || kind === 88 /* DefaultKeyword */; +} +function isExportOrDefaultModifier(node) { + const kind = node.kind; + return isExportOrDefaultKeywordKind(kind); +} +function isNonExportDefaultModifier(node) { + const kind = node.kind; + return isModifierKind(kind) && !isExportOrDefaultKeywordKind(kind); +} function elideNodes(factory2, nodes) { if (nodes === void 0) return void 0; @@ -29065,13 +29171,16 @@ function elideNodes(factory2, nodes) { return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes); } function getNodeForGeneratedName(name) { - if (name.autoGenerate.flags & 4 /* Node */) { - const autoGenerateId = name.autoGenerate.id; + var _a2; + const autoGenerate = name.emitNode.autoGenerate; + if (autoGenerate.flags & 4 /* Node */) { + const autoGenerateId = autoGenerate.id; let node = name; let original = node.original; while (original) { node = original; - if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) { + const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) { break; } original = node.original; @@ -29170,6 +29279,50 @@ function createAccessorPropertySetRedirector(factory2, node, modifiers, name) { ]) ); } +function findComputedPropertyNameCacheAssignment(name) { + let node = name.expression; + while (true) { + node = skipOuterExpressions(node); + if (isCommaListExpression(node)) { + node = last(node.elements); + continue; + } + if (isCommaExpression(node)) { + node = node.right; + continue; + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ) && isGeneratedIdentifier(node.left)) { + return node; + } + break; + } +} +function isSyntheticParenthesizedExpression(node) { + return isParenthesizedExpression(node) && nodeIsSynthesized(node) && !node.emitNode; +} +function flattenCommaListWorker(node, expressions) { + if (isSyntheticParenthesizedExpression(node)) { + flattenCommaListWorker(node.expression, expressions); + } else if (isCommaExpression(node)) { + flattenCommaListWorker(node.left, expressions); + flattenCommaListWorker(node.right, expressions); + } else if (isCommaListExpression(node)) { + for (const child of node.elements) { + flattenCommaListWorker(child, expressions); + } + } else { + expressions.push(node); + } +} +function flattenCommaList(node) { + const expressions = []; + flattenCommaListWorker(node, expressions); + return expressions; +} // src/compiler/factory/utilitiesPublic.ts function setTextRange(range, location) { @@ -29243,7 +29396,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); }, [300 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); }, [301 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); @@ -29258,7 +29411,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, [299 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); }, [257 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); @@ -29267,7 +29420,7 @@ var forEachChildTable = { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [178 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [182 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -29284,7 +29437,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [173 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [174 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -29293,7 +29446,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [259 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [215 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -29302,7 +29455,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); }, [172 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); }, [180 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); @@ -29423,7 +29576,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); }, [240 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); }, [258 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.declarations); @@ -29487,25 +29640,25 @@ var forEachChildTable = { [260 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, [228 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, [261 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); }, [262 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); }, [263 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); }, [302 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [264 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); }, [268 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); }, [269 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [270 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); @@ -29517,7 +29670,7 @@ var forEachChildTable = { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); }, [267 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); }, [271 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); @@ -29528,12 +29681,12 @@ var forEachChildTable = { [272 /* NamedImports */]: forEachChildInNamedImportsOrExports, [276 /* NamedExports */]: forEachChildInNamedImportsOrExports, [275 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [273 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, [278 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, [274 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); }, [225 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); @@ -29560,9 +29713,9 @@ var forEachChildTable = { return visitNode2(cbNode, node.expression); }, [279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers); + return visitNodes(cbNode, cbNodes, node.modifiers); }, - [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, [281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { @@ -29634,6 +29787,7 @@ var forEachChildTable = { [347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, [346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, [343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, + [353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, [352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, [342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, [326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { @@ -29653,7 +29807,7 @@ var forEachChildTable = { [339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, [334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, [340 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression + [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -29966,7 +30120,7 @@ var Parser; const pos = getNodePos(); let statements, endOfFileToken; if (token() === 1 /* EndOfFileToken */) { - statements = createNodeArray2([], pos, pos); + statements = createNodeArray([], pos, pos); endOfFileToken = parseTokenNode(); } else { let expressions; @@ -30012,7 +30166,7 @@ var Parser; const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); const statement = factory2.createExpressionStatement(expression); finishNode(statement, pos); - statements = createNodeArray2([statement], pos); + statements = createNodeArray([statement], pos); endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); } const sourceFile = createSourceFile2( @@ -30660,7 +30814,7 @@ var Parser; function parseSemicolon() { return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); } - function createNodeArray2(elements, pos, end, hasTrailingComma) { + function createNodeArray(elements, pos, end, hasTrailingComma) { const array = factory2.createNodeArray(elements, hasTrailingComma); setTextRangePosEnd(array, pos, end != null ? end : scanner2.getStartPos()); return array; @@ -30685,8 +30839,6 @@ var Parser; const pos = getNodePos(); const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( "", - /*typeArguments*/ - void 0, /*originalKeywordKind*/ void 0 ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode( @@ -30713,7 +30865,7 @@ var Parser; } return identifier; } - function createIdentifier3(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { + function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { if (isIdentifier3) { identifierCount++; const pos = getNodePos(); @@ -30721,23 +30873,17 @@ var Parser; const text = internIdentifier(scanner2.getTokenValue()); const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind, - hasExtendedUnicodeEscape - ), pos); + return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - return createIdentifier3( + return createIdentifier( /*isIdentifier*/ true ); } if (token() === 0 /* Unknown */ && scanner2.tryScan(() => scanner2.reScanInvalidIdentifier() === 79 /* Identifier */)) { - return createIdentifier3( + return createIdentifier( /*isIdentifier*/ true ); @@ -30750,7 +30896,7 @@ var Parser; return createMissingNode(79 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg); } function parseBindingIdentifier(privateIdentifierDiagnosticMessage) { - return createIdentifier3( + return createIdentifier( isBindingIdentifier(), /*diagnosticMessage*/ void 0, @@ -30758,10 +30904,10 @@ var Parser; ); } function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) { - return createIdentifier3(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); + return createIdentifier(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); } function parseIdentifierName(diagnosticMessage) { - return createIdentifier3(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); + return createIdentifier(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); } function isLiteralPropertyName() { return tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */; @@ -30838,7 +30984,7 @@ var Parser; } } function canFollowExportModifier() { - return token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); + return token() === 59 /* AtToken */ || token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); } function nextTokenCanFollowExportModifier() { nextToken(); @@ -30852,7 +30998,7 @@ var Parser; } function nextTokenCanFollowDefaultKeyword() { nextToken(); - return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); + return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 59 /* AtToken */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); } function isListElement2(parsingContext2, inErrorRecovery) { const node = currentNode(parsingContext2); @@ -31059,7 +31205,7 @@ var Parser; } } parsingContext = saveParsingContext; - return createNodeArray2(list, listPos); + return createNodeArray(list, listPos); } function parseListElement(parsingContext2, parseElement) { const node = currentNode(parsingContext2); @@ -31069,6 +31215,7 @@ var Parser; return parseElement(); } function currentNode(parsingContext2, pos) { + var _a2; if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { return void 0; } @@ -31083,8 +31230,8 @@ var Parser; if (!canReuseNode(node, parsingContext2)) { return void 0; } - if (canHaveJSDoc(node) && node.jsDocCache) { - node.jsDocCache = void 0; + if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) { + node.jsDoc.jsDocCache = void 0; } return node; } @@ -31143,7 +31290,7 @@ var Parser; return true; case 171 /* MethodDeclaration */: const methodDeclaration = node; - const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 135 /* ConstructorKeyword */; + const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; } } @@ -31335,7 +31482,7 @@ var Parser; } } parsingContext = saveParsingContext; - return createNodeArray2( + return createNodeArray( list, listPos, /*end*/ @@ -31347,7 +31494,7 @@ var Parser; return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; } function createMissingList() { - const list = createNodeArray2([], getNodePos()); + const list = createNodeArray([], getNodePos()); list.isMissingList = true; return list; } @@ -31365,13 +31512,10 @@ var Parser; function parseEntityName(allowReservedWords, diagnosticMessage) { const pos = getNodePos(); let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); - let dotPos = getNodePos(); while (parseOptional(24 /* DotToken */)) { if (token() === 29 /* LessThanToken */) { - entity.jsdocDotPos = dotPos; break; } - dotPos = getNodePos(); entity = finishNode( factory2.createQualifiedName( entity, @@ -31386,7 +31530,7 @@ var Parser; } return entity; } - function createQualifiedName2(entity, name) { + function createQualifiedName(entity, name) { return finishNode(factory2.createQualifiedName(entity, name), entity.pos); } function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers) { @@ -31420,7 +31564,7 @@ var Parser; node = parseTemplateSpan(isTaggedTemplate); list.push(node); } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray2(list, pos); + return createNodeArray(list, pos); } function parseTemplateExpression(isTaggedTemplate) { const pos = getNodePos(); @@ -31453,7 +31597,7 @@ var Parser; node = parseTemplateTypeSpan(); list.push(node); } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray2(list, pos); + return createNodeArray(list, pos); } function parseTemplateTypeSpan() { const pos = getNodePos(); @@ -31701,6 +31845,8 @@ var Parser; function parseTypeParameter() { const pos = getNodePos(); const modifiers = parseModifiers( + /*allowDecorators*/ + false, /*permitConstAsModifier*/ true ); @@ -31753,13 +31899,19 @@ var Parser; function parseParameterWorker(inOuterAwaitContext, allowAmbiguity = true) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : doOutsideOfAwaitContext(parseDecorators); + const modifiers = inOuterAwaitContext ? doInAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )) : doOutsideOfAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )); if (token() === 108 /* ThisKeyword */) { const node2 = factory2.createParameterDeclaration( - decorators, + modifiers, /*dotDotDotToken*/ void 0, - createIdentifier3( + createIdentifier( /*isIdentifier*/ true ), @@ -31769,14 +31921,14 @@ var Parser; /*initializer*/ void 0 ); - if (decorators) { - parseErrorAtRange(decorators[0], Diagnostics.Decorators_may_not_be_applied_to_this_parameters); + const modifier = firstOrUndefined(modifiers); + if (modifier) { + parseErrorAtRange(modifier, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); } return withJSDoc(finishNode(node2, pos), hasJSDoc); } const savedTopLevel = topLevel; topLevel = false; - const modifiers = combineDecoratorsAndModifiers(decorators, parseModifiers()); const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); if (!allowAmbiguity && !isParameterNameStart()) { return void 0; @@ -31888,7 +32040,7 @@ var Parser; nextToken(); return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } - function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( /*inOuterAwaitContext*/ false @@ -31896,7 +32048,6 @@ var Parser; const type = parseTypeAnnotation(); parseTypeMemberSemicolon(); const node = factory2.createIndexSignature(modifiers, parameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { @@ -31951,37 +32102,18 @@ var Parser; } const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 174 /* GetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 4 /* Type */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 175 /* SetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 4 /* Type */); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers - ); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); } @@ -32125,7 +32257,7 @@ var Parser; const pos = getNodePos(); nextToken(); const modifier = finishNode(factory2.createToken(126 /* AbstractKeyword */), pos); - modifiers = createNodeArray2([modifier], pos); + modifiers = createNodeArray([modifier], pos); } return modifiers; } @@ -32436,7 +32568,7 @@ var Parser; while (parseOptional(operator)) { types.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType()); } - type = finishNode(createTypeNode(createNodeArray2(types, pos)), pos); + type = finishNode(createTypeNode(createNodeArray(types, pos)), pos); } return type; } @@ -32461,7 +32593,10 @@ var Parser; } function skipParameterStart() { if (isModifierKind(token())) { - parseModifiers(); + parseModifiers( + /*allowDecorators*/ + false + ); } if (isIdentifier2() || token() === 108 /* ThisKeyword */) { nextToken(); @@ -32589,6 +32724,7 @@ var Parser; case 133 /* AwaitKeyword */: case 125 /* YieldKeyword */: case 80 /* PrivateIdentifier */: + case 59 /* AtToken */: return true; default: if (isBinaryOperator2()) { @@ -32710,7 +32846,7 @@ var Parser; void 0 ); finishNode(parameter, identifier.pos); - const parameters = createNodeArray2([parameter], parameter.pos, parameter.end); + const parameters = createNodeArray([parameter], parameter.pos, parameter.end); const equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */); const body = parseArrowFunctionExpressionBody( /*isAsync*/ @@ -33197,7 +33333,7 @@ var Parser; lastChild.openingElement.pos, end ); - children = createNodeArray2([...children.slice(0, children.length - 1), newLast], children.pos, end); + children = createNodeArray([...children.slice(0, children.length - 1), newLast], children.pos, end); closingElement = lastChild.closingElement; } else { closingElement = parseJsxClosingElement(opening, inExpressionContext); @@ -33291,7 +33427,7 @@ var Parser; } } parsingContext = saveParsingContext; - return createNodeArray2(list, listPos); + return createNodeArray(list, listPos); } function parseJsxAttributes() { const pos = getNodePos(); @@ -33680,6 +33816,8 @@ var Parser; break; } return parseFunctionExpression(); + case 59 /* AtToken */: + return parseDecoratedExpression(); case 84 /* ClassKeyword */: return parseClassExpression(); case 98 /* FunctionKeyword */: @@ -33747,13 +33885,15 @@ var Parser; ); return withJSDoc(finishNode(factory2.createSpreadAssignment(expression), pos), hasJSDoc); } - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const tokenIsIdentifier = isIdentifier2(); @@ -33761,7 +33901,7 @@ var Parser; const questionToken = parseOptionalToken(57 /* QuestionToken */); const exclamationToken = parseOptionalToken(53 /* ExclamationToken */); if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken); + return parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken); } let node; const isShorthandPropertyAssignment2 = tokenIsIdentifier && token() !== 58 /* ColonToken */; @@ -33781,7 +33921,6 @@ var Parser; )); node = factory2.createPropertyAssignment(name, initializer); } - node.illegalDecorators = decorators; node.modifiers = modifiers; node.questionToken = questionToken; node.exclamationToken = exclamationToken; @@ -33809,7 +33948,10 @@ var Parser; ); const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); parseExpected(98 /* FunctionKeyword */); const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; @@ -34181,7 +34323,7 @@ var Parser; if (currentToken2 === 154 /* TypeKeyword */) { currentToken2 = lookAhead(nextToken); } - if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */) { + if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */ || currentToken2 === 59 /* AtToken */) { return true; } continue; @@ -34265,8 +34407,6 @@ var Parser; return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -34275,8 +34415,6 @@ var Parser; return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -34286,8 +34424,6 @@ var Parser; return parseFunctionDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -34295,8 +34431,6 @@ var Parser; return parseClassDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -34359,8 +34493,10 @@ var Parser; function parseDeclaration() { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); const isAmbient = some(modifiers, isDeclareModifier); if (isAmbient) { const node = tryReuseAmbientDeclaration(pos); @@ -34370,9 +34506,9 @@ var Parser; for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); } else { - return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); + return parseDeclarationWorker(pos, hasJSDoc, modifiers); } } function tryReuseAmbientDeclaration(pos) { @@ -34383,41 +34519,41 @@ var Parser; } }); } - function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) { + function parseDeclarationWorker(pos, hasJSDoc, modifiersIn) { switch (token()) { case 113 /* VarKeyword */: case 119 /* LetKeyword */: case 85 /* ConstKeyword */: - return parseVariableStatement(pos, hasJSDoc, decorators, modifiers); + return parseVariableStatement(pos, hasJSDoc, modifiersIn); case 98 /* FunctionKeyword */: - return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseFunctionDeclaration(pos, hasJSDoc, modifiersIn); case 84 /* ClassKeyword */: - return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassDeclaration(pos, hasJSDoc, modifiersIn); case 118 /* InterfaceKeyword */: - return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseInterfaceDeclaration(pos, hasJSDoc, modifiersIn); case 154 /* TypeKeyword */: - return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseTypeAliasDeclaration(pos, hasJSDoc, modifiersIn); case 92 /* EnumKeyword */: - return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseEnumDeclaration(pos, hasJSDoc, modifiersIn); case 159 /* GlobalKeyword */: case 142 /* ModuleKeyword */: case 143 /* NamespaceKeyword */: - return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseModuleDeclaration(pos, hasJSDoc, modifiersIn); case 100 /* ImportKeyword */: - return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiersIn); case 93 /* ExportKeyword */: nextToken(); switch (token()) { case 88 /* DefaultKeyword */: case 63 /* EqualsToken */: - return parseExportAssignment(pos, hasJSDoc, decorators, modifiers); + return parseExportAssignment(pos, hasJSDoc, modifiersIn); case 128 /* AsKeyword */: - return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseNamespaceExportDeclaration(pos, hasJSDoc, modifiersIn); default: - return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseExportDeclaration(pos, hasJSDoc, modifiersIn); } default: - if (decorators || modifiers) { + if (modifiersIn) { const missing = createMissingNode( 279 /* MissingDeclaration */, /*reportAtCurrentPosition*/ @@ -34425,8 +34561,7 @@ var Parser; Diagnostics.Declaration_expected ); setTextRangePos(missing, pos); - missing.illegalDecorators = decorators; - missing.modifiers = modifiers; + missing.modifiers = modifiersIn; return missing; } return void 0; @@ -34559,17 +34694,16 @@ var Parser; function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } - function parseVariableStatement(pos, hasJSDoc, decorators, modifiers) { + function parseVariableStatement(pos, hasJSDoc, modifiers) { const declarationList = parseVariableDeclarationList( /*inForStatementInitializer*/ false ); parseSemicolon(); const node = factory2.createVariableStatement(modifiers, declarationList); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); const modifierFlags = modifiersToFlags(modifiers); parseExpected(98 /* FunctionKeyword */); @@ -34592,7 +34726,6 @@ var Parser; const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, Diagnostics.or_expected); setAwaitContext(savedAwaitContext); const node = factory2.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseConstructorName() { @@ -34606,7 +34739,7 @@ var Parser; }); } } - function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) { + function tryParseConstructorDeclaration(pos, hasJSDoc, modifiers) { return tryParse(() => { if (parseConstructorName()) { const typeParameters = parseTypeParameters(); @@ -34618,14 +34751,13 @@ var Parser; ); const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected); const node = factory2.createConstructorDeclaration(modifiers, parameters, body); - node.illegalDecorators = decorators; node.typeParameters = typeParameters; node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } }); } - function parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { + function parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; const typeParameters = parseTypeParameters(); @@ -34637,7 +34769,7 @@ var Parser; ); const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage); const node = factory2.createMethodDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, asteriskToken, name, questionToken, @@ -34649,13 +34781,13 @@ var Parser; node.exclamationToken = exclamationToken; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken) { + function parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken) { const exclamationToken = !questionToken && !scanner2.hasPrecedingLineBreak() ? parseOptionalToken(53 /* ExclamationToken */) : void 0; const type = parseTypeAnnotation(); const initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer); parseSemicolonAfterPropertyName(name, type, initializer); const node = factory2.createPropertyDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, name, questionToken || exclamationToken, type, @@ -34663,7 +34795,7 @@ var Parser; ); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers) { const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const name = parsePropertyName(); const questionToken = parseOptionalToken(57 /* QuestionToken */); @@ -34671,7 +34803,6 @@ var Parser; return parseMethodDeclaration( pos, hasJSDoc, - decorators, modifiers, asteriskToken, name, @@ -34681,9 +34812,9 @@ var Parser; Diagnostics.or_expected ); } - return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken); + return parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken); } - function parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, kind, flags) { + function parseAccessorDeclaration(pos, hasJSDoc, modifiers, kind, flags) { const name = parsePropertyName(); const typeParameters = parseTypeParameters(); const parameters = parseParameters(0 /* None */); @@ -34693,7 +34824,7 @@ var Parser; false ); const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body); + const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); node.typeParameters = typeParameters; if (isSetAccessorDeclaration(node)) node.type = type; @@ -34739,11 +34870,10 @@ var Parser; } return false; } - function parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers) { parseExpectedToken(124 /* StaticKeyword */); const body = parseClassStaticBlockBody(); const node = withJSDoc(finishNode(factory2.createClassStaticBlockDeclaration(body), pos), hasJSDoc); - node.illegalDecorators = decorators; node.modifiers = modifiers; return node; } @@ -34783,15 +34913,7 @@ var Parser; const expression = doInDecoratorContext(parseDecoratorExpression); return finishNode(factory2.createDecorator(expression), pos); } - function parseDecorators() { - const pos = getNodePos(); - let list, decorator; - while (decorator = tryParseDecorator()) { - list = append(list, decorator); - } - return list && createNodeArray2(list, pos); - } - function tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { + function tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); const kind = token(); if (token() === 85 /* ConstKeyword */ && permitConstAsModifier) { @@ -34809,24 +34931,27 @@ var Parser; } return finishNode(factory2.createToken(kind), pos); } - function combineDecoratorsAndModifiers(decorators, modifiers) { - if (!decorators) - return modifiers; - if (!modifiers) - return decorators; - const decoratorsAndModifiers = factory2.createNodeArray(concatenate(decorators, modifiers)); - setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end); - return decoratorsAndModifiers; - } - function parseModifiers(permitConstAsModifier, stopOnStartOfClassStaticBlock) { + function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); - let list, modifier, hasSeenStatic = false; - while (modifier = tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) { + let list; + let modifier, hasSeenStaticModifier = false; + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) - hasSeenStatic = true; + hasSeenStaticModifier = true; list = append(list, modifier); } - return list && createNodeArray2(list, pos); + if (allowDecorators && token() === 59 /* AtToken */) { + let decorator; + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { + if (modifier.kind === 124 /* StaticKeyword */) + hasSeenStaticModifier = true; + list = append(list, modifier); + } + } + return list && createNodeArray(list, pos); } function parseModifiersForArrowFunction() { let modifiers; @@ -34834,7 +34959,7 @@ var Parser; const pos = getNodePos(); nextToken(); const modifier = finishNode(factory2.createToken(132 /* AsyncKeyword */), pos); - modifiers = createNodeArray2([modifier], pos); + modifiers = createNodeArray([modifier], pos); } return modifiers; } @@ -34845,30 +34970,31 @@ var Parser; return finishNode(factory2.createSemicolonClassElement(), pos); } const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); const modifiers = parseModifiers( + /*allowDecorators*/ + true, /*permitConstAsModifier*/ true, /*stopOnStartOfClassStaticBlock*/ true ); if (token() === 124 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { - return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); } if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } if (token() === 135 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { - const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); + const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); if (constructorDeclaration) { return constructorDeclaration; } } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) { const isAmbient = some(modifiers, isDeclareModifier); @@ -34876,12 +35002,12 @@ var Parser; for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); } else { - return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); + return parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers); } } - if (decorators || modifiers) { + if (modifiers) { const name = createMissingNode( 79 /* Identifier */, /*reportAtCurrentPosition*/ @@ -34891,7 +35017,6 @@ var Parser; return parsePropertyDeclaration( pos, hasJSDoc, - decorators, modifiers, name, /*questionToken*/ @@ -34900,21 +35025,39 @@ var Parser; } return Debug.fail("Should not have attempted to parse class member declaration."); } + function parseDecoratedExpression() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); + if (token() === 84 /* ClassKeyword */) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 228 /* ClassExpression */); + } + const missing = createMissingNode( + 279 /* MissingDeclaration */, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Expression_expected + ); + setTextRangePos(missing, pos); + missing.modifiers = modifiers; + return missing; + } function parseClassExpression() { return parseClassDeclarationOrExpression( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0, 228 /* ClassExpression */ ); } - function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 260 /* ClassDeclaration */); + function parseClassDeclaration(pos, hasJSDoc, modifiers) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 260 /* ClassDeclaration */); } - function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { + function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { const savedAwaitContext = inAwaitContext(); parseExpected(84 /* ClassKeyword */); const name = parseNameOfClassDeclarationOrExpression(); @@ -34933,11 +35076,11 @@ var Parser; members = createMissingList(); } setAwaitContext(savedAwaitContext); - const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members); + const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseNameOfClassDeclarationOrExpression() { - return isBindingIdentifier() && !isImplementsClause() ? createIdentifier3(isBindingIdentifier()) : void 0; + return isBindingIdentifier() && !isImplementsClause() ? createIdentifier(isBindingIdentifier()) : void 0; } function isImplementsClause() { return token() === 117 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); @@ -34974,17 +35117,16 @@ var Parser; function parseClassMembers() { return parseList(ParsingContext.ClassMembers, parseClassElement); } - function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); const heritageClauses = parseHeritageClauses(); const members = parseObjectTypeMembers(); const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) { parseExpected(154 /* TypeKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); @@ -34992,7 +35134,6 @@ var Parser; const type = token() === 139 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); parseSemicolon(); const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseEnumMember() { @@ -35002,7 +35143,7 @@ var Parser; const initializer = allowInAnd(parseInitializer); return withJSDoc(finishNode(factory2.createEnumMember(name, initializer), pos), hasJSDoc); } - function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseEnumDeclaration(pos, hasJSDoc, modifiers) { parseExpected(92 /* EnumKeyword */); const name = parseIdentifier(); let members; @@ -35013,7 +35154,6 @@ var Parser; members = createMissingList(); } const node = factory2.createEnumDeclaration(modifiers, name, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseModuleBlock() { @@ -35027,24 +35167,21 @@ var Parser; } return finishNode(factory2.createModuleBlock(statements), pos); } - function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags) { + function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) { const namespaceFlag = flags & 16 /* Namespace */; const name = parseIdentifier(); const body = parseOptional(24 /* DotToken */) ? parseModuleOrNamespaceDeclaration( getNodePos(), /*hasJSDoc*/ false, - /*decorators*/ - void 0, /*modifiers*/ void 0, 4 /* NestedNamespace */ | namespaceFlag ) : parseModuleBlock(); const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; let name; if (token() === 159 /* GlobalKeyword */) { @@ -35060,23 +35197,22 @@ var Parser; } else { parseSemicolon(); } - const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; + const node = factory2.createModuleDeclaration(modifiersIn, name, body, flags); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; if (token() === 159 /* GlobalKeyword */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } else if (parseOptional(143 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { parseExpected(142 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } } - return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); + return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiersIn, flags); } function isExternalModuleReference2() { return token() === 147 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); @@ -35090,17 +35226,16 @@ var Parser; function nextTokenIsSlash() { return nextToken() === 43 /* SlashToken */; } - function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseNamespaceExportDeclaration(pos, hasJSDoc, modifiers) { parseExpected(128 /* AsKeyword */); parseExpected(143 /* NamespaceKeyword */); const name = parseIdentifier(); parseSemicolon(); const node = factory2.createNamespaceExportDeclaration(name); - node.illegalDecorators = decorators; node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) { parseExpected(100 /* ImportKeyword */); const afterImportPos = scanner2.getStartPos(); let identifier; @@ -35113,7 +35248,7 @@ var Parser; identifier = isIdentifier2() ? parseIdentifier() : void 0; } if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { - return parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly); + return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly); } let importClause; if (identifier || // import id @@ -35129,7 +35264,6 @@ var Parser; } parseSemicolon(); const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseAssertEntry() { @@ -35167,7 +35301,7 @@ var Parser; } return finishNode(factory2.createAssertClause(elements, multiLine), pos); } else { - const elements = createNodeArray2( + const elements = createNodeArray( [], getNodePos(), /*end*/ @@ -35188,12 +35322,11 @@ var Parser; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { return token() === 27 /* CommaToken */ || token() === 158 /* FromKeyword */; } - function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { + function parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly) { parseExpected(63 /* EqualsToken */); const moduleReference = parseModuleReference(); parseSemicolon(); const node = factory2.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); - node.illegalDecorators = decorators; const finished = withJSDoc(finishNode(node, pos), hasJSDoc); return finished; } @@ -35303,7 +35436,7 @@ var Parser; function parseNamespaceExport(pos) { return finishNode(factory2.createNamespaceExport(parseIdentifierName()), pos); } - function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseExportDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -35333,10 +35466,9 @@ var Parser; parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) { + function parseExportAssignment(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -35355,7 +35487,6 @@ var Parser; parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportAssignment(modifiers, isExportEquals, expression); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } let ParsingContext; @@ -35610,8 +35741,8 @@ var Parser; } if (parts.length && tags) Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set"); - const tagsArray = tags && createNodeArray2(tags, tagsPos, tagsEnd); - return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray2(parts, start2, commentsPos) : comments.length ? comments.join("") : void 0, tagsArray), start2, end); + const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd); + return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start2, commentsPos) : comments.length ? comments.join("") : void 0, tagsArray), start2, end); }); function removeLeadingNewlines(comments2) { while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) { @@ -35739,6 +35870,9 @@ var Parser; case "overload": tag = parseOverloadTag(start3, tagName, margin, indentText); break; + case "satisfies": + tag = parseSatisfiesTag(start3, tagName, margin, indentText); + break; case "see": tag = parseSeeTag(start3, tagName, margin, indentText); break; @@ -35851,7 +35985,7 @@ var Parser; if (comments2.length) { parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2)); } - return createNodeArray2(parts2, commentsPos2, scanner2.getTextPos()); + return createNodeArray(parts2, commentsPos2, scanner2.getTextPos()); } else if (comments2.length) { return comments2.join(""); } @@ -36017,7 +36151,7 @@ var Parser; if (!comments2) { commentEnd = scanner2.getStartPos(); } - const allParts = typeof comments2 !== "string" ? createNodeArray2(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; + const allParts = typeof comments2 !== "string" ? createNodeArray(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; return finishNode(factory2.createJSDocAuthorTag(tagName, allParts), start3); } function parseAuthorNameAndEmail() { @@ -36047,6 +36181,14 @@ var Parser; const className = parseExpressionWithTypeArgumentsForAugments(); return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start3, getNodePos(), margin, indentText)), start3); } + function parseSatisfiesTag(start3, tagName, margin, indentText) { + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + false + ); + const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start3, getNodePos(), margin, indentText) : void 0; + return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start3); + } function parseExpressionWithTypeArgumentsForAugments() { const usedBrace = parseOptional(18 /* OpenBraceToken */); const pos = getNodePos(); @@ -36151,7 +36293,7 @@ var Parser; return finishNode(jsDocNamespaceNode, pos); } if (nested) { - typeNameOrNamespaceName.isInJSDocNamespace = true; + typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */; } return typeNameOrNamespaceName; } @@ -36162,7 +36304,7 @@ var Parser; while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) { parameters = append(parameters, child); } - return createNodeArray2(parameters || [], pos); + return createNodeArray(parameters || [], pos); } function parseJSDocSignature(start3, indent3) { const parameters = parseCallbackTagParameters(indent3); @@ -36313,7 +36455,7 @@ var Parser; } skipWhitespaceOrAsterisk(); } while (parseOptionalJsdoc(27 /* CommaToken */)); - return createNodeArray2(typeParameters, pos); + return createNodeArray(typeParameters, pos); } function parseTemplateTag(start3, tagName, indent3, indentText) { const constraint = token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0; @@ -36337,7 +36479,7 @@ var Parser; if (parseOptional(22 /* OpenBracketToken */)) { parseExpected(23 /* CloseBracketToken */); } - entity = createQualifiedName2(entity, name); + entity = createQualifiedName(entity, name); } return entity; } @@ -36355,12 +36497,7 @@ var Parser; const end2 = scanner2.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner2.getTokenValue()); - const result = finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind - ), pos, end2); + const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -36982,6 +37119,7 @@ var libEntries = [ ["es2020", "lib.es2020.d.ts"], ["es2021", "lib.es2021.d.ts"], ["es2022", "lib.es2022.d.ts"], + ["es2023", "lib.es2023.d.ts"], ["esnext", "lib.esnext.d.ts"], // Host only ["dom", "lib.dom.d.ts"], @@ -37035,14 +37173,17 @@ var libEntries = [ ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"], ["es2022.string", "lib.es2022.string.d.ts"], ["es2022.regexp", "lib.es2022.regexp.d.ts"], - ["esnext.array", "lib.es2022.array.d.ts"], + ["es2023.array", "lib.es2023.array.d.ts"], + ["esnext.array", "lib.es2023.array.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.es2022.string.d.ts"], ["esnext.promise", "lib.es2021.promise.d.ts"], - ["esnext.weakref", "lib.es2021.weakref.d.ts"] + ["esnext.weakref", "lib.es2021.weakref.d.ts"], + ["decorators", "lib.decorators.d.ts"], + ["decorators.legacy", "lib.decorators.legacy.d.ts"] ]; var libs = libEntries.map((entry) => entry[0]); var libMap = new Map(libEntries); @@ -37585,6 +37726,13 @@ var commandOptionsWithoutBuild = [ transpileOptionValue: true, defaultValueDescription: false }, + { + name: "verbatimModuleSyntax", + type: "boolean", + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting, + defaultValueDescription: false + }, // Strict Type Checks { name: "strict", @@ -37886,7 +38034,7 @@ var commandOptionsWithoutBuild = [ { name: "allowImportingTsExtensions", type: "boolean", - affectsModuleResolution: true, + affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, defaultValueDescription: false @@ -37950,10 +38098,11 @@ var commandOptionsWithoutBuild = [ { name: "experimentalDecorators", type: "boolean", + affectsEmit: true, affectsSemanticDiagnostics: true, affectsBuildInfo: true, category: Diagnostics.Language_and_Environment, - description: Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators, + description: Diagnostics.Enable_experimental_support_for_legacy_experimental_decorators, defaultValueDescription: false }, { @@ -38067,7 +38216,7 @@ var commandOptionsWithoutBuild = [ paramType: Diagnostics.NEWLINE, category: Diagnostics.Emit, description: Diagnostics.Set_the_newline_character_for_emitting_files, - defaultValueDescription: Diagnostics.Platform_specific + defaultValueDescription: "lf" }, { name: "noErrorTruncation", @@ -38243,7 +38392,7 @@ var commandOptionsWithoutBuild = [ affectsModuleResolution: true, category: Diagnostics.Interop_Constraints, description: Diagnostics.Ensure_that_casing_is_correct_in_imports, - defaultValueDescription: false + defaultValueDescription: true }, { name: "maxNodeModuleJsDepth", @@ -38367,14 +38516,6 @@ var buildOpts = [ ...optionsForBuild ]; var typeAcquisitionDeclarations = [ - { - /* @deprecated typingOptions.enableAutoDiscovery - * Use typeAcquisition.enable instead. - */ - name: "enableAutoDiscovery", - type: "boolean", - defaultValueDescription: false - }, { name: "enable", type: "boolean", @@ -38429,16 +38570,6 @@ var defaultInitCompilerOptions = { forceConsistentCasingInFileNames: true, skipLibCheck: true }; -function convertEnableAutoDiscoveryToEnable(typeAcquisition) { - if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== void 0 && typeAcquisition.enable === void 0) { - return { - enable: typeAcquisition.enableAutoDiscovery, - include: typeAcquisition.include || [], - exclude: typeAcquisition.exclude || [] - }; - } - return typeAcquisition; -} function createCompilerDiagnosticForInvalidCustomType(opt) { return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic); } @@ -38816,12 +38947,6 @@ function getTsconfigRootOptionsMap() { elementOptions: getCommandLineWatchOptionsMap(), extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics }, - { - name: "typingOptions", - type: "object", - elementOptions: getCommandLineTypeAcquisitionMap(), - extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics - }, { name: "typeAcquisition", type: "object", @@ -39669,11 +39794,11 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } const options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName); - const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName); + const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition, basePath, errors, configFileName); const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors); json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors); let extendedConfigPath; - if (json.extends) { + if (json.extends || json.extends === "") { if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) { errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration))); } else { @@ -39696,7 +39821,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { } function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { const options = getDefaultCompilerOptions(configFileName); - let typeAcquisition, typingOptionstypeAcquisition; + let typeAcquisition; let watchOptions; let extendedConfigPath; let rootCompilerOptions; @@ -39713,9 +39838,6 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa case "typeAcquisition": currentOption = typeAcquisition || (typeAcquisition = getDefaultTypeAcquisition(configFileName)); break; - case "typingOptions": - currentOption = typingOptionstypeAcquisition || (typingOptionstypeAcquisition = getDefaultTypeAcquisition(configFileName)); - break; default: Debug.fail("Unknown option"); } @@ -39768,15 +39890,7 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa optionsIterator ); if (!typeAcquisition) { - if (typingOptionstypeAcquisition) { - typeAcquisition = typingOptionstypeAcquisition.enableAutoDiscovery !== void 0 ? { - enable: typingOptionstypeAcquisition.enableAutoDiscovery, - include: typingOptionstypeAcquisition.include, - exclude: typingOptionstypeAcquisition.exclude - } : typingOptionstypeAcquisition; - } else { - typeAcquisition = getDefaultTypeAcquisition(configFileName); - } + typeAcquisition = getDefaultTypeAcquisition(configFileName); } if (rootCompilerOptions && json && json.compilerOptions === void 0) { errors.push(createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, getTextOfPropertyName(rootCompilerOptions[0]))); @@ -39800,7 +39914,11 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag if (resolved.resolvedModule) { return resolved.resolvedModule.resolvedFileName; } - errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); + if (extendedConfig === "") { + errors.push(createDiagnostic(Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends")); + } else { + errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); + } return void 0; } function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) { @@ -39878,8 +39996,7 @@ function getDefaultTypeAcquisition(configFileName) { } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { const options = getDefaultTypeAcquisition(configFileName); - const typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions); - convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), typeAcquisition, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); + convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), jsonOptions, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); return options; } function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) { @@ -40083,6 +40200,7 @@ function validateSpecs(specs, errors, disallowTrailingRecursion, jsonSourceFile, } } function specToDiagnostic(spec, disallowTrailingRecursion) { + Debug.assert(typeof spec === "string"); if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return [Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; } else if (invalidDotDotAfterRecursiveWildcard(spec)) { @@ -40288,7 +40406,7 @@ function resolvedTypeScriptOnly(resolved) { Debug.assert(extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } -function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) { +function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations); @@ -40306,7 +40424,8 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra }, failedLookupLocations: initializeResolutionField(failedLookupLocations), affectingLocations: initializeResolutionField(affectingLocations), - resolutionDiagnostics: initializeResolutionField(diagnostics) + resolutionDiagnostics: initializeResolutionField(diagnostics), + node10Result: legacyResult }; } function initializeResolutionField(value) { @@ -41361,7 +41480,7 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) { ); } function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) { - var _a2, _b; + var _a2, _b, _c, _d; const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations = []; const affectingLocations = []; @@ -41388,44 +41507,60 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) { const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */); const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */); - result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0; + result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0; } else { - result = tryResolve(extensions); + result = tryResolve(extensions, state); + } + let legacyResult; + if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) { + traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update); + const diagnosticState = { + ...state, + features: state.features & ~8 /* Exports */, + failedLookupLocations: [], + affectingLocations: [], + reportDiagnostic: noop + }; + const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState); + if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) { + legacyResult = diagnosticResult.value.resolved.path; + } } return createResolvedModuleWithFailedLookupLocations( - (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved, - (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport, + (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, + (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state.resultFromCache, + legacyResult ); - function tryResolve(extensions2) { - const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName( + function tryResolve(extensions2, state2) { + const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName( extensions3, candidate, onlyRecordFailures, - state2, + state3, /*considerPackageJson*/ true ); - const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state); + const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2); if (resolved) { return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) }); } if (!isExternalModuleNameRelative(moduleName)) { let resolved2; if (features & 2 /* Imports */ && startsWith(moduleName, "#")) { - resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2 && features & 4 /* SelfName */) { - resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) { if (traceEnabled) { trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2)); } - resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) return void 0; @@ -41444,7 +41579,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, candidate, /*onlyRecordFailures*/ false, - state, + state2, /*considerPackageJson*/ true ); @@ -42647,7 +42782,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host, } } function shouldAllowImportingTsExtension(compilerOptions, fromFileName) { - return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && (!!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName)); + return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName); } function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) { const traceEnabled = isTraceEnabled(compilerOptions, host); @@ -42784,7 +42919,7 @@ function getModuleInstanceStateWorker(node, visited) { case 264 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { return 0 /* NonInstantiated */; } } @@ -43221,6 +43356,7 @@ function createBinder() { } else if (containerFlags & 64 /* IsInterface */) { seenThisKeyword = false; bindChildren(node); + Debug.assertNotNode(node, isIdentifier); node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */; } else { bindChildren(node); @@ -43521,13 +43657,12 @@ function createBinder() { } else if (node.kind === 221 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 223 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); + return isLogicalOrCoalescingBinaryExpression(node); } } } function isLogicalAssignmentExpression(node) { - node = skipParentheses(node); - return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind); + return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node)); } function isTopLevelLogicalExpression(node) { while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) { @@ -43910,7 +44045,7 @@ function createBinder() { }; } const operator = node.operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */ || isLogicalOrCoalescingAssignmentOperator(operator)) { + if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) { if (isTopLevelLogicalExpression(node)) { const postExpressionLabel = createBranchLabel(); bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); @@ -44380,13 +44515,17 @@ function createBinder() { } function checkContextualIdentifier(node) { if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) { - if (inStrictMode && node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 125 /* LastFutureReservedWord */) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind === void 0) { + return; + } + if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, getStrictModeIdentifierMessage(node), declarationNameToString(node) )); - } else if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + } else if (originalKeywordKind === 133 /* AwaitKeyword */) { if (isExternalModule(file) && isInTopLevelContext(node)) { file.bindDiagnostics.push(createDiagnosticForNode2( node, @@ -44400,7 +44539,7 @@ function createBinder() { declarationNameToString(node) )); } - } else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { + } else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, @@ -44612,7 +44751,7 @@ function createBinder() { function bindWorker(node) { switch (node.kind) { case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { let parentNode = node.parent; while (parentNode && !isJSDocTypeAlias(parentNode)) { parentNode = parentNode.parent; @@ -46636,6 +46775,7 @@ function createTypeChecker(host) { deferredDiagnosticsCallbacks.push(arg); }; let cancellationToken; + const requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); let requestedExternalEmitHelpers; let externalHelpersModule; const Symbol46 = objectAllocator.getSymbolConstructor(); @@ -46654,6 +46794,7 @@ function createTypeChecker(host) { const compilerOptions = host.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); @@ -46678,6 +46819,7 @@ function createTypeChecker(host) { globals.set(globalThisSymbol.escapedName, globalThisSymbol); const argumentsSymbol = createSymbol(4 /* Property */, "arguments"); const requireSymbol = createSymbol(4 /* Property */, "require"); + const isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; let apparentArgumentCount; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), @@ -47098,6 +47240,7 @@ function createTypeChecker(host) { const stringMappingTypes = /* @__PURE__ */ new Map(); const substitutionTypes = /* @__PURE__ */ new Map(); const subtypeReductionCache = /* @__PURE__ */ new Map(); + const decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); const cachedTypes = /* @__PURE__ */ new Map(); const evolvingArrayTypes = []; const undefinedProperties = /* @__PURE__ */ new Map(); @@ -47337,6 +47480,14 @@ function createTypeChecker(host) { let deferredGlobalBigIntType; let deferredGlobalNaNSymbol; let deferredGlobalRecordSymbol; + let deferredGlobalClassDecoratorContextType; + let deferredGlobalClassMethodDecoratorContextType; + let deferredGlobalClassGetterDecoratorContextType; + let deferredGlobalClassSetterDecoratorContextType; + let deferredGlobalClassAccessorDecoratorContextType; + let deferredGlobalClassAccessorDecoratorTargetType; + let deferredGlobalClassAccessorDecoratorResultType; + let deferredGlobalClassFieldDecoratorContextType; const allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); let flowLoopStart = 0; let flowLoopCount = 0; @@ -47423,7 +47574,7 @@ function createTypeChecker(host) { if (jsxFragmentPragma) { const chosenPragma = isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma; file.localJsxFragmentFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFragmentFactory, markAsSynthetic); + visitNode(file.localJsxFragmentFactory, markAsSynthetic, isEntityName); if (file.localJsxFragmentFactory) { return file.localJsxFragmentNamespace = getFirstIdentifier(file.localJsxFragmentFactory).escapedText; } @@ -47466,7 +47617,7 @@ function createTypeChecker(host) { if (jsxPragma) { const chosenPragma = isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; file.localJsxFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFactory, markAsSynthetic); + visitNode(file.localJsxFactory, markAsSynthetic, isEntityName); if (file.localJsxFactory) { return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; } @@ -47519,7 +47670,7 @@ function createTypeChecker(host) { addErrorOrSuggestion(isError, "message" in message ? createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : createDiagnosticForFileFromMessageChain(file, message)); return; } - addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(location, message)); + addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(location), location, message)); } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { const diagnostic = error(location, message, arg0, arg1, arg2, arg3); @@ -47564,6 +47715,16 @@ function createTypeChecker(host) { symbol.links.checkFlags = checkFlags || 0 /* None */; return symbol; } + function createParameter(name, type) { + const symbol = createSymbol(1 /* FunctionScopedVariable */, name); + symbol.links.type = type; + return symbol; + } + function createProperty(name, type) { + const symbol = createSymbol(4 /* Property */, name); + symbol.links.type = type; + return symbol; + } function getExcludedSymbolFlags(flags) { let result = 0; if (flags & 2 /* BlockScopedVariable */) @@ -48110,6 +48271,15 @@ function createTypeChecker(host) { break; case 263 /* EnumDeclaration */: if (result = lookup(((_c = getSymbolOfDeclaration(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) { + if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 16777216 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { + error( + errorLocation, + Diagnostics.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead, + unescapeLeadingUnderscores(name), + isolatedModulesLikeFlagName, + `${unescapeLeadingUnderscores(getSymbolOfNode(location).escapedName)}.${unescapeLeadingUnderscores(name)}` + ); + } break loop; } break; @@ -48355,7 +48525,7 @@ function createTypeChecker(host) { if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */); if (typeOnlyDeclaration) { - const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; const unescapedName = unescapeLeadingUnderscores(name); addTypeOnlyDeclarationRelatedInfo( error(errorLocation, message, unescapedName), @@ -48375,7 +48545,7 @@ function createTypeChecker(host) { diagnostic, createDiagnosticForNode( typeOnlyDeclaration, - typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, + typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, unescapedName ) ); @@ -48754,10 +48924,10 @@ function createTypeChecker(host) { false ) && !node.isTypeOnly) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); - const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */; + const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */; const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here; - const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); + const name = typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); } } @@ -48977,6 +49147,7 @@ function createTypeChecker(host) { return valueSymbol; } const result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); + Debug.assert(valueSymbol.declarations || typeSymbol.declarations); result.declarations = deduplicate(concatenate(valueSymbol.declarations, typeSymbol.declarations), equateValues); result.parent = valueSymbol.parent || typeSymbol.parent; if (valueSymbol.valueDeclaration) @@ -48988,15 +49159,19 @@ function createTypeChecker(host) { return result; } function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + var _a2; if (symbol.flags & 1536 /* Module */) { const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); const resolved = resolveSymbol(exportSymbol, dontResolveAlias); + const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name.escapedText); markSymbolOfAliasDeclarationIfTypeOnly( specifier, exportSymbol, resolved, /*overwriteEmpty*/ - false + false, + exportStarDeclaration, + name.escapedText ); return resolved; } @@ -49323,7 +49498,7 @@ function createTypeChecker(host) { } return flags; } - function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { + function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) { if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration)) return false; const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration); @@ -49332,6 +49507,14 @@ function createTypeChecker(host) { links2.typeOnlyDeclaration = aliasDeclaration; return true; } + if (exportStarDeclaration) { + const links2 = getSymbolLinks(sourceSymbol); + links2.typeOnlyDeclaration = exportStarDeclaration; + if (sourceSymbol.escapedName !== exportStarName) { + links2.typeOnlyExportStarName = exportStarName; + } + return true; + } const links = getSymbolLinks(sourceSymbol); return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty); } @@ -49353,11 +49536,15 @@ function createTypeChecker(host) { return links.typeOnlyDeclaration || void 0; } if (links.typeOnlyDeclaration) { - return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : void 0; + const resolved = links.typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); + return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; } return void 0; } function markExportAsReferenced(node) { + if (compilerOptions.verbatimModuleSyntax) { + return; + } const symbol = getSymbolOfDeclaration(node); const target = resolveAlias(symbol); if (target) { @@ -49368,6 +49555,7 @@ function createTypeChecker(host) { } } function markAliasSymbolAsReferenced(symbol) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); const links = getSymbolLinks(symbol); if (!links.referenced) { links.referenced = true; @@ -49674,6 +49862,8 @@ function createTypeChecker(host) { /*isError*/ false, errorNode, + currentSourceFile, + mode, resolvedModule, moduleReference ); @@ -49725,7 +49915,7 @@ function createTypeChecker(host) { } } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chainDiagnosticMessages( + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chainDiagnosticMessages( diagnosticDetails, Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, moduleReference @@ -49759,6 +49949,8 @@ function createTypeChecker(host) { /*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, + currentSourceFile, + mode, resolvedModule, moduleReference ); @@ -49813,26 +50005,37 @@ function createTypeChecker(host) { return importSourceWithoutExtension; } } - function errorOnImplicitAnyModule(isError, errorNode, { packageId, resolvedFileName }, moduleReference) { - const errorInfo = !isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, - packageId.name, - mangleScopedPackageName(packageId.name) - ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, - packageId.name, - moduleReference - ) : chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, - moduleReference, - mangleScopedPackageName(packageId.name) - ) : void 0; + function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) { + var _a2, _b; + let errorInfo; + if (!isExternalModuleNameRelative(moduleReference) && packageId) { + const node10Result = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleReference, mode)) == null ? void 0 : _b.node10Result; + errorInfo = node10Result ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings, + node10Result, + node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageId.name)}` : packageId.name + ) : typesPackageExists(packageId.name) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, + packageId.name, + mangleScopedPackageName(packageId.name) + ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, + packageId.name, + moduleReference + ) : chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, + moduleReference, + mangleScopedPackageName(packageId.name) + ); + } errorOrSuggestion(isError, errorNode, chainDiagnosticMessages( errorInfo, Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, @@ -49992,7 +50195,12 @@ function createTypeChecker(host) { } function getExportsOfModule(moduleSymbol) { const links = getSymbolLinks(moduleSymbol); - return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol)); + if (!links.resolvedExports) { + const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol); + links.resolvedExports = exports; + links.typeOnlyExportStarMap = typeOnlyExportStarMap; + } + return links.resolvedExports; } function extendExportSymbols(target, source, lookupTable, exportNode) { if (!source) @@ -50020,9 +50228,21 @@ function createTypeChecker(host) { } function getExportsOfModuleWorker(moduleSymbol) { const visitedSymbols = []; + let typeOnlyExportStarMap; + const nonTypeOnlyNames = /* @__PURE__ */ new Set(); moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); - return visit(moduleSymbol) || emptySymbols; - function visit(symbol) { + const exports = visit(moduleSymbol) || emptySymbols; + if (typeOnlyExportStarMap) { + nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name)); + } + return { + exports, + typeOnlyExportStarMap + }; + function visit(symbol, exportStar, isTypeOnly) { + if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) { + symbol.exports.forEach((_, name) => nonTypeOnlyNames.add(name)); + } if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) { return; } @@ -50034,7 +50254,7 @@ function createTypeChecker(host) { if (exportStars.declarations) { for (const node of exportStars.declarations) { const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); - const exportedSymbols = visit(resolvedModule); + const exportedSymbols = visit(resolvedModule, node, isTypeOnly || node.isTypeOnly); extendExportSymbols( nestedSymbols, exportedSymbols, @@ -50058,6 +50278,13 @@ function createTypeChecker(host) { }); extendExportSymbols(symbols, nestedSymbols); } + if (exportStar == null ? void 0 : exportStar.isTypeOnly) { + typeOnlyExportStarMap != null ? typeOnlyExportStarMap : typeOnlyExportStarMap = /* @__PURE__ */ new Map(); + symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set( + escapedName, + exportStar + )); + } return symbols; } } @@ -51489,13 +51716,17 @@ function createTypeChecker(host) { let qualifier = root.qualifier; if (qualifier) { if (isIdentifier(qualifier)) { - qualifier = factory.updateIdentifier(qualifier, typeArguments); + if (typeArguments !== getIdentifierTypeArguments(qualifier)) { + qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments); + } } else { - qualifier = factory.updateQualifiedName( - qualifier, - qualifier.left, - factory.updateIdentifier(qualifier.right, typeArguments) - ); + if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) { + qualifier = factory.updateQualifiedName( + qualifier, + qualifier.left, + setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments) + ); + } } } typeArguments = ref.typeArguments; @@ -51515,13 +51746,17 @@ function createTypeChecker(host) { let typeArguments = root.typeArguments; let typeName = root.typeName; if (isIdentifier(typeName)) { - typeName = factory.updateIdentifier(typeName, typeArguments); + if (typeArguments !== getIdentifierTypeArguments(typeName)) { + typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments); + } } else { - typeName = factory.updateQualifiedName( - typeName, - typeName.left, - factory.updateIdentifier(typeName.right, typeArguments) - ); + if (typeArguments !== getIdentifierTypeArguments(typeName.right)) { + typeName = factory.updateQualifiedName( + typeName, + typeName.left, + setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments) + ); + } } typeArguments = ref.typeArguments; const ids = getAccessStack(ref); @@ -52235,7 +52470,11 @@ function createTypeChecker(host) { if (!nonRootParts || isEntityName(nonRootParts)) { if (nonRootParts) { const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; - lastId.typeArguments = void 0; + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); } return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf); } else { @@ -52252,8 +52491,12 @@ function createTypeChecker(host) { return factory.createTypeQueryNode(entityName); } else { const lastId = isIdentifier(entityName) ? entityName : entityName.right; - const lastTypeArgs = lastId.typeArguments; - lastId.typeArguments = void 0; + const lastTypeArgs = getIdentifierTypeArguments(lastId); + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); return factory.createTypeReferenceNode(entityName, lastTypeArgs); } function createAccessFromSymbolChain(chain2, index, stopper) { @@ -52297,7 +52540,9 @@ function createTypeChecker(host) { return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2))); } } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; if (index > stopper) { const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper); @@ -52355,7 +52600,9 @@ function createTypeChecker(host) { text = `${rawtext}_${i}`; } if (text !== rawtext) { - result = factory.createIdentifier(text, result.typeArguments); + const typeArguments = getIdentifierTypeArguments(result); + result = factory.createIdentifier(text); + setIdentifierTypeArguments(result, typeArguments); } (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i); (context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result); @@ -52379,7 +52626,9 @@ function createTypeChecker(host) { if (index === 0) { context.flags ^= 16777216 /* InInitialEntityName */; } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier; } @@ -52402,7 +52651,9 @@ function createTypeChecker(host) { return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context)); } if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) { - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier; } else { @@ -52417,8 +52668,11 @@ function createTypeChecker(host) { expression = factory.createNumericLiteral(+symbolName2); } if (!expression) { - expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); - expression.symbol = symbol2; + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); + identifier.symbol = symbol2; + expression = identifier; } return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression); } @@ -52574,7 +52828,7 @@ function createTypeChecker(host) { } let hadError = false; const file = getSourceFileOfNode(existing); - const transformed = visitNode(existing, visitExistingNodeTreeSymbols); + const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode); if (hadError) { return void 0; } @@ -52587,16 +52841,16 @@ function createTypeChecker(host) { return factory.createKeywordTypeNode(157 /* UnknownKeyword */); } if (isJSDocNullableType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), factory.createLiteralTypeNode(factory.createNull())]); + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createLiteralTypeNode(factory.createNull())]); } if (isJSDocOptionalType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), factory.createKeywordTypeNode(155 /* UndefinedKeyword */)]); + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createKeywordTypeNode(155 /* UndefinedKeyword */)]); } if (isJSDocNonNullableType(node)) { return visitNode(node.type, visitExistingNodeTreeSymbols); } if (isJSDocVariadicType(node)) { - return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols)); + return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode)); } if (isJSDocTypeLiteral(node)) { return factory.createTypeLiteralNode(map(node.jsDocPropertyTags, (t) => { @@ -52608,7 +52862,7 @@ function createTypeChecker(host) { void 0, name, t.isBracketed || t.typeExpression && isJSDocOptionalType(t.typeExpression.type) ? factory.createToken(57 /* QuestionToken */) : void 0, - overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); })); } @@ -52627,9 +52881,9 @@ function createTypeChecker(host) { "x", /*questionToken*/ void 0, - visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols) + visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols, isTypeNode) )], - visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols) + visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols, isTypeNode) )]); } if (isJSDocFunctionType(node)) { @@ -52638,33 +52892,33 @@ function createTypeChecker(host) { return factory.createConstructorTypeNode( /*modifiers*/ void 0, - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols), + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), mapDefined(node.parameters, (p, i) => p.name && isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode = p.type, void 0) : factory.createParameterDeclaration( /*modifiers*/ void 0, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, - visitNode(p.type, visitExistingNodeTreeSymbols), + visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), /*initializer*/ void 0 )), - visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); } else { return factory.createFunctionTypeNode( - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols), + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), map(node.parameters, (p, i) => factory.createParameterDeclaration( /*modifiers*/ void 0, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, - visitNode(p.type, visitExistingNodeTreeSymbols), + visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), /*initializer*/ void 0 )), - visitNode(node.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); } } @@ -53113,7 +53367,7 @@ function createTypeChecker(host) { /*modifiers*/ void 0, /*isTypeOnly*/ - false, + node.isTypeOnly, /*exportClause*/ void 0, factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context)) @@ -53586,7 +53840,7 @@ function createTypeChecker(host) { break; } case 268 /* ImportEqualsDeclaration */: - if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, isJsonSourceFile)) { + if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) { serializeMaybeAliasAssignment(symbol); break; } @@ -54681,6 +54935,12 @@ function createTypeChecker(host) { const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration); const isOptional = includeOptionality && isOptionalDeclaration(declaration); const declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { + if (declaredType) { + return isTypeAny(declaredType) || declaredType === unknownType ? declaredType : errorType; + } + return useUnknownInCatchVariables ? unknownType : anyType; + } if (declaredType) { return addOptionality(declaredType, isProperty, isOptional); } @@ -55259,14 +55519,6 @@ function createTypeChecker(host) { } Debug.assertIsDefined(symbol.valueDeclaration); const declaration = symbol.valueDeclaration; - if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode === void 0) { - return useUnknownInCatchVariables ? unknownType : anyType; - } - const type2 = getTypeOfNode(typeNode); - return isTypeAny(type2) || type2 === unknownType ? type2 : errorType; - } if (isSourceFile(declaration) && isJsonSourceFile(declaration)) { if (!declaration.statements.length) { return emptyObjectType; @@ -55858,7 +56110,7 @@ function createTypeChecker(host) { baseType ); const diagnostic = chainDiagnosticMessages(elaboration, Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(reducedBaseType)); - diagnostics.add(createDiagnosticForNodeFromMessageChain(baseTypeNode.expression, diagnostic)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(baseTypeNode.expression), baseTypeNode.expression, diagnostic)); return type.resolvedBaseTypes = emptyArray; } if (type === reducedBaseType || hasBaseType(reducedBaseType, type)) { @@ -56259,7 +56511,7 @@ function createTypeChecker(host) { const links = getSymbolLinks(symbol); if (!links[resolutionKind]) { const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */; - const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) : symbol.exports; + const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol).exports : symbol.exports; links[resolutionKind] = earlySymbols || emptySymbols; const lateSymbols = createSymbolTable(); for (const decl of symbol.declarations || emptyArray) { @@ -57248,7 +57500,7 @@ function createTypeChecker(host) { } function isConstTypeVariable(type) { var _a2; - return !!(type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType)); + return !!(type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || isGenericTupleType(type) && findIndex(getTypeArguments(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t)) >= 0 || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType)); } function getConstraintOfIndexedAccess(type) { return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0; @@ -58472,6 +58724,12 @@ function createTypeChecker(host) { } return result & 458752 /* PropagatingFlags */; } + function tryCreateTypeReference(target, typeArguments) { + if (some(typeArguments) && target === emptyGenericType) { + return unknownType; + } + return createTypeReference(target, typeArguments); + } function createTypeReference(target, typeArguments) { const id = getTypeListId(typeArguments); let type = target.instantiations.get(id); @@ -59166,6 +59424,78 @@ function createTypeChecker(host) { false )) || emptyObjectType; } + function getGlobalClassDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassDecoratorContextType != null ? deferredGlobalClassDecoratorContextType : deferredGlobalClassDecoratorContextType = getGlobalType( + "ClassDecoratorContext", + /*arity*/ + 1, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassMethodDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassMethodDecoratorContextType != null ? deferredGlobalClassMethodDecoratorContextType : deferredGlobalClassMethodDecoratorContextType = getGlobalType( + "ClassMethodDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassGetterDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassGetterDecoratorContextType != null ? deferredGlobalClassGetterDecoratorContextType : deferredGlobalClassGetterDecoratorContextType = getGlobalType( + "ClassGetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassSetterDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassSetterDecoratorContextType != null ? deferredGlobalClassSetterDecoratorContextType : deferredGlobalClassSetterDecoratorContextType = getGlobalType( + "ClassSetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorContextType != null ? deferredGlobalClassAccessorDecoratorContextType : deferredGlobalClassAccessorDecoratorContextType = getGlobalType( + "ClassAccessorDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorTargetType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorTargetType != null ? deferredGlobalClassAccessorDecoratorTargetType : deferredGlobalClassAccessorDecoratorTargetType = getGlobalType( + "ClassAccessorDecoratorTarget", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorResultType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorResultType != null ? deferredGlobalClassAccessorDecoratorResultType : deferredGlobalClassAccessorDecoratorResultType = getGlobalType( + "ClassAccessorDecoratorResult", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassFieldDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassFieldDecoratorContextType != null ? deferredGlobalClassFieldDecoratorContextType : deferredGlobalClassFieldDecoratorContextType = getGlobalType( + "ClassFieldDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } function getGlobalNaNSymbol() { return deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol( "NaN", @@ -60476,7 +60806,7 @@ function createTypeChecker(host) { typeToString(fullIndexType), typeToString(objectType) ); - diagnostics.add(createDiagnosticForNodeFromMessageChain(accessExpression, errorInfo)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(accessExpression), accessExpression, errorInfo)); } } } @@ -62890,7 +63220,7 @@ function createTypeChecker(host) { } } } - const diag2 = createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, errorInfo, relatedInformation); if (relatedInfo) { addRelatedInfo(diag2, ...relatedInfo); } @@ -65933,19 +66263,22 @@ function createTypeChecker(host) { break; case 166 /* Parameter */: const param = declaration; - if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( - param, - param.name.escapedText, - 788968 /* Type */, - void 0, - param.name.escapedText, - /*isUse*/ - true - ) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) { - const newName = "arg" + param.parent.parameters.indexOf(param); - const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); - errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); - return; + if (isIdentifier(param.name)) { + const originalKeywordKind = identifierToKeywordKind(param.name); + if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( + param, + param.name.escapedText, + 788968 /* Type */, + void 0, + param.name.escapedText, + /*isUse*/ + true + ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) { + const newName = "arg" + param.parent.parameters.indexOf(param); + const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); + errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); + return; + } } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; @@ -66133,6 +66466,10 @@ function createTypeChecker(host) { function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); } + function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { + const typePredicate = getTypePredicateOfSignature(signature); + return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter); + } function createEmptyObjectTypeFromStringLiteral(type) { const members = createSymbolTable(); forEachType(type, (t) => { @@ -66856,7 +67193,7 @@ function createTypeChecker(host) { } else { const middleLength = targetArity - startLength - endLength; if (middleLength === 2) { - if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) { + if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */) { const targetInfo = getInferenceInfoForType(elementTypes[startLength]); if (targetInfo && targetInfo.impliedArity !== void 0) { inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]); @@ -66870,7 +67207,7 @@ function createTypeChecker(host) { inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]); inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]); } - } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) { + } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */) { const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter; const constraint = param && getBaseConstraintOfType(param); if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) { @@ -66890,10 +67227,10 @@ function createTypeChecker(host) { } } else if (middleLength === 1 && elementFlags[startLength] & 8 /* Variadic */) { const endsInOptional = target.target.elementFlags[targetArity - 1] & 2 /* Optional */; - const sourceSlice = isTupleType(source) ? sliceTupleType(source, startLength, endLength) : createArrayType(getTypeArguments(source)[0]); + const sourceSlice = sliceTupleType(source, startLength, endLength); inferWithPriority(sourceSlice, elementTypes[startLength], endsInOptional ? 2 /* SpeculativeTuple */ : 0); } else if (middleLength === 1 && elementFlags[startLength] & 4 /* Rest */) { - const restType = isTupleType(source) ? getElementTypeOfSliceOfTupleType(source, startLength, endLength) : getTypeArguments(source)[0]; + const restType = getElementTypeOfSliceOfTupleType(source, startLength, endLength); if (restType) { inferFromTypes(restType, elementTypes[startLength]); } @@ -67004,7 +67341,7 @@ function createTypeChecker(host) { function getCovariantInference(inference, signature) { const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates); const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter); - const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); + const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter)); const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates; const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates); return getWidenedType(unwidenedType); @@ -69059,7 +69396,7 @@ function createTypeChecker(host) { return getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */); } function isSymbolAssigned(symbol) { if (!symbol.valueDeclaration) { @@ -69141,6 +69478,9 @@ function createTypeChecker(host) { }); } function markAliasReferenced(symbol, location) { + if (compilerOptions.verbatimModuleSyntax) { + return; + } if (isNonLocalAlias( symbol, /*excludes*/ @@ -69148,7 +69488,7 @@ function createTypeChecker(host) { ) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) { const target = resolveAlias(symbol); if (getAllSymbolFlags(target) & (111551 /* Value */ | 1048576 /* ExportValue */)) { - if (compilerOptions.isolatedModules || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { + if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { markAliasSymbolAsReferenced(symbol); } else { markConstEnumAliasAsReferenced(symbol); @@ -69157,6 +69497,7 @@ function createTypeChecker(host) { } } function getNarrowedTypeOfSymbol(symbol, location) { + var _a2; const type = getTypeOfSymbol(symbol); const declaration = symbol.valueDeclaration; if (declaration) { @@ -69192,7 +69533,7 @@ function createTypeChecker(host) { if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) { const contextualSignature = getContextualSignature(func); if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) { - const restType = getReducedApparentType(getTypeOfSymbol(contextualSignature.parameters[0])); + const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a2 = getInferenceContext(func)) == null ? void 0 : _a2.nonFixingMapper)); if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) { const narrowedType = getFlowTypeOfReference( func, @@ -69245,7 +69586,7 @@ function createTypeChecker(host) { } let declaration = localOrExportSymbol.valueDeclaration; if (declaration && localOrExportSymbol.flags & 32 /* Class */) { - if (declaration.kind === 260 /* ClassDeclaration */ && nodeIsDecorated(declaration)) { + if (declaration.kind === 260 /* ClassDeclaration */ && nodeIsDecorated(legacyDecorators, declaration)) { let container = getContainingClass(node); while (container !== void 0) { if (container === declaration && container.name !== node) { @@ -69316,13 +69657,14 @@ function createTypeChecker(host) { const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); + const isCatch = flowContainer.kind === 295 /* CatchClause */; const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -69469,7 +69811,7 @@ function createTypeChecker(host) { } } function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) { - if (isPropertyDeclaration(container) && hasStaticModifier(container) && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { + if (isPropertyDeclaration(container) && hasStaticModifier(container) && legacyDecorators && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { error(thisExpression, Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); } } @@ -69847,7 +70189,7 @@ function createTypeChecker(host) { } } function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0); if (typeNode) { return getTypeFromTypeNode(typeNode); } @@ -70013,6 +70355,10 @@ function createTypeChecker(host) { const restIndex = signature.parameters.length - 1; return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex); } + function getContextualTypeForDecorator(decorator) { + const signature = getDecoratorCallSignature(decorator); + return signature ? getOrCreateTypeFromSignature(signature) : void 0; + } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { if (template.parent.kind === 212 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); @@ -70413,7 +70759,9 @@ function createTypeChecker(host) { } const index = findContextualNode(node); if (index >= 0) { - return contextualTypes[index]; + const cached = contextualTypes[index]; + if (cached || !contextFlags) + return cached; } const { parent: parent2 } = node; switch (parent2.kind) { @@ -70433,6 +70781,8 @@ function createTypeChecker(host) { case 210 /* CallExpression */: case 211 /* NewExpression */: return getContextualTypeForArgument(parent2, node); + case 167 /* Decorator */: + return getContextualTypeForDecorator(parent2); case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: return isConstTypeReference(parent2.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(parent2.type); @@ -70454,8 +70804,16 @@ function createTypeChecker(host) { Debug.assert(parent2.parent.kind === 225 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent2.parent, node); case 214 /* ParenthesizedExpression */: { - const tag = isInJSFile(parent2) ? getJSDocTypeTag(parent2) : void 0; - return !tag ? getContextualType2(parent2, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(tag.typeExpression.type); + if (isInJSFile(parent2)) { + if (isJSDocSatisfiesExpression(parent2)) { + return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent2)); + } + const typeTag = getJSDocTypeTag(parent2); + if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) { + return getTypeFromTypeNode(typeTag.typeExpression.type); + } + } + return getContextualType2(parent2, contextFlags); } case 232 /* NonNullExpression */: return getContextualType2(parent2, contextFlags); @@ -71607,7 +71965,7 @@ function createTypeChecker(host) { } if (jsxFactorySym) { jsxFactorySym.isReferenced = 67108863 /* All */; - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + if (!compilerOptions.verbatimModuleSyntax && jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { markAliasSymbolAsReferenced(jsxFactorySym); } } @@ -72064,7 +72422,7 @@ function createTypeChecker(host) { node.kind === 163 /* QualifiedName */ ); } - if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 302 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { + if (isIdentifier(left) && parentSymbol && (getIsolatedModules(compilerOptions) || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 302 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { markAliasReferenced(parentSymbol, node); } let propType; @@ -72273,7 +72631,7 @@ function createTypeChecker(host) { } } } - const resultDiagnostic = createDiagnosticForNodeFromMessageChain(propNode, errorInfo); + const resultDiagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(propNode), propNode, errorInfo); if (relatedInfo) { addRelatedInfo(resultDiagnostic, relatedInfo); } @@ -73135,35 +73493,22 @@ function createTypeChecker(host) { return args; } function getEffectiveDecoratorArguments(node) { - const parent2 = node.parent; const expr = node.expression; - switch (parent2.kind) { - case 260 /* ClassDeclaration */: - case 228 /* ClassExpression */: - return [ - createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfDeclaration(parent2))) - ]; - case 166 /* Parameter */: - const func = parent2.parent; - return [ - createSyntheticExpression(expr, parent2.parent.kind === 173 /* Constructor */ ? getTypeOfSymbol(getSymbolOfDeclaration(func)) : errorType), - createSyntheticExpression(expr, anyType), - createSyntheticExpression(expr, numberType) - ]; - case 169 /* PropertyDeclaration */: - case 171 /* MethodDeclaration */: - case 174 /* GetAccessor */: - case 175 /* SetAccessor */: - const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2)); - return [ - createSyntheticExpression(expr, getParentTypeOfClassElement(parent2)), - createSyntheticExpression(expr, getClassElementPropertyKeyType(parent2)), - createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent2)) : anyType) - ]; + const signature = getDecoratorCallSignature(node); + if (signature) { + const args = []; + for (const param of signature.parameters) { + const type = getTypeOfSymbol(param); + args.push(createSyntheticExpression(expr, type)); + } + return args; } return Debug.fail(); } function getDecoratorArgumentCount(node, signature) { + return compilerOptions.experimentalDecorators ? getLegacyDecoratorArgumentCount(node, signature) : 2; + } + function getLegacyDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { case 260 /* ClassDeclaration */: case 228 /* ClassExpression */: @@ -73198,9 +73543,15 @@ function createTypeChecker(host) { function getDiagnosticForCallNode(node, message, arg0, arg1, arg2, arg3) { if (isCallExpression(node)) { const { sourceFile, start: start2, length: length2 } = getDiagnosticSpanForCallNode(node); - return createFileDiagnostic(sourceFile, start2, length2, message, arg0, arg1, arg2, arg3); + if ("message" in message) { + return createFileDiagnostic(sourceFile, start2, length2, message, arg0, arg1, arg2, arg3); + } + return createDiagnosticForFileFromMessageChain(sourceFile, message); } else { - return createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + if ("message" in message) { + return createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + } + return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, message); } } function isPromiseResolveArityError(node) { @@ -73224,7 +73575,7 @@ function createTypeChecker(host) { ); return constructorSymbol === globalPromiseSymbol; } - function getArgumentArityError(node, signatures, args) { + function getArgumentArityError(node, signatures, args, headMessage) { var _a2; const spreadIndex = getSpreadArgumentIndex(args); if (spreadIndex > -1) { @@ -73254,11 +73605,36 @@ function createTypeChecker(host) { if (isVoidPromiseError && isInJSFile(node)) { return getDiagnosticForCallNode(node, Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments); } - const error2 = hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; + const error2 = isDecorator(node) ? hasRestParameter2 ? Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 : Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 : hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; if (min2 < args.length && args.length < max) { + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, + args.length, + maxBelow, + minAbove + ); + chain = chainDiagnosticMessages(chain, headMessage); + return getDiagnosticForCallNode(node, chain); + } return getDiagnosticForCallNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove); } else if (args.length < min2) { - const diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + let diagnostic; + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + error2, + parameterRange, + args.length + ); + chain = chainDiagnosticMessages(chain, headMessage); + diagnostic = getDiagnosticForCallNode(node, chain); + } else { + diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + } const parameter = (_a2 = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a2.parameters[closestSignature.thisParameter ? args.length + 1 : args.length]; if (parameter) { const parameterError = createDiagnosticForNode( @@ -73277,15 +73653,37 @@ function createTypeChecker(host) { end++; } setTextRangePosEnd(errorSpan, pos, end); + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + error2, + parameterRange, + args.length + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), errorSpan, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error2, parameterRange, args.length); } } - function getTypeArgumentArityError(node, signatures, typeArguments) { + function getTypeArgumentArityError(node, signatures, typeArguments, headMessage) { const argCount = typeArguments.length; if (signatures.length === 1) { const sig = signatures[0]; const min2 = getMinTypeArgumentCount(sig.typeParameters); const max = length(sig.typeParameters); + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + min2 < max ? min2 + "-" + max : min2, + argCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min2 < max ? min2 + "-" + max : min2, argCount); } let belowArgCount = -Infinity; @@ -73300,11 +73698,34 @@ function createTypeChecker(host) { } } if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, + argCount, + belowArgCount, + aboveArgCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); } + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + belowArgCount === -Infinity ? aboveArgCount : belowArgCount, + argCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } - function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { + function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) { const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */; const isDecorator2 = node.kind === 167 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); @@ -73353,6 +73774,9 @@ function createTypeChecker(host) { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call); } + if (headMessage) { + chain = chainDiagnosticMessages(chain, headMessage); + } const diags = getSignatureApplicabilityError( node, args, @@ -73413,39 +73837,40 @@ function createTypeChecker(host) { } const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures"); - const chain = chainDiagnosticMessages( + let chain = chainDiagnosticMessages( map(diags, createDiagnosticMessageChainFromDiagnostic), Diagnostics.No_overload_matches_this_call ); + if (headMessage) { + chain = chainDiagnosticMessages(chain, headMessage); + } const related = [...flatMap(diags, (d) => d.relatedInformation)]; let diag2; if (every(diags, (d) => d.start === diags[0].start && d.length === diags[0].length && d.file === diags[0].file)) { const { file, start: start2, length: length2 } = diags[0]; diag2 = { file, start: start2, length: length2, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; } else { - diag2 = createDiagnosticForNodeFromMessageChain(node, chain, related); + diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, chain, related); } addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2); diagnostics.add(diag2); } } else if (candidateForArgumentArityError) { - diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args)); + diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args, headMessage)); } else if (candidateForTypeArgumentError) { checkTypeArguments( candidateForTypeArgumentError, node.typeArguments, /*reportErrors*/ true, - fallbackError + headMessage ); } else { const signaturesWithCorrectTypeArgumentArity = filter(signatures, (s) => hasCorrectTypeArgumentArity(s, typeArguments)); if (signaturesWithCorrectTypeArgumentArity.length === 0) { - diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments)); - } else if (!isDecorator2) { - diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args)); - } else if (fallbackError) { - diagnostics.add(getDiagnosticForCallNode(node, fallbackError)); + diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments, headMessage)); + } else { + diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args, headMessage)); } } } @@ -73948,7 +74373,7 @@ function createTypeChecker(host) { } function invocationError(errorTarget, apparentType, kind, relatedInformation) { const { messageChain, relatedMessage: relatedInfo } = invocationErrorDetails(errorTarget, apparentType, kind); - const diagnostic = createDiagnosticForNodeFromMessageChain(errorTarget, messageChain); + const diagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorTarget), errorTarget, messageChain); if (relatedInfo) { addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo)); } @@ -74029,7 +74454,7 @@ function createTypeChecker(host) { if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { return resolveUntypedCall(node); } - if (isPotentiallyUncalledDecorator(node, callSignatures)) { + if (isPotentiallyUncalledDecorator(node, callSignatures) && !isParenthesizedExpression(node.expression)) { const nodeStr = getTextOfNode( node.expression, /*includeTrivia*/ @@ -74042,7 +74467,7 @@ function createTypeChecker(host) { if (!callSignatures.length) { const errorDetails = invocationErrorDetails(node.expression, apparentType, 0 /* Call */); const messageChain = chainDiagnosticMessages(errorDetails.messageChain, headMessage); - const diag2 = createDiagnosticForNodeFromMessageChain(node.expression, messageChain); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node.expression), node.expression, messageChain); if (errorDetails.relatedMessage) { addRelatedInfo(diag2, createDiagnosticForNode(node.expression, errorDetails.relatedMessage)); } @@ -74659,12 +75084,15 @@ function createTypeChecker(host) { } function checkSatisfiesExpression(node) { checkSourceElement(node.type); - const exprType = checkExpression(node.expression); - const targetType = getTypeFromTypeNode(node.type); + return checkSatisfiesExpressionWorker(node.expression, node.type); + } + function checkSatisfiesExpressionWorker(expression, target, checkMode) { + const exprType = checkExpression(expression, checkMode); + const targetType = getTypeFromTypeNode(target); if (isErrorType(targetType)) { return targetType; } - checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); + checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); return exprType; } function checkMetaProperty(node) { @@ -75002,6 +75430,243 @@ function createTypeChecker(host) { } } } + function createClassDecoratorContextType(classType) { + return tryCreateTypeReference(getGlobalClassDecoratorContextType( + /*reportErrors*/ + true + ), [classType]); + } + function createClassMethodDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassMethodDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassGetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassGetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassSetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassSetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassFieldDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2) { + const key = `${isPrivate ? "p" : "P"}${isStatic2 ? "s" : "S"}${nameType.id}`; + let overrideType = decoratorContextOverrideTypeCache.get(key); + if (!overrideType) { + const members = createSymbolTable(); + members.set("name", createProperty("name", nameType)); + members.set("private", createProperty("private", isPrivate ? trueType : falseType)); + members.set("static", createProperty("static", isStatic2 ? trueType : falseType)); + overrideType = createAnonymousType( + /*symbol*/ + void 0, + members, + emptyArray, + emptyArray, + emptyArray + ); + decoratorContextOverrideTypeCache.set(key, overrideType); + } + return overrideType; + } + function createClassMemberDecoratorContextTypeForNode(node, thisType, valueType) { + const isStatic2 = hasStaticModifier(node); + const isPrivate = isPrivateIdentifier(node.name); + const nameType = isPrivate ? getStringLiteralType(idText(node.name)) : getLiteralTypeFromPropertyName(node.name); + const contextType = isMethodDeclaration(node) ? createClassMethodDecoratorContextType(thisType, valueType) : isGetAccessorDeclaration(node) ? createClassGetterDecoratorContextType(thisType, valueType) : isSetAccessorDeclaration(node) ? createClassSetterDecoratorContextType(thisType, valueType) : isAutoAccessorPropertyDeclaration(node) ? createClassAccessorDecoratorContextType(thisType, valueType) : isPropertyDeclaration(node) ? createClassFieldDecoratorContextType(thisType, valueType) : Debug.failBadSyntaxKind(node); + const overrideType = getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2); + return getIntersectionType([contextType, overrideType]); + } + function createClassAccessorDecoratorTargetType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorTargetType( + /*reportError*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorResultType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorResultType( + /*reportError*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorInitializerMutatorType(thisType, valueType) { + const thisParam = createParameter("this", thisType); + const valueParam = createParameter("value", valueType); + return createFunctionType( + /*typeParameters*/ + void 0, + thisParam, + [valueParam], + valueType, + /*typePredicate*/ + void 0, + 1 + ); + } + function createESDecoratorCallSignature(targetType, contextType, nonOptionalReturnType) { + const targetParam = createParameter("target", targetType); + const contextParam = createParameter("context", contextType); + const returnType = getUnionType([nonOptionalReturnType, voidType]); + return createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, contextParam], + returnType + ); + } + function getESDecoratorCallSignature(decorator) { + const { parent: parent2 } = decorator; + const links = getNodeLinks(parent2); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent2.kind) { + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: { + const node = parent2; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const contextType = createClassDecoratorContextType(targetType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); + break; + } + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const valueType = isMethodDeclaration(node) ? getOrCreateTypeFromSignature(getSignatureFromDeclaration(node)) : getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + case 169 /* PropertyDeclaration */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const valueType = getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = hasAccessorModifier(node) ? createClassAccessorDecoratorTargetType(thisType, valueType) : undefinedType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = hasAccessorModifier(node) ? createClassAccessorDecoratorResultType(thisType, valueType) : createClassFieldDecoratorInitializerMutatorType(thisType, valueType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getLegacyDecoratorCallSignature(decorator) { + const { parent: parent2 } = decorator; + const links = getNodeLinks(parent2); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent2.kind) { + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: { + const node = parent2; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const targetParam = createParameter("target", targetType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam], + getUnionType([targetType, voidType]) + ); + break; + } + case 166 /* Parameter */: { + const node = parent2; + if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { + break; + } + if (getThisParameter(node.parent) === node) { + break; + } + const index = getThisParameter(node.parent) ? node.parent.parameters.indexOf(node) - 1 : node.parent.parameters.indexOf(node); + Debug.assert(index >= 0); + const targetType = isConstructorDeclaration(node.parent) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent.parent)) : getParentTypeOfClassElement(node.parent); + const keyType = isConstructorDeclaration(node.parent) ? undefinedType : getClassElementPropertyKeyType(node.parent); + const indexType = getNumberLiteralType(index); + const targetParam = createParameter("target", targetType); + const keyParam = createParameter("propertyKey", keyType); + const indexParam = createParameter("parameterIndex", indexType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, indexParam], + voidType + ); + break; + } + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: + case 169 /* PropertyDeclaration */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const targetType = getParentTypeOfClassElement(node); + const targetParam = createParameter("target", targetType); + const keyType = getClassElementPropertyKeyType(node); + const keyParam = createParameter("propertyKey", keyType); + const returnType = isPropertyDeclaration(node) ? voidType : createTypedPropertyDescriptorType(getTypeOfNode(node)); + const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2)); + if (hasPropDesc) { + const descriptorType = createTypedPropertyDescriptorType(getTypeOfNode(node)); + const descriptorParam = createParameter("descriptor", descriptorType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, descriptorParam], + getUnionType([returnType, voidType]) + ); + } else { + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam], + getUnionType([returnType, voidType]) + ); + } + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getDecoratorCallSignature(decorator) { + return legacyDecorators ? getLegacyDecoratorCallSignature(decorator) : getESDecoratorCallSignature(decorator); + } function createPromiseType(promisedType) { const globalPromiseType = getGlobalPromiseType( /*reportErrors*/ @@ -76071,12 +76736,12 @@ function createTypeChecker(host) { void 0 ); const operator = operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) { - if (operator === 55 /* AmpersandAmpersandToken */) { - let parent2 = node.parent; - while (parent2.kind === 214 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) { - parent2 = parent2.parent; - } + if (isLogicalOrCoalescingBinaryOperator(operator)) { + let parent2 = node.parent; + while (parent2.kind === 214 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { + parent2 = parent2.parent; + } + if (operator === 55 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) { checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0); } checkTruthinessOfType(leftType, node.left); @@ -76153,7 +76818,7 @@ function createTypeChecker(host) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 108 /* ThisKeyword */); } let leftType; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) { + if (isLogicalOrCoalescingBinaryOperator(operator)) { leftType = checkTruthinessExpression(left, checkMode); } else { leftType = checkExpression(left, checkMode); @@ -76304,7 +76969,14 @@ function createTypeChecker(host) { if (checkForDisallowedESSymbolOperand(operator)) { leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); - reportOperatorErrorUnless((left2, right2) => isTypeComparableTo(left2, right2) || isTypeComparableTo(right2, left2) || isTypeAssignableTo(left2, numberOrBigIntType) && isTypeAssignableTo(right2, numberOrBigIntType)); + reportOperatorErrorUnless((left2, right2) => { + if (isTypeAny(left2) || isTypeAny(right2)) { + return true; + } + const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType); + const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType); + return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2); + }); } return booleanType; case 34 /* EqualsEqualsToken */: @@ -76437,7 +77109,7 @@ function createTypeChecker(host) { left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access - ) && (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) { + )) { let headMessage; if (exactOptionalPropertyTypes && isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768 /* Undefined */)) { const target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText); @@ -76686,7 +77358,7 @@ function createTypeChecker(host) { } return links.resolvedType; } - function isTypeAssertion3(node) { + function isTypeAssertion(node) { node = skipParentheses( node, /*excludeJSDocTypeAssertions*/ @@ -76696,6 +77368,12 @@ function createTypeChecker(host) { } function checkDeclarationInitializer(declaration, checkMode, contextualType) { const initializer = getEffectiveInitializer(declaration); + if (isInJSFile(declaration)) { + const typeNode = tryGetJSDocSatisfiesTypeNode(declaration); + if (typeNode) { + return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode); + } + } const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType( initializer, contextualType, @@ -76764,7 +77442,7 @@ function createTypeChecker(host) { } function checkExpressionForMutableLocation(node, checkMode, forceTuple) { const type = checkExpression(node, checkMode, forceTuple); - return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion3(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType( + return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType( getContextualType2( node, /*contextFlags*/ @@ -77014,18 +77692,23 @@ function createTypeChecker(host) { if (!ok) { error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } - if (compilerOptions.isolatedModules) { + if (getIsolatedModules(compilerOptions)) { Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */)); const constEnumDeclaration = type.symbol.valueDeclaration; if (constEnumDeclaration.flags & 16777216 /* Ambient */) { - error(node, Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided); + error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } } } function checkParenthesizedExpression(node, checkMode) { - if (hasJSDocNodes(node) && isJSDocTypeAssertion(node)) { - const type = getJSDocTypeAssertionType(node); - return checkAssertionWorker(type, type, node.expression, checkMode); + if (hasJSDocNodes(node)) { + if (isJSDocSatisfiesExpression(node)) { + return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode); + } + if (isJSDocTypeAssertion(node)) { + const type = getJSDocTypeAssertionType(node); + return checkAssertionWorker(type, type, node.expression, checkMode); + } } return checkExpression(node.expression, checkMode); } @@ -77188,7 +77871,7 @@ function createTypeChecker(host) { } } function checkParameter(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkVariableLikeDeclaration(node); const func = getContainingFunction(node); if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) { @@ -77509,7 +78192,7 @@ function createTypeChecker(host) { } } function checkPropertyDeclaration(node) { - if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarProperty(node)) + if (!checkGrammarModifiers(node) && !checkGrammarProperty(node)) checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); setNodeLinksForPrivateIdentifierScope(node); @@ -77553,7 +78236,7 @@ function createTypeChecker(host) { } } function checkClassStaticBlockDeclaration(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); forEachChild(node, checkSourceElement); } function checkConstructorDeclaration(node) { @@ -77733,8 +78416,11 @@ function createTypeChecker(host) { } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 180 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) { - grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + if (node.kind === 180 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { + const sourceFile = getSourceFileOfNode(node); + if (scanTokenAtPosition(sourceFile, node.typeName.end) === 24 /* DotToken */) { + grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + } } forEach(node.typeArguments, checkSourceElement); const type = getTypeFromTypeReference(node); @@ -78427,7 +79113,7 @@ function createTypeChecker(host) { chain = chainDiagnosticMessages(chain, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForErrorOut.value)); } chain = chainDiagnosticMessages(chain, diagnosticMessage, arg0); - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chain)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chain)); } return void 0; } @@ -78518,36 +79204,66 @@ function createTypeChecker(host) { if (returnType.flags & 1 /* Any */) { return; } + const decoratorSignature = getDecoratorCallSignature(node); + if (!(decoratorSignature == null ? void 0 : decoratorSignature.resolvedReturnType)) + return; let headMessage; - let expectedReturnType; + const expectedReturnType = decoratorSignature.resolvedReturnType; switch (node.parent.kind) { case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - const classSymbol = getSymbolOfDeclaration(node.parent); - const classConstructorType = getTypeOfSymbol(classSymbol); - expectedReturnType = getUnionType([classConstructorType, voidType]); break; case 169 /* PropertyDeclaration */: + if (!legacyDecorators) { + headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + break; + } case 166 /* Parameter */: headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; - expectedReturnType = voidType; break; case 171 /* MethodDeclaration */: case 174 /* GetAccessor */: case 175 /* SetAccessor */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - const methodType = getTypeOfNode(node.parent); - const descriptorType = createTypedPropertyDescriptorType(methodType); - expectedReturnType = getUnionType([descriptorType, voidType]); break; default: - return Debug.fail(); + return Debug.failBadSyntaxKind(node.parent); } - checkTypeAssignableTo( - returnType, - expectedReturnType, - node, - headMessage + checkTypeAssignableTo(returnType, expectedReturnType, node.expression, headMessage); + } + function createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount = parameters.length, flags = 0 /* None */) { + const decl = factory.createFunctionTypeNode( + /*typeParameters*/ + void 0, + emptyArray, + factory.createKeywordTypeNode(131 /* AnyKeyword */) + ); + return createSignature(decl, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + } + function createFunctionType(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags) { + const signature = createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + return getOrCreateTypeFromSignature(signature); + } + function createGetterFunctionType(type) { + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + type + ); + } + function createSetterFunctionType(type) { + const valueParam = createParameter("value", type); + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [valueParam], + voidType ); } function markTypeNodeAsReferenced(node) { @@ -78574,9 +79290,9 @@ function createTypeChecker(host) { true ); if (rootSymbol && rootSymbol.flags & 2097152 /* Alias */) { - if (symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { + if (!compilerOptions.verbatimModuleSyntax && symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { markAliasSymbolAsReferenced(rootSymbol); - } else if (forDecoratorMetadata && compilerOptions.isolatedModules && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { + } else if (forDecoratorMetadata && getIsolatedModules(compilerOptions) && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { const diag2 = error(typeName, Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled); const aliasDeclaration = find(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration2); if (aliasDeclaration) { @@ -78642,19 +79358,37 @@ function createTypeChecker(host) { return isRestParameter(node) ? getRestParameterElementType(typeNode) : typeNode; } function checkDecorators(node) { - if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(node, node.parent, node.parent.parent)) { + if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { return; } - if (!compilerOptions.experimentalDecorators) { - error(node, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning); - } const firstDecorator = find(node.modifiers, isDecorator); if (!firstDecorator) { return; } - checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 166 /* Parameter */) { - checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + if (legacyDecorators) { + checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); + if (node.kind === 166 /* Parameter */) { + checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + } + } else if (languageVersion < 99 /* ESNext */) { + checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */); + if (isClassDeclaration(node)) { + if (!node.name) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } else { + const member = getFirstTransformableStaticClassElement(node); + if (member) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } + } + } else if (!isClassExpression(node)) { + if (isPrivateIdentifier(node.name) && (isMethodDeclaration(node) || isAccessor(node) || isAutoAccessorPropertyDeclaration(node))) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } + if (isComputedPropertyName(node.name)) { + checkExternalEmitHelpers(firstDecorator, 16777216 /* PropKey */); + } + } } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); @@ -78724,6 +79458,19 @@ function createTypeChecker(host) { function checkJSDocTypeTag(node) { checkSourceElement(node.typeExpression); } + function checkJSDocSatisfiesTag(node) { + checkSourceElement(node.typeExpression); + const host2 = getEffectiveJSDocHost(node); + if (host2) { + const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag); + if (length(tags) > 1) { + for (let i = 1; i < length(tags); i++) { + const tagName = tags[i].tagName; + error(tagName, Diagnostics._0_tag_already_specified, idText(tagName)); + } + } + } + } function checkJSDocLinkLikeTag(node) { if (node.name) { resolveJSDocMemberName( @@ -79396,7 +80143,7 @@ function createTypeChecker(host) { return; } const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 205 /* BindingElement */ ? node.parent.parent : node)) { + if (symbol.flags & 2097152 /* Alias */ && (isVariableDeclarationInitializedToBareOrAccessedRequire(node) || isBindingElementOfBareOrAccessedRequire(node))) { checkAliasSymbol(node); return; } @@ -79488,7 +80235,7 @@ function createTypeChecker(host) { return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { - if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) + if (!checkGrammarModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) checkGrammarForDisallowedLetOrConstStatement(node); forEach(node.declarationList.declarations, checkSourceElement); } @@ -79509,17 +80256,26 @@ function createTypeChecker(host) { function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) { if (!strictNullChecks) return; - helper(condExpr, body); - while (isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56 /* BarBarToken */) { - condExpr = condExpr.left; - helper(condExpr, body); + bothHelper(condExpr, body); + function bothHelper(condExpr2, body2) { + condExpr2 = skipParentheses(condExpr2); + helper(condExpr2, body2); + while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 60 /* QuestionQuestionToken */)) { + condExpr2 = skipParentheses(condExpr2.left); + helper(condExpr2, body2); + } } function helper(condExpr2, body2) { - const location = isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 55 /* AmpersandAmpersandToken */) ? condExpr2.right : condExpr2; - if (isModuleExportsAccessExpression(location)) + const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2; + if (isModuleExportsAccessExpression(location)) { + return; + } + if (isLogicalOrCoalescingBinaryExpression(location)) { + bothHelper(location, body2); return; + } const type = location === condExpr2 ? condType : checkTruthinessExpression(location); - const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion3(location.expression); + const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression); if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast) return; const callSignatures = getSignaturesOfType(type, 0 /* Call */); @@ -79527,7 +80283,7 @@ function createTypeChecker(host) { if (callSignatures.length === 0 && !isPromise) { return; } - const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : isBinaryExpression(location) && isIdentifier(location.right) ? location.right : void 0; + const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0; const testedSymbol = testedNode && getSymbolAtLocation(testedNode); if (!testedSymbol && !isPromise) { return; @@ -80485,14 +81241,10 @@ function createTypeChecker(host) { if (catchClause) { if (catchClause.variableDeclaration) { const declaration = catchClause.variableDeclaration; - const typeNode = getEffectiveTypeAnnotationNode(getRootDeclaration(declaration)); + checkVariableLikeDeclaration(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration); if (typeNode) { - const type = getTypeForVariableLikeDeclaration( - declaration, - /*includeOptionality*/ - false, - 0 /* Normal */ - ); + const type = getTypeFromTypeNode(typeNode); if (type && !(type.flags & 3 /* AnyOrUnknown */)) { grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } @@ -80747,9 +81499,65 @@ function createTypeChecker(host) { } return true; } + function getFirstTransformableStaticClassElement(node) { + var _a2; + const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ESNext */ && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + ); + const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */; + const willTransformInitializers = !useDefineForClassFields || languageVersion < 9 /* ES2022 */; + if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) { + for (const member of node.members) { + if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated( + /*useLegacyDecorators*/ + false, + member, + node + )) { + return (_a2 = firstOrUndefined(getDecorators(node))) != null ? _a2 : node; + } else if (willTransformPrivateElementsOrClassStaticBlocks) { + if (isClassStaticBlockDeclaration(member)) { + return member; + } else if (isStatic(member)) { + if (isPrivateIdentifierClassElementDeclaration(member) || willTransformInitializers && isInitializedProperty(member)) { + return member; + } + } + } + } + } + } + function checkClassExpressionExternalHelpers(node) { + var _a2; + if (node.name) + return; + const parent2 = walkUpOuterExpressions(node); + if (!isNamedEvaluationSource(parent2)) + return; + const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ESNext */; + let location; + if (willTransformESDecorators && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + )) { + location = (_a2 = firstOrUndefined(getDecorators(node))) != null ? _a2 : node; + } else { + location = getFirstTransformableStaticClassElement(node); + } + if (location) { + checkExternalEmitHelpers(location, 8388608 /* SetFunctionName */); + if ((isPropertyAssignment(parent2) || isPropertyDeclaration(parent2) || isBindingElement(parent2)) && isComputedPropertyName(parent2.name)) { + checkExternalEmitHelpers(location, 16777216 /* PropKey */); + } + } + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); + checkClassExpressionExternalHelpers(node); return getTypeOfSymbol(getSymbolOfDeclaration(node)); } function checkClassExpressionDeferred(node) { @@ -80758,7 +81566,7 @@ function createTypeChecker(host) { } function checkClassDeclaration(node) { const firstDecorator = find(node.modifiers, isDecorator); - if (firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { + if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator); } if (!node.name && !hasSyntacticModifier(node, 1024 /* Default */)) { @@ -81232,7 +82040,7 @@ function createTypeChecker(host) { typeName2 ); errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); - diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(typeNode), typeNode, errorInfo)); } } } @@ -81288,7 +82096,7 @@ function createTypeChecker(host) { return !containsUndefinedType(flowType); } function checkInterfaceDeclaration(node) { - if (!checkGrammarDecoratorsAndModifiers(node)) + if (!checkGrammarModifiers(node)) checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); addLazyDiagnostic(() => { @@ -81322,7 +82130,7 @@ function createTypeChecker(host) { }); } function checkTypeAliasDeclaration(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); @@ -81518,7 +82326,7 @@ function createTypeChecker(host) { addLazyDiagnostic(() => checkEnumDeclarationWorker(node)); } function checkEnumDeclarationWorker(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkCollisionsForDeclarationName(node, node.name); checkExportsOnMergedDeclarations(node); node.members.forEach(checkEnumMember); @@ -81593,6 +82401,7 @@ function createTypeChecker(host) { } addLazyDiagnostic(checkModuleDeclarationDiagnostics); function checkModuleDeclarationDiagnostics() { + var _a2, _b; const isGlobalAugmentation = isGlobalScopeAugmentation(node); const inAmbientContext = node.flags & 16777216 /* Ambient */; if (isGlobalAugmentation && !inAmbientContext) { @@ -81603,7 +82412,7 @@ function createTypeChecker(host) { if (checkGrammarModuleElementContext(node, contextErrorMessage)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node)) { + if (!checkGrammarModifiers(node)) { if (!inAmbientContext && node.name.kind === 10 /* StringLiteral */) { grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -81613,18 +82422,29 @@ function createTypeChecker(host) { } checkExportsOnMergedDeclarations(node); const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && symbol.declarations && symbol.declarations.length > 1 && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { - const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (firstNonAmbientClassOrFunc) { - if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { + if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) { + error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); + } + if (((_a2 = symbol.declarations) == null ? void 0 : _a2.length) > 1) { + const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + } else if (node.pos < firstNonAmbientClassOrFunc.pos) { + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + } + } + const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */); + if (mergedClass && inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */); - if (mergedClass && inSameLexicalScope(node, mergedClass)) { - getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */) { + const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 93 /* ExportKeyword */); + if (exportModifier) { + error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } } } if (isAmbientExternalModule) { @@ -81780,7 +82600,7 @@ function createTypeChecker(host) { const message = node.kind === 278 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } - if (compilerOptions.isolatedModules && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) { + if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) { const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol); const isType = !(targetFlags & 111551 /* Value */); if (isType || typeOnlyAlias) { @@ -81788,9 +82608,9 @@ function createTypeChecker(host) { case 270 /* ImportClause */: case 273 /* ImportSpecifier */: case 268 /* ImportEqualsDeclaration */: { - if (compilerOptions.preserveValueImports) { + if (compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) { Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); - const message = isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; + const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? compilerOptions.verbatimModuleSyntax ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : compilerOptions.verbatimModuleSyntax ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; const name = idText(node.kind === 273 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); addTypeOnlyDeclarationRelatedInfo( error(node, message, name), @@ -81799,24 +82619,23 @@ function createTypeChecker(host) { ); } if (isType && node.kind === 268 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) { - error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided); + error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); } break; } case 278 /* ExportSpecifier */: { - if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { - const message = isType ? Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled; + if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { const name = idText(node.propertyName || node.name); - addTypeOnlyDeclarationRelatedInfo( - error(node, message, name), - isType ? void 0 : typeOnlyAlias, - name - ); - return; + const diagnostic = isType ? error(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName); + addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name); + break; } } } } + if (compilerOptions.verbatimModuleSyntax && node.kind !== 268 /* ImportEqualsDeclaration */ && !isInJSFile(node) && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } } if (isImportSpecifier(node)) { const targetSymbol = checkDeprecatedAliasedSymbol(symbol, node); @@ -81896,7 +82715,7 @@ function createTypeChecker(host) { if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -81926,7 +82745,7 @@ function createTypeChecker(host) { if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (hasSyntacticModifier(node, 1 /* Export */)) { @@ -81962,7 +82781,7 @@ function createTypeChecker(host) { if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasSyntacticModifiers(node)) { + if (!checkGrammarModifiers(node) && hasSyntacticModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers); } if (node.moduleSpecifier && node.exportClause && isNamedExports(node.exportClause) && length(node.exportClause.elements) && languageVersion === 0 /* ES3 */) { @@ -81999,12 +82818,8 @@ function createTypeChecker(host) { } function checkGrammarExportDeclaration(node) { var _a2; - if (node.isTypeOnly) { - if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) { - return checkGrammarNamedImportsOrExports(node.exportClause); - } else { - return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type); - } + if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) { + return checkGrammarNamedImportsOrExports(node.exportClause); } return false; } @@ -82102,13 +82917,14 @@ function createTypeChecker(host) { } return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); } const typeAnnotationNode = getEffectiveTypeAnnotationNode(node); if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } + const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; const sym = resolveEntityName( @@ -82122,16 +82938,28 @@ function createTypeChecker(host) { ); if (sym) { markAliasReferenced(sym, id); - const target = sym.flags & 2097152 /* Alias */ ? resolveAlias(sym) : sym; - if (getAllSymbolFlags(target) & 111551 /* Value */) { - checkExpressionCached(node.expression); + if (getAllSymbolFlags(sym) & 111551 /* Value */) { + checkExpressionCached(id); + if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { + error( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, + idText(id) + ); + } + } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + error( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, + idText(id) + ); } } else { - checkExpressionCached(node.expression); + checkExpressionCached(id); } if (getEmitDeclarations(compilerOptions)) { collectLinkedAliases( - node.expression, + id, /*setVisibility*/ true ); @@ -82139,6 +82967,9 @@ function createTypeChecker(host) { } else { checkExpressionCached(node.expression); } + if (isIllegalExportDefaultInCJS) { + error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } checkExternalModuleExports(container); if (node.flags & 16777216 /* Ambient */ && !isEntityNameExpression(node.expression)) { grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context); @@ -82328,6 +83159,8 @@ function createTypeChecker(host) { case 338 /* JSDocProtectedTag */: case 337 /* JSDocPrivateTag */: return checkJSDocAccessibilityModifiers(node); + case 353 /* JSDocSatisfiesTag */: + return checkJSDocSatisfiesTag(node); case 196 /* IndexedAccessType */: return checkIndexedAccessType(node); case 197 /* MappedType */: @@ -83343,8 +84176,9 @@ function createTypeChecker(host) { } } function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; + const specifier = getIdentifierGeneratedImportReference(nodeIn); + if (specifier) { + return specifier; } const node = getParseTreeNode(nodeIn, isIdentifier); if (node) { @@ -83426,6 +84260,7 @@ function createTypeChecker(host) { return false; } function isValueAliasDeclaration(node) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); switch (node.kind) { case 268 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfDeclaration(node)); @@ -83466,6 +84301,7 @@ function createTypeChecker(host) { return isConstEnumSymbol(s) || !!s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); if (isAliasSymbolDeclaration2(node)) { const symbol = getSymbolOfDeclaration(node); const links = symbol && getSymbolLinks(symbol); @@ -84182,23 +85018,27 @@ function createTypeChecker(host) { const helpersModule = resolveHelpersModule(sourceFile, location); if (helpersModule !== unknownSymbol) { const uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; - for (let helper = 1 /* FirstEmitHelper */; helper <= 4194304 /* LastEmitHelper */; helper <<= 1) { + for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) { if (uncheckedHelpers & helper) { - const name = getHelperName(helper); - const symbol = getSymbol2(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */); - if (!symbol) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); - } else if (helper & 524288 /* ClassPrivateFieldGet */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); - } - } else if (helper & 1048576 /* ClassPrivateFieldSet */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); - } - } else if (helper & 1024 /* SpreadArray */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + for (const name of getHelperNames(helper)) { + if (requestedExternalEmitHelperNames.has(name)) + continue; + requestedExternalEmitHelperNames.add(name); + const symbol = getSymbol2(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */); + if (!symbol) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); + } else if (helper & 524288 /* ClassPrivateFieldGet */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); + } + } else if (helper & 1048576 /* ClassPrivateFieldSet */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); + } + } else if (helper & 1024 /* SpreadArray */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + } } } } @@ -84208,54 +85048,58 @@ function createTypeChecker(host) { } } } - function getHelperName(helper) { + function getHelperNames(helper) { switch (helper) { case 1 /* Extends */: - return "__extends"; + return ["__extends"]; case 2 /* Assign */: - return "__assign"; + return ["__assign"]; case 4 /* Rest */: - return "__rest"; + return ["__rest"]; case 8 /* Decorate */: - return "__decorate"; + return legacyDecorators ? ["__decorate"] : ["__esDecorate", "__runInitializers"]; case 16 /* Metadata */: - return "__metadata"; + return ["__metadata"]; case 32 /* Param */: - return "__param"; + return ["__param"]; case 64 /* Awaiter */: - return "__awaiter"; + return ["__awaiter"]; case 128 /* Generator */: - return "__generator"; + return ["__generator"]; case 256 /* Values */: - return "__values"; + return ["__values"]; case 512 /* Read */: - return "__read"; + return ["__read"]; case 1024 /* SpreadArray */: - return "__spreadArray"; + return ["__spreadArray"]; case 2048 /* Await */: - return "__await"; + return ["__await"]; case 4096 /* AsyncGenerator */: - return "__asyncGenerator"; + return ["__asyncGenerator"]; case 8192 /* AsyncDelegator */: - return "__asyncDelegator"; + return ["__asyncDelegator"]; case 16384 /* AsyncValues */: - return "__asyncValues"; + return ["__asyncValues"]; case 32768 /* ExportStar */: - return "__exportStar"; + return ["__exportStar"]; case 65536 /* ImportStar */: - return "__importStar"; + return ["__importStar"]; case 131072 /* ImportDefault */: - return "__importDefault"; + return ["__importDefault"]; case 262144 /* MakeTemplateObject */: - return "__makeTemplateObject"; + return ["__makeTemplateObject"]; case 524288 /* ClassPrivateFieldGet */: - return "__classPrivateFieldGet"; + return ["__classPrivateFieldGet"]; case 1048576 /* ClassPrivateFieldSet */: - return "__classPrivateFieldSet"; + return ["__classPrivateFieldSet"]; case 2097152 /* ClassPrivateFieldIn */: - return "__classPrivateFieldIn"; + return ["__classPrivateFieldIn"]; case 4194304 /* CreateBinding */: - return "__createBinding"; + return ["__createBinding"]; + case 8388608 /* SetFunctionName */: + return ["__setFunctionName"]; + case 16777216 /* PropKey */: + return ["__propKey"]; default: return Debug.fail("Unrecognized helper"); } @@ -84266,257 +85110,264 @@ function createTypeChecker(host) { } return externalHelpersModule; } - function checkGrammarDecoratorsAndModifiers(node) { - return checkGrammarDecorators(node) || checkGrammarModifiers(node); - } - function checkGrammarDecorators(node) { - if (canHaveIllegalDecorators(node) && some(node.illegalDecorators)) { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); - } - if (!canHaveDecorators(node) || !hasDecorators(node)) { - return false; - } - if (!nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 171 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { - return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); - } else { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); - } - } else if (node.kind === 174 /* GetAccessor */ || node.kind === 175 /* SetAccessor */) { - const accessors = getAllAccessorDeclarations(node.parent.members, node); - if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); - } - } - return false; - } function checkGrammarModifiers(node) { - const quickResult = reportObviousModifierErrors(node); + const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node); if (quickResult !== void 0) { return quickResult; } - let lastStatic, lastDeclare, lastAsync, lastOverride; + if (isParameter(node) && parameterIsThisKeyword(node)) { + return grammarErrorOnFirstToken(node, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); + } + let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; + let sawExportBeforeDecorators = false; for (const modifier of node.modifiers) { - if (isDecorator(modifier)) - continue; - if (modifier.kind !== 146 /* ReadonlyKeyword */) { - if (node.kind === 168 /* PropertySignature */ || node.kind === 170 /* MethodSignature */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); + if (isDecorator(modifier)) { + if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { + if (node.kind === 171 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } else { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); + } + } else if (legacyDecorators && (node.kind === 174 /* GetAccessor */ || node.kind === 175 /* SetAccessor */)) { + const accessors = getAllAccessorDeclarations(node.parent.members, node); + if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } } - if (node.kind === 178 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !isClassLike(node.parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); + if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { + return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } - } - if (modifier.kind !== 101 /* InKeyword */ && modifier.kind !== 145 /* OutKeyword */ && modifier.kind !== 85 /* ConstKeyword */) { - if (node.kind === 165 /* TypeParameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); + flags |= 131072 /* Decorator */; + if (flags & 1 /* Export */) { + sawExportBeforeDecorators = true; } - } - switch (modifier.kind) { - case 85 /* ConstKeyword */: - if (node.kind !== 263 /* EnumDeclaration */ && node.kind !== 165 /* TypeParameter */) { - return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(85 /* ConstKeyword */)); - } - const parent2 = node.parent; - if (node.kind === 165 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); + firstDecorator != null ? firstDecorator : firstDecorator = modifier; + } else { + if (modifier.kind !== 146 /* ReadonlyKeyword */) { + if (node.kind === 168 /* PropertySignature */ || node.kind === 170 /* MethodSignature */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); } - break; - case 161 /* OverrideKeyword */: - if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); - } - flags |= 16384 /* Override */; - lastOverride = modifier; - break; - case 123 /* PublicKeyword */: - case 122 /* ProtectedKeyword */: - case 121 /* PrivateKeyword */: - const text = visibilityToString(modifierToFlag(modifier.kind)); - if (flags & 28 /* AccessibilityModifier */) { - return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); - } else if (flags & 32 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); - } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); - } else if (flags & 256 /* Abstract */) { - if (modifier.kind === 121 /* PrivateKeyword */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); - } else { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); - } - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + if (node.kind === 178 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !isClassLike(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); } - flags |= modifierToFlag(modifier.kind); - break; - case 124 /* StaticKeyword */: - if (flags & 32 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); - } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } else if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); - } - flags |= 32 /* Static */; - lastStatic = modifier; - break; - case 127 /* AccessorKeyword */: - if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); - } else if (node.kind !== 169 /* PropertyDeclaration */) { - return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); - } - flags |= 128 /* Accessor */; - break; - case 146 /* ReadonlyKeyword */: - if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); - } else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); - } - flags |= 64 /* Readonly */; - break; - case 93 /* ExportKeyword */: - if (flags & 1 /* Export */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } else if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); - } else if (isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 88 /* DefaultKeyword */: - const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 264 /* ModuleDeclaration */ && !isAmbientModule(container)) { - return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); - } else if (!(flags & 1 /* Export */)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); - } - flags |= 1024 /* Default */; - break; - case 136 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); - } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 265 /* ModuleBlock */) { - return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); - } - flags |= 2 /* Ambient */; - lastDeclare = modifier; - break; - case 126 /* AbstractKeyword */: - if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); + } + if (modifier.kind !== 101 /* InKeyword */ && modifier.kind !== 145 /* OutKeyword */ && modifier.kind !== 85 /* ConstKeyword */) { + if (node.kind === 165 /* TypeParameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); } - if (node.kind !== 260 /* ClassDeclaration */ && node.kind !== 182 /* ConstructorType */) { - if (node.kind !== 171 /* MethodDeclaration */ && node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 174 /* GetAccessor */ && node.kind !== 175 /* SetAccessor */) { - return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + switch (modifier.kind) { + case 85 /* ConstKeyword */: + if (node.kind !== 263 /* EnumDeclaration */ && node.kind !== 165 /* TypeParameter */) { + return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(85 /* ConstKeyword */)); + } + const parent2 = node.parent; + if (node.kind === 165 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); + } + break; + case 161 /* OverrideKeyword */: + if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); } - if (!(node.parent.kind === 260 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { - return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + flags |= 16384 /* Override */; + lastOverride = modifier; + break; + case 123 /* PublicKeyword */: + case 122 /* ProtectedKeyword */: + case 121 /* PrivateKeyword */: + const text = visibilityToString(modifierToFlag(modifier.kind)); + if (flags & 28 /* AccessibilityModifier */) { + return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); + } else if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); + } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); + } else if (flags & 256 /* Abstract */) { + if (modifier.kind === 121 /* PrivateKeyword */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); + } else { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); + } + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); } + flags |= modifierToFlag(modifier.kind); + break; + case 124 /* StaticKeyword */: if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); + } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } else if (flags & 256 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); } - if (flags & 8 /* Private */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + flags |= 32 /* Static */; + lastStatic = modifier; + break; + case 127 /* AccessorKeyword */: + if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); + } else if (node.kind !== 169 /* PropertyDeclaration */) { + return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); } - if (flags & 512 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + flags |= 128 /* Accessor */; + break; + case 146 /* ReadonlyKeyword */: + if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); + } else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); } - if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + flags |= 64 /* Readonly */; + break; + case 93 /* ExportKeyword */: + if (compilerOptions.verbatimModuleSyntax && !(node.flags & 16777216 /* Ambient */) && node.kind !== 262 /* TypeAliasDeclaration */ && node.kind !== 261 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later + node.kind !== 264 /* ModuleDeclaration */ && node.parent.kind === 308 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } - if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + if (flags & 1 /* Export */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } else if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); + } else if (isClassLike(node.parent)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } - } - if (isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); - } - flags |= 256 /* Abstract */; - break; - case 132 /* AsyncKeyword */: - if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); - } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); - } - if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } - flags |= 512 /* Async */; - lastAsync = modifier; - break; - case 101 /* InKeyword */: - case 145 /* OutKeyword */: - const inOutFlag = modifier.kind === 101 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; - const inOutText = modifier.kind === 101 /* InKeyword */ ? "in" : "out"; - if (node.kind !== 165 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); - } - if (flags & inOutFlag) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); - } - if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); - } - flags |= inOutFlag; - break; + flags |= 1 /* Export */; + break; + case 88 /* DefaultKeyword */: + const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 264 /* ModuleDeclaration */ && !isAmbientModule(container)) { + return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } else if (!(flags & 1 /* Export */)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); + } else if (sawExportBeforeDecorators) { + return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here); + } + flags |= 1024 /* Default */; + break; + case 136 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); + } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 265 /* ModuleBlock */) { + return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); + } + flags |= 2 /* Ambient */; + lastDeclare = modifier; + break; + case 126 /* AbstractKeyword */: + if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); + } + if (node.kind !== 260 /* ClassDeclaration */ && node.kind !== 182 /* ConstructorType */) { + if (node.kind !== 171 /* MethodDeclaration */ && node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 174 /* GetAccessor */ && node.kind !== 175 /* SetAccessor */) { + return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + if (!(node.parent.kind === 260 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { + return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + } + if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } + if (flags & 8 /* Private */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + } + if (flags & 512 /* Async */ && lastAsync) { + return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + } + if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + } + } + if (isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); + } + flags |= 256 /* Abstract */; + break; + case 132 /* AsyncKeyword */: + if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); + } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); + } + if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + flags |= 512 /* Async */; + lastAsync = modifier; + break; + case 101 /* InKeyword */: + case 145 /* OutKeyword */: + const inOutFlag = modifier.kind === 101 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; + const inOutText = modifier.kind === 101 /* InKeyword */ ? "in" : "out"; + if (node.kind !== 165 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); + } + if (flags & inOutFlag) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); + } + if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); + } + flags |= inOutFlag; + break; + } } } if (node.kind === 173 /* Constructor */) { @@ -84543,9 +85394,16 @@ function createTypeChecker(host) { return false; } function reportObviousModifierErrors(node) { - return !node.modifiers ? false : shouldReportBadModifier(node) ? grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here) : void 0; + if (!node.modifiers) + return false; + const modifier = findFirstIllegalModifier(node); + return modifier && grammarErrorOnFirstToken(modifier, Diagnostics.Modifiers_cannot_appear_here); } - function shouldReportBadModifier(node) { + function findFirstModifierExcept(node, allowedModifier) { + const modifier = find(node.modifiers, isModifier); + return modifier && modifier.kind !== allowedModifier ? modifier : void 0; + } + function findFirstIllegalModifier(node) { switch (node.kind) { case 174 /* GetAccessor */: case 175 /* SetAccessor */: @@ -84564,43 +85422,42 @@ function createTypeChecker(host) { case 216 /* ArrowFunction */: case 166 /* Parameter */: case 165 /* TypeParameter */: - return false; + return void 0; case 172 /* ClassStaticBlockDeclaration */: case 299 /* PropertyAssignment */: case 300 /* ShorthandPropertyAssignment */: case 267 /* NamespaceExportDeclaration */: case 181 /* FunctionType */: case 279 /* MissingDeclaration */: - return true; + return find(node.modifiers, isModifier); default: if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return false; + return void 0; } switch (node.kind) { case 259 /* FunctionDeclaration */: - return nodeHasAnyModifiersExcept(node, 132 /* AsyncKeyword */); + return findFirstModifierExcept(node, 132 /* AsyncKeyword */); case 260 /* ClassDeclaration */: case 182 /* ConstructorType */: - return nodeHasAnyModifiersExcept(node, 126 /* AbstractKeyword */); + return findFirstModifierExcept(node, 126 /* AbstractKeyword */); case 228 /* ClassExpression */: case 261 /* InterfaceDeclaration */: case 240 /* VariableStatement */: case 262 /* TypeAliasDeclaration */: - return true; + return find(node.modifiers, isModifier); case 263 /* EnumDeclaration */: - return nodeHasAnyModifiersExcept(node, 85 /* ConstKeyword */); + return findFirstModifierExcept(node, 85 /* ConstKeyword */); default: Debug.assertNever(node); } } } - function nodeHasAnyModifiersExcept(node, allowedModifier) { - for (const modifier of node.modifiers) { - if (isDecorator(modifier)) - continue; - return modifier.kind !== allowedModifier; - } - return false; + function reportObviousDecoratorErrors(node) { + const decorator = findFirstIllegalDecorator(node); + return decorator && grammarErrorOnFirstToken(decorator, Diagnostics.Decorators_are_not_valid_here); + } + function findFirstIllegalDecorator(node) { + return canHaveIllegalDecorators(node) ? find(node.modifiers, isDecorator) : void 0; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { @@ -84679,7 +85536,7 @@ function createTypeChecker(host) { } function checkGrammarFunctionLikeDeclaration(node) { const file = getSourceFileOfNode(node); - return checkGrammarDecoratorsAndModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); + return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); } function checkGrammarClassLikeDeclaration(node) { const file = getSourceFileOfNode(node); @@ -84737,7 +85594,7 @@ function createTypeChecker(host) { return false; } function checkGrammarIndexSignature(node) { - return checkGrammarDecoratorsAndModifiers(node) || checkGrammarIndexSignatureParameters(node); + return checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { if (typeArguments && typeArguments.length === 0) { @@ -84777,7 +85634,7 @@ function createTypeChecker(host) { function checkGrammarClassDeclarationHeritageClauses(node) { let seenExtendsClause = false; let seenImplementsClause = false; - if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) { + if (!checkGrammarModifiers(node) && node.heritageClauses) { for (const heritageClause of node.heritageClauses) { if (heritageClause.token === 94 /* ExtendsKeyword */) { if (seenExtendsClause) { @@ -84878,7 +85735,9 @@ function createTypeChecker(host) { } } else if (canHaveIllegalModifiers(prop) && prop.modifiers) { for (const mod of prop.modifiers) { - grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); + if (isModifier(mod)) { + grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); + } } } let currentKind; @@ -85322,7 +86181,7 @@ function createTypeChecker(host) { } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 79 /* Identifier */) { - if (name.originalKeywordKind === 119 /* LetKeyword */) { + if (name.escapedText === "let") { return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { @@ -85610,6 +86469,9 @@ function createTypeChecker(host) { }); } function checkGrammarImportCallExpression(node) { + if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) { + return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } if (moduleKind === 5 /* ES2015 */) { return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext); } @@ -85885,13 +86747,10 @@ var SymbolTrackerImpl = class { // src/compiler/visitorPublic.ts function visitNode(node, visitor, test, lift) { - if (node === void 0 || visitor === void 0) { + if (node === void 0) { return node; } const visited = visitor(node); - if (visited === node) { - return node; - } let visitedNode; if (visited === void 0) { return void 0; @@ -85904,7 +86763,7 @@ function visitNode(node, visitor, test, lift) { return visitedNode; } function visitNodes2(nodes, visitor, test, start2, count) { - if (nodes === void 0 || visitor === void 0) { + if (nodes === void 0) { return nodes; } const length2 = nodes.length; @@ -85953,25 +86812,30 @@ function visitArrayWorker(nodes, visitor, test, start2, count) { } for (let i = 0; i < count; i++) { const node = nodes[i + start2]; - const visited = node !== void 0 ? visitor(node) : void 0; + const visited = node !== void 0 ? visitor ? visitor(node) : node : void 0; if (updated !== void 0 || visited === void 0 || visited !== node) { if (updated === void 0) { updated = nodes.slice(0, i); + Debug.assertEachNode(updated, test); } if (visited) { if (isArray(visited)) { for (const visitedNode of visited) { - void Debug.assertNode(visitedNode, test); + Debug.assertNode(visitedNode, test); updated.push(visitedNode); } } else { - void Debug.assertNode(visited, test); + Debug.assertNode(visited, test); updated.push(visited); } } } } - return updated != null ? updated : nodes; + if (updated) { + return updated; + } + Debug.assertEachNode(nodes, test); + return nodes; } function visitLexicalEnvironment(statements, visitor, context, start2, ensureUseStrict, nodesVisitor = visitNodes2) { context.startLexicalEnvironment(); @@ -85985,7 +86849,7 @@ function visitParameterList(nodes, visitor, context, nodesVisitor = visitNodes2) context.startLexicalEnvironment(); if (nodes) { context.setLexicalEnvironmentFlags(1 /* InParameters */, true); - updated = nodesVisitor(nodes, visitor, isParameterDeclaration); + updated = nodesVisitor(nodes, visitor, isParameter); if (context.getLexicalEnvironmentFlags() & 2 /* VariablesHoistedInParameters */ && getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { updated = addDefaultValueAssignmentsIfNeeded(updated, context); } @@ -86107,6 +86971,7 @@ function visitFunctionBody(node, visitor, context, nodeVisitor = visitNode) { function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { context.startBlockScope(); const updated = nodeVisitor(body, visitor, isStatement, context.factory.liftToBlock); + Debug.assert(updated); const declarations = context.endBlockScope(); if (some(declarations)) { if (isBlock(updated)) { @@ -86118,6 +86983,18 @@ function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { } return updated; } +function visitCommaListElements(elements, visitor, discardVisitor = visitor) { + if (discardVisitor === visitor || elements.length <= 1) { + return visitNodes2(elements, visitor, isExpression); + } + let i = 0; + const length2 = elements.length; + return visitNodes2(elements, (node) => { + const discarded = i < length2 - 1; + i++; + return discarded ? discardVisitor(node) : visitor(node); + }, isExpression); +} function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) { if (node === void 0) { return void 0; @@ -86126,23 +87003,17 @@ function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, toke return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor); } var visitEachChildTable = { - [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateIdentifier( - node, - nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration) - ); - }, [163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateQualifiedName( node, - nodeVisitor(node.left, visitor, isEntityName), - nodeVisitor(node.right, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), + Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) ); }, [164 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateComputedPropertyName( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Signature elements @@ -86150,7 +87021,7 @@ var visitEachChildTable = { return context.factory.updateTypeParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.constraint, visitor, isTypeNode), nodeVisitor(node.default, visitor, isTypeNode) ); @@ -86159,9 +87030,9 @@ var visitEachChildTable = { return context.factory.updateParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -86169,7 +87040,7 @@ var visitEachChildTable = { [167 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDecorator( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Type elements @@ -86177,19 +87048,19 @@ var visitEachChildTable = { return context.factory.updatePropertySignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode) ); }, [169 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - var _a2; + var _a2, _b; return context.factory.updatePropertyDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration - nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken), + tokenVisitor ? nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken) : (_b = node.questionToken) != null ? _b : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -86198,10 +87069,10 @@ var visitEachChildTable = { return context.factory.updateMethodSignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -86209,9 +87080,9 @@ var visitEachChildTable = { return context.factory.updateMethodDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), @@ -86221,7 +87092,7 @@ var visitEachChildTable = { [173 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -86230,7 +87101,7 @@ var visitEachChildTable = { return context.factory.updateGetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor) @@ -86240,7 +87111,7 @@ var visitEachChildTable = { return context.factory.updateSetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -86257,7 +87128,7 @@ var visitEachChildTable = { return context.factory.updateCallSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -86265,16 +87136,16 @@ var visitEachChildTable = { return context.factory.updateConstructSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, [178 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexSignature( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, // Types @@ -86282,14 +87153,14 @@ var visitEachChildTable = { return context.factory.updateTypePredicateNode( node, nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), - nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode), + Debug.checkDefined(nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode)), nodeVisitor(node.type, visitor, isTypeNode) ); }, [180 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeReferenceNode( node, - nodeVisitor(node.typeName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -86297,8 +87168,8 @@ var visitEachChildTable = { return context.factory.updateFunctionTypeNode( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [182 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -86306,14 +87177,14 @@ var visitEachChildTable = { node, nodesVisitor(node.modifiers, visitor, isModifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [183 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeQueryNode( node, - nodeVisitor(node.exprName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -86326,7 +87197,7 @@ var visitEachChildTable = { [185 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateArrayTypeNode( node, - nodeVisitor(node.elementType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) ); }, [186 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -86338,13 +87209,13 @@ var visitEachChildTable = { [187 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateOptionalTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [188 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateRestTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [189 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -86362,22 +87233,22 @@ var visitEachChildTable = { [191 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConditionalTypeNode( node, - nodeVisitor(node.checkType, visitor, isTypeNode), - nodeVisitor(node.extendsType, visitor, isTypeNode), - nodeVisitor(node.trueType, visitor, isTypeNode), - nodeVisitor(node.falseType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.extendsType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.trueType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) ); }, [192 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInferTypeNode( node, - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration) + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) ); }, [202 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeNode( node, - nodeVisitor(node.argument, visitor, isTypeNode), + Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer), nodeVisitor(node.qualifier, visitor, isEntityName), nodesVisitor(node.typeArguments, visitor, isTypeNode), @@ -86387,45 +87258,45 @@ var visitEachChildTable = { [298 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeAssertionContainer( node, - nodeVisitor(node.assertClause, visitor, isAssertClause), + Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), node.multiLine ); }, [199 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateNamedTupleMember( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.type, visitor, isTypeNode) + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [193 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedType( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [195 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOperatorNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [196 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexedAccessTypeNode( node, - nodeVisitor(node.objectType, visitor, isTypeNode), - nodeVisitor(node.indexType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) ); }, [197 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMappedTypeNode( node, - nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken), - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration), + tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)), nodeVisitor(node.nameType, visitor, isTypeNode), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodesVisitor(node.members, visitor, isTypeElement) ); @@ -86433,21 +87304,21 @@ var visitEachChildTable = { [198 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLiteralTypeNode( node, - nodeVisitor(node.literal, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) ); }, [200 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralType( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) ); }, [201 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralTypeSpan( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Binding patterns @@ -86466,9 +87337,9 @@ var visitEachChildTable = { [205 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBindingElement( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, nodeVisitor(node.propertyName, visitor, isPropertyName), - nodeVisitor(node.name, visitor, isBindingName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -86488,37 +87359,37 @@ var visitEachChildTable = { [208 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ) : context.factory.updatePropertyAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ); }, [209 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isElementAccessChain(node) ? context.factory.updateElementAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ) : context.factory.updateElementAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ); }, [210 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return isCallChain(node) ? context.factory.updateCallChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ) : context.factory.updateCallExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -86526,7 +87397,7 @@ var visitEachChildTable = { [211 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNewExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -86534,29 +87405,29 @@ var visitEachChildTable = { [212 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTaggedTemplateExpression( node, - nodeVisitor(node.tag, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.template, visitor, isTemplateLiteral) + Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) ); }, [213 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAssertion( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [214 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [215 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionExpression( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -86571,82 +87442,82 @@ var visitEachChildTable = { nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken)) : node.equalsGreaterThanToken, visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, [217 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDeleteExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [218 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOfExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [219 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVoidExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [220 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAwaitExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [221 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePrefixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [222 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePostfixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [223 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBinaryExpression( node, - nodeVisitor(node.left, visitor, isExpression), - nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken), - nodeVisitor(node.right, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken)) : node.operatorToken, + Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) ); }, [224 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateConditionalExpression( node, - nodeVisitor(node.condition, visitor, isExpression), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.whenTrue, visitor, isExpression), - nodeVisitor(node.colonToken, tokenVisitor, isColonToken), - nodeVisitor(node.whenFalse, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken)) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.whenTrue, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.colonToken, tokenVisitor, isColonToken)) : node.colonToken, + Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) ); }, [225 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateExpression( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateSpan) ); }, [226 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateYieldExpression( node, - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.expression, visitor, isExpression) ); }, [227 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadElement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [228 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -86662,45 +87533,45 @@ var visitEachChildTable = { [230 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionWithTypeArguments( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, [231 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAsExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [235 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSatisfiesExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [232 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return isOptionalChain(node) ? context.factory.updateNonNullChain( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ) : context.factory.updateNonNullExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [233 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateMetaProperty( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Misc [236 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateSpan( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Element @@ -86713,21 +87584,21 @@ var visitEachChildTable = { [240 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVariableStatement( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.declarationList, visitor, isVariableDeclarationList) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) ); }, [241 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [242 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIfStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock)), nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) ); }, @@ -86735,13 +87606,13 @@ var visitEachChildTable = { return context.factory.updateDoStatement( node, visitIterationBody(node.statement, visitor, context, nodeVisitor), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [244 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWhileStatement( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -86757,17 +87628,17 @@ var visitEachChildTable = { [246 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForInStatement( node, - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, [247 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateForOfStatement( node, - nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword), - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -86792,34 +87663,34 @@ var visitEachChildTable = { [251 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWithStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [252 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSwitchStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.caseBlock, visitor, isCaseBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) ); }, [253 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLabeledStatement( node, - nodeVisitor(node.label, visitor, isIdentifier), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [254 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateThrowStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [255 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTryStatement( node, - nodeVisitor(node.tryBlock, visitor, isBlock), + Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), nodeVisitor(node.catchClause, visitor, isCatchClause), nodeVisitor(node.finallyBlock, visitor, isBlock) ); @@ -86827,8 +87698,8 @@ var visitEachChildTable = { [257 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateVariableDeclaration( node, - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken) : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -86843,7 +87714,7 @@ var visitEachChildTable = { return context.factory.updateFunctionDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -86864,8 +87735,8 @@ var visitEachChildTable = { [261 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInterfaceDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, isHeritageClause), nodesVisitor(node.members, visitor, isTypeElement) @@ -86874,25 +87745,25 @@ var visitEachChildTable = { [262 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAliasDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [263 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.members, visitor, isEnumMember) ); }, [264 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateModuleDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isModuleName), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleName)), nodeVisitor(node.body, visitor, isModuleBody) ); }, @@ -86911,24 +87782,24 @@ var visitEachChildTable = { [267 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExportDeclaration( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [268 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportEqualsDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.moduleReference, visitor, isModuleReference) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) ); }, [269 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), nodeVisitor(node.importClause, visitor, isImportClause), - nodeVisitor(node.moduleSpecifier, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)), nodeVisitor(node.assertClause, visitor, isAssertClause) ); }, @@ -86942,8 +87813,8 @@ var visitEachChildTable = { [297 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAssertEntry( node, - nodeVisitor(node.name, visitor, isAssertionKey), - nodeVisitor(node.value, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)), + Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) ); }, [270 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -86957,13 +87828,13 @@ var visitEachChildTable = { [271 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceImport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [277 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [272 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -86977,20 +87848,20 @@ var visitEachChildTable = { node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [274 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportAssignment( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.expression, visitor, isExpression) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [275 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, isExpression), @@ -87008,59 +87879,59 @@ var visitEachChildTable = { node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Module references [280 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExternalModuleReference( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // JSX [281 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxElement( node, - nodeVisitor(node.openingElement, visitor, isJsxOpeningElement), + Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingElement, visitor, isJsxClosingElement) + Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) ); }, [282 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSelfClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [283 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxOpeningElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [284 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression) + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) ); }, [285 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxFragment( node, - nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment), + Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment) + Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) ); }, [288 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) ); }, @@ -87073,20 +87944,20 @@ var visitEachChildTable = { [290 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSpreadAttribute( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Clauses [292 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCaseClause( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.statements, visitor, isStatement) ); }, @@ -87106,35 +87977,35 @@ var visitEachChildTable = { return context.factory.updateCatchClause( node, nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), - nodeVisitor(node.block, visitor, isBlock) + Debug.checkDefined(nodeVisitor(node.block, visitor, isBlock)) ); }, // Property assignments [299 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePropertyAssignment( node, - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.initializer, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) ); }, [300 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateShorthandPropertyAssignment( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) ); }, [301 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadAssignment( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Enum [302 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumMember( node, - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -87146,13 +88017,13 @@ var visitEachChildTable = { ); }, // Transformation nodes - [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePartiallyEmittedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCommaListExpression( node, nodesVisitor(node.elements, visitor, isExpression) @@ -88032,10 +88903,13 @@ function getAllDecoratorsOfClass(node) { parameters }; } -function getAllDecoratorsOfClassElement(member, parent2) { +function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { switch (member.kind) { case 174 /* GetAccessor */: case 175 /* SetAccessor */: + if (!useLegacyDecorators) { + return getAllDecoratorsOfMethod(member); + } return getAllDecoratorsOfAccessors(member, parent2); case 171 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); @@ -88084,6 +88958,34 @@ function getAllDecoratorsOfProperty(property) { } return { decorators }; } +function walkUpLexicalEnvironments(env, cb) { + while (env) { + const result = cb(env); + if (result !== void 0) + return result; + env = env.previous; + } +} +function newPrivateEnvironment(data) { + return { data }; +} +function getPrivateIdentifier(privateEnv, name) { + var _a2, _b; + return isGeneratedPrivateIdentifier(name) ? (_a2 = privateEnv == null ? void 0 : privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(getNodeForGeneratedName(name)) : (_b = privateEnv == null ? void 0 : privateEnv.identifiers) == null ? void 0 : _b.get(name.escapedText); +} +function setPrivateIdentifier(privateEnv, name, entry) { + var _a2, _b; + if (isGeneratedPrivateIdentifier(name)) { + (_a2 = privateEnv.generatedIdentifiers) != null ? _a2 : privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map(); + privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), entry); + } else { + (_b = privateEnv.identifiers) != null ? _b : privateEnv.identifiers = /* @__PURE__ */ new Map(); + privateEnv.identifiers.set(name.escapedText, entry); + } +} +function accessPrivateIdentifier(env, name) { + return walkUpLexicalEnvironments(env, (env2) => getPrivateIdentifier(env2.privateEnv, name)); +} // src/compiler/transformers/destructuring.ts var FlattenLevel = /* @__PURE__ */ ((FlattenLevel2) => { @@ -88101,7 +89003,7 @@ function flattenDestructuringAssignment(node, visitor, context, level, needsValu location = node = value; value = node.right; } else { - return visitNode(value, visitor, isExpression); + return Debug.checkDefined(visitNode(value, visitor, isExpression)); } } } @@ -88120,6 +89022,7 @@ function flattenDestructuringAssignment(node, visitor, context, level, needsValu }; if (value) { value = visitNode(value, visitor, isExpression); + Debug.assert(value); if (isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node)) { value = ensureIdentifier( flattenContext, @@ -88161,7 +89064,7 @@ function flattenDestructuringAssignment(node, visitor, context, level, needsValu function emitBindingOrAssignment(target, value2, location2, original) { Debug.assertNode(target, createAssignmentCallback ? isIdentifier : isExpression); const expression = createAssignmentCallback ? createAssignmentCallback(target, value2, location2) : setTextRange( - context.factory.createAssignment(visitNode(target, visitor, isExpression), value2), + context.factory.createAssignment(Debug.checkDefined(visitNode(target, visitor, isExpression)), value2), location2 ); expression.original = original; @@ -88218,7 +89121,7 @@ function flattenDestructuringBinding(node, visitor, context, level, rval, hoistT if (initializer && (isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node))) { initializer = ensureIdentifier( flattenContext, - visitNode(initializer, flattenContext.visitor), + Debug.checkDefined(visitNode(initializer, flattenContext.visitor, isExpression)), /*reuseIdentifierExpressions*/ false, initializer @@ -88339,7 +89242,7 @@ function flattenObjectBindingOrAssignmentPattern(flattenContext, parent2, patter if (!getRestIndicatorOfBindingOrAssignmentElement(element)) { const propertyName = getPropertyNameOfBindingOrAssignmentElement(element); if (flattenContext.level >= 1 /* ObjectRest */ && !(element.transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !(getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !isComputedPropertyName(propertyName)) { - bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor)); + bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor, isBindingOrAssignmentElement)); } else { if (bindingElements) { flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern); @@ -88477,7 +89380,7 @@ function createDestructuringPropertyAccess(flattenContext, value, propertyName) if (isComputedPropertyName(propertyName)) { const argumentExpression = ensureIdentifier( flattenContext, - visitNode(propertyName.expression, flattenContext.visitor), + Debug.checkDefined(visitNode(propertyName.expression, flattenContext.visitor, isExpression)), /*reuseIdentifierExpressions*/ false, /*location*/ @@ -88520,6 +89423,7 @@ function makeArrayBindingPattern(factory2, elements) { return factory2.createArrayBindingPattern(elements); } function makeArrayAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isArrayBindingOrAssignmentElement); return factory2.createArrayLiteralExpression(map(elements, factory2.converters.convertToArrayAssignmentElement)); } function makeObjectBindingPattern(factory2, elements) { @@ -88527,6 +89431,7 @@ function makeObjectBindingPattern(factory2, elements) { return factory2.createObjectBindingPattern(elements); } function makeObjectAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isObjectBindingOrAssignmentElement); return factory2.createObjectLiteralExpression(map(elements, factory2.converters.convertToObjectAssignmentElement)); } function makeBindingElement(factory2, name) { @@ -88550,6 +89455,7 @@ var ProcessLevel = /* @__PURE__ */ ((ProcessLevel2) => { })(ProcessLevel || {}); function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) { const tag = visitNode(node.tag, visitor, isExpression); + Debug.assert(tag); const templateArguments = [void 0]; const cookedStrings = []; const rawStrings = []; @@ -88566,7 +89472,7 @@ function processTaggedTemplateExpression(context, node, visitor, currentSourceFi for (const templateSpan of template.templateSpans) { cookedStrings.push(createTemplateCooked(templateSpan.literal)); rawStrings.push(getRawLiteral(templateSpan.literal, currentSourceFile)); - templateArguments.push(visitNode(templateSpan.expression, visitor, isExpression)); + templateArguments.push(Debug.checkDefined(visitNode(templateSpan.expression, visitor, isExpression))); } } const helperCall = context.getEmitHelperFactory().createTemplateObjectHelper( @@ -88626,6 +89532,7 @@ function transformTypeScript(context) { const compilerOptions = context.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const typeSerializer = compilerOptions.emitDecoratorMetadata ? createRuntimeTypeSerializer(context) : void 0; const previousOnEmitNode = context.onEmitNode; const previousOnSubstituteNode = context.onSubstituteNode; @@ -88800,6 +89707,12 @@ function transformTypeScript(context) { return Debug.failBadSyntaxKind(node); } } + function decoratorElidingVisitor(node) { + return isDecorator(node) ? void 0 : visitor(node); + } + function modifierElidingVisitor(node) { + return isModifier(node) ? void 0 : visitor(node); + } function modifierVisitor(node) { if (isDecorator(node)) return void 0; @@ -88939,19 +89852,25 @@ function transformTypeScript(context) { function visitObjectLiteralExpression(node) { return factory2.updateObjectLiteralExpression( node, - visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElement) + visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElementLike) ); } - function getClassFacts(node, staticProperties) { + function getClassFacts(node) { let facts = 0 /* None */; - if (some(staticProperties)) + if (some(getProperties( + node, + /*requireInitialized*/ + true, + /*isStatic*/ + true + ))) facts |= 1 /* HasStaticInitializedProperties */; const extendsClauseElement = getEffectiveBaseTypeNode(node); if (extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */) facts |= 64 /* IsDerivedClass */; - if (classOrConstructorParameterIsDecorated(node)) - facts |= 2 /* HasConstructorDecorators */; - if (childIsDecorated(node)) + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) + facts |= 2 /* HasClassOrConstructorParameterDecorators */; + if (childIsDecorated(legacyDecorators, node)) facts |= 4 /* HasMemberDecorators */; if (isExportOfNamespace(node)) facts |= 8 /* IsExportOfNamespace */; @@ -88959,8 +89878,6 @@ function transformTypeScript(context) { facts |= 32 /* IsDefaultExternalExport */; else if (isNamedExternalModuleExport(node)) facts |= 16 /* IsNamedExternalExport */; - if (languageVersion <= 1 /* ES5 */ && facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */) - facts |= 128 /* UseImmediatelyInvokedFunctionExpression */; return facts; } function hasTypeScriptClassSyntax(node) { @@ -88970,7 +89887,10 @@ function transformTypeScript(context) { return hasDecorators(node) || some(node.typeParameters) || some(node.heritageClauses, hasTypeScriptClassSyntax) || some(node.members, hasTypeScriptClassSyntax); } function visitClassDeclaration(node) { - if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !(currentNamespace && hasSyntacticModifier(node, 1 /* Export */))) { + var _a2; + const facts = getClassFacts(node); + const promoteToIIFE = languageVersion <= 1 /* ES5 */ && !!(facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */); + if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !classOrConstructorParameterIsDecorated(legacyDecorators, node) && !isExportOfNamespace(node)) { return factory2.updateClassDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), @@ -88981,24 +89901,19 @@ function transformTypeScript(context) { visitNodes2(node.members, getClassElementVisitor(node), isClassElement) ); } - const staticProperties = getProperties( - node, - /*requireInitializer*/ - true, - /*isStatic*/ - true - ); - const facts = getClassFacts(node, staticProperties); - if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) { + if (promoteToIIFE) { context.startLexicalEnvironment(); } - const name = node.name || (facts & 5 /* NeedsName */ ? factory2.getGeneratedNameForNode(node) : void 0); - const allDecorators = getAllDecoratorsOfClass(node); - const decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); - const modifiers = !(facts & 128 /* UseImmediatelyInvokedFunctionExpression */) ? visitNodes2(node.modifiers, modifierVisitor, isModifier) : elideNodes(factory2, node.modifiers); - const classStatement = factory2.updateClassDeclaration( + const moveModifiers = promoteToIIFE || facts & 8 /* IsExportOfNamespace */ || facts & 2 /* HasClassOrConstructorParameterDecorators */ && legacyDecorators || facts & 1 /* HasStaticInitializedProperties */; + let modifiers = moveModifiers ? visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, visitor, isModifierLike); + if (facts & 2 /* HasClassOrConstructorParameterDecorators */) { + modifiers = injectClassTypeMetadata(modifiers, node); + } + const needsName = moveModifiers && !node.name || facts & 4 /* HasMemberDecorators */ || facts & 1 /* HasStaticInitializedProperties */; + const name = needsName ? (_a2 = node.name) != null ? _a2 : factory2.getGeneratedNameForNode(node) : node.name; + const classDeclaration = factory2.updateClassDeclaration( node, - concatenate(decorators, modifiers), + modifiers, name, /*typeParameters*/ void 0, @@ -89009,24 +89924,25 @@ function transformTypeScript(context) { if (facts & 1 /* HasStaticInitializedProperties */) { emitFlags |= 64 /* NoTrailingSourceMap */; } - setEmitFlags(classStatement, emitFlags); - let statements = [classStatement]; - if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) { + setEmitFlags(classDeclaration, emitFlags); + let statement; + if (promoteToIIFE) { + const statements = [classDeclaration]; const closingBraceLocation = createTokenRange(skipTrivia(currentSourceFile.text, node.members.end), 19 /* CloseBraceToken */); const localName = factory2.getInternalName(node); const outer = factory2.createPartiallyEmittedExpression(localName); setTextRangeEnd(outer, closingBraceLocation.end); setEmitFlags(outer, 3072 /* NoComments */); - const statement = factory2.createReturnStatement(outer); - setTextRangePos(statement, closingBraceLocation.pos); - setEmitFlags(statement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); - statements.push(statement); + const returnStatement = factory2.createReturnStatement(outer); + setTextRangePos(returnStatement, closingBraceLocation.pos); + setEmitFlags(returnStatement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); + statements.push(returnStatement); insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment()); const iife = factory2.createImmediatelyInvokedArrowFunction(statements); - setEmitFlags(iife, 67108864 /* TypeScriptClassWrapper */); + setInternalEmitFlags(iife, 1 /* TypeScriptClassWrapper */); + const modifiers2 = facts & 16 /* IsNamedExternalExport */ ? factory2.createModifiersFromModifierFlags(1 /* Export */) : void 0; const varStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, + modifiers2, factory2.createVariableDeclarationList([ factory2.createVariableDeclaration( factory2.getLocalName( @@ -89042,114 +89958,133 @@ function transformTypeScript(context) { void 0, iife ) - ]) + ], 1 /* Let */) ); setOriginalNode(varStatement, node); setCommentRange(varStatement, node); setSourceMapRange(varStatement, moveRangePastDecorators(node)); startOnNewLine(varStatement); - statements = [varStatement]; + statement = varStatement; + } else { + statement = classDeclaration; } - if (facts & 8 /* IsExportOfNamespace */) { - addExportMemberAssignment(statements, node); - } else if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) { + if (moveModifiers) { + if (facts & 8 /* IsExportOfNamespace */) { + return demarcateMultiStatementExport( + statement, + createExportMemberAssignmentStatement(node) + ); + } if (facts & 32 /* IsDefaultExternalExport */) { - statements.push(factory2.createExportDefault(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ))); - } else if (facts & 16 /* IsNamedExternalExport */) { - statements.push(factory2.createExternalModuleExport(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ))); + return demarcateMultiStatementExport( + statement, + factory2.createExportDefault(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ); + } + if (facts & 16 /* IsNamedExternalExport */ && !promoteToIIFE) { + return demarcateMultiStatementExport( + statement, + factory2.createExternalModuleExport(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ); } } - if (statements.length > 1) { - statements.push(factory2.createEndOfDeclarationMarker(node)); - setEmitFlags(classStatement, getEmitFlags(classStatement) | 8388608 /* HasEndOfDeclarationMarker */); - } - return singleOrMany(statements); + return statement; + } + function demarcateMultiStatementExport(declarationStatement, exportStatement) { + addEmitFlags(declarationStatement, 8388608 /* HasEndOfDeclarationMarker */); + return [ + declarationStatement, + exportStatement, + factory2.createEndOfDeclarationMarker(declarationStatement) + ]; } function visitClassExpression(node) { - const allDecorators = getAllDecoratorsOfClass(node); - const decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); + let modifiers = visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike); + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) { + modifiers = injectClassTypeMetadata(modifiers, node); + } return factory2.updateClassExpression( node, - decorators, + modifiers, node.name, /*typeParameters*/ void 0, visitNodes2(node.heritageClauses, visitor, isHeritageClause), - isClassLikeDeclarationWithTypeScriptSyntax(node) ? transformClassMembers(node) : visitNodes2(node.members, getClassElementVisitor(node), isClassElement) + transformClassMembers(node) ); } function transformClassMembers(node) { - const members = []; + const members = visitNodes2(node.members, getClassElementVisitor(node), isClassElement); + let newMembers; const constructor = getFirstConstructorWithBody(node); const parametersWithPropertyAssignments = constructor && filter(constructor.parameters, (p) => isParameterPropertyDeclaration(p, constructor)); if (parametersWithPropertyAssignments) { for (const parameter of parametersWithPropertyAssignments) { - if (isIdentifier(parameter.name)) { - members.push(setOriginalNode(factory2.createPropertyDeclaration( - /*modifiers*/ - void 0, - parameter.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ), parameter)); - } + const parameterProperty = factory2.createPropertyDeclaration( + /*modifiers*/ + void 0, + parameter.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + setOriginalNode(parameterProperty, parameter); + newMembers = append(newMembers, parameterProperty); } } - addRange(members, visitNodes2(node.members, getClassElementVisitor(node), isClassElement)); - return setTextRange( - factory2.createNodeArray(members), - /*location*/ - node.members - ); + if (newMembers) { + newMembers = addRange(newMembers, members); + return setTextRange( + factory2.createNodeArray(newMembers), + /*location*/ + node.members + ); + } + return members; } - function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { - var _a2, _b, _c, _d; - if (!allDecorators) { - return void 0; + function injectClassTypeMetadata(modifiers, node) { + const metadata = getTypeMetadata(node, node); + if (some(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, takeWhile(modifiers, isExportOrDefaultModifier)); + addRange(modifiersArray, filter(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter(skipWhile(modifiers, isExportOrDefaultModifier), isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); } - const decorators = visitArray(allDecorators.decorators, visitor, isDecorator); - const parameterDecorators = flatMap(allDecorators.parameters, transformDecoratorsOfParameter); - const metadataDecorators = some(decorators) || some(parameterDecorators) ? getTypeMetadata(node, container) : void 0; - const result = factory2.createNodeArray(concatenate(concatenate(decorators, parameterDecorators), metadataDecorators)); - const pos = (_b = (_a2 = firstOrUndefined(allDecorators.decorators)) == null ? void 0 : _a2.pos) != null ? _b : -1; - const end = (_d = (_c = lastOrUndefined(allDecorators.decorators)) == null ? void 0 : _c.end) != null ? _d : -1; - setTextRangePosEnd(result, pos, end); - return result; + return modifiers; } - function transformDecoratorsOfParameter(parameterDecorators, parameterOffset) { - if (parameterDecorators) { - const decorators = []; - for (const parameterDecorator of parameterDecorators) { - const expression = visitNode(parameterDecorator.expression, visitor, isExpression); - const helper = emitHelpers().createParamHelper(expression, parameterOffset); - setTextRange(helper, parameterDecorator.expression); - setEmitFlags(helper, 3072 /* NoComments */); - const decorator = factory2.createDecorator(helper); - setSourceMapRange(decorator, parameterDecorator.expression); - setCommentRange(decorator, parameterDecorator.expression); - setEmitFlags(decorator, 3072 /* NoComments */); - decorators.push(decorator); + function injectClassElementTypeMetadata(modifiers, node, container) { + if (isClassLike(container) && classElementOrClassElementParameterIsDecorated(legacyDecorators, node, container)) { + const metadata = getTypeMetadata(node, container); + if (some(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, filter(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter(modifiers, isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); } - return decorators; } + return modifiers; } function getTypeMetadata(node, container) { + if (!legacyDecorators) + return void 0; return USE_NEW_TYPE_METADATA_FORMAT ? getNewTypeMetadata(node, container) : getOldTypeMetadata(node, container); } function getOldTypeMetadata(node, container) { @@ -89258,8 +90193,9 @@ function transformTypeScript(context) { } function visitPropertyNameOfClassElement(member) { const name = member.name; - if (isComputedPropertyName(name) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member))) { + if (isComputedPropertyName(name) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member) && legacyDecorators)) { const expression = visitNode(name.expression, visitor, isExpression); + Debug.assert(expression); const innerExpression = skipPartiallyEmittedExpressions(expression); if (!isSimpleInlineableExpression(innerExpression)) { const generatedName = factory2.getGeneratedNameForNode(name); @@ -89267,7 +90203,7 @@ function transformTypeScript(context) { return factory2.updateComputedPropertyName(name, factory2.createAssignment(generatedName, expression)); } } - return visitNode(name, visitor, isPropertyName); + return Debug.checkDefined(visitNode(name, visitor, isPropertyName)); } function visitHeritageClause(node) { if (node.token === 117 /* ImplementsKeyword */) { @@ -89278,7 +90214,7 @@ function transformTypeScript(context) { function visitExpressionWithTypeArguments(node) { return factory2.updateExpressionWithTypeArguments( node, - visitNode(node.expression, visitor, isLeftHandSideExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression)), /*typeArguments*/ void 0 ); @@ -89288,16 +90224,16 @@ function transformTypeScript(context) { } function visitPropertyDeclaration(node, parent2) { const isAmbient = node.flags & 16777216 /* Ambient */ || hasSyntacticModifier(node, 256 /* Abstract */); - if (isAmbient && !hasDecorators(node)) { + if (isAmbient && !(legacyDecorators && hasDecorators(node))) { return void 0; } - const allDecorators = getAllDecoratorsOfClassElement(node, parent2); - const decorators = transformAllDecoratorsOfDeclaration(node, parent2, allDecorators); + let modifiers = isClassLike(parent2) ? !isAmbient ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); if (isAmbient) { return factory2.updatePropertyDeclaration( node, - concatenate(decorators, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), - visitNode(node.name, visitor, isPropertyName), + concatenate(modifiers, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, /*type*/ @@ -89308,13 +90244,13 @@ function transformTypeScript(context) { } return factory2.updatePropertyDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), /*questionOrExclamationToken*/ void 0, /*type*/ void 0, - visitNode(node.initializer, visitor) + visitNode(node.initializer, visitor, isExpression) ); } function visitConstructor(node) { @@ -89415,11 +90351,11 @@ function transformTypeScript(context) { if (!shouldEmitFunctionLikeDeclaration(node)) { return void 0; } - const allDecorators = isClassLike(parent2) ? getAllDecoratorsOfClassElement(node, parent2) : void 0; - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, allDecorators) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateMethodDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, node.asteriskToken, visitPropertyNameOfClassElement(node), /*questionToken*/ @@ -89442,10 +90378,11 @@ function transformTypeScript(context) { if (!shouldEmitAccessorDeclaration(node)) { return void 0; } - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, getAllDecoratorsOfClassElement(node, parent2)) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateGetAccessorDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), visitParameterList(node.parameters, visitor, context), /*type*/ @@ -89460,10 +90397,11 @@ function transformTypeScript(context) { if (!shouldEmitAccessorDeclaration(node)) { return void 0; } - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, getAllDecoratorsOfClassElement(node, parent2)) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateSetAccessorDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context) || factory2.createBlock([]) @@ -89530,10 +90468,9 @@ function transformTypeScript(context) { } const updated = factory2.updateParameterDeclaration( node, - elideNodes(factory2, node.modifiers), - // preserve positions, if available + visitNodes2(node.modifiers, (node2) => isDecorator(node2) ? visitor(node2) : void 0, isModifierLike), node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*questionToken*/ void 0, /*type*/ @@ -89582,7 +90519,7 @@ function transformTypeScript(context) { return setTextRange( factory2.createAssignment( getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), - visitNode(node.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) ), /*location*/ node @@ -89592,7 +90529,7 @@ function transformTypeScript(context) { function visitVariableDeclaration(node) { const updated = factory2.updateVariableDeclaration( node, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*exclamationToken*/ void 0, /*type*/ @@ -89608,26 +90545,30 @@ function transformTypeScript(context) { const innerExpression = skipOuterExpressions(node.expression, ~6 /* Assertions */); if (isAssertionExpression(innerExpression)) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } return visitEachChild(node, visitor, context); } function visitAssertionExpression(node) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitNonNullExpression(node) { const expression = visitNode(node.expression, visitor, isLeftHandSideExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitSatisfiesExpression(node) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitCallExpression(node) { return factory2.updateCallExpression( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -89636,7 +90577,7 @@ function transformTypeScript(context) { function visitNewExpression(node) { return factory2.updateNewExpression( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -89645,28 +90586,28 @@ function transformTypeScript(context) { function visitTaggedTemplateExpression(node) { return factory2.updateTaggedTemplateExpression( node, - visitNode(node.tag, visitor, isExpression), + Debug.checkDefined(visitNode(node.tag, visitor, isExpression)), /*typeArguments*/ void 0, - visitNode(node.template, visitor, isExpression) + Debug.checkDefined(visitNode(node.template, visitor, isTemplateLiteral)) ); } function visitJsxSelfClosingElement(node) { return factory2.updateJsxSelfClosingElement( node, - visitNode(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), /*typeArguments*/ void 0, - visitNode(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) ); } function visitJsxJsxOpeningElement(node) { return factory2.updateJsxOpeningElement( node, - visitNode(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), /*typeArguments*/ void 0, - visitNode(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) ); } function shouldEmitEnumDeclaration(node) { @@ -89812,7 +90753,7 @@ function transformTypeScript(context) { } else { enableSubstitutionForNonQualifiedEnumMembers(); if (member.initializer) { - return visitNode(member.initializer, visitor, isExpression); + return Debug.checkDefined(visitNode(member.initializer, visitor, isExpression)); } else { return factory2.createVoidZero(); } @@ -90054,7 +90995,7 @@ function transformTypeScript(context) { if (node.kind === 271 /* NamespaceImport */) { return shouldEmitAliasDeclaration(node) ? node : void 0; } else { - const allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); + const allowEmpty = compilerOptions.verbatimModuleSyntax || compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); const elements = visitNodes2(node.elements, visitImportSpecifier, isImportSpecifier); return allowEmpty || some(elements) ? factory2.updateNamedImports(node, elements) : void 0; } @@ -90063,7 +91004,7 @@ function transformTypeScript(context) { return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : void 0; } function visitExportAssignment(node) { - return resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; + return compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; } function visitExportDeclaration(node) { if (node.isTypeOnly) { @@ -90072,7 +91013,7 @@ function transformTypeScript(context) { if (!node.exportClause || isNamespaceExport(node.exportClause)) { return node; } - const allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); + const allowEmpty = compilerOptions.verbatimModuleSyntax || !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); const exportClause = visitNode( node.exportClause, (bindings) => visitNamedExportBindings(bindings, allowEmpty), @@ -90093,13 +91034,13 @@ function transformTypeScript(context) { return allowEmpty || some(elements) ? factory2.updateNamedExports(node, elements) : void 0; } function visitNamespaceExports(node) { - return factory2.updateNamespaceExport(node, visitNode(node.name, visitor, isIdentifier)); + return factory2.updateNamespaceExport(node, Debug.checkDefined(visitNode(node.name, visitor, isIdentifier))); } function visitNamedExportBindings(node, allowEmpty) { return isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty); } function visitExportSpecifier(node) { - return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : void 0; + return !node.isTypeOnly && (compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node)) ? node : void 0; } function shouldEmitImportEqualsDeclaration(node) { return shouldEmitAliasDeclaration(node) || !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node); @@ -90159,7 +91100,7 @@ function transformTypeScript(context) { ); } else { return setOriginalNode( - createNamespaceExport2( + createNamespaceExport( node.name, moduleReference, node @@ -90180,7 +91121,7 @@ function transformTypeScript(context) { function isDefaultExternalModuleExport(node) { return isExternalModuleExport(node) && hasSyntacticModifier(node, 1024 /* Default */); } - function addExportMemberAssignment(statements, node) { + function createExportMemberAssignmentStatement(node) { const expression = factory2.createAssignment( factory2.getExternalModuleOrNamespaceExportName( currentNamespaceContainerName, @@ -90195,9 +91136,12 @@ function transformTypeScript(context) { setSourceMapRange(expression, createRange(node.name ? node.name.pos : node.pos, node.end)); const statement = factory2.createExpressionStatement(expression); setSourceMapRange(statement, createRange(-1, node.end)); - statements.push(statement); + return statement; + } + function addExportMemberAssignment(statements, node) { + statements.push(createExportMemberAssignmentStatement(node)); } - function createNamespaceExport2(exportName, exportValue, location) { + function createNamespaceExport(exportName, exportValue, location) { return setTextRange( factory2.createExpressionStatement( factory2.createAssignment( @@ -90358,20 +91302,15 @@ function transformTypeScript(context) { return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; } function shouldEmitAliasDeclaration(node) { - return isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); + return compilerOptions.verbatimModuleSyntax || isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); } } // src/compiler/transformers/classFields.ts -var PrivateIdentifierKind2 = /* @__PURE__ */ ((PrivateIdentifierKind3) => { - PrivateIdentifierKind3["Field"] = "f"; - PrivateIdentifierKind3["Method"] = "m"; - PrivateIdentifierKind3["Accessor"] = "a"; - return PrivateIdentifierKind3; -})(PrivateIdentifierKind2 || {}); function transformClassFields(context) { const { factory: factory2, + getEmitHelperFactory: emitHelpers, hoistVariableDeclaration, endLexicalEnvironment, startLexicalEnvironment, @@ -90382,6 +91321,7 @@ function transformClassFields(context) { const compilerOptions = context.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const shouldTransformInitializersUsingSet = !useDefineForClassFields; const shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9 /* ES2022 */; const shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine; @@ -90394,42 +91334,69 @@ function transformClassFields(context) { context.onSubstituteNode = onSubstituteNode; const previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; + let shouldTransformPrivateStaticElementsInFile = false; let enabledSubstitutions; let classAliases; let pendingExpressions; let pendingStatements; - const classLexicalEnvironmentStack = []; - const classLexicalEnvironmentMap = /* @__PURE__ */ new Map(); - let currentClassLexicalEnvironment; + let lexicalEnvironment; + const lexicalEnvironmentMap = /* @__PURE__ */ new Map(); let currentClassContainer; - let currentComputedPropertyNameClassLexicalEnvironment; let currentStaticPropertyDeclarationOrStaticBlock; + let shouldSubstituteThisWithClassThis = false; + let previousShouldSubstituteThisWithClassThis = false; return chainBundle(context, transformSourceFile); function transformSourceFile(node) { - if (node.isDeclarationFile || !shouldTransformAnything) { + if (node.isDeclarationFile) { + return node; + } + lexicalEnvironment = void 0; + shouldTransformPrivateStaticElementsInFile = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); + if (!shouldTransformAnything && !shouldTransformPrivateStaticElementsInFile) { return node; } const visited = visitEachChild(node, visitor, context); addEmitHelpers(visited, context.readEmitHelpers()); return visited; } + function modifierVisitor(node) { + switch (node.kind) { + case 127 /* AccessorKeyword */: + return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + default: + return tryCast(node, isModifier); + } + } function visitor(node) { if (!(node.transformFlags & 16777216 /* ContainsClassFields */) && !(node.transformFlags & 134234112 /* ContainsLexicalThisOrSuper */)) { return node; } switch (node.kind) { case 127 /* AccessorKeyword */: - return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + return Debug.fail("Use `modifierVisitor` instead."); case 260 /* ClassDeclaration */: return visitClassDeclaration(node); case 228 /* ClassExpression */: - return visitClassExpression(node); + return visitClassExpression( + node, + /*referencedName*/ + void 0 + ); case 172 /* ClassStaticBlockDeclaration */: - return visitClassStaticBlockDeclaration(node); case 169 /* PropertyDeclaration */: - return visitPropertyDeclaration(node); + return Debug.fail("Use `classElementVisitor` instead."); + case 299 /* PropertyAssignment */: + return visitPropertyAssignment(node); case 240 /* VariableStatement */: return visitVariableStatement(node); + case 257 /* VariableDeclaration */: + return visitVariableDeclaration(node); + case 166 /* Parameter */: + return visitParameterDeclaration(node); + case 205 /* BindingElement */: + return visitBindingElement(node); + case 274 /* ExportAssignment */: + return visitExportAssignment(node); case 80 /* PrivateIdentifier */: return visitPrivateIdentifier(node); case 208 /* PropertyAccessExpression */: @@ -90440,15 +91407,23 @@ function transformClassFields(context) { case 222 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ false ); case 223 /* BinaryExpression */: return visitBinaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ false ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); case 210 /* CallExpression */: return visitCallExpression(node); case 241 /* ExpressionStatement */: @@ -90477,21 +91452,57 @@ function transformClassFields(context) { function fallbackVisitor(node) { return visitEachChild(node, visitor, context); } + function namedEvaluationVisitor(node, referencedName) { + switch (node.kind) { + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 228 /* ClassExpression */: + return visitClassExpression(node, referencedName); + default: + return visitor(node); + } + } function discardedValueVisitor(node) { switch (node.kind) { case 221 /* PrefixUnaryExpression */: case 222 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ true ); case 223 /* BinaryExpression */: return visitBinaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ + true + ); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ true ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + true, + /*referencedName*/ + void 0 + ); default: return visitor(node); } @@ -90535,10 +91546,20 @@ function transformClassFields(context) { visitPropertyDeclaration, node ); + case 172 /* ClassStaticBlockDeclaration */: + return visitClassStaticBlockDeclaration(node); case 164 /* ComputedPropertyName */: return visitComputedPropertyName(node); case 237 /* SemicolonClassElement */: return node; + default: + return isModifierLike(node) ? modifierVisitor(node) : visitor(node); + } + } + function propertyNameVisitor(node) { + switch (node.kind) { + case 164 /* ComputedPropertyName */: + return visitComputedPropertyName(node); default: return visitor(node); } @@ -90564,20 +91585,25 @@ function transformClassFields(context) { } return setOriginalNode(factory2.createIdentifier(""), node); } - function isPrivateIdentifierInExpression(node) { - return isPrivateIdentifier(node.left) && node.operatorToken.kind === 101 /* InKeyword */; - } function transformPrivateIdentifierInInExpression(node) { - const info = accessPrivateIdentifier(node.left); + const info = accessPrivateIdentifier2(node.left); if (info) { const receiver = visitNode(node.right, visitor, isExpression); return setOriginalNode( - context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), + emitHelpers().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node ); } return visitEachChild(node, visitor, context); } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updatePropertyAssignment(node, name, initializer); + } + return visitEachChild(node, visitor, context); + } function visitVariableStatement(node) { const savedPendingStatements = pendingStatements; pendingStatements = []; @@ -90586,17 +91612,90 @@ function transformClassFields(context) { pendingStatements = savedPendingStatements; return statement; } - function visitComputedPropertyName(node) { - let expression = visitNode(node.expression, visitor, isExpression); + function getAssignedNameOfIdentifier(name, initializer) { + const originalClass = getOriginalNode(initializer, isClassLike); + return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateVariableDeclaration( + node, + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitParameterDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const propertyName = visitNode(node.propertyName, visitor, isPropertyName); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBindingElement( + node, + /*dotDotDotToken*/ + void 0, + propertyName, + name, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateExportAssignment(node, modifiers, expression); + } + return visitEachChild(node, visitor, context); + } + function injectPendingExpressions(expression) { if (some(pendingExpressions)) { if (isParenthesizedExpression(expression)) { - expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions([...pendingExpressions, expression.expression])); + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); } else { - expression = factory2.inlineExpressions([...pendingExpressions, expression]); + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); } pendingExpressions = void 0; } - return factory2.updateComputedPropertyName(node, expression); + return expression; + } + function visitComputedPropertyName(node) { + const expression = visitNode(node.expression, visitor, isExpression); + return factory2.updateComputedPropertyName(node, injectPendingExpressions(expression)); } function visitConstructorDeclaration(node) { if (currentClassContainer) { @@ -90604,12 +91703,19 @@ function transformClassFields(context) { } return fallbackVisitor(node); } + function shouldTransformClassElementToWeakMap(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) + return true; + if (hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) + return true; + return false; + } function visitMethodOrAccessorDeclaration(node) { Debug.assert(!hasDecorators(node)); - if (!shouldTransformPrivateElementsOrClassStaticBlocks || !isPrivateIdentifier(node.name)) { + if (!isPrivateIdentifierClassElementDeclaration(node) || !shouldTransformClassElementToWeakMap(node)) { return visitEachChild(node, classElementVisitor, context); } - const info = accessPrivateIdentifier(node.name); + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); if (!info.isValid) { return node; @@ -90644,7 +91750,7 @@ function transformClassFields(context) { } function getHoistedFunctionName(node) { Debug.assert(isPrivateIdentifier(node.name)); - const info = accessPrivateIdentifier(node.name); + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); if (info.kind === "m" /* Method */) { return info.methodName; @@ -90659,42 +91765,61 @@ function transformClassFields(context) { } } function transformAutoAccessor(node) { - Debug.assertEachNode(node.modifiers, isModifier); const commentRange = getCommentRange(node); const sourceMapRange = getSourceMapRange(node); const name = node.name; let getterName = name; let setterName = name; if (isComputedPropertyName(name) && !isSimpleInlineableExpression(name.expression)) { - const temp = factory2.createTempVariable(hoistVariableDeclaration); - setSourceMapRange(temp, name.expression); - const expression = visitNode(name.expression, visitor, isExpression); - const assignment = factory2.createAssignment(temp, expression); - setSourceMapRange(assignment, name.expression); - getterName = factory2.updateComputedPropertyName(name, factory2.inlineExpressions([assignment, temp])); - setterName = factory2.updateComputedPropertyName(name, temp); + const cacheAssignment = findComputedPropertyNameCacheAssignment(name); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name, visitNode(name.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name.expression); + const expression = visitNode(name.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name.expression); + getterName = factory2.updateComputedPropertyName(name, assignment); + setterName = factory2.updateComputedPropertyName(name, temp); + } } - const backingField = createAccessorPropertyBackingField(factory2, node, node.modifiers, node.initializer); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiers, node.initializer); setOriginalNode(backingField, node); setEmitFlags(backingField, 3072 /* NoComments */); setSourceMapRange(backingField, sourceMapRange); - const getter = createAccessorPropertyGetRedirector(factory2, node, node.modifiers, getterName); + const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName); setOriginalNode(getter, node); setCommentRange(getter, commentRange); setSourceMapRange(getter, sourceMapRange); - const setter = createAccessorPropertySetRedirector(factory2, node, node.modifiers, setterName); + const setter = createAccessorPropertySetRedirector(factory2, node, modifiers, setterName); setOriginalNode(setter, node); setEmitFlags(setter, 3072 /* NoComments */); setSourceMapRange(setter, sourceMapRange); return visitArray([backingField, getter, setter], accessorFieldResultVisitor, isClassElement); } function transformPrivateFieldInitializer(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { - const info = accessPrivateIdentifier(node.name); + if (shouldTransformClassElementToWeakMap(node)) { + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); - return info.isValid ? void 0 : node; + if (!info.isValid) { + return node; + } + if (info.isStatic && !shouldTransformPrivateElementsOrClassStaticBlocks) { + const statement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); + if (statement) { + return factory2.createClassStaticBlockDeclaration(factory2.createBlock( + [statement], + /*multiLine*/ + true + )); + } + } + return void 0; } - if (shouldTransformInitializersUsingSet && !isStatic(node) && currentClassLexicalEnvironment && currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */) { + if (shouldTransformInitializersUsingSet && !isStatic(node) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */) { return factory2.updatePropertyDeclaration( node, visitNodes2(node.modifiers, visitor, isModifierLike), @@ -90707,6 +91832,19 @@ function transformClassFields(context) { void 0 ); } + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) + ); + } return visitEachChild(node, visitor, context); } function transformPublicFieldInitializer(node) { @@ -90714,10 +91852,12 @@ function transformClassFields(context) { const expr = getPropertyNameExpressionIfNeeded( node.name, /*shouldHoist*/ - !!node.initializer || useDefineForClassFields + !!node.initializer || useDefineForClassFields, + /*captureReferencedName*/ + isNamedEvaluation(node, isAnonymousClassNeedingAssignedName) ); if (expr) { - getPendingExpressions().push(expr); + getPendingExpressions().push(...flattenCommaList(expr)); } if (isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks) { const initializerStatement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); @@ -90735,17 +91875,26 @@ function transformClassFields(context) { } return void 0; } - return visitEachChild(node, classElementVisitor, context); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); } function transformFieldInitializer(node) { Debug.assert(!hasDecorators(node), "Decorators should already have been transformed and elided."); return isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node); } function shouldTransformAutoAccessorsInCurrentClass() { - return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!currentClassLexicalEnvironment && !!(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */); + return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !!(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */); } function visitPropertyDeclaration(node) { - if (shouldTransformAutoAccessorsInCurrentClass() && isAutoAccessorPropertyDeclaration(node)) { + if (isAutoAccessorPropertyDeclaration(node) && (shouldTransformAutoAccessorsInCurrentClass() || hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */)) { return transformAutoAccessor(node); } return transformFieldInitializer(node); @@ -90757,33 +91906,35 @@ function transformClassFields(context) { setCommentRange(receiver, moveRangePos(receiver, -1)); switch (info.kind) { case "a" /* Accessor */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, info.getterName ); case "m" /* Method */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, info.methodName ); case "f" /* Field */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, - info.variableName + info.isStatic ? info.variableName : void 0 ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); default: Debug.assertNever(info, "Unknown private element type"); } } function visitPropertyAccessExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(node.name)) { - const privateIdentifierInfo = accessPrivateIdentifier(node.name); + if (isPrivateIdentifier(node.name)) { + const privateIdentifierInfo = accessPrivateIdentifier2(node.name); if (privateIdentifierInfo) { return setTextRange( setOriginalNode( @@ -90794,8 +91945,8 @@ function transformClassFields(context) { ); } } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); } @@ -90813,8 +91964,8 @@ function transformClassFields(context) { return visitEachChild(node, visitor, context); } function visitElementAccessExpression(node) { - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); } @@ -90831,16 +91982,16 @@ function transformClassFields(context) { } return visitEachChild(node, visitor, context); } - function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) { + function visitPreOrPostfixUnaryExpression(node, discarded) { if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { const operand = skipParentheses(node.operand); - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(operand)) { + if (isPrivateIdentifierPropertyAccessExpression(operand)) { let info; - if (info = accessPrivateIdentifier(operand.name)) { + if (info = accessPrivateIdentifier2(operand.name)) { const receiver = visitNode(operand.expression, visitor, isExpression); const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver); let expression = createPrivateIdentifierAccess(info, readExpression); - const temp = isPrefixUnaryExpression(node) || valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = isPrefixUnaryExpression(node) || discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); expression = createPrivateIdentifierAssignment( info, @@ -90856,8 +92007,8 @@ function transformClassFields(context) { } return expression; } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { const expression = visitInvalidSuperProperty(operand); return isPrefixUnaryExpression(node) ? factory2.updatePrefixUnaryExpression(node, expression) : factory2.updatePostfixUnaryExpression(node, expression); @@ -90880,7 +92031,7 @@ function transformClassFields(context) { if (setterName && getterName) { let expression = factory2.createReflectGetCall(superClassReference, getterName, classConstructor); setTextRange(expression, operand); - const temp = valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); expression = factory2.createReflectSetCall(superClassReference, setterName, expression, classConstructor); setOriginalNode(expression, node); @@ -90921,12 +92072,13 @@ function transformClassFields(context) { return { readExpression, initializeExpression }; } function visitCallExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.expression)) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.expression) && accessPrivateIdentifier2(node.expression.name)) { const { thisArg, target } = factory2.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion); if (isCallChain(node)) { return factory2.updateCallChain( node, - factory2.createPropertyAccessChain(visitNode(target, visitor), node.questionDotToken, "call"), + factory2.createPropertyAccessChain(visitNode(target, visitor, isExpression), node.questionDotToken, "call"), /*questionDotToken*/ void 0, /*typeArguments*/ @@ -90936,16 +92088,16 @@ function transformClassFields(context) { } return factory2.updateCallExpression( node, - factory2.createPropertyAccessExpression(visitNode(target, visitor), "call"), + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "call"), /*typeArguments*/ void 0, [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { const invocation = factory2.createFunctionCallCall( visitNode(node.expression, visitor, isExpression), - currentClassLexicalEnvironment.classConstructor, + lexicalEnvironment.data.classConstructor, visitNodes2(node.arguments, visitor, isExpression) ); setOriginalNode(invocation, node); @@ -90955,12 +92107,13 @@ function transformClassFields(context) { return visitEachChild(node, visitor, context); } function visitTaggedTemplateExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.tag)) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.tag) && accessPrivateIdentifier2(node.tag.name)) { const { thisArg, target } = factory2.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion); return factory2.updateTaggedTemplateExpression( node, factory2.createCallExpression( - factory2.createPropertyAccessExpression(visitNode(target, visitor), "bind"), + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "bind"), /*typeArguments*/ void 0, [visitNode(thisArg, visitor, isExpression)] @@ -90970,10 +92123,10 @@ function transformClassFields(context) { visitNode(node.template, visitor, isTemplateLiteral) ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { const invocation = factory2.createFunctionBindCall( visitNode(node.tag, visitor, isExpression), - currentClassLexicalEnvironment.classConstructor, + lexicalEnvironment.data.classConstructor, [] ); setOriginalNode(invocation, node); @@ -90989,10 +92142,10 @@ function transformClassFields(context) { return visitEachChild(node, visitor, context); } function transformClassStaticBlockDeclaration(node) { + if (lexicalEnvironment) { + lexicalEnvironmentMap.set(getOriginalNode(node), lexicalEnvironment); + } if (shouldTransformPrivateElementsOrClassStaticBlocks) { - if (currentClassLexicalEnvironment) { - classLexicalEnvironmentMap.set(getOriginalNodeId(node), currentClassLexicalEnvironment); - } startLexicalEnvironment(); let statements = setCurrentStaticPropertyDeclarationOrStaticBlockAnd( node, @@ -91007,23 +92160,45 @@ function transformClassFields(context) { return iife; } } - function visitBinaryExpression(node, valueIsDiscarded) { + function isAnonymousClassNeedingAssignedName(node) { + if (isClassExpression(node) && !node.name) { + const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); + const classStaticBlock = find(staticPropertiesOrClassStaticBlocks, isClassStaticBlockDeclaration); + if (classStaticBlock) { + for (const statement of classStaticBlock.body.statements) { + if (isExpressionStatement(statement) && isCallToHelper(statement.expression, "___setFunctionName")) { + return false; + } + } + } + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || !!(getInternalEmitFlags(node) && 32 /* TransformPrivateStaticElements */)) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + return hasTransformableStatics; + } + return false; + } + function visitBinaryExpression(node, discarded) { if (isDestructuringAssignment(node)) { const savedPendingExpressions = pendingExpressions; pendingExpressions = void 0; node = factory2.updateBinaryExpression( node, - visitNode(node.left, assignmentTargetVisitor), + visitNode(node.left, assignmentTargetVisitor, isExpression), node.operatorToken, - visitNode(node.right, visitor) + visitNode(node.right, visitor, isExpression) ); const expr = some(pendingExpressions) ? factory2.inlineExpressions(compact([...pendingExpressions, node])) : node; pendingExpressions = savedPendingExpressions; return expr; } if (isAssignmentExpression(node)) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.left)) { - const info = accessPrivateIdentifier(node.left.name); + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isPrivateIdentifierPropertyAccessExpression(node.left)) { + const info = accessPrivateIdentifier2(node.left.name); if (info) { return setTextRange( setOriginalNode( @@ -91033,8 +92208,8 @@ function transformClassFields(context) { node ); } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return factory2.updateBinaryExpression( node, @@ -91067,7 +92242,7 @@ function transformClassFields(context) { ); setTextRange(expression, node); } - const temp = valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); if (temp) { expression = factory2.createAssignment(temp, expression); setTextRange(temp, node); @@ -91089,11 +92264,42 @@ function transformClassFields(context) { } } } - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierInExpression(node)) { + if (isPrivateIdentifierInExpression(node)) { return transformPrivateIdentifierInInExpression(node); } return visitEachChild(node, visitor, context); } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitParenthesizedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function visitPartiallyEmittedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + const referencedName = factory2.createTempVariable(hoistVariableDeclaration); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name }; + } function createPrivateIdentifierAssignment(info, receiver, right, operator) { receiver = visitNode(receiver, visitor, isExpression); right = visitNode(right, visitor, isExpression); @@ -91109,7 +92315,7 @@ function transformClassFields(context) { setCommentRange(receiver, moveRangePos(receiver, -1)); switch (info.kind) { case "a" /* Accessor */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, @@ -91117,7 +92323,7 @@ function transformClassFields(context) { info.setterName ); case "m" /* Method */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, @@ -91126,13 +92332,15 @@ function transformClassFields(context) { void 0 ); case "f" /* Field */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, info.kind, - info.variableName + info.isStatic ? info.variableName : void 0 ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); default: Debug.assertNever(info, "Unknown private element type"); } @@ -91143,7 +92351,7 @@ function transformClassFields(context) { function getClassFacts(node) { let facts = 0 /* None */; const original = getOriginalNode(node); - if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(original)) { + if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) { facts |= 1 /* ClassWasDecorated */; } let containsPublicInstanceFields = false; @@ -91187,7 +92395,8 @@ function transformClassFields(context) { return facts; } function visitExpressionWithTypeArgumentsInHeritageClause(node) { - const facts = (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts) || 0 /* None */; + var _a2; + const facts = ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts) || 0 /* None */; if (facts & 4 /* NeedsClassSuperReference */) { const temp = factory2.createTempVariable( hoistVariableDeclaration, @@ -91207,20 +92416,24 @@ function transformClassFields(context) { } return visitEachChild(node, visitor, context); } - function visitInNewClassLexicalEnvironment(node, visitor2) { + function visitInNewClassLexicalEnvironment(node, referencedName, visitor2) { const savedCurrentClassContainer = currentClassContainer; const savedPendingExpressions = pendingExpressions; + const savedLexicalEnvironment = lexicalEnvironment; currentClassContainer = node; pendingExpressions = void 0; startClassLexicalEnvironment(); - if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const shouldAlwaysTransformPrivateStaticElements = getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */; + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldAlwaysTransformPrivateStaticElements) { const name = getNameOfDeclaration(node); if (name && isIdentifier(name)) { - getPrivateIdentifierEnvironment().className = name; + getPrivateIdentifierEnvironment().data.className = name; } + } + if (shouldTransformPrivateElementsOrClassStaticBlocks) { const privateInstanceMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); if (some(privateInstanceMethodsAndAccessors)) { - getPrivateIdentifierEnvironment().weakSetName = createHoistedVariableForClass( + getPrivateIdentifierEnvironment().data.weakSetName = createHoistedVariableForClass( "instances", privateInstanceMethodsAndAccessors[0].name ); @@ -91233,27 +92446,42 @@ function transformClassFields(context) { if (facts & 8 /* NeedsSubstitutionForThisInClassStaticField */) { enableSubstitutionForClassStaticThisOrSuperReference(); } - const result = visitor2(node, facts); + const result = visitor2(node, facts, referencedName); endClassLexicalEnvironment(); + Debug.assert(lexicalEnvironment === savedLexicalEnvironment); currentClassContainer = savedCurrentClassContainer; pendingExpressions = savedPendingExpressions; return result; } function visitClassDeclaration(node) { - return visitInNewClassLexicalEnvironment(node, visitClassDeclarationInNewClassLexicalEnvironment); + return visitInNewClassLexicalEnvironment( + node, + /*referencedName*/ + void 0, + visitClassDeclarationInNewClassLexicalEnvironment + ); } function visitClassDeclarationInNewClassLexicalEnvironment(node, facts) { + var _a2, _b; let pendingClassReferenceAssignment; if (facts & 2 /* NeedsClassConstructorReference */) { - const temp = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); - pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) { + getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + pendingClassReferenceAssignment = factory2.createAssignment(node.emitNode.classThis, factory2.getInternalName(node)); + } else { + const temp = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + } + if ((_b = node.emitNode) == null ? void 0 : _b.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; + } } - const modifiers = visitNodes2(node.modifiers, visitor, isModifierLike); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); const classDecl = factory2.updateClassDeclaration( @@ -91276,7 +92504,7 @@ function transformClassFields(context) { if (some(pendingExpressions)) { statements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); } - if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks) { + if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) { const staticProperties = getStaticPropertiesAndClassStaticBlock(node); if (some(staticProperties)) { addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory2.getInternalName(node)); @@ -91284,28 +92512,37 @@ function transformClassFields(context) { } return statements; } - function visitClassExpression(node) { - return visitInNewClassLexicalEnvironment(node, visitClassExpressionInNewClassLexicalEnvironment); + function visitClassExpression(node, referencedName) { + return visitInNewClassLexicalEnvironment(node, referencedName, visitClassExpressionInNewClassLexicalEnvironment); } - function visitClassExpressionInNewClassLexicalEnvironment(node, facts) { + function visitClassExpressionInNewClassLexicalEnvironment(node, facts, referencedName) { + var _a2, _b, _c, _d, _e, _f; const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */); const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */; let temp; function createClassTempVar() { + var _a3; + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a3 = node.emitNode) == null ? void 0 : _a3.classThis)) { + return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + } const classCheckFlags = resolver.getNodeCheckFlags(node); const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */; const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */; - return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2); + return temp2; + } + if ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; } if (facts & 2 /* NeedsClassConstructorReference */) { - temp = createClassTempVar(); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + temp != null ? temp : temp = createClassTempVar(); } - const modifiers = visitNodes2(node.modifiers, visitor, isModifierLike); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); - const classExpression = factory2.updateClassExpression( + let classExpression = factory2.updateClassExpression( node, modifiers, node.name, @@ -91318,46 +92555,68 @@ function transformClassFields(context) { if (prologue) { expressions.push(prologue); } - const hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); - if (hasTransformableStatics || some(pendingExpressions)) { + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + if (hasTransformableStatics || some(pendingExpressions) || referencedName) { if (isDecoratedClassDeclaration) { Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration."); - if (pendingStatements && pendingExpressions && some(pendingExpressions)) { - pendingStatements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); + if (some(pendingExpressions)) { + addRange(pendingStatements, map(pendingExpressions, factory2.createExpressionStatement)); + } + if (referencedName) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const setNameExpression = emitHelpers().createSetFunctionNameHelper((_c = temp != null ? temp : (_b = node.emitNode) == null ? void 0 : _b.classThis) != null ? _c : factory2.getInternalName(node), referencedName); + pendingStatements.push(factory2.createExpressionStatement(setNameExpression)); + } else { + const setNameExpression = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), referencedName); + classExpression = factory2.updateClassExpression( + classExpression, + classExpression.modifiers, + classExpression.name, + classExpression.typeParameters, + classExpression.heritageClauses, + [ + factory2.createClassStaticBlockDeclaration( + factory2.createBlock([ + factory2.createExpressionStatement(setNameExpression) + ]) + ), + ...classExpression.members + ] + ); + } } - if (pendingStatements && some(staticPropertiesOrClassStaticBlocks)) { - addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, factory2.getInternalName(node)); + if (some(staticPropertiesOrClassStaticBlocks)) { + addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, (_e = (_d = node.emitNode) == null ? void 0 : _d.classThis) != null ? _e : factory2.getInternalName(node)); } if (temp) { - expressions.push( - startOnNewLine(factory2.createAssignment(temp, classExpression)), - startOnNewLine(temp) - ); + expressions.push(factory2.createAssignment(temp, classExpression)); + } else if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_f = node.emitNode) == null ? void 0 : _f.classThis)) { + expressions.push(factory2.createAssignment(node.emitNode.classThis, classExpression)); } else { expressions.push(classExpression); - if (prologue) { - startOnNewLine(classExpression); - } } } else { - temp || (temp = createClassTempVar()); + temp != null ? temp : temp = createClassTempVar(); if (isClassWithConstructorReference) { enableSubstitutionForClassAliases(); const alias = factory2.cloneNode(temp); - alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; + alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; classAliases[getOriginalNodeId(node)] = alias; } - setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression)); - expressions.push(startOnNewLine(factory2.createAssignment(temp, classExpression))); - addRange(expressions, map(pendingExpressions, startOnNewLine)); + expressions.push(factory2.createAssignment(temp, classExpression)); + addRange(expressions, pendingExpressions); + if (referencedName) { + expressions.push(emitHelpers().createSetFunctionNameHelper(temp, referencedName)); + } addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp)); - expressions.push(startOnNewLine(temp)); + expressions.push(factory2.cloneNode(temp)); } } else { expressions.push(classExpression); - if (prologue) { - startOnNewLine(classExpression); - } + } + if (expressions.length > 1) { + addEmitFlags(classExpression, 131072 /* Indented */); + expressions.forEach(startOnNewLine); } return factory2.inlineExpressions(expressions); } @@ -91368,16 +92627,24 @@ function transformClassFields(context) { return void 0; } function transformClassMembers(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const shouldTransformPrivateStaticElementsInClass = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInFile) { for (const member of node.members) { if (isPrivateIdentifierClassElementDeclaration(member)) { - addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + if (shouldTransformClassElementToWeakMap(member)) { + addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, member.name, { kind: "untransformed" }); + } } } - if (some(getPrivateInstanceMethodsAndAccessors(node))) { - createBrandCheckWeakSetForPrivateMethods(); + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + if (some(getPrivateInstanceMethodsAndAccessors(node))) { + createBrandCheckWeakSetForPrivateMethods(); + } } - if (shouldTransformAutoAccessors) { + if (shouldTransformAutoAccessorsInCurrentClass()) { for (const member of node.members) { if (isAutoAccessorPropertyDeclaration(member)) { const storageName = factory2.getGeneratedPrivateNameForNode( @@ -91386,7 +92653,12 @@ function transformClassFields(context) { void 0, "_accessor_storage" ); - addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInClass && hasStaticModifier(member)) { + addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, storageName, { kind: "untransformed" }); + } } } } @@ -91445,7 +92717,7 @@ function transformClassFields(context) { return { members, prologue }; } function createBrandCheckWeakSetForPrivateMethods() { - const { weakSetName } = getPrivateIdentifierEnvironment(); + const { weakSetName } = getPrivateIdentifierEnvironment().data; Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); getPendingExpressions().push( factory2.createAssignment( @@ -91461,7 +92733,7 @@ function transformClassFields(context) { } function transformConstructor(constructor, container) { constructor = visitNode(constructor, visitor, isConstructorDeclaration); - if (!currentClassLexicalEnvironment || !(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */)) { + if (!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) || !(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */)) { return constructor; } const extendsClauseElement = getEffectiveBaseTypeNode(container); @@ -91498,13 +92770,14 @@ function transformClassFields(context) { } function transformConstructorBody(node, constructor, isDerivedClass) { var _a2, _b; - let properties = getProperties( + const instanceProperties = getProperties( node, /*requireInitializer*/ false, /*isStatic*/ false ); + let properties = instanceProperties; if (!useDefineForClassFields) { properties = filter(properties, (property) => !!property.initializer || isPrivateIdentifier(property.name) || hasAccessorModifier(property)); } @@ -91558,37 +92831,30 @@ function transformClassFields(context) { } let parameterPropertyDeclarationCount = 0; if (constructor == null ? void 0 : constructor.body) { - if (useDefineForClassFields) { - statements = statements.filter((statement) => !isParameterPropertyDeclaration(getOriginalNode(statement), constructor)); - } else { - for (const statement of constructor.body.statements) { - if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - parameterPropertyDeclarationCount++; - } - } - if (parameterPropertyDeclarationCount > 0) { - const parameterProperties = visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount); - if (superStatementIndex >= 0) { - addRange(statements, parameterProperties); - } else { - let superAndPrologueStatementCount = prologueStatementCount; - if (needsSyntheticConstructor) - superAndPrologueStatementCount++; - statements = [ - ...statements.slice(0, superAndPrologueStatementCount), - ...parameterProperties, - ...statements.slice(superAndPrologueStatementCount) - ]; - } - indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + for (let i = indexOfFirstStatementAfterSuperAndPrologue; i < constructor.body.statements.length; i++) { + const statement = constructor.body.statements[i]; + if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { + parameterPropertyDeclarationCount++; + } else { + break; } } + if (parameterPropertyDeclarationCount > 0) { + indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + } } const receiver = factory2.createThis(); - addMethodStatements(statements, privateMethodsAndAccessors, receiver); - addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + addInstanceMethodStatements(statements, privateMethodsAndAccessors, receiver); + if (constructor) { + const parameterProperties = filter(instanceProperties, (prop) => isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + const nonParameterProperties = filter(properties, (prop) => !isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + addPropertyOrClassStaticBlockStatements(statements, parameterProperties, receiver); + addPropertyOrClassStaticBlockStatements(statements, nonParameterProperties, receiver); + } else { + addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + } if (constructor) { - addRange(statements, visitNodes2(constructor.body.statements, visitBodyStatement, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); + addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); } statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); if (statements.length === 0 && !constructor) { @@ -91607,16 +92873,10 @@ function transformClassFields(context) { /*location*/ constructor ? constructor.body : void 0 ); - function visitBodyStatement(statement) { - if (useDefineForClassFields && isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - return void 0; - } - return visitor(statement); - } } function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) { for (const property of properties) { - if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) { + if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks) { continue; } const statement = transformPropertyOrClassStaticBlock(property, receiver); @@ -91634,10 +92894,19 @@ function transformClassFields(context) { const statement = factory2.createExpressionStatement(expression); setOriginalNode(statement, property); addEmitFlags(statement, getEmitFlags(property) & 3072 /* NoComments */); - setSourceMapRange(statement, moveRangePastModifiers(property)); setCommentRange(statement, property); + const propertyOriginalNode = getOriginalNode(property); + if (isParameter(propertyOriginalNode)) { + setSourceMapRange(statement, propertyOriginalNode); + removeAllComments(statement); + } else { + setSourceMapRange(statement, moveRangePastModifiers(property)); + } setSyntheticLeadingComments(expression, void 0); setSyntheticTrailingComments(expression, void 0); + if (hasAccessorModifier(propertyOriginalNode)) { + addEmitFlags(statement, 3072 /* NoComments */); + } return statement; } function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) { @@ -91657,37 +92926,49 @@ function transformClassFields(context) { return expressions; } function transformProperty(property, receiver) { + var _a2; const savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock; const transformed = transformPropertyWorker(property, receiver); - if (transformed && hasStaticModifier(property) && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts)) { + if (transformed && hasStaticModifier(property) && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts)) { setOriginalNode(transformed, property); addEmitFlags(transformed, 4 /* AdviseOnEmitNode */); - classLexicalEnvironmentMap.set(getOriginalNodeId(transformed), currentClassLexicalEnvironment); + setSourceMapRange(transformed, getSourceMapRange(property.name)); + lexicalEnvironmentMap.set(getOriginalNode(property), lexicalEnvironment); } currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock; return transformed; } function transformPropertyWorker(property, receiver) { - var _a2; const emitAssignment = !useDefineForClassFields; + let referencedName; + if (isNamedEvaluation(property, isAnonymousClassNeedingAssignedName)) { + if (isPropertyNameLiteral(property.name) || isPrivateIdentifier(property.name)) { + referencedName = factory2.createStringLiteralFromNode(property.name); + } else if (isPropertyNameLiteral(property.name.expression) && !isIdentifier(property.name.expression)) { + referencedName = factory2.createStringLiteralFromNode(property.name.expression); + } else { + referencedName = factory2.getGeneratedNameForNode(property.name); + } + } const propertyName = hasAccessorModifier(property) ? factory2.getGeneratedPrivateNameForNode(property.name) : isComputedPropertyName(property.name) && !isSimpleInlineableExpression(property.name.expression) ? factory2.updateComputedPropertyName(property.name, factory2.getGeneratedNameForNode(property.name)) : property.name; if (hasStaticModifier(property)) { currentStaticPropertyDeclarationOrStaticBlock = property; } - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(propertyName)) { - const privateIdentifierInfo = accessPrivateIdentifier(propertyName); + const initializerVisitor = referencedName ? (child) => namedEvaluationVisitor(child, referencedName) : visitor; + if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property)) { + const privateIdentifierInfo = accessPrivateIdentifier2(propertyName); if (privateIdentifierInfo) { if (privateIdentifierInfo.kind === "f" /* Field */) { if (!privateIdentifierInfo.isStatic) { return createPrivateInstanceFieldInitializer( receiver, - visitNode(property.initializer, visitor, isExpression), + visitNode(property.initializer, initializerVisitor, isExpression), privateIdentifierInfo.brandCheckIdentifier ); } else { return createPrivateStaticFieldInitializer( privateIdentifierInfo.variableName, - visitNode(property.initializer, visitor, isExpression) + visitNode(property.initializer, initializerVisitor, isExpression) ); } } else { @@ -91704,7 +92985,23 @@ function transformClassFields(context) { if (hasSyntacticModifier(propertyOriginalNode, 256 /* Abstract */)) { return void 0; } - const initializer = property.initializer || emitAssignment ? (_a2 = visitNode(property.initializer, visitor, isExpression)) != null ? _a2 : factory2.createVoidZero() : isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName) ? propertyName : factory2.createVoidZero(); + let initializer = visitNode(property.initializer, initializerVisitor, isExpression); + if (isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName)) { + const localName = factory2.cloneNode(propertyName); + if (initializer) { + if (isParenthesizedExpression(initializer) && isCommaExpression(initializer.expression) && isCallToHelper(initializer.expression.left, "___runInitializers") && isVoidExpression(initializer.expression.right) && isNumericLiteral(initializer.expression.right.expression)) { + initializer = initializer.expression.left; + } + initializer = factory2.inlineExpressions([initializer, localName]); + } else { + initializer = localName; + } + setEmitFlags(propertyName, 3072 /* NoComments */ | 96 /* NoSourceMap */); + setSourceMapRange(localName, propertyOriginalNode.name); + setEmitFlags(localName, 3072 /* NoComments */); + } else { + initializer != null ? initializer : initializer = factory2.createVoidZero(); + } if (emitAssignment || isPrivateIdentifier(propertyName)) { const memberAccess = createMemberAccessForPropertyName( factory2, @@ -91713,7 +93010,9 @@ function transformClassFields(context) { /*location*/ propertyName ); - return factory2.createAssignment(memberAccess, initializer); + addEmitFlags(memberAccess, 1024 /* NoLeadingComments */); + const expression = factory2.createAssignment(memberAccess, initializer); + return expression; } else { const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; const descriptor = factory2.createPropertyDescriptor({ value: initializer, configurable: true, writable: true, enumerable: true }); @@ -91741,11 +93040,11 @@ function transformClassFields(context) { context.enableEmitNotification(164 /* ComputedPropertyName */); } } - function addMethodStatements(statements, methods, receiver) { + function addInstanceMethodStatements(statements, methods, receiver) { if (!shouldTransformPrivateElementsOrClassStaticBlocks || !some(methods)) { return; } - const { weakSetName } = getPrivateIdentifierEnvironment(); + const { weakSetName } = getPrivateIdentifierEnvironment().data; Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); statements.push( factory2.createExpressionStatement( @@ -91764,20 +93063,352 @@ function transformClassFields(context) { visitNode(node.argumentExpression, visitor, isExpression) ); } + function getPropertyNameExpressionIfNeeded(name, shouldHoist, captureReferencedName) { + if (isComputedPropertyName(name)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name); + let expression = visitNode(name.expression, visitor, isExpression); + const innerExpression = skipPartiallyEmittedExpressions(expression); + const inlinable = isSimpleInlineableExpression(innerExpression); + const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); + if (!alreadyTransformed && !inlinable && shouldHoist) { + const generatedName = factory2.getGeneratedNameForNode(name); + if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) { + addBlockScopedVariable(generatedName); + } else { + hoistVariableDeclaration(generatedName); + } + if (captureReferencedName) { + expression = emitHelpers().createPropKeyHelper(expression); + } + return factory2.createAssignment(generatedName, expression); + } + return inlinable || isIdentifier(innerExpression) ? void 0 : expression; + } + } + function startClassLexicalEnvironment() { + lexicalEnvironment = { previous: lexicalEnvironment, data: void 0 }; + } + function endClassLexicalEnvironment() { + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + } + function getClassLexicalEnvironment() { + var _a2; + Debug.assert(lexicalEnvironment); + return (_a2 = lexicalEnvironment.data) != null ? _a2 : lexicalEnvironment.data = { + facts: 0 /* None */, + classConstructor: void 0, + classThis: void 0, + superClassReference: void 0 + // privateIdentifierEnvironment: undefined, + }; + } + function getPrivateIdentifierEnvironment() { + var _a2; + Debug.assert(lexicalEnvironment); + return (_a2 = lexicalEnvironment.privateEnv) != null ? _a2 : lexicalEnvironment.privateEnv = newPrivateEnvironment({ + className: void 0, + weakSetName: void 0 + }); + } + function getPendingExpressions() { + return pendingExpressions != null ? pendingExpressions : pendingExpressions = []; + } + function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + if (isAutoAccessorPropertyDeclaration(node)) { + addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isPropertyDeclaration(node)) { + addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isMethodDeclaration(node)) { + addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isGetAccessorDeclaration(node)) { + addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isSetAccessorDeclaration(node)) { + addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } + } + function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + if (isStatic2) { + const brandCheckIdentifier = Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment"); + const variableName = createHoistedVariableForPrivateName(name); + setPrivateIdentifier(privateEnv, name, { + kind: "f" /* Field */, + isStatic: true, + brandCheckIdentifier, + variableName, + isValid + }); + } else { + const weakMapName = createHoistedVariableForPrivateName(name); + setPrivateIdentifier(privateEnv, name, { + kind: "f" /* Field */, + isStatic: false, + brandCheckIdentifier: weakMapName, + isValid + }); + getPendingExpressions().push(factory2.createAssignment( + weakMapName, + factory2.createNewExpression( + factory2.createIdentifier("WeakMap"), + /*typeArguments*/ + void 0, + [] + ) + )); + } + } + function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + const methodName = createHoistedVariableForPrivateName(name); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name, { + kind: "m" /* Method */, + methodName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + var _a2; + const getterName = createHoistedVariableForPrivateName(name, "_get"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { + previousInfo.getterName = getterName; + } else { + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName, + setterName: void 0, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + } + function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + var _a2; + const setterName = createHoistedVariableForPrivateName(name, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { + previousInfo.setterName = setterName; + } else { + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName: void 0, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + } + function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + const getterName = createHoistedVariableForPrivateName(name, "_get"); + const setterName = createHoistedVariableForPrivateName(name, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { + const lex = getClassLexicalEnvironment(); + const privateEnv = getPrivateIdentifierEnvironment(); + const previousInfo = getPrivateIdentifier(privateEnv, name); + const isStatic2 = hasStaticModifier(node); + const isValid = !isReservedPrivateName(name) && previousInfo === void 0; + addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } + function createHoistedVariableForClass(name, node, suffix) { + const { className } = getPrivateIdentifierEnvironment().data; + const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; + const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0, + /*reserveInNestedScopes*/ + true, + prefix, + suffix + ); + if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) { + addBlockScopedVariable(identifier); + } else { + hoistVariableDeclaration(identifier); + } + return identifier; + } + function createHoistedVariableForPrivateName(name, suffix) { + var _a2; + const text = tryGetTextOfPropertyName(name); + return createHoistedVariableForClass((_a2 = text == null ? void 0 : text.substring(1)) != null ? _a2 : name, name, suffix); + } + function accessPrivateIdentifier2(name) { + const info = accessPrivateIdentifier(lexicalEnvironment, name); + return (info == null ? void 0 : info.kind) === "untransformed" ? void 0 : info; + } + function wrapPrivateIdentifierForDestructuringTarget(node) { + const parameter = factory2.getGeneratedNameForNode(node); + const info = accessPrivateIdentifier2(node.name); + if (!info) { + return visitEachChild(node, visitor, context); + } + let receiver = node.expression; + if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { + receiver = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getPendingExpressions().push(factory2.createBinaryExpression(receiver, 63 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); + } + return factory2.createAssignmentTargetWrapper( + parameter, + createPrivateIdentifierAssignment( + info, + receiver, + parameter, + 63 /* EqualsToken */ + ) + ); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isPrivateIdentifierPropertyAccessExpression(node)) { + return wrapPrivateIdentifierForDestructuringTarget(node); + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1 /* ClassWasDecorated */) { + return visitInvalidSuperProperty(node); + } else if (classConstructor && superClassReference) { + const name = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (name) { + const temp = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + return factory2.createAssignmentTargetWrapper( + temp, + factory2.createReflectSetCall( + superClassReference, + name, + temp, + classConstructor + ) + ); + } + } + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const left = visitDestructuringAssignmentTarget(node.left); + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const left = visitDestructuringAssignmentTarget(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitDestructuringAssignmentTarget(node); + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentProperty(node) { + const name = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + return visitEachChild(node, visitor, context); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); + const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateShorthandPropertyAssignment(node, node.name, objectAssignmentInitializer); + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + return factory2.updateArrayLiteralExpression( + node, + visitNodes2(node.elements, visitArrayAssignmentElement, isExpression) + ); + } else { + return factory2.updateObjectLiteralExpression( + node, + visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike) + ); + } + } function onEmitNode(hint, node, emitCallback) { const original = getOriginalNode(node); - if (original.id) { - const classLexicalEnvironment = classLexicalEnvironmentMap.get(original.id); - if (classLexicalEnvironment) { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = classLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = classLexicalEnvironment; - previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; - return; - } + const lex = lexicalEnvironmentMap.get(original); + if (lex) { + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = lex; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = !isClassStaticBlockDeclaration(original) || !(getInternalEmitFlags(original) & 32 /* TransformPrivateStaticElements */); + previousOnEmitNode(hint, node, emitCallback); + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; + return; } switch (node.kind) { case 215 /* FunctionExpression */: @@ -91785,37 +93416,30 @@ function transformClassFields(context) { break; } case 259 /* FunctionDeclaration */: - case 173 /* Constructor */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = void 0; - currentComputedPropertyNameClassLexicalEnvironment = void 0; - previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; - return; - } + case 173 /* Constructor */: case 174 /* GetAccessor */: case 175 /* SetAccessor */: case 171 /* MethodDeclaration */: case 169 /* PropertyDeclaration */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment; - currentClassLexicalEnvironment = void 0; + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = void 0; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = false; previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; return; } case 164 /* ComputedPropertyName */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = void 0; + const savedLexicalEnvironment = lexicalEnvironment; + const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + shouldSubstituteThisWithClassThis = savedShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; return; } } @@ -91838,15 +93462,16 @@ function transformClassFields(context) { return node; } function substituteThisExpression(node) { - if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && currentClassLexicalEnvironment) { - const { facts, classConstructor } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { + if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { facts, classConstructor, classThis } = lexicalEnvironment.data; + if (facts & 1 /* ClassWasDecorated */ && legacyDecorators) { return factory2.createParenthesizedExpression(factory2.createVoidZero()); } - if (classConstructor) { + const substituteThis = shouldSubstituteThisWithClassThis ? classThis != null ? classThis : classConstructor : classConstructor; + if (substituteThis) { return setTextRange( setOriginalNode( - factory2.cloneNode(classConstructor), + factory2.cloneNode(substituteThis), node ), node @@ -91875,350 +93500,6 @@ function transformClassFields(context) { } return void 0; } - function getPropertyNameExpressionIfNeeded(name, shouldHoist) { - if (isComputedPropertyName(name)) { - const expression = visitNode(name.expression, visitor, isExpression); - const innerExpression = skipPartiallyEmittedExpressions(expression); - const inlinable = isSimpleInlineableExpression(innerExpression); - const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); - if (!alreadyTransformed && !inlinable && shouldHoist) { - const generatedName = factory2.getGeneratedNameForNode(name); - if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) { - addBlockScopedVariable(generatedName); - } else { - hoistVariableDeclaration(generatedName); - } - return factory2.createAssignment(generatedName, expression); - } - return inlinable || isIdentifier(innerExpression) ? void 0 : expression; - } - } - function startClassLexicalEnvironment() { - classLexicalEnvironmentStack.push(currentClassLexicalEnvironment); - currentClassLexicalEnvironment = void 0; - } - function endClassLexicalEnvironment() { - currentClassLexicalEnvironment = classLexicalEnvironmentStack.pop(); - } - function getClassLexicalEnvironment() { - return currentClassLexicalEnvironment || (currentClassLexicalEnvironment = { - facts: 0 /* None */, - classConstructor: void 0, - superClassReference: void 0, - privateIdentifierEnvironment: void 0 - }); - } - function getPrivateIdentifierEnvironment() { - const lex = getClassLexicalEnvironment(); - lex.privateIdentifierEnvironment || (lex.privateIdentifierEnvironment = { - className: void 0, - weakSetName: void 0, - identifiers: void 0, - generatedIdentifiers: void 0 - }); - return lex.privateIdentifierEnvironment; - } - function getPendingExpressions() { - return pendingExpressions != null ? pendingExpressions : pendingExpressions = []; - } - function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - if (isAutoAccessorPropertyDeclaration(node)) { - addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isPropertyDeclaration(node)) { - addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isMethodDeclaration(node)) { - addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isGetAccessorDeclaration(node)) { - addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isSetAccessorDeclaration(node)) { - addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - } - function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - if (isStatic2) { - Debug.assert(lex.classConstructor, "classConstructor should be set in private identifier environment"); - const variableName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - brandCheckIdentifier: lex.classConstructor, - variableName, - isStatic: true, - isValid - }); - } else { - const weakMapName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - brandCheckIdentifier: weakMapName, - variableName: void 0, - isStatic: false, - isValid - }); - getPendingExpressions().push(factory2.createAssignment( - weakMapName, - factory2.createNewExpression( - factory2.createIdentifier("WeakMap"), - /*typeArguments*/ - void 0, - [] - ) - )); - } - } - function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const methodName = createHoistedVariableForPrivateName(name); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "m" /* Method */, - methodName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { - previousInfo.getterName = getterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName: void 0, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { - previousInfo.setterName = setterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName: void 0, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { - const lex = getClassLexicalEnvironment(); - const privateEnv = getPrivateIdentifierEnvironment(); - const previousInfo = getPrivateIdentifier(privateEnv, name); - const isStatic2 = hasStaticModifier(node); - const isValid = !isReservedPrivateName(name) && previousInfo === void 0; - addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - function createHoistedVariableForClass(name, node, suffix) { - const { className } = getPrivateIdentifierEnvironment(); - const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; - const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0, - /*reserveInNestedScopes*/ - true, - prefix, - suffix - ); - if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) { - addBlockScopedVariable(identifier); - } else { - hoistVariableDeclaration(identifier); - } - return identifier; - } - function createHoistedVariableForPrivateName(name, suffix) { - var _a2; - const text = tryGetTextOfPropertyName(name); - return createHoistedVariableForClass((_a2 = text == null ? void 0 : text.substring(1)) != null ? _a2 : name, name, suffix); - } - function accessPrivateIdentifier(name) { - if (isGeneratedPrivateIdentifier(name)) { - return accessGeneratedPrivateIdentifier(name); - } else { - return accessPrivateIdentifierByText(name.escapedText); - } - } - function accessPrivateIdentifierByText(text) { - return accessPrivateIdentifierWorker(getPrivateIdentifierInfo, text); - } - function accessGeneratedPrivateIdentifier(name) { - return accessPrivateIdentifierWorker(getGeneratedPrivateIdentifierInfo, getNodeForGeneratedName(name)); - } - function accessPrivateIdentifierWorker(getPrivateIdentifierInfo2, privateIdentifierKey) { - if (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.privateIdentifierEnvironment) { - const info = getPrivateIdentifierInfo2(currentClassLexicalEnvironment.privateIdentifierEnvironment, privateIdentifierKey); - if (info) { - return info; - } - } - for (let i = classLexicalEnvironmentStack.length - 1; i >= 0; --i) { - const env = classLexicalEnvironmentStack[i]; - if (!env) { - continue; - } - if (env.privateIdentifierEnvironment) { - const info = getPrivateIdentifierInfo2(env.privateIdentifierEnvironment, privateIdentifierKey); - if (info) { - return info; - } - } - } - return void 0; - } - function wrapPrivateIdentifierForDestructuringTarget(node) { - const parameter = factory2.getGeneratedNameForNode(node); - const info = accessPrivateIdentifier(node.name); - if (!info) { - return visitEachChild(node, visitor, context); - } - let receiver = node.expression; - if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { - receiver = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getPendingExpressions().push(factory2.createBinaryExpression(receiver, 63 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); - } - return factory2.createAssignmentTargetWrapper( - parameter, - createPrivateIdentifierAssignment( - info, - receiver, - parameter, - 63 /* EqualsToken */ - ) - ); - } - function visitArrayAssignmentTarget(node) { - const target = getTargetOfBindingOrAssignmentElement(node); - if (target) { - let wrapped; - if (isPrivateIdentifierPropertyAccessExpression(target)) { - wrapped = wrapPrivateIdentifierForDestructuringTarget(target); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { - wrapped = visitInvalidSuperProperty(target); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(target) ? visitNode(target.argumentExpression, visitor, isExpression) : isIdentifier(target.name) ? factory2.createStringLiteralFromNode(target.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - wrapped = factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - if (wrapped) { - if (isAssignmentExpression(node)) { - return factory2.updateBinaryExpression( - node, - wrapped, - node.operatorToken, - visitNode(node.right, visitor, isExpression) - ); - } else if (isSpreadElement(node)) { - return factory2.updateSpreadElement(node, wrapped); - } else { - return wrapped; - } - } - } - return visitNode(node, assignmentTargetVisitor); - } - function visitObjectAssignmentTarget(node) { - if (isObjectBindingOrAssignmentElement(node) && !isShorthandPropertyAssignment(node)) { - const target = getTargetOfBindingOrAssignmentElement(node); - let wrapped; - if (target) { - if (isPrivateIdentifierPropertyAccessExpression(target)) { - wrapped = wrapPrivateIdentifierForDestructuringTarget(target); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { - wrapped = visitInvalidSuperProperty(target); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(target) ? visitNode(target.argumentExpression, visitor, isExpression) : isIdentifier(target.name) ? factory2.createStringLiteralFromNode(target.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - wrapped = factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - } - if (isPropertyAssignment(node)) { - const initializer = getInitializerOfBindingOrAssignmentElement(node); - return factory2.updatePropertyAssignment( - node, - visitNode(node.name, visitor, isPropertyName), - wrapped ? initializer ? factory2.createAssignment(wrapped, visitNode(initializer, visitor)) : wrapped : visitNode(node.initializer, assignmentTargetVisitor, isExpression) - ); - } - if (isSpreadAssignment(node)) { - return factory2.updateSpreadAssignment( - node, - wrapped || visitNode(node.expression, assignmentTargetVisitor, isExpression) - ); - } - Debug.assert(wrapped === void 0, "Should not have generated a wrapped target"); - } - return visitNode(node, visitor); - } - function visitAssignmentPattern(node) { - if (isArrayLiteralExpression(node)) { - return factory2.updateArrayLiteralExpression( - node, - visitNodes2(node.elements, visitArrayAssignmentTarget, isExpression) - ); - } else { - return factory2.updateObjectLiteralExpression( - node, - visitNodes2(node.properties, visitObjectAssignmentTarget, isObjectLiteralElementLike) - ); - } - } } function createPrivateStaticFieldInitializer(variableName, initializer) { return factory.createAssignment( @@ -92247,26 +93528,8 @@ function createPrivateInstanceMethodInitializer(receiver, weakSetName) { function isReservedPrivateName(node) { return !isGeneratedPrivateIdentifier(node) && node.escapedText === "#constructor"; } -function getPrivateIdentifier(privateEnv, name) { - return isGeneratedPrivateIdentifier(name) ? getGeneratedPrivateIdentifierInfo(privateEnv, getNodeForGeneratedName(name)) : getPrivateIdentifierInfo(privateEnv, name.escapedText); -} -function setPrivateIdentifier(privateEnv, name, info) { - var _a2, _b; - if (isGeneratedPrivateIdentifier(name)) { - (_a2 = privateEnv.generatedIdentifiers) != null ? _a2 : privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map(); - privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), info); - } else { - (_b = privateEnv.identifiers) != null ? _b : privateEnv.identifiers = /* @__PURE__ */ new Map(); - privateEnv.identifiers.set(name.escapedText, info); - } -} -function getPrivateIdentifierInfo(privateEnv, key) { - var _a2; - return (_a2 = privateEnv.identifiers) == null ? void 0 : _a2.get(key); -} -function getGeneratedPrivateIdentifierInfo(privateEnv, key) { - var _a2; - return (_a2 = privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(key); +function isPrivateIdentifierInExpression(node) { + return isPrivateIdentifier(node.left) && node.operatorToken.kind === 101 /* InKeyword */; } // src/compiler/transformers/typeSerializer.ts @@ -92672,9 +93935,22 @@ function transformLegacyDecorators(context) { } } function visitClassDeclaration(node) { - if (!(classOrConstructorParameterIsDecorated(node) || childIsDecorated(node))) + if (!(classOrConstructorParameterIsDecorated( + /*legacyDecorators*/ + true, + node + ) || childIsDecorated( + /*legacyDecorators*/ + true, + node + ))) { return visitEachChild(node, visitor, context); - const statements = hasDecorators(node) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); + } + const statements = classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + true, + node + ) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); if (statements.length > 1) { statements.push(factory2.createEndOfDeclarationMarker(node)); setEmitFlags(statements[0], getEmitFlags(statements[0]) | 8388608 /* HasEndOfDeclarationMarker */); @@ -92691,7 +93967,12 @@ function transformLegacyDecorators(context) { for (const member of node.members) { if (!canHaveDecorators(member)) continue; - const allDecorators = getAllDecoratorsOfClassElement(member, node); + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); if (some(allDecorators == null ? void 0 : allDecorators.decorators, decoratorContainsPrivateIdentifierInExpression)) return true; if (some(allDecorators == null ? void 0 : allDecorators.parameters, parameterDecoratorsContainPrivateIdentifierInExpression)) @@ -92768,7 +94049,7 @@ function transformLegacyDecorators(context) { const classExpression = factory2.createClassExpression( /*modifiers*/ void 0, - name, + name && isGeneratedIdentifier(name) ? void 0 : name, /*typeParameters*/ void 0, heritageClauses, @@ -92813,7 +94094,7 @@ function transformLegacyDecorators(context) { return factory2.updateConstructorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), visitNode(node.body, visitor, isBlock) ); } @@ -92829,12 +94110,12 @@ function transformLegacyDecorators(context) { node, visitNodes2(node.modifiers, modifierVisitor, isModifier), node.asteriskToken, - visitNode(node.name, visitor, isPropertyName), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionToken*/ void 0, /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -92844,8 +94125,8 @@ function transformLegacyDecorators(context) { return finishClassElement(factory2.updateGetAccessorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -92855,8 +94136,8 @@ function transformLegacyDecorators(context) { return finishClassElement(factory2.updateSetAccessorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), visitNode(node.body, visitor, isBlock) ), node); } @@ -92867,7 +94148,7 @@ function transformLegacyDecorators(context) { return finishClassElement(factory2.updatePropertyDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, /*type*/ @@ -92880,7 +94161,7 @@ function transformLegacyDecorators(context) { node, elideNodes(factory2, node.modifiers), node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*questionToken*/ void 0, /*type*/ @@ -92895,20 +94176,30 @@ function transformLegacyDecorators(context) { } return updated; } + function isSyntheticMetadataDecorator(node) { + return isCallToHelper(node.expression, "___metadata"); + } function transformAllDecoratorsOfDeclaration(allDecorators) { if (!allDecorators) { return void 0; } + const { false: decorators, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator); const decoratorExpressions = []; - addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); + addRange(decoratorExpressions, map(decorators, transformDecorator)); addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); + addRange(decoratorExpressions, map(metadata, transformDecorator)); return decoratorExpressions; } function addClassElementDecorationStatements(statements, node, isStatic2) { addRange(statements, map(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr))); } function isDecoratedClassElement(member, isStaticElement, parent2) { - return nodeOrChildIsDecorated(member, parent2) && isStaticElement === isStatic(member); + return nodeOrChildIsDecorated( + /*legacyDecorators*/ + true, + member, + parent2 + ) && isStaticElement === isStatic(member); } function getDecoratedClassElements(node, isStatic2) { return filter(node.members, (m) => isDecoratedClassElement(m, isStatic2, node)); @@ -92922,7 +94213,12 @@ function transformLegacyDecorators(context) { return expressions; } function generateClassElementDecorationExpression(node, member) { - const allDecorators = getAllDecoratorsOfClassElement(member, node); + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); if (!decoratorExpressions) { return void 0; @@ -92977,7 +94273,7 @@ function transformLegacyDecorators(context) { return expression; } function transformDecorator(decorator) { - return visitNode(decorator.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(decorator.expression, visitor, isExpression)); } function transformDecoratorsOfParameter(decorators, parameterOffset) { let expressions; @@ -93065,6 +94361,1713 @@ function transformLegacyDecorators(context) { } } +// src/compiler/transformers/esDecorators.ts +function transformESDecorators(context) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + startLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context; + let top; + let classInfo; + let classThis; + let classSuper; + let pendingExpressions; + let shouldTransformPrivateStaticElementsInFile; + return chainBundle(context, transformSourceFile); + function transformSourceFile(node) { + top = void 0; + shouldTransformPrivateStaticElementsInFile = false; + const visited = visitEachChild(node, visitor, context); + addEmitHelpers(visited, context.readEmitHelpers()); + if (shouldTransformPrivateStaticElementsInFile) { + addInternalEmitFlags(visited, 32 /* TransformPrivateStaticElements */); + shouldTransformPrivateStaticElementsInFile = false; + } + return visited; + } + function updateState() { + classInfo = void 0; + classThis = void 0; + classSuper = void 0; + switch (top == null ? void 0 : top.kind) { + case "class": + classInfo = top.classInfo; + break; + case "class-element": + classInfo = top.next.classInfo; + classThis = top.classThis; + classSuper = top.classSuper; + break; + case "name": + const grandparent = top.next.next.next; + if ((grandparent == null ? void 0 : grandparent.kind) === "class-element") { + classInfo = grandparent.next.classInfo; + classThis = grandparent.classThis; + classSuper = grandparent.classSuper; + } + break; + } + } + function enterClass(classInfo2) { + top = { kind: "class", next: top, classInfo: classInfo2, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + function exitClass() { + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + function enterClassElement(node) { + var _a2, _b; + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "class-element", next: top }; + if (isClassStaticBlockDeclaration(node) || isPropertyDeclaration(node) && hasStaticModifier(node)) { + top.classThis = (_a2 = top.next.classInfo) == null ? void 0 : _a2.classThis; + top.classSuper = (_b = top.next.classInfo) == null ? void 0 : _b.classSuper; + } + updateState(); + } + function exitClassElement() { + var _a2; + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + Debug.assert(((_a2 = top.next) == null ? void 0 : _a2.kind) === "class", "Incorrect value for top.next.kind.", () => { + var _a3; + return `Expected top.next.kind to be 'class' but got '${(_a3 = top.next) == null ? void 0 : _a3.kind}' instead.`; + }); + top = top.next; + updateState(); + } + function enterName() { + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "name", next: top }; + updateState(); + } + function exitName() { + Debug.assert((top == null ? void 0 : top.kind) === "name", "Incorrect value for top.kind.", () => `Expected top.kind to be 'name' but got '${top == null ? void 0 : top.kind}' instead.`); + top = top.next; + updateState(); + } + function enterOther() { + if ((top == null ? void 0 : top.kind) === "other") { + Debug.assert(!pendingExpressions); + top.depth++; + } else { + top = { kind: "other", next: top, depth: 0, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + } + function exitOther() { + Debug.assert((top == null ? void 0 : top.kind) === "other", "Incorrect value for top.kind.", () => `Expected top.kind to be 'other' but got '${top == null ? void 0 : top.kind}' instead.`); + if (top.depth > 0) { + Debug.assert(!pendingExpressions); + top.depth--; + } else { + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + } + function shouldVisitNode(node) { + return !!(node.transformFlags & 33554432 /* ContainsDecorators */) || !!classThis && !!(node.transformFlags & 16384 /* ContainsLexicalThis */) || !!classThis && !!classSuper && !!(node.transformFlags & 134217728 /* ContainsLexicalSuper */); + } + function visitor(node) { + if (!shouldVisitNode(node)) { + return node; + } + switch (node.kind) { + case 167 /* Decorator */: + return Debug.fail("Use `modifierVisitor` instead."); + case 260 /* ClassDeclaration */: + return visitClassDeclaration(node); + case 228 /* ClassExpression */: + return visitClassExpression( + node, + /*referencedName*/ + void 0 + ); + case 173 /* Constructor */: + case 169 /* PropertyDeclaration */: + case 172 /* ClassStaticBlockDeclaration */: + return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); + case 166 /* Parameter */: + return visitParameterDeclaration(node); + case 223 /* BinaryExpression */: + return visitBinaryExpression( + node, + /*discarded*/ + false + ); + case 299 /* PropertyAssignment */: + return visitPropertyAssignment(node); + case 257 /* VariableDeclaration */: + return visitVariableDeclaration(node); + case 205 /* BindingElement */: + return visitBindingElement(node); + case 274 /* ExportAssignment */: + return visitExportAssignment(node); + case 108 /* ThisKeyword */: + return visitThisExpression(node); + case 245 /* ForStatement */: + return visitForStatement(node); + case 241 /* ExpressionStatement */: + return visitExpressionStatement(node); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ + false + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); + case 210 /* CallExpression */: + return visitCallExpression(node); + case 212 /* TaggedTemplateExpression */: + return visitTaggedTemplateExpression(node); + case 221 /* PrefixUnaryExpression */: + case 222 /* PostfixUnaryExpression */: + return visitPreOrPostfixUnaryExpression( + node, + /*discard*/ + false + ); + case 208 /* PropertyAccessExpression */: + return visitPropertyAccessExpression(node); + case 209 /* ElementAccessExpression */: + return visitElementAccessExpression(node); + case 164 /* ComputedPropertyName */: + return visitComputedPropertyName(node); + case 171 /* MethodDeclaration */: + case 175 /* SetAccessor */: + case 174 /* GetAccessor */: + case 215 /* FunctionExpression */: + case 259 /* FunctionDeclaration */: { + enterOther(); + const result = visitEachChild(node, fallbackVisitor, context); + exitOther(); + return result; + } + default: + return visitEachChild(node, fallbackVisitor, context); + } + } + function fallbackVisitor(node) { + switch (node.kind) { + case 167 /* Decorator */: + return void 0; + default: + return visitor(node); + } + } + function modifierVisitor(node) { + switch (node.kind) { + case 167 /* Decorator */: + return void 0; + default: + return node; + } + } + function classElementVisitor(node) { + switch (node.kind) { + case 173 /* Constructor */: + return visitConstructorDeclaration(node); + case 171 /* MethodDeclaration */: + return visitMethodDeclaration(node); + case 174 /* GetAccessor */: + return visitGetAccessorDeclaration(node); + case 175 /* SetAccessor */: + return visitSetAccessorDeclaration(node); + case 169 /* PropertyDeclaration */: + return visitPropertyDeclaration(node); + case 172 /* ClassStaticBlockDeclaration */: + return visitClassStaticBlockDeclaration(node); + default: + return visitor(node); + } + } + function namedEvaluationVisitor(node, referencedName) { + switch (node.kind) { + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 228 /* ClassExpression */: + return visitClassExpression(node, referencedName); + default: + return visitor(node); + } + } + function discardedValueVisitor(node) { + switch (node.kind) { + case 221 /* PrefixUnaryExpression */: + case 222 /* PostfixUnaryExpression */: + return visitPreOrPostfixUnaryExpression( + node, + /*discarded*/ + true + ); + case 223 /* BinaryExpression */: + return visitBinaryExpression( + node, + /*discarded*/ + true + ); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ + true + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + true, + /*referencedName*/ + void 0 + ); + default: + return visitor(node); + } + } + function getHelperVariableName(node) { + let declarationName = node.name && isIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name) : node.name && isPrivateIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name).slice(1) : node.name && isStringLiteral(node.name) && isIdentifierText(node.name.text, 99 /* ESNext */) ? node.name.text : isClassLike(node) ? "class" : "member"; + if (isGetAccessor(node)) + declarationName = `get_${declarationName}`; + if (isSetAccessor(node)) + declarationName = `set_${declarationName}`; + if (node.name && isPrivateIdentifier(node.name)) + declarationName = `private_${declarationName}`; + if (isStatic(node)) + declarationName = `static_${declarationName}`; + return "_" + declarationName; + } + function createHelperVariable(node, suffix) { + return factory2.createUniqueName(`${getHelperVariableName(node)}_${suffix}`, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */); + } + function createLet(name, initializer) { + return factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ) + ], 1 /* Let */) + ); + } + function createClassInfo(node) { + let instanceExtraInitializersName; + let staticExtraInitializersName; + let hasStaticInitializers = false; + let hasNonAmbientInstanceFields = false; + let hasStaticPrivateClassElements = false; + for (const member of node.members) { + if (isNamedClassElement(member) && nodeOrChildIsDecorated( + /*legacyDecorators*/ + false, + member, + node + )) { + if (hasStaticModifier(member)) { + staticExtraInitializersName != null ? staticExtraInitializersName : staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */); + } else { + instanceExtraInitializersName != null ? instanceExtraInitializersName : instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */); + } + } + if (isClassStaticBlockDeclaration(member)) { + hasStaticInitializers = true; + } else if (isPropertyDeclaration(member)) { + if (hasStaticModifier(member)) { + hasStaticInitializers || (hasStaticInitializers = !!member.initializer || hasDecorators(member)); + } else { + hasNonAmbientInstanceFields || (hasNonAmbientInstanceFields = !isAmbientPropertyDeclaration(member)); + } + } + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + hasStaticPrivateClassElements = true; + } + if (staticExtraInitializersName && instanceExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) { + break; + } + } + return { + class: node, + instanceExtraInitializersName, + staticExtraInitializersName, + hasStaticInitializers, + hasNonAmbientInstanceFields, + hasStaticPrivateClassElements + }; + } + function containsLexicalSuperInStaticInitializer(node) { + for (const member of node.members) { + if (isClassStaticBlockDeclaration(member) || isPropertyDeclaration(member) && hasStaticModifier(member)) { + if (member.transformFlags & 134217728 /* ContainsLexicalSuper */) { + return true; + } + } + } + return false; + } + function transformClassLike(node, className) { + var _a2, _b, _c, _d, _e; + startLexicalEnvironment(); + const classReference = (_a2 = node.name) != null ? _a2 : factory2.getGeneratedNameForNode(node); + const classInfo2 = createClassInfo(node); + const classDefinitionStatements = []; + let leadingBlockStatements; + let trailingBlockStatements; + let syntheticConstructor; + let heritageClauses; + let shouldTransformPrivateStaticElementsInClass = false; + const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(node)); + if (classDecorators) { + classInfo2.classDecoratorsName = factory2.createUniqueName("_classDecorators", 16 /* Optimistic */); + classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */); + classInfo2.classExtraInitializersName = factory2.createUniqueName("_classExtraInitializers", 16 /* Optimistic */); + classInfo2.classThis = factory2.createUniqueName("_classThis", 16 /* Optimistic */); + classDefinitionStatements.push( + createLet(classInfo2.classDecoratorsName, factory2.createArrayLiteralExpression(classDecorators)), + createLet(classInfo2.classDescriptorName), + createLet(classInfo2.classExtraInitializersName, factory2.createArrayLiteralExpression()), + createLet(classInfo2.classThis) + ); + if (classInfo2.hasStaticPrivateClassElements) { + shouldTransformPrivateStaticElementsInClass = true; + shouldTransformPrivateStaticElementsInFile = true; + } + } + if (classDecorators && containsLexicalSuperInStaticInitializer(node)) { + const extendsClause = getHeritageClause(node.heritageClauses, 94 /* ExtendsKeyword */); + const extendsElement = extendsClause && firstOrUndefined(extendsClause.types); + const extendsExpression = extendsElement && visitNode(extendsElement.expression, visitor, isExpression); + if (extendsExpression) { + classInfo2.classSuper = factory2.createUniqueName("_classSuper", 16 /* Optimistic */); + const unwrapped = skipOuterExpressions(extendsExpression); + const safeExtendsExpression = isClassExpression(unwrapped) && !unwrapped.name || isFunctionExpression(unwrapped) && !unwrapped.name || isArrowFunction(unwrapped) ? factory2.createComma(factory2.createNumericLiteral(0), extendsExpression) : extendsExpression; + classDefinitionStatements.push(createLet(classInfo2.classSuper, safeExtendsExpression)); + const updatedExtendsElement = factory2.updateExpressionWithTypeArguments( + extendsElement, + classInfo2.classSuper, + /*typeArguments*/ + void 0 + ); + const updatedExtendsClause = factory2.updateHeritageClause(extendsClause, [updatedExtendsElement]); + heritageClauses = factory2.createNodeArray([updatedExtendsClause]); + } + } else { + heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + } + const renamedClassThis = (_b = classInfo2.classThis) != null ? _b : factory2.createThis(); + const needsSetNameHelper = !((_c = getOriginalNode(node, isClassLike)) == null ? void 0 : _c.name) && (classDecorators || !isStringLiteral(className) || !isEmptyStringLiteral(className)); + if (needsSetNameHelper) { + const setNameExpr = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), className); + leadingBlockStatements = append(leadingBlockStatements, factory2.createExpressionStatement(setNameExpr)); + } + enterClass(classInfo2); + let members = visitNodes2(node.members, classElementVisitor, isClassElement); + if (pendingExpressions) { + let outerThis; + for (let expression of pendingExpressions) { + expression = visitNode(expression, function thisVisitor(node2) { + if (!(node2.transformFlags & 16384 /* ContainsLexicalThis */)) { + return node2; + } + switch (node2.kind) { + case 108 /* ThisKeyword */: + if (!outerThis) { + outerThis = factory2.createUniqueName("_outerThis", 16 /* Optimistic */); + classDefinitionStatements.unshift(createLet(outerThis, factory2.createThis())); + } + return outerThis; + default: + return visitEachChild(node2, thisVisitor, context); + } + }, isExpression); + const statement = factory2.createExpressionStatement(expression); + leadingBlockStatements = append(leadingBlockStatements, statement); + } + pendingExpressions = void 0; + } + exitClass(); + if (classInfo2.instanceExtraInitializersName && !getFirstConstructorWithBody(node)) { + const initializerStatements = prepareConstructor(node, classInfo2); + if (initializerStatements) { + const extendsClauseElement = getEffectiveBaseTypeNode(node); + const isDerivedClass = !!(extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */); + const constructorStatements = []; + if (isDerivedClass) { + const spreadArguments = factory2.createSpreadElement(factory2.createIdentifier("arguments")); + const superCall = factory2.createCallExpression( + factory2.createSuper(), + /*typeArguments*/ + void 0, + [spreadArguments] + ); + constructorStatements.push(factory2.createExpressionStatement(superCall)); + } + addRange(constructorStatements, initializerStatements); + const constructorBody = factory2.createBlock( + constructorStatements, + /*multiLine*/ + true + ); + syntheticConstructor = factory2.createConstructorDeclaration( + /*modifiers*/ + void 0, + [], + constructorBody + ); + } + } + if (classInfo2.staticExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.staticExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.instanceExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.instanceExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (!isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticFieldDecorationStatements); + if (classInfo2.classDescriptorName && classInfo2.classDecoratorsName && classInfo2.classExtraInitializersName && classInfo2.classThis) { + leadingBlockStatements != null ? leadingBlockStatements : leadingBlockStatements = []; + const valueProperty = factory2.createPropertyAssignment("value", factory2.createThis()); + const classDescriptor = factory2.createObjectLiteralExpression([valueProperty]); + const classDescriptorAssignment = factory2.createAssignment(classInfo2.classDescriptorName, classDescriptor); + const classNameReference = factory2.createPropertyAccessExpression(factory2.createThis(), "name"); + const esDecorateHelper2 = emitHelpers().createESDecorateHelper( + factory2.createNull(), + classDescriptorAssignment, + classInfo2.classDecoratorsName, + { kind: "class", name: classNameReference }, + factory2.createNull(), + classInfo2.classExtraInitializersName + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateHelper2); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(node)); + leadingBlockStatements.push(esDecorateStatement); + const classDescriptorValueReference = factory2.createPropertyAccessExpression(classInfo2.classDescriptorName, "value"); + const classThisAssignment = factory2.createAssignment(classInfo2.classThis, classDescriptorValueReference); + const classReferenceAssignment = factory2.createAssignment(classReference, classThisAssignment); + leadingBlockStatements.push(factory2.createExpressionStatement(classReferenceAssignment)); + } + if (classInfo2.staticExtraInitializersName) { + const runStaticInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.staticExtraInitializersName); + const runStaticInitializersStatement = factory2.createExpressionStatement(runStaticInitializersHelper); + setSourceMapRange(runStaticInitializersStatement, (_d = node.name) != null ? _d : moveRangePastDecorators(node)); + leadingBlockStatements = append(leadingBlockStatements, runStaticInitializersStatement); + } + if (classInfo2.classExtraInitializersName) { + const runClassInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.classExtraInitializersName); + const runClassInitializersStatement = factory2.createExpressionStatement(runClassInitializersHelper); + setSourceMapRange(runClassInitializersStatement, (_e = node.name) != null ? _e : moveRangePastDecorators(node)); + trailingBlockStatements = append(trailingBlockStatements, runClassInitializersStatement); + } + if (leadingBlockStatements && trailingBlockStatements && !classInfo2.hasStaticInitializers) { + addRange(leadingBlockStatements, trailingBlockStatements); + trailingBlockStatements = void 0; + } + let newMembers = members; + if (leadingBlockStatements) { + const leadingStaticBlockBody = factory2.createBlock( + leadingBlockStatements, + /*multiline*/ + true + ); + const leadingStaticBlock = factory2.createClassStaticBlockDeclaration(leadingStaticBlockBody); + if (shouldTransformPrivateStaticElementsInClass) { + setInternalEmitFlags(leadingStaticBlock, 32 /* TransformPrivateStaticElements */); + } + newMembers = [leadingStaticBlock, ...newMembers]; + } + if (syntheticConstructor) { + newMembers = [...newMembers, syntheticConstructor]; + } + if (trailingBlockStatements) { + const trailingStaticBlockBody = factory2.createBlock( + trailingBlockStatements, + /*multiline*/ + true + ); + const trailingStaticBlock = factory2.createClassStaticBlockDeclaration(trailingStaticBlockBody); + newMembers = [...newMembers, trailingStaticBlock]; + } + if (newMembers !== members) { + members = setTextRange(factory2.createNodeArray(newMembers), members); + } + const lexicalEnvironment = endLexicalEnvironment(); + let classExpression; + if (classDecorators) { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + const classReferenceDeclaration = factory2.createVariableDeclaration( + classReference, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + classExpression + ); + const classReferenceVarDeclList = factory2.createVariableDeclarationList([classReferenceDeclaration]); + const returnExpr = classInfo2.classThis ? factory2.createAssignment(classReference, classInfo2.classThis) : classReference; + classDefinitionStatements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + classReferenceVarDeclList + ), + factory2.createReturnStatement(returnExpr) + ); + } else { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + classDefinitionStatements.push(factory2.createReturnStatement(classExpression)); + } + if (shouldTransformPrivateStaticElementsInClass) { + addInternalEmitFlags(classExpression, 32 /* TransformPrivateStaticElements */); + for (const member of classExpression.members) { + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + addInternalEmitFlags(member, 32 /* TransformPrivateStaticElements */); + } + } + } + setOriginalNode(classExpression, node); + getOrCreateEmitNode(classExpression).classThis = classInfo2.classThis; + return factory2.createImmediatelyInvokedArrowFunction(factory2.mergeLexicalEnvironment(classDefinitionStatements, lexicalEnvironment)); + } + function isDecoratedClassLike(node) { + return classOrConstructorParameterIsDecorated( + /*legacyDecorators*/ + false, + node + ) || childIsDecorated( + /*legacyDecorators*/ + false, + node + ); + } + function visitClassDeclaration(node) { + var _a2; + if (isDecoratedClassLike(node)) { + if (hasSyntacticModifier(node, 1 /* Export */) && hasSyntacticModifier(node, 1024 /* Default */)) { + const originalClass = (_a2 = getOriginalNode(node, isClassLike)) != null ? _a2 : node; + const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default"); + const iife = transformClassLike(node, className); + const statement = factory2.createExportDefault(iife); + setOriginalNode(statement, node); + setCommentRange(statement, getCommentRange(node)); + setSourceMapRange(statement, moveRangePastDecorators(node)); + return statement; + } else { + Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name."); + const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name)); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const varDecl = factory2.createVariableDeclaration( + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + const varDecls = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); + const statement = factory2.createVariableStatement(modifiers, varDecls); + setOriginalNode(statement, node); + setCommentRange(statement, getCommentRange(node)); + return statement; + } + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassDeclaration( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function visitClassExpression(node, referencedName) { + if (isDecoratedClassLike(node)) { + const className = node.name ? factory2.createStringLiteralFromNode(node.name) : referencedName != null ? referencedName : factory2.createStringLiteral(""); + const iife = transformClassLike(node, className); + setOriginalNode(iife, node); + return iife; + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassExpression( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function prepareConstructor(_parent, classInfo2) { + if (classInfo2.instanceExtraInitializersName && !classInfo2.hasNonAmbientInstanceFields) { + const statements = []; + statements.push( + factory2.createExpressionStatement( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + classInfo2.instanceExtraInitializersName + ) + ) + ); + return statements; + } + } + function visitConstructorDeclaration(node) { + enterClassElement(node); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const parameters = visitNodes2(node.parameters, visitor, isParameter); + let body; + if (node.body && classInfo) { + const initializerStatements = prepareConstructor(classInfo.class, classInfo); + if (initializerStatements) { + const statements = []; + const nonPrologueStart = factory2.copyPrologue( + node.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart)); + body = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + setOriginalNode(body, node.body); + setTextRange(body, node.body); + } + } + body != null ? body : body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return factory2.updateConstructorDeclaration(node, modifiers, parameters, body); + } + function finishClassElement(updated, original) { + if (updated !== original) { + setCommentRange(updated, original); + setSourceMapRange(updated, moveRangePastDecorators(original)); + } + return updated; + } + function partialTransformClassElement(member, useNamedEvaluation, classInfo2, createDescriptor) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let referencedName; + let name; + let initializersName; + let thisArg; + let descriptorName; + if (!classInfo2) { + const modifiers2 = visitNodes2(member.modifiers, modifierVisitor, isModifier); + enterName(); + if (useNamedEvaluation) { + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + } else { + name = visitPropertyName(member.name); + } + exitName(); + return { modifiers: modifiers2, referencedName, name, initializersName, descriptorName, thisArg }; + } + const memberDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClassElement( + member, + classInfo2.class, + /*useLegacyDecorators*/ + false + )); + const modifiers = visitNodes2(member.modifiers, modifierVisitor, isModifier); + if (memberDecorators) { + const memberDecoratorsName = createHelperVariable(member, "decorators"); + const memberDecoratorsArray = factory2.createArrayLiteralExpression(memberDecorators); + const memberDecoratorsAssignment = factory2.createAssignment(memberDecoratorsName, memberDecoratorsArray); + const memberInfo = { memberDecoratorsName }; + (_a2 = classInfo2.memberInfos) != null ? _a2 : classInfo2.memberInfos = /* @__PURE__ */ new Map(); + classInfo2.memberInfos.set(member, memberInfo); + pendingExpressions != null ? pendingExpressions : pendingExpressions = []; + pendingExpressions.push(memberDecoratorsAssignment); + const statements = isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? (_b = classInfo2.staticNonFieldDecorationStatements) != null ? _b : classInfo2.staticNonFieldDecorationStatements = [] : (_c = classInfo2.nonStaticNonFieldDecorationStatements) != null ? _c : classInfo2.nonStaticNonFieldDecorationStatements = [] : isPropertyDeclaration(member) && !isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? (_d = classInfo2.staticFieldDecorationStatements) != null ? _d : classInfo2.staticFieldDecorationStatements = [] : (_e = classInfo2.nonStaticFieldDecorationStatements) != null ? _e : classInfo2.nonStaticFieldDecorationStatements = [] : Debug.fail(); + const kind = isGetAccessorDeclaration(member) ? "getter" : isSetAccessorDeclaration(member) ? "setter" : isMethodDeclaration(member) ? "method" : isAutoAccessorPropertyDeclaration(member) ? "accessor" : isPropertyDeclaration(member) ? "field" : Debug.fail(); + let propertyName; + if (isIdentifier(member.name) || isPrivateIdentifier(member.name)) { + propertyName = { computed: false, name: member.name }; + } else if (isPropertyNameLiteral(member.name)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(member.name) }; + } else { + const expression = member.name.expression; + if (isPropertyNameLiteral(expression) && !isIdentifier(expression)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(expression) }; + } else { + enterName(); + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + propertyName = { computed: true, name: referencedName }; + exitName(); + } + } + const context2 = { + kind, + name: propertyName, + static: isStatic(member), + private: isPrivateIdentifier(member.name), + access: { + // 15.7.3 CreateDecoratorAccessObject (kind, name) + // 2. If _kind_ is ~field~, ~method~, ~accessor~, or ~getter~, then ... + get: isPropertyDeclaration(member) || isGetAccessorDeclaration(member) || isMethodDeclaration(member), + // 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ... + set: isPropertyDeclaration(member) || isSetAccessorDeclaration(member) + } + }; + const extraInitializers = isStatic(member) ? (_f = classInfo2.staticExtraInitializersName) != null ? _f : classInfo2.staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */) : (_g = classInfo2.instanceExtraInitializersName) != null ? _g : classInfo2.instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */); + if (isMethodOrAccessor(member)) { + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && createDescriptor) { + descriptor = createDescriptor(member, visitNodes2(modifiers, (node) => tryCast(node, isAsyncModifier), isModifier)); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper(factory2.createThis(), descriptor != null ? descriptor : factory2.createNull(), memberDecoratorsName, context2, factory2.createNull(), extraInitializers); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } else if (isPropertyDeclaration(member)) { + initializersName = (_h = memberInfo.memberInitializersName) != null ? _h : memberInfo.memberInitializersName = createHelperVariable(member, "initializers"); + if (isStatic(member)) { + thisArg = classInfo2.classThis; + } + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && hasAccessorModifier(member) && createDescriptor) { + descriptor = createDescriptor( + member, + /*modifiers*/ + void 0 + ); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper( + isAutoAccessorPropertyDeclaration(member) ? factory2.createThis() : factory2.createNull(), + descriptor != null ? descriptor : factory2.createNull(), + memberDecoratorsName, + context2, + initializersName, + extraInitializers + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } + } + if (name === void 0) { + enterName(); + if (useNamedEvaluation) { + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + } else { + name = visitPropertyName(member.name); + } + exitName(); + } + if (!some(modifiers) && (isMethodDeclaration(member) || isPropertyDeclaration(member))) { + setEmitFlags(name, 1024 /* NoLeadingComments */); + } + return { modifiers, referencedName, name, initializersName, descriptorName, thisArg }; + } + function visitMethodDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createMethodDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createMethodDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateMethodDeclaration( + node, + modifiers, + node.asteriskToken, + name, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitGetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createGetAccessorDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createGetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateGetAccessorDeclaration( + node, + modifiers, + name, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitSetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createSetAccessorDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createSetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateSetAccessorDeclaration(node, modifiers, name, parameters, body), node); + } + } + function visitClassStaticBlockDeclaration(node) { + enterClassElement(node); + if (classInfo) + classInfo.hasStaticInitializers = true; + const result = visitEachChild(node, visitor, context); + exitClassElement(); + return result; + } + function visitPropertyDeclaration(node) { + enterClassElement(node); + Debug.assert(!isAmbientPropertyDeclaration(node), "Not yet implemented."); + const useNamedEvaluation = isNamedEvaluation(node, isAnonymousClassNeedingAssignedName); + const { modifiers, name, referencedName, initializersName, descriptorName, thisArg } = partialTransformClassElement(node, useNamedEvaluation, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0); + startLexicalEnvironment(); + let initializer = referencedName ? visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression) : visitNode(node.initializer, visitor, isExpression); + if (initializersName) { + initializer = emitHelpers().createRunInitializersHelper( + thisArg != null ? thisArg : factory2.createThis(), + initializersName, + initializer != null ? initializer : factory2.createVoidZero() + ); + } + if (!isStatic(node) && (classInfo == null ? void 0 : classInfo.instanceExtraInitializersName) && !(classInfo == null ? void 0 : classInfo.hasInjectedInstanceInitializers)) { + classInfo.hasInjectedInstanceInitializers = true; + initializer != null ? initializer : initializer = factory2.createVoidZero(); + initializer = factory2.createParenthesizedExpression(factory2.createComma( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + classInfo.instanceExtraInitializersName + ), + initializer + )); + } + if (isStatic(node) && classInfo && initializer) { + classInfo.hasStaticInitializers = true; + } + const declarations = endLexicalEnvironment(); + if (some(declarations)) { + initializer = factory2.createImmediatelyInvokedArrowFunction([ + ...declarations, + factory2.createReturnStatement(initializer) + ]); + } + exitClassElement(); + if (hasAccessorModifier(node) && descriptorName) { + const commentRange = getCommentRange(node); + const sourceMapRange = getSourceMapRange(node); + const name2 = node.name; + let getterName = name2; + let setterName = name2; + if (isComputedPropertyName(name2) && !isSimpleInlineableExpression(name2.expression)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name2); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name2, visitNode(name2.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name2, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name2.expression); + const expression = visitNode(name2.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name2.expression); + getterName = factory2.updateComputedPropertyName(name2, assignment); + setterName = factory2.updateComputedPropertyName(name2, temp); + } + } + const modifiersWithoutAccessor = visitNodes2(modifiers, (node2) => node2.kind !== 127 /* AccessorKeyword */ ? node2 : void 0, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiersWithoutAccessor, initializer); + setOriginalNode(backingField, node); + setEmitFlags(backingField, 3072 /* NoComments */); + setSourceMapRange(backingField, sourceMapRange); + setSourceMapRange(backingField.name, node.name); + const getter = createGetAccessorDescriptorForwarder(modifiersWithoutAccessor, getterName, descriptorName); + setOriginalNode(getter, node); + setCommentRange(getter, commentRange); + setSourceMapRange(getter, sourceMapRange); + const setter = createSetAccessorDescriptorForwarder(modifiersWithoutAccessor, setterName, descriptorName); + setOriginalNode(setter, node); + setEmitFlags(setter, 3072 /* NoComments */); + setSourceMapRange(setter, sourceMapRange); + return [backingField, getter, setter]; + } + return finishClassElement(factory2.updatePropertyDeclaration( + node, + modifiers, + name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node); + } + function visitThisExpression(node) { + return classThis != null ? classThis : node; + } + function visitCallExpression(node) { + if (isSuperProperty(node.expression) && classThis) { + const expression = visitNode(node.expression, visitor, isExpression); + const argumentsList = visitNodes2(node.arguments, visitor, isExpression); + const invocation = factory2.createFunctionCallCall(expression, classThis, argumentsList); + setOriginalNode(invocation, node); + setTextRange(invocation, node); + return invocation; + } + return visitEachChild(node, visitor, context); + } + function visitTaggedTemplateExpression(node) { + if (isSuperProperty(node.tag) && classThis) { + const tag = visitNode(node.tag, visitor, isExpression); + const boundTag = factory2.createFunctionBindCall(tag, classThis, []); + setOriginalNode(boundTag, node); + setTextRange(boundTag, node); + const template = visitNode(node.template, visitor, isTemplateLiteral); + return factory2.updateTaggedTemplateExpression( + node, + boundTag, + /*typeArguments*/ + void 0, + template + ); + } + return visitEachChild(node, visitor, context); + } + function visitPropertyAccessExpression(node) { + if (isSuperProperty(node) && isIdentifier(node.name) && classThis && classSuper) { + const propertyName = factory2.createStringLiteralFromNode(node.name); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context); + } + function visitElementAccessExpression(node) { + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = visitNode(node.argumentExpression, visitor, isExpression); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context); + } + function visitParameterDeclaration(node) { + let updated; + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } else { + updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + visitNode(node.name, visitor, isBindingName), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + } + if (updated !== node) { + setCommentRange(updated, node); + setTextRange(updated, moveRangePastModifiers(node)); + setSourceMapRange(updated, moveRangePastModifiers(node)); + setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */); + } + return updated; + } + function isAnonymousClassNeedingAssignedName(node) { + return isClassExpression(node) && !node.name && isDecoratedClassLike(node); + } + function visitForStatement(node) { + return factory2.updateForStatement( + node, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, discardedValueVisitor, isExpression), + visitIterationBody(node.statement, visitor, context) + ); + } + function visitExpressionStatement(node) { + return visitEachChild(node, discardedValueVisitor, context); + } + function visitBinaryExpression(node, discarded) { + if (isDestructuringAssignment(node)) { + const left = visitAssignmentPattern(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression(node)) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isSuperProperty(node.left) && classThis && classSuper) { + let setterName = isElementAccessExpression(node.left) ? visitNode(node.left.argumentExpression, visitor, isExpression) : isIdentifier(node.left.name) ? factory2.createStringLiteralFromNode(node.left.name) : void 0; + if (setterName) { + let expression = visitNode(node.right, visitor, isExpression); + if (isCompoundAssignment(node.operatorToken.kind)) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + const superPropertyGet = factory2.createReflectGetCall( + classSuper, + getterName, + classThis + ); + setOriginalNode(superPropertyGet, node.left); + setTextRange(superPropertyGet, node.left); + expression = factory2.createBinaryExpression( + superPropertyGet, + getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), + expression + ); + setTextRange(expression, node); + } + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + if (temp) { + expression = factory2.createAssignment(temp, expression); + setTextRange(temp, node); + } + expression = factory2.createReflectSetCall( + classSuper, + setterName, + expression, + classThis + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + if (node.operatorToken.kind === 27 /* CommaToken */) { + const left = visitNode(node.left, discardedValueVisitor, isExpression); + const right = visitNode(node.right, discarded ? discardedValueVisitor : visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitEachChild(node, visitor, context); + } + function visitPreOrPostfixUnaryExpression(node, discarded) { + if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { + const operand = skipParentheses(node.operand); + if (isSuperProperty(operand) && classThis && classSuper) { + let setterName = isElementAccessExpression(operand) ? visitNode(operand.argumentExpression, visitor, isExpression) : isIdentifier(operand.name) ? factory2.createStringLiteralFromNode(operand.name) : void 0; + if (setterName) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + let expression = factory2.createReflectGetCall(classSuper, getterName, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); + expression = factory2.createReflectSetCall(classSuper, setterName, expression, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + return visitEachChild(node, visitor, context); + } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + const referencedName = factory2.getGeneratedNameForNode(node); + hoistVariableDeclaration(referencedName); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name }; + } + function visitPropertyName(node) { + if (isComputedPropertyName(node)) { + return visitComputedPropertyName(node); + } + return visitNode(node, visitor, isPropertyName); + } + function visitComputedPropertyName(node) { + let expression = visitNode(node.expression, visitor, isExpression); + if (!isSimpleInlineableExpression(expression)) { + expression = injectPendingExpressions(expression); + } + return factory2.updateComputedPropertyName(node, expression); + } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updatePropertyAssignment(node, name, initializer); + } + return visitEachChild(node, visitor, context); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateVariableDeclaration( + node, + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const propertyName = visitNode(node.propertyName, visitor, isPropertyName); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBindingElement( + node, + /*dotDotDotToken*/ + void 0, + propertyName, + name, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (propertyName) { + const paramName = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const expression = factory2.createAssignmentTargetWrapper( + paramName, + factory2.createReflectSetCall( + classSuper, + propertyName, + paramName, + classThis + ) + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + return expression; + } + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentElement(node) { + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentTarget = visitDestructuringAssignmentTarget(node.left); + let initializer; + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + initializer = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + } else { + initializer = visitNode(node.right, visitor, isExpression); + } + return factory2.updateBinaryExpression(node, assignmentTarget, node.operatorToken, initializer); + } else { + return visitDestructuringAssignmentTarget(node); + } + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentProperty(node) { + const name = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + return visitEachChild(node, visitor, context); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); + const name = visitNode(node.name, visitor, isIdentifier); + const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer); + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + const elements = visitNodes2(node.elements, visitArrayAssignmentElement, isExpression); + return factory2.updateArrayLiteralExpression(node, elements); + } else { + const properties = visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike); + return factory2.updateObjectLiteralExpression(node, properties); + } + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const referencedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updateExportAssignment(node, modifiers, expression); + } + return visitEachChild(node, visitor, context); + } + function visitParenthesizedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function visitPartiallyEmittedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function injectPendingExpressions(expression) { + if (some(pendingExpressions)) { + if (isParenthesizedExpression(expression)) { + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); + } else { + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); + } + pendingExpressions = void 0; + } + return expression; + } + function transformAllDecoratorsOfDeclaration(allDecorators) { + if (!allDecorators) { + return void 0; + } + const decoratorExpressions = []; + addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); + return decoratorExpressions; + } + function transformDecorator(decorator) { + const expression = visitNode(decorator.expression, visitor, isExpression); + setEmitFlags(expression, 3072 /* NoComments */); + return expression; + } + function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) { + const func = factory2.createFunctionExpression( + modifiers, + asteriskToken, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body != null ? body : factory2.createBlock([]) + ); + setOriginalNode(func, original); + setSourceMapRange(func, moveRangePastDecorators(original)); + setEmitFlags(func, 3072 /* NoComments */); + const prefix = kind === "get" || kind === "set" ? kind : void 0; + const functionName = factory2.createStringLiteralFromNode( + name, + /*isSingleQuote*/ + void 0 + ); + const namedFunction = emitHelpers().createSetFunctionNameHelper(func, functionName, prefix); + const method = factory2.createPropertyAssignment(factory2.createIdentifier(kind), namedFunction); + setOriginalNode(method, original); + setSourceMapRange(method, moveRangePastDecorators(original)); + setEmitFlags(method, 3072 /* NoComments */); + return method; + } + function createMethodDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + node.asteriskToken, + "value", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createGetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createSetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createAccessorPropertyDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ) + ) + ]) + ), + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ), + factory2.createIdentifier("value") + ) + ) + ]) + ) + ]); + } + function createMethodDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("value") + ) + ) + ]) + ); + } + function createGetAccessorDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("get") + ), + factory2.createThis(), + [] + ) + ) + ]) + ); + } + function createSetAccessorDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createSetAccessorDeclaration( + modifiers, + name, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("set") + ), + factory2.createThis(), + [factory2.createIdentifier("value")] + ) + ) + ]) + ); + } + function getAssignedNameOfIdentifier(name, initializer) { + const originalClass = getOriginalNode(initializer, isClassLike); + return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); + } +} + // src/compiler/transformers/es2017.ts function transformES2017(context) { const { @@ -93243,21 +96246,21 @@ function transformES2017(context) { node.initializer, /*hasReceiver*/ true - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), visitIterationBody(node.statement, asyncBodyVisitor, context) ); } function visitForOfStatementInAsyncBody(node) { return factory2.updateForOfStatement( node, - visitNode(node.awaitModifier, visitor, isToken), + visitNode(node.awaitModifier, visitor, isAwaitKeyword), isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( node.initializer, /*hasReceiver*/ true - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), visitIterationBody(node.statement, asyncBodyVisitor, context) ); } @@ -93294,7 +96297,7 @@ function transformES2017(context) { function visitConstructorDeclaration(node) { return factory2.updateConstructorDeclaration( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), visitParameterList(node.parameters, visitor, context), transformMethodBody(node) ); @@ -93352,7 +96355,7 @@ function transformES2017(context) { function visitFunctionExpression(node) { return factory2.updateFunctionExpression( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), node.asteriskToken, node.name, /*typeParameters*/ @@ -93366,7 +96369,7 @@ function transformES2017(context) { function visitArrowFunction(node) { return factory2.updateArrowFunction( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), /*typeParameters*/ void 0, visitParameterList(node.parameters, visitor, context), @@ -93423,7 +96426,7 @@ function transformES2017(context) { ), node ); - return visitNode(converted, visitor, isExpression); + return Debug.checkDefined(visitNode(converted, visitor, isExpression)); } function collidesWithParameterName({ name }) { if (isIdentifier(name)) { @@ -93555,7 +96558,7 @@ function transformES2017(context) { if (isBlock(body)) { return factory2.updateBlock(body, visitNodes2(body.statements, asyncBodyVisitor, isStatement, start2)); } else { - return factory2.converters.convertToFunctionBlock(visitNode(body, asyncBodyVisitor, isConciseBody)); + return factory2.converters.convertToFunctionBlock(Debug.checkDefined(visitNode(body, asyncBodyVisitor, isConciseBody))); } } function getPromiseConstructor(type) { @@ -93910,7 +96913,7 @@ function transformES2018(context) { return visitObjectLiteralExpression(node); case 223 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 295 /* CatchClause */: return visitCatchClause(node); @@ -94668,7 +97671,7 @@ function transformES2018(context) { /*questionToken*/ void 0, visitor, - isToken + isQuestionToken ), /*typeParameters*/ void 0, @@ -95342,15 +98345,10 @@ function transformES2021(context) { if ((node.transformFlags & 16 /* ContainsES2021 */) === 0) { return node; } - switch (node.kind) { - case 223 /* BinaryExpression */: - const binaryExpression = node; - if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { - return transformLogicalAssignment(binaryExpression); - } - default: - return visitEachChild(node, visitor, context); + if (isLogicalOrCoalescingAssignmentExpression(node)) { + return transformLogicalAssignment(node); } + return visitEachChild(node, visitor, context); } function transformLogicalAssignment(binaryExpression) { const operator = binaryExpression.operatorToken; @@ -95480,7 +98478,7 @@ function transformJsx(context) { factory2.createIdentifier(name), generatedName ); - generatedName.generatedImportReference = specifier; + setIdentifierGeneratedImportReference(generatedName, specifier); specifierSourceImports.set(name, specifier); return generatedName; } @@ -95796,7 +98794,7 @@ function transformJsx(context) { return element; } function transformJsxSpreadAttributeToSpreadAssignment(node) { - return factory2.createSpreadAssignment(visitNode(node.expression, visitor, isExpression)); + return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); } function transformJsxAttributesToObjectProps(attrs, children) { const target = getEmitScriptTarget(compilerOptions); @@ -95826,7 +98824,7 @@ function transformJsx(context) { return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions); } function transformJsxSpreadAttributeToExpression(node) { - return visitNode(node.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); } function transformJsxAttributeToObjectLiteralElement(node) { const name = getAttributeName(node); @@ -95846,7 +98844,7 @@ function transformJsx(context) { if (node.expression === void 0) { return factory2.createTrue(); } - return visitNode(node.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); } if (isJsxElement(node)) { return visitJsxElement( @@ -96357,7 +99355,7 @@ function transformES2015(context) { node, /*lookInLabeledStatements*/ false - ) && shouldConvertIterationStatement(node) || (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) !== 0; + ) && shouldConvertIterationStatement(node) || (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { return shouldVisitNode(node) ? visitorWorker( @@ -96488,7 +99486,7 @@ function transformES2015(context) { return visitParenthesizedExpression(node, expressionResultIsUnused2); case 223 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -96591,7 +99589,7 @@ function transformES2015(context) { [ factory2.createPropertyAssignment( factory2.createIdentifier("value"), - node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() + node.expression ? Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) : factory2.createVoidZero() ) ] ) @@ -96623,7 +99621,7 @@ function transformES2015(context) { return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments")); } } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { return setOriginalNode(setTextRange( factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)), node @@ -96762,7 +99760,7 @@ function transformES2015(context) { outer, /*typeArguments*/ void 0, - extendsClauseElement ? [visitNode(extendsClauseElement.expression, visitor, isExpression)] : [] + extendsClauseElement ? [Debug.checkDefined(visitNode(extendsClauseElement.expression, visitor, isExpression))] : [] ) ); addSyntheticLeadingComment(result, 3 /* MultiLineCommentTrivia */, "* @class "); @@ -97104,7 +100102,7 @@ function transformES2015(context) { factory2.createExpressionStatement( factory2.createAssignment( factory2.getGeneratedNameForNode(parameter), - visitNode(initializer, visitor, isExpression) + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) ) ), 2097152 /* CustomPrologue */ @@ -97115,7 +100113,7 @@ function transformES2015(context) { return false; } function insertDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { - initializer = visitNode(initializer, visitor, isExpression); + initializer = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); const statement = factory2.createIfStatement( factory2.createTypeCheck(factory2.cloneNode(name), "undefined"), setEmitFlags( @@ -97391,6 +100389,7 @@ function transformES2015(context) { container ); const propertyName = visitNode(member.name, visitor, isPropertyName); + Debug.assert(propertyName); let e; if (!isPrivateIdentifier(propertyName) && getUseDefineForClassFields(context.getCompilerOptions())) { const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; @@ -97434,6 +100433,7 @@ function transformES2015(context) { setEmitFlags(target, 3072 /* NoComments */ | 64 /* NoTrailingSourceMap */); setSourceMapRange(target, firstAccessor.name); const visitedAccessorName = visitNode(firstAccessor.name, visitor, isPropertyName); + Debug.assert(visitedAccessorName); if (isPrivateIdentifier(visitedAccessorName)) { return Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015."); } @@ -97706,9 +100706,9 @@ function transformES2015(context) { if (node.operatorToken.kind === 27 /* CommaToken */) { return factory2.updateBinaryExpression( node, - visitNode(node.left, visitorWithUnusedExpressionResult, isExpression), + Debug.checkDefined(visitNode(node.left, visitorWithUnusedExpressionResult, isExpression)), node.operatorToken, - visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression) + Debug.checkDefined(visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -97723,6 +100723,7 @@ function transformES2015(context) { const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression); if (result || visited !== element) { result || (result = node.elements.slice(0, i)); + Debug.assert(visited); result.push(visited); } } @@ -97730,7 +100731,7 @@ function transformES2015(context) { return factory2.updateCommaListExpression(node, elements); } function isVariableStatementOfTypeScriptClassWrapper(node) { - return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getEmitFlags(node.declarationList.declarations[0].initializer) & 67108864 /* TypeScriptClassWrapper */); + return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */); } function visitVariableStatement(node) { const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); @@ -97749,7 +100750,7 @@ function transformES2015(context) { 0 /* All */ ); } else { - assignment = factory2.createBinaryExpression(decl.name, 63 /* EqualsToken */, visitNode(decl.initializer, visitor, isExpression)); + assignment = factory2.createBinaryExpression(decl.name, 63 /* EqualsToken */, Debug.checkDefined(visitNode(decl.initializer, visitor, isExpression))); setTextRange(assignment, decl); } assignments = append(assignments, assignment); @@ -97771,7 +100772,7 @@ function transformES2015(context) { if (node.flags & 3 /* BlockScoped */) { enableSubstitutionsForBlockScopedBindings(); } - const declarations = flatMap(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration); + const declarations = visitNodes2(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration, isVariableDeclaration); const declarationList = factory2.createVariableDeclarationList(declarations); setOriginalNode(declarationList, node); setTextRange(declarationList, node); @@ -97855,7 +100856,7 @@ function transformES2015(context) { statement, /*outermostLabeledStatement*/ node - ) : factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node, convertedLoopState && resetLabel); + ) : factory2.restoreEnclosingLabel(Debug.checkDefined(visitNode(statement, visitor, isStatement, factory2.liftToBlock)), node, convertedLoopState && resetLabel); } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { @@ -97898,7 +100899,7 @@ function transformES2015(context) { visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer), visitNode(node.condition, visitor, isExpression), visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression), - visitNode(node.statement, visitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) ); } function visitForInStatement(node, outermostLabeledStatement) { @@ -97984,13 +100985,14 @@ function transformES2015(context) { ))); } else { setTextRangeEnd(assignment, initializer.end); - statements.push(setTextRange(factory2.createExpressionStatement(visitNode(assignment, visitor, isExpression)), moveRangeEnd(initializer, -1))); + statements.push(setTextRange(factory2.createExpressionStatement(Debug.checkDefined(visitNode(assignment, visitor, isExpression))), moveRangeEnd(initializer, -1))); } } if (convertedLoopBodyStatements) { return createSyntheticBlockForConvertedStatements(addRange(statements, convertedLoopBodyStatements)); } else { const statement = visitNode(node.statement, visitor, isStatement, factory2.liftToBlock); + Debug.assert(statement); if (isBlock(statement)) { return factory2.updateBlock(statement, setTextRange(factory2.createNodeArray(concatenate(statements, statement.statements)), statement.statements)); } else { @@ -98011,6 +101013,7 @@ function transformES2015(context) { } function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const counter = factory2.createLoopVariable(); const rhsReference = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( /*recordTempVariable*/ @@ -98070,6 +101073,7 @@ function transformES2015(context) { } function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const iterator = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( /*recordTempVariable*/ void 0 @@ -98327,7 +101331,7 @@ function transformES2015(context) { loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); } } else { - const clone2 = convertIterationStatementCore(node, initializerFunction, visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)); + const clone2 = convertIterationStatementCore(node, initializerFunction, Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))); loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); } statements.push(loop); @@ -98365,16 +101369,16 @@ function transformES2015(context) { node, /*awaitModifier*/ void 0, - visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } function convertForInStatement(node, convertedLoopBody) { return factory2.updateForInStatement( node, - visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } @@ -98382,13 +101386,13 @@ function transformES2015(context) { return factory2.updateDoStatement( node, convertedLoopBody, - visitNode(node.expression, visitor, isExpression) + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) ); } function convertWhileStatement(node, convertedLoopBody) { return factory2.updateWhileStatement( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } @@ -98550,7 +101554,7 @@ function transformES2015(context) { void 0, /*type*/ void 0, - visitNode( + Debug.checkDefined(visitNode( factory2.createBlock( statements, /*multiLine*/ @@ -98558,7 +101562,7 @@ function transformES2015(context) { ), visitor, isBlock - ) + )) ), emitFlags ) @@ -98581,7 +101585,7 @@ function transformES2015(context) { if (node.incrementor) { statements.push(factory2.createIfStatement( currentState.conditionVariable, - factory2.createExpressionStatement(visitNode(node.incrementor, visitor, isExpression)), + factory2.createExpressionStatement(Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression))), factory2.createExpressionStatement(factory2.createAssignment(currentState.conditionVariable, factory2.createTrue())) )); } else { @@ -98592,11 +101596,12 @@ function transformES2015(context) { } if (shouldConvertConditionOfForStatement(node)) { statements.push(factory2.createIfStatement( - factory2.createPrefixUnaryExpression(53 /* ExclamationToken */, visitNode(node.condition, visitor, isExpression)), - visitNode(factory2.createBreakStatement(), visitor, isStatement) + factory2.createPrefixUnaryExpression(53 /* ExclamationToken */, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))), + Debug.checkDefined(visitNode(factory2.createBreakStatement(), visitor, isStatement)) )); } } + Debug.assert(statement); if (isBlock(statement)) { addRange(statements, statement.statements); } else { @@ -98864,9 +101869,9 @@ function transformES2015(context) { createMemberAccessForPropertyName( factory2, receiver, - visitNode(property.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) ), - visitNode(property.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(property.initializer, visitor, isExpression)) ); setTextRange(expression, property); if (startsOnNewLine) { @@ -98879,7 +101884,7 @@ function transformES2015(context) { createMemberAccessForPropertyName( factory2, receiver, - visitNode(property.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) ), factory2.cloneNode(property.name) ); @@ -98894,7 +101899,7 @@ function transformES2015(context) { createMemberAccessForPropertyName( factory2, receiver, - visitNode(method.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(method.name, visitor, isPropertyName)) ), transformFunctionLikeToExpression( method, @@ -99015,7 +102020,7 @@ function transformES2015(context) { return visitEachChild(node, visitor, context); } function visitCallExpression(node) { - if (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) { + if (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) { return visitTypeScriptClassWrapper(node); } const expression = skipOuterExpressions(node.expression); @@ -99028,7 +102033,7 @@ function transformES2015(context) { } return factory2.updateCallExpression( node, - visitNode(node.expression, callExpressionVisitor, isExpression), + Debug.checkDefined(visitNode(node.expression, callExpressionVisitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -99080,7 +102085,14 @@ function transformES2015(context) { if (classBodyEnd < -1) { addRange(statements, funcStatements, classBodyEnd + 1); } - addRange(statements, remainingStatements); + const returnStatement = tryCast(elementAt(funcStatements, classBodyEnd), isReturnStatement); + for (const statement of remainingStatements) { + if (isReturnStatement(statement) && (returnStatement == null ? void 0 : returnStatement.expression) && !isIdentifier(returnStatement.expression)) { + statements.push(returnStatement); + } else { + statements.push(statement); + } + } addRange( statements, classStatements, @@ -99140,8 +102152,8 @@ function transformES2015(context) { let resultingCall; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { resultingCall = factory2.createFunctionApplyCall( - visitNode(target, callExpressionVisitor, isExpression), - node.expression.kind === 106 /* SuperKeyword */ ? thisArg : visitNode(thisArg, visitor, isExpression), + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 106 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), transformAndSpreadElements( node.arguments, /*isArgumentList*/ @@ -99155,8 +102167,8 @@ function transformES2015(context) { } else { resultingCall = setTextRange( factory2.createFunctionCallCall( - visitNode(target, callExpressionVisitor, isExpression), - node.expression.kind === 106 /* SuperKeyword */ ? thisArg : visitNode(thisArg, visitor, isExpression), + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 106 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), visitNodes2(node.arguments, visitor, isExpression) ), node @@ -99178,7 +102190,7 @@ function transformES2015(context) { const { target, thisArg } = factory2.createCallBinding(factory2.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration); return factory2.createNewExpression( factory2.createFunctionApplyCall( - visitNode(target, visitor, isExpression), + Debug.checkDefined(visitNode(target, visitor, isExpression)), thisArg, transformAndSpreadElements( factory2.createNodeArray([factory2.createVoidZero(), ...node.arguments]), @@ -99235,7 +102247,9 @@ function transformES2015(context) { return map(chunk, visitExpressionOfSpread); } function visitExpressionOfSpread(node) { + Debug.assertNode(node, isSpreadElement); let expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const isCallToReadHelper = isCallToHelper(expression, "___read"); let kind = isCallToReadHelper || isPackedArrayLiteral(expression) ? 2 /* PackedSpread */ : 1 /* UnpackedSpread */; if (compilerOptions.downlevelIteration && kind === 1 /* UnpackedSpread */ && !isArrayLiteralExpression(expression) && !isCallToReadHelper) { @@ -99286,7 +102300,7 @@ function transformES2015(context) { function visitTemplateExpression(node) { let expression = factory2.createStringLiteral(node.head.text); for (const span of node.templateSpans) { - const args = [visitNode(span.expression, visitor, isExpression)]; + const args = [Debug.checkDefined(visitNode(span.expression, visitor, isExpression))]; if (span.literal.text.length > 0) { args.push(factory2.createStringLiteral(span.literal.text)); } @@ -99504,7 +102518,7 @@ function transformES5(context) { return node; } function trySubstituteReservedName(name) { - const token = name.originalKeywordKind || (nodeIsSynthesized(name) ? stringToToken(idText(name)) : void 0); + const token = identifierToKeywordKind(name); if (token !== void 0 && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) { return setTextRange(factory2.createStringLiteralFromNode(name), name); } @@ -99640,7 +102654,7 @@ function transformGenerators(context) { switch (node.kind) { case 223 /* BinaryExpression */: return visitBinaryExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node); case 224 /* ConditionalExpression */: return visitConditionalExpression(node); @@ -99852,19 +102866,19 @@ function transformGenerators(context) { case 208 /* PropertyAccessExpression */: target = factory2.updatePropertyAccessExpression( left, - cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)), + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), left.name ); break; case 209 /* ElementAccessExpression */: target = factory2.updateElementAccessExpression( left, - cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)), - cacheExpression(visitNode(left.argumentExpression, visitor, isExpression)) + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), + cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression))) ); break; default: - target = visitNode(left, visitor, isExpression); + target = Debug.checkDefined(visitNode(left, visitor, isExpression)); break; } const operator = node.operatorToken.kind; @@ -99876,7 +102890,7 @@ function transformGenerators(context) { factory2.createBinaryExpression( cacheExpression(target), getNonAssignmentOperatorForCompoundAssignment(operator), - visitNode(right, visitor, isExpression) + Debug.checkDefined(visitNode(right, visitor, isExpression)) ), node ) @@ -99884,7 +102898,7 @@ function transformGenerators(context) { node ); } else { - return factory2.updateBinaryExpression(node, target, node.operatorToken, visitNode(right, visitor, isExpression)); + return factory2.updateBinaryExpression(node, target, node.operatorToken, Debug.checkDefined(visitNode(right, visitor, isExpression))); } } return visitEachChild(node, visitor, context); @@ -99898,9 +102912,9 @@ function transformGenerators(context) { } return factory2.updateBinaryExpression( node, - cacheExpression(visitNode(node.left, visitor, isExpression)), + cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))), node.operatorToken, - visitNode(node.right, visitor, isExpression) + Debug.checkDefined(visitNode(node.right, visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -99919,7 +102933,7 @@ function transformGenerators(context) { emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); pendingExpressions = []; } - pendingExpressions.push(visitNode(node2, visitor, isExpression)); + pendingExpressions.push(Debug.checkDefined(visitNode(node2, visitor, isExpression))); } } } @@ -99933,7 +102947,7 @@ function transformGenerators(context) { emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); pendingExpressions = []; } - pendingExpressions.push(visitNode(elem, visitor, isExpression)); + pendingExpressions.push(Debug.checkDefined(visitNode(elem, visitor, isExpression))); } } return factory2.inlineExpressions(pendingExpressions); @@ -99943,7 +102957,7 @@ function transformGenerators(context) { const resultLocal = declareLocal(); emitAssignment( resultLocal, - visitNode(node.left, visitor, isExpression), + Debug.checkDefined(visitNode(node.left, visitor, isExpression)), /*location*/ node.left ); @@ -99964,7 +102978,7 @@ function transformGenerators(context) { } emitAssignment( resultLocal, - visitNode(node.right, visitor, isExpression), + Debug.checkDefined(visitNode(node.right, visitor, isExpression)), /*location*/ node.right ); @@ -99978,13 +102992,13 @@ function transformGenerators(context) { const resultLocal = declareLocal(); emitBreakWhenFalse( whenFalseLabel, - visitNode(node.condition, visitor, isExpression), + Debug.checkDefined(visitNode(node.condition, visitor, isExpression)), /*location*/ node.condition ); emitAssignment( resultLocal, - visitNode(node.whenTrue, visitor, isExpression), + Debug.checkDefined(visitNode(node.whenTrue, visitor, isExpression)), /*location*/ node.whenTrue ); @@ -99992,7 +103006,7 @@ function transformGenerators(context) { markLabel(whenFalseLabel); emitAssignment( resultLocal, - visitNode(node.whenFalse, visitor, isExpression), + Debug.checkDefined(visitNode(node.whenFalse, visitor, isExpression)), /*location*/ node.whenFalse ); @@ -100072,7 +103086,7 @@ function transformGenerators(context) { leadingElement = void 0; expressions2 = []; } - expressions2.push(visitNode(element, visitor, isExpression)); + expressions2.push(Debug.checkDefined(visitNode(element, visitor, isExpression))); return expressions2; } } @@ -100111,8 +103125,8 @@ function transformGenerators(context) { if (containsYield(node.argumentExpression)) { return factory2.updateElementAccessExpression( node, - cacheExpression(visitNode(node.expression, visitor, isLeftHandSideExpression)), - visitNode(node.argumentExpression, visitor, isExpression) + cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))), + Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -100129,7 +103143,7 @@ function transformGenerators(context) { return setOriginalNode( setTextRange( factory2.createFunctionApplyCall( - cacheExpression(visitNode(target, visitor, isLeftHandSideExpression)), + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isLeftHandSideExpression))), thisArg, visitElements(node.arguments) ), @@ -100147,7 +103161,7 @@ function transformGenerators(context) { setTextRange( factory2.createNewExpression( factory2.createFunctionApplyCall( - cacheExpression(visitNode(target, visitor, isExpression)), + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isExpression))), thisArg, visitElements( node.arguments, @@ -100263,7 +103277,7 @@ function transformGenerators(context) { return setSourceMapRange( factory2.createAssignment( setSourceMapRange(factory2.cloneNode(node.name), node.name), - visitNode(node.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) ), node ); @@ -100275,7 +103289,7 @@ function transformGenerators(context) { const elseLabel = node.elseStatement ? defineLabel() : void 0; emitBreakWhenFalse( node.elseStatement ? elseLabel : endLabel, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*location*/ node.expression ); @@ -100304,7 +103318,7 @@ function transformGenerators(context) { markLabel(loopLabel); transformAndEmitEmbeddedStatement(node.statement); markLabel(conditionLabel); - emitBreakWhenTrue(loopLabel, visitNode(node.expression, visitor, isExpression)); + emitBreakWhenTrue(loopLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); endLoopBlock(); } else { emitStatement(visitNode(node, visitor, isStatement)); @@ -100325,7 +103339,7 @@ function transformGenerators(context) { const loopLabel = defineLabel(); const endLabel = beginLoopBlock(loopLabel); markLabel(loopLabel); - emitBreakWhenFalse(endLabel, visitNode(node.expression, visitor, isExpression)); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); transformAndEmitEmbeddedStatement(node.statement); emitBreak(loopLabel); endLoopBlock(); @@ -100356,7 +103370,7 @@ function transformGenerators(context) { emitStatement( setTextRange( factory2.createExpressionStatement( - visitNode(initializer, visitor, isExpression) + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) ), initializer ) @@ -100365,7 +103379,7 @@ function transformGenerators(context) { } markLabel(conditionLabel); if (node.condition) { - emitBreakWhenFalse(endLabel, visitNode(node.condition, visitor, isExpression)); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))); } transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); @@ -100373,7 +103387,7 @@ function transformGenerators(context) { emitStatement( setTextRange( factory2.createExpressionStatement( - visitNode(node.incrementor, visitor, isExpression) + Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression)) ), node.incrementor ) @@ -100418,7 +103432,7 @@ function transformGenerators(context) { const keysIndex = factory2.createLoopVariable(); const initializer = node.initializer; hoistVariableDeclaration(keysIndex); - emitAssignment(obj, visitNode(node.expression, visitor, isExpression)); + emitAssignment(obj, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); emitAssignment(keysArray, factory2.createArrayLiteralExpression()); emitStatement( factory2.createForInStatement( @@ -100449,7 +103463,7 @@ function transformGenerators(context) { } variable = factory2.cloneNode(initializer.declarations[0].name); } else { - variable = visitNode(initializer, visitor, isExpression); + variable = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); Debug.assert(isLeftHandSideExpression(variable)); } emitAssignment(variable, key); @@ -100474,8 +103488,8 @@ function transformGenerators(context) { node = factory2.updateForInStatement( node, initializer.declarations[0].name, - visitNode(node.expression, visitor, isExpression), - visitNode(node.statement, visitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) ); } else { node = visitEachChild(node, visitor, context); @@ -100551,7 +103565,7 @@ function transformGenerators(context) { } function transformAndEmitWithStatement(node) { if (containsYield(node)) { - beginWithBlock(cacheExpression(visitNode(node.expression, visitor, isExpression))); + beginWithBlock(cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)))); transformAndEmitEmbeddedStatement(node.statement); endWithBlock(); } else { @@ -100563,7 +103577,7 @@ function transformGenerators(context) { const caseBlock = node.caseBlock; const numClauses = caseBlock.clauses.length; const endLabel = beginSwitchBlock(); - const expression = cacheExpression(visitNode(node.expression, visitor, isExpression)); + const expression = cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); const clauseLabels = []; let defaultClauseIndex = -1; for (let i = 0; i < numClauses; i++) { @@ -100585,7 +103599,7 @@ function transformGenerators(context) { } pendingClauses.push( factory2.createCaseClause( - visitNode(clause.expression, visitor, isExpression), + Debug.checkDefined(visitNode(clause.expression, visitor, isExpression)), [ createInlineBreak( clauseLabels[i], @@ -100655,7 +103669,7 @@ function transformGenerators(context) { function transformAndEmitThrowStatement(node) { var _a2; emitThrow( - visitNode((_a2 = node.expression) != null ? _a2 : factory2.createVoidZero(), visitor, isExpression), + Debug.checkDefined(visitNode((_a2 = node.expression) != null ? _a2 : factory2.createVoidZero(), visitor, isExpression)), /*location*/ node ); @@ -101011,7 +104025,7 @@ function transformGenerators(context) { } return 0; } - function createLabel2(label) { + function createLabel(label) { if (label !== void 0 && label > 0) { if (labelExpressions === void 0) { labelExpressions = []; @@ -101037,7 +104051,7 @@ function transformGenerators(context) { factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), location @@ -101242,10 +104256,10 @@ function transformGenerators(context) { void 0, [ factory2.createArrayLiteralExpression([ - createLabel2(startLabel), - createLabel2(catchLabel), - createLabel2(finallyLabel), - createLabel2(endLabel) + createLabel(startLabel), + createLabel(catchLabel), + createLabel(finallyLabel), + createLabel(endLabel) ]) ] ) @@ -101421,7 +104435,7 @@ function transformGenerators(context) { factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -101440,7 +104454,7 @@ function transformGenerators(context) { factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -101462,7 +104476,7 @@ function transformGenerators(context) { factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -101939,7 +104953,7 @@ function transformModule(context) { } function addExportEqualsIfNeeded(statements, emitAsReturn) { if (currentModuleInfo.exportEquals) { - const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor); + const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor, isExpression); if (expressionResult) { if (emitAsReturn) { const statement = factory2.createReturnStatement(expressionResult); @@ -101979,9 +104993,9 @@ function transformModule(context) { return visitFunctionDeclaration(node); case 260 /* ClassDeclaration */: return visitClassDeclaration(node); - case 357 /* MergeDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 358 /* EndOfDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return visitor(node); @@ -101998,7 +105012,7 @@ function transformModule(context) { return visitExpressionStatement(node); case 214 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); case 210 /* CallExpression */: if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) { @@ -102134,7 +105148,7 @@ function transformModule(context) { } function visitImportCallExpression(node) { const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; const containsLexicalThis = !!(node.transformFlags & 16384 /* ContainsLexicalThis */); switch (compilerOptions.module) { @@ -102343,7 +105357,7 @@ function transformModule(context) { return downleveledImport; } function getHelperExpressionForExport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { return innerExpr; } if (getExportNeedsImportStarHelper(node)) { @@ -102352,7 +105366,7 @@ function transformModule(context) { return innerExpr; } function getHelperExpressionForImport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { return innerExpr; } if (getImportNeedsImportStarHelper(node)) { @@ -102597,7 +105611,7 @@ function transformModule(context) { ) ); } else { - const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default"; + const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default"; const exportedValue = factory2.createPropertyAccessExpression( exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, specifier.propertyName || specifier.name @@ -102663,7 +105677,7 @@ function transformModule(context) { deferredExports[id] = appendExportStatement( deferredExports[id], factory2.createIdentifier("default"), - visitNode(node.expression, visitor), + visitNode(node.expression, visitor, isExpression), /*location*/ node, /*allowComments*/ @@ -102673,7 +105687,7 @@ function transformModule(context) { statements = appendExportStatement( statements, factory2.createIdentifier("default"), - visitNode(node.expression, visitor), + visitNode(node.expression, visitor, isExpression), /*location*/ node, /*allowComments*/ @@ -102701,7 +105715,7 @@ function transformModule(context) { ), /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitEachChild(node.body, visitor, context) @@ -102742,8 +105756,8 @@ function transformModule(context) { ), /*typeParameters*/ void 0, - visitNodes2(node.heritageClauses, visitor), - visitNodes2(node.members, visitor) + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + visitNodes2(node.members, visitor, isClassElement) ), node ), @@ -102773,7 +105787,23 @@ function transformModule(context) { if (!modifiers) { modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); } - variables = append(variables, variable); + if (variable.initializer) { + const updatedVariable = factory2.updateVariableDeclaration( + variable, + variable.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createExportExpression( + variable.name, + visitNode(variable.initializer, visitor, isExpression) + ) + ); + variables = append(variables, updatedVariable); + } else { + variables = append(variables, variable); + } } else if (variable.initializer) { if (!isBindingPattern(variable.name) && (isArrowFunction(variable.initializer) || isFunctionExpression(variable.initializer) || isClassExpression(variable.initializer))) { const expression = factory2.createAssignment( @@ -102791,7 +105821,7 @@ function transformModule(context) { variable.name, variable.exclamationToken, variable.type, - visitNode(variable.initializer, visitor) + visitNode(variable.initializer, visitor, isExpression) ); variables = append(variables, updatedVariable); expressions = append(expressions, expression); @@ -102842,9 +105872,8 @@ function transformModule(context) { function transformInitializedVariable(node) { if (isBindingPattern(node.name)) { return flattenDestructuringAssignment( - visitNode(node, visitor), - /*visitor*/ - void 0, + visitNode(node, visitor, isInitializedVariable), + visitor, context, 0 /* All */, /*needsValue*/ @@ -102861,7 +105890,7 @@ function transformModule(context) { /*location*/ node.name ), - node.initializer ? visitNode(node.initializer, visitor) : factory2.createVoidZero() + node.initializer ? visitNode(node.initializer, visitor, isExpression) : factory2.createVoidZero() ); } } @@ -103131,7 +106160,7 @@ function transformModule(context) { const expression = substituteExpressionIdentifier(node.expression); noSubstitution[getNodeId(expression)] = true; if (!isIdentifier(expression) && !(getEmitFlags(node.expression) & 8192 /* HelperName */)) { - return addEmitFlags( + return addInternalEmitFlags( factory2.updateCallExpression( node, expression, @@ -103139,7 +106168,7 @@ function transformModule(context) { void 0, node.arguments ), - 1073741824 /* IndirectCall */ + 16 /* IndirectCall */ ); } } @@ -103150,7 +106179,7 @@ function transformModule(context) { const tag = substituteExpressionIdentifier(node.tag); noSubstitution[getNodeId(tag)] = true; if (!isIdentifier(tag) && !(getEmitFlags(node.tag) & 8192 /* HelperName */)) { - return addEmitFlags( + return addInternalEmitFlags( factory2.updateTaggedTemplateExpression( node, tag, @@ -103158,7 +106187,7 @@ function transformModule(context) { void 0, node.template ), - 1073741824 /* IndirectCall */ + 16 /* IndirectCall */ ); } } @@ -103172,7 +106201,7 @@ function transformModule(context) { return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); } return node; - } else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { + } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node)); if (exportContainer && exportContainer.kind === 308 /* SourceFile */) { return setTextRange( @@ -103804,7 +106833,7 @@ function transformSystemModule(context) { ), /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -103901,7 +106930,7 @@ function transformSystemModule(context) { return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 308 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { - const createAssignment3 = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; + const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; return isBindingPattern(node.name) ? flattenDestructuringAssignment( node, visitor, @@ -103909,8 +106938,8 @@ function transformSystemModule(context) { 0 /* All */, /*needsValue*/ false, - createAssignment3 - ) : node.initializer ? createAssignment3(node.name, visitNode(node.initializer, visitor, isExpression)) : node.name; + createAssignment + ) : node.initializer ? createAssignment(node.name, visitNode(node.initializer, visitor, isExpression)) : node.name; } function createExportedVariableAssignment(name, value, location) { return createVariableAssignment( @@ -104114,9 +107143,9 @@ function transformSystemModule(context) { return visitCatchClause(node); case 238 /* Block */: return visitBlock(node); - case 357 /* MergeDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 358 /* EndOfDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return visitor(node); @@ -104178,7 +107207,7 @@ function transformSystemModule(context) { } return expressions ? factory2.inlineExpressions(expressions) : factory2.createOmittedExpression(); } else { - return visitNode(node, discardedValueVisitor, isExpression); + return visitNode(node, discardedValueVisitor, isForInitializer); } } function visitDoStatement(node) { @@ -104199,21 +107228,21 @@ function transformSystemModule(context) { return factory2.updateLabeledStatement( node, node.label, - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) ); } function visitWithStatement(node) { return factory2.updateWithStatement( node, visitNode(node.expression, visitor, isExpression), - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) ); } function visitSwitchStatement(node) { return factory2.updateSwitchStatement( node, visitNode(node.expression, visitor, isExpression), - visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock) + Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock)) ); } function visitCaseBlock(node) { @@ -104245,7 +107274,7 @@ function transformSystemModule(context) { node = factory2.updateCatchClause( node, node.variableDeclaration, - visitNode(node.block, topLevelNestedVisitor, isBlock) + Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock)) ); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; @@ -104272,7 +107301,7 @@ function transformSystemModule(context) { return visitExpressionStatement(node); case 214 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); case 223 /* BinaryExpression */: if (isDestructuringAssignment(node)) { @@ -104315,7 +107344,7 @@ function transformSystemModule(context) { } function visitImportCallExpression(node) { const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; return factory2.createCallExpression( factory2.createPropertyAccessExpression( @@ -105436,7 +108465,7 @@ function transformDeclarations(context) { sourceFile, /*bundled*/ true - )) : visitNodes2(sourceFile.statements, visitDeclarationStatements); + )) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); const newFile = factory2.updateSourceFile( sourceFile, [factory2.createModuleDeclaration( @@ -105458,7 +108487,7 @@ function transformDeclarations(context) { return newFile; } needsDeclare = true; - const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements); + const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); return factory2.updateSourceFile( sourceFile, transformAndReplaceLatePaintedStatements(updated2), @@ -105527,7 +108556,7 @@ function transformDeclarations(context) { refs.forEach(referenceVisitor); emittedImports = filter(combinedStatements, isAnyImportSyntax); } else { - const statements = visitNodes2(node.statements, visitDeclarationStatements); + const statements = visitNodes2(node.statements, visitDeclarationStatements, isStatement); combinedStatements = setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements); refs.forEach(referenceVisitor); emittedImports = filter(combinedStatements, isAnyImportSyntax); @@ -105644,9 +108673,9 @@ function transformDeclarations(context) { return name; } else { if (name.kind === 204 /* ArrayBindingPattern */) { - return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement)); + return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement)); } else { - return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement)); + return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement)); } } function visitBindingElement(elem) { @@ -105716,10 +108745,10 @@ function transformDeclarations(context) { } const shouldUseResolverType = node.kind === 166 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { - return visitNode(type, visitDeclarationSubtree); + return visitNode(type, visitDeclarationSubtree, isTypeNode); } if (!getParseTreeNode(node)) { - return type ? visitNode(type, visitDeclarationSubtree) : factory2.createKeywordTypeNode(131 /* AnyKeyword */); + return type ? visitNode(type, visitDeclarationSubtree, isTypeNode) : factory2.createKeywordTypeNode(131 /* AnyKeyword */); } if (node.kind === 175 /* SetAccessor */) { return factory2.createKeywordTypeNode(131 /* AnyKeyword */); @@ -105789,11 +108818,11 @@ function transformDeclarations(context) { } function updateParamsList(node, params, modifierMask) { if (hasEffectiveModifier(node, 8 /* Private */)) { - return void 0; + return factory2.createNodeArray(); } const newParams = map(params, (p) => ensureParameter(p, modifierMask)); if (!newParams) { - return void 0; + return factory2.createNodeArray(); } return factory2.createNodeArray(newParams, params.hasTrailingComma); } @@ -105833,7 +108862,7 @@ function transformDeclarations(context) { return factory2.createNodeArray(newParams || emptyArray); } function ensureTypeParams(node, params) { - return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree); + return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration); } function isEnclosingDeclaration(node) { return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node); @@ -105968,7 +108997,7 @@ function transformDeclarations(context) { needsDeclare = priorNeedsDeclare; lateStatementReplacementMap.set(getOriginalNodeId(i), result); } - return visitNodes2(statements, visitLateVisibilityMarkedStatements); + return visitNodes2(statements, visitLateVisibilityMarkedStatements, isStatement); function visitLateVisibilityMarkedStatements(statement) { if (isLateVisibilityPaintedStatement(statement)) { const key = getOriginalNodeId(statement); @@ -106182,7 +109211,7 @@ function transformDeclarations(context) { input, ensureModifiers(input), updateParamsList(input, input.parameters), - visitNode(input.type, visitDeclarationSubtree) || factory2.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode(131 /* AnyKeyword */) )); } case 257 /* VariableDeclaration */: { @@ -106215,20 +109244,24 @@ function transformDeclarations(context) { return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); } case 191 /* ConditionalType */: { - const checkType = visitNode(input.checkType, visitDeclarationSubtree); - const extendsType = visitNode(input.extendsType, visitDeclarationSubtree); + const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); + const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); const oldEnclosingDecl = enclosingDeclaration; enclosingDeclaration = input.trueType; - const trueType = visitNode(input.trueType, visitDeclarationSubtree); + const trueType = visitNode(input.trueType, visitDeclarationSubtree, isTypeNode); enclosingDeclaration = oldEnclosingDecl; - const falseType = visitNode(input.falseType, visitDeclarationSubtree); + const falseType = visitNode(input.falseType, visitDeclarationSubtree, isTypeNode); + Debug.assert(checkType); + Debug.assert(extendsType); + Debug.assert(trueType); + Debug.assert(falseType); return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } case 181 /* FunctionType */: { - return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree))); + return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); } case 182 /* ConstructorType */: { - return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree))); + return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); } case 202 /* ImportType */: { if (!isLiteralImportTypeNode(input)) @@ -106372,7 +109405,7 @@ function transformDeclarations(context) { ensureModifiers(input), input.name, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), - visitNode(input.type, visitDeclarationSubtree, isTypeNode) + Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) )); needsDeclare = previousNeedsDeclare; return clean2; @@ -106384,7 +109417,7 @@ function transformDeclarations(context) { input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), - visitNodes2(input.members, visitDeclarationSubtree) + visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) )); } case 259 /* FunctionDeclaration */: { @@ -106501,7 +109534,7 @@ function transformDeclarations(context) { const oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; needsScopeFixMarker = false; - const statements = visitNodes2(inner.statements, visitDeclarationStatements); + const statements = visitNodes2(inner.statements, visitDeclarationStatements, isStatement); let lateStatements = transformAndReplaceLatePaintedStatements(statements); if (input.flags & 16777216 /* Ambient */) { needsScopeFixMarker = false; @@ -106510,7 +109543,7 @@ function transformDeclarations(context) { if (needsScopeFixMarker) { lateStatements = factory2.createNodeArray([...lateStatements, createEmptyExports(factory2)]); } else { - lateStatements = visitNodes2(lateStatements, stripExportModifiers); + lateStatements = visitNodes2(lateStatements, stripExportModifiers, isStatement); } } const body = factory2.updateModuleBlock(inner, lateStatements); @@ -106606,7 +109639,7 @@ function transformDeclarations(context) { void 0 ) ] : void 0; - const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree)); + const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement)); const members = factory2.createNodeArray(memberNodes); const extendsClause = getEffectiveBaseTypeNode(input); if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 104 /* NullKeyword */) { @@ -106630,11 +109663,11 @@ function transformDeclarations(context) { if (clause.token === 94 /* ExtendsKeyword */) { const oldDiag2 = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]); - const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree)))); + const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree, isTypeNode)))); getSymbolAccessibilityDiagnostic = oldDiag2; return newClause; } - return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */)), visitDeclarationSubtree)); + return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */)), visitDeclarationSubtree, isExpressionWithTypeArguments)); })); return [statement, cleanup(factory2.updateClassDeclaration( input, @@ -106690,7 +109723,7 @@ function transformDeclarations(context) { function transformVariableStatement(input) { if (!forEach(input.declarationList.declarations, getBindingNameVisible)) return; - const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree); + const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree, isVariableDeclaration); if (!length(nodes)) return; return factory2.updateVariableStatement(input, factory2.createNodeArray(ensureModifiers(input)), factory2.updateVariableDeclarationList(input.declarationList, nodes)); @@ -106781,7 +109814,7 @@ function transformDeclarations(context) { function transformHeritageClauses(nodes) { return factory2.createNodeArray(filter(map(nodes, (clause) => factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => { return isEntityNameExpression(t.expression) || clause.token === 94 /* ExtendsKeyword */ && t.expression.kind === 104 /* NullKeyword */; - })), visitDeclarationSubtree))), (clause) => clause.types && !!clause.types.length)); + })), visitDeclarationSubtree, isExpressionWithTypeArguments))), (clause) => clause.types && !!clause.types.length)); } } function isAlwaysType(node) { @@ -106890,10 +109923,15 @@ function getScriptTransformers(compilerOptions, customTransformers, emitOnly) { return emptyArray; const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); const transformers = []; addRange(transformers, customTransformers && map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(transformTypeScript); - transformers.push(transformLegacyDecorators); + if (compilerOptions.experimentalDecorators) { + transformers.push(transformLegacyDecorators); + } else if (languageVersion < 99 /* ESNext */ || !useDefineForClassFields) { + transformers.push(transformESDecorators); + } transformers.push(transformClassFields); if (getJSXTransformEnabled(compilerOptions)) { transformers.push(transformJsx); @@ -106959,7 +109997,7 @@ function noEmitNotification(hint, node, callback) { } function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { var _a2, _b; - const enabledSyntaxKindFeatures = new Array(360 /* Count */); + const enabledSyntaxKindFeatures = new Array(361 /* Count */); let lexicalEnvironmentVariableDeclarations; let lexicalEnvironmentFunctionDeclarations; let lexicalEnvironmentStatements; @@ -107521,7 +110559,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; const emitterDiagnostics = createDiagnosticCollection(); - const newLine = getNewLineCharacter(compilerOptions, () => host.getNewLine()); + const newLine = getNewLineCharacter(compilerOptions); const writer = createTextWriter(newLine); const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); let bundleBuildInfo; @@ -108021,7 +111059,6 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory), getCompilerOptions: () => config.options, getCurrentDirectory: () => host.getCurrentDirectory(), - getNewLine: () => host.getNewLine(), getSourceFile: returnUndefined, getSourceFileByPath: returnUndefined, getSourceFiles: () => sourceFilesForJsEmit, @@ -108107,6 +111144,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { const bundledHelpers = /* @__PURE__ */ new Map(); let currentSourceFile; let nodeIdToGeneratedName; + let nodeIdToGeneratedPrivateName; let autoGeneratedIdToGeneratedName; let generatedNames; let formattedNameTempFlagsStack; @@ -108403,6 +111441,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function reset2() { nodeIdToGeneratedName = []; + nodeIdToGeneratedPrivateName = []; autoGeneratedIdToGeneratedName = []; generatedNames = /* @__PURE__ */ new Set(); formattedNameTempFlagsStack = []; @@ -108454,7 +111493,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node); } function beforeEmitNode(node) { - if (preserveSourceNewlines && getEmitFlags(node) & 268435456 /* IgnoreSourceNewlines */) { + if (preserveSourceNewlines && getInternalEmitFlags(node) & 4 /* IgnoreSourceNewlines */) { preserveSourceNewlines = false; } } @@ -108844,6 +111883,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { case 346 /* JSDocThisTag */: case 347 /* JSDocTypeTag */: case 352 /* JSDocThrowsTag */: + case 353 /* JSDocSatisfiesTag */: return emitJSDocSimpleTypedTag(node); case 348 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); @@ -108851,9 +111891,9 @@ function createPrinter(printerOptions = {}, handlers = {}) { return emitJSDocTypedefTag(node); case 350 /* JSDocSeeTag */: return emitJSDocSeeTag(node); - case 354 /* NotEmittedStatement */: - case 358 /* EndOfDeclarationMarker */: - case 357 /* MergeDeclarationMarker */: + case 355 /* NotEmittedStatement */: + case 359 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return; } if (isExpression(node)) { @@ -108946,24 +111986,26 @@ function createPrinter(printerOptions = {}, handlers = {}) { return emitMetaProperty(node); case 234 /* SyntheticExpression */: return Debug.fail("SyntheticExpression should never be printed."); + case 279 /* MissingDeclaration */: + return; case 281 /* JsxElement */: return emitJsxElement(node); case 282 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); case 285 /* JsxFragment */: return emitJsxFragment(node); - case 353 /* SyntaxList */: + case 354 /* SyntaxList */: return Debug.fail("SyntaxList should not be printed"); - case 354 /* NotEmittedStatement */: + case 355 /* NotEmittedStatement */: return; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return emitCommaList(node); - case 357 /* MergeDeclarationMarker */: - case 358 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return; - case 359 /* SyntheticReferenceExpression */: + case 360 /* SyntheticReferenceExpression */: return Debug.fail("SyntheticReferenceExpression should not be printed"); } } @@ -109136,7 +112178,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { /*includeTrivia*/ false ), node.symbol); - emitList(node, node.typeArguments, 53776 /* TypeParameters */); + emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */); } function emitPrivateIdentifier(node) { write(getTextOfNode2( @@ -109167,7 +112209,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames); } function emitTypeParameter(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emit(node.name); if (node.constraint) { writeSpace(); @@ -109183,7 +112225,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } function emitParameter(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); @@ -109199,14 +112246,19 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); } function emitPropertySignature(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emitNodeWithWriter(node.name, writeProperty); emit(node.questionToken); emitTypeAnnotation(node.type); writeTrailingSemicolon(); } function emitPropertyDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.name); emit(node.questionToken); emit(node.exclamationToken); @@ -109216,7 +112268,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitMethodSignature(node) { pushNameGenerationScope(node); - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emit(node.name); emit(node.questionToken); emitTypeParameters(node, node.typeParameters); @@ -109226,7 +112278,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { popNameGenerationScope(node); } function emitMethodDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.asteriskToken); emit(node.name); emit(node.questionToken); @@ -109237,13 +112294,24 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitBlockFunctionBody(node.body); } function emitConstructor(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); - writeKeyword(node.kind === 174 /* GetAccessor */ ? "get" : "set"); + const pos = emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + const token = node.kind === 174 /* GetAccessor */ ? 137 /* GetKeyword */ : 151 /* SetKeyword */; + emitTokenWithComment(token, pos, writeKeyword, node); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -109267,7 +112335,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { popNameGenerationScope(node); } function emitIndexSignature(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitParametersForIndexSignature(node, node.parameters); emitTypeAnnotation(node.type); writeTrailingSemicolon(); @@ -109326,7 +112399,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitConstructorType(node) { pushNameGenerationScope(node); - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); writeKeyword("new"); writeSpace(); emitTypeParameters(node, node.typeParameters); @@ -109602,7 +112675,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node); } function emitCallExpression(node) { - const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */; + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; if (indirectCall) { writePunctuation("("); writeLiteral("0"); @@ -109625,7 +112698,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); } function emitTaggedTemplateExpression(node) { - const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */; + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; if (indirectCall) { writePunctuation("("); writeLiteral("0"); @@ -109663,7 +112736,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitFunctionDeclarationOrExpression(node); } function emitArrowFunction(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emitSignatureAndBody(node, emitArrowFunctionHead); } function emitArrowFunctionHead(node) { @@ -109929,7 +113002,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { ); } function emitVariableStatement(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emit(node.declarationList); writeTrailingSemicolon(); } @@ -110187,7 +113265,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitFunctionDeclarationOrExpression(node); } function emitFunctionDeclarationOrExpression(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("function"); emit(node.asteriskToken); writeSpace(); @@ -110295,8 +113378,13 @@ function createPrinter(printerOptions = {}, handlers = {}) { void 0 ); forEach(node.members, generateMemberNames); - emitDecoratorsAndModifiers(node, node.modifiers); - writeKeyword("class"); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emitTokenWithComment(84 /* ClassKeyword */, moveRangePastModifiers(node).pos, writeKeyword, node); if (node.name) { writeSpace(); emitIdentifierName(node.name); @@ -110322,7 +113410,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { /*newReservedMemberNames*/ void 0 ); - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("interface"); writeSpace(); emit(node.name); @@ -110335,7 +113428,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { popPrivateNameGenerationScope(); } function emitTypeAliasDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("type"); writeSpace(); emit(node.name); @@ -110347,7 +113445,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { writeTrailingSemicolon(); } function emitEnumDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("enum"); writeSpace(); emit(node.name); @@ -110357,7 +113460,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { writePunctuation("}"); } function emitModuleDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); if (~node.flags & 1024 /* GlobalAugmentation */) { writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); writeSpace(); @@ -110397,7 +113505,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { ); } function emitImportEqualsDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { @@ -110419,7 +113532,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } function emitImportDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.importClause) { @@ -110472,7 +113590,12 @@ function createPrinter(printerOptions = {}, handlers = {}) { writeTrailingSemicolon(); } function emitExportDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); let nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { @@ -111095,23 +114218,27 @@ function createPrinter(printerOptions = {}, handlers = {}) { emit(node); write = savedWrite; } - function emitDecoratorsAndModifiers(node, modifiers) { + function emitDecoratorsAndModifiers(node, modifiers, allowDecorators) { if (modifiers == null ? void 0 : modifiers.length) { if (every(modifiers, isModifier)) { - return emitModifiers(node, modifiers); + return emitModifierList(node, modifiers); } if (every(modifiers, isDecorator)) { - return emitDecorators(node, modifiers); + if (allowDecorators) { + return emitDecoratorList(node, modifiers); + } + return node.pos; } onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); let lastMode; let mode; let start2 = 0; let pos = 0; + let lastModifier; while (start2 < modifiers.length) { while (pos < modifiers.length) { - const modifier = modifiers[pos]; - mode = isDecorator(modifier) ? "decorators" : "modifiers"; + lastModifier = modifiers[pos]; + mode = isDecorator(lastModifier) ? "decorators" : "modifiers"; if (lastMode === void 0) { lastMode = mode; } else if (mode !== lastMode) { @@ -111124,28 +114251,36 @@ function createPrinter(printerOptions = {}, handlers = {}) { textRange.pos = modifiers.pos; if (pos === modifiers.length - 1) textRange.end = modifiers.end; - emitNodeListItems( - emit, - node, - modifiers, - lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, - /*parenthesizerRule*/ - void 0, - start2, - pos - start2, - /*hasTrailingComma*/ - false, - textRange - ); + if (lastMode === "modifiers" || allowDecorators) { + emitNodeListItems( + emit, + node, + modifiers, + lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, + /*parenthesizerRule*/ + void 0, + start2, + pos - start2, + /*hasTrailingComma*/ + false, + textRange + ); + } start2 = pos; lastMode = mode; pos++; } onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); + if (lastModifier && !positionIsSynthesized(lastModifier.end)) { + return lastModifier.end; + } } + return node.pos; } - function emitModifiers(node, modifiers) { + function emitModifierList(node, modifiers) { emitList(node, modifiers, 2359808 /* Modifiers */); + const lastModifier = lastOrUndefined(modifiers); + return lastModifier && !positionIsSynthesized(lastModifier.end) ? lastModifier.end : node.pos; } function emitTypeAnnotation(node) { if (node) { @@ -111201,8 +114336,10 @@ function createPrinter(printerOptions = {}, handlers = {}) { decreaseIndent(); } } - function emitDecorators(parentNode, decorators) { + function emitDecoratorList(parentNode, decorators) { emitList(parentNode, decorators, 2146305 /* Decorators */); + const lastDecorator = lastOrUndefined(decorators); + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos; } function emitTypeArguments(parentNode, typeArguments) { emitList(parentNode, typeArguments, 53776 /* TypeArguments */, typeArgumentParenthesizerRuleSelector); @@ -111329,7 +114466,10 @@ function createPrinter(printerOptions = {}, handlers = {}) { writeDelimiter(format); } else if (previousSibling) { if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) { - emitLeadingCommentsOfPosition(previousSibling.end); + const previousSiblingEmitFlags = getEmitFlags(previousSibling); + if (!(previousSiblingEmitFlags & 2048 /* NoTrailingComments */)) { + emitLeadingCommentsOfPosition(previousSibling.end); + } } writeDelimiter(format); recordBundleFileInternalSectionEnd(previousSourceFileTextKind); @@ -111854,16 +114994,18 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } function generateName(name) { - if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { - return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix); + const autoGenerate = name.emitNode.autoGenerate; + if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { + return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix); } else { - const autoGenerateId = name.autoGenerate.id; + const autoGenerateId = autoGenerate.id; return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name)); } } function generateNameCached(node, privateName, flags, prefix, suffix) { const nodeId = getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); + const cache = privateName ? nodeIdToGeneratedPrivateName : nodeIdToGeneratedName; + return cache[nodeId] || (cache[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); } function isUniqueName(name, privateName) { return isFileLevelUniqueName2(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name); @@ -112105,7 +115247,21 @@ function createPrinter(printerOptions = {}, handlers = {}) { Debug.assert(!prefix && !suffix && !privateName); return generateNameForImportOrExportDeclaration(node); case 259 /* FunctionDeclaration */: - case 260 /* ClassDeclaration */: + case 260 /* ClassDeclaration */: { + Debug.assert(!prefix && !suffix && !privateName); + const name = node.name; + if (name && !isGeneratedIdentifier(name)) { + return generateNameForNode( + name, + /*privateName*/ + false, + flags, + prefix, + suffix + ); + } + return generateNameForExportDefault(); + } case 274 /* ExportAssignment */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForExportDefault(); @@ -112137,16 +115293,17 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } function makeName(name) { - const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName); - const suffix = formatGeneratedNamePart(name.autoGenerate.suffix); - switch (name.autoGenerate.flags & 7 /* KindMask */) { + const autoGenerate = name.emitNode.autoGenerate; + const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName); + const suffix = formatGeneratedNamePart(autoGenerate.suffix); + switch (autoGenerate.flags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); case 2 /* Loop */: Debug.assertNode(name, isIdentifier); return makeTempVariableName( TempFlags._i, - !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), /*privateName*/ false, prefix, @@ -112155,16 +115312,16 @@ function createPrinter(printerOptions = {}, handlers = {}) { case 3 /* Unique */: return makeUniqueName2( idText(name), - name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, - !!(name.autoGenerate.flags & 16 /* Optimistic */), - !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), + autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, + !!(autoGenerate.flags & 16 /* Optimistic */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix ); } return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum( - name.autoGenerate.flags & 7 /* KindMask */, + autoGenerate.flags & 7 /* KindMask */, GeneratedIdentifierFlags, /*isFlags*/ true @@ -112209,7 +115366,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitLeadingComments( pos, /*isEmittedNode*/ - node.kind !== 354 /* NotEmittedStatement */ + node.kind !== 355 /* NotEmittedStatement */ ); } if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { @@ -112233,7 +115390,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { containerPos = savedContainerPos; containerEnd = savedContainerEnd; declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 354 /* NotEmittedStatement */) { + if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) { emitTrailingComments(end); } } @@ -112505,7 +115662,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } else { const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); } if (emitFlags & 128 /* NoNestedSourceMaps */) { @@ -112520,7 +115677,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { if (emitFlags & 128 /* NoNestedSourceMaps */) { sourceMapsDisabled = false; } - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); } } @@ -113230,7 +116387,7 @@ function createCompilerHostWorker(options, setParentNodes, system = sys) { function getDefaultLibLocation() { return getDirectoryPath(normalizePath(system.getExecutingFilePath())); } - const newLine = getNewLineCharacter(options, () => system.newLine); + const newLine = getNewLineCharacter(options); const realpath = system.realpath && ((path) => system.realpath(path)); const compilerHost = { getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes), @@ -114754,7 +117911,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: () => currentDirectory, - getNewLine: () => host.getNewLine(), getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, @@ -115133,8 +118289,26 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } function walkArray(nodes, parent2) { - if (canHaveModifiers(parent2) && parent2.modifiers === nodes && some(nodes, isDecorator) && !options.experimentalDecorators) { - diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); + if (canHaveIllegalDecorators(parent2)) { + const decorator = find(parent2.modifiers, isDecorator); + if (decorator) { + diagnostics.push(createDiagnosticForNode2(decorator, Diagnostics.Decorators_are_not_valid_here)); + } + } else if (canHaveDecorators(parent2) && parent2.modifiers) { + const decoratorIndex = findIndex(parent2.modifiers, isDecorator); + if (decoratorIndex >= 0) { + if (isParameter(parent2) && !options.experimentalDecorators) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (isClassDeclaration(parent2)) { + const exportIndex = findIndex(parent2.modifiers, isExportModifier); + const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); + if (exportIndex >= 0 && decoratorIndex < exportIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files)); + } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } + } + } } switch (parent2.kind) { case 260 /* ClassDeclaration */: @@ -115293,7 +118467,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config /*assertClause*/ void 0 ); - addEmitFlags(importDecl, 134217728 /* NeverApplyImportHelper */); + addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */); setParent(externalHelpersModuleReference, importDecl); setParent(importDecl, file); externalHelpersModuleReference.flags &= ~8 /* Synthesized */; @@ -115560,7 +118734,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (filesByName.has(path)) { const file2 = filesByName.get(path); addFileIncludeReason(file2 || void 0, reason); - if (file2 && options.forceConsistentCasingInFileNames) { + if (file2 && !(options.forceConsistentCasingInFileNames === false)) { const checkedName = file2.fileName; const isRedirect = toPath3(checkedName) !== toPath3(fileName); if (isRedirect) { @@ -116159,24 +119333,12 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } const languageVersion = getEmitScriptTarget(options); const firstNonAmbientExternalModuleSourceFile = find(files, (f) => isExternalModule(f) && !f.isDeclarationFile); - if (options.isolatedModules) { - if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */) { + if (options.isolatedModules || options.verbatimModuleSyntax) { + if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */ && options.isolatedModules) { createDiagnosticForOptionName(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"); } if (options.preserveConstEnums === false) { - createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules"); - } - for (const file of files) { - if (!isExternalModule(file) && !isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* JSON */) { - const span = getErrorSpanForNode(file, file); - programDiagnostics.add(createFileDiagnostic( - file, - span.start, - span.length, - Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, - getBaseFileName(file.fileName) - )); - } + createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled, options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", "preserveConstEnums"); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === 0 /* None */) { const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); @@ -116258,10 +119420,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) { - createOptionValueDiagnostic("importsNotUsedAsValues", Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later); + createDiagnosticForOptionName(Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); + } + if (options.verbatimModuleSyntax) { + const moduleKind = getEmitModuleKind(options); + if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { + createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); + } + if (options.isolatedModules) { + createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); + } + if (options.preserveValueImports) { + createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); + } + if (options.importsNotUsedAsValues) { + createRedundantOptionDiagnostic("importsNotUsedAsValues", "verbatimModuleSyntax"); + } } if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) { - createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set); + createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set); } const moduleResolution = getEmitModuleResolutionKind(options); if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { @@ -116307,16 +119484,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } } - function verifyDeprecatedCompilerOptions() { + function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) { const version2 = typeScriptVersion3 || versionMajorMinor; const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) { return; - } else { + } else if (reportInvalidIgnoreDeprecations) { createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); } } + return version2; + } + function verifyDeprecatedCompilerOptions() { + const version2 = getVersionForDeprecationDiagnostics( + /*reportInvalidIgnoreDeprecations*/ + true + ); + if (!version2) + return; if (options.target === 0 /* ES3 */) { createDeprecatedDiagnosticForOption(version2, "target", "ES3"); } @@ -116341,30 +119527,83 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (options.out) { createDeprecatedDiagnosticForOption(version2, "out"); } - } - function createDeprecatedDiagnosticForOption(version2, name, value) { - if (version2 === "6.0" /* v6_0 */) { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnosticForOption( + version2, + "importsNotUsedAsValues", + /*value*/ void 0, - Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, - value || name + "verbatimModuleSyntax" ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ + } + if (options.preserveValueImports) { + createDeprecatedDiagnosticForOption( + version2, + "preserveValueImports", + /*value*/ void 0, - Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, - value || name, - "5.5" /* v5_5 */, - "5.0" /* v5_0 */ + "verbatimModuleSyntax" + ); + } + } + function verifyDeprecatedProjectReference(ref, parentFile, index) { + if (ref.prepend) { + const version2 = getVersionForDeprecationDiagnostics( + /*reportInvalidIgnoreDeprecations*/ + false ); + if (version2) { + createDeprecatedOptionForVersionDiagnostic( + version2, + (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), + "prepend" + ); + } + } + } + function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) { + return createDeprecatedOptionForVersionDiagnostic( + version2, + (message, arg0, arg1, arg2) => { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + chain + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + message, + arg0, + arg1, + arg2 + ); + } + }, + name, + value + ); + } + function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) { + if (version2 === "6.0" /* v6_0 */) { + createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); + } else { + createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); } } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { @@ -116510,6 +119749,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent2, index) => { const ref = (parent2 ? parent2.commandLine.projectReferences : projectReferences)[index]; const parentFile = parent2 && parent2.sourceFile; + verifyDeprecatedProjectReference(ref, parentFile, index); if (!resolvedRef) { createDiagnosticForReference(parentFile, index, Diagnostics.File_0_not_found, ref.path); return; @@ -116617,22 +119857,26 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config arg1 ); } - function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) { + function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) { const referencesSyntax = firstDefined( getTsConfigPropArray(sourceFile || options.configFile, "references"), (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 ); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); } } function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); if (needCompilerDiagnostic) { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + if ("messageText" in message) { + programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); + } else { + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + } } } function getCompilerOptionsObjectLiteralSyntax() { @@ -116653,10 +119897,32 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + if ("messageText" in message) { + programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); + } else { + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + } } return !!props.length; } + function createRedundantOptionDiagnostic(errorOnOption, redundantWithOption) { + const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + if (compilerOptionsObjectLiteralSyntax) { + createOptionDiagnosticInObjectLiteralSyntax( + compilerOptionsObjectLiteralSyntax, + /*onKey*/ + true, + errorOnOption, + /*key2*/ + void 0, + Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, + errorOnOption, + redundantWithOption + ); + } else { + createDiagnosticForOptionName(Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, errorOnOption, redundantWithOption); + } + } function blockEmittingOfFile(emitFileName, diag2) { hasEmitBlockingDiagnostics.set(toPath3(emitFileName), true); programDiagnostics.add(diag2); @@ -116908,9 +120174,8 @@ function createPrependNodes(projectReferences, getCommandLine, readFile, host) { } return nodes || emptyArray; } -function resolveProjectReferencePath(hostOrRef, ref) { - const passedInRef = ref ? ref : hostOrRef; - return resolveConfigFileProjectName(passedInRef.path); +function resolveProjectReferencePath(ref) { + return resolveConfigFileProjectName(ref.path); } function getResolutionDiagnostic(options, { extension }, { isDeclarationFile }) { switch (extension) { @@ -119522,6 +122787,9 @@ function getFilesInErrorForSummary(diagnostics) { } ); return filesInError.map((fileName) => { + if (fileName === void 0) { + return void 0; + } const diagnosticForFileName = find( diagnostics, (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName @@ -119915,7 +123183,6 @@ function createWatchFactory(host, options) { } function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) { const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); - const hostGetNewLine = memoize(() => host.getNewLine()); const compilerHost = { getSourceFile: createGetSourceFile( (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding), @@ -119933,7 +123200,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt getCurrentDirectory: memoize(() => host.getCurrentDirectory()), useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames), - getNewLine: () => getNewLineCharacter(getCompilerOptions(), hostGetNewLine), + getNewLine: () => getNewLineCharacter(getCompilerOptions()), fileExists: (f) => host.fileExists(f), readFile: (f) => host.readFile(f), trace: maybeBind(host, host.trace), @@ -120019,7 +123286,7 @@ function createWatchCompilerHost(system = sys, createProgram2, reportDiagnostic, copyProperties(result, createWatchHost(system, reportWatchStatus2)); result.afterProgramCreate = (builderProgram) => { const compilerOptions = builderProgram.getCompilerOptions(); - const newLine = getNewLineCharacter(compilerOptions, () => system.newLine); + const newLine = getNewLineCharacter(compilerOptions); emitFilesAndReportErrors( builderProgram, reportDiagnostic, @@ -120190,11 +123457,13 @@ function createWatchProgram(host) { } reportWatchDiagnostic(Diagnostics.Starting_compilation_in_watch_mode); if (configFileName && !host.configFileParsingResult) { - newLine = getNewLineCharacter(optionsToExtendForConfigFile, () => host.getNewLine()); + newLine = getNewLineCharacter(optionsToExtendForConfigFile); Debug.assert(!rootFileNames); parseConfigFile2(); newLine = updateNewLine(); } + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions); const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`); @@ -120297,6 +123566,8 @@ function createWatchProgram(host) { } function synchronizeProgram() { writeLog(`Synchronizing program`); + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); clearInvalidateResolutionsOfFailedLookupLocations(); const program = getCurrentBuilderProgram(); if (hasChangedCompilerOptions) { @@ -120382,7 +123653,7 @@ function createWatchProgram(host) { scheduleProgramUpdate(); } function updateNewLine() { - return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile, () => host.getNewLine()); + return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile); } function toPath3(fileName) { return toPath(fileName, currentDirectory, getCanonicalFileName); @@ -120536,6 +123807,8 @@ function createWatchProgram(host) { } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); + Debug.assert(configFileName); reloadLevel = 0 /* None */; rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { @@ -120544,6 +123817,7 @@ function createWatchProgram(host) { synchronizeProgram(); } function reloadConfigFile() { + Debug.assert(configFileName); writeLog(`Reloading config file: ${configFileName}`); reloadLevel = 0 /* None */; if (cachedDirectoryStructureHost) { @@ -120556,6 +123830,7 @@ function createWatchProgram(host) { updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile); } function parseConfigFile2() { + Debug.assert(configFileName); setConfigFileParsingResult(getParsedCommandLineOfConfigFile( configFileName, optionsToExtendForConfigFile, @@ -120583,6 +123858,7 @@ function createWatchProgram(host) { return config.parsedCommandLine; if (config.parsedCommandLine && config.reloadLevel === 1 /* Partial */ && !host.getParsedCommandLine) { writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); const fileNames = getFileNamesFromConfigSpecs( config.parsedCommandLine.options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName2), currentDirectory), @@ -120674,7 +123950,8 @@ function createWatchProgram(host) { return watchDirectory( directory, (fileOrDirectory) => { - Debug.assert(!!configFileName); + Debug.assert(configFileName); + Debug.assert(compilerOptions); const fileOrDirectoryPath = toPath3(fileOrDirectory); if (cachedDirectoryStructureHost) { cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); @@ -120705,6 +123982,7 @@ function createWatchProgram(host) { ); } function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { + Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, @@ -123302,6 +126580,7 @@ __export(ts_exports3, { InferencePriority: () => InferencePriority, InlayHintKind: () => InlayHintKind, InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, InternalSymbolName: () => InternalSymbolName, InvalidatedProjectKind: () => InvalidatedProjectKind, JsDoc: () => ts_JsDoc_exports, @@ -123345,7 +126624,7 @@ __export(ts_exports3, { PollingInterval: () => PollingInterval, PollingWatchKind: () => PollingWatchKind, PragmaKindFlags: () => PragmaKindFlags, - PrivateIdentifierKind: () => PrivateIdentifierKind2, + PrivateIdentifierKind: () => PrivateIdentifierKind, ProcessLevel: () => ProcessLevel, QuotePreference: () => QuotePreference, RelationComparisonResult: () => RelationComparisonResult, @@ -123395,10 +126674,13 @@ __export(ts_exports3, { WatchFileKind: () => WatchFileKind, WatchLogLevel: () => WatchLogLevel, WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, addEmitFlags: () => addEmitFlags, addEmitHelper: () => addEmitHelper, addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, addRange: () => addRange, addRelatedInfo: () => addRelatedInfo, addSyntheticLeadingComment: () => addSyntheticLeadingComment, @@ -123469,6 +126751,7 @@ __export(ts_exports3, { changesAffectModuleResolution: () => changesAffectModuleResolution, changesAffectingProgramStructure: () => changesAffectingProgramStructure, childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, classPrivateFieldInHelper: () => classPrivateFieldInHelper, @@ -123517,6 +126800,7 @@ __export(ts_exports3, { compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, computeLineOfPosition: () => computeLineOfPosition, @@ -123534,7 +126818,6 @@ __export(ts_exports3, { containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, - convertEnableAutoDiscoveryToEnable: () => convertEnableAutoDiscoveryToEnable, convertJsonOption: () => convertJsonOption, convertToBase64: () => convertToBase64, convertToObject: () => convertToObject, @@ -123555,41 +126838,17 @@ __export(ts_exports3, { createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, - createAdd: () => createAdd, - createArrayBindingPattern: () => createArrayBindingPattern, - createArrayLiteral: () => createArrayLiteral, - createArrayTypeNode: () => createArrayTypeNode, - createArrowFunction: () => createArrowFunction, - createAsExpression: () => createAsExpression, - createAssignment: () => createAssignment, - createAwait: () => createAwait, createBaseNodeFactory: () => createBaseNodeFactory, - createBigIntLiteral: () => createBigIntLiteral, - createBinary: () => createBinary, createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, - createBindingElement: () => createBindingElement, createBindingHelper: () => createBindingHelper, - createBlock: () => createBlock, - createBreak: () => createBreak, createBuildInfo: () => createBuildInfo, createBuilderProgram: () => createBuilderProgram, createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, createBuilderStatusReporter: () => createBuilderStatusReporter, - createBundle: () => createBundle, createCacheWithRedirects: () => createCacheWithRedirects, createCacheableExportInfoMap: () => createCacheableExportInfoMap, createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, - createCall: () => createCall, - createCallChain: () => createCallChain, - createCallSignature: () => createCallSignature, - createCaseBlock: () => createCaseBlock, - createCaseClause: () => createCaseClause, - createCatchClause: () => createCatchClause, - createClassDeclaration: () => createClassDeclaration, - createClassExpression: () => createClassExpression, createClassifier: () => createClassifier, - createComma: () => createComma, - createCommaList: () => createCommaList, createCommentDirectivesMap: () => createCommentDirectivesMap, createCompilerDiagnostic: () => createCompilerDiagnostic, createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, @@ -123597,212 +126856,73 @@ __export(ts_exports3, { createCompilerHost: () => createCompilerHost, createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, createCompilerHostWorker: () => createCompilerHostWorker, - createComputedPropertyName: () => createComputedPropertyName, - createConditional: () => createConditional, - createConditionalTypeNode: () => createConditionalTypeNode, - createConstructSignature: () => createConstructSignature, - createConstructor: () => createConstructor, - createConstructorTypeNode: () => createConstructorTypeNode, - createContinue: () => createContinue, - createDebuggerStatement: () => createDebuggerStatement, - createDecorator: () => createDecorator, - createDefaultClause: () => createDefaultClause, - createDelete: () => createDelete, createDetachedDiagnostic: () => createDetachedDiagnostic, createDiagnosticCollection: () => createDiagnosticCollection, createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, createDiagnosticForNode: () => createDiagnosticForNode, createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, createDiagnosticForRange: () => createDiagnosticForRange, createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, createDiagnosticReporter: () => createDiagnosticReporter, - createDo: () => createDo, createDocumentPositionMapper: () => createDocumentPositionMapper, createDocumentRegistry: () => createDocumentRegistry, createDocumentRegistryInternal: () => createDocumentRegistryInternal, - createElementAccess: () => createElementAccess, - createElementAccessChain: () => createElementAccessChain, createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, createEmitHelperFactory: () => createEmitHelperFactory, createEmptyExports: () => createEmptyExports, - createEmptyStatement: () => createEmptyStatement, - createEnumDeclaration: () => createEnumDeclaration, - createEnumMember: () => createEnumMember, - createExportAssignment: () => createExportAssignment2, - createExportDeclaration: () => createExportDeclaration, - createExportDefault: () => createExportDefault, - createExportSpecifier: () => createExportSpecifier, createExpressionForJsxElement: () => createExpressionForJsxElement, createExpressionForJsxFragment: () => createExpressionForJsxFragment, createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, createExpressionForPropertyName: () => createExpressionForPropertyName, createExpressionFromEntityName: () => createExpressionFromEntityName, - createExpressionStatement: () => createExpressionStatement, - createExpressionWithTypeArguments: () => createExpressionWithTypeArguments, createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createExternalModuleExport: () => createExternalModuleExport, - createExternalModuleReference: () => createExternalModuleReference, - createFalse: () => createFalse, createFileDiagnostic: () => createFileDiagnostic, createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createFileLevelUniqueName: () => createFileLevelUniqueName, - createFor: () => createFor, - createForIn: () => createForIn, - createForOf: () => createForOf, createForOfBindingStatement: () => createForOfBindingStatement, - createFunctionDeclaration: () => createFunctionDeclaration, - createFunctionExpression: () => createFunctionExpression, - createFunctionTypeNode: () => createFunctionTypeNode, - createGetAccessor: () => createGetAccessor, createGetCanonicalFileName: () => createGetCanonicalFileName, createGetSourceFile: () => createGetSourceFile, createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, createGetSymbolWalker: () => createGetSymbolWalker, - createHeritageClause: () => createHeritageClause, - createIdentifier: () => createIdentifier, - createIf: () => createIf, - createImmediatelyInvokedArrowFunction: () => createImmediatelyInvokedArrowFunction, - createImmediatelyInvokedFunctionExpression: () => createImmediatelyInvokedFunctionExpression, - createImportClause: () => createImportClause, - createImportDeclaration: () => createImportDeclaration, - createImportEqualsDeclaration: () => createImportEqualsDeclaration, - createImportSpecifier: () => createImportSpecifier, - createImportTypeNode: () => createImportTypeNode, createIncrementalCompilerHost: () => createIncrementalCompilerHost, createIncrementalProgram: () => createIncrementalProgram, - createIndexSignature: () => createIndexSignature, - createIndexedAccessTypeNode: () => createIndexedAccessTypeNode, - createInferTypeNode: () => createInferTypeNode, createInputFiles: () => createInputFiles, createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, - createInterfaceDeclaration: () => createInterfaceDeclaration, - createIntersectionTypeNode: () => createIntersectionTypeNode, - createJSDocAugmentsTag: () => createJSDocAugmentsTag, - createJSDocAuthorTag: () => createJSDocAuthorTag, - createJSDocCallbackTag: () => createJSDocCallbackTag, - createJSDocClassTag: () => createJSDocClassTag, - createJSDocComment: () => createJSDocComment, - createJSDocEnumTag: () => createJSDocEnumTag, - createJSDocImplementsTag: () => createJSDocImplementsTag, - createJSDocParamTag: () => createJSDocParamTag, - createJSDocParameterTag: () => createJSDocParameterTag, - createJSDocPrivateTag: () => createJSDocPrivateTag, - createJSDocPropertyTag: () => createJSDocPropertyTag, - createJSDocProtectedTag: () => createJSDocProtectedTag, - createJSDocPublicTag: () => createJSDocPublicTag, - createJSDocReadonlyTag: () => createJSDocReadonlyTag, - createJSDocReturnTag: () => createJSDocReturnTag, - createJSDocSignature: () => createJSDocSignature, - createJSDocTag: () => createJSDocTag, - createJSDocTemplateTag: () => createJSDocTemplateTag, - createJSDocThisTag: () => createJSDocThisTag, - createJSDocTypeExpression: () => createJSDocTypeExpression, - createJSDocTypeLiteral: () => createJSDocTypeLiteral, - createJSDocTypeTag: () => createJSDocTypeTag, - createJSDocTypedefTag: () => createJSDocTypedefTag, - createJsxAttribute: () => createJsxAttribute, - createJsxAttributes: () => createJsxAttributes, - createJsxClosingElement: () => createJsxClosingElement, - createJsxElement: () => createJsxElement, - createJsxExpression: () => createJsxExpression, createJsxFactoryExpression: () => createJsxFactoryExpression, - createJsxFragment: () => createJsxFragment, - createJsxJsxClosingFragment: () => createJsxJsxClosingFragment, - createJsxOpeningElement: () => createJsxOpeningElement, - createJsxOpeningFragment: () => createJsxOpeningFragment, - createJsxSelfClosingElement: () => createJsxSelfClosingElement, - createJsxSpreadAttribute: () => createJsxSpreadAttribute, - createJsxText: () => createJsxText, - createKeywordTypeNode: () => createKeywordTypeNode, - createLabel: () => createLabel, createLanguageService: () => createLanguageService, createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createLessThan: () => createLessThan, - createLiteral: () => createLiteral, - createLiteralTypeNode: () => createLiteralTypeNode, - createLogicalAnd: () => createLogicalAnd, - createLogicalNot: () => createLogicalNot, - createLogicalOr: () => createLogicalOr, - createLoopVariable: () => createLoopVariable, - createMappedTypeNode: () => createMappedTypeNode, createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createMetaProperty: () => createMetaProperty, - createMethod: () => createMethod, - createMethodSignature: () => createMethodSignature, createModeAwareCache: () => createModeAwareCache, createModeAwareCacheKey: () => createModeAwareCacheKey, - createModifier: () => createModifier, - createModifiersFromModifierFlags: () => createModifiersFromModifierFlags, - createModuleBlock: () => createModuleBlock, - createModuleDeclaration: () => createModuleDeclaration, createModuleResolutionCache: () => createModuleResolutionCache, createModuleResolutionLoader: () => createModuleResolutionLoader, createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, createMultiMap: () => createMultiMap, - createNamedExports: () => createNamedExports, - createNamedImports: () => createNamedImports, - createNamespaceExport: () => createNamespaceExport, - createNamespaceExportDeclaration: () => createNamespaceExportDeclaration, - createNamespaceImport: () => createNamespaceImport, - createNew: () => createNew, - createNoSubstitutionTemplateLiteral: () => createNoSubstitutionTemplateLiteral, - createNode: () => createNode2, - createNodeArray: () => createNodeArray, createNodeConverters: () => createNodeConverters, createNodeFactory: () => createNodeFactory, - createNonNullChain: () => createNonNullChain, - createNonNullExpression: () => createNonNullExpression, - createNotEmittedStatement: () => createNotEmittedStatement, - createNull: () => createNull, - createNumericLiteral: () => createNumericLiteral, - createObjectBindingPattern: () => createObjectBindingPattern, - createObjectLiteral: () => createObjectLiteral, - createOmittedExpression: () => createOmittedExpression, - createOptimisticUniqueName: () => createOptimisticUniqueName, createOptionNameMap: () => createOptionNameMap, - createOptionalTypeNode: () => createOptionalTypeNode, createOverload: () => createOverload, createPackageJsonImportFilter: () => createPackageJsonImportFilter, createPackageJsonInfo: () => createPackageJsonInfo, - createParameter: () => createParameter, - createParen: () => createParen, - createParenthesizedType: () => createParenthesizedType, createParenthesizerRules: () => createParenthesizerRules, - createPartiallyEmittedExpression: () => createPartiallyEmittedExpression, createPatternMatcher: () => createPatternMatcher, - createPostfix: () => createPostfix, - createPostfixIncrement: () => createPostfixIncrement, - createPrefix: () => createPrefix, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, - createPrivateIdentifier: () => createPrivateIdentifier, createProgram: () => createProgram, createProgramHost: () => createProgramHost, - createProperty: () => createProperty, - createPropertyAccess: () => createPropertyAccess, - createPropertyAccessChain: () => createPropertyAccessChain, - createPropertyAssignment: () => createPropertyAssignment, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, - createPropertySignature: () => createPropertySignature, - createQualifiedName: () => createQualifiedName, createQueue: () => createQueue, createRange: () => createRange, createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, - createRegularExpressionLiteral: () => createRegularExpressionLiteral, createResolutionCache: () => createResolutionCache, - createRestTypeNode: () => createRestTypeNode, - createReturn: () => createReturn, createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, createScanner: () => createScanner, createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, - createSemicolonClassElement: () => createSemicolonClassElement, createSet: () => createSet, - createSetAccessor: () => createSetAccessor, - createShorthandPropertyAssignment: () => createShorthandPropertyAssignment, createSolutionBuilder: () => createSolutionBuilder, createSolutionBuilderHost: () => createSolutionBuilderHost, createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, @@ -123811,27 +126931,10 @@ __export(ts_exports3, { createSourceFile: () => createSourceFile, createSourceMapGenerator: () => createSourceMapGenerator, createSourceMapSource: () => createSourceMapSource, - createSpread: () => createSpread, - createSpreadAssignment: () => createSpreadAssignment, - createStatement: () => createStatement, - createStrictEquality: () => createStrictEquality, - createStrictInequality: () => createStrictInequality, - createStringLiteral: () => createStringLiteral, - createStringLiteralFromNode: () => createStringLiteralFromNode, - createSubtract: () => createSubtract, - createSuper: () => createSuper, createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, - createSwitch: () => createSwitch, createSymbolTable: () => createSymbolTable, createSymlinkCache: () => createSymlinkCache, createSystemWatchFunctions: () => createSystemWatchFunctions, - createTaggedTemplate: () => createTaggedTemplate, - createTempVariable: () => createTempVariable, - createTemplateExpression: () => createTemplateExpression, - createTemplateHead: () => createTemplateHead, - createTemplateMiddle: () => createTemplateMiddle, - createTemplateSpan: () => createTemplateSpan, - createTemplateTail: () => createTemplateTail, createTextChange: () => createTextChange, createTextChangeFromStartLength: () => createTextChangeFromStartLength, createTextChangeRange: () => createTextChangeRange, @@ -123843,36 +126946,12 @@ __export(ts_exports3, { createTextSpanFromRange: () => createTextSpanFromRange, createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, createTextWriter: () => createTextWriter, - createThis: () => createThis, - createThisTypeNode: () => createThisTypeNode, - createThrow: () => createThrow, - createToken: () => createToken, createTokenRange: () => createTokenRange, - createTrue: () => createTrue, - createTry: () => createTry, - createTupleTypeNode: () => createTupleTypeNode, - createTypeAliasDeclaration: () => createTypeAliasDeclaration, - createTypeAssertion: () => createTypeAssertion, createTypeChecker: () => createTypeChecker, - createTypeLiteralNode: () => createTypeLiteralNode, - createTypeOf: () => createTypeOf, - createTypeOperatorNode: () => createTypeOperatorNode, - createTypeParameterDeclaration: () => createTypeParameterDeclaration, - createTypePredicateNode: () => createTypePredicateNode, - createTypePredicateNodeWithModifier: () => createTypePredicateNodeWithModifier, - createTypeQueryNode: () => createTypeQueryNode, createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, - createTypeReferenceNode: () => createTypeReferenceNode, createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap, - createUnionTypeNode: () => createUnionTypeNode, - createUniqueName: () => createUniqueName, createUnparsedSourceFile: () => createUnparsedSourceFile, - createVariableDeclaration: () => createVariableDeclaration, - createVariableDeclarationList: () => createVariableDeclarationList, - createVariableStatement: () => createVariableStatement, - createVoid: () => createVoid, - createVoidZero: () => createVoidZero, createWatchCompilerHost: () => createWatchCompilerHost2, createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, @@ -123880,10 +126959,7 @@ __export(ts_exports3, { createWatchHost: () => createWatchHost, createWatchProgram: () => createWatchProgram, createWatchStatusReporter: () => createWatchStatusReporter, - createWhile: () => createWhile, - createWith: () => createWith, createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - createYield: () => createYield, declarationNameToString: () => declarationNameToString, decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, @@ -123930,6 +127006,7 @@ __export(ts_exports3, { equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, equateStringsCaseSensitive: () => equateStringsCaseSensitive, equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, escapeJsxAttributeString: () => escapeJsxAttributeString, escapeLeadingUnderscores: () => escapeLeadingUnderscores, escapeNonAsciiString: () => escapeNonAsciiString, @@ -123958,6 +127035,7 @@ __export(ts_exports3, { findAncestor: () => findAncestor, findBestPatternMatch: () => findBestPatternMatch, findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, findConfigFile: () => findConfigFile, findContainingList: () => findContainingList, findDiagnosticForNode: () => findDiagnosticForNode, @@ -123988,6 +127066,7 @@ __export(ts_exports3, { flatMapIterator: () => flatMapIterator, flatMapToMutable: () => flatMapToMutable, flatten: () => flatten, + flattenCommaList: () => flattenCommaList, flattenDestructuringAssignment: () => flattenDestructuringAssignment, flattenDestructuringBinding: () => flattenDestructuringBinding, flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, @@ -124093,6 +127172,7 @@ __export(ts_exports3, { getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, getDecorators: () => getDecorators, getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, getDefaultLibFileName: () => getDefaultLibFileName, getDefaultLibFilePath: () => getDefaultLibFilePath, @@ -124164,9 +127244,11 @@ __export(ts_exports3, { getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, getFullWidth: () => getFullWidth, getFunctionFlags: () => getFunctionFlags, - getGeneratedNameForNode: () => getGeneratedNameForNode, getHeritageClause: () => getHeritageClause, getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, @@ -124178,7 +127260,9 @@ __export(ts_exports3, { getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, getJSDocAugmentsTag: () => getJSDocAugmentsTag, getJSDocClassTag: () => getJSDocClassTag, getJSDocCommentRanges: () => getJSDocCommentRanges, @@ -124202,6 +127286,8 @@ __export(ts_exports3, { getJSDocReturnTag: () => getJSDocReturnTag, getJSDocReturnType: () => getJSDocReturnType, getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, getJSDocTags: () => getJSDocTags, getJSDocTagsNoCache: () => getJSDocTagsNoCache, getJSDocTemplateTag: () => getJSDocTemplateTag, @@ -124256,7 +127342,6 @@ __export(ts_exports3, { getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, - getMutableClone: () => getMutableClone, getNameForExportedSymbol: () => getNameForExportedSymbol, getNameFromIndexInfo: () => getNameFromIndexInfo, getNameFromPropertyName: () => getNameFromPropertyName, @@ -124330,6 +127415,7 @@ __export(ts_exports3, { getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, getPreEmitDiagnostics: () => getPreEmitDiagnostics, getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, getProperties: () => getProperties, getProperty: () => getProperty, getPropertyArrayElementValue: () => getPropertyArrayElementValue, @@ -124455,6 +127541,7 @@ __export(ts_exports3, { getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, getWatchFactory: () => getWatchFactory, group: () => group, + groupBy: () => groupBy, guessIndentation: () => guessIndentation, handleNoEmitOptions: () => handleNoEmitOptions, hasAbstractModifier: () => hasAbstractModifier, @@ -124500,12 +127587,14 @@ __export(ts_exports3, { hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, idText: () => idText, identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, identity: () => identity, identitySourceMapConsumer: () => identitySourceMapConsumer, ignoreSourceNewlines: () => ignoreSourceNewlines, ignoredPaths: () => ignoredPaths, importDefaultHelper: () => importDefaultHelper, importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, importStarHelper: () => importStarHelper, indexOfAnyCharCode: () => indexOfAnyCharCode, indexOfNode: () => indexOfNode, @@ -124531,6 +127620,7 @@ __export(ts_exports3, { isAliasableExpression: () => isAliasableExpression, isAmbientModule: () => isAmbientModule, isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, isAnyDirectorySeparator: () => isAnyDirectorySeparator, isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, isAnyImportOrReExport: () => isAnyImportOrReExport, @@ -124540,6 +127630,7 @@ __export(ts_exports3, { isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, isArray: () => isArray, isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, isArrayBindingPattern: () => isArrayBindingPattern, isArrayLiteralExpression: () => isArrayLiteralExpression, @@ -124571,7 +127662,9 @@ __export(ts_exports3, { isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, isBindableStaticNameExpression: () => isBindableStaticNameExpression, isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, isBindingPattern: () => isBindingPattern, isBlock: () => isBlock, @@ -124612,6 +127705,7 @@ __export(ts_exports3, { isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, isCollapsedRange: () => isCollapsedRange, isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, isCommaListExpression: () => isCommaListExpression, isCommaSequence: () => isCommaSequence, isCommaToken: () => isCommaToken, @@ -124645,6 +127739,7 @@ __export(ts_exports3, { isDecoratorTarget: () => isDecoratorTarget, isDefaultClause: () => isDefaultClause, isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, isDeleteExpression: () => isDeleteExpression, isDeleteTarget: () => isDeleteTarget, @@ -124668,6 +127763,7 @@ __export(ts_exports3, { isEmptyBindingPattern: () => isEmptyBindingPattern, isEmptyObjectLiteral: () => isEmptyObjectLiteral, isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, isEndOfDeclarationMarker: () => isEndOfDeclarationMarker, isEntityName: () => isEntityName, isEntityNameExpression: () => isEntityNameExpression, @@ -124684,6 +127780,7 @@ __export(ts_exports3, { isExportModifier: () => isExportModifier, isExportName: () => isExportName, isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, isExportSpecifier: () => isExportSpecifier, isExportsIdentifier: () => isExportsIdentifier, isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, @@ -124738,7 +127835,6 @@ __export(ts_exports3, { isIdentifier: () => isIdentifier, isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, isIdentifierName: () => isIdentifierName, - isIdentifierOrPrivateIdentifier: () => isIdentifierOrPrivateIdentifier, isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, isIdentifierPart: () => isIdentifierPart, isIdentifierStart: () => isIdentifierStart, @@ -124778,6 +127874,7 @@ __export(ts_exports3, { isInferTypeNode: () => isInferTypeNode, isInfinityOrNaNString: () => isInfinityOrNaNString, isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, isInsideJsxElement: () => isInsideJsxElement, isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, isInsideNodeModules: () => isInsideNodeModules, @@ -124827,6 +127924,8 @@ __export(ts_exports3, { isJSDocPublicTag: () => isJSDocPublicTag, isJSDocReadonlyTag: () => isJSDocReadonlyTag, isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, isJSDocSeeTag: () => isJSDocSeeTag, isJSDocSignature: () => isJSDocSignature, isJSDocTag: () => isJSDocTag, @@ -124882,11 +127981,14 @@ __export(ts_exports3, { isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, isLiteralTypeNode: () => isLiteralTypeNode, isLocalName: () => isLocalName, isLogicalOperator: () => isLogicalOperator, isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, isMappedTypeNode: () => isMappedTypeNode, isMemberName: () => isMemberName, isMergeDeclarationMarker: () => isMergeDeclarationMarker, @@ -124914,6 +128016,8 @@ __export(ts_exports3, { isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, isNamedClassElement: () => isNamedClassElement, isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, isNamedExportBindings: () => isNamedExportBindings, isNamedExports: () => isNamedExports, isNamedImportBindings: () => isNamedImportBindings, @@ -124938,6 +128042,7 @@ __export(ts_exports3, { isNodeModulesDirectory: () => isNodeModulesDirectory, isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, isNonGlobalDeclaration: () => isNonGlobalDeclaration, isNonNullAccess: () => isNonNullAccess, @@ -125006,6 +128111,7 @@ __export(ts_exports3, { isPropertyName: () => isPropertyName, isPropertyNameLiteral: () => isPropertyNameLiteral, isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, isPrototypeAccess: () => isPrototypeAccess, isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, isPunctuation: () => isPunctuation, @@ -125117,7 +128223,6 @@ __export(ts_exports3, { isTupleTypeNode: () => isTupleTypeNode, isTypeAlias: () => isTypeAlias, isTypeAliasDeclaration: () => isTypeAliasDeclaration, - isTypeAssertion: () => isTypeAssertion, isTypeAssertionExpression: () => isTypeAssertionExpression, isTypeDeclaration: () => isTypeDeclaration, isTypeElement: () => isTypeElement, @@ -125127,8 +128232,9 @@ __export(ts_exports3, { isTypeLiteralNode: () => isTypeLiteralNode, isTypeNode: () => isTypeNode, isTypeNodeKind: () => isTypeNodeKind, - isTypeNodeOrTypeParameterDeclaration: () => isTypeNodeOrTypeParameterDeclaration, isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, isTypeOperatorNode: () => isTypeOperatorNode, isTypeParameterDeclaration: () => isTypeParameterDeclaration, @@ -125203,6 +128309,7 @@ __export(ts_exports3, { maybeBind: () => maybeBind, maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, memoize: () => memoize, + memoizeCached: () => memoizeCached, memoizeOne: () => memoizeOne, memoizeWeak: () => memoizeWeak, metadataHelper: () => metadataHelper, @@ -125228,6 +128335,7 @@ __export(ts_exports3, { mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, noTransformers: () => noTransformers, @@ -125321,6 +128429,7 @@ __export(ts_exports3, { programContainsEsModules: () => programContainsEsModules, programContainsModules: () => programContainsModules, projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, propertyNamePart: () => propertyNamePart, pseudoBigIntToString: () => pseudoBigIntToString, punctuationPart: () => punctuationPart, @@ -125385,10 +128494,12 @@ __export(ts_exports3, { returnTrue: () => returnTrue, returnUndefined: () => returnUndefined, returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, sameFlatMap: () => sameFlatMap, sameMap: () => sameMap, sameMapping: () => sameMapping, scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, scanner: () => scanner, screenStartingMessageCodes: () => screenStartingMessageCodes, semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, @@ -125400,7 +128511,12 @@ __export(ts_exports3, { setConstantValue: () => setConstantValue, setEachParent: () => setEachParent, setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, setModuleDefaultHelper: () => setModuleDefaultHelper, setNodeFlags: () => setNodeFlags, @@ -125408,6 +128524,7 @@ __export(ts_exports3, { setOriginalNode: () => setOriginalNode, setParent: () => setParent, setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, setResolvedModule: () => setResolvedModule, setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective, setSnippetElement: () => setSnippetElement, @@ -125448,6 +128565,7 @@ __export(ts_exports3, { skipTrivia: () => skipTrivia, skipTypeChecking: () => skipTypeChecking, skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, sliceAfter: () => sliceAfter, some: () => some, sort: () => sort, @@ -125542,6 +128660,7 @@ __export(ts_exports3, { transformES2020: () => transformES2020, transformES2021: () => transformES2021, transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, transformESNext: () => transformESNext, transformGenerators: () => transformGenerators, transformJsx: () => transformJsx, @@ -125568,6 +128687,7 @@ __export(ts_exports3, { tryGetDirectories: () => tryGetDirectories, tryGetExtensionFromPath: () => tryGetExtensionFromPath2, tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, @@ -125602,148 +128722,14 @@ __export(ts_exports3, { unreachableCodeIsError: () => unreachableCodeIsError, unusedLabelIsError: () => unusedLabelIsError, unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, - updateArrayBindingPattern: () => updateArrayBindingPattern, - updateArrayLiteral: () => updateArrayLiteral, - updateArrayTypeNode: () => updateArrayTypeNode, - updateArrowFunction: () => updateArrowFunction, - updateAsExpression: () => updateAsExpression, - updateAwait: () => updateAwait, - updateBinary: () => updateBinary, - updateBindingElement: () => updateBindingElement, - updateBlock: () => updateBlock, - updateBreak: () => updateBreak, - updateBundle: () => updateBundle, - updateCall: () => updateCall, - updateCallChain: () => updateCallChain, - updateCallSignature: () => updateCallSignature, - updateCaseBlock: () => updateCaseBlock, - updateCaseClause: () => updateCaseClause, - updateCatchClause: () => updateCatchClause, - updateClassDeclaration: () => updateClassDeclaration, - updateClassExpression: () => updateClassExpression, - updateCommaList: () => updateCommaList, - updateComputedPropertyName: () => updateComputedPropertyName, - updateConditional: () => updateConditional, - updateConditionalTypeNode: () => updateConditionalTypeNode, - updateConstructSignature: () => updateConstructSignature, - updateConstructor: () => updateConstructor, - updateConstructorTypeNode: () => updateConstructorTypeNode, - updateContinue: () => updateContinue, - updateDecorator: () => updateDecorator, - updateDefaultClause: () => updateDefaultClause, - updateDelete: () => updateDelete, - updateDo: () => updateDo, - updateElementAccess: () => updateElementAccess, - updateElementAccessChain: () => updateElementAccessChain, - updateEnumDeclaration: () => updateEnumDeclaration, - updateEnumMember: () => updateEnumMember, updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, - updateExportAssignment: () => updateExportAssignment, - updateExportDeclaration: () => updateExportDeclaration, - updateExportSpecifier: () => updateExportSpecifier, - updateExpressionStatement: () => updateExpressionStatement, - updateExpressionWithTypeArguments: () => updateExpressionWithTypeArguments, - updateExternalModuleReference: () => updateExternalModuleReference, - updateFor: () => updateFor, - updateForIn: () => updateForIn, - updateForOf: () => updateForOf, - updateFunctionDeclaration: () => updateFunctionDeclaration, - updateFunctionExpression: () => updateFunctionExpression, - updateFunctionTypeNode: () => updateFunctionTypeNode, - updateGetAccessor: () => updateGetAccessor, - updateHeritageClause: () => updateHeritageClause, - updateIf: () => updateIf, - updateImportClause: () => updateImportClause, - updateImportDeclaration: () => updateImportDeclaration, - updateImportEqualsDeclaration: () => updateImportEqualsDeclaration, - updateImportSpecifier: () => updateImportSpecifier, - updateImportTypeNode: () => updateImportTypeNode, - updateIndexSignature: () => updateIndexSignature, - updateIndexedAccessTypeNode: () => updateIndexedAccessTypeNode, - updateInferTypeNode: () => updateInferTypeNode, - updateInterfaceDeclaration: () => updateInterfaceDeclaration, - updateIntersectionTypeNode: () => updateIntersectionTypeNode, - updateJsxAttribute: () => updateJsxAttribute, - updateJsxAttributes: () => updateJsxAttributes, - updateJsxClosingElement: () => updateJsxClosingElement, - updateJsxElement: () => updateJsxElement, - updateJsxExpression: () => updateJsxExpression, - updateJsxFragment: () => updateJsxFragment, - updateJsxOpeningElement: () => updateJsxOpeningElement, - updateJsxSelfClosingElement: () => updateJsxSelfClosingElement, - updateJsxSpreadAttribute: () => updateJsxSpreadAttribute, - updateJsxText: () => updateJsxText, - updateLabel: () => updateLabel, updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, - updateLiteralTypeNode: () => updateLiteralTypeNode, - updateMappedTypeNode: () => updateMappedTypeNode, - updateMetaProperty: () => updateMetaProperty, - updateMethod: () => updateMethod, - updateMethodSignature: () => updateMethodSignature, updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updateModuleBlock: () => updateModuleBlock, - updateModuleDeclaration: () => updateModuleDeclaration, - updateNamedExports: () => updateNamedExports, - updateNamedImports: () => updateNamedImports, - updateNamespaceExport: () => updateNamespaceExport, - updateNamespaceExportDeclaration: () => updateNamespaceExportDeclaration, - updateNamespaceImport: () => updateNamespaceImport, - updateNew: () => updateNew, - updateNonNullChain: () => updateNonNullChain, - updateNonNullExpression: () => updateNonNullExpression, - updateObjectBindingPattern: () => updateObjectBindingPattern, - updateObjectLiteral: () => updateObjectLiteral, - updateOptionalTypeNode: () => updateOptionalTypeNode, updatePackageJsonWatch: () => updatePackageJsonWatch, - updateParameter: () => updateParameter, - updateParen: () => updateParen, - updateParenthesizedType: () => updateParenthesizedType, - updatePartiallyEmittedExpression: () => updatePartiallyEmittedExpression, - updatePostfix: () => updatePostfix, - updatePrefix: () => updatePrefix, - updateProperty: () => updateProperty, - updatePropertyAccess: () => updatePropertyAccess, - updatePropertyAccessChain: () => updatePropertyAccessChain, - updatePropertyAssignment: () => updatePropertyAssignment, - updatePropertySignature: () => updatePropertySignature, - updateQualifiedName: () => updateQualifiedName, updateResolutionField: () => updateResolutionField, - updateRestTypeNode: () => updateRestTypeNode, - updateReturn: () => updateReturn, - updateSetAccessor: () => updateSetAccessor, updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, - updateShorthandPropertyAssignment: () => updateShorthandPropertyAssignment, updateSourceFile: () => updateSourceFile, - updateSourceFileNode: () => updateSourceFileNode, - updateSpread: () => updateSpread, - updateSpreadAssignment: () => updateSpreadAssignment, - updateStatement: () => updateStatement, - updateSwitch: () => updateSwitch, - updateTaggedTemplate: () => updateTaggedTemplate, - updateTemplateExpression: () => updateTemplateExpression, - updateTemplateSpan: () => updateTemplateSpan, - updateThrow: () => updateThrow, - updateTry: () => updateTry, - updateTupleTypeNode: () => updateTupleTypeNode, - updateTypeAliasDeclaration: () => updateTypeAliasDeclaration, - updateTypeAssertion: () => updateTypeAssertion, - updateTypeLiteralNode: () => updateTypeLiteralNode, - updateTypeOf: () => updateTypeOf, - updateTypeOperatorNode: () => updateTypeOperatorNode, - updateTypeParameterDeclaration: () => updateTypeParameterDeclaration, - updateTypePredicateNode: () => updateTypePredicateNode, - updateTypePredicateNodeWithModifier: () => updateTypePredicateNodeWithModifier, - updateTypeQueryNode: () => updateTypeQueryNode, - updateTypeReferenceNode: () => updateTypeReferenceNode, - updateUnionTypeNode: () => updateUnionTypeNode, - updateVariableDeclaration: () => updateVariableDeclaration, - updateVariableDeclarationList: () => updateVariableDeclarationList, - updateVariableStatement: () => updateVariableStatement, - updateVoid: () => updateVoid, updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, - updateWhile: () => updateWhile, - updateWith: () => updateWith, - updateYield: () => updateYield, usesExtensionsOnImports: () => usesExtensionsOnImports, usingSingleLineStringWriter: () => usingSingleLineStringWriter, utf16EncodeAsString: () => utf16EncodeAsString, @@ -125752,6 +128738,7 @@ __export(ts_exports3, { version: () => version, versionMajorMinor: () => versionMajorMinor, visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, visitEachChild: () => visitEachChild, visitFunctionBody: () => visitFunctionBody, visitIterationBody: () => visitIterationBody, @@ -125760,6 +128747,8 @@ __export(ts_exports3, { visitNodes: () => visitNodes2, visitParameterList: () => visitParameterList, walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, @@ -126658,7 +129647,7 @@ function findContainingList(node) { Debug.assert(!syntaxList || contains(syntaxList.getChildren(), node)); return syntaxList; } -function isDefaultModifier(node) { +function isDefaultModifier2(node) { return node.kind === 88 /* DefaultKeyword */; } function isClassKeyword(node) { @@ -126672,7 +129661,7 @@ function getAdjustedLocationForClass(node) { return node.name; } if (isClassDeclaration(node)) { - const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier); + const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier2); if (defaultModifier) return defaultModifier; } @@ -126687,7 +129676,7 @@ function getAdjustedLocationForFunction(node) { return node.name; } if (isFunctionDeclaration(node)) { - const defaultModifier = find(node.modifiers, isDefaultModifier); + const defaultModifier = find(node.modifiers, isDefaultModifier2); if (defaultModifier) return defaultModifier; } @@ -127631,16 +130620,19 @@ function spanContainsNode(span, node, file) { function findModifier(node, kind) { return canHaveModifiers(node) ? find(node.modifiers, (m) => m.kind === kind) : void 0; } -function insertImports(changes, sourceFile, imports, blankLineBetween) { +function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) { const decl = isArray(imports) ? imports[0] : imports; const importKindPredicate = decl.kind === 240 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; const existingImportStatements = filter(sourceFile.statements, importKindPredicate); - const sortedNewImports = isArray(imports) ? stableSort(imports, ts_OrganizeImports_exports.compareImportsOrRequireStatements) : [imports]; + let sortKind = isArray(imports) ? ts_OrganizeImports_exports.detectImportDeclarationSorting(imports, preferences) : 3 /* Both */; + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); + const sortedNewImports = isArray(imports) ? stableSort(imports, (a, b) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a, b, comparer)) : [imports]; if (!existingImportStatements.length) { changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); - } else if (existingImportStatements && ts_OrganizeImports_exports.detectImportDeclarationSorting(existingImportStatements)) { + } else if (existingImportStatements && (sortKind = ts_OrganizeImports_exports.detectImportDeclarationSorting(existingImportStatements, preferences))) { + const comparer2 = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); for (const newImport of sortedNewImports) { - const insertionIndex = ts_OrganizeImports_exports.getImportDeclarationInsertionIndex(existingImportStatements, newImport); + const insertionIndex = ts_OrganizeImports_exports.getImportDeclarationInsertionIndex(existingImportStatements, newImport, comparer2); if (insertionIndex === 0) { const options = existingImportStatements[0] === sourceFile.statements[0] ? { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude } : {}; changes.insertNodeBefore( @@ -127970,10 +130962,10 @@ function findLinkNameEnd(text) { } return 0; } -var carriageReturnLineFeed2 = "\r\n"; +var lineFeed2 = "\n"; function getNewLineOrDefaultFromHost(host, formatSettings) { var _a2; - return (formatSettings == null ? void 0 : formatSettings.newLineCharacter) || ((_a2 = host.getNewLine) == null ? void 0 : _a2.call(host)) || carriageReturnLineFeed2; + return (formatSettings == null ? void 0 : formatSettings.newLineCharacter) || ((_a2 = host.getNewLine) == null ? void 0 : _a2.call(host)) || lineFeed2; } function lineBreakPart() { return displayPart("\n", 6 /* lineBreak */); @@ -128693,7 +131685,7 @@ function isNonGlobalDeclaration(declaration) { if (!sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) { return false; } - return isInJSFile(declaration) || !findAncestor(declaration, isGlobalScopeAugmentation); + return isInJSFile(declaration) || !findAncestor(declaration, (d) => isModuleDeclaration(d) && isGlobalScopeAugmentation(d)); } function isDeprecatedDeclaration(decl) { return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 8192 /* Deprecated */); @@ -128992,7 +131984,7 @@ function forEachExternalModuleToImportFrom(program, host, preferences, useAutoIm } function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) { var _a2; - const isExcluded = (fileName) => excludePatterns == null ? void 0 : excludePatterns.some((p) => p.test(fileName)); + const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName))); for (const ambient of checker.getAmbientModules()) { if (!stringContains(ambient.name, "*") && !(excludePatterns && ((_a2 = ambient.declarations) == null ? void 0 : _a2.every((d) => isExcluded(d.getSourceFile().fileName))))) { cb( @@ -129003,7 +131995,7 @@ function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) { } } for (const sourceFile of allSourceFiles) { - if (isExternalOrCommonJsModule(sourceFile) && !isExcluded(sourceFile.fileName)) { + if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile.fileName))) { cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile); } } @@ -129100,10 +132092,10 @@ function getDefaultLikeExportWorker(moduleSymbol, checker) { function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) { const localSymbol = getLocalSymbolForExportDefault(defaultExport); if (localSymbol) - return { symbolForMeaning: localSymbol, name: localSymbol.name }; + return { resolvedSymbol: localSymbol, name: localSymbol.name }; const name = getNameForExportDefault(defaultExport); if (name !== void 0) - return { symbolForMeaning: defaultExport, name }; + return { resolvedSymbol: defaultExport, name }; if (defaultExport.flags & 2097152 /* Alias */) { const aliased = checker.getImmediateAliasedSymbol(defaultExport); if (aliased && aliased.parent) { @@ -129111,9 +132103,9 @@ function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) { } } if (defaultExport.escapedName !== "default" /* Default */ && defaultExport.escapedName !== "export=" /* ExportEquals */) { - return { symbolForMeaning: defaultExport, name: defaultExport.getName() }; + return { resolvedSymbol: defaultExport, name: defaultExport.getName() }; } - return { symbolForMeaning: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) }; + return { resolvedSymbol: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) }; } function getNameForExportDefault(symbol) { return symbol.declarations && firstDefined(symbol.declarations, (declaration) => { @@ -132918,7 +135910,7 @@ var NodeObject = class { if (!children.length) { return void 0; } - const child = find(children, (kid) => kid.kind < 312 /* FirstJSDocNode */ || kid.kind > 352 /* LastJSDocNode */); + const child = find(children, (kid) => kid.kind < 312 /* FirstJSDocNode */ || kid.kind > 353 /* LastJSDocNode */); return child.kind < 163 /* FirstNode */ ? child : child.getFirstToken(sourceFile); } getLastToken(sourceFile) { @@ -132985,7 +135977,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) { } } function createSyntaxList(nodes, parent2) { - const list = createNode(353 /* SyntaxList */, nodes.pos, nodes.end, parent2); + const list = createNode(354 /* SyntaxList */, nodes.pos, nodes.end, parent2); list._children = []; let pos = nodes.pos; for (const node of nodes) { @@ -133813,7 +136805,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h getCancellationToken: () => cancellationToken, getCanonicalFileName, useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, - getNewLine: () => getNewLineCharacter(newSettings, () => getNewLineOrDefaultFromHost(host)), + getNewLine: () => getNewLineCharacter(newSettings), getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2), writeFile: noop, getCurrentDirectory: () => currentDirectory, @@ -134359,22 +137351,22 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h } return []; } - function getCodeFixesAtPosition(fileName, start2, end, errorCodes64, formatOptions, preferences = emptyOptions) { + function getCodeFixesAtPosition(fileName, start2, end, errorCodes63, formatOptions, preferences = emptyOptions) { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); const span = createTextSpanFromBounds(start2, end); const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - return flatMap(deduplicate(errorCodes64, equateValues, compareValues), (errorCode) => { + return flatMap(deduplicate(errorCodes63, equateValues, compareValues), (errorCode) => { cancellationToken.throwIfCancellationRequested(); return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences }); }); } - function getCombinedCodeFix(scope, fixId52, formatOptions, preferences = emptyOptions) { + function getCombinedCodeFix(scope, fixId51, formatOptions, preferences = emptyOptions) { synchronizeHostData(); Debug.assert(scope.type === "file"); const sourceFile = getValidSourceFile(scope.fileName); const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - return ts_codefix_exports.getAllFixes({ fixId: fixId52, sourceFile, program, host, cancellationToken, formatContext, preferences }); + return ts_codefix_exports.getAllFixes({ fixId: fixId51, sourceFile, program, host, cancellationToken, formatContext, preferences }); } function organizeImports2(args, formatOptions, preferences = emptyOptions) { var _a3; @@ -134398,7 +137390,11 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); } function getDocCommentTemplateAtPosition2(fileName, position, options) { - return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost( + host, + /*formatSettings*/ + void 0 + ), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); } function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { if (openingBrace === 60 /* lessThan */) { @@ -135301,7 +138297,11 @@ var LanguageServiceShimObject = class extends ShimBase { ); } realizeDiagnostics(diagnostics) { - const newLine = getNewLineOrDefaultFromHost(this.host); + const newLine = getNewLineOrDefaultFromHost( + this.host, + /*formatSettings*/ + void 0 + ); return realizeDiagnostics(diagnostics, newLine); } getSyntacticClassifications(fileName, start2, length2) { @@ -136432,9 +139432,9 @@ function getCallHierarchyDeclarationReferenceNode(node) { return node.name; if (isConstNamedExpression(node)) return node.parent.name; - return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier2)); + return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier3)); } -function isDefaultModifier2(node) { +function isDefaultModifier3(node) { return node.kind === 88 /* DefaultKeyword */; } function getSymbolOfCallHierarchyDeclaration(typeChecker, node) { @@ -136446,7 +139446,7 @@ function getCallHierarchyItemName(program, node) { return { text: node.fileName, pos: 0, end: 0 }; } if ((isFunctionDeclaration(node) || isClassDeclaration(node)) && !isNamedDeclaration(node)) { - const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier2); + const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier3); if (defaultModifier) { return { text: "default", pos: defaultModifier.getStart(), end: defaultModifier.getEnd() }; } @@ -137153,23 +140153,23 @@ function createCodeFixActionWithoutFixAll(fixName8, changes, description2) { void 0 ); } -function createCodeFixAction(fixName8, changes, description2, fixId52, fixAllDescription, command) { - return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId52, diagnosticToString(fixAllDescription), command); +function createCodeFixAction(fixName8, changes, description2, fixId51, fixAllDescription, command) { + return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId51, diagnosticToString(fixAllDescription), command); } -function createCodeFixActionMaybeFixAll(fixName8, changes, description2, fixId52, fixAllDescription, command) { - return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId52, fixAllDescription && diagnosticToString(fixAllDescription), command); +function createCodeFixActionMaybeFixAll(fixName8, changes, description2, fixId51, fixAllDescription, command) { + return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId51, fixAllDescription && diagnosticToString(fixAllDescription), command); } -function createCodeFixActionWorker(fixName8, description2, changes, fixId52, fixAllDescription, command) { - return { fixName: fixName8, description: description2, changes, fixId: fixId52, fixAllDescription, commands: command ? [command] : void 0 }; +function createCodeFixActionWorker(fixName8, description2, changes, fixId51, fixAllDescription, command) { + return { fixName: fixName8, description: description2, changes, fixId: fixId51, fixAllDescription, commands: command ? [command] : void 0 }; } function registerCodeFix(reg) { for (const error of reg.errorCodes) { errorCodeToFixes.add(String(error), reg); } if (reg.fixIds) { - for (const fixId52 of reg.fixIds) { - Debug.assert(!fixIdToRegistration.has(fixId52)); - fixIdToRegistration.set(fixId52, reg); + for (const fixId51 of reg.fixIds) { + Debug.assert(!fixIdToRegistration.has(fixId51)); + fixIdToRegistration.set(fixId51, reg); } } } @@ -137177,17 +140177,17 @@ function getSupportedErrorCodes() { return arrayFrom(errorCodeToFixes.keys()); } function removeFixIdIfFixAllUnavailable(registration, diagnostics) { - const { errorCodes: errorCodes64 } = registration; + const { errorCodes: errorCodes63 } = registration; let maybeFixableDiagnostics = 0; for (const diag2 of diagnostics) { - if (contains(errorCodes64, diag2.code)) + if (contains(errorCodes63, diag2.code)) maybeFixableDiagnostics++; if (maybeFixableDiagnostics > 1) break; } const fixAllUnavailable = maybeFixableDiagnostics < 2; - return ({ fixId: fixId52, fixAllDescription, ...action }) => { - return fixAllUnavailable ? action : { ...action, fixId: fixId52, fixAllDescription }; + return ({ fixId: fixId51, fixAllDescription, ...action }) => { + return fixAllUnavailable ? action : { ...action, fixId: fixId51, fixAllDescription }; }; } function getFixes(context) { @@ -137204,14 +140204,14 @@ function createCombinedCodeActions(changes, commands) { function createFileTextChanges(fileName, textChanges2) { return { fileName, textChanges: textChanges2 }; } -function codeFixAll(context, errorCodes64, use) { +function codeFixAll(context, errorCodes63, use) { const commands = []; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes64, (diag2) => use(t, diag2, commands))); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes63, (diag2) => use(t, diag2, commands))); return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands); } -function eachDiagnostic(context, errorCodes64, cb) { +function eachDiagnostic(context, errorCodes63, cb) { for (const diag2 of getDiagnostics(context)) { - if (contains(errorCodes64, diag2.code)) { + if (contains(errorCodes63, diag2.code)) { cb(diag2); } } @@ -137892,7 +140892,7 @@ function doChange(changes, sourceFile, decl) { if (!param.type) { const paramType = getJSDocType(param); if (paramType) - changes.tryInsertTypeAnnotation(sourceFile, param, transformJSDocType(paramType)); + changes.tryInsertTypeAnnotation(sourceFile, param, visitNode(paramType, transformJSDocType, isTypeNode)); } } if (needParens) @@ -137900,12 +140900,12 @@ function doChange(changes, sourceFile, decl) { if (!decl.type) { const returnType = getJSDocReturnType(decl); if (returnType) - changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType)); + changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(returnType, transformJSDocType, isTypeNode)); } } else { const jsdocType = Debug.checkDefined(getJSDocType(decl), "A JSDocType for this declaration should exist"); Debug.assert(!decl.type, "The JSDocType decl should have a type"); - changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType)); + changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(jsdocType, transformJSDocType, isTypeNode)); } } function isDeclarationWithType(node) { @@ -137942,19 +140942,19 @@ function transformJSDocTypeLiteral(node) { void 0, isIdentifier(tag.name) ? tag.name : tag.name.right, isOptionalJSDocPropertyLikeTag(tag) ? factory.createToken(57 /* QuestionToken */) : void 0, - tag.typeExpression && visitNode(tag.typeExpression.type, transformJSDocType) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + tag.typeExpression && visitNode(tag.typeExpression.type, transformJSDocType, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ))); setEmitFlags(typeNode, 1 /* SingleLine */); return typeNode; } function transformJSDocOptionalType(node) { - return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType), factory.createTypeReferenceNode("undefined", emptyArray)]); + return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("undefined", emptyArray)]); } function transformJSDocNullableType(node) { - return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType), factory.createTypeReferenceNode("null", emptyArray)]); + return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("null", emptyArray)]); } function transformJSDocVariadicType(node) { - return factory.createArrayTypeNode(visitNode(node.type, transformJSDocType)); + return factory.createArrayTypeNode(visitNode(node.type, transformJSDocType, isTypeNode)); } function transformJSDocFunctionType(node) { var _a2; @@ -137965,7 +140965,7 @@ function transformJSDocParameter(node) { const isRest = node.type.kind === 321 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; const name = node.name || (isRest ? "rest" : "arg" + index); const dotdotdot = isRest ? factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; - return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType), node.initializer); + return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType, isTypeNode), node.initializer); } function transformJSDocTypeReference(node) { let name = node.typeName; @@ -137992,7 +140992,7 @@ function transformJSDocTypeReference(node) { if ((text === "Array" || text === "Promise") && !node.typeArguments) { args = factory.createNodeArray([factory.createTypeReferenceNode("any", emptyArray)]); } else { - args = visitNodes2(node.typeArguments, transformJSDocType); + args = visitNodes2(node.typeArguments, transformJSDocType, isTypeNode); } } return factory.createTypeReferenceNode(name, args); @@ -139078,8 +142078,8 @@ function convertFileToEsModule(sourceFile, checker, changes, target, quotePrefer function collectExportRenames(sourceFile, checker, identifiers) { const res = /* @__PURE__ */ new Map(); forEachExportReference(sourceFile, (node) => { - const { text, originalKeywordKind } = node.name; - if (!res.has(text) && (originalKeywordKind !== void 0 && isNonContextualKeyword(originalKeywordKind) || checker.resolveName( + const { text } = node.name; + if (!res.has(text) && (isIdentifierANonContextualKeyword(node.name) || checker.resolveName( text, node, 111551 /* Value */, @@ -139589,7 +142589,7 @@ function doChange3(changeTracker, sourceFile, qualifiedName) { } // src/services/codefixes/convertToTypeOnlyExport.ts -var errorCodes13 = [Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code]; +var errorCodes13 = [Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code]; var fixId12 = "convertToTypeOnlyExport"; registerCodeFix({ errorCodes: errorCodes13, @@ -139954,7 +142954,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre Debug.checkDefined(exportInfo), moduleSymbol, program, - /*useNamespaceInfo*/ + /*position*/ void 0, !!isValidTypeOnlyUseSite, useRequire, @@ -140099,7 +143099,8 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre sourceFile, newDeclarations, /*blankLineBetween*/ - true + true, + preferences ); } } @@ -140111,10 +143112,10 @@ function createImportSpecifierResolver(importingFile, program, host, preferences const packageJsonImportFilter = createPackageJsonImportFilter(importingFile, preferences, host); const importMap = createExistingImportMap(program.getTypeChecker(), importingFile, program.getCompilerOptions()); return { getModuleSpecifierForBestExportInfo }; - function getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite, fromCacheOnly) { + function getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, fromCacheOnly) { const { fixes, computedWithoutCacheCount } = getImportFixes( exportInfo, - { symbolName: symbolName2, position }, + position, isValidTypeOnlyUseSite, /*useRequire*/ false, @@ -140149,7 +143150,7 @@ function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbo Debug.assertIsDefined(exportInfos); const useRequire = shouldUseRequire(sourceFile, program); const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); - const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, { symbolName: symbolName2, position }, isValidTypeOnlyUseSite, useRequire, host, preferences)); + const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); return { moduleSpecifier: fix.moduleSpecifier, codeAction: codeFixActionToCodeAction(codeActionForFix( @@ -140171,10 +143172,10 @@ function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, ho const includeSymbolNameInDescription = symbolName2 !== symbolToken.text; return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences)); } -function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, host, preferences) { +function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol"); const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); - return getBestFix(getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); + return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); } function codeFixActionToCodeAction({ description: description2, changes, commands }) { return { description: description2, changes, commands }; @@ -140215,10 +143216,10 @@ function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) { } } } -function getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()), fromCacheOnly) { +function getImportFixes(exportInfos, usagePosition, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()), fromCacheOnly) { const checker = program.getTypeChecker(); const existingImports = flatMap(exportInfos, importMap.getImportsForExportInfo); - const useNamespace = useNamespaceInfo && tryUseExistingNamespaceImport(existingImports, useNamespaceInfo.symbolName, useNamespaceInfo.position, checker); + const useNamespace = usagePosition !== void 0 && tryUseExistingNamespaceImport(existingImports, usagePosition); const addToExisting = tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, program.getCompilerOptions()); if (addToExisting) { return { @@ -140231,7 +143232,7 @@ function getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, u existingImports, program, sourceFile, - useNamespaceInfo == null ? void 0 : useNamespaceInfo.position, + usagePosition, isValidTypeOnlyUseSite, useRequire, host, @@ -140243,33 +143244,18 @@ function getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, u fixes: [...useNamespace ? [useNamespace] : emptyArray, ...fixes] }; } -function tryUseExistingNamespaceImport(existingImports, symbolName2, position, checker) { - return firstDefined(existingImports, ({ declaration }) => { +function tryUseExistingNamespaceImport(existingImports, position) { + return firstDefined(existingImports, ({ declaration, importKind }) => { var _a2; + if (importKind !== 0 /* Named */) + return void 0; const namespacePrefix = getNamespaceLikeImportText(declaration); - const moduleSpecifier = (_a2 = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a2.text; - if (namespacePrefix && moduleSpecifier) { - const moduleSymbol = getTargetModuleFromNamespaceLikeImport(declaration, checker); - if (moduleSymbol && moduleSymbol.exports.has(escapeLeadingUnderscores(symbolName2))) { - return { kind: 0 /* UseNamespace */, namespacePrefix, position, moduleSpecifier }; - } + const moduleSpecifier = namespacePrefix && ((_a2 = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a2.text); + if (moduleSpecifier) { + return { kind: 0 /* UseNamespace */, namespacePrefix, usagePosition: position, moduleSpecifier }; } }); } -function getTargetModuleFromNamespaceLikeImport(declaration, checker) { - var _a2; - switch (declaration.kind) { - case 257 /* VariableDeclaration */: - return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 268 /* ImportEqualsDeclaration */: - return checker.getAliasedSymbol(declaration.symbol); - case 269 /* ImportDeclaration */: - const namespaceImport = tryCast((_a2 = declaration.importClause) == null ? void 0 : _a2.namedBindings, isNamespaceImport); - return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); - default: - return Debug.assertNever(declaration); - } -} function getNamespaceLikeImportText(declaration) { var _a2, _b, _c; switch (declaration.kind) { @@ -140290,7 +143276,7 @@ function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, sym if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2 /* Error */) { return 2 /* Required */; } - if (compilerOptions.isolatedModules && compilerOptions.preserveValueImports && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { + if ((compilerOptions.isolatedModules && compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { return 2 /* Required */; } return 1 /* Allowed */; @@ -140385,7 +143371,7 @@ function shouldUseRequire(sourceFile, program) { function createGetChecker(program, host) { return memoizeOne((isFromPackageJson) => isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker()); } -function getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { +function getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { const isJs = isSourceFileJS(sourceFile); const compilerOptions = program.getCompilerOptions(); const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); @@ -140408,27 +143394,47 @@ function getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite compilerOptions ); computedWithoutCacheCount += computedWithoutCache ? 1 : 0; - return mapDefined( - moduleSpecifiers, - (moduleSpecifier) => rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier) ? void 0 : ( - // `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types. - !importedSymbolHasValueMeaning && isJs && position !== void 0 ? { kind: 1 /* JsdocTypeImport */, moduleSpecifier, position, exportInfo: exportInfo2, isReExport: i > 0 } : { - kind: 3 /* AddNew */, - moduleSpecifier, - importKind: getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions), - useRequire, - addAsTypeOnly, - exportInfo: exportInfo2, - isReExport: i > 0 - } - ) - ); + return mapDefined(moduleSpecifiers, (moduleSpecifier) => { + var _a2; + if (rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier)) { + return void 0; + } + if (!importedSymbolHasValueMeaning && isJs && usagePosition !== void 0) { + return { kind: 1 /* JsdocTypeImport */, moduleSpecifier, usagePosition, exportInfo: exportInfo2, isReExport: i > 0 }; + } + const importKind = getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions); + let qualification; + if (usagePosition !== void 0 && importKind === 3 /* CommonJS */ && exportInfo2.exportKind === 0 /* Named */) { + const exportEquals = checker.resolveExternalModuleSymbol(exportInfo2.moduleSymbol); + let namespacePrefix; + if (exportEquals !== exportInfo2.moduleSymbol) { + namespacePrefix = (_a2 = getDefaultExportInfoWorker(exportEquals, checker, compilerOptions)) == null ? void 0 : _a2.name; + } + namespacePrefix || (namespacePrefix = moduleSymbolToValidIdentifier( + exportInfo2.moduleSymbol, + getEmitScriptTarget(compilerOptions), + /*forceCapitalize*/ + false + )); + qualification = { namespacePrefix, usagePosition }; + } + return { + kind: 3 /* AddNew */, + moduleSpecifier, + importKind, + useRequire, + addAsTypeOnly, + exportInfo: exportInfo2, + isReExport: i > 0, + qualification + }; + }); }); return { computedWithoutCacheCount, fixes }; } -function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { +function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { const existingDeclaration = firstDefined(existingImports, (info) => newImportInfoFromExistingSpecifier(info, isValidTypeOnlyUseSite, useRequire, program.getTypeChecker(), program.getCompilerOptions())); - return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); + return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); } function newImportInfoFromExistingSpecifier({ declaration, importKind, symbol, targetFlags }, isValidTypeOnlyUseSite, useRequire, checker, compilerOptions) { var _a2; @@ -140528,10 +143534,10 @@ function getFixesInfoForUMDImport({ sourceFile, program, host, preferences }, to const symbolName2 = umdSymbol.name; const exportInfo = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: void 0, exportKind: 3 /* UMD */, targetFlags: symbol.flags, isFromPackageJson: false }]; const useRequire = shouldUseRequire(sourceFile, program); - const position = isIdentifier(token) ? token.getStart(sourceFile) : void 0; const fixes = getImportFixes( exportInfo, - position ? { position, symbolName: symbolName2 } : void 0, + /*usagePosition*/ + void 0, /*isValidTypeOnlyUseSite*/ false, useRequire, @@ -140550,15 +143556,24 @@ function getUmdSymbol(token, checker) { if (isUMDExportSymbol(umdSymbol)) return umdSymbol; const { parent: parent2 } = token; - return isJsxOpeningLikeElement(parent2) && parent2.tagName === token || isJsxOpeningFragment(parent2) ? tryCast(checker.resolveName( - checker.getJsxNamespace(parent2), - isJsxOpeningLikeElement(parent2) ? token : parent2, - 111551 /* Value */, - /*excludeGlobals*/ - false - ), isUMDExportSymbol) : void 0; + if (isJsxOpeningLikeElement(parent2) && parent2.tagName === token || isJsxOpeningFragment(parent2)) { + const parentSymbol = checker.resolveName( + checker.getJsxNamespace(parent2), + isJsxOpeningLikeElement(parent2) ? token : parent2, + 111551 /* Value */, + /*excludeGlobals*/ + false + ); + if (isUMDExportSymbol(parentSymbol)) { + return parentSymbol; + } + } + return void 0; } function getImportKind(importingFile, exportKind, compilerOptions, forceImportKeyword) { + if (compilerOptions.verbatimModuleSyntax && (getEmitModuleKind(compilerOptions) === 1 /* CommonJS */ || importingFile.impliedNodeFormat === 1 /* CommonJS */)) { + return 3 /* CommonJS */; + } switch (exportKind) { case 0 /* Named */: return 0 /* Named */; @@ -140610,7 +143625,7 @@ function getFixesInfoForNonUMDImport({ sourceFile, program, cancellationToken, h const useRequire = shouldUseRequire(sourceFile, program); const exportInfo = getExportInfos(symbolName2, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences); return arrayFrom( - flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, { symbolName: symbolName2, position: symbolToken.getStart(sourceFile) }, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes), + flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, symbolToken.getStart(sourceFile), isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes), (fix) => ({ fix, symbolName: symbolName2, errorIdentifierText: symbolToken.text, isJsxNamespaceFix: symbolName2 !== symbolToken.text }) ); }); @@ -140680,7 +143695,7 @@ function getExportInfos(symbolName2, isJsxTagName, currentTokenMeaning, cancella cancellationToken.throwIfCancellationRequested(); const compilerOptions = program2.getCompilerOptions(); const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName2 || moduleSymbolToValidIdentifier(moduleSymbol, getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName2) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { + if (defaultInfo && (defaultInfo.name === symbolName2 || moduleSymbolToValidIdentifier(moduleSymbol, getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName2) && symbolHasMeaning(defaultInfo.resolvedSymbol, currentTokenMeaning)) { addSymbol(moduleSymbol, sourceFile, defaultInfo.symbol, defaultInfo.exportKind, program2, isFromPackageJson); } const exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); @@ -140737,23 +143752,27 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifierWithoutQuotes] : [Diagnostics.Update_import_from_0, moduleSpecifierWithoutQuotes]; } case 3 /* AddNew */: { - const { importKind, moduleSpecifier, addAsTypeOnly, useRequire } = fix; + const { importKind, moduleSpecifier, addAsTypeOnly, useRequire, qualification } = fix; const getDeclarations = useRequire ? getNewRequires : getNewImports; const defaultImport = importKind === 1 /* Default */ ? { name: symbolName2, addAsTypeOnly } : void 0; const namedImports = importKind === 0 /* Named */ ? [{ name: symbolName2, addAsTypeOnly }] : void 0; - const namespaceLikeImport = importKind === 2 /* Namespace */ || importKind === 3 /* CommonJS */ ? { importKind, name: symbolName2, addAsTypeOnly } : void 0; + const namespaceLikeImport = importKind === 2 /* Namespace */ || importKind === 3 /* CommonJS */ ? { importKind, name: (qualification == null ? void 0 : qualification.namespacePrefix) || symbolName2, addAsTypeOnly } : void 0; insertImports( changes, sourceFile, getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport), /*blankLineBetween*/ - true + true, + preferences ); + if (qualification) { + addNamespaceQualifier(changes, sourceFile, qualification); + } return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifier] : [Diagnostics.Add_import_from_0, moduleSpecifier]; } case 4 /* PromoteTypeOnly */: { const { typeOnlyAliasDeclaration } = fix; - const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile); + const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile, preferences); return promotedDeclaration.kind === 273 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; } default: @@ -140764,12 +143783,12 @@ function getModuleSpecifierText(promotedDeclaration) { var _a2, _b; return promotedDeclaration.kind === 268 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } -function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile) { - const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules; +function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) { + const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax; switch (aliasDeclaration.kind) { case 273 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { - const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements); + const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements, preferences); if (aliasDeclaration.parent.elements.length > 1 && sortKind) { changes.delete(sourceFile, aliasDeclaration); const newSpecifier = factory.updateImportSpecifier( @@ -140779,7 +143798,8 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF aliasDeclaration.propertyName, aliasDeclaration.name ); - const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, sortKind === 2 /* CaseInsensitive */); + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); + const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, comparer); changes.insertImportSpecifierAtIndex(sourceFile, newSpecifier, aliasDeclaration.parent, insertionIndex); } else { changes.deleteRange(sourceFile, aliasDeclaration.getFirstToken()); @@ -140807,7 +143827,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF if (convertExistingToTypeOnly) { const namedImports = tryCast(importClause.namedBindings, isNamedImports); if (namedImports && namedImports.elements.length > 1) { - if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements) && aliasDeclaration.kind === 273 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { + if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements, preferences) && aliasDeclaration.kind === 273 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { changes.delete(sourceFile, aliasDeclaration); changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); } @@ -140838,7 +143858,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor } const promoteFromTypeOnly2 = clause.isTypeOnly && some([defaultImport, ...namedImports], (i) => (i == null ? void 0 : i.addAsTypeOnly) === 4 /* NotAllowed */); const existingSpecifiers = clause.namedBindings && ((_a2 = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a2.elements); - const convertExistingToTypeOnly = promoteFromTypeOnly2 && compilerOptions.preserveValueImports && compilerOptions.isolatedModules; + const convertExistingToTypeOnly = promoteFromTypeOnly2 && (compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax); if (defaultImport) { Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " }); @@ -140848,14 +143868,15 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor if (typeof preferences.organizeImportsIgnoreCase === "boolean") { ignoreCaseForSorting = preferences.organizeImportsIgnoreCase; } else if (existingSpecifiers) { - const targetImportSorting = ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers); + const targetImportSorting = ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences); if (targetImportSorting !== 3 /* Both */) { ignoreCaseForSorting = targetImportSorting === 2 /* CaseInsensitive */; } } if (ignoreCaseForSorting === void 0) { - ignoreCaseForSorting = ts_OrganizeImports_exports.detectSorting(sourceFile) === 2 /* CaseInsensitive */; + ignoreCaseForSorting = ts_OrganizeImports_exports.detectSorting(sourceFile, preferences) === 2 /* CaseInsensitive */; } + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, ignoreCaseForSorting); const newSpecifiers = stableSort( namedImports.map((namedImport) => factory.createImportSpecifier( (!clause.isTypeOnly || promoteFromTypeOnly2) && needsTypeOnly(namedImport), @@ -140863,12 +143884,12 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor void 0, factory.createIdentifier(namedImport.name) )), - (s1, s2) => ts_OrganizeImports_exports.compareImportOrExportSpecifiers(s1, s2, ignoreCaseForSorting) + (s1, s2) => ts_OrganizeImports_exports.compareImportOrExportSpecifiers(s1, s2, comparer) ); - const specifierSort = (existingSpecifiers == null ? void 0 : existingSpecifiers.length) && ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers); + const specifierSort = (existingSpecifiers == null ? void 0 : existingSpecifiers.length) && ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences); if (specifierSort && !(ignoreCaseForSorting && specifierSort === 1 /* CaseSensitive */)) { for (const spec of newSpecifiers) { - const insertionIndex = convertExistingToTypeOnly && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, ignoreCaseForSorting); + const insertionIndex = convertExistingToTypeOnly && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, comparer); changes.insertImportSpecifierAtIndex(sourceFile, spec, clause.namedBindings, insertionIndex); } } else if (existingSpecifiers == null ? void 0 : existingSpecifiers.length) { @@ -140908,10 +143929,10 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor } } } -function addNamespaceQualifier(changes, sourceFile, { namespacePrefix, position }) { - changes.insertText(sourceFile, position, namespacePrefix + "."); +function addNamespaceQualifier(changes, sourceFile, { namespacePrefix, usagePosition }) { + changes.insertText(sourceFile, usagePosition, namespacePrefix + "."); } -function addImportType(changes, sourceFile, { moduleSpecifier, position }, quotePreference) { +function addImportType(changes, sourceFile, { moduleSpecifier, usagePosition: position }, quotePreference) { changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference)); } function getImportTypePrefix(moduleSpecifier, quotePreference) { @@ -141232,10 +144253,10 @@ registerCodeFix({ const info = errorCodeFixIdMap[errorCode]; if (!info) return emptyArray; - const { descriptions, fixId: fixId52, fixAllDescriptions } = info; + const { descriptions, fixId: fixId51, fixAllDescriptions } = info; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => dispatchChanges(changes2, context, errorCode, span.start)); return [ - createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId52, fixAllDescriptions) + createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId51, fixAllDescriptions) ]; }, fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId], @@ -142046,7 +145067,7 @@ registerCodeFix({ }, fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes], getAllCodeActions: (context) => { - const { program, fixId: fixId52 } = context; + const { program, fixId: fixId51 } = context; const checker = program.getTypeChecker(); const seen = /* @__PURE__ */ new Map(); const typeDeclToMembers = /* @__PURE__ */ new Map(); @@ -142056,11 +145077,11 @@ registerCodeFix({ if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + info.token.text)) { return; } - if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) { + if (fixId51 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) { addFunctionDeclaration(changes, context, info); - } else if (fixId52 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) { + } else if (fixId51 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) { addObjectLiteralProperties(changes, context, info); - } else if (fixId52 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) { + } else if (fixId51 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) { addJsxAttributes(changes, context, info); } else { if (info.kind === 1 /* Enum */) { @@ -142837,39 +145858,11 @@ function doChange11(changes, sourceFile, ctr) { changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall); } -// src/services/codefixes/fixEnableExperimentalDecorators.ts -var fixId27 = "enableExperimentalDecorators"; -var errorCodes32 = [ - Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning.code -]; -registerCodeFix({ - errorCodes: errorCodes32, - getCodeActions: function getCodeActionsToEnableExperimentalDecorators(context) { - const { configFile } = context.program.getCompilerOptions(); - if (configFile === void 0) { - return void 0; - } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => doChange12(changeTracker, configFile)); - return [createCodeFixActionWithoutFixAll(fixId27, changes, Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]; - }, - fixIds: [fixId27], - getAllCodeActions: (context) => codeFixAll(context, errorCodes32, (changes) => { - const { configFile } = context.program.getCompilerOptions(); - if (configFile === void 0) { - return void 0; - } - doChange12(changes, configFile); - }) -}); -function doChange12(changeTracker, configFile) { - setJsonCompilerOptionValue(changeTracker, configFile, "experimentalDecorators", factory.createTrue()); -} - // src/services/codefixes/fixEnableJsxFlag.ts var fixID = "fixEnableJsxFlag"; -var errorCodes33 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; +var errorCodes32 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; registerCodeFix({ - errorCodes: errorCodes33, + errorCodes: errorCodes32, getCodeActions: function getCodeActionsToFixEnableJsxFlag(context) { const { configFile } = context.program.getCompilerOptions(); if (configFile === void 0) { @@ -142877,47 +145870,47 @@ registerCodeFix({ } const changes = ts_textChanges_exports.ChangeTracker.with( context, - (changeTracker) => doChange13(changeTracker, configFile) + (changeTracker) => doChange12(changeTracker, configFile) ); return [ createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) ]; }, fixIds: [fixID], - getAllCodeActions: (context) => codeFixAll(context, errorCodes33, (changes) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes32, (changes) => { const { configFile } = context.program.getCompilerOptions(); if (configFile === void 0) { return void 0; } - doChange13(changes, configFile); + doChange12(changes, configFile); }) }); -function doChange13(changeTracker, configFile) { +function doChange12(changeTracker, configFile) { setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react")); } // src/services/codefixes/fixNaNEquality.ts -var fixId28 = "fixNaNEquality"; -var errorCodes34 = [ +var fixId27 = "fixNaNEquality"; +var errorCodes33 = [ Diagnostics.This_condition_will_always_return_0.code ]; registerCodeFix({ - errorCodes: errorCodes34, + errorCodes: errorCodes33, getCodeActions(context) { const { sourceFile, span, program } = context; const info = getInfo8(program, sourceFile, span); if (info === void 0) return; const { suggestion, expression, arg } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, sourceFile, arg, expression)); - return [createCodeFixAction(fixId28, changes, [Diagnostics.Use_0, suggestion], fixId28, Diagnostics.Use_Number_isNaN_in_all_conditions)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange13(t, sourceFile, arg, expression)); + return [createCodeFixAction(fixId27, changes, [Diagnostics.Use_0, suggestion], fixId27, Diagnostics.Use_Number_isNaN_in_all_conditions)]; }, - fixIds: [fixId28], + fixIds: [fixId27], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes34, (changes, diag2) => { + return codeFixAll(context, errorCodes33, (changes, diag2) => { const info = getInfo8(context.program, diag2.file, createTextSpan(diag2.start, diag2.length)); if (info) { - doChange14(changes, diag2.file, info.arg, info.expression); + doChange13(changes, diag2.file, info.arg, info.expression); } }); } @@ -142937,7 +145930,7 @@ function getInfo8(program, sourceFile, span) { } return void 0; } -function doChange14(changes, sourceFile, arg, expression) { +function doChange13(changes, sourceFile, arg, expression) { const callExpression = factory.createCallExpression( factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")), /*typeArguments*/ @@ -142997,22 +145990,22 @@ registerCodeFix({ }); // src/services/codefixes/fixPropertyAssignment.ts -var fixId29 = "fixPropertyAssignment"; -var errorCodes35 = [ +var fixId28 = "fixPropertyAssignment"; +var errorCodes34 = [ Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code ]; registerCodeFix({ - errorCodes: errorCodes35, - fixIds: [fixId29], + errorCodes: errorCodes34, + fixIds: [fixId28], getCodeActions(context) { const { sourceFile, span } = context; const property = getProperty2(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, context.sourceFile, property)); - return [createCodeFixAction(fixId29, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId29, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile, property)); + return [createCodeFixAction(fixId28, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId28, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes, diag2) => doChange15(changes, diag2.file, getProperty2(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange14(changes, diag2.file, getProperty2(diag2.file, diag2.start))) }); -function doChange15(changes, sourceFile, node) { +function doChange14(changes, sourceFile, node) { changes.replaceNode(sourceFile, node, factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer)); } function getProperty2(sourceFile, pos) { @@ -143020,10 +146013,10 @@ function getProperty2(sourceFile, pos) { } // src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts -var fixId30 = "extendsInterfaceBecomesImplements"; -var errorCodes36 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; +var fixId29 = "extendsInterfaceBecomesImplements"; +var errorCodes35 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; registerCodeFix({ - errorCodes: errorCodes36, + errorCodes: errorCodes35, getCodeActions(context) { const { sourceFile } = context; const nodes = getNodes2(sourceFile, context.span.start); @@ -143031,10 +146024,10 @@ registerCodeFix({ return void 0; const { extendsToken, heritageClauses } = nodes; const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChanges2(t, sourceFile, extendsToken, heritageClauses)); - return [createCodeFixAction(fixId30, changes, Diagnostics.Change_extends_to_implements, fixId30, Diagnostics.Change_all_extended_interfaces_to_implements)]; + return [createCodeFixAction(fixId29, changes, Diagnostics.Change_extends_to_implements, fixId29, Diagnostics.Change_all_extended_interfaces_to_implements)]; }, - fixIds: [fixId30], - getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { + fixIds: [fixId29], + getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes, diag2) => { const nodes = getNodes2(diag2.file, diag2.start); if (nodes) doChanges2(changes, diag2.file, nodes.extendsToken, nodes.heritageClauses); @@ -143062,29 +146055,29 @@ function doChanges2(changes, sourceFile, extendsToken, heritageClauses) { } // src/services/codefixes/fixForgottenThisPropertyAccess.ts -var fixId31 = "forgottenThisPropertyAccess"; +var fixId30 = "forgottenThisPropertyAccess"; var didYouMeanStaticMemberCode = Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code; -var errorCodes37 = [ +var errorCodes36 = [ Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, didYouMeanStaticMemberCode ]; registerCodeFix({ - errorCodes: errorCodes37, + errorCodes: errorCodes36, getCodeActions(context) { const { sourceFile } = context; const info = getInfo9(sourceFile, context.span.start, context.errorCode); if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16(t, sourceFile, info)); - return [createCodeFixAction(fixId31, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId31, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, sourceFile, info)); + return [createCodeFixAction(fixId30, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId30, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; }, - fixIds: [fixId31], - getAllCodeActions: (context) => codeFixAll(context, errorCodes37, (changes, diag2) => { + fixIds: [fixId30], + getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { const info = getInfo9(diag2.file, diag2.start, diag2.code); if (info) - doChange16(changes, context.sourceFile, info); + doChange15(changes, context.sourceFile, info); }) }); function getInfo9(sourceFile, pos, diagCode) { @@ -143093,7 +146086,7 @@ function getInfo9(sourceFile, pos, diagCode) { return { node, className: diagCode === didYouMeanStaticMemberCode ? getContainingClass(node).name.text : void 0 }; } } -function doChange16(changes, sourceFile, { node, className }) { +function doChange15(changes, sourceFile, { node, className }) { suppressLeadingAndTrailingTrivia(node); changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node)); } @@ -143101,16 +146094,16 @@ function doChange16(changes, sourceFile, { node, className }) { // src/services/codefixes/fixInvalidJsxCharacters.ts var fixIdExpression = "fixInvalidJsxCharacters_expression"; var fixIdHtmlEntity = "fixInvalidJsxCharacters_htmlEntity"; -var errorCodes38 = [ +var errorCodes37 = [ Diagnostics.Unexpected_token_Did_you_mean_or_gt.code, Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code ]; registerCodeFix({ - errorCodes: errorCodes38, + errorCodes: errorCodes37, fixIds: [fixIdExpression, fixIdHtmlEntity], getCodeActions(context) { const { sourceFile, preferences, span } = context; - const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( + const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( t, preferences, sourceFile, @@ -143118,7 +146111,7 @@ registerCodeFix({ /* useHtmlEntity */ false )); - const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( + const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( t, preferences, sourceFile, @@ -143132,7 +146125,7 @@ registerCodeFix({ ]; }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes38, (changes, diagnostic) => doChange17(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); + return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange16(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); } }); var htmlEntity = { @@ -143142,7 +146135,7 @@ var htmlEntity = { function isValidCharacter(character) { return hasProperty(htmlEntity, character); } -function doChange17(changes, preferences, sourceFile, start2, useHtmlEntity) { +function doChange16(changes, preferences, sourceFile, start2, useHtmlEntity) { const character = sourceFile.getText()[start2]; if (!isValidCharacter(character)) { return; @@ -143154,12 +146147,12 @@ function doChange17(changes, preferences, sourceFile, start2, useHtmlEntity) { // src/services/codefixes/fixUnmatchedParameter.ts var deleteUnmatchedParameter = "deleteUnmatchedParameter"; var renameUnmatchedParameter = "renameUnmatchedParameter"; -var errorCodes39 = [ +var errorCodes38 = [ Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code ]; registerCodeFix({ fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter], - errorCodes: errorCodes39, + errorCodes: errorCodes38, getCodeActions: function getCodeActionsToFixUnmatchedParameter(context) { const { sourceFile, span } = context; const actions2 = []; @@ -143174,7 +146167,7 @@ registerCodeFix({ getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context) { const tagsToSignature = /* @__PURE__ */ new Map(); return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes39, ({ file, start: start2 }) => { + eachDiagnostic(context, errorCodes38, ({ file, start: start2 }) => { const info = getInfo10(file, start2); if (info) { tagsToSignature.set(info.signature, append(tagsToSignature.get(info.signature), info.jsDocParameterTag)); @@ -143189,8 +146182,8 @@ registerCodeFix({ })); } }); -function getDeleteAction(context, { name, signature, jsDocParameterTag }) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.filterJSDocTags(context.sourceFile, signature, (t) => t !== jsDocParameterTag)); +function getDeleteAction(context, { name, jsDocHost, jsDocParameterTag }) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.filterJSDocTags(context.sourceFile, jsDocHost, (t) => t !== jsDocParameterTag)); return createCodeFixAction( deleteUnmatchedParameter, changes, @@ -143229,19 +146222,20 @@ function getInfo10(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); if (token.parent && isJSDocParameterTag(token.parent) && isIdentifier(token.parent.name)) { const jsDocParameterTag = token.parent; + const jsDocHost = getJSDocHost(jsDocParameterTag); const signature = getHostSignatureFromJSDoc(jsDocParameterTag); - if (signature) { - return { signature, name: token.parent.name, jsDocParameterTag }; + if (jsDocHost && signature) { + return { jsDocHost, signature, name: token.parent.name, jsDocParameterTag }; } } return void 0; } // src/services/codefixes/fixUnreferenceableDecoratorMetadata.ts -var fixId32 = "fixUnreferenceableDecoratorMetadata"; -var errorCodes40 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code]; +var fixId31 = "fixUnreferenceableDecoratorMetadata"; +var errorCodes39 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code]; registerCodeFix({ - errorCodes: errorCodes40, + errorCodes: errorCodes39, getCodeActions: (context) => { const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start); if (!importDeclaration) @@ -143250,14 +146244,14 @@ registerCodeFix({ const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program)); let actions2; if (namespaceChanges.length) { - actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId31, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); } if (typeOnlyChanges.length) { - actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, typeOnlyChanges, Diagnostics.Convert_to_type_only_import)); + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId31, typeOnlyChanges, Diagnostics.Convert_to_type_only_import)); } return actions2; }, - fixIds: [fixId32] + fixIds: [fixId31] }); function getImportDeclaration(sourceFile, program, start2) { const identifier = tryCast(getTokenAtPosition(sourceFile, start2), isIdentifier); @@ -143296,7 +146290,7 @@ var fixIdPrefix = "unusedIdentifier_prefix"; var fixIdDelete = "unusedIdentifier_delete"; var fixIdDeleteImports = "unusedIdentifier_deleteImports"; var fixIdInfer = "unusedIdentifier_infer"; -var errorCodes41 = [ +var errorCodes40 = [ Diagnostics._0_is_declared_but_its_value_is_never_read.code, Diagnostics._0_is_declared_but_never_used.code, Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, @@ -143306,7 +146300,7 @@ var errorCodes41 = [ Diagnostics.All_type_parameters_are_unused.code ]; registerCodeFix({ - errorCodes: errorCodes41, + errorCodes: errorCodes40, getCodeActions(context) { const { errorCode, sourceFile, program, cancellationToken } = context; const checker = program.getTypeChecker(); @@ -143392,7 +146386,7 @@ registerCodeFix({ const { sourceFile, program, cancellationToken } = context; const checker = program.getTypeChecker(); const sourceFiles = program.getSourceFiles(); - return codeFixAll(context, errorCodes41, (changes, diag2) => { + return codeFixAll(context, errorCodes40, (changes, diag2) => { const token = getTokenAtPosition(sourceFile, diag2.start); switch (context.fixId) { case fixIdPrefix: @@ -143609,21 +146603,21 @@ function mayDeleteExpression(node) { } // src/services/codefixes/fixUnreachableCode.ts -var fixId33 = "fixUnreachableCode"; -var errorCodes42 = [Diagnostics.Unreachable_code_detected.code]; +var fixId32 = "fixUnreachableCode"; +var errorCodes41 = [Diagnostics.Unreachable_code_detected.code]; registerCodeFix({ - errorCodes: errorCodes42, + errorCodes: errorCodes41, getCodeActions(context) { const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken); if (syntacticDiagnostics.length) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); - return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unreachable_code, fixId33, Diagnostics.Remove_all_unreachable_code)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); + return [createCodeFixAction(fixId32, changes, Diagnostics.Remove_unreachable_code, fixId32, Diagnostics.Remove_all_unreachable_code)]; }, - fixIds: [fixId33], - getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start, diag2.length, diag2.code)) + fixIds: [fixId32], + getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange17(changes, diag2.file, diag2.start, diag2.length, diag2.code)) }); -function doChange18(changes, sourceFile, start2, length2, errorCode) { +function doChange17(changes, sourceFile, start2, length2, errorCode) { const token = getTokenAtPosition(sourceFile, start2); const statement = findAncestor(token, isStatement); if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { @@ -143673,18 +146667,18 @@ function lastWhere(a, pred) { } // src/services/codefixes/fixUnusedLabel.ts -var fixId34 = "fixUnusedLabel"; -var errorCodes43 = [Diagnostics.Unused_label.code]; +var fixId33 = "fixUnusedLabel"; +var errorCodes42 = [Diagnostics.Unused_label.code]; registerCodeFix({ - errorCodes: errorCodes43, + errorCodes: errorCodes42, getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, context.sourceFile, context.span.start)); - return [createCodeFixAction(fixId34, changes, Diagnostics.Remove_unused_label, fixId34, Diagnostics.Remove_all_unused_labels)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start)); + return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unused_label, fixId33, Diagnostics.Remove_all_unused_labels)]; }, - fixIds: [fixId34], - getAllCodeActions: (context) => codeFixAll(context, errorCodes43, (changes, diag2) => doChange19(changes, diag2.file, diag2.start)) + fixIds: [fixId33], + getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start)) }); -function doChange19(changes, sourceFile, start2) { +function doChange18(changes, sourceFile, start2) { const token = getTokenAtPosition(sourceFile, start2); const labeledStatement = cast(token.parent, isLabeledStatement); const pos = token.getStart(sourceFile); @@ -143701,13 +146695,13 @@ function doChange19(changes, sourceFile, start2) { // src/services/codefixes/fixJSDocTypes.ts var fixIdPlain = "fixJSDocTypes_plain"; var fixIdNullable = "fixJSDocTypes_nullable"; -var errorCodes44 = [ +var errorCodes43 = [ Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code, Diagnostics._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code, Diagnostics._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code ]; registerCodeFix({ - errorCodes: errorCodes44, + errorCodes: errorCodes43, getCodeActions(context) { const { sourceFile } = context; const checker = context.program.getTypeChecker(); @@ -143721,26 +146715,26 @@ registerCodeFix({ actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); } return actions2; - function fix(type2, fixId52, fixAllDescription) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, sourceFile, typeNode, type2, checker)); - return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId52, fixAllDescription); + function fix(type2, fixId51, fixAllDescription) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, sourceFile, typeNode, type2, checker)); + return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId51, fixAllDescription); } }, fixIds: [fixIdPlain, fixIdNullable], getAllCodeActions(context) { - const { fixId: fixId52, program, sourceFile } = context; + const { fixId: fixId51, program, sourceFile } = context; const checker = program.getTypeChecker(); - return codeFixAll(context, errorCodes44, (changes, err) => { + return codeFixAll(context, errorCodes43, (changes, err) => { const info = getInfo11(err.file, err.start, checker); if (!info) return; const { typeNode, type } = info; - const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; - doChange20(changes, sourceFile, typeNode, fixedType, checker); + const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId51 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + doChange19(changes, sourceFile, typeNode, fixedType, checker); }); } }); -function doChange20(changes, sourceFile, oldTypeNode, newType, checker) { +function doChange19(changes, sourceFile, oldTypeNode, newType, checker) { changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( newType, /*enclosingDeclaration*/ @@ -143791,28 +146785,28 @@ function getType(checker, node) { } // src/services/codefixes/fixMissingCallParentheses.ts -var fixId35 = "fixMissingCallParentheses"; -var errorCodes45 = [ +var fixId34 = "fixMissingCallParentheses"; +var errorCodes44 = [ Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code ]; registerCodeFix({ - errorCodes: errorCodes45, - fixIds: [fixId35], + errorCodes: errorCodes44, + fixIds: [fixId34], getCodeActions(context) { const { sourceFile, span } = context; const callName = getCallName(sourceFile, span.start); if (!callName) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, context.sourceFile, callName)); - return [createCodeFixAction(fixId35, changes, Diagnostics.Add_missing_call_parentheses, fixId35, Diagnostics.Add_all_missing_call_parentheses)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, context.sourceFile, callName)); + return [createCodeFixAction(fixId34, changes, Diagnostics.Add_missing_call_parentheses, fixId34, Diagnostics.Add_all_missing_call_parentheses)]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes45, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => { const callName = getCallName(diag2.file, diag2.start); if (callName) - doChange21(changes, diag2.file, callName); + doChange20(changes, diag2.file, callName); }) }); -function doChange21(changes, sourceFile, name) { +function doChange20(changes, sourceFile, name) { changes.replaceNodeWithText(sourceFile, name, `${name.text}()`); } function getCallName(sourceFile, start2) { @@ -143831,30 +146825,30 @@ function getCallName(sourceFile, start2) { } // src/services/codefixes/fixAwaitInSyncFunction.ts -var fixId36 = "fixAwaitInSyncFunction"; -var errorCodes46 = [ +var fixId35 = "fixAwaitInSyncFunction"; +var errorCodes45 = [ Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code ]; registerCodeFix({ - errorCodes: errorCodes46, + errorCodes: errorCodes45, getCodeActions(context) { const { sourceFile, span } = context; const nodes = getNodes3(sourceFile, span.start); if (!nodes) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange22(t, sourceFile, nodes)); - return [createCodeFixAction(fixId36, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId36, Diagnostics.Add_all_missing_async_modifiers)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, sourceFile, nodes)); + return [createCodeFixAction(fixId35, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId35, Diagnostics.Add_all_missing_async_modifiers)]; }, - fixIds: [fixId36], + fixIds: [fixId35], getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) { const seen = /* @__PURE__ */ new Map(); - return codeFixAll(context, errorCodes46, (changes, diag2) => { + return codeFixAll(context, errorCodes45, (changes, diag2) => { const nodes = getNodes3(diag2.file, diag2.start); if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return; - doChange22(changes, context.sourceFile, nodes); + doChange21(changes, context.sourceFile, nodes); }); } }); @@ -143893,7 +146887,7 @@ function getNodes3(sourceFile, start2) { returnType: getReturnType(containingFunction) }; } -function doChange22(changes, sourceFile, { insertBefore, returnType }) { +function doChange21(changes, sourceFile, { insertBefore, returnType }) { if (returnType) { const entityName = getEntityNameFromTypeNode(returnType); if (!entityName || entityName.kind !== 79 /* Identifier */ || entityName.text !== "Promise") { @@ -143904,22 +146898,22 @@ function doChange22(changes, sourceFile, { insertBefore, returnType }) { } // src/services/codefixes/fixPropertyOverrideAccessor.ts -var errorCodes47 = [ +var errorCodes46 = [ Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code, Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code ]; -var fixId37 = "fixPropertyOverrideAccessor"; +var fixId36 = "fixPropertyOverrideAccessor"; registerCodeFix({ - errorCodes: errorCodes47, + errorCodes: errorCodes46, getCodeActions(context) { - const edits = doChange23(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); + const edits = doChange22(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); if (edits) { - return [createCodeFixAction(fixId37, edits, Diagnostics.Generate_get_and_set_accessors, fixId37, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; + return [createCodeFixAction(fixId36, edits, Diagnostics.Generate_get_and_set_accessors, fixId36, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; } }, - fixIds: [fixId37], - getAllCodeActions: (context) => codeFixAll(context, errorCodes47, (changes, diag2) => { - const edits = doChange23(diag2.file, diag2.start, diag2.length, diag2.code, context); + fixIds: [fixId36], + getAllCodeActions: (context) => codeFixAll(context, errorCodes46, (changes, diag2) => { + const edits = doChange22(diag2.file, diag2.start, diag2.length, diag2.code, context); if (edits) { for (const edit of edits) { changes.pushRaw(context.sourceFile, edit); @@ -143927,7 +146921,7 @@ registerCodeFix({ } }) }); -function doChange23(file, start2, length2, code, context) { +function doChange22(file, start2, length2, code, context) { let startPosition; let endPosition; if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) { @@ -143956,8 +146950,8 @@ function doChange23(file, start2, length2, code, context) { } // src/services/codefixes/inferFromUsage.ts -var fixId38 = "inferFromUsage"; -var errorCodes48 = [ +var fixId37 = "inferFromUsage"; +var errorCodes47 = [ // Variable declarations Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, // Variable uses @@ -143991,13 +146985,13 @@ var errorCodes48 = [ Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code ]; registerCodeFix({ - errorCodes: errorCodes48, + errorCodes: errorCodes47, getCodeActions(context) { const { sourceFile, program, span: { start: start2 }, errorCode, cancellationToken, host, preferences } = context; const token = getTokenAtPosition(sourceFile, start2); let declaration; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - declaration = doChange24( + declaration = doChange23( changes2, sourceFile, token, @@ -144011,14 +147005,14 @@ registerCodeFix({ ); }); const name = declaration && getNameOfDeclaration(declaration); - return !name || changes.length === 0 ? void 0 : [createCodeFixAction(fixId38, changes, [getDiagnostic(errorCode, token), getTextOfNode(name)], fixId38, Diagnostics.Infer_all_types_from_usage)]; + return !name || changes.length === 0 ? void 0 : [createCodeFixAction(fixId37, changes, [getDiagnostic(errorCode, token), getTextOfNode(name)], fixId37, Diagnostics.Infer_all_types_from_usage)]; }, - fixIds: [fixId38], + fixIds: [fixId37], getAllCodeActions(context) { const { sourceFile, program, cancellationToken, host, preferences } = context; const markSeen = nodeSeenTracker(); - return codeFixAll(context, errorCodes48, (changes, err) => { - doChange24(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); + return codeFixAll(context, errorCodes47, (changes, err) => { + doChange23(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); }); } }); @@ -144057,7 +147051,7 @@ function mapSuggestionDiagnostic(errorCode) { } return errorCode; } -function doChange24(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { +function doChange23(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { if (!isParameterPropertyModifier(token.kind) && token.kind !== 79 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 108 /* ThisKeyword */) { return void 0; } @@ -144953,13 +147947,13 @@ function inferTypeFromReferences(program, references, cancellationToken) { } // src/services/codefixes/fixReturnTypeInAsyncFunction.ts -var fixId39 = "fixReturnTypeInAsyncFunction"; -var errorCodes49 = [ +var fixId38 = "fixReturnTypeInAsyncFunction"; +var errorCodes48 = [ Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code ]; registerCodeFix({ - errorCodes: errorCodes49, - fixIds: [fixId39], + errorCodes: errorCodes48, + fixIds: [fixId38], getCodeActions: function getCodeActionsToFixReturnTypeInAsyncFunction(context) { const { sourceFile, program, span } = context; const checker = program.getTypeChecker(); @@ -144968,23 +147962,23 @@ registerCodeFix({ return void 0; } const { returnTypeNode, returnType, promisedTypeNode, promisedType } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, sourceFile, returnTypeNode, promisedTypeNode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, sourceFile, returnTypeNode, promisedTypeNode)); return [createCodeFixAction( - fixId39, + fixId38, changes, [ Diagnostics.Replace_0_with_Promise_1, checker.typeToString(returnType), checker.typeToString(promisedType) ], - fixId39, + fixId38, Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions )]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes49, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes48, (changes, diag2) => { const info = getInfo12(diag2.file, context.program.getTypeChecker(), diag2.start); if (info) { - doChange25(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); + doChange24(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); } }) }); @@ -145011,19 +148005,19 @@ function getInfo12(sourceFile, checker, pos) { return { returnTypeNode, returnType, promisedTypeNode, promisedType }; } } -function doChange25(changes, sourceFile, returnTypeNode, promisedTypeNode) { +function doChange24(changes, sourceFile, returnTypeNode, promisedTypeNode) { changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode])); } // src/services/codefixes/disableJsDiagnostics.ts var fixName4 = "disableJsDiagnostics"; -var fixId40 = "disableJsDiagnostics"; -var errorCodes50 = mapDefined(Object.keys(Diagnostics), (key) => { +var fixId39 = "disableJsDiagnostics"; +var errorCodes49 = mapDefined(Object.keys(Diagnostics), (key) => { const diag2 = Diagnostics[key]; return diag2.category === 1 /* Error */ ? diag2.code : void 0; }); registerCodeFix({ - errorCodes: errorCodes50, + errorCodes: errorCodes49, getCodeActions: function getCodeActionsToDisableJsDiagnostics(context) { const { sourceFile, program, span, host, formatContext } = context; if (!isInJSFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { @@ -145041,14 +148035,14 @@ registerCodeFix({ ) ]; if (ts_textChanges_exports.isValidLocationToAddComment(sourceFile, span.start)) { - fixes.unshift(createCodeFixAction(fixName4, ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange8(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId40, Diagnostics.Add_ts_ignore_to_all_error_messages)); + fixes.unshift(createCodeFixAction(fixName4, ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange8(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId39, Diagnostics.Add_ts_ignore_to_all_error_messages)); } return fixes; }, - fixIds: [fixId40], + fixIds: [fixId39], getAllCodeActions: (context) => { const seenLines = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes50, (changes, diag2) => { + return codeFixAll(context, errorCodes49, (changes, diag2) => { if (ts_textChanges_exports.isValidLocationToAddComment(diag2.file, diag2.start)) { makeChange8(changes, diag2.file, diag2.start, seenLines); } @@ -145668,18 +148662,17 @@ function findJsonProperty(obj, name) { } function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) { let symbols; - const typeNode = visitNode(importTypeNode, visit); + const typeNode = visitNode(importTypeNode, visit, isTypeNode); if (symbols && typeNode) { return { typeNode, symbols }; } function visit(node) { - var _a2; if (isLiteralImportTypeNode(node) && node.qualifier) { const firstIdentifier = getFirstIdentifier(node.qualifier); const name = getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget); const qualifier = name !== firstIdentifier.text ? replaceFirstIdentifierOfEntityName(node.qualifier, factory.createIdentifier(name)) : node.qualifier; symbols = append(symbols, firstIdentifier.symbol); - const typeArguments = (_a2 = node.typeArguments) == null ? void 0 : _a2.map(visit); + const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode); return factory.createTypeReferenceNode(qualifier, typeArguments); } return visitEachChild(node, visit, nullTransformationContext); @@ -145817,9 +148810,7 @@ function generateGetAccessor(fieldName, accessorName, type, modifiers, isStatic2 return factory.createGetAccessorDeclaration( modifiers, accessorName, - /*parameters*/ - void 0, - // TODO: GH#18217 + [], type, factory.createBlock( [ @@ -146030,9 +149021,9 @@ var fixName6 = "strictClassInitialization"; var fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; var fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; var fixIdAddInitializer = "addMissingPropertyInitializer"; -var errorCodes51 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; +var errorCodes50 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; registerCodeFix({ - errorCodes: errorCodes51, + errorCodes: errorCodes50, getCodeActions: function getCodeActionsForStrictClassInitializationErrors(context) { const info = getInfo13(context.sourceFile, context.span.start); if (!info) @@ -146045,7 +149036,7 @@ registerCodeFix({ }, fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes51, (changes, diag2) => { + return codeFixAll(context, errorCodes50, (changes, diag2) => { const info = getInfo13(diag2.file, diag2.start); if (!info) return; @@ -146175,27 +149166,27 @@ function getDefaultValueFromType(checker, type) { } // src/services/codefixes/requireInTs.ts -var fixId41 = "requireInTs"; -var errorCodes52 = [Diagnostics.require_call_may_be_converted_to_an_import.code]; +var fixId40 = "requireInTs"; +var errorCodes51 = [Diagnostics.require_call_may_be_converted_to_an_import.code]; registerCodeFix({ - errorCodes: errorCodes52, + errorCodes: errorCodes51, getCodeActions(context) { const info = getInfo14(context.sourceFile, context.program, context.span.start); if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, context.sourceFile, info)); - return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_require_to_import, fixId41, Diagnostics.Convert_all_require_to_import)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, context.sourceFile, info)); + return [createCodeFixAction(fixId40, changes, Diagnostics.Convert_require_to_import, fixId40, Diagnostics.Convert_all_require_to_import)]; }, - fixIds: [fixId41], - getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { + fixIds: [fixId40], + getAllCodeActions: (context) => codeFixAll(context, errorCodes51, (changes, diag2) => { const info = getInfo14(diag2.file, context.program, diag2.start); if (info) { - doChange26(changes, context.sourceFile, info); + doChange25(changes, context.sourceFile, info); } }) }); -function doChange26(changes, sourceFile, info) { +function doChange25(changes, sourceFile, info) { const { allowSyntheticDefaults, defaultImportName, namedImports, statement, required } = info; changes.replaceNode(sourceFile, statement, defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( /*modifiers*/ @@ -146259,23 +149250,23 @@ function tryCreateNamedImportsFromObjectBindingPattern(node) { } // src/services/codefixes/useDefaultImport.ts -var fixId42 = "useDefaultImport"; -var errorCodes53 = [Diagnostics.Import_may_be_converted_to_a_default_import.code]; +var fixId41 = "useDefaultImport"; +var errorCodes52 = [Diagnostics.Import_may_be_converted_to_a_default_import.code]; registerCodeFix({ - errorCodes: errorCodes53, + errorCodes: errorCodes52, getCodeActions(context) { const { sourceFile, span: { start: start2 } } = context; const info = getInfo15(sourceFile, start2); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, info, context.preferences)); - return [createCodeFixAction(fixId42, changes, Diagnostics.Convert_to_default_import, fixId42, Diagnostics.Convert_all_to_default_imports)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, sourceFile, info, context.preferences)); + return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_to_default_import, fixId41, Diagnostics.Convert_all_to_default_imports)]; }, - fixIds: [fixId42], - getAllCodeActions: (context) => codeFixAll(context, errorCodes53, (changes, diag2) => { + fixIds: [fixId41], + getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { const info = getInfo15(diag2.file, diag2.start); if (info) - doChange27(changes, diag2.file, info, context.preferences); + doChange26(changes, diag2.file, info, context.preferences); }) }); function getInfo15(sourceFile, pos) { @@ -146290,7 +149281,7 @@ function getInfo15(sourceFile, pos) { return { importNode, name, moduleSpecifier: importNode.moduleSpecifier }; } } -function doChange27(changes, sourceFile, info, preferences) { +function doChange26(changes, sourceFile, info, preferences) { changes.replaceNode(sourceFile, info.importNode, makeImport( info.name, /*namedImports*/ @@ -146301,21 +149292,21 @@ function doChange27(changes, sourceFile, info, preferences) { } // src/services/codefixes/useBigintLiteral.ts -var fixId43 = "useBigintLiteral"; -var errorCodes54 = [ +var fixId42 = "useBigintLiteral"; +var errorCodes53 = [ Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code ]; registerCodeFix({ - errorCodes: errorCodes54, + errorCodes: errorCodes53, getCodeActions: function getCodeActionsToUseBigintLiteral(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange9(t, context.sourceFile, context.span)); if (changes.length > 0) { - return [createCodeFixAction(fixId43, changes, Diagnostics.Convert_to_a_bigint_numeric_literal, fixId43, Diagnostics.Convert_all_to_bigint_numeric_literals)]; + return [createCodeFixAction(fixId42, changes, Diagnostics.Convert_to_a_bigint_numeric_literal, fixId42, Diagnostics.Convert_all_to_bigint_numeric_literals)]; } }, - fixIds: [fixId43], + fixIds: [fixId42], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes54, (changes, diag2) => makeChange9(changes, diag2.file, diag2)); + return codeFixAll(context, errorCodes53, (changes, diag2) => makeChange9(changes, diag2.file, diag2)); } }); function makeChange9(changeTracker, sourceFile, span) { @@ -146329,18 +149320,18 @@ function makeChange9(changeTracker, sourceFile, span) { // src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts var fixIdAddMissingTypeof = "fixAddModuleReferTypeMissingTypeof"; -var fixId44 = fixIdAddMissingTypeof; -var errorCodes55 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code]; +var fixId43 = fixIdAddMissingTypeof; +var errorCodes54 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code]; registerCodeFix({ - errorCodes: errorCodes55, + errorCodes: errorCodes54, getCodeActions: function getCodeActionsToAddMissingTypeof(context) { const { sourceFile, span } = context; const importType = getImportTypeNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, importType)); - return [createCodeFixAction(fixId44, changes, Diagnostics.Add_missing_typeof, fixId44, Diagnostics.Add_missing_typeof)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, importType)); + return [createCodeFixAction(fixId43, changes, Diagnostics.Add_missing_typeof, fixId43, Diagnostics.Add_missing_typeof)]; }, - fixIds: [fixId44], - getAllCodeActions: (context) => codeFixAll(context, errorCodes55, (changes, diag2) => doChange28(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) + fixIds: [fixId43], + getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange27(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) }); function getImportTypeNode(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); @@ -146348,7 +149339,7 @@ function getImportTypeNode(sourceFile, pos) { Debug.assert(token.parent.kind === 202 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } -function doChange28(changes, sourceFile, importType) { +function doChange27(changes, sourceFile, importType) { const newTypeNode = factory.updateImportTypeNode( importType, importType.argument, @@ -146363,23 +149354,23 @@ function doChange28(changes, sourceFile, importType) { // src/services/codefixes/wrapJsxInFragment.ts var fixID2 = "wrapJsxInFragment"; -var errorCodes56 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code]; +var errorCodes55 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code]; registerCodeFix({ - errorCodes: errorCodes56, + errorCodes: errorCodes55, getCodeActions: function getCodeActionsToWrapJsxInFragment(context) { const { sourceFile, span } = context; const node = findNodeToFix(sourceFile, span.start); if (!node) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, node)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, node)); return [createCodeFixAction(fixID2, changes, Diagnostics.Wrap_in_JSX_fragment, fixID2, Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]; }, fixIds: [fixID2], - getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes55, (changes, diag2) => { const node = findNodeToFix(context.sourceFile, diag2.start); if (!node) return void 0; - doChange29(changes, context.sourceFile, node); + doChange28(changes, context.sourceFile, node); }) }); function findNodeToFix(sourceFile, pos) { @@ -146395,7 +149386,7 @@ function findNodeToFix(sourceFile, pos) { return void 0; return binaryExpr; } -function doChange29(changeTracker, sf, node) { +function doChange28(changeTracker, sf, node) { const jsx = flattenInvalidBinaryExpr(node); if (jsx) changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment())); @@ -146420,24 +149411,24 @@ function flattenInvalidBinaryExpr(node) { } // src/services/codefixes/convertToMappedObjectType.ts -var fixId45 = "fixConvertToMappedObjectType"; -var errorCodes57 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; +var fixId44 = "fixConvertToMappedObjectType"; +var errorCodes56 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; registerCodeFix({ - errorCodes: errorCodes57, + errorCodes: errorCodes56, getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) { const { sourceFile, span } = context; const info = getInfo16(sourceFile, span.start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, info)); const name = idText(info.container.name); - return [createCodeFixAction(fixId45, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId45, [Diagnostics.Convert_0_to_mapped_object_type, name])]; + return [createCodeFixAction(fixId44, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId44, [Diagnostics.Convert_0_to_mapped_object_type, name])]; }, - fixIds: [fixId45], - getAllCodeActions: (context) => codeFixAll(context, errorCodes57, (changes, diag2) => { + fixIds: [fixId44], + getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { const info = getInfo16(diag2.file, diag2.start); if (info) - doChange30(changes, diag2.file, info); + doChange29(changes, diag2.file, info); }) }); function getInfo16(sourceFile, pos) { @@ -146453,7 +149444,7 @@ function getInfo16(sourceFile, pos) { function createTypeAliasFromInterface(declaration, type) { return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type); } -function doChange30(changes, sourceFile, { indexSignature, container }) { +function doChange29(changes, sourceFile, { indexSignature, container }) { const members = isInterfaceDeclaration(container) ? container.members : container.type.members; const otherMembers = members.filter((member) => !isIndexSignatureDeclaration(member)); const parameter = first(indexSignature.parameters); @@ -146482,12 +149473,12 @@ function doChange30(changes, sourceFile, { indexSignature, container }) { } // src/services/codefixes/removeAccidentalCallParentheses.ts -var fixId46 = "removeAccidentalCallParentheses"; -var errorCodes58 = [ +var fixId45 = "removeAccidentalCallParentheses"; +var errorCodes57 = [ Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code ]; registerCodeFix({ - errorCodes: errorCodes58, + errorCodes: errorCodes57, getCodeActions(context) { const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression); if (!callExpression) { @@ -146496,27 +149487,27 @@ registerCodeFix({ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { t.deleteRange(context.sourceFile, { pos: callExpression.expression.end, end: callExpression.end }); }); - return [createCodeFixActionWithoutFixAll(fixId46, changes, Diagnostics.Remove_parentheses)]; + return [createCodeFixActionWithoutFixAll(fixId45, changes, Diagnostics.Remove_parentheses)]; }, - fixIds: [fixId46] + fixIds: [fixId45] }); // src/services/codefixes/removeUnnecessaryAwait.ts -var fixId47 = "removeUnnecessaryAwait"; -var errorCodes59 = [ +var fixId46 = "removeUnnecessaryAwait"; +var errorCodes58 = [ Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code ]; registerCodeFix({ - errorCodes: errorCodes59, + errorCodes: errorCodes58, getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span)); if (changes.length > 0) { - return [createCodeFixAction(fixId47, changes, Diagnostics.Remove_unnecessary_await, fixId47, Diagnostics.Remove_all_unnecessary_uses_of_await)]; + return [createCodeFixAction(fixId46, changes, Diagnostics.Remove_unnecessary_await, fixId46, Diagnostics.Remove_all_unnecessary_uses_of_await)]; } }, - fixIds: [fixId47], + fixIds: [fixId46], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes59, (changes, diag2) => makeChange10(changes, diag2.file, diag2)); + return codeFixAll(context, errorCodes58, (changes, diag2) => makeChange10(changes, diag2.file, diag2)); } }); function makeChange10(changeTracker, sourceFile, span) { @@ -146544,20 +149535,20 @@ function makeChange10(changeTracker, sourceFile, span) { } // src/services/codefixes/splitTypeOnlyImport.ts -var errorCodes60 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; -var fixId48 = "splitTypeOnlyImport"; +var errorCodes59 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; +var fixId47 = "splitTypeOnlyImport"; registerCodeFix({ - errorCodes: errorCodes60, - fixIds: [fixId48], + errorCodes: errorCodes59, + fixIds: [fixId47], getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { return splitTypeOnlyImport(t, getImportDeclaration2(context.sourceFile, context.span), context); }); if (changes.length) { - return [createCodeFixAction(fixId48, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId48, Diagnostics.Split_all_invalid_type_only_imports)]; + return [createCodeFixAction(fixId47, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId47, Diagnostics.Split_all_invalid_type_only_imports)]; } }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes60, (changes, error) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes59, (changes, error) => { splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error), context); }) }); @@ -146598,34 +149589,34 @@ function splitTypeOnlyImport(changes, importDeclaration, context) { } // src/services/codefixes/convertConstToLet.ts -var fixId49 = "fixConvertConstToLet"; -var errorCodes61 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; +var fixId48 = "fixConvertConstToLet"; +var errorCodes60 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; registerCodeFix({ - errorCodes: errorCodes61, + errorCodes: errorCodes60, getCodeActions: function getCodeActionsToConvertConstToLet(context) { const { sourceFile, span, program } = context; const info = getInfo17(sourceFile, span.start, program); if (info === void 0) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info.token)); - return [createCodeFixActionMaybeFixAll(fixId49, changes, Diagnostics.Convert_const_to_let, fixId49, Diagnostics.Convert_all_const_to_let)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info.token)); + return [createCodeFixActionMaybeFixAll(fixId48, changes, Diagnostics.Convert_const_to_let, fixId48, Diagnostics.Convert_all_const_to_let)]; }, getAllCodeActions: (context) => { const { program } = context; const seen = /* @__PURE__ */ new Map(); return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes61, (diag2) => { + eachDiagnostic(context, errorCodes60, (diag2) => { const info = getInfo17(diag2.file, diag2.start, program); if (info) { if (addToSeen(seen, getSymbolId(info.symbol))) { - return doChange31(changes, diag2.file, info.token); + return doChange30(changes, diag2.file, info.token); } } return void 0; }); })); }, - fixIds: [fixId49] + fixIds: [fixId48] }); function getInfo17(sourceFile, pos, program) { var _a2; @@ -146641,64 +149632,64 @@ function getInfo17(sourceFile, pos, program) { return; return { symbol, token: constToken }; } -function doChange31(changes, sourceFile, token) { +function doChange30(changes, sourceFile, token) { changes.replaceNode(sourceFile, token, factory.createToken(119 /* LetKeyword */)); } // src/services/codefixes/fixExpectedComma.ts -var fixId50 = "fixExpectedComma"; +var fixId49 = "fixExpectedComma"; var expectedErrorCode = Diagnostics._0_expected.code; -var errorCodes62 = [expectedErrorCode]; +var errorCodes61 = [expectedErrorCode]; registerCodeFix({ - errorCodes: errorCodes62, + errorCodes: errorCodes61, getCodeActions(context) { const { sourceFile } = context; const info = getInfo18(sourceFile, context.span.start, context.errorCode); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info)); return [createCodeFixAction( - fixId50, + fixId49, changes, [Diagnostics.Change_0_to_1, ";", ","], - fixId50, + fixId49, [Diagnostics.Change_0_to_1, ";", ","] )]; }, - fixIds: [fixId50], - getAllCodeActions: (context) => codeFixAll(context, errorCodes62, (changes, diag2) => { + fixIds: [fixId49], + getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, diag2) => { const info = getInfo18(diag2.file, diag2.start, diag2.code); if (info) - doChange32(changes, context.sourceFile, info); + doChange31(changes, context.sourceFile, info); }) }); function getInfo18(sourceFile, pos, _) { const node = getTokenAtPosition(sourceFile, pos); return node.kind === 26 /* SemicolonToken */ && node.parent && (isObjectLiteralExpression(node.parent) || isArrayLiteralExpression(node.parent)) ? { node } : void 0; } -function doChange32(changes, sourceFile, { node }) { +function doChange31(changes, sourceFile, { node }) { const newNode = factory.createToken(27 /* CommaToken */); changes.replaceNode(sourceFile, node, newNode); } // src/services/codefixes/fixAddVoidToPromise.ts var fixName7 = "addVoidToPromise"; -var fixId51 = "addVoidToPromise"; -var errorCodes63 = [ +var fixId50 = "addVoidToPromise"; +var errorCodes62 = [ Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code, Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code ]; registerCodeFix({ - errorCodes: errorCodes63, - fixIds: [fixId51], + errorCodes: errorCodes62, + fixIds: [fixId50], getCodeActions(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span, context.program)); if (changes.length > 0) { - return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId51, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; + return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId50, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; } }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes63, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set())); + return codeFixAll(context, errorCodes62, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set())); } }); function makeChange11(changes, sourceFile, span, program, seen) { @@ -146870,9 +149861,9 @@ function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, (_b = host.log) == null ? void 0 : _b.call(host, `${logPrefix}: response is ${skippedAny ? "incomplete" : "complete"}`); (_c = host.log) == null ? void 0 : _c.call(host, `${logPrefix}: ${timestamp() - start2}`); return result; - function tryResolve(exportInfo, symbolName2, isFromAmbientModule) { + function tryResolve(exportInfo, isFromAmbientModule) { if (isFromAmbientModule) { - const result3 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite); + const result3 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite); if (result3) { ambientCount++; } @@ -146880,7 +149871,7 @@ function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, } const shouldResolveModuleSpecifier = needsFullResolution || preferences.allowIncompleteCompletions && resolvedCount < moduleSpecifierResolutionLimit; const shouldGetModuleSpecifierFromCache = !shouldResolveModuleSpecifier && preferences.allowIncompleteCompletions && cacheAttemptCount < moduleSpecifierResolutionCacheAttemptLimit; - const result2 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; + const result2 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; if (!shouldResolveModuleSpecifier && !shouldGetModuleSpecifierFromCache || shouldGetModuleSpecifierFromCache && !result2) { skippedAny = true; } @@ -146907,7 +149898,7 @@ function getCompletionsAtPosition(host, program, log, sourceFile, position, pref const compilerOptions = program.getCompilerOptions(); const incompleteCompletionsCache = preferences.allowIncompleteCompletions ? (_a2 = host.getIncompleteCompletionsCache) == null ? void 0 : _a2.call(host) : void 0; if (incompleteCompletionsCache && completionKind === 3 /* TriggerForIncompleteCompletions */ && previousToken && isIdentifier(previousToken)) { - const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken); + const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken, position); if (incompleteContinuation) { return incompleteContinuation; } @@ -146976,10 +149967,11 @@ function compareCompletionEntries(entryInArray, entryToInsert) { function completionEntryDataIsResolved(data) { return !!(data == null ? void 0 : data.moduleSpecifier); } -function continuePreviousIncompleteResponse(cache, file, location, program, host, preferences, cancellationToken) { +function continuePreviousIncompleteResponse(cache, file, location, program, host, preferences, cancellationToken, position) { const previousResponse = cache.get(); if (!previousResponse) return void 0; + const touchNode = getTouchingPropertyName(file, position); const lowerCaseTokenText = location.text.toLowerCase(); const exportMap = getExportInfoMap(file, host, program, preferences, cancellationToken); const newEntries = resolvingModuleSpecifiers( @@ -147003,7 +149995,7 @@ function continuePreviousIncompleteResponse(cache, file, location, program, host } const { origin } = Debug.checkDefined(getAutoImportSymbolFromCompletionEntryData(entry.name, entry.data, program, host)); const info = exportMap.get(file.path, entry.data.exportMapKey); - const result = info && context.tryResolve(info, entry.name, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); + const result = info && context.tryResolve(info, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); if (result === "skipped") return entry; if (!result || result === "failed") { @@ -147028,6 +150020,7 @@ function continuePreviousIncompleteResponse(cache, file, location, program, host ); previousResponse.entries = newEntries; previousResponse.flags = (previousResponse.flags || 0) | 4 /* IsContinuation */; + previousResponse.optionalReplacementSpan = getOptionalReplacementSpan(touchNode); return previousResponse; } function jsdocCompletionInfo(entries) { @@ -147122,6 +150115,7 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log, void 0, contextToken, location, + position, sourceFile, host, program, @@ -147235,10 +150229,10 @@ function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options, } else if (!tracker.hasValue(type.value)) { switch (typeof type.value) { case "object": - elements.push(factory.createBigIntLiteral(type.value)); + elements.push(type.value.negative ? factory.createPrefixUnaryExpression(40 /* MinusToken */, factory.createBigIntLiteral({ negative: false, base10Value: type.value.base10Value })) : factory.createBigIntLiteral(type.value)); break; case "number": - elements.push(factory.createNumericLiteral(type.value)); + elements.push(type.value < 0 ? factory.createPrefixUnaryExpression(40 /* MinusToken */, factory.createNumericLiteral(-type.value)) : factory.createNumericLiteral(type.value)); break; case "string": elements.push(factory.createStringLiteral(type.value, quotePreference === 0 /* Single */)); @@ -147250,7 +150244,7 @@ function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options, return void 0; } const newClauses = map(elements, (element) => factory.createCaseClause(element, [])); - const newLineChar = getNewLineCharacter(options, maybeBind(host, host.getNewLine)); + const newLineChar = getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options); const printer = createSnippetPrinter({ removeComments: true, module: options.module, @@ -147447,7 +150441,7 @@ function completionNameForLiteral(sourceFile, preferences, literal) { function createCompletionEntryForLiteral(sourceFile, preferences, literal) { return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } -function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { +function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { let insertText; let replacementSpan = getReplacementSpanForContextToken(replacementToken); let data; @@ -147505,7 +150499,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, } if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) { let importAdder; - ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext)); + ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext)); sortText = SortText.ClassMemberSnippets; if (importAdder == null ? void 0 : importAdder.hasFixes()) { hasAction = true; @@ -147569,7 +150563,7 @@ function isClassLikeMemberCompletion(symbol, location, sourceFile) { const memberFlags = 106500 /* ClassMember */ & 900095 /* EnumMemberExcludes */; return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent)); } -function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext) { +function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) { const classLikeDeclaration = findAncestor(location, isClassLike); if (!classLikeDeclaration) { return { insertText: name }; @@ -147584,7 +150578,7 @@ function getEntryForMemberCompletion(host, program, options, preferences, name, module: options.module, target: options.target, omitTrailingSemicolon: false, - newLine: getNewLineKind(getNewLineCharacter(options, maybeBind(host, host.getNewLine))) + newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) }); const importAdder = ts_codefix_exports.createImportAdder(sourceFile, program, preferences, host); let body; @@ -147605,7 +150599,7 @@ function getEntryForMemberCompletion(host, program, options, preferences, name, ); } let modifiers = 0 /* None */; - const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken); + const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken, sourceFile, position); const isAbstract = !!(presentModifiers & 256 /* Abstract */); const completionNodes = []; ts_codefix_exports.addNewNodeForMemberSymbol( @@ -147660,8 +150654,8 @@ function getEntryForMemberCompletion(host, program, options, preferences, name, } return { insertText, isSnippet, importAdder, replacementSpan }; } -function getPresentModifiers(contextToken) { - if (!contextToken) { +function getPresentModifiers(contextToken, sourceFile, position) { + if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) { return { modifiers: 0 /* None */ }; } let modifiers = 0 /* None */; @@ -147681,8 +150675,11 @@ function isModifierLike2(node) { if (isModifier(node)) { return node.kind; } - if (isIdentifier(node) && node.originalKeywordKind && isModifierKind(node.originalKeywordKind)) { - return node.originalKeywordKind; + if (isIdentifier(node)) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind && isModifierKind(originalKeywordKind)) { + return originalKeywordKind; + } } return void 0; } @@ -147699,7 +150696,7 @@ function getEntryForObjectLiteralMethodCompletion(symbol, name, enclosingDeclara module: options.module, target: options.target, omitTrailingSemicolon: false, - newLine: getNewLineKind(getNewLineCharacter(options, maybeBind(host, host.getNewLine))) + newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) }); if (formatContext) { insertText = printer.printAndFormatSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, factory.createNodeArray( @@ -148024,7 +151021,7 @@ function getSourceFromOrigin(origin) { return "TypeOnlyAlias/" /* TypeOnlyAlias */; } } -function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { +function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { var _a2; const start2 = timestamp(); const variableDeclaration = getVariableDeclaration(location); @@ -148047,6 +151044,7 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con replacementToken, contextToken, location, + position, sourceFile, host, program, @@ -148290,6 +151288,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo name, symbol, location, + position, contextToken, formatContext ); @@ -148330,7 +151329,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo targetSymbol, moduleSymbol, sourceFile, - getNameForExportedSymbol(symbol, getEmitScriptTarget(compilerOptions), isJsxOpeningTagName), + name, isJsxOpeningTagName, host, program, @@ -148670,6 +151669,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, case 347 /* JSDocTypeTag */: case 349 /* JSDocTypedefTag */: case 352 /* JSDocThrowsTag */: + case 353 /* JSDocSatisfiesTag */: return true; case 348 /* JSDocTemplateTag */: return !!tag.constraint; @@ -148812,7 +151812,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, moduleSymbol, symbol: firstAccessibleSymbol, targetFlags: skipAlias(firstAccessibleSymbol, typeChecker).flags - }], firstAccessibleSymbol.name, position, isValidTypeOnlyAliasUseSite(location)) || {}; + }], position, isValidTypeOnlyAliasUseSite(location)) || {}; if (moduleSpecifier) { const origin = { kind: getNullableSymbolOriginInfoKind(6 /* SymbolMemberExport */), @@ -148908,7 +151908,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, symbolToSortTextMap[getSymbolId(symbol)] = SortText.GlobalsOrKeywords; } if (typeOnlyAliasNeedsPromotion && !(symbol.flags & 111551 /* Value */)) { - const typeOnlyAliasDeclaration = symbol.declarations && find(symbol.declarations, isTypeOnlyImportOrExportDeclaration); + const typeOnlyAliasDeclaration = symbol.declarations && find(symbol.declarations, isTypeOnlyImportDeclaration); if (typeOnlyAliasDeclaration) { const origin = { kind: 64 /* TypeOnlyAlias */, declaration: typeOnlyAliasDeclaration }; symbolToOriginInfoMap[i] = origin; @@ -149038,7 +152038,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (!firstImportableExportInfo) { return; } - const result = context.tryResolve(info, symbolName2, isFromAmbientModule) || {}; + const result = context.tryResolve(info, isFromAmbientModule) || {}; if (result === "failed") return; let exportInfo2 = firstImportableExportInfo, moduleSpecifier; @@ -149881,7 +152881,8 @@ function isFunctionLikeBodyKeyword(kind) { return kind === 132 /* AsyncKeyword */ || kind === 133 /* AwaitKeyword */ || kind === 128 /* AsKeyword */ || kind === 150 /* SatisfiesKeyword */ || kind === 154 /* TypeKeyword */ || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node) { - return isIdentifier(node) ? node.originalKeywordKind || 0 /* Unknown */ : node.kind; + var _a2; + return isIdentifier(node) ? (_a2 = identifierToKeywordKind(node)) != null ? _a2 : 0 /* Unknown */ : node.kind; } function getContextualKeywords(contextToken, position) { const entries = []; @@ -149927,8 +152928,9 @@ function getPropertiesForCompletion(type, checker) { return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { + var _a2; switch (location.kind) { - case 353 /* SyntaxList */: + case 354 /* SyntaxList */: return tryCast(location.parent, isObjectTypeDeclaration); case 1 /* EndOfFileToken */: const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration); @@ -149937,8 +152939,8 @@ function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken } break; case 79 /* Identifier */: { - const originalKeywordKind = location.originalKeywordKind; - if (originalKeywordKind && isKeyword(originalKeywordKind)) { + const originalKeywordKind = identifierToKeywordKind(location); + if (originalKeywordKind) { return void 0; } if (isPropertyDeclaration(location.parent) && location.parent.initializer === location) { @@ -149964,14 +152966,14 @@ function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken case 27 /* CommaToken */: return tryCast(contextToken.parent, isObjectTypeDeclaration); default: - if (!isFromObjectTypeDeclaration(contextToken)) { - if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line && isObjectTypeDeclaration(location)) { + if (isObjectTypeDeclaration(location)) { + if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { return location; } - return void 0; + const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; + return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword((_a2 = identifierToKeywordKind(contextToken)) != null ? _a2 : 0 /* Unknown */) ? contextToken.parent.parent : void 0; } - const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; - return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword(stringToToken(contextToken.text)) ? contextToken.parent.parent : void 0; + return void 0; } } function tryGetTypeLiteralNode(node) { @@ -150274,10 +153276,10 @@ function getStringLiteralCompletions(sourceFile, position, contextToken, options if (!contextToken || !isStringLiteralLike(contextToken)) return void 0; const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences); - return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences); + return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position); } } -function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences) { +function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) { if (completion === void 0) { return void 0; } @@ -150293,6 +153295,7 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h contextToken, contextToken, sourceFile, + position, sourceFile, host, program, @@ -150933,7 +153936,7 @@ function removeLeadingDirectorySeparator(path) { } function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) { const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name)); - const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment)); + const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.indexOf("*") < 0); if (fragmentDirectory !== void 0) { const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory); return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator)); @@ -152908,7 +155911,7 @@ var Core; } } if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { - const isDefaultExport = referenceLocation.originalKeywordKind === 88 /* DefaultKeyword */ || exportSpecifier.name.originalKeywordKind === 88 /* DefaultKeyword */; + const isDefaultExport = referenceLocation.escapedText === "default" || exportSpecifier.name.escapedText === "default"; const exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */; const exportSymbol = Debug.checkDefined(exportSpecifier.symbol); const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker); @@ -154346,6 +157349,7 @@ var jsDocTagNames = [ "readonly", "requires", "returns", + "satisfies", "see", "since", "static", @@ -154455,6 +157459,7 @@ function getCommentDisplayParts(tag, checker) { } return displayParts; case 347 /* JSDocTypeTag */: + case 353 /* JSDocSatisfiesTag */: return withNode(tag.typeExpression); case 349 /* JSDocTypedefTag */: case 341 /* JSDocCallbackTag */: @@ -154691,6 +157696,7 @@ __export(ts_OrganizeImports_exports, { detectSorting: () => detectSorting, getImportDeclarationInsertionIndex: () => getImportDeclarationInsertionIndex, getImportSpecifierInsertionIndex: () => getImportSpecifierInsertionIndex, + getOrganizeImportsComparer: () => getOrganizeImportsComparer, organizeImports: () => organizeImports }); @@ -154700,18 +157706,21 @@ function organizeImports(sourceFile, formatContext, host, program, preferences, const shouldSort = mode === "SortAndCombine" /* SortAndCombine */ || mode === "All" /* All */; const shouldCombine = shouldSort; const shouldRemove = mode === "RemoveUnused" /* RemoveUnused */ || mode === "All" /* All */; - const maybeRemove = shouldRemove ? removeUnusedImports : identity; - const maybeCoalesce = shouldCombine ? coalesceImports : identity; const topLevelImportGroupDecls = groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)); - const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : shouldSort && detectSortingWorker(topLevelImportGroupDecls) === 2 /* CaseInsensitive */; + const comparer = getOrganizeImportsComparerWithDetection(preferences, shouldSort ? () => detectSortingWorker(topLevelImportGroupDecls, preferences) === 2 /* CaseInsensitive */ : void 0); const processImportsOfSameModuleSpecifier = (importGroup) => { - const processedDeclarations = maybeCoalesce(maybeRemove(importGroup, sourceFile, program), ignoreCase, sourceFile); - return shouldSort ? stableSort(processedDeclarations, (s1, s2) => compareImportsOrRequireStatements(s1, s2)) : processedDeclarations; + if (shouldRemove) + importGroup = removeUnusedImports(importGroup, sourceFile, program); + if (shouldCombine) + importGroup = coalesceImportsWorker(importGroup, comparer, sourceFile); + if (shouldSort) + importGroup = stableSort(importGroup, (s1, s2) => compareImportsOrRequireStatements(s1, s2, comparer)); + return importGroup; }; topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier)); if (mode !== "RemoveUnused" /* RemoveUnused */) { const topLevelExportDecls = sourceFile.statements.filter(isExportDeclaration); - organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExports(group2, ignoreCase)); + organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExportsWorker(group2, comparer)); } for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) { if (!ambientModule.body) @@ -154720,7 +157729,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences, ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier)); if (mode !== "RemoveUnused" /* RemoveUnused */) { const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration); - organizeImportsWorker(ambientModuleExportDecls, (group2) => coalesceExports(group2, ignoreCase)); + organizeImportsWorker(ambientModuleExportDecls, (group2) => coalesceExportsWorker(group2, comparer)); } } return changeTracker.getChanges(); @@ -154730,7 +157739,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences, } suppressLeadingTrivia(oldImportDecls[0]); const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls]; - const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiers2(group1[0].moduleSpecifier, group2[0].moduleSpecifier)) : oldImportGroups; + const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer)) : oldImportGroups; const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup); if (newImportDecls.length === 0) { changeTracker.deleteNodes( @@ -154853,12 +157862,14 @@ function getExternalModuleName2(specifier) { return specifier !== void 0 && isStringLiteralLike(specifier) ? specifier.text : void 0; } function coalesceImports(importGroup, ignoreCase, sourceFile) { - var _a2, _b, _c, _d; + const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); + return coalesceImportsWorker(importGroup, comparer, sourceFile); +} +function coalesceImportsWorker(importGroup, comparer, sourceFile) { if (importGroup.length === 0) { return importGroup; } const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroup); - const compareIdentifiers = ignoreCase ? compareIdentifiersCaseInsensitive : compareIdentifiersCaseSensitive; const coalescedImports = []; if (importWithoutClause) { coalescedImports.push(importWithoutClause); @@ -154873,7 +157884,7 @@ function coalesceImports(importGroup, ignoreCase, sourceFile) { ); continue; } - const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => compareIdentifiers(i1.importClause.namedBindings.name, i2.importClause.namedBindings.name)); + const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text)); for (const namespaceImport of sortedNamespaceImports) { coalescedImports.push( updateImportDeclarationAndClause( @@ -154884,7 +157895,10 @@ function coalesceImports(importGroup, ignoreCase, sourceFile) { ) ); } - if (defaultImports.length === 0 && namedImports.length === 0) { + const firstDefaultImport = firstOrUndefined(defaultImports); + const firstNamedImport = firstOrUndefined(namedImports); + const importDecl = firstDefaultImport != null ? firstDefaultImport : firstNamedImport; + if (!importDecl) { continue; } let newDefaultImport; @@ -154905,12 +157919,11 @@ function coalesceImports(importGroup, ignoreCase, sourceFile) { } newImportSpecifiers.push(...getNewImportSpecifiers(namedImports)); const sortedImportSpecifiers = factory.createNodeArray( - sortSpecifiers(newImportSpecifiers, ignoreCase), - (_b = (_a2 = namedImports[0]) == null ? void 0 : _a2.importClause.namedBindings) == null ? void 0 : _b.elements.hasTrailingComma + sortSpecifiers(newImportSpecifiers, comparer), + firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma ); - const importDecl = defaultImports.length > 0 ? defaultImports[0] : namedImports[0]; - const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : namedImports.length === 0 ? factory.createNamedImports(sortedImportSpecifiers) : factory.updateNamedImports(namedImports[0].importClause.namedBindings, sortedImportSpecifiers); - if (sourceFile && newNamedImports && ((_c = namedImports[0]) == null ? void 0 : _c.importClause.namedBindings) && !rangeIsOnSingleLine(namedImports[0].importClause.namedBindings, sourceFile)) { + const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers); + if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) { setEmitFlags(newNamedImports, 2 /* MultiLine */); } if (isTypeOnly && newDefaultImport && newNamedImports) { @@ -154924,7 +157937,7 @@ function coalesceImports(importGroup, ignoreCase, sourceFile) { ); coalescedImports.push( updateImportDeclarationAndClause( - (_d = namedImports[0]) != null ? _d : importDecl, + firstNamedImport != null ? firstNamedImport : importDecl, /*name*/ void 0, newNamedImports @@ -154967,6 +157980,10 @@ function getCategorizedImports(importGroup) { }; } function coalesceExports(exportGroup, ignoreCase) { + const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); + return coalesceExportsWorker(exportGroup, comparer); +} +function coalesceExportsWorker(exportGroup, comparer) { if (exportGroup.length === 0) { return exportGroup; } @@ -154981,7 +157998,7 @@ function coalesceExports(exportGroup, ignoreCase) { } const newExportSpecifiers = []; newExportSpecifiers.push(...flatMap(exportGroup2, (i) => i.exportClause && isNamedExports(i.exportClause) ? i.exportClause.elements : emptyArray)); - const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, ignoreCase); + const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, comparer); const exportDecl = exportGroup2[0]; coalescedExports.push( factory.updateExportDeclaration( @@ -155025,25 +158042,21 @@ function updateImportDeclarationAndClause(importDeclaration, name, namedBindings importDeclaration.assertClause ); } -function sortSpecifiers(specifiers, ignoreCase) { - return stableSort(specifiers, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, ignoreCase)); -} -function compareImportOrExportSpecifiers(s1, s2, ignoreCase) { - const compareIdentifiers = ignoreCase ? compareIdentifiersCaseInsensitive : compareIdentifiersCaseSensitive; - return compareBooleans(s1.isTypeOnly, s2.isTypeOnly) || compareIdentifiers(s1.name, s2.name); +function sortSpecifiers(specifiers, comparer) { + return stableSort(specifiers, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer)); } -function compareIdentifiersCaseSensitive(s1, s2) { - return compareStringsCaseSensitive(s1.text, s2.text); -} -function compareIdentifiersCaseInsensitive(s1, s2) { - return compareStringsCaseInsensitiveEslintCompatible(s1.text, s2.text); +function compareImportOrExportSpecifiers(s1, s2, comparer) { + return compareBooleans(s1.isTypeOnly, s2.isTypeOnly) || comparer(s1.name.text, s2.name.text); } function compareModuleSpecifiers2(m1, m2, ignoreCase) { + const comparer = getOrganizeImportsOrdinalStringComparer(!!ignoreCase); + return compareModuleSpecifiersWorker(m1, m2, comparer); +} +function compareModuleSpecifiersWorker(m1, m2, comparer) { const name1 = m1 === void 0 ? void 0 : getExternalModuleName2(m1); const name2 = m2 === void 0 ? void 0 : getExternalModuleName2(m2); - const compareStrings = ignoreCase ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseSensitive; return compareBooleans(name1 === void 0, name2 === void 0) || compareBooleans(isExternalModuleNameRelative(name1), isExternalModuleNameRelative(name2)) || // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - compareStrings(name1, name2); + comparer(name1, name2); } function getModuleSpecifierExpression(declaration) { var _a2; @@ -155056,24 +158069,40 @@ function getModuleSpecifierExpression(declaration) { return declaration.declarationList.declarations[0].initializer.arguments[0]; } } -function detectSorting(sourceFile) { +function detectSorting(sourceFile, preferences) { return detectSortingWorker( - groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)) + groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)), + preferences ); } -function detectSortingWorker(importGroups) { +function detectSortingWorker(importGroups, preferences) { + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); let sortState = 3 /* Both */; + let seenUnsortedGroup = false; for (const importGroup of importGroups) { if (importGroup.length > 1) { - sortState &= detectSortCaseSensitivity( + const moduleSpecifierSort = detectSortCaseSensitivity( importGroup, - /*useEslintOrdering*/ - true, (i) => { var _a2, _b; return (_b = (_a2 = tryCast(i.moduleSpecifier, isStringLiteral)) == null ? void 0 : _a2.text) != null ? _b : ""; - } + }, + collateCaseSensitive, + collateCaseInsensitive ); + if (moduleSpecifierSort) { + sortState &= moduleSpecifierSort; + seenUnsortedGroup = true; + } if (!sortState) { return sortState; } @@ -155086,7 +158115,11 @@ function detectSortingWorker(importGroups) { } ); if (declarationWithNamedImports) { - sortState &= detectImportSpecifierSorting(declarationWithNamedImports.importClause.namedBindings.elements); + const namedImportSort = detectImportSpecifierSorting(declarationWithNamedImports.importClause.namedBindings.elements, preferences); + if (namedImportSort) { + sortState &= namedImportSort; + seenUnsortedGroup = true; + } if (!sortState) { return sortState; } @@ -155095,37 +158128,73 @@ function detectSortingWorker(importGroups) { return sortState; } } - return sortState; + return seenUnsortedGroup ? 0 /* None */ : sortState; } -function detectImportDeclarationSorting(imports) { +function detectImportDeclarationSorting(imports, preferences) { + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); return detectSortCaseSensitivity( imports, - /*useEslintOrdering*/ - true, - (s) => getExternalModuleName2(getModuleSpecifierExpression(s)) || "" + (s) => getExternalModuleName2(getModuleSpecifierExpression(s)) || "", + collateCaseSensitive, + collateCaseInsensitive ); } -var detectImportSpecifierSorting = memoizeWeak((specifiers) => { +var ImportSpecifierSortingCache = class { + has([specifiers, preferences]) { + if (this._lastPreferences !== preferences || !this._cache) + return false; + return this._cache.has(specifiers); + } + get([specifiers, preferences]) { + if (this._lastPreferences !== preferences || !this._cache) + return void 0; + return this._cache.get(specifiers); + } + set([specifiers, preferences], value) { + var _a2; + if (this._lastPreferences !== preferences) { + this._lastPreferences = preferences; + this._cache = void 0; + } + (_a2 = this._cache) != null ? _a2 : this._cache = /* @__PURE__ */ new WeakMap(); + this._cache.set(specifiers, value); + } +}; +var detectImportSpecifierSorting = memoizeCached((specifiers, preferences) => { if (!arrayIsSorted(specifiers, (s1, s2) => compareBooleans(s1.isTypeOnly, s2.isTypeOnly))) { return 0 /* None */; } - return detectSortCaseSensitivity( - specifiers, - /*useEslintOrdering*/ - true, - (specifier) => specifier.name.text + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false ); -}); -function getImportDeclarationInsertionIndex(sortedImports, newImport, ignoreCase) { - const index = binarySearch(sortedImports, newImport, identity, (a, b) => compareImportsOrRequireStatements(a, b, ignoreCase)); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); + return detectSortCaseSensitivity(specifiers, (specifier) => specifier.name.text, collateCaseSensitive, collateCaseInsensitive); +}, new ImportSpecifierSortingCache()); +function getImportDeclarationInsertionIndex(sortedImports, newImport, comparer) { + const index = binarySearch(sortedImports, newImport, identity, (a, b) => compareImportsOrRequireStatements(a, b, comparer)); return index < 0 ? ~index : index; } -function getImportSpecifierInsertionIndex(sortedImports, newImport, ignoreCase) { - const index = binarySearch(sortedImports, newImport, identity, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, ignoreCase)); +function getImportSpecifierInsertionIndex(sortedImports, newImport, comparer) { + const index = binarySearch(sortedImports, newImport, identity, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer)); return index < 0 ? ~index : index; } -function compareImportsOrRequireStatements(s1, s2, ignoreCase) { - return compareModuleSpecifiers2(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), ignoreCase) || compareImportKind(s1, s2); +function compareImportsOrRequireStatements(s1, s2, comparer) { + return compareModuleSpecifiersWorker(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), comparer) || compareImportKind(s1, s2); } function compareImportKind(s1, s2) { return compareValues(getImportKindOrder(s1), getImportKindOrder(s2)); @@ -155168,6 +158237,44 @@ function tryGetNamedBindingElements(namedImport) { var _a2; return ((_a2 = namedImport.importClause) == null ? void 0 : _a2.namedBindings) && isNamedImports(namedImport.importClause.namedBindings) ? namedImport.importClause.namedBindings.elements : void 0; } +function getOrganizeImportsOrdinalStringComparer(ignoreCase) { + return ignoreCase ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseSensitive; +} +function getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) { + var _a2, _b, _c; + const resolvedLocale = getOrganizeImportsLocale(preferences); + const caseFirst = (_a2 = preferences.organizeImportsCaseFirst) != null ? _a2 : false; + const numeric = (_b = preferences.organizeImportsNumericCollation) != null ? _b : false; + const accents = (_c = preferences.organizeImportsAccentCollation) != null ? _c : true; + const sensitivity = ignoreCase ? accents ? "accent" : "base" : accents ? "variant" : "case"; + const collator = new Intl.Collator(resolvedLocale, { + usage: "sort", + caseFirst: caseFirst || "false", + sensitivity, + numeric + }); + return collator.compare; +} +function getOrganizeImportsLocale(preferences) { + let locale = preferences.organizeImportsLocale; + if (locale === "auto") + locale = getUILocale(); + if (locale === void 0) + locale = "en"; + const supportedLocales = Intl.Collator.supportedLocalesOf(locale); + const resolvedLocale = supportedLocales.length ? supportedLocales[0] : "en"; + return resolvedLocale; +} +function getOrganizeImportsComparer(preferences, ignoreCase) { + var _a2; + const collation = (_a2 = preferences.organizeImportsCollation) != null ? _a2 : "ordinal"; + return collation === "unicode" ? getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) : getOrganizeImportsOrdinalStringComparer(ignoreCase); +} +function getOrganizeImportsComparerWithDetection(preferences, detectIgnoreCase) { + var _a2; + const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : (_a2 = detectIgnoreCase == null ? void 0 : detectIgnoreCase()) != null ? _a2 : false; + return getOrganizeImportsComparer(preferences, ignoreCase); +} // src/services/_namespaces/ts.OutliningElementsCollector.ts var ts_OutliningElementsCollector_exports = {}; @@ -155626,7 +158733,7 @@ registerRefactor(refactorName, { Debug.assert(actionName2 === defaultToNamedAction.name || actionName2 === namedToDefaultAction.name, "Unexpected action name"); const info = getInfo19(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, info, t, context.cancellationToken)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(context.file, context.program, info, t, context.cancellationToken)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -155679,7 +158786,7 @@ function getInfo19(context, considerPartialSpans = true) { return void 0; } } -function doChange33(exportingSourceFile, program, info, changes, cancellationToken) { +function doChange32(exportingSourceFile, program, info, changes, cancellationToken) { changeExport(exportingSourceFile, info, changes, program.getTypeChecker()); changeImports(program, info, changes, cancellationToken); } @@ -155874,7 +158981,7 @@ registerRefactor(refactorName2, { Debug.assert(some(getOwnValues(actions), (action) => action.name === actionName2), "Unexpected action name"); const info = getImportConversionInfo(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, t, info)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, t, info)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -155905,7 +159012,7 @@ function getImportConversionInfo(context, considerPartialSpans = true) { function getShouldUseDefault(program, importClause) { return getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); } -function doChange34(sourceFile, program, changes, info) { +function doChange33(sourceFile, program, changes, info) { const checker = program.getTypeChecker(); if (info.convertTo === 0 /* Named */) { doChangeNamespaceToNamed(sourceFile, checker, changes, info.import, getAllowSyntheticDefaultImports(program.getCompilerOptions())); @@ -156378,7 +159485,7 @@ registerRefactor(refactorName4, { getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) { Debug.assert(actionName2 === refactorName4, "Wrong refactor invoked"); const statements = Debug.checkDefined(getStatementsToMove(context)); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(context.file, context.program, statements, t, context.host, context.preferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, statements, t, context.host, context.preferences)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -156403,7 +159510,7 @@ function getRangeToMove(context) { afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex] }; } -function doChange35(oldFile, program, toMove, changes, host, preferences) { +function doChange34(oldFile, program, toMove, changes, host, preferences) { const checker = program.getTypeChecker(); const usage = getUsageInfo(oldFile, toMove.all, checker); const currentDirectory = getDirectoryPath(oldFile.fileName); @@ -156484,7 +159591,8 @@ function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, p oldFile, importsFromNewFile, /*blankLineBetween*/ - true + true, + preferences ); } deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker); @@ -157778,12 +160886,12 @@ function getRefactorEditsToConvertParametersToDestructuredObject(context, action return void 0; const groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); if (groupedReferences.valid) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(file, program, host, t, functionDeclaration, groupedReferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(file, program, host, t, functionDeclaration, groupedReferences)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return { edits: [] }; } -function doChange36(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { +function doChange35(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { const signature = groupedReferences.signature; const newFunctionDeclarationParams = map(createNewParameters(functionDeclaration, program, host), (param) => getSynthesizedDeepClone(param)); if (signature) { @@ -158547,7 +161655,7 @@ function getRefactorEditsToConvertToOptionalChain(context, actionName2) { Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); const edits = ts_textChanges_exports.ChangeTracker.with( context, - (t) => doChange37(context.file, context.program.getTypeChecker(), t, info, actionName2) + (t) => doChange36(context.file, context.program.getTypeChecker(), t, info, actionName2) ); return { edits, renameFilename: void 0, renameLocation: void 0 }; } @@ -158703,7 +161811,7 @@ function convertOccurrences(checker, toConvert, occurrences) { } return toConvert; } -function doChange37(sourceFile, checker, changes, info, _actionName) { +function doChange36(sourceFile, checker, changes, info, _actionName) { const { finalExpression, occurrences, expression } = info; const firstOccurrence = occurrences[occurrences.length - 1]; const convertedChain = convertOccurrences(checker, finalExpression, occurrences); @@ -159655,7 +162763,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont 111551 /* Value */, /*excludeGlobals*/ false - ) && !isPrivateIdentifier(node.name) && !isKeyword(node.name.originalKeywordKind) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); + ) && !isPrivateIdentifier(node.name) && !identifierToKeywordKind(node.name) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); const isJS = isInJSFile(scope); let variableType = isJS || !checker.isContextSensitive(node) ? void 0 : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */); let initializer = transformConstantInitializer(skipParentheses(node), substitutions); @@ -159892,7 +163000,7 @@ function transformFunctionBody(body, exposedVariableDeclarations, writes, substi let ignoreReturns = false; const statements = factory.createNodeArray(isBlock(body) ? body.statements.slice(0) : [isStatement(body) ? body : factory.createReturnStatement(skipParentheses(body))]); if (hasWritesOrVariableDeclarations || substitutions.size) { - const rewrittenStatements = visitNodes2(statements, visitor).slice(); + const rewrittenStatements = visitNodes2(statements, visitor, isStatement).slice(); if (hasWritesOrVariableDeclarations && !hasReturn2 && isStatement(body)) { const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (assignments.length === 1) { @@ -159920,7 +163028,7 @@ function transformFunctionBody(body, exposedVariableDeclarations, writes, substi if (!returnValueProperty) { returnValueProperty = "__return"; } - assignments.unshift(factory.createPropertyAssignment(returnValueProperty, visitNode(node.expression, visitor))); + assignments.unshift(factory.createPropertyAssignment(returnValueProperty, visitNode(node.expression, visitor, isExpression))); } if (assignments.length === 1) { return factory.createReturnStatement(assignments[0].name); @@ -160408,7 +163516,7 @@ registerRefactor(refactorName12, { function getRefactorEditsToInferReturnType(context) { const info = getInfo21(context); if (info && !isRefactorErrorInfo(info)) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange38(context.file, t, info.declaration, info.returnTypeNode)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(context.file, t, info.declaration, info.returnTypeNode)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return void 0; @@ -160433,7 +163541,7 @@ function getRefactorActionsToInferReturnType(context) { } return emptyArray; } -function doChange38(sourceFile, changes, declaration, typeNode) { +function doChange37(sourceFile, changes, declaration, typeNode) { const closeParen = findChildOfKind(declaration, 21 /* CloseParenToken */, sourceFile); const needParens = isArrowFunction(declaration) && closeParen === void 0; const endNode2 = needParens ? first(declaration.parameters) : closeParen; @@ -160525,7 +163633,7 @@ function getRenameInfoForNode(node, typeChecker, sourceFile, program, preference if (declarations.some((declaration) => isDefinedInLibraryFile(program, declaration))) { return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } - if (isIdentifier(node) && node.originalKeywordKind === 88 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) { + if (isIdentifier(node) && node.escapedText === "default" && symbol.parent && symbol.parent.flags & 1536 /* Module */) { return void 0; } if (isStringLiteralLike(node) && tryGetImportFromModuleSpecifier(node)) { @@ -162733,7 +165841,6 @@ function updateJSDocHost(parent2) { } const jsDocNode = parent2.parent.kind === 169 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; jsDocNode.jsDoc = parent2.jsDoc; - jsDocNode.jsDocCache = parent2.jsDocCache; return jsDocNode; } function tryMergeJsdocTags(oldTag, newTag) { @@ -162939,6 +166046,7 @@ function assignPositionsToNodeArray(nodes, visitor, test, start2, count) { if (!visited) { return visited; } + Debug.assert(nodes); const nodeArray = visited === nodes ? factory.createNodeArray(visited.slice(0)) : visited; setTextRangePosEnd(nodeArray, getPos2(nodes), getEnd(nodes)); return nodeArray; @@ -166111,7 +169219,7 @@ function createDeprecation(name, options = {}) { const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter; const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter; const since = typeof options.since === "string" ? new Version(options.since) : (_b = options.since) != null ? _b : warnAfter; - const error = options.error || errorAfter && version2.compareTo(errorAfter) <= 0; + const error = options.error || errorAfter && version2.compareTo(errorAfter) >= 0; const warn = !warnAfter || version2.compareTo(warnAfter) >= 0; return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop; } @@ -166172,1276 +169280,37 @@ function buildOverload(name) { }; } -// src/deprecatedCompat/4.0/nodeFactoryTopLevelExports.ts -var factoryDeprecation = { since: "4.0", warnAfter: "4.1", message: "Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead." }; -var createNodeArray = deprecate(factory.createNodeArray, factoryDeprecation); -var createNumericLiteral = deprecate(factory.createNumericLiteral, factoryDeprecation); -var createBigIntLiteral = deprecate(factory.createBigIntLiteral, factoryDeprecation); -var createStringLiteral = deprecate(factory.createStringLiteral, factoryDeprecation); -var createStringLiteralFromNode = deprecate(factory.createStringLiteralFromNode, factoryDeprecation); -var createRegularExpressionLiteral = deprecate(factory.createRegularExpressionLiteral, factoryDeprecation); -var createLoopVariable = deprecate(factory.createLoopVariable, factoryDeprecation); -var createUniqueName = deprecate(factory.createUniqueName, factoryDeprecation); -var createPrivateIdentifier = deprecate(factory.createPrivateIdentifier, factoryDeprecation); -var createSuper = deprecate(factory.createSuper, factoryDeprecation); -var createThis = deprecate(factory.createThis, factoryDeprecation); -var createNull = deprecate(factory.createNull, factoryDeprecation); -var createTrue = deprecate(factory.createTrue, factoryDeprecation); -var createFalse = deprecate(factory.createFalse, factoryDeprecation); -var createModifier = deprecate(factory.createModifier, factoryDeprecation); -var createModifiersFromModifierFlags = deprecate(factory.createModifiersFromModifierFlags, factoryDeprecation); -var createQualifiedName = deprecate(factory.createQualifiedName, factoryDeprecation); -var updateQualifiedName = deprecate(factory.updateQualifiedName, factoryDeprecation); -var createComputedPropertyName = deprecate(factory.createComputedPropertyName, factoryDeprecation); -var updateComputedPropertyName = deprecate(factory.updateComputedPropertyName, factoryDeprecation); -var createTypeParameterDeclaration = deprecate(factory.createTypeParameterDeclaration, factoryDeprecation); -var updateTypeParameterDeclaration = deprecate(factory.updateTypeParameterDeclaration, factoryDeprecation); -var createParameter = deprecate(factory.createParameterDeclaration, factoryDeprecation); -var updateParameter = deprecate(factory.updateParameterDeclaration, factoryDeprecation); -var createDecorator = deprecate(factory.createDecorator, factoryDeprecation); -var updateDecorator = deprecate(factory.updateDecorator, factoryDeprecation); -var createProperty = deprecate(factory.createPropertyDeclaration, factoryDeprecation); -var updateProperty = deprecate(factory.updatePropertyDeclaration, factoryDeprecation); -var createMethod = deprecate(factory.createMethodDeclaration, factoryDeprecation); -var updateMethod = deprecate(factory.updateMethodDeclaration, factoryDeprecation); -var createConstructor = deprecate(factory.createConstructorDeclaration, factoryDeprecation); -var updateConstructor = deprecate(factory.updateConstructorDeclaration, factoryDeprecation); -var createGetAccessor = deprecate(factory.createGetAccessorDeclaration, factoryDeprecation); -var updateGetAccessor = deprecate(factory.updateGetAccessorDeclaration, factoryDeprecation); -var createSetAccessor = deprecate(factory.createSetAccessorDeclaration, factoryDeprecation); -var updateSetAccessor = deprecate(factory.updateSetAccessorDeclaration, factoryDeprecation); -var createCallSignature = deprecate(factory.createCallSignature, factoryDeprecation); -var updateCallSignature = deprecate(factory.updateCallSignature, factoryDeprecation); -var createConstructSignature = deprecate(factory.createConstructSignature, factoryDeprecation); -var updateConstructSignature = deprecate(factory.updateConstructSignature, factoryDeprecation); -var updateIndexSignature = deprecate(factory.updateIndexSignature, factoryDeprecation); -var createKeywordTypeNode = deprecate(factory.createKeywordTypeNode, factoryDeprecation); -var createTypePredicateNodeWithModifier = deprecate(factory.createTypePredicateNode, factoryDeprecation); -var updateTypePredicateNodeWithModifier = deprecate(factory.updateTypePredicateNode, factoryDeprecation); -var createTypeReferenceNode = deprecate(factory.createTypeReferenceNode, factoryDeprecation); -var updateTypeReferenceNode = deprecate(factory.updateTypeReferenceNode, factoryDeprecation); -var createFunctionTypeNode = deprecate(factory.createFunctionTypeNode, factoryDeprecation); -var updateFunctionTypeNode = deprecate(factory.updateFunctionTypeNode, factoryDeprecation); -var createConstructorTypeNode = deprecate((typeParameters, parameters, type) => { - return factory.createConstructorTypeNode( - /*modifiers*/ - void 0, - typeParameters, - parameters, - type - ); -}, factoryDeprecation); -var updateConstructorTypeNode = deprecate((node, typeParameters, parameters, type) => { - return factory.updateConstructorTypeNode(node, node.modifiers, typeParameters, parameters, type); -}, factoryDeprecation); -var createTypeQueryNode = deprecate(factory.createTypeQueryNode, factoryDeprecation); -var updateTypeQueryNode = deprecate(factory.updateTypeQueryNode, factoryDeprecation); -var createTypeLiteralNode = deprecate(factory.createTypeLiteralNode, factoryDeprecation); -var updateTypeLiteralNode = deprecate(factory.updateTypeLiteralNode, factoryDeprecation); -var createArrayTypeNode = deprecate(factory.createArrayTypeNode, factoryDeprecation); -var updateArrayTypeNode = deprecate(factory.updateArrayTypeNode, factoryDeprecation); -var createTupleTypeNode = deprecate(factory.createTupleTypeNode, factoryDeprecation); -var updateTupleTypeNode = deprecate(factory.updateTupleTypeNode, factoryDeprecation); -var createOptionalTypeNode = deprecate(factory.createOptionalTypeNode, factoryDeprecation); -var updateOptionalTypeNode = deprecate(factory.updateOptionalTypeNode, factoryDeprecation); -var createRestTypeNode = deprecate(factory.createRestTypeNode, factoryDeprecation); -var updateRestTypeNode = deprecate(factory.updateRestTypeNode, factoryDeprecation); -var createUnionTypeNode = deprecate(factory.createUnionTypeNode, factoryDeprecation); -var updateUnionTypeNode = deprecate(factory.updateUnionTypeNode, factoryDeprecation); -var createIntersectionTypeNode = deprecate(factory.createIntersectionTypeNode, factoryDeprecation); -var updateIntersectionTypeNode = deprecate(factory.updateIntersectionTypeNode, factoryDeprecation); -var createConditionalTypeNode = deprecate(factory.createConditionalTypeNode, factoryDeprecation); -var updateConditionalTypeNode = deprecate(factory.updateConditionalTypeNode, factoryDeprecation); -var createInferTypeNode = deprecate(factory.createInferTypeNode, factoryDeprecation); -var updateInferTypeNode = deprecate(factory.updateInferTypeNode, factoryDeprecation); -var createImportTypeNode = deprecate(factory.createImportTypeNode, factoryDeprecation); -var updateImportTypeNode = deprecate(factory.updateImportTypeNode, factoryDeprecation); -var createParenthesizedType = deprecate(factory.createParenthesizedType, factoryDeprecation); -var updateParenthesizedType = deprecate(factory.updateParenthesizedType, factoryDeprecation); -var createThisTypeNode = deprecate(factory.createThisTypeNode, factoryDeprecation); -var updateTypeOperatorNode = deprecate(factory.updateTypeOperatorNode, factoryDeprecation); -var createIndexedAccessTypeNode = deprecate(factory.createIndexedAccessTypeNode, factoryDeprecation); -var updateIndexedAccessTypeNode = deprecate(factory.updateIndexedAccessTypeNode, factoryDeprecation); -var createMappedTypeNode = deprecate(factory.createMappedTypeNode, factoryDeprecation); -var updateMappedTypeNode = deprecate(factory.updateMappedTypeNode, factoryDeprecation); -var createLiteralTypeNode = deprecate(factory.createLiteralTypeNode, factoryDeprecation); -var updateLiteralTypeNode = deprecate(factory.updateLiteralTypeNode, factoryDeprecation); -var createObjectBindingPattern = deprecate(factory.createObjectBindingPattern, factoryDeprecation); -var updateObjectBindingPattern = deprecate(factory.updateObjectBindingPattern, factoryDeprecation); -var createArrayBindingPattern = deprecate(factory.createArrayBindingPattern, factoryDeprecation); -var updateArrayBindingPattern = deprecate(factory.updateArrayBindingPattern, factoryDeprecation); -var createBindingElement = deprecate(factory.createBindingElement, factoryDeprecation); -var updateBindingElement = deprecate(factory.updateBindingElement, factoryDeprecation); -var createArrayLiteral = deprecate(factory.createArrayLiteralExpression, factoryDeprecation); -var updateArrayLiteral = deprecate(factory.updateArrayLiteralExpression, factoryDeprecation); -var createObjectLiteral = deprecate(factory.createObjectLiteralExpression, factoryDeprecation); -var updateObjectLiteral = deprecate(factory.updateObjectLiteralExpression, factoryDeprecation); -var createPropertyAccess = deprecate(factory.createPropertyAccessExpression, factoryDeprecation); -var updatePropertyAccess = deprecate(factory.updatePropertyAccessExpression, factoryDeprecation); -var createPropertyAccessChain = deprecate(factory.createPropertyAccessChain, factoryDeprecation); -var updatePropertyAccessChain = deprecate(factory.updatePropertyAccessChain, factoryDeprecation); -var createElementAccess = deprecate(factory.createElementAccessExpression, factoryDeprecation); -var updateElementAccess = deprecate(factory.updateElementAccessExpression, factoryDeprecation); -var createElementAccessChain = deprecate(factory.createElementAccessChain, factoryDeprecation); -var updateElementAccessChain = deprecate(factory.updateElementAccessChain, factoryDeprecation); -var createCall = deprecate(factory.createCallExpression, factoryDeprecation); -var updateCall = deprecate(factory.updateCallExpression, factoryDeprecation); -var createCallChain = deprecate(factory.createCallChain, factoryDeprecation); -var updateCallChain = deprecate(factory.updateCallChain, factoryDeprecation); -var createNew = deprecate(factory.createNewExpression, factoryDeprecation); -var updateNew = deprecate(factory.updateNewExpression, factoryDeprecation); -var createTypeAssertion = deprecate(factory.createTypeAssertion, factoryDeprecation); -var updateTypeAssertion = deprecate(factory.updateTypeAssertion, factoryDeprecation); -var createParen = deprecate(factory.createParenthesizedExpression, factoryDeprecation); -var updateParen = deprecate(factory.updateParenthesizedExpression, factoryDeprecation); -var createFunctionExpression = deprecate(factory.createFunctionExpression, factoryDeprecation); -var updateFunctionExpression = deprecate(factory.updateFunctionExpression, factoryDeprecation); -var createDelete = deprecate(factory.createDeleteExpression, factoryDeprecation); -var updateDelete = deprecate(factory.updateDeleteExpression, factoryDeprecation); -var createTypeOf = deprecate(factory.createTypeOfExpression, factoryDeprecation); -var updateTypeOf = deprecate(factory.updateTypeOfExpression, factoryDeprecation); -var createVoid = deprecate(factory.createVoidExpression, factoryDeprecation); -var updateVoid = deprecate(factory.updateVoidExpression, factoryDeprecation); -var createAwait = deprecate(factory.createAwaitExpression, factoryDeprecation); -var updateAwait = deprecate(factory.updateAwaitExpression, factoryDeprecation); -var createPrefix = deprecate(factory.createPrefixUnaryExpression, factoryDeprecation); -var updatePrefix = deprecate(factory.updatePrefixUnaryExpression, factoryDeprecation); -var createPostfix = deprecate(factory.createPostfixUnaryExpression, factoryDeprecation); -var updatePostfix = deprecate(factory.updatePostfixUnaryExpression, factoryDeprecation); -var createBinary = deprecate(factory.createBinaryExpression, factoryDeprecation); -var updateConditional = deprecate(factory.updateConditionalExpression, factoryDeprecation); -var createTemplateExpression = deprecate(factory.createTemplateExpression, factoryDeprecation); -var updateTemplateExpression = deprecate(factory.updateTemplateExpression, factoryDeprecation); -var createTemplateHead = deprecate(factory.createTemplateHead, factoryDeprecation); -var createTemplateMiddle = deprecate(factory.createTemplateMiddle, factoryDeprecation); -var createTemplateTail = deprecate(factory.createTemplateTail, factoryDeprecation); -var createNoSubstitutionTemplateLiteral = deprecate(factory.createNoSubstitutionTemplateLiteral, factoryDeprecation); -var updateYield = deprecate(factory.updateYieldExpression, factoryDeprecation); -var createSpread = deprecate(factory.createSpreadElement, factoryDeprecation); -var updateSpread = deprecate(factory.updateSpreadElement, factoryDeprecation); -var createOmittedExpression = deprecate(factory.createOmittedExpression, factoryDeprecation); -var createAsExpression = deprecate(factory.createAsExpression, factoryDeprecation); -var updateAsExpression = deprecate(factory.updateAsExpression, factoryDeprecation); -var createNonNullExpression = deprecate(factory.createNonNullExpression, factoryDeprecation); -var updateNonNullExpression = deprecate(factory.updateNonNullExpression, factoryDeprecation); -var createNonNullChain = deprecate(factory.createNonNullChain, factoryDeprecation); -var updateNonNullChain = deprecate(factory.updateNonNullChain, factoryDeprecation); -var createMetaProperty = deprecate(factory.createMetaProperty, factoryDeprecation); -var updateMetaProperty = deprecate(factory.updateMetaProperty, factoryDeprecation); -var createTemplateSpan = deprecate(factory.createTemplateSpan, factoryDeprecation); -var updateTemplateSpan = deprecate(factory.updateTemplateSpan, factoryDeprecation); -var createSemicolonClassElement = deprecate(factory.createSemicolonClassElement, factoryDeprecation); -var createBlock = deprecate(factory.createBlock, factoryDeprecation); -var updateBlock = deprecate(factory.updateBlock, factoryDeprecation); -var createVariableStatement = deprecate(factory.createVariableStatement, factoryDeprecation); -var updateVariableStatement = deprecate(factory.updateVariableStatement, factoryDeprecation); -var createEmptyStatement = deprecate(factory.createEmptyStatement, factoryDeprecation); -var createExpressionStatement = deprecate(factory.createExpressionStatement, factoryDeprecation); -var updateExpressionStatement = deprecate(factory.updateExpressionStatement, factoryDeprecation); -var createStatement = deprecate(factory.createExpressionStatement, factoryDeprecation); -var updateStatement = deprecate(factory.updateExpressionStatement, factoryDeprecation); -var createIf = deprecate(factory.createIfStatement, factoryDeprecation); -var updateIf = deprecate(factory.updateIfStatement, factoryDeprecation); -var createDo = deprecate(factory.createDoStatement, factoryDeprecation); -var updateDo = deprecate(factory.updateDoStatement, factoryDeprecation); -var createWhile = deprecate(factory.createWhileStatement, factoryDeprecation); -var updateWhile = deprecate(factory.updateWhileStatement, factoryDeprecation); -var createFor = deprecate(factory.createForStatement, factoryDeprecation); -var updateFor = deprecate(factory.updateForStatement, factoryDeprecation); -var createForIn = deprecate(factory.createForInStatement, factoryDeprecation); -var updateForIn = deprecate(factory.updateForInStatement, factoryDeprecation); -var createForOf = deprecate(factory.createForOfStatement, factoryDeprecation); -var updateForOf = deprecate(factory.updateForOfStatement, factoryDeprecation); -var createContinue = deprecate(factory.createContinueStatement, factoryDeprecation); -var updateContinue = deprecate(factory.updateContinueStatement, factoryDeprecation); -var createBreak = deprecate(factory.createBreakStatement, factoryDeprecation); -var updateBreak = deprecate(factory.updateBreakStatement, factoryDeprecation); -var createReturn = deprecate(factory.createReturnStatement, factoryDeprecation); -var updateReturn = deprecate(factory.updateReturnStatement, factoryDeprecation); -var createWith = deprecate(factory.createWithStatement, factoryDeprecation); -var updateWith = deprecate(factory.updateWithStatement, factoryDeprecation); -var createSwitch = deprecate(factory.createSwitchStatement, factoryDeprecation); -var updateSwitch = deprecate(factory.updateSwitchStatement, factoryDeprecation); -var createLabel = deprecate(factory.createLabeledStatement, factoryDeprecation); -var updateLabel = deprecate(factory.updateLabeledStatement, factoryDeprecation); -var createThrow = deprecate(factory.createThrowStatement, factoryDeprecation); -var updateThrow = deprecate(factory.updateThrowStatement, factoryDeprecation); -var createTry = deprecate(factory.createTryStatement, factoryDeprecation); -var updateTry = deprecate(factory.updateTryStatement, factoryDeprecation); -var createDebuggerStatement = deprecate(factory.createDebuggerStatement, factoryDeprecation); -var createVariableDeclarationList = deprecate(factory.createVariableDeclarationList, factoryDeprecation); -var updateVariableDeclarationList = deprecate(factory.updateVariableDeclarationList, factoryDeprecation); -var createFunctionDeclaration = deprecate(factory.createFunctionDeclaration, factoryDeprecation); -var updateFunctionDeclaration = deprecate(factory.updateFunctionDeclaration, factoryDeprecation); -var createClassDeclaration = deprecate(factory.createClassDeclaration, factoryDeprecation); -var updateClassDeclaration = deprecate(factory.updateClassDeclaration, factoryDeprecation); -var createInterfaceDeclaration = deprecate(factory.createInterfaceDeclaration, factoryDeprecation); -var updateInterfaceDeclaration = deprecate(factory.updateInterfaceDeclaration, factoryDeprecation); -var createTypeAliasDeclaration = deprecate(factory.createTypeAliasDeclaration, factoryDeprecation); -var updateTypeAliasDeclaration = deprecate(factory.updateTypeAliasDeclaration, factoryDeprecation); -var createEnumDeclaration = deprecate(factory.createEnumDeclaration, factoryDeprecation); -var updateEnumDeclaration = deprecate(factory.updateEnumDeclaration, factoryDeprecation); -var createModuleDeclaration = deprecate(factory.createModuleDeclaration, factoryDeprecation); -var updateModuleDeclaration = deprecate(factory.updateModuleDeclaration, factoryDeprecation); -var createModuleBlock = deprecate(factory.createModuleBlock, factoryDeprecation); -var updateModuleBlock = deprecate(factory.updateModuleBlock, factoryDeprecation); -var createCaseBlock = deprecate(factory.createCaseBlock, factoryDeprecation); -var updateCaseBlock = deprecate(factory.updateCaseBlock, factoryDeprecation); -var createNamespaceExportDeclaration = deprecate(factory.createNamespaceExportDeclaration, factoryDeprecation); -var updateNamespaceExportDeclaration = deprecate(factory.updateNamespaceExportDeclaration, factoryDeprecation); -var createImportEqualsDeclaration = deprecate(factory.createImportEqualsDeclaration, factoryDeprecation); -var updateImportEqualsDeclaration = deprecate(factory.updateImportEqualsDeclaration, factoryDeprecation); -var createImportDeclaration = deprecate(factory.createImportDeclaration, factoryDeprecation); -var updateImportDeclaration = deprecate(factory.updateImportDeclaration, factoryDeprecation); -var createNamespaceImport = deprecate(factory.createNamespaceImport, factoryDeprecation); -var updateNamespaceImport = deprecate(factory.updateNamespaceImport, factoryDeprecation); -var createNamedImports = deprecate(factory.createNamedImports, factoryDeprecation); -var updateNamedImports = deprecate(factory.updateNamedImports, factoryDeprecation); -var createImportSpecifier = deprecate(factory.createImportSpecifier, factoryDeprecation); -var updateImportSpecifier = deprecate(factory.updateImportSpecifier, factoryDeprecation); -var createExportAssignment2 = deprecate(factory.createExportAssignment, factoryDeprecation); -var updateExportAssignment = deprecate(factory.updateExportAssignment, factoryDeprecation); -var createNamedExports = deprecate(factory.createNamedExports, factoryDeprecation); -var updateNamedExports = deprecate(factory.updateNamedExports, factoryDeprecation); -var createExportSpecifier = deprecate(factory.createExportSpecifier, factoryDeprecation); -var updateExportSpecifier = deprecate(factory.updateExportSpecifier, factoryDeprecation); -var createExternalModuleReference = deprecate(factory.createExternalModuleReference, factoryDeprecation); -var updateExternalModuleReference = deprecate(factory.updateExternalModuleReference, factoryDeprecation); -var createJSDocTypeExpression = deprecate(factory.createJSDocTypeExpression, factoryDeprecation); -var createJSDocTypeTag = deprecate(factory.createJSDocTypeTag, factoryDeprecation); -var createJSDocReturnTag = deprecate(factory.createJSDocReturnTag, factoryDeprecation); -var createJSDocThisTag = deprecate(factory.createJSDocThisTag, factoryDeprecation); -var createJSDocComment = deprecate(factory.createJSDocComment, factoryDeprecation); -var createJSDocParameterTag = deprecate(factory.createJSDocParameterTag, factoryDeprecation); -var createJSDocClassTag = deprecate(factory.createJSDocClassTag, factoryDeprecation); -var createJSDocAugmentsTag = deprecate(factory.createJSDocAugmentsTag, factoryDeprecation); -var createJSDocEnumTag = deprecate(factory.createJSDocEnumTag, factoryDeprecation); -var createJSDocTemplateTag = deprecate(factory.createJSDocTemplateTag, factoryDeprecation); -var createJSDocTypedefTag = deprecate(factory.createJSDocTypedefTag, factoryDeprecation); -var createJSDocCallbackTag = deprecate(factory.createJSDocCallbackTag, factoryDeprecation); -var createJSDocSignature = deprecate(factory.createJSDocSignature, factoryDeprecation); -var createJSDocPropertyTag = deprecate(factory.createJSDocPropertyTag, factoryDeprecation); -var createJSDocTypeLiteral = deprecate(factory.createJSDocTypeLiteral, factoryDeprecation); -var createJSDocImplementsTag = deprecate(factory.createJSDocImplementsTag, factoryDeprecation); -var createJSDocAuthorTag = deprecate(factory.createJSDocAuthorTag, factoryDeprecation); -var createJSDocPublicTag = deprecate(factory.createJSDocPublicTag, factoryDeprecation); -var createJSDocPrivateTag = deprecate(factory.createJSDocPrivateTag, factoryDeprecation); -var createJSDocProtectedTag = deprecate(factory.createJSDocProtectedTag, factoryDeprecation); -var createJSDocReadonlyTag = deprecate(factory.createJSDocReadonlyTag, factoryDeprecation); -var createJSDocTag = deprecate(factory.createJSDocUnknownTag, factoryDeprecation); -var createJsxElement = deprecate(factory.createJsxElement, factoryDeprecation); -var updateJsxElement = deprecate(factory.updateJsxElement, factoryDeprecation); -var createJsxSelfClosingElement = deprecate(factory.createJsxSelfClosingElement, factoryDeprecation); -var updateJsxSelfClosingElement = deprecate(factory.updateJsxSelfClosingElement, factoryDeprecation); -var createJsxOpeningElement = deprecate(factory.createJsxOpeningElement, factoryDeprecation); -var updateJsxOpeningElement = deprecate(factory.updateJsxOpeningElement, factoryDeprecation); -var createJsxClosingElement = deprecate(factory.createJsxClosingElement, factoryDeprecation); -var updateJsxClosingElement = deprecate(factory.updateJsxClosingElement, factoryDeprecation); -var createJsxFragment = deprecate(factory.createJsxFragment, factoryDeprecation); -var createJsxText = deprecate(factory.createJsxText, factoryDeprecation); -var updateJsxText = deprecate(factory.updateJsxText, factoryDeprecation); -var createJsxOpeningFragment = deprecate(factory.createJsxOpeningFragment, factoryDeprecation); -var createJsxJsxClosingFragment = deprecate(factory.createJsxJsxClosingFragment, factoryDeprecation); -var updateJsxFragment = deprecate(factory.updateJsxFragment, factoryDeprecation); -var createJsxAttribute = deprecate(factory.createJsxAttribute, factoryDeprecation); -var updateJsxAttribute = deprecate(factory.updateJsxAttribute, factoryDeprecation); -var createJsxAttributes = deprecate(factory.createJsxAttributes, factoryDeprecation); -var updateJsxAttributes = deprecate(factory.updateJsxAttributes, factoryDeprecation); -var createJsxSpreadAttribute = deprecate(factory.createJsxSpreadAttribute, factoryDeprecation); -var updateJsxSpreadAttribute = deprecate(factory.updateJsxSpreadAttribute, factoryDeprecation); -var createJsxExpression = deprecate(factory.createJsxExpression, factoryDeprecation); -var updateJsxExpression = deprecate(factory.updateJsxExpression, factoryDeprecation); -var createCaseClause = deprecate(factory.createCaseClause, factoryDeprecation); -var updateCaseClause = deprecate(factory.updateCaseClause, factoryDeprecation); -var createDefaultClause = deprecate(factory.createDefaultClause, factoryDeprecation); -var updateDefaultClause = deprecate(factory.updateDefaultClause, factoryDeprecation); -var createHeritageClause = deprecate(factory.createHeritageClause, factoryDeprecation); -var updateHeritageClause = deprecate(factory.updateHeritageClause, factoryDeprecation); -var createCatchClause = deprecate(factory.createCatchClause, factoryDeprecation); -var updateCatchClause = deprecate(factory.updateCatchClause, factoryDeprecation); -var createPropertyAssignment = deprecate(factory.createPropertyAssignment, factoryDeprecation); -var updatePropertyAssignment = deprecate(factory.updatePropertyAssignment, factoryDeprecation); -var createShorthandPropertyAssignment = deprecate(factory.createShorthandPropertyAssignment, factoryDeprecation); -var updateShorthandPropertyAssignment = deprecate(factory.updateShorthandPropertyAssignment, factoryDeprecation); -var createSpreadAssignment = deprecate(factory.createSpreadAssignment, factoryDeprecation); -var updateSpreadAssignment = deprecate(factory.updateSpreadAssignment, factoryDeprecation); -var createEnumMember = deprecate(factory.createEnumMember, factoryDeprecation); -var updateEnumMember = deprecate(factory.updateEnumMember, factoryDeprecation); -var updateSourceFileNode = deprecate(factory.updateSourceFile, factoryDeprecation); -var createNotEmittedStatement = deprecate(factory.createNotEmittedStatement, factoryDeprecation); -var createPartiallyEmittedExpression = deprecate(factory.createPartiallyEmittedExpression, factoryDeprecation); -var updatePartiallyEmittedExpression = deprecate(factory.updatePartiallyEmittedExpression, factoryDeprecation); -var createCommaList = deprecate(factory.createCommaListExpression, factoryDeprecation); -var updateCommaList = deprecate(factory.updateCommaListExpression, factoryDeprecation); -var createBundle = deprecate(factory.createBundle, factoryDeprecation); -var updateBundle = deprecate(factory.updateBundle, factoryDeprecation); -var createImmediatelyInvokedFunctionExpression = deprecate(factory.createImmediatelyInvokedFunctionExpression, factoryDeprecation); -var createImmediatelyInvokedArrowFunction = deprecate(factory.createImmediatelyInvokedArrowFunction, factoryDeprecation); -var createVoidZero = deprecate(factory.createVoidZero, factoryDeprecation); -var createExportDefault = deprecate(factory.createExportDefault, factoryDeprecation); -var createExternalModuleExport = deprecate(factory.createExternalModuleExport, factoryDeprecation); -var createNamespaceExport = deprecate(factory.createNamespaceExport, factoryDeprecation); -var updateNamespaceExport = deprecate(factory.updateNamespaceExport, factoryDeprecation); -var createToken = deprecate(function createToken2(kind) { - return factory.createToken(kind); -}, factoryDeprecation); -var createIdentifier = deprecate(function createIdentifier2(text) { - return factory.createIdentifier( - text, - /*typeArguments*/ - void 0, - /*originalKeywordKind*/ - void 0 - ); -}, factoryDeprecation); -var createTempVariable = deprecate(function createTempVariable2(recordTempVariable) { - return factory.createTempVariable( - recordTempVariable, - /*reserveInNestedScopes*/ - void 0 - ); -}, factoryDeprecation); -var getGeneratedNameForNode = deprecate(function getGeneratedNameForNode2(node) { - return factory.getGeneratedNameForNode( - node, - /*flags*/ - void 0 - ); -}, factoryDeprecation); -var createOptimisticUniqueName = deprecate(function createOptimisticUniqueName2(text) { - return factory.createUniqueName(text, 16 /* Optimistic */); -}, factoryDeprecation); -var createFileLevelUniqueName = deprecate(function createFileLevelUniqueName2(text) { - return factory.createUniqueName(text, 16 /* Optimistic */ | 32 /* FileLevel */); -}, factoryDeprecation); -var createIndexSignature = deprecate(function createIndexSignature2(decorators, modifiers, parameters, type) { - return factory.createIndexSignature(decorators, modifiers, parameters, type); -}, factoryDeprecation); -var createTypePredicateNode = deprecate(function createTypePredicateNode2(parameterName, type) { - return factory.createTypePredicateNode( - /*assertsModifier*/ - void 0, - parameterName, - type - ); -}, factoryDeprecation); -var updateTypePredicateNode = deprecate(function updateTypePredicateNode2(node, parameterName, type) { - return factory.updateTypePredicateNode( - node, - /*assertsModifier*/ - void 0, - parameterName, - type - ); -}, factoryDeprecation); -var createLiteral = deprecate(function createLiteral2(value) { - if (typeof value === "number") { - return factory.createNumericLiteral(value); - } - if (typeof value === "object" && "base10Value" in value) { - return factory.createBigIntLiteral(value); - } - if (typeof value === "boolean") { - return value ? factory.createTrue() : factory.createFalse(); - } - if (typeof value === "string") { - return factory.createStringLiteral( - value, - /*isSingleQuote*/ - void 0 - ); - } - return factory.createStringLiteralFromNode(value); -}, { since: "4.0", warnAfter: "4.1", message: "Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead." }); -var createMethodSignature = deprecate(function createMethodSignature2(typeParameters, parameters, type, name, questionToken) { - return factory.createMethodSignature( - /*modifiers*/ - void 0, - name, - questionToken, - typeParameters, - parameters, - type - ); -}, factoryDeprecation); -var updateMethodSignature = deprecate(function updateMethodSignature2(node, typeParameters, parameters, type, name, questionToken) { - return factory.updateMethodSignature(node, node.modifiers, name, questionToken, typeParameters, parameters, type); -}, factoryDeprecation); -var createTypeOperatorNode = deprecate(function createTypeOperatorNode2(operatorOrType, type) { - let operator; - if (type) { - operator = operatorOrType; - } else { - type = operatorOrType; - operator = 141 /* KeyOfKeyword */; - } - return factory.createTypeOperatorNode(operator, type); -}, factoryDeprecation); -var createTaggedTemplate = deprecate(function createTaggedTemplate2(tag, typeArgumentsOrTemplate, template) { - let typeArguments; - if (template) { - typeArguments = typeArgumentsOrTemplate; - } else { - template = typeArgumentsOrTemplate; - } - return factory.createTaggedTemplateExpression(tag, typeArguments, template); -}, factoryDeprecation); -var updateTaggedTemplate = deprecate(function updateTaggedTemplate2(node, tag, typeArgumentsOrTemplate, template) { - let typeArguments; - if (template) { - typeArguments = typeArgumentsOrTemplate; - } else { - template = typeArgumentsOrTemplate; - } - return factory.updateTaggedTemplateExpression(node, tag, typeArguments, template); -}, factoryDeprecation); -var updateBinary = deprecate(function updateBinary2(node, left, right, operator = node.operatorToken) { - if (typeof operator === "number") { - operator = operator === node.operatorToken.kind ? node.operatorToken : factory.createToken(operator); - } - return factory.updateBinaryExpression(node, left, operator, right); -}, factoryDeprecation); -var createConditional = deprecate(function createConditional2(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - return arguments.length === 5 ? factory.createConditionalExpression(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) : arguments.length === 3 ? factory.createConditionalExpression(condition, factory.createToken(57 /* QuestionToken */), questionTokenOrWhenTrue, factory.createToken(58 /* ColonToken */), whenTrueOrWhenFalse) : Debug.fail("Argument count mismatch"); -}, factoryDeprecation); -var createYield = deprecate(function createYield2(asteriskTokenOrExpression, expression) { - let asteriskToken; - if (expression) { - asteriskToken = asteriskTokenOrExpression; - } else { - expression = asteriskTokenOrExpression; +// src/deprecatedCompat/5.0/identifierProperties.ts +addObjectAllocatorPatcher((objectAllocator2) => { + const Identifier73 = objectAllocator2.getIdentifierConstructor(); + if (!hasProperty(Identifier73.prototype, "originalKeywordKind")) { + Object.defineProperty(Identifier73.prototype, "originalKeywordKind", { + get: deprecate(function() { + return identifierToKeywordKind(this); + }, { + name: "originalKeywordKind", + since: "5.0", + warnAfter: "5.1", + errorAfter: "5.2", + message: "Use 'identifierToKeywordKind(identifier)' instead." + }) + }); } - return factory.createYieldExpression(asteriskToken, expression); -}, factoryDeprecation); -var createClassExpression = deprecate(function createClassExpression2(modifiers, name, typeParameters, heritageClauses, members) { - return factory.createClassExpression( - /*decorators*/ - void 0, - modifiers, - name, - typeParameters, - heritageClauses, - members - ); -}, factoryDeprecation); -var updateClassExpression = deprecate(function updateClassExpression2(node, modifiers, name, typeParameters, heritageClauses, members) { - return factory.updateClassExpression( - node, - /*decorators*/ - void 0, - modifiers, - name, - typeParameters, - heritageClauses, - members - ); -}, factoryDeprecation); -var createPropertySignature = deprecate(function createPropertySignature2(modifiers, name, questionToken, type, initializer) { - const node = factory.createPropertySignature(modifiers, name, questionToken, type); - node.initializer = initializer; - return node; -}, factoryDeprecation); -var updatePropertySignature = deprecate(function updatePropertySignature2(node, modifiers, name, questionToken, type, initializer) { - let updated = factory.updatePropertySignature(node, modifiers, name, questionToken, type); - if (node.initializer !== initializer) { - if (updated === node) { - updated = factory.cloneNode(node); - } - updated.initializer = initializer; + if (!hasProperty(Identifier73.prototype, "isInJSDocNamespace")) { + Object.defineProperty(Identifier73.prototype, "isInJSDocNamespace", { + get: deprecate(function() { + return this.flags & 2048 /* IdentifierIsInJSDocNamespace */ ? true : void 0; + }, { + name: "isInJSDocNamespace", + since: "5.0", + warnAfter: "5.1", + errorAfter: "5.2", + message: "Use '.parent' or the surrounding context to determine this instead." + }) + }); } - return updated; -}, factoryDeprecation); -var createExpressionWithTypeArguments = deprecate(function createExpressionWithTypeArguments2(typeArguments, expression) { - return factory.createExpressionWithTypeArguments(expression, typeArguments); -}, factoryDeprecation); -var updateExpressionWithTypeArguments = deprecate(function updateExpressionWithTypeArguments2(node, typeArguments, expression) { - return factory.updateExpressionWithTypeArguments(node, expression, typeArguments); -}, factoryDeprecation); -var createArrowFunction = deprecate(function createArrowFunction2(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) { - return arguments.length === 6 ? factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) : arguments.length === 5 ? factory.createArrowFunction( - modifiers, - typeParameters, - parameters, - type, - /*equalsGreaterThanToken*/ - void 0, - equalsGreaterThanTokenOrBody - ) : Debug.fail("Argument count mismatch"); -}, factoryDeprecation); -var updateArrowFunction = deprecate(function updateArrowFunction2(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) { - return arguments.length === 7 ? factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) : arguments.length === 6 ? factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, equalsGreaterThanTokenOrBody) : Debug.fail("Argument count mismatch"); -}, factoryDeprecation); -var createVariableDeclaration = deprecate(function createVariableDeclaration2(name, exclamationTokenOrType, typeOrInitializer, initializer) { - return arguments.length === 4 ? factory.createVariableDeclaration(name, exclamationTokenOrType, typeOrInitializer, initializer) : arguments.length >= 1 && arguments.length <= 3 ? factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - exclamationTokenOrType, - typeOrInitializer - ) : Debug.fail("Argument count mismatch"); -}, factoryDeprecation); -var updateVariableDeclaration = deprecate(function updateVariableDeclaration2(node, name, exclamationTokenOrType, typeOrInitializer, initializer) { - return arguments.length === 5 ? factory.updateVariableDeclaration(node, name, exclamationTokenOrType, typeOrInitializer, initializer) : arguments.length === 4 ? factory.updateVariableDeclaration(node, name, node.exclamationToken, exclamationTokenOrType, typeOrInitializer) : Debug.fail("Argument count mismatch"); -}, factoryDeprecation); -var createImportClause = deprecate(function createImportClause2(name, namedBindings, isTypeOnly = false) { - return factory.createImportClause(isTypeOnly, name, namedBindings); -}, factoryDeprecation); -var updateImportClause = deprecate(function updateImportClause2(node, name, namedBindings, isTypeOnly) { - return factory.updateImportClause(node, isTypeOnly, name, namedBindings); -}, factoryDeprecation); -var createExportDeclaration = deprecate(function createExportDeclaration2(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly = false) { - return factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier); -}, factoryDeprecation); -var updateExportDeclaration = deprecate(function updateExportDeclaration2(node, decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { - return factory.updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, node.assertClause); -}, factoryDeprecation); -var createJSDocParamTag = deprecate(function createJSDocParamTag2(name, isBracketed, typeExpression, comment) { - return factory.createJSDocParameterTag( - /*tagName*/ - void 0, - name, - isBracketed, - typeExpression, - /*isNameFirst*/ - false, - comment ? factory.createNodeArray([factory.createJSDocText(comment)]) : void 0 - ); -}, factoryDeprecation); -var createComma = deprecate(function createComma2(left, right) { - return factory.createComma(left, right); -}, factoryDeprecation); -var createLessThan = deprecate(function createLessThan2(left, right) { - return factory.createLessThan(left, right); -}, factoryDeprecation); -var createAssignment = deprecate(function createAssignment2(left, right) { - return factory.createAssignment(left, right); -}, factoryDeprecation); -var createStrictEquality = deprecate(function createStrictEquality2(left, right) { - return factory.createStrictEquality(left, right); -}, factoryDeprecation); -var createStrictInequality = deprecate(function createStrictInequality2(left, right) { - return factory.createStrictInequality(left, right); -}, factoryDeprecation); -var createAdd = deprecate(function createAdd2(left, right) { - return factory.createAdd(left, right); -}, factoryDeprecation); -var createSubtract = deprecate(function createSubtract2(left, right) { - return factory.createSubtract(left, right); -}, factoryDeprecation); -var createLogicalAnd = deprecate(function createLogicalAnd2(left, right) { - return factory.createLogicalAnd(left, right); -}, factoryDeprecation); -var createLogicalOr = deprecate(function createLogicalOr2(left, right) { - return factory.createLogicalOr(left, right); -}, factoryDeprecation); -var createPostfixIncrement = deprecate(function createPostfixIncrement2(operand) { - return factory.createPostfixIncrement(operand); -}, factoryDeprecation); -var createLogicalNot = deprecate(function createLogicalNot2(operand) { - return factory.createLogicalNot(operand); -}, factoryDeprecation); -var createNode2 = deprecate(function createNode3(kind, pos = 0, end = 0) { - return setTextRangePosEnd( - kind === 308 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind), - pos, - end - ); -}, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory` method instead." }); -var getMutableClone = deprecate(function getMutableClone2(node) { - const clone2 = factory.cloneNode(node); - setTextRange(clone2, node); - setParent(clone2, node.parent); - return clone2; -}, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`." }); - -// src/deprecatedCompat/4.0/renamedNodeTests.ts -var isTypeAssertion = deprecate(function isTypeAssertion2(node) { - return node.kind === 213 /* TypeAssertionExpression */; -}, { - since: "4.0", - warnAfter: "4.1", - message: "Use `isTypeAssertionExpression` instead." -}); - -// src/deprecatedCompat/4.2/renamedNodeTests.ts -var isIdentifierOrPrivateIdentifier = deprecate(function isIdentifierOrPrivateIdentifier2(node) { - return isMemberName(node); -}, { - since: "4.2", - warnAfter: "4.3", - message: "Use `isMemberName` instead." }); -// src/deprecatedCompat/4.2/abstractConstructorTypes.ts -function patchNodeFactory(factory2) { - const { - createConstructorTypeNode: createConstructorTypeNode2, - updateConstructorTypeNode: updateConstructorTypeNode2 - } = factory2; - factory2.createConstructorTypeNode = buildOverload("createConstructorTypeNode").overload({ - 0(modifiers, typeParameters, parameters, type) { - return createConstructorTypeNode2(modifiers, typeParameters, parameters, type); - }, - 1(typeParameters, parameters, type) { - return createConstructorTypeNode2( - /*modifiers*/ - void 0, - typeParameters, - parameters, - type - ); - } - }).bind({ - 0: (args) => args.length === 4, - 1: (args) => args.length === 3 - }).deprecate({ - 1: { since: "4.2", warnAfter: "4.3", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - factory2.updateConstructorTypeNode = buildOverload("updateConstructorTypeNode").overload({ - 0(node, modifiers, typeParameters, parameters, type) { - return updateConstructorTypeNode2(node, modifiers, typeParameters, parameters, type); - }, - 1(node, typeParameters, parameters, type) { - return updateConstructorTypeNode2(node, node.modifiers, typeParameters, parameters, type); - } - }).bind({ - 0: (args) => args.length === 5, - 1: (args) => args.length === 4 - }).deprecate({ - 1: { since: "4.2", warnAfter: "4.3", message: "Use the overload that accepts 'modifiers'" } - }).finish(); -} -addNodeFactoryPatcher(patchNodeFactory); -patchNodeFactory(factory); - -// src/deprecatedCompat/4.6/importTypeAssertions.ts -function patchNodeFactory2(factory2) { - const { - createImportTypeNode: createImportTypeNode2, - updateImportTypeNode: updateImportTypeNode2 - } = factory2; - factory2.createImportTypeNode = buildOverload("createImportTypeNode").overload({ - 0(argument, assertions, qualifier, typeArguments, isTypeOf) { - return createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf); - }, - 1(argument, qualifier, typeArguments, isTypeOf) { - return createImportTypeNode2( - argument, - /*assertions*/ - void 0, - qualifier, - typeArguments, - isTypeOf - ); - } - }).bind({ - 0: ([, assertions, qualifier, typeArguments, isTypeOf]) => (assertions === void 0 || isImportTypeAssertionContainer(assertions)) && (qualifier === void 0 || !isArray(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"), - 1: ([, qualifier, typeArguments, isTypeOf, other]) => other === void 0 && (qualifier === void 0 || isEntityName(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean") - }).deprecate({ - 1: { since: "4.6", warnAfter: "4.7", message: "Use the overload that accepts 'assertions'" } - }).finish(); - factory2.updateImportTypeNode = buildOverload("updateImportTypeNode").overload({ - 0(node, argument, assertions, qualifier, typeArguments, isTypeOf) { - return updateImportTypeNode2(node, argument, assertions, qualifier, typeArguments, isTypeOf); - }, - 1(node, argument, qualifier, typeArguments, isTypeOf) { - return updateImportTypeNode2(node, argument, node.assertions, qualifier, typeArguments, isTypeOf); - } - }).bind({ - 0: ([, , assertions, qualifier, typeArguments, isTypeOf]) => (assertions === void 0 || isImportTypeAssertionContainer(assertions)) && (qualifier === void 0 || !isArray(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"), - 1: ([, , qualifier, typeArguments, isTypeOf, other]) => other === void 0 && (qualifier === void 0 || isEntityName(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean") - }).deprecate({ - 1: { since: "4.6", warnAfter: "4.7", message: "Use the overload that accepts 'assertions'" } - }).finish(); -} -addNodeFactoryPatcher(patchNodeFactory2); -patchNodeFactory2(factory); - -// src/deprecatedCompat/4.7/typeParameterModifiers.ts -function patchNodeFactory3(factory2) { - const { - createTypeParameterDeclaration: createTypeParameterDeclaration2, - updateTypeParameterDeclaration: updateTypeParameterDeclaration2 - } = factory2; - factory2.createTypeParameterDeclaration = buildOverload("createTypeParameterDeclaration").overload({ - 0(modifiers, name, constraint, defaultType) { - return createTypeParameterDeclaration2(modifiers, name, constraint, defaultType); - }, - 1(name, constraint, defaultType) { - return createTypeParameterDeclaration2( - /*modifiers*/ - void 0, - name, - constraint, - defaultType - ); - } - }).bind({ - 0: ([modifiers]) => modifiers === void 0 || isArray(modifiers), - 1: ([name]) => name !== void 0 && !isArray(name) - }).deprecate({ - 1: { since: "4.7", warnAfter: "4.8", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - factory2.updateTypeParameterDeclaration = buildOverload("updateTypeParameterDeclaration").overload({ - 0(node, modifiers, name, constraint, defaultType) { - return updateTypeParameterDeclaration2(node, modifiers, name, constraint, defaultType); - }, - 1(node, name, constraint, defaultType) { - return updateTypeParameterDeclaration2(node, node.modifiers, name, constraint, defaultType); - } - }).bind({ - 0: ([, modifiers]) => modifiers === void 0 || isArray(modifiers), - 1: ([, name]) => name !== void 0 && !isArray(name) - }).deprecate({ - 1: { since: "4.7", warnAfter: "4.8", message: "Use the overload that accepts 'modifiers'" } - }).finish(); -} -addNodeFactoryPatcher(patchNodeFactory3); -patchNodeFactory3(factory); - -// src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts -var MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload that does not accept a 'decorators' parameter." }; -var DISALLOW_DECORATORS = { since: "4.8", warnAfter: "4.9.0-0", message: `Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter.` }; -var DISALLOW_DECORATORS_AND_MODIFIERS = { since: "4.8", warnAfter: "4.9.0-0", message: `Decorators and modifiers are no longer supported for this function. Callers should switch to an overload that does not accept the 'decorators' and 'modifiers' parameters.` }; -function patchNodeFactory4(factory2) { - const { - createParameterDeclaration, - updateParameterDeclaration, - createPropertyDeclaration, - updatePropertyDeclaration: updatePropertyDeclaration2, - createMethodDeclaration, - updateMethodDeclaration, - createConstructorDeclaration, - updateConstructorDeclaration, - createGetAccessorDeclaration, - updateGetAccessorDeclaration, - createSetAccessorDeclaration, - updateSetAccessorDeclaration, - createIndexSignature: createIndexSignature3, - updateIndexSignature: updateIndexSignature2, - createClassStaticBlockDeclaration, - updateClassStaticBlockDeclaration, - createClassExpression: createClassExpression3, - updateClassExpression: updateClassExpression3, - createFunctionDeclaration: createFunctionDeclaration2, - updateFunctionDeclaration: updateFunctionDeclaration2, - createClassDeclaration: createClassDeclaration2, - updateClassDeclaration: updateClassDeclaration2, - createInterfaceDeclaration: createInterfaceDeclaration2, - updateInterfaceDeclaration: updateInterfaceDeclaration2, - createTypeAliasDeclaration: createTypeAliasDeclaration2, - updateTypeAliasDeclaration: updateTypeAliasDeclaration2, - createEnumDeclaration: createEnumDeclaration2, - updateEnumDeclaration: updateEnumDeclaration2, - createModuleDeclaration: createModuleDeclaration2, - updateModuleDeclaration: updateModuleDeclaration2, - createImportEqualsDeclaration: createImportEqualsDeclaration2, - updateImportEqualsDeclaration: updateImportEqualsDeclaration2, - createImportDeclaration: createImportDeclaration2, - updateImportDeclaration: updateImportDeclaration2, - createExportAssignment: createExportAssignment3, - updateExportAssignment: updateExportAssignment2, - createExportDeclaration: createExportDeclaration3, - updateExportDeclaration: updateExportDeclaration3 - } = factory2; - factory2.createParameterDeclaration = buildOverload("createParameterDeclaration").overload({ - 0(modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer); - }, - 1(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return createParameterDeclaration(concatenate(decorators, modifiers), dotDotDotToken, name, questionToken, type, initializer); - } - }).bind({ - 0: ([, dotDotDotToken, name, questionToken, type, initializer, other]) => other === void 0 && (dotDotDotToken === void 0 || !isArray(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, modifiers, dotDotDotToken, name, questionToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (dotDotDotToken === void 0 || typeof dotDotDotToken === "object" && isDotDotDotToken(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateParameterDeclaration = buildOverload("updateParameterDeclaration").overload({ - 0(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer); - }, - 1(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return updateParameterDeclaration(node, concatenate(decorators, modifiers), dotDotDotToken, name, questionToken, type, initializer); - } - }).bind({ - 0: ([, , dotDotDotToken, name, questionToken, type, initializer, other]) => other === void 0 && (dotDotDotToken === void 0 || !isArray(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, , modifiers, dotDotDotToken, name, questionToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (dotDotDotToken === void 0 || typeof dotDotDotToken === "object" && isDotDotDotToken(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createPropertyDeclaration = buildOverload("createPropertyDeclaration").overload({ - 0(modifiers, name, questionOrExclamationToken, type, initializer) { - return createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer); - }, - 1(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - return createPropertyDeclaration(concatenate(decorators, modifiers), name, questionOrExclamationToken, type, initializer); - } - }).bind({ - 0: ([, name, questionOrExclamationToken, type, initializer, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (questionOrExclamationToken === void 0 || typeof questionOrExclamationToken === "object" && isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, modifiers, name, questionOrExclamationToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionOrExclamationToken === void 0 || isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updatePropertyDeclaration = buildOverload("updatePropertyDeclaration").overload({ - 0(node, modifiers, name, questionOrExclamationToken, type, initializer) { - return updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer); - }, - 1(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - return updatePropertyDeclaration2(node, concatenate(decorators, modifiers), name, questionOrExclamationToken, type, initializer); - } - }).bind({ - 0: ([, , name, questionOrExclamationToken, type, initializer, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (questionOrExclamationToken === void 0 || typeof questionOrExclamationToken === "object" && isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, , modifiers, name, questionOrExclamationToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionOrExclamationToken === void 0 || isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createMethodDeclaration = buildOverload("createMethodDeclaration").overload({ - 0(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body); - }, - 1(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return createMethodDeclaration(concatenate(decorators, modifiers), asteriskToken, name, questionToken, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, asteriskToken, name, questionToken, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || !some(parameters, isTypeParameterDeclaration)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken === "object" && isAsteriskToken(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || !isArray(questionToken)) && (typeParameters === void 0 || !some(typeParameters, isParameter)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateMethodDeclaration = buildOverload("updateMethodDeclaration").overload({ - 0(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return updateMethodDeclaration(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body); - }, - 1(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return updateMethodDeclaration(node, concatenate(decorators, modifiers), asteriskToken, name, questionToken, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, , asteriskToken, name, questionToken, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || !some(parameters, isTypeParameterDeclaration)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken === "object" && isAsteriskToken(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || !isArray(questionToken)) && (typeParameters === void 0 || !some(typeParameters, isParameter)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createConstructorDeclaration = buildOverload("createConstructorDeclaration").overload({ - 0(modifiers, parameters, body) { - return createConstructorDeclaration(modifiers, parameters, body); - }, - 1(_decorators, modifiers, parameters, body) { - return createConstructorDeclaration(modifiers, parameters, body); - } - }).bind({ - 0: ([modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)), - 1: ([decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateConstructorDeclaration = buildOverload("updateConstructorDeclaration").overload({ - 0(node, modifiers, parameters, body) { - return updateConstructorDeclaration(node, modifiers, parameters, body); - }, - 1(node, _decorators, modifiers, parameters, body) { - return updateConstructorDeclaration(node, modifiers, parameters, body); - } - }).bind({ - 0: ([, modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)), - 1: ([, decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createGetAccessorDeclaration = buildOverload("createGetAccessorDeclaration").overload({ - 0(modifiers, name, parameters, type, body) { - return createGetAccessorDeclaration(modifiers, name, parameters, type, body); - }, - 1(decorators, modifiers, name, parameters, type, body) { - return createGetAccessorDeclaration(concatenate(decorators, modifiers), name, parameters, type, body); - } - }).bind({ - 0: ([, name, parameters, type, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, name, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateGetAccessorDeclaration = buildOverload("updateGetAccessorDeclaration").overload({ - 0(node, modifiers, name, parameters, type, body) { - return updateGetAccessorDeclaration(node, modifiers, name, parameters, type, body); - }, - 1(node, decorators, modifiers, name, parameters, type, body) { - return updateGetAccessorDeclaration(node, concatenate(decorators, modifiers), name, parameters, type, body); - } - }).bind({ - 0: ([, , name, parameters, type, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, name, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createSetAccessorDeclaration = buildOverload("createSetAccessorDeclaration").overload({ - 0(modifiers, name, parameters, body) { - return createSetAccessorDeclaration(modifiers, name, parameters, body); - }, - 1(decorators, modifiers, name, parameters, body) { - return createSetAccessorDeclaration(concatenate(decorators, modifiers), name, parameters, body); - } - }).bind({ - 0: ([, name, parameters, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || !isArray(body)), - 1: ([, modifiers, name, parameters, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateSetAccessorDeclaration = buildOverload("updateSetAccessorDeclaration").overload({ - 0(node, modifiers, name, parameters, body) { - return updateSetAccessorDeclaration(node, modifiers, name, parameters, body); - }, - 1(node, decorators, modifiers, name, parameters, body) { - return updateSetAccessorDeclaration(node, concatenate(decorators, modifiers), name, parameters, body); - } - }).bind({ - 0: ([, , name, parameters, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || !isArray(body)), - 1: ([, , modifiers, name, parameters, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createIndexSignature = buildOverload("createIndexSignature").overload({ - 0(modifiers, parameters, type) { - return createIndexSignature3(modifiers, parameters, type); - }, - 1(_decorators, modifiers, parameters, type) { - return createIndexSignature3(modifiers, parameters, type); - } - }).bind({ - 0: ([modifiers, parameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)), - 1: ([decorators, modifiers, parameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateIndexSignature = buildOverload("updateIndexSignature").overload({ - 0(node, modifiers, parameters, type) { - return updateIndexSignature2(node, modifiers, parameters, type); - }, - 1(node, _decorators, modifiers, parameters, type) { - return updateIndexSignature2(node, modifiers, parameters, type); - } - }).bind({ - 0: ([, modifiers, parameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)), - 1: ([, decorators, modifiers, parameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createClassStaticBlockDeclaration = buildOverload("createClassStaticBlockDeclaration").overload({ - 0(body) { - return createClassStaticBlockDeclaration(body); - }, - 1(_decorators, _modifiers, body) { - return createClassStaticBlockDeclaration(body); - } - }).bind({ - 0: ([body, other1, other2]) => other1 === void 0 && other2 === void 0 && (body === void 0 || !isArray(body)), - 1: ([decorators, modifiers, body]) => (decorators === void 0 || isArray(decorators)) && (modifiers === void 0 || isArray(decorators)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS_AND_MODIFIERS - }).finish(); - factory2.updateClassStaticBlockDeclaration = buildOverload("updateClassStaticBlockDeclaration").overload({ - 0(node, body) { - return updateClassStaticBlockDeclaration(node, body); - }, - 1(node, _decorators, _modifiers, body) { - return updateClassStaticBlockDeclaration(node, body); - } - }).bind({ - 0: ([, body, other1, other2]) => other1 === void 0 && other2 === void 0 && (body === void 0 || !isArray(body)), - 1: ([, decorators, modifiers, body]) => (decorators === void 0 || isArray(decorators)) && (modifiers === void 0 || isArray(decorators)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS_AND_MODIFIERS - }).finish(); - factory2.createClassExpression = buildOverload("createClassExpression").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createClassExpression3(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createClassExpression3(concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateClassExpression = buildOverload("updateClassExpression").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassExpression3(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassExpression3(node, concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, , name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, , modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createFunctionDeclaration = buildOverload("createFunctionDeclaration").overload({ - 0(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - }, - 1(_decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, asteriskToken, name, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isIdentifier(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, asteriskToken, name, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken !== "string" && isAsteriskToken(asteriskToken)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateFunctionDeclaration = buildOverload("updateFunctionDeclaration").overload({ - 0(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body); - }, - 1(node, _decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, , asteriskToken, name, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || isIdentifier(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, asteriskToken, name, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken !== "string" && isAsteriskToken(asteriskToken)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createClassDeclaration = buildOverload("createClassDeclaration").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createClassDeclaration2(concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: () => true - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateClassDeclaration = buildOverload("updateClassDeclaration").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassDeclaration2(node, concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, , name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, , modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createInterfaceDeclaration = buildOverload("createInterfaceDeclaration").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(_decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)), - 1: ([decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateInterfaceDeclaration = buildOverload("updateInterfaceDeclaration").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, _decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)), - 1: ([, decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createTypeAliasDeclaration = buildOverload("createTypeAliasDeclaration").overload({ - 0(modifiers, name, typeParameters, type) { - return createTypeAliasDeclaration2(modifiers, name, typeParameters, type); - }, - 1(_decorators, modifiers, name, typeParameters, type) { - return createTypeAliasDeclaration2(modifiers, name, typeParameters, type); - } - }).bind({ - 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)), - 1: ([decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateTypeAliasDeclaration = buildOverload("updateTypeAliasDeclaration").overload({ - 0(node, modifiers, name, typeParameters, type) { - return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type); - }, - 1(node, _decorators, modifiers, name, typeParameters, type) { - return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type); - } - }).bind({ - 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)), - 1: ([, decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createEnumDeclaration = buildOverload("createEnumDeclaration").overload({ - 0(modifiers, name, members) { - return createEnumDeclaration2(modifiers, name, members); - }, - 1(_decorators, modifiers, name, members) { - return createEnumDeclaration2(modifiers, name, members); - } - }).bind({ - 0: ([modifiers, name, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)), - 1: ([decorators, modifiers, name, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateEnumDeclaration = buildOverload("updateEnumDeclaration").overload({ - 0(node, modifiers, name, members) { - return updateEnumDeclaration2(node, modifiers, name, members); - }, - 1(node, _decorators, modifiers, name, members) { - return updateEnumDeclaration2(node, modifiers, name, members); - } - }).bind({ - 0: ([, modifiers, name, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)), - 1: ([, decorators, modifiers, name, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createModuleDeclaration = buildOverload("createModuleDeclaration").overload({ - 0(modifiers, name, body, flags) { - return createModuleDeclaration2(modifiers, name, body, flags); - }, - 1(_decorators, modifiers, name, body, flags) { - return createModuleDeclaration2(modifiers, name, body, flags); - } - }).bind({ - 0: ([modifiers, name, body, flags, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name !== void 0 && !isArray(name)) && (body === void 0 || isModuleBody(body)) && (flags === void 0 || typeof flags === "number"), - 1: ([decorators, modifiers, name, body, flags]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name !== void 0 && isModuleName(name)) && (body === void 0 || typeof body === "object") && (flags === void 0 || typeof flags === "number") - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateModuleDeclaration = buildOverload("updateModuleDeclaration").overload({ - 0(node, modifiers, name, body) { - return updateModuleDeclaration2(node, modifiers, name, body); - }, - 1(node, _decorators, modifiers, name, body) { - return updateModuleDeclaration2(node, modifiers, name, body); - } - }).bind({ - 0: ([, modifiers, name, body, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (body === void 0 || isModuleBody(body)), - 1: ([, decorators, modifiers, name, body]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name !== void 0 && isModuleName(name)) && (body === void 0 || isModuleBody(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createImportEqualsDeclaration = buildOverload("createImportEqualsDeclaration").overload({ - 0(modifiers, isTypeOnly, name, moduleReference) { - return createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference); - }, - 1(_decorators, modifiers, isTypeOnly, name, moduleReference) { - return createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference); - } - }).bind({ - 0: ([modifiers, isTypeOnly, name, moduleReference, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && typeof name !== "boolean" && typeof moduleReference !== "string", - 1: ([decorators, modifiers, isTypeOnly, name, moduleReference]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && (typeof name === "string" || isIdentifier(name)) && (moduleReference !== void 0 && isModuleReference(moduleReference)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateImportEqualsDeclaration = buildOverload("updateImportEqualsDeclaration").overload({ - 0(node, modifiers, isTypeOnly, name, moduleReference) { - return updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference); - }, - 1(node, _decorators, modifiers, isTypeOnly, name, moduleReference) { - return updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference); - } - }).bind({ - 0: ([, modifiers, isTypeOnly, name, moduleReference, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && typeof name !== "boolean" && typeof moduleReference !== "string", - 1: ([, decorators, modifiers, isTypeOnly, name, moduleReference]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && (typeof name === "string" || isIdentifier(name)) && (moduleReference !== void 0 && isModuleReference(moduleReference)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createImportDeclaration = buildOverload("createImportDeclaration").overload({ - 0(modifiers, importClause, moduleSpecifier, assertClause) { - return createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause); - }, - 1(_decorators, modifiers, importClause, moduleSpecifier, assertClause) { - return createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([modifiers, importClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (importClause === void 0 || !isArray(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (importClause === void 0 || isImportClause(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateImportDeclaration = buildOverload("updateImportDeclaration").overload({ - 0(node, modifiers, importClause, moduleSpecifier, assertClause) { - return updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause); - }, - 1(node, _decorators, modifiers, importClause, moduleSpecifier, assertClause) { - return updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (importClause === void 0 || !isArray(importClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (importClause === void 0 || isImportClause(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createExportAssignment = buildOverload("createExportAssignment").overload({ - 0(modifiers, isExportEquals, expression) { - return createExportAssignment3(modifiers, isExportEquals, expression); - }, - 1(_decorators, modifiers, isExportEquals, expression) { - return createExportAssignment3(modifiers, isExportEquals, expression); - } - }).bind({ - 0: ([modifiers, isExportEquals, expression, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isExportEquals === void 0 || typeof isExportEquals === "boolean") && typeof expression === "object", - 1: ([decorators, modifiers, isExportEquals, expression]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isExportEquals === void 0 || typeof isExportEquals === "boolean") && (expression !== void 0 && isExpression(expression)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateExportAssignment = buildOverload("updateExportAssignment").overload({ - 0(node, modifiers, expression) { - return updateExportAssignment2(node, modifiers, expression); - }, - 1(node, _decorators, modifiers, expression) { - return updateExportAssignment2(node, modifiers, expression); - } - }).bind({ - 0: ([, modifiers, expression, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (expression !== void 0 && !isArray(expression)), - 1: ([, decorators, modifiers, expression]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (expression !== void 0 && isExpression(expression)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createExportDeclaration = buildOverload("createExportDeclaration").overload({ - 0(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - }, - 1(_decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && typeof isTypeOnly === "boolean" && typeof exportClause !== "boolean" && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && typeof isTypeOnly === "boolean" && (exportClause === void 0 || isNamedExportBindings(exportClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateExportDeclaration = buildOverload("updateExportDeclaration").overload({ - 0(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - }, - 1(node, _decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && typeof isTypeOnly === "boolean" && typeof exportClause !== "boolean" && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && typeof isTypeOnly === "boolean" && (exportClause === void 0 || isNamedExportBindings(exportClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); -} -addNodeFactoryPatcher(patchNodeFactory4); -patchNodeFactory4(factory); - // src/server/utilitiesPublic.ts var LogLevel2 = /* @__PURE__ */ ((LogLevel3) => { LogLevel3[LogLevel3["terse"] = 0] = "terse"; @@ -171057,13 +172926,8 @@ var _ProjectService = class { this.session = opts.session; if (opts.serverMode !== void 0) { this.serverMode = opts.serverMode; - this.syntaxOnly = this.serverMode === 2 /* Syntactic */; - } else if (opts.syntaxOnly) { - this.serverMode = 2 /* Syntactic */; - this.syntaxOnly = true; } else { this.serverMode = 0 /* Semantic */; - this.syntaxOnly = false; } if (this.host.realpath) { this.realpathToScriptInfos = createMultiMap(); @@ -173602,7 +175466,7 @@ Dynamic files must always be opened with service's current directory or service excludedFiles.push(normalizedNames[i]); } else { let exclude = false; - if (typeAcquisition.enable || typeAcquisition.enableAutoDiscovery) { + if (typeAcquisition.enable) { const baseName = getBaseFileName(toFileNameLowerCase(normalizedNames[i])); if (fileExtensionIs(baseName, "js")) { const inferredTypingName = removeFileExtension(baseName); @@ -173631,10 +175495,6 @@ Dynamic files must always be opened with service's current directory or service return excludedFiles; } openExternalProject(proj) { - if (proj.typingOptions && !proj.typeAcquisition) { - const typeAcquisition = convertEnableAutoDiscoveryToEnable(proj.typingOptions); - proj.typeAcquisition = typeAcquisition; - } proj.typeAcquisition = proj.typeAcquisition || {}; proj.typeAcquisition.include = proj.typeAcquisition.include || []; proj.typeAcquisition.exclude = proj.typeAcquisition.exclude || []; @@ -174152,7 +176012,7 @@ function formatDiagnosticToProtocol(diag2, includeFileName) { function allEditsBeforePos(edits, pos) { return edits.every((edit) => textSpanEnd(edit.span) < pos); } -var CommandNames = ts_server_protocol_exports.CommandTypes; +var CommandNames = CommandTypes; function formatMessage2(msg, logger, byteLength, newLine) { const verboseLogging = logger.hasLevel(3 /* verbose */); const json = JSON.stringify(msg); @@ -174513,96 +176373,97 @@ function getMappedContextSpanForProject(documentSpan, project) { return getMappedContextSpan(documentSpan, project.getSourceMapper(), (p) => project.projectService.fileExists(p)); } var invalidPartialSemanticModeCommands = [ - CommandNames.OpenExternalProject, - CommandNames.OpenExternalProjects, - CommandNames.CloseExternalProject, - CommandNames.SynchronizeProjectList, - CommandNames.EmitOutput, - CommandNames.CompileOnSaveAffectedFileList, - CommandNames.CompileOnSaveEmitFile, - CommandNames.CompilerOptionsDiagnosticsFull, - CommandNames.EncodedSemanticClassificationsFull, - CommandNames.SemanticDiagnosticsSync, - CommandNames.SuggestionDiagnosticsSync, - CommandNames.GeterrForProject, - CommandNames.Reload, - CommandNames.ReloadProjects, - CommandNames.GetCodeFixes, - CommandNames.GetCodeFixesFull, - CommandNames.GetCombinedCodeFix, - CommandNames.GetCombinedCodeFixFull, - CommandNames.ApplyCodeActionCommand, - CommandNames.GetSupportedCodeFixes, - CommandNames.GetApplicableRefactors, - CommandNames.GetEditsForRefactor, - CommandNames.GetEditsForRefactorFull, - CommandNames.OrganizeImports, - CommandNames.OrganizeImportsFull, - CommandNames.GetEditsForFileRename, - CommandNames.GetEditsForFileRenameFull, - CommandNames.PrepareCallHierarchy, - CommandNames.ProvideCallHierarchyIncomingCalls, - CommandNames.ProvideCallHierarchyOutgoingCalls + "openExternalProject" /* OpenExternalProject */, + "openExternalProjects" /* OpenExternalProjects */, + "closeExternalProject" /* CloseExternalProject */, + "synchronizeProjectList" /* SynchronizeProjectList */, + "emit-output" /* EmitOutput */, + "compileOnSaveAffectedFileList" /* CompileOnSaveAffectedFileList */, + "compileOnSaveEmitFile" /* CompileOnSaveEmitFile */, + "compilerOptionsDiagnostics-full" /* CompilerOptionsDiagnosticsFull */, + "encodedSemanticClassifications-full" /* EncodedSemanticClassificationsFull */, + "semanticDiagnosticsSync" /* SemanticDiagnosticsSync */, + "suggestionDiagnosticsSync" /* SuggestionDiagnosticsSync */, + "geterrForProject" /* GeterrForProject */, + "reload" /* Reload */, + "reloadProjects" /* ReloadProjects */, + "getCodeFixes" /* GetCodeFixes */, + "getCodeFixes-full" /* GetCodeFixesFull */, + "getCombinedCodeFix" /* GetCombinedCodeFix */, + "getCombinedCodeFix-full" /* GetCombinedCodeFixFull */, + "applyCodeActionCommand" /* ApplyCodeActionCommand */, + "getSupportedCodeFixes" /* GetSupportedCodeFixes */, + "getApplicableRefactors" /* GetApplicableRefactors */, + "getEditsForRefactor" /* GetEditsForRefactor */, + "getEditsForRefactor-full" /* GetEditsForRefactorFull */, + "organizeImports" /* OrganizeImports */, + "organizeImports-full" /* OrganizeImportsFull */, + "getEditsForFileRename" /* GetEditsForFileRename */, + "getEditsForFileRename-full" /* GetEditsForFileRenameFull */, + "prepareCallHierarchy" /* PrepareCallHierarchy */, + "provideCallHierarchyIncomingCalls" /* ProvideCallHierarchyIncomingCalls */, + "provideCallHierarchyOutgoingCalls" /* ProvideCallHierarchyOutgoingCalls */ ]; var invalidSyntacticModeCommands = [ ...invalidPartialSemanticModeCommands, - CommandNames.Definition, - CommandNames.DefinitionFull, - CommandNames.DefinitionAndBoundSpan, - CommandNames.DefinitionAndBoundSpanFull, - CommandNames.TypeDefinition, - CommandNames.Implementation, - CommandNames.ImplementationFull, - CommandNames.References, - CommandNames.ReferencesFull, - CommandNames.Rename, - CommandNames.RenameLocationsFull, - CommandNames.RenameInfoFull, - CommandNames.Quickinfo, - CommandNames.QuickinfoFull, - CommandNames.CompletionInfo, - CommandNames.Completions, - CommandNames.CompletionsFull, - CommandNames.CompletionDetails, - CommandNames.CompletionDetailsFull, - CommandNames.SignatureHelp, - CommandNames.SignatureHelpFull, - CommandNames.Navto, - CommandNames.NavtoFull, - CommandNames.Occurrences, - CommandNames.DocumentHighlights, - CommandNames.DocumentHighlightsFull + "definition" /* Definition */, + "definition-full" /* DefinitionFull */, + "definitionAndBoundSpan" /* DefinitionAndBoundSpan */, + "definitionAndBoundSpan-full" /* DefinitionAndBoundSpanFull */, + "typeDefinition" /* TypeDefinition */, + "implementation" /* Implementation */, + "implementation-full" /* ImplementationFull */, + "references" /* References */, + "references-full" /* ReferencesFull */, + "rename" /* Rename */, + "renameLocations-full" /* RenameLocationsFull */, + "rename-full" /* RenameInfoFull */, + "quickinfo" /* Quickinfo */, + "quickinfo-full" /* QuickinfoFull */, + "completionInfo" /* CompletionInfo */, + "completions" /* Completions */, + "completions-full" /* CompletionsFull */, + "completionEntryDetails" /* CompletionDetails */, + "completionEntryDetails-full" /* CompletionDetailsFull */, + "signatureHelp" /* SignatureHelp */, + "signatureHelp-full" /* SignatureHelpFull */, + "navto" /* Navto */, + "navto-full" /* NavtoFull */, + "occurrences" /* Occurrences */, + "documentHighlights" /* DocumentHighlights */, + "documentHighlights-full" /* DocumentHighlightsFull */ ]; var Session3 = class { constructor(opts) { this.changeSeq = 0; this.handlers = new Map(Object.entries({ - [CommandNames.Status]: () => { + // TODO(jakebailey): correctly type the handlers + ["status" /* Status */]: () => { const response = { version }; return this.requiredResponse(response); }, - [CommandNames.OpenExternalProject]: (request) => { + ["openExternalProject" /* OpenExternalProject */]: (request) => { this.projectService.openExternalProject(request.arguments); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.OpenExternalProjects]: (request) => { + ["openExternalProjects" /* OpenExternalProjects */]: (request) => { this.projectService.openExternalProjects(request.arguments.projects); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.CloseExternalProject]: (request) => { + ["closeExternalProject" /* CloseExternalProject */]: (request) => { this.projectService.closeExternalProject(request.arguments.projectFileName); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.SynchronizeProjectList]: (request) => { + ["synchronizeProjectList" /* SynchronizeProjectList */]: (request) => { const result = this.projectService.synchronizeProjectList(request.arguments.knownProjects, request.arguments.includeProjectReferenceRedirectInfo); if (!result.some((p) => p.projectErrors && p.projectErrors.length !== 0)) { return this.requiredResponse(result); @@ -174624,7 +176485,7 @@ var Session3 = class { }); return this.requiredResponse(converted); }, - [CommandNames.UpdateOpen]: (request) => { + ["updateOpen" /* UpdateOpen */]: (request) => { this.changeSeq++; this.projectService.applyChangesInOpenFiles( request.arguments.openFiles && mapIterator(request.arguments.openFiles, (file) => ({ @@ -174649,7 +176510,7 @@ var Session3 = class { true ); }, - [CommandNames.ApplyChangedToOpenFiles]: (request) => { + ["applyChangedToOpenFiles" /* ApplyChangedToOpenFiles */]: (request) => { this.changeSeq++; this.projectService.applyChangesInOpenFiles( request.arguments.openFiles, @@ -174665,93 +176526,93 @@ var Session3 = class { true ); }, - [CommandNames.Exit]: () => { + ["exit" /* Exit */]: () => { this.exit(); return this.notRequired(); }, - [CommandNames.Definition]: (request) => { + ["definition" /* Definition */]: (request) => { return this.requiredResponse(this.getDefinition( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.DefinitionFull]: (request) => { + ["definition-full" /* DefinitionFull */]: (request) => { return this.requiredResponse(this.getDefinition( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.DefinitionAndBoundSpan]: (request) => { + ["definitionAndBoundSpan" /* DefinitionAndBoundSpan */]: (request) => { return this.requiredResponse(this.getDefinitionAndBoundSpan( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.DefinitionAndBoundSpanFull]: (request) => { + ["definitionAndBoundSpan-full" /* DefinitionAndBoundSpanFull */]: (request) => { return this.requiredResponse(this.getDefinitionAndBoundSpan( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.FindSourceDefinition]: (request) => { + ["findSourceDefinition" /* FindSourceDefinition */]: (request) => { return this.requiredResponse(this.findSourceDefinition(request.arguments)); }, - [CommandNames.EmitOutput]: (request) => { + ["emit-output" /* EmitOutput */]: (request) => { return this.requiredResponse(this.getEmitOutput(request.arguments)); }, - [CommandNames.TypeDefinition]: (request) => { + ["typeDefinition" /* TypeDefinition */]: (request) => { return this.requiredResponse(this.getTypeDefinition(request.arguments)); }, - [CommandNames.Implementation]: (request) => { + ["implementation" /* Implementation */]: (request) => { return this.requiredResponse(this.getImplementation( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.ImplementationFull]: (request) => { + ["implementation-full" /* ImplementationFull */]: (request) => { return this.requiredResponse(this.getImplementation( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.References]: (request) => { + ["references" /* References */]: (request) => { return this.requiredResponse(this.getReferences( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.ReferencesFull]: (request) => { + ["references-full" /* ReferencesFull */]: (request) => { return this.requiredResponse(this.getReferences( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.Rename]: (request) => { + ["rename" /* Rename */]: (request) => { return this.requiredResponse(this.getRenameLocations( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.RenameLocationsFull]: (request) => { + ["renameLocations-full" /* RenameLocationsFull */]: (request) => { return this.requiredResponse(this.getRenameLocations( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.RenameInfoFull]: (request) => { + ["rename-full" /* RenameInfoFull */]: (request) => { return this.requiredResponse(this.getRenameInfo(request.arguments)); }, - [CommandNames.Open]: (request) => { + ["open" /* Open */]: (request) => { this.openClientFile( toNormalizedPath(request.arguments.file), request.arguments.fileContent, @@ -174761,451 +176622,451 @@ var Session3 = class { ); return this.notRequired(); }, - [CommandNames.Quickinfo]: (request) => { + ["quickinfo" /* Quickinfo */]: (request) => { return this.requiredResponse(this.getQuickInfoWorker( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.QuickinfoFull]: (request) => { + ["quickinfo-full" /* QuickinfoFull */]: (request) => { return this.requiredResponse(this.getQuickInfoWorker( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.GetOutliningSpans]: (request) => { + ["getOutliningSpans" /* GetOutliningSpans */]: (request) => { return this.requiredResponse(this.getOutliningSpans( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetOutliningSpansFull]: (request) => { + ["outliningSpans" /* GetOutliningSpansFull */]: (request) => { return this.requiredResponse(this.getOutliningSpans( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.TodoComments]: (request) => { + ["todoComments" /* TodoComments */]: (request) => { return this.requiredResponse(this.getTodoComments(request.arguments)); }, - [CommandNames.Indentation]: (request) => { + ["indentation" /* Indentation */]: (request) => { return this.requiredResponse(this.getIndentation(request.arguments)); }, - [CommandNames.NameOrDottedNameSpan]: (request) => { + ["nameOrDottedNameSpan" /* NameOrDottedNameSpan */]: (request) => { return this.requiredResponse(this.getNameOrDottedNameSpan(request.arguments)); }, - [CommandNames.BreakpointStatement]: (request) => { + ["breakpointStatement" /* BreakpointStatement */]: (request) => { return this.requiredResponse(this.getBreakpointStatement(request.arguments)); }, - [CommandNames.BraceCompletion]: (request) => { + ["braceCompletion" /* BraceCompletion */]: (request) => { return this.requiredResponse(this.isValidBraceCompletion(request.arguments)); }, - [CommandNames.DocCommentTemplate]: (request) => { + ["docCommentTemplate" /* DocCommentTemplate */]: (request) => { return this.requiredResponse(this.getDocCommentTemplate(request.arguments)); }, - [CommandNames.GetSpanOfEnclosingComment]: (request) => { + ["getSpanOfEnclosingComment" /* GetSpanOfEnclosingComment */]: (request) => { return this.requiredResponse(this.getSpanOfEnclosingComment(request.arguments)); }, - [CommandNames.FileReferences]: (request) => { + ["fileReferences" /* FileReferences */]: (request) => { return this.requiredResponse(this.getFileReferences( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.FileReferencesFull]: (request) => { + ["fileReferences-full" /* FileReferencesFull */]: (request) => { return this.requiredResponse(this.getFileReferences( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.Format]: (request) => { + ["format" /* Format */]: (request) => { return this.requiredResponse(this.getFormattingEditsForRange(request.arguments)); }, - [CommandNames.Formatonkey]: (request) => { + ["formatonkey" /* Formatonkey */]: (request) => { return this.requiredResponse(this.getFormattingEditsAfterKeystroke(request.arguments)); }, - [CommandNames.FormatFull]: (request) => { + ["format-full" /* FormatFull */]: (request) => { return this.requiredResponse(this.getFormattingEditsForDocumentFull(request.arguments)); }, - [CommandNames.FormatonkeyFull]: (request) => { + ["formatonkey-full" /* FormatonkeyFull */]: (request) => { return this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(request.arguments)); }, - [CommandNames.FormatRangeFull]: (request) => { + ["formatRange-full" /* FormatRangeFull */]: (request) => { return this.requiredResponse(this.getFormattingEditsForRangeFull(request.arguments)); }, - [CommandNames.CompletionInfo]: (request) => { - return this.requiredResponse(this.getCompletions(request.arguments, CommandNames.CompletionInfo)); + ["completionInfo" /* CompletionInfo */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completionInfo" /* CompletionInfo */)); }, - [CommandNames.Completions]: (request) => { - return this.requiredResponse(this.getCompletions(request.arguments, CommandNames.Completions)); + ["completions" /* Completions */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completions" /* Completions */)); }, - [CommandNames.CompletionsFull]: (request) => { - return this.requiredResponse(this.getCompletions(request.arguments, CommandNames.CompletionsFull)); + ["completions-full" /* CompletionsFull */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completions-full" /* CompletionsFull */)); }, - [CommandNames.CompletionDetails]: (request) => { + ["completionEntryDetails" /* CompletionDetails */]: (request) => { return this.requiredResponse(this.getCompletionEntryDetails( request.arguments, /*fullResult*/ false )); }, - [CommandNames.CompletionDetailsFull]: (request) => { + ["completionEntryDetails-full" /* CompletionDetailsFull */]: (request) => { return this.requiredResponse(this.getCompletionEntryDetails( request.arguments, /*fullResult*/ true )); }, - [CommandNames.CompileOnSaveAffectedFileList]: (request) => { + ["compileOnSaveAffectedFileList" /* CompileOnSaveAffectedFileList */]: (request) => { return this.requiredResponse(this.getCompileOnSaveAffectedFileList(request.arguments)); }, - [CommandNames.CompileOnSaveEmitFile]: (request) => { + ["compileOnSaveEmitFile" /* CompileOnSaveEmitFile */]: (request) => { return this.requiredResponse(this.emitFile(request.arguments)); }, - [CommandNames.SignatureHelp]: (request) => { + ["signatureHelp" /* SignatureHelp */]: (request) => { return this.requiredResponse(this.getSignatureHelpItems( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.SignatureHelpFull]: (request) => { + ["signatureHelp-full" /* SignatureHelpFull */]: (request) => { return this.requiredResponse(this.getSignatureHelpItems( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.CompilerOptionsDiagnosticsFull]: (request) => { + ["compilerOptionsDiagnostics-full" /* CompilerOptionsDiagnosticsFull */]: (request) => { return this.requiredResponse(this.getCompilerOptionsDiagnostics(request.arguments)); }, - [CommandNames.EncodedSyntacticClassificationsFull]: (request) => { + ["encodedSyntacticClassifications-full" /* EncodedSyntacticClassificationsFull */]: (request) => { return this.requiredResponse(this.getEncodedSyntacticClassifications(request.arguments)); }, - [CommandNames.EncodedSemanticClassificationsFull]: (request) => { + ["encodedSemanticClassifications-full" /* EncodedSemanticClassificationsFull */]: (request) => { return this.requiredResponse(this.getEncodedSemanticClassifications(request.arguments)); }, - [CommandNames.Cleanup]: () => { + ["cleanup" /* Cleanup */]: () => { this.cleanup(); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.SemanticDiagnosticsSync]: (request) => { + ["semanticDiagnosticsSync" /* SemanticDiagnosticsSync */]: (request) => { return this.requiredResponse(this.getSemanticDiagnosticsSync(request.arguments)); }, - [CommandNames.SyntacticDiagnosticsSync]: (request) => { + ["syntacticDiagnosticsSync" /* SyntacticDiagnosticsSync */]: (request) => { return this.requiredResponse(this.getSyntacticDiagnosticsSync(request.arguments)); }, - [CommandNames.SuggestionDiagnosticsSync]: (request) => { + ["suggestionDiagnosticsSync" /* SuggestionDiagnosticsSync */]: (request) => { return this.requiredResponse(this.getSuggestionDiagnosticsSync(request.arguments)); }, - [CommandNames.Geterr]: (request) => { + ["geterr" /* Geterr */]: (request) => { this.errorCheck.startNew((next) => this.getDiagnostics(next, request.arguments.delay, request.arguments.files)); return this.notRequired(); }, - [CommandNames.GeterrForProject]: (request) => { + ["geterrForProject" /* GeterrForProject */]: (request) => { this.errorCheck.startNew((next) => this.getDiagnosticsForProject(next, request.arguments.delay, request.arguments.file)); return this.notRequired(); }, - [CommandNames.Change]: (request) => { + ["change" /* Change */]: (request) => { this.change(request.arguments); return this.notRequired(); }, - [CommandNames.Configure]: (request) => { + ["configure" /* Configure */]: (request) => { this.projectService.setHostConfiguration(request.arguments); this.doOutput( /*info*/ void 0, - CommandNames.Configure, + "configure" /* Configure */, request.seq, /*success*/ true ); return this.notRequired(); }, - [CommandNames.Reload]: (request) => { + ["reload" /* Reload */]: (request) => { this.reload(request.arguments, request.seq); return this.requiredResponse({ reloadFinished: true }); }, - [CommandNames.Saveto]: (request) => { + ["saveto" /* Saveto */]: (request) => { const savetoArgs = request.arguments; this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); return this.notRequired(); }, - [CommandNames.Close]: (request) => { + ["close" /* Close */]: (request) => { const closeArgs = request.arguments; this.closeClientFile(closeArgs.file); return this.notRequired(); }, - [CommandNames.Navto]: (request) => { + ["navto" /* Navto */]: (request) => { return this.requiredResponse(this.getNavigateToItems( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.NavtoFull]: (request) => { + ["navto-full" /* NavtoFull */]: (request) => { return this.requiredResponse(this.getNavigateToItems( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.Brace]: (request) => { + ["brace" /* Brace */]: (request) => { return this.requiredResponse(this.getBraceMatching( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.BraceFull]: (request) => { + ["brace-full" /* BraceFull */]: (request) => { return this.requiredResponse(this.getBraceMatching( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.NavBar]: (request) => { + ["navbar" /* NavBar */]: (request) => { return this.requiredResponse(this.getNavigationBarItems( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.NavBarFull]: (request) => { + ["navbar-full" /* NavBarFull */]: (request) => { return this.requiredResponse(this.getNavigationBarItems( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.NavTree]: (request) => { + ["navtree" /* NavTree */]: (request) => { return this.requiredResponse(this.getNavigationTree( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.NavTreeFull]: (request) => { + ["navtree-full" /* NavTreeFull */]: (request) => { return this.requiredResponse(this.getNavigationTree( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.Occurrences]: (request) => { + ["occurrences" /* Occurrences */]: (request) => { return this.requiredResponse(this.getOccurrences(request.arguments)); }, - [CommandNames.DocumentHighlights]: (request) => { + ["documentHighlights" /* DocumentHighlights */]: (request) => { return this.requiredResponse(this.getDocumentHighlights( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.DocumentHighlightsFull]: (request) => { + ["documentHighlights-full" /* DocumentHighlightsFull */]: (request) => { return this.requiredResponse(this.getDocumentHighlights( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.CompilerOptionsForInferredProjects]: (request) => { + ["compilerOptionsForInferredProjects" /* CompilerOptionsForInferredProjects */]: (request) => { this.setCompilerOptionsForInferredProjects(request.arguments); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.ProjectInfo]: (request) => { + ["projectInfo" /* ProjectInfo */]: (request) => { return this.requiredResponse(this.getProjectInfo(request.arguments)); }, - [CommandNames.ReloadProjects]: () => { + ["reloadProjects" /* ReloadProjects */]: () => { this.projectService.reloadProjects(); return this.notRequired(); }, - [CommandNames.JsxClosingTag]: (request) => { + ["jsxClosingTag" /* JsxClosingTag */]: (request) => { return this.requiredResponse(this.getJsxClosingTag(request.arguments)); }, - [CommandNames.GetCodeFixes]: (request) => { + ["getCodeFixes" /* GetCodeFixes */]: (request) => { return this.requiredResponse(this.getCodeFixes( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetCodeFixesFull]: (request) => { + ["getCodeFixes-full" /* GetCodeFixesFull */]: (request) => { return this.requiredResponse(this.getCodeFixes( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.GetCombinedCodeFix]: (request) => { + ["getCombinedCodeFix" /* GetCombinedCodeFix */]: (request) => { return this.requiredResponse(this.getCombinedCodeFix( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetCombinedCodeFixFull]: (request) => { + ["getCombinedCodeFix-full" /* GetCombinedCodeFixFull */]: (request) => { return this.requiredResponse(this.getCombinedCodeFix( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.ApplyCodeActionCommand]: (request) => { + ["applyCodeActionCommand" /* ApplyCodeActionCommand */]: (request) => { return this.requiredResponse(this.applyCodeActionCommand(request.arguments)); }, - [CommandNames.GetSupportedCodeFixes]: (request) => { + ["getSupportedCodeFixes" /* GetSupportedCodeFixes */]: (request) => { return this.requiredResponse(this.getSupportedCodeFixes(request.arguments)); }, - [CommandNames.GetApplicableRefactors]: (request) => { + ["getApplicableRefactors" /* GetApplicableRefactors */]: (request) => { return this.requiredResponse(this.getApplicableRefactors(request.arguments)); }, - [CommandNames.GetEditsForRefactor]: (request) => { + ["getEditsForRefactor" /* GetEditsForRefactor */]: (request) => { return this.requiredResponse(this.getEditsForRefactor( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetEditsForRefactorFull]: (request) => { + ["getEditsForRefactor-full" /* GetEditsForRefactorFull */]: (request) => { return this.requiredResponse(this.getEditsForRefactor( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.OrganizeImports]: (request) => { + ["organizeImports" /* OrganizeImports */]: (request) => { return this.requiredResponse(this.organizeImports( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.OrganizeImportsFull]: (request) => { + ["organizeImports-full" /* OrganizeImportsFull */]: (request) => { return this.requiredResponse(this.organizeImports( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.GetEditsForFileRename]: (request) => { + ["getEditsForFileRename" /* GetEditsForFileRename */]: (request) => { return this.requiredResponse(this.getEditsForFileRename( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetEditsForFileRenameFull]: (request) => { + ["getEditsForFileRename-full" /* GetEditsForFileRenameFull */]: (request) => { return this.requiredResponse(this.getEditsForFileRename( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.ConfigurePlugin]: (request) => { + ["configurePlugin" /* ConfigurePlugin */]: (request) => { this.configurePlugin(request.arguments); this.doOutput( /*info*/ void 0, - CommandNames.ConfigurePlugin, + "configurePlugin" /* ConfigurePlugin */, request.seq, /*success*/ true ); return this.notRequired(); }, - [CommandNames.SelectionRange]: (request) => { + ["selectionRange" /* SelectionRange */]: (request) => { return this.requiredResponse(this.getSmartSelectionRange( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.SelectionRangeFull]: (request) => { + ["selectionRange-full" /* SelectionRangeFull */]: (request) => { return this.requiredResponse(this.getSmartSelectionRange( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.PrepareCallHierarchy]: (request) => { + ["prepareCallHierarchy" /* PrepareCallHierarchy */]: (request) => { return this.requiredResponse(this.prepareCallHierarchy(request.arguments)); }, - [CommandNames.ProvideCallHierarchyIncomingCalls]: (request) => { + ["provideCallHierarchyIncomingCalls" /* ProvideCallHierarchyIncomingCalls */]: (request) => { return this.requiredResponse(this.provideCallHierarchyIncomingCalls(request.arguments)); }, - [CommandNames.ProvideCallHierarchyOutgoingCalls]: (request) => { + ["provideCallHierarchyOutgoingCalls" /* ProvideCallHierarchyOutgoingCalls */]: (request) => { return this.requiredResponse(this.provideCallHierarchyOutgoingCalls(request.arguments)); }, - [CommandNames.ToggleLineComment]: (request) => { + ["toggleLineComment" /* ToggleLineComment */]: (request) => { return this.requiredResponse(this.toggleLineComment( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.ToggleLineCommentFull]: (request) => { + ["toggleLineComment-full" /* ToggleLineCommentFull */]: (request) => { return this.requiredResponse(this.toggleLineComment( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.ToggleMultilineComment]: (request) => { + ["toggleMultilineComment" /* ToggleMultilineComment */]: (request) => { return this.requiredResponse(this.toggleMultilineComment( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.ToggleMultilineCommentFull]: (request) => { + ["toggleMultilineComment-full" /* ToggleMultilineCommentFull */]: (request) => { return this.requiredResponse(this.toggleMultilineComment( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.CommentSelection]: (request) => { + ["commentSelection" /* CommentSelection */]: (request) => { return this.requiredResponse(this.commentSelection( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.CommentSelectionFull]: (request) => { + ["commentSelection-full" /* CommentSelectionFull */]: (request) => { return this.requiredResponse(this.commentSelection( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.UncommentSelection]: (request) => { + ["uncommentSelection" /* UncommentSelection */]: (request) => { return this.requiredResponse(this.uncommentSelection( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.UncommentSelectionFull]: (request) => { + ["uncommentSelection-full" /* UncommentSelectionFull */]: (request) => { return this.requiredResponse(this.uncommentSelection( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.ProvideInlayHints]: (request) => { + ["provideInlayHints" /* ProvideInlayHints */]: (request) => { return this.requiredResponse(this.provideInlayHints(request.arguments)); } })); @@ -175243,7 +177104,6 @@ var Session3 = class { pluginProbeLocations: opts.pluginProbeLocations, allowLocalPluginLoads: opts.allowLocalPluginLoads, typesMapLocation: opts.typesMapLocation, - syntaxOnly: opts.syntaxOnly, serverMode: opts.serverMode, session: this }; @@ -175436,18 +177296,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter event(body, eventName) { this.send(toEvent(eventName, body)); } - // For backwards-compatibility only. - /** @deprecated */ - output(info, cmdName, reqSeq, errorMsg) { - this.doOutput( - info, - cmdName, - reqSeq, - /*success*/ - !errorMsg, - errorMsg - ); - } + /** @internal */ doOutput(info, cmdName, reqSeq, success, message) { const res = { seq: 0, @@ -176455,7 +178304,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter ); if (completions === void 0) return void 0; - if (kind === ts_server_protocol_exports.CommandTypes.CompletionsFull) + if (kind === "completions-full" /* CompletionsFull */) return completions; const prefix = args.prefix || ""; const entries = mapDefined(completions.entries, (entry) => { @@ -176497,7 +178346,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter }; } }); - if (kind === ts_server_protocol_exports.CommandTypes.Completions) { + if (kind === "completions" /* Completions */) { if (completions.metadata) entries.metadata = completions.metadata; return entries; @@ -176649,7 +178498,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter this.doOutput( /*info*/ void 0, - CommandNames.Reload, + "reload" /* Reload */, reqSeq, /*success*/ true @@ -176920,10 +178769,10 @@ ${e.message}`; } return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions; } - getCombinedCodeFix({ scope, fixId: fixId52 }, simplifiedResult) { + getCombinedCodeFix({ scope, fixId: fixId51 }, simplifiedResult) { Debug.assert(scope.type === "file"); const { file, project } = this.getFileAndProject(scope.args); - const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId52, this.getFormatOptions(file), this.getPreferences(file)); + const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId51, this.getFormatOptions(file), this.getPreferences(file)); if (simplifiedResult) { return { changes: this.mapTextChangesToCodeEdits(res.changes), commands: res.commands }; } else { @@ -176962,8 +178811,8 @@ ${e.message}`; mapCodeAction({ description: description2, changes, commands }) { return { description: description2, changes: this.mapTextChangesToCodeEdits(changes), commands }; } - mapCodeFixAction({ fixName: fixName8, description: description2, changes, commands, fixId: fixId52, fixAllDescription }) { - return { fixName: fixName8, description: description2, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId52, fixAllDescription }; + mapCodeFixAction({ fixName: fixName8, description: description2, changes, commands, fixId: fixId51, fixAllDescription }) { + return { fixName: fixName8, description: description2, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId51, fixAllDescription }; } mapTextChangesToCodeEdits(textChanges2) { return textChanges2.map((change) => this.mapTextChangeToCodeEdit(change)); @@ -177213,7 +179062,7 @@ ${e.message}`; this.doOutput( /*info*/ void 0, - CommandNames.Unknown, + "unknown" /* Unknown */, request.seq, /*success*/ false, @@ -177298,7 +179147,7 @@ ${e.message}`; this.doOutput( /*info*/ void 0, - request ? request.command : CommandNames.Unknown, + request ? request.command : "unknown" /* Unknown */, request ? request.seq : 0, /*success*/ false, @@ -178800,12 +180649,11 @@ function findArgumentStringArray(argName) { return arg.split(",").filter((name) => name !== ""); } function start({ args, logger, cancellationToken, serverMode, unknownServerMode, startSession: startServer }, platform) { - const syntaxOnly = hasArgument("--syntaxOnly"); logger.info(`Starting TS Server`); logger.info(`Version: ${version}`); logger.info(`Arguments: ${args.join(" ")}`); logger.info(`Platform: ${platform} NodeVersion: ${getNodeMajorVersion()} CaseSensitive: ${sys.useCaseSensitiveFileNames}`); - logger.info(`ServerMode: ${serverMode} syntaxOnly: ${syntaxOnly} hasUnknownServerMode: ${unknownServerMode}`); + logger.info(`ServerMode: ${serverMode} hasUnknownServerMode: ${unknownServerMode}`); setStackTraceLimit(); if (Debug.isDebugging) { Debug.enableDebugInfo(); @@ -178825,7 +180673,6 @@ function start({ args, logger, cancellationToken, serverMode, unknownServerMode, useInferredProjectPerProjectRoot: hasArgument("--useInferredProjectPerProjectRoot"), suppressDiagnosticEvents: hasArgument("--suppressDiagnosticEvents"), noGetErrOnBackgroundUpdate: hasArgument("--noGetErrOnBackgroundUpdate"), - syntaxOnly, serverMode }, logger, @@ -178897,6 +180744,7 @@ start(initializeNodeSystem(), require("os").platform()); InferencePriority, InlayHintKind, InlayHints, + InternalEmitFlags, InternalSymbolName, InvalidatedProjectKind, JsDoc, @@ -178990,10 +180838,13 @@ start(initializeNodeSystem(), require("os").platform()); WatchFileKind, WatchLogLevel, WatchType, + accessPrivateIdentifier, addEmitFlags, addEmitHelper, addEmitHelpers, + addInternalEmitFlags, addNodeFactoryPatcher, + addObjectAllocatorPatcher, addRange, addRelatedInfo, addSyntheticLeadingComment, @@ -179064,6 +180915,7 @@ start(initializeNodeSystem(), require("os").platform()); changesAffectModuleResolution, changesAffectingProgramStructure, childIsDecorated, + classElementOrClassElementParameterIsDecorated, classOrConstructorParameterIsDecorated, classPrivateFieldGetHelper, classPrivateFieldInHelper, @@ -179112,6 +180964,7 @@ start(initializeNodeSystem(), require("os").platform()); compilerOptionsAffectSemanticDiagnostics, compilerOptionsDidYouMeanDiagnostics, compilerOptionsIndicateEsModules, + compose, computeCommonSourceDirectoryOfFilenames, computeLineAndCharacterOfPosition, computeLineOfPosition, @@ -179129,7 +180982,6 @@ start(initializeNodeSystem(), require("os").platform()); containsPath, convertCompilerOptionsForTelemetry, convertCompilerOptionsFromJson, - convertEnableAutoDiscoveryToEnable, convertJsonOption, convertToBase64, convertToObject, @@ -179150,41 +181002,17 @@ start(initializeNodeSystem(), require("os").platform()); createAccessorPropertyBackingField, createAccessorPropertyGetRedirector, createAccessorPropertySetRedirector, - createAdd, - createArrayBindingPattern, - createArrayLiteral, - createArrayTypeNode, - createArrowFunction, - createAsExpression, - createAssignment, - createAwait, createBaseNodeFactory, - createBigIntLiteral, - createBinary, createBinaryExpressionTrampoline, - createBindingElement, createBindingHelper, - createBlock, - createBreak, createBuildInfo, createBuilderProgram, createBuilderProgramUsingProgramBuildInfo, createBuilderStatusReporter, - createBundle, createCacheWithRedirects, createCacheableExportInfoMap, createCachedDirectoryStructureHost, - createCall, - createCallChain, - createCallSignature, - createCaseBlock, - createCaseClause, - createCatchClause, - createClassDeclaration, - createClassExpression, createClassifier, - createComma, - createCommaList, createCommentDirectivesMap, createCompilerDiagnostic, createCompilerDiagnosticForInvalidCustomType, @@ -179192,212 +181020,73 @@ start(initializeNodeSystem(), require("os").platform()); createCompilerHost, createCompilerHostFromProgramHost, createCompilerHostWorker, - createComputedPropertyName, - createConditional, - createConditionalTypeNode, - createConstructSignature, - createConstructor, - createConstructorTypeNode, - createContinue, - createDebuggerStatement, - createDecorator, - createDefaultClause, - createDelete, createDetachedDiagnostic, createDiagnosticCollection, createDiagnosticForFileFromMessageChain, createDiagnosticForNode, createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain, createDiagnosticForNodeFromMessageChain, createDiagnosticForNodeInSourceFile, createDiagnosticForRange, createDiagnosticMessageChainFromDiagnostic, createDiagnosticReporter, - createDo, createDocumentPositionMapper, createDocumentRegistry, createDocumentRegistryInternal, - createElementAccess, - createElementAccessChain, createEmitAndSemanticDiagnosticsBuilderProgram, createEmitHelperFactory, createEmptyExports, - createEmptyStatement, - createEnumDeclaration, - createEnumMember, - createExportAssignment, - createExportDeclaration, - createExportDefault, - createExportSpecifier, createExpressionForJsxElement, createExpressionForJsxFragment, createExpressionForObjectLiteralElementLike, createExpressionForPropertyName, createExpressionFromEntityName, - createExpressionStatement, - createExpressionWithTypeArguments, createExternalHelpersImportDeclarationIfNeeded, - createExternalModuleExport, - createExternalModuleReference, - createFalse, createFileDiagnostic, createFileDiagnosticFromMessageChain, - createFileLevelUniqueName, - createFor, - createForIn, - createForOf, createForOfBindingStatement, - createFunctionDeclaration, - createFunctionExpression, - createFunctionTypeNode, - createGetAccessor, createGetCanonicalFileName, createGetSourceFile, createGetSymbolAccessibilityDiagnosticForNode, createGetSymbolAccessibilityDiagnosticForNodeName, createGetSymbolWalker, - createHeritageClause, - createIdentifier, - createIf, - createImmediatelyInvokedArrowFunction, - createImmediatelyInvokedFunctionExpression, - createImportClause, - createImportDeclaration, - createImportEqualsDeclaration, - createImportSpecifier, - createImportTypeNode, createIncrementalCompilerHost, createIncrementalProgram, - createIndexSignature, - createIndexedAccessTypeNode, - createInferTypeNode, createInputFiles, createInputFilesWithFilePaths, createInputFilesWithFileTexts, - createInterfaceDeclaration, - createIntersectionTypeNode, - createJSDocAugmentsTag, - createJSDocAuthorTag, - createJSDocCallbackTag, - createJSDocClassTag, - createJSDocComment, - createJSDocEnumTag, - createJSDocImplementsTag, - createJSDocParamTag, - createJSDocParameterTag, - createJSDocPrivateTag, - createJSDocPropertyTag, - createJSDocProtectedTag, - createJSDocPublicTag, - createJSDocReadonlyTag, - createJSDocReturnTag, - createJSDocSignature, - createJSDocTag, - createJSDocTemplateTag, - createJSDocThisTag, - createJSDocTypeExpression, - createJSDocTypeLiteral, - createJSDocTypeTag, - createJSDocTypedefTag, - createJsxAttribute, - createJsxAttributes, - createJsxClosingElement, - createJsxElement, - createJsxExpression, createJsxFactoryExpression, - createJsxFragment, - createJsxJsxClosingFragment, - createJsxOpeningElement, - createJsxOpeningFragment, - createJsxSelfClosingElement, - createJsxSpreadAttribute, - createJsxText, - createKeywordTypeNode, - createLabel, createLanguageService, createLanguageServiceSourceFile, - createLessThan, - createLiteral, - createLiteralTypeNode, - createLogicalAnd, - createLogicalNot, - createLogicalOr, - createLoopVariable, - createMappedTypeNode, createMemberAccessForPropertyName, - createMetaProperty, - createMethod, - createMethodSignature, createModeAwareCache, createModeAwareCacheKey, - createModifier, - createModifiersFromModifierFlags, - createModuleBlock, - createModuleDeclaration, createModuleResolutionCache, createModuleResolutionLoader, createModuleSpecifierResolutionHost, createMultiMap, - createNamedExports, - createNamedImports, - createNamespaceExport, - createNamespaceExportDeclaration, - createNamespaceImport, - createNew, - createNoSubstitutionTemplateLiteral, - createNode, - createNodeArray, createNodeConverters, createNodeFactory, - createNonNullChain, - createNonNullExpression, - createNotEmittedStatement, - createNull, - createNumericLiteral, - createObjectBindingPattern, - createObjectLiteral, - createOmittedExpression, - createOptimisticUniqueName, createOptionNameMap, - createOptionalTypeNode, createOverload, createPackageJsonImportFilter, createPackageJsonInfo, - createParameter, - createParen, - createParenthesizedType, createParenthesizerRules, - createPartiallyEmittedExpression, createPatternMatcher, - createPostfix, - createPostfixIncrement, - createPrefix, createPrependNodes, createPrinter, - createPrivateIdentifier, createProgram, createProgramHost, - createProperty, - createPropertyAccess, - createPropertyAccessChain, - createPropertyAssignment, createPropertyNameNodeForIdentifierOrLiteral, - createPropertySignature, - createQualifiedName, createQueue, createRange, createRedirectedBuilderProgram, - createRegularExpressionLiteral, createResolutionCache, - createRestTypeNode, - createReturn, createRuntimeTypeSerializer, createScanner, createSemanticDiagnosticsBuilderProgram, - createSemicolonClassElement, createSet, - createSetAccessor, - createShorthandPropertyAssignment, createSolutionBuilder, createSolutionBuilderHost, createSolutionBuilderWithWatch, @@ -179406,27 +181095,10 @@ start(initializeNodeSystem(), require("os").platform()); createSourceFile, createSourceMapGenerator, createSourceMapSource, - createSpread, - createSpreadAssignment, - createStatement, - createStrictEquality, - createStrictInequality, - createStringLiteral, - createStringLiteralFromNode, - createSubtract, - createSuper, createSuperAccessVariableStatement, - createSwitch, createSymbolTable, createSymlinkCache, createSystemWatchFunctions, - createTaggedTemplate, - createTempVariable, - createTemplateExpression, - createTemplateHead, - createTemplateMiddle, - createTemplateSpan, - createTemplateTail, createTextChange, createTextChangeFromStartLength, createTextChangeRange, @@ -179438,36 +181110,12 @@ start(initializeNodeSystem(), require("os").platform()); createTextSpanFromRange, createTextSpanFromStringLiteralLikeContent, createTextWriter, - createThis, - createThisTypeNode, - createThrow, - createToken, createTokenRange, - createTrue, - createTry, - createTupleTypeNode, - createTypeAliasDeclaration, - createTypeAssertion, createTypeChecker, - createTypeLiteralNode, - createTypeOf, - createTypeOperatorNode, - createTypeParameterDeclaration, - createTypePredicateNode, - createTypePredicateNodeWithModifier, - createTypeQueryNode, createTypeReferenceDirectiveResolutionCache, - createTypeReferenceNode, createTypeReferenceResolutionLoader, createUnderscoreEscapedMultiMap, - createUnionTypeNode, - createUniqueName, createUnparsedSourceFile, - createVariableDeclaration, - createVariableDeclarationList, - createVariableStatement, - createVoid, - createVoidZero, createWatchCompilerHost, createWatchCompilerHostOfConfigFile, createWatchCompilerHostOfFilesAndCompilerOptions, @@ -179475,10 +181123,7 @@ start(initializeNodeSystem(), require("os").platform()); createWatchHost, createWatchProgram, createWatchStatusReporter, - createWhile, - createWith, createWriteFileMeasuringIO, - createYield, declarationNameToString, decodeMappings, decodedTextSpanIntersectsWith, @@ -179525,6 +181170,7 @@ start(initializeNodeSystem(), require("os").platform()); equateStringsCaseInsensitive, equateStringsCaseSensitive, equateValues, + esDecorateHelper, escapeJsxAttributeString, escapeLeadingUnderscores, escapeNonAsciiString, @@ -179553,6 +181199,7 @@ start(initializeNodeSystem(), require("os").platform()); findAncestor, findBestPatternMatch, findChildOfKind, + findComputedPropertyNameCacheAssignment, findConfigFile, findContainingList, findDiagnosticForNode, @@ -179583,6 +181230,7 @@ start(initializeNodeSystem(), require("os").platform()); flatMapIterator, flatMapToMutable, flatten, + flattenCommaList, flattenDestructuringAssignment, flattenDestructuringBinding, flattenDiagnosticMessageText, @@ -179688,6 +181336,7 @@ start(initializeNodeSystem(), require("os").platform()); getDeclaredExpandoInitializer, getDecorators, getDefaultCompilerOptions, + getDefaultExportInfoWorker, getDefaultFormatCodeSettings, getDefaultLibFileName, getDefaultLibFilePath, @@ -179759,9 +181408,11 @@ start(initializeNodeSystem(), require("os").platform()); getFormatCodeSettingsForWriting, getFullWidth, getFunctionFlags, - getGeneratedNameForNode, getHeritageClause, getHostSignatureFromJSDoc, + getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference, + getIdentifierTypeArguments, getImmediatelyInvokedFunctionExpression, getImpliedNodeFormatForFile, getImpliedNodeFormatForFileWorker, @@ -179773,7 +181424,9 @@ start(initializeNodeSystem(), require("os").platform()); getInitializerOfBinaryExpression, getInitializerOfBindingOrAssignmentElement, getInterfaceBaseTypeNodes, + getInternalEmitFlags, getInvokedExpression, + getIsolatedModules, getJSDocAugmentsTag, getJSDocClassTag, getJSDocCommentRanges, @@ -179797,6 +181450,8 @@ start(initializeNodeSystem(), require("os").platform()); getJSDocReturnTag, getJSDocReturnType, getJSDocRoot, + getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag, getJSDocTags, getJSDocTagsNoCache, getJSDocTemplateTag, @@ -179851,7 +181506,6 @@ start(initializeNodeSystem(), require("os").platform()); getModuleNameStringLiteralAt, getModuleSpecifierEndingPreference, getModuleSpecifierResolverHost, - getMutableClone, getNameForExportedSymbol, getNameFromIndexInfo, getNameFromPropertyName, @@ -179925,6 +181579,7 @@ start(initializeNodeSystem(), require("os").platform()); getPossibleTypeArgumentsInfo, getPreEmitDiagnostics, getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier, getProperties, getProperty, getPropertyArrayElementValue, @@ -180050,6 +181705,7 @@ start(initializeNodeSystem(), require("os").platform()); getWatchErrorSummaryDiagnosticMessage, getWatchFactory, group, + groupBy, guessIndentation, handleNoEmitOptions, hasAbstractModifier, @@ -180095,12 +181751,14 @@ start(initializeNodeSystem(), require("os").platform()); hostUsesCaseSensitiveFileNames, idText, identifierIsThisKeyword, + identifierToKeywordKind, identity, identitySourceMapConsumer, ignoreSourceNewlines, ignoredPaths, importDefaultHelper, importFromModuleSpecifier, + importNameElisionDisabled, importStarHelper, indexOfAnyCharCode, indexOfNode, @@ -180126,6 +181784,7 @@ start(initializeNodeSystem(), require("os").platform()); isAliasableExpression, isAmbientModule, isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition, isAnyDirectorySeparator, isAnyImportOrBareOrAccessedRequire, isAnyImportOrReExport, @@ -180135,6 +181794,7 @@ start(initializeNodeSystem(), require("os").platform()); isArgumentExpressionOfElementAccess, isArray, isArrayBindingElement, + isArrayBindingOrAssignmentElement, isArrayBindingOrAssignmentPattern, isArrayBindingPattern, isArrayLiteralExpression, @@ -180166,7 +181826,9 @@ start(initializeNodeSystem(), require("os").platform()); isBindableStaticElementAccessExpression, isBindableStaticNameExpression, isBindingElement, + isBindingElementOfBareOrAccessedRequire, isBindingName, + isBindingOrAssignmentElement, isBindingOrAssignmentPattern, isBindingPattern, isBlock, @@ -180207,6 +181869,7 @@ start(initializeNodeSystem(), require("os").platform()); isClassStaticBlockDeclaration, isCollapsedRange, isColonToken, + isCommaExpression, isCommaListExpression, isCommaSequence, isCommaToken, @@ -180240,6 +181903,7 @@ start(initializeNodeSystem(), require("os").platform()); isDecoratorTarget, isDefaultClause, isDefaultImport, + isDefaultModifier, isDefaultedExpandoInitializer, isDeleteExpression, isDeleteTarget, @@ -180263,6 +181927,7 @@ start(initializeNodeSystem(), require("os").platform()); isEmptyBindingPattern, isEmptyObjectLiteral, isEmptyStatement, + isEmptyStringLiteral, isEndOfDeclarationMarker, isEntityName, isEntityNameExpression, @@ -180279,6 +181944,7 @@ start(initializeNodeSystem(), require("os").platform()); isExportModifier, isExportName, isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier, isExportSpecifier, isExportsIdentifier, isExportsOrModuleExportsOrAlias, @@ -180333,7 +181999,6 @@ start(initializeNodeSystem(), require("os").platform()); isIdentifier, isIdentifierANonContextualKeyword, isIdentifierName, - isIdentifierOrPrivateIdentifier, isIdentifierOrThisTypeNode, isIdentifierPart, isIdentifierStart, @@ -180373,6 +182038,7 @@ start(initializeNodeSystem(), require("os").platform()); isInferTypeNode, isInfinityOrNaNString, isInitializedProperty, + isInitializedVariable, isInsideJsxElement, isInsideJsxElementOrAttribute, isInsideNodeModules, @@ -180422,6 +182088,8 @@ start(initializeNodeSystem(), require("os").platform()); isJSDocPublicTag, isJSDocReadonlyTag, isJSDocReturnTag, + isJSDocSatisfiesExpression, + isJSDocSatisfiesTag, isJSDocSeeTag, isJSDocSignature, isJSDocTag, @@ -180477,11 +182145,14 @@ start(initializeNodeSystem(), require("os").platform()); isLiteralLikeElementAccess, isLiteralNameOfPropertyDeclarationOrIndexAccess, isLiteralTypeLikeExpression, + isLiteralTypeLiteral, isLiteralTypeNode, isLocalName, isLogicalOperator, isLogicalOrCoalescingAssignmentExpression, isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator, isMappedTypeNode, isMemberName, isMergeDeclarationMarker, @@ -180509,6 +182180,8 @@ start(initializeNodeSystem(), require("os").platform()); isNameOfModuleDeclaration, isNamedClassElement, isNamedDeclaration, + isNamedEvaluation, + isNamedEvaluationSource, isNamedExportBindings, isNamedExports, isNamedImportBindings, @@ -180533,6 +182206,7 @@ start(initializeNodeSystem(), require("os").platform()); isNodeModulesDirectory, isNodeWithPossibleHoistedDeclaration, isNonContextualKeyword, + isNonExportDefaultModifier, isNonGlobalAmbientModule, isNonGlobalDeclaration, isNonNullAccess, @@ -180601,6 +182275,7 @@ start(initializeNodeSystem(), require("os").platform()); isPropertyName, isPropertyNameLiteral, isPropertySignature, + isProtoSetter, isPrototypeAccess, isPrototypePropertyAssignment, isPunctuation, @@ -180712,7 +182387,6 @@ start(initializeNodeSystem(), require("os").platform()); isTupleTypeNode, isTypeAlias, isTypeAliasDeclaration, - isTypeAssertion, isTypeAssertionExpression, isTypeDeclaration, isTypeElement, @@ -180722,8 +182396,9 @@ start(initializeNodeSystem(), require("os").platform()); isTypeLiteralNode, isTypeNode, isTypeNodeKind, - isTypeNodeOrTypeParameterDeclaration, isTypeOfExpression, + isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration, isTypeOnlyImportOrExportDeclaration, isTypeOperatorNode, isTypeParameterDeclaration, @@ -180798,6 +182473,7 @@ start(initializeNodeSystem(), require("os").platform()); maybeBind, maybeSetLocalizedDiagnosticMessages, memoize, + memoizeCached, memoizeOne, memoizeWeak, metadataHelper, @@ -180823,6 +182499,7 @@ start(initializeNodeSystem(), require("os").platform()); mutateMapSkippingNewValues, needsParentheses, needsScopeMarker, + newPrivateEnvironment, noEmitNotification, noEmitSubstitution, noTransformers, @@ -180916,6 +182593,7 @@ start(initializeNodeSystem(), require("os").platform()); programContainsEsModules, programContainsModules, projectReferenceIsEqualTo, + propKeyHelper, propertyNamePart, pseudoBigIntToString, punctuationPart, @@ -180980,10 +182658,12 @@ start(initializeNodeSystem(), require("os").platform()); returnTrue, returnUndefined, returnsPromise, + runInitializersHelper, sameFlatMap, sameMap, sameMapping, scanShebangTrivia, + scanTokenAtPosition, scanner, screenStartingMessageCodes, semanticDiagnosticsOptionDeclarations, @@ -180995,7 +182675,12 @@ start(initializeNodeSystem(), require("os").platform()); setConstantValue, setEachParent, setEmitFlags, + setFunctionNameHelper, setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference, + setIdentifierTypeArguments, + setInternalEmitFlags, setLocalizedDiagnosticMessages, setModuleDefaultHelper, setNodeFlags, @@ -181003,6 +182688,7 @@ start(initializeNodeSystem(), require("os").platform()); setOriginalNode, setParent, setParentRecursive, + setPrivateIdentifier, setResolvedModule, setResolvedTypeReferenceDirective, setSnippetElement, @@ -181043,6 +182729,7 @@ start(initializeNodeSystem(), require("os").platform()); skipTrivia, skipTypeChecking, skipTypeParentheses, + skipWhile, sliceAfter, some, sort, @@ -181137,6 +182824,7 @@ start(initializeNodeSystem(), require("os").platform()); transformES2020, transformES2021, transformES5, + transformESDecorators, transformESNext, transformGenerators, transformJsx, @@ -181163,6 +182851,7 @@ start(initializeNodeSystem(), require("os").platform()); tryGetDirectories, tryGetExtensionFromPath, tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode, tryGetModuleNameFromFile, tryGetModuleSpecifierFromDeclaration, tryGetNativePerformanceHooks, @@ -181197,148 +182886,14 @@ start(initializeNodeSystem(), require("os").platform()); unreachableCodeIsError, unusedLabelIsError, unwrapInnermostStatementOfLabel, - updateArrayBindingPattern, - updateArrayLiteral, - updateArrayTypeNode, - updateArrowFunction, - updateAsExpression, - updateAwait, - updateBinary, - updateBindingElement, - updateBlock, - updateBreak, - updateBundle, - updateCall, - updateCallChain, - updateCallSignature, - updateCaseBlock, - updateCaseClause, - updateCatchClause, - updateClassDeclaration, - updateClassExpression, - updateCommaList, - updateComputedPropertyName, - updateConditional, - updateConditionalTypeNode, - updateConstructSignature, - updateConstructor, - updateConstructorTypeNode, - updateContinue, - updateDecorator, - updateDefaultClause, - updateDelete, - updateDo, - updateElementAccess, - updateElementAccessChain, - updateEnumDeclaration, - updateEnumMember, updateErrorForNoInputFiles, - updateExportAssignment, - updateExportDeclaration, - updateExportSpecifier, - updateExpressionStatement, - updateExpressionWithTypeArguments, - updateExternalModuleReference, - updateFor, - updateForIn, - updateForOf, - updateFunctionDeclaration, - updateFunctionExpression, - updateFunctionTypeNode, - updateGetAccessor, - updateHeritageClause, - updateIf, - updateImportClause, - updateImportDeclaration, - updateImportEqualsDeclaration, - updateImportSpecifier, - updateImportTypeNode, - updateIndexSignature, - updateIndexedAccessTypeNode, - updateInferTypeNode, - updateInterfaceDeclaration, - updateIntersectionTypeNode, - updateJsxAttribute, - updateJsxAttributes, - updateJsxClosingElement, - updateJsxElement, - updateJsxExpression, - updateJsxFragment, - updateJsxOpeningElement, - updateJsxSelfClosingElement, - updateJsxSpreadAttribute, - updateJsxText, - updateLabel, updateLanguageServiceSourceFile, - updateLiteralTypeNode, - updateMappedTypeNode, - updateMetaProperty, - updateMethod, - updateMethodSignature, updateMissingFilePathsWatch, - updateModuleBlock, - updateModuleDeclaration, - updateNamedExports, - updateNamedImports, - updateNamespaceExport, - updateNamespaceExportDeclaration, - updateNamespaceImport, - updateNew, - updateNonNullChain, - updateNonNullExpression, - updateObjectBindingPattern, - updateObjectLiteral, - updateOptionalTypeNode, updatePackageJsonWatch, - updateParameter, - updateParen, - updateParenthesizedType, - updatePartiallyEmittedExpression, - updatePostfix, - updatePrefix, - updateProperty, - updatePropertyAccess, - updatePropertyAccessChain, - updatePropertyAssignment, - updatePropertySignature, - updateQualifiedName, updateResolutionField, - updateRestTypeNode, - updateReturn, - updateSetAccessor, updateSharedExtendedConfigFileWatcher, - updateShorthandPropertyAssignment, updateSourceFile, - updateSourceFileNode, - updateSpread, - updateSpreadAssignment, - updateStatement, - updateSwitch, - updateTaggedTemplate, - updateTemplateExpression, - updateTemplateSpan, - updateThrow, - updateTry, - updateTupleTypeNode, - updateTypeAliasDeclaration, - updateTypeAssertion, - updateTypeLiteralNode, - updateTypeOf, - updateTypeOperatorNode, - updateTypeParameterDeclaration, - updateTypePredicateNode, - updateTypePredicateNodeWithModifier, - updateTypeQueryNode, - updateTypeReferenceNode, - updateUnionTypeNode, - updateVariableDeclaration, - updateVariableDeclarationList, - updateVariableStatement, - updateVoid, updateWatchingWildcardDirectories, - updateWhile, - updateWith, - updateYield, usesExtensionsOnImports, usingSingleLineStringWriter, utf16EncodeAsString, @@ -181347,6 +182902,7 @@ start(initializeNodeSystem(), require("os").platform()); version, versionMajorMinor, visitArray, + visitCommaListElements, visitEachChild, visitFunctionBody, visitIterationBody, @@ -181355,6 +182911,8 @@ start(initializeNodeSystem(), require("os").platform()); visitNodes, visitParameterList, walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments, + walkUpOuterExpressions, walkUpParenthesizedExpressions, walkUpParenthesizedTypes, walkUpParenthesizedTypesAndGetParentAndChild, diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 0884b10602045..d37896300e8f8 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -87,9 +87,6 @@ declare namespace ts { readonly kind: ActionSet; } namespace protocol { - /** - * Declaration module describing the TypeScript Server protocol - */ enum CommandTypes { JsxClosingTag = "jsxClosingTag", Brace = "brace", @@ -1147,10 +1144,6 @@ declare namespace ts { * Compiler options for the project */ options: ExternalProjectCompilerOptions; - /** - * @deprecated typingOptions. Use typeAcquisition instead - */ - typingOptions?: TypeAcquisition; /** * Explicitly specified type acquisition for the project */ @@ -2802,7 +2795,59 @@ declare namespace ts { readonly includeInlayFunctionLikeReturnTypeHints?: boolean; readonly includeInlayEnumMemberValueHints?: boolean; readonly autoImportFileExcludePatterns?: string[]; + /** + * Indicates whether imports should be organized in a case-insensitive manner. + */ readonly organizeImportsIgnoreCase?: "auto" | boolean; + /** + * Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value + * of their code points, or via "unicode" collation (via the + * [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale + * specified in {@link organizeImportsCollationLocale}. + * + * Default: `"ordinal"`. + */ + readonly organizeImportsCollation?: "ordinal" | "unicode"; + /** + * Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant + * for the sake of consistent sorting. Use `"auto"` to use the detected UI locale. + * + * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. + * + * Default: `"en"` + */ + readonly organizeImportsCollationLocale?: string; + /** + * Indicates whether numeric collation should be used for digit sequences in strings. When `true`, will collate + * strings such that `a1z < a2z < a100z`. When `false`, will collate strings such that `a1z < a100z < a2z`. + * + * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. + * + * Default: `false` + */ + readonly organizeImportsNumericCollation?: boolean; + /** + * Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When + * `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified + * in {@link organizeImportsCollationLocale}. + * + * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. + * + * Default: `true` + */ + readonly organizeImportsAccentCollation?: boolean; + /** + * Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale + * specified in {@link organizeImportsCollationLocale} is used. + * + * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. This preference is also + * ignored if we are using case-insensitive sorting, which occurs when {@link organizeImportsIgnoreCase} is `true`, + * or if {@link organizeImportsIgnoreCase} is `"auto"` and the auto-detected case sensitivity is determined to be + * case-insensitive. + * + * Default: `false` + */ + readonly organizeImportsCaseFirst?: "upper" | "lower" | false; /** * Indicates whether {@link ReferencesResponseItem.lineText} is supported. */ @@ -3005,10 +3050,6 @@ declare namespace ts { Info = "Info", Perf = "Perf" } - namespace Msg { - /** @deprecated Only here for backwards-compatibility. Prefer just `Msg`. */ - type Types = Msg; - } namespace Errors { function ThrowNoProject(): never; function ThrowProjectLanguageServiceDisabled(): never; @@ -3484,8 +3525,6 @@ declare namespace ts { pluginProbeLocations?: readonly string[]; allowLocalPluginLoads?: boolean; typesMapLocation?: string; - /** @deprecated use serverMode instead */ - syntaxOnly?: boolean; serverMode?: LanguageServiceMode; session: Session | undefined; } @@ -3557,8 +3596,6 @@ declare namespace ts { readonly allowLocalPluginLoads: boolean; private currentPluginConfigOverrides; readonly typesMapLocation: string | undefined; - /** @deprecated use serverMode instead */ - readonly syntaxOnly: boolean; readonly serverMode: LanguageServiceMode; /** Tracks projects that we have already sent telemetry for. */ private readonly seenProjects; @@ -3729,7 +3766,7 @@ declare namespace ts { private enableRequestedPluginsForProjectAsync; configurePlugin(args: protocol.ConfigurePluginRequestArguments): void; } - function formatMessage(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string; + function formatMessage(msg: T, logger: Logger, byteLength: (s: string, encoding: BufferEncoding) => number, newLine: string): string; interface ServerCancellationToken extends HostCancellationToken { setRequest(requestId: number): void; resetRequest(requestId: number): void; @@ -3739,7 +3776,9 @@ declare namespace ts { fileName: NormalizedPath; project: Project; } + /** @deprecated use ts.server.protocol.CommandTypes */ type CommandNames = protocol.CommandTypes; + /** @deprecated use ts.server.protocol.CommandTypes */ const CommandNames: any; type Event = (body: T, eventName: string) => void; interface EventSender { @@ -3751,8 +3790,14 @@ declare namespace ts { useSingleInferredProject: boolean; useInferredProjectPerProjectRoot: boolean; typingsInstaller: ITypingsInstaller; - byteLength: (buf: string, encoding?: string) => number; - hrtime: (start?: number[]) => number[]; + byteLength: (buf: string, encoding?: BufferEncoding) => number; + hrtime: (start?: [ + number, + number + ]) => [ + number, + number + ]; logger: Logger; /** * If falsy, all events are suppressed. @@ -3761,8 +3806,6 @@ declare namespace ts { eventHandler?: ProjectServiceEventHandler; /** Has no effect if eventHandler is also specified. */ suppressDiagnosticEvents?: boolean; - /** @deprecated use serverMode instead */ - syntaxOnly?: boolean; serverMode?: LanguageServiceMode; throttleWaitMilliseconds?: number; noGetErrOnBackgroundUpdate?: boolean; @@ -3781,7 +3824,7 @@ declare namespace ts { protected host: ServerHost; private readonly cancellationToken; protected readonly typingsInstaller: ITypingsInstaller; - protected byteLength: (buf: string, encoding?: string) => number; + protected byteLength: (buf: string, encoding?: BufferEncoding) => number; private hrtime; protected logger: Logger; protected canUseEvents: boolean; @@ -3799,9 +3842,6 @@ declare namespace ts { send(msg: protocol.Message): void; protected writeMessage(msg: protocol.Message): void; event(body: T, eventName: string): void; - /** @deprecated */ - output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void; - private doOutput; private semanticCheck; private syntacticCheck; private suggestionCheck; @@ -4283,15 +4323,15 @@ declare namespace ts { ShorthandPropertyAssignment = 300, SpreadAssignment = 301, EnumMember = 302, - UnparsedPrologue = 303, - UnparsedPrepend = 304, - UnparsedText = 305, - UnparsedInternalText = 306, - UnparsedSyntheticReference = 307, + /** @deprecated */ UnparsedPrologue = 303, + /** @deprecated */ UnparsedPrepend = 304, + /** @deprecated */ UnparsedText = 305, + /** @deprecated */ UnparsedInternalText = 306, + /** @deprecated */ UnparsedSyntheticReference = 307, SourceFile = 308, Bundle = 309, - UnparsedSource = 310, - InputFiles = 311, + /** @deprecated */ UnparsedSource = 310, + /** @deprecated */ InputFiles = 311, JSDocTypeExpression = 312, JSDocNameReference = 313, JSDocMemberName = 314, @@ -4335,14 +4375,15 @@ declare namespace ts { JSDocSeeTag = 350, JSDocPropertyTag = 351, JSDocThrowsTag = 352, - SyntaxList = 353, - NotEmittedStatement = 354, - PartiallyEmittedExpression = 355, - CommaListExpression = 356, - MergeDeclarationMarker = 357, - EndOfDeclarationMarker = 358, - SyntheticReferenceExpression = 359, - Count = 360, + JSDocSatisfiesTag = 353, + SyntaxList = 354, + NotEmittedStatement = 355, + PartiallyEmittedExpression = 356, + CommaListExpression = 357, + MergeDeclarationMarker = 358, + EndOfDeclarationMarker = 359, + SyntheticReferenceExpression = 360, + Count = 361, FirstAssignment = 63, LastAssignment = 78, FirstCompoundAssignment = 64, @@ -4371,14 +4412,14 @@ declare namespace ts { LastStatement = 256, FirstNode = 163, FirstJSDocNode = 312, - LastJSDocNode = 352, + LastJSDocNode = 353, FirstJSDocTagNode = 330, - LastJSDocTagNode = 352 + LastJSDocTagNode = 353 } type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; - type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; + type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword; type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; @@ -4475,30 +4516,6 @@ declare namespace ts { getLastToken(sourceFile?: SourceFile): Node | undefined; forEachChild(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray) => T | undefined): T | undefined; } - interface Node { - /** - * @deprecated `decorators` has been removed from `Node` and merged with `modifiers` on the `Node` subtypes that support them. - * Use `ts.canHaveDecorators()` to test whether a `Node` can have decorators. - * Use `ts.getDecorators()` to get the decorators of a `Node`. - * - * For example: - * ```ts - * const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined; - * ``` - */ - readonly decorators?: undefined; - /** - * @deprecated `modifiers` has been removed from `Node` and moved to the `Node` subtypes that support them. - * Use `ts.canHaveModifiers()` to test whether a `Node` can have modifiers. - * Use `ts.getModifiers()` to get the modifiers of a `Node`. - * - * For example: - * ```ts - * const modifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined; - * ``` - */ - readonly modifiers?: NodeArray | undefined; - } interface JSDocContainer extends Node { _jsdocContainerBrand: any; } @@ -4530,6 +4547,9 @@ declare namespace ts { type ExclamationToken = PunctuationToken; type ColonToken = PunctuationToken; type EqualsToken = PunctuationToken; + type AmpersandAmpersandEqualsToken = PunctuationToken; + type BarBarEqualsToken = PunctuationToken; + type QuestionQuestionEqualsToken = PunctuationToken; type AsteriskToken = PunctuationToken; type EqualsGreaterThanToken = PunctuationToken; type PlusToken = PunctuationToken; @@ -4541,10 +4561,6 @@ declare namespace ts { type AssertKeyword = KeywordToken; type AwaitKeyword = KeywordToken; type CaseKeyword = KeywordToken; - /** @deprecated Use `AwaitKeyword` instead. */ - type AwaitKeywordToken = AwaitKeyword; - /** @deprecated Use `AssertsKeyword` instead. */ - type AssertsToken = AssertsKeyword; interface ModifierToken extends KeywordToken { } type AbstractKeyword = ModifierToken; @@ -4562,8 +4578,6 @@ declare namespace ts { type OutKeyword = ModifierToken; type OverrideKeyword = ModifierToken; type StaticKeyword = ModifierToken; - /** @deprecated Use `ReadonlyKeyword` instead. */ - type ReadonlyToken = ReadonlyKeyword; type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword; type ModifierLike = Modifier | Decorator; type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword; @@ -4584,12 +4598,16 @@ declare namespace ts { * Text of identifier, but if the identifier begins with two underscores, this will begin with three. */ readonly escapedText: __String; - readonly originalKeywordKind?: SyntaxKind; - isInJSDocNamespace?: boolean; } interface Identifier { readonly text: string; } + interface Identifier { + /** @deprecated Use `idKeyword(identifier)` instead. */ + readonly originalKeywordKind?: SyntaxKind; + /** @deprecated Use `.parent` or the surrounding context to determine this instead. */ + readonly isInJSDocNamespace?: boolean; + } interface TransientIdentifier extends Identifier { resolvedSymbol: Symbol; } @@ -4692,10 +4710,6 @@ declare namespace ts { readonly questionToken?: QuestionToken; readonly type?: TypeNode; } - interface PropertySignature { - /** @deprecated A property signature cannot have an initializer */ - readonly initializer?: Expression | undefined; - } interface PropertyDeclaration extends ClassElement, JSDocContainer { readonly kind: SyntaxKind.PropertyDeclaration; readonly parent: ClassLikeDeclaration; @@ -4721,12 +4735,6 @@ declare namespace ts { readonly name: PropertyName; readonly initializer: Expression; } - interface PropertyAssignment { - /** @deprecated A property assignment cannot have a question token */ - readonly questionToken?: QuestionToken | undefined; - /** @deprecated A property assignment cannot have an exclamation token */ - readonly exclamationToken?: ExclamationToken | undefined; - } interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer { readonly kind: SyntaxKind.ShorthandPropertyAssignment; readonly parent: ObjectLiteralExpression; @@ -4734,14 +4742,6 @@ declare namespace ts { readonly equalsToken?: EqualsToken; readonly objectAssignmentInitializer?: Expression; } - interface ShorthandPropertyAssignment { - /** @deprecated A shorthand property assignment cannot have modifiers */ - readonly modifiers?: NodeArray | undefined; - /** @deprecated A shorthand property assignment cannot have a question token */ - readonly questionToken?: QuestionToken | undefined; - /** @deprecated A shorthand property assignment cannot have an exclamation token */ - readonly exclamationToken?: ExclamationToken | undefined; - } interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer { readonly kind: SyntaxKind.SpreadAssignment; readonly parent: ObjectLiteralExpression; @@ -4780,7 +4780,7 @@ declare namespace ts { type FunctionLike = SignatureDeclaration; interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement, LocalsContainer { readonly kind: SyntaxKind.FunctionDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name?: Identifier; readonly body?: FunctionBody; } @@ -4800,7 +4800,7 @@ declare namespace ts { interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer, LocalsContainer { readonly kind: SyntaxKind.Constructor; readonly parent: ClassLikeDeclaration; - readonly modifiers?: NodeArray | undefined; + readonly modifiers?: NodeArray | undefined; readonly body?: FunctionBody | undefined; } /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ @@ -4826,7 +4826,7 @@ declare namespace ts { interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement, LocalsContainer { readonly kind: SyntaxKind.IndexSignature; readonly parent: ObjectTypeDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly type: TypeNode; } interface ClassStaticBlockDeclaration extends ClassElement, JSDocContainer, LocalsContainer { @@ -4864,10 +4864,6 @@ declare namespace ts { interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer { readonly kind: SyntaxKind.FunctionType; } - interface FunctionTypeNode { - /** @deprecated A function type cannot have modifiers */ - readonly modifiers?: NodeArray | undefined; - } interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer { readonly kind: SyntaxKind.ConstructorType; readonly modifiers?: NodeArray; @@ -5409,7 +5405,7 @@ declare namespace ts { interface DebuggerStatement extends Statement, FlowContainer { readonly kind: SyntaxKind.DebuggerStatement; } - interface MissingDeclaration extends DeclarationStatement { + interface MissingDeclaration extends DeclarationStatement, PrimaryExpression { readonly kind: SyntaxKind.MissingDeclaration; readonly name?: Identifier; } @@ -5420,7 +5416,7 @@ declare namespace ts { } interface VariableStatement extends Statement, FlowContainer { readonly kind: SyntaxKind.VariableStatement; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly declarationList: VariableDeclarationList; } interface ExpressionStatement extends Statement, FlowContainer { @@ -5557,7 +5553,7 @@ declare namespace ts { } interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.InterfaceDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: Identifier; readonly typeParameters?: NodeArray; readonly heritageClauses?: NodeArray; @@ -5571,7 +5567,7 @@ declare namespace ts { } interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer, LocalsContainer { readonly kind: SyntaxKind.TypeAliasDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: Identifier; readonly typeParameters?: NodeArray; readonly type: TypeNode; @@ -5584,7 +5580,7 @@ declare namespace ts { } interface EnumDeclaration extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.EnumDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: Identifier; readonly members: NodeArray; } @@ -5593,7 +5589,7 @@ declare namespace ts { interface ModuleDeclaration extends DeclarationStatement, JSDocContainer, LocalsContainer { readonly kind: SyntaxKind.ModuleDeclaration; readonly parent: ModuleBody | SourceFile; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: ModuleName; readonly body?: ModuleBody | JSDocNamespaceDeclaration; } @@ -5621,7 +5617,7 @@ declare namespace ts { interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.ImportEqualsDeclaration; readonly parent: SourceFile | ModuleBlock; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: Identifier; readonly isTypeOnly: boolean; readonly moduleReference: ModuleReference; @@ -5634,7 +5630,7 @@ declare namespace ts { interface ImportDeclaration extends Statement { readonly kind: SyntaxKind.ImportDeclaration; readonly parent: SourceFile | ModuleBlock; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly importClause?: ImportClause; /** If this is not a StringLiteral it will be a grammar error. */ readonly moduleSpecifier: Expression; @@ -5679,7 +5675,7 @@ declare namespace ts { interface ExportDeclaration extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.ExportDeclaration; readonly parent: SourceFile | ModuleBlock; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly isTypeOnly: boolean; /** Will not be assigned in the case of `export * from "foo";` */ readonly exportClause?: NamedExportBindings; @@ -5713,8 +5709,8 @@ declare namespace ts { readonly name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; - type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier; - type TypeOnlyAliasDeclaration = ImportClause & { + type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier | ExportDeclaration | NamespaceExport; + type TypeOnlyImportDeclaration = ImportClause & { readonly isTypeOnly: true; readonly name: Identifier; } | ImportEqualsDeclaration & { @@ -5731,7 +5727,8 @@ declare namespace ts { readonly isTypeOnly: true; }; }; - }) | ExportSpecifier & ({ + }); + type TypeOnlyExportDeclaration = ExportSpecifier & ({ readonly isTypeOnly: true; } | { readonly parent: NamedExports & { @@ -5739,7 +5736,14 @@ declare namespace ts { readonly isTypeOnly: true; }; }; - }); + }) | ExportDeclaration & { + readonly isTypeOnly: true; + } | NamespaceExport & { + readonly parent: ExportDeclaration & { + readonly isTypeOnly: true; + }; + }; + type TypeOnlyAliasDeclaration = TypeOnlyImportDeclaration | TypeOnlyExportDeclaration; /** * This is either an `export =` or an `export default` declaration. * Unless `isExportEquals` is set, this node was parsed as an `export default`. @@ -5747,7 +5751,7 @@ declare namespace ts { interface ExportAssignment extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.ExportAssignment; readonly parent: SourceFile; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly isExportEquals?: boolean; readonly expression: Expression; } @@ -5967,6 +5971,10 @@ declare namespace ts { /** If true, then this type literal represents an *array* of its type. */ readonly isArrayType: boolean; } + interface JSDocSatisfiesTag extends JSDocTag { + readonly kind: SyntaxKind.JSDocSatisfiesTag; + readonly typeExpression: JSDocTypeExpression; + } enum FlowFlags { Unreachable = 1, Start = 2, @@ -6092,9 +6100,10 @@ declare namespace ts { } interface Bundle extends Node { readonly kind: SyntaxKind.Bundle; - readonly prepends: readonly (InputFiles | UnparsedSource)[]; + /** @deprecated */ readonly prepends: readonly (InputFiles | UnparsedSource)[]; readonly sourceFiles: readonly SourceFile[]; } + /** @deprecated */ interface InputFiles extends Node { readonly kind: SyntaxKind.InputFiles; javascriptPath?: string; @@ -6106,6 +6115,7 @@ declare namespace ts { declarationMapPath?: string; declarationMapText?: string; } + /** @deprecated */ interface UnparsedSource extends Node { readonly kind: SyntaxKind.UnparsedSource; fileName: string; @@ -6121,28 +6131,35 @@ declare namespace ts { readonly syntheticReferences?: readonly UnparsedSyntheticReference[]; readonly texts: readonly UnparsedSourceText[]; } + /** @deprecated */ type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike; + /** @deprecated */ type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference; + /** @deprecated */ interface UnparsedSection extends Node { readonly kind: SyntaxKind; readonly parent: UnparsedSource; readonly data?: string; } + /** @deprecated */ interface UnparsedPrologue extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrologue; readonly parent: UnparsedSource; readonly data: string; } + /** @deprecated */ interface UnparsedPrepend extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrepend; readonly parent: UnparsedSource; readonly data: string; readonly texts: readonly UnparsedTextLike[]; } + /** @deprecated */ interface UnparsedTextLike extends UnparsedSection { readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText; readonly parent: UnparsedSource; } + /** @deprecated */ interface UnparsedSyntheticReference extends UnparsedSection { readonly kind: SyntaxKind.UnparsedSyntheticReference; readonly parent: UnparsedSource; @@ -6283,9 +6300,7 @@ declare namespace ts { DiagnosticsPresent_OutputsSkipped = 1, DiagnosticsPresent_OutputsGenerated = 2, InvalidProject_OutputsSkipped = 3, - ProjectReferenceCycle_OutputsSkipped = 4, - /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */ - ProjectReferenceCycle_OutputsSkupped = 4 + ProjectReferenceCycle_OutputsSkipped = 4 } interface EmitResult { emitSkipped: boolean; @@ -6415,8 +6430,6 @@ declare namespace ts { OmitThisParameter = 33554432, AllowThisInObjectLiteral = 32768, AllowQualifiedNameInPlaceOfIdentifier = 65536, - /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ - AllowQualifedNameInPlaceOfIdentifier = 65536, AllowAnonymousIdentifier = 131072, AllowEmptyUnionOrIntersection = 262144, AllowEmptyTuple = 524288, @@ -6451,7 +6464,6 @@ declare namespace ts { InElementType = 2097152, InFirstTypeArgument = 4194304, InTypeAlias = 8388608, - /** @deprecated */ WriteOwnNameForAnyLike = 0, NodeBuilderFlagsMask = 848330091 } enum SymbolFormatFlags { @@ -6907,8 +6919,6 @@ declare namespace ts { PriorityImpliesCombination = 416, Circularity = -1 } - /** @deprecated Use FileExtensionInfo instead. */ - type JsFileExtensionInfo = FileExtensionInfo; interface FileExtensionInfo { extension: string; isMixedContent: boolean; @@ -7116,6 +7126,7 @@ declare namespace ts { types?: string[]; /** Paths used to compute primary types search locations */ typeRoots?: string[]; + verbatimModuleSyntax?: boolean; esModuleInterop?: boolean; useDefineForClassFields?: boolean; [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined; @@ -7130,11 +7141,6 @@ declare namespace ts { [option: string]: CompilerOptionsValue | undefined; } interface TypeAcquisition { - /** - * @deprecated typingOptions.enableAutoDiscovery - * Use typeAcquisition.enable instead. - */ - enableAutoDiscovery?: boolean; enable?: boolean; include?: string[]; exclude?: string[]; @@ -7510,8 +7516,8 @@ declare namespace ts { updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature; createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; - createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; - updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + createConstructorDeclaration(modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; @@ -7520,8 +7526,8 @@ declare namespace ts { updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): CallSignatureDeclaration; createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; - createIndexSignature(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - updateIndexSignature(node: IndexSignatureDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + createIndexSignature(modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + updateIndexSignature(node: IndexSignatureDeclaration, modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; createClassStaticBlockDeclaration(body: Block): ClassStaticBlockDeclaration; @@ -7657,8 +7663,8 @@ declare namespace ts { createSemicolonClassElement(): SemicolonClassElement; createBlock(statements: readonly Statement[], multiLine?: boolean): Block; updateBlock(node: Block, statements: readonly Statement[]): Block; - createVariableStatement(modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement; - updateVariableStatement(node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement; + createVariableStatement(modifiers: readonly ModifierLike[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement; + updateVariableStatement(node: VariableStatement, modifiers: readonly ModifierLike[] | undefined, declarationList: VariableDeclarationList): VariableStatement; createEmptyStatement(): EmptyStatement; createExpressionStatement(expression: Expression): ExpressionStatement; updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; @@ -7699,24 +7705,24 @@ declare namespace ts { updateFunctionDeclaration(node: FunctionDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; createClassDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; updateClassDeclaration(node: ClassDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; - createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; - updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; - createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; - updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; - createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration; - updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration; - createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; - updateModuleDeclaration(node: ModuleDeclaration, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; + createInterfaceDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; + updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; + createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; + updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; + createEnumDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration; + updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration; + createModuleDeclaration(modifiers: readonly ModifierLike[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; + updateModuleDeclaration(node: ModuleDeclaration, modifiers: readonly ModifierLike[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; createModuleBlock(statements: readonly Statement[]): ModuleBlock; updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock; createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock; updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock; createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration; updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration; - createImportEqualsDeclaration(modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - createImportDeclaration(modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration; - updateImportDeclaration(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; + createImportEqualsDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration; + updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; createAssertClause(elements: NodeArray, multiLine?: boolean): AssertClause; @@ -7733,10 +7739,10 @@ declare namespace ts { updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports; createImportSpecifier(isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; - createExportAssignment(modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; - updateExportAssignment(node: ExportAssignment, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment; - createExportDeclaration(modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration; - updateExportDeclaration(node: ExportDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration; + createExportAssignment(modifiers: readonly ModifierLike[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; + updateExportAssignment(node: ExportAssignment, modifiers: readonly ModifierLike[] | undefined, expression: Expression): ExportAssignment; + createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration; + updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration; createNamedExports(elements: readonly ExportSpecifier[]): NamedExports; updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports; createExportSpecifier(isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; @@ -7813,12 +7819,14 @@ declare namespace ts { updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | NodeArray | undefined): JSDocReadonlyTag; createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray): JSDocUnknownTag; updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray | undefined): JSDocUnknownTag; - createJSDocDeprecatedTag(tagName: Identifier, comment?: string | NodeArray): JSDocDeprecatedTag; - updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string | NodeArray): JSDocDeprecatedTag; - createJSDocOverrideTag(tagName: Identifier, comment?: string | NodeArray): JSDocOverrideTag; - updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment?: string | NodeArray): JSDocOverrideTag; + createJSDocDeprecatedTag(tagName: Identifier | undefined, comment?: string | NodeArray): JSDocDeprecatedTag; + updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier | undefined, comment?: string | NodeArray): JSDocDeprecatedTag; + createJSDocOverrideTag(tagName: Identifier | undefined, comment?: string | NodeArray): JSDocOverrideTag; + updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier | undefined, comment?: string | NodeArray): JSDocOverrideTag; createJSDocThrowsTag(tagName: Identifier, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray): JSDocThrowsTag; updateJSDocThrowsTag(node: JSDocThrowsTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray | undefined): JSDocThrowsTag; + createJSDocSatisfiesTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray): JSDocSatisfiesTag; + updateJSDocSatisfiesTag(node: JSDocSatisfiesTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray | undefined): JSDocSatisfiesTag; createJSDocText(text: string): JSDocText; updateJSDocText(node: JSDocText, text: string): JSDocText; createJSDocComment(comment?: string | NodeArray | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc; @@ -7868,8 +7876,10 @@ declare namespace ts { updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; createCommaListExpression(elements: readonly Expression[]): CommaListExpression; updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression; - createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; - updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + createBundle(sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + updateBundle(node: Bundle, sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; createComma(left: Expression, right: Expression): BinaryExpression; createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; createAssignment(left: Expression, right: Expression): AssignmentExpression; @@ -7912,179 +7922,6 @@ declare namespace ts { createExternalModuleExport(exportName: Identifier): ExportDeclaration; restoreOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression; } - interface NodeFactory { - /** @deprecated Use the overload that accepts 'modifiers' */ - createConstructorTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode; - /** @deprecated Use the overload that accepts 'modifiers' */ - updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode; - } - interface NodeFactory { - createImportTypeNode(argument: TypeNode, assertions?: ImportTypeAssertionContainer, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; - /** @deprecated Use the overload that accepts 'assertions' */ - createImportTypeNode(argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; - /** @deprecated Use the overload that accepts 'assertions' */ - updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode; - } - interface NodeFactory { - /** @deprecated Use the overload that accepts 'modifiers' */ - createTypeParameterDeclaration(name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration; - /** @deprecated Use the overload that accepts 'modifiers' */ - updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; - } - interface NodeFactory { - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createParameterDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateParameterDeclaration(node: ParameterDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createPropertyDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updatePropertyDeclaration(node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createMethodDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateMethodDeclaration(node: MethodDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; - /** - * @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter. - */ - createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; - /** - * @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createGetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createSetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - /** - * @deprecated Decorators and modifiers are no longer supported for this function. Callers should use an overload that does not accept the `decorators` and `modifiers` parameters. - */ - updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - /** - * @deprecated Decorators and modifiers are no longer supported for this function. Callers should use an overload that does not accept the `decorators` and `modifiers` parameters. - */ - createClassStaticBlockDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, body: Block): ClassStaticBlockDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateClassStaticBlockDeclaration(node: ClassStaticBlockDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, body: Block): ClassStaticBlockDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createClassExpression(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateClassExpression(node: ClassExpression, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createFunctionDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateFunctionDeclaration(node: FunctionDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createClassDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateClassDeclaration(node: ClassDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createInterfaceDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateInterfaceDeclaration(node: InterfaceDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createTypeAliasDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createEnumDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateEnumDeclaration(node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createModuleDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateModuleDeclaration(node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createImportEqualsDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createImportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateImportDeclaration(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createExportAssignment(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateExportAssignment(node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateExportDeclaration(node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration; - } interface CoreTransformationContext { readonly factory: NodeFactory; /** Gets the compiler options supplied to the transformer. */ @@ -8181,16 +8018,39 @@ declare namespace ts { /** * A function that accepts and possibly transforms a node. */ - type Visitor = (node: Node) => VisitResult; + type Visitor = (node: TIn) => VisitResult; + /** + * A function that walks a node using the given visitor, lifting node arrays into single nodes, + * returning an node which satisfies the test. + * + * - If the input node is undefined, then the output is undefined. + * - If the visitor returns undefined, then the output is undefined. + * - If the output node is not undefined, then it will satisfy the test function. + * - In order to obtain a return type that is more specific than `Node`, a test + * function _must_ be provided, and that function must be a type predicate. + * + * For the canonical implementation of this type, @see {visitNode}. + */ interface NodeVisitor { - (nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T; - (nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined; + (node: TIn, visitor: Visitor, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined); + (node: TIn, visitor: Visitor, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined); } + /** + * A function that walks a node array using the given visitor, returning an array whose contents satisfy the test. + * + * - If the input node array is undefined, the output is undefined. + * - If the visitor can return undefined, the node it visits in the array will be reused. + * - If the output node array is not undefined, then its contents will satisfy the test. + * - In order to obtain a return type that is more specific than `NodeArray`, a test + * function _must_ be provided, and that function must be a type predicate. + * + * For the canonical implementation of this type, @see {visitNodes}. + */ interface NodesVisitor { - (nodes: NodeArray, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray; - (nodes: NodeArray | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | undefined; + | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray | (TInArray & undefined); + | undefined>(nodes: TInArray, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | (TInArray & undefined); } - type VisitResult = T | readonly T[] | undefined; + type VisitResult = T | readonly Node[]; interface Printer { /** * Print a node and its subtree as-is, without any emit transformations. @@ -8390,6 +8250,11 @@ declare namespace ts { readonly allowRenameOfImportPath?: boolean; readonly autoImportFileExcludePatterns?: string[]; readonly organizeImportsIgnoreCase?: "auto" | boolean; + readonly organizeImportsCollation?: "ordinal" | "unicode"; + readonly organizeImportsLocale?: string; + readonly organizeImportsNumericCollation?: boolean; + readonly organizeImportsAccentCollation?: boolean; + readonly organizeImportsCaseFirst?: "upper" | "lower" | false; } /** Represents a bigint literal value without requiring bigint support */ interface PseudoBigInt { @@ -8404,6 +8269,7 @@ declare namespace ts { } type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind, modifiedTime?: Date) => void; type DirectoryWatcherCallback = (fileName: string) => void; + type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"; interface System { args: string[]; newLine: string; @@ -8462,8 +8328,8 @@ declare namespace ts { function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; - function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined; - function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined; + function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined; + function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined; function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; /** Optionally, get the shebang */ @@ -8542,7 +8408,7 @@ declare namespace ts { function getTypeParameterOwner(d: Declaration): Declaration | undefined; function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration; function isEmptyBindingPattern(node: BindingName): node is BindingPattern; - function isEmptyBindingElement(node: BindingElement): boolean; + function isEmptyBindingElement(node: BindingElement | ArrayBindingElement): boolean; function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration; function getCombinedModifierFlags(node: Declaration): ModifierFlags; function getCombinedNodeFlags(node: Node): NodeFlags; @@ -8559,7 +8425,7 @@ declare namespace ts { function getOriginalNode(node: Node): Node; function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; function getOriginalNode(node: Node | undefined): Node | undefined; - function getOriginalNode(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined; + function getOriginalNode(node: Node | undefined, nodeTest: (node: Node) => node is T): T | undefined; /** * Iterates through the parent chain of a node and performs the callback on each parent until the callback * returns a truthy value, then returns that value. @@ -8599,6 +8465,11 @@ declare namespace ts { */ function unescapeLeadingUnderscores(identifier: __String): string; function idText(identifierOrPrivateName: Identifier | PrivateIdentifier): string; + /** + * If the text of an Identifier matches a keyword (including contextual and TypeScript-specific keywords), returns the + * SyntaxKind for the matching keyword. + */ + function identifierToKeywordKind(node: Identifier): KeywordSyntaxKind | undefined; function symbolName(symbol: Symbol): string; function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined; function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined; @@ -8660,6 +8531,7 @@ declare namespace ts { function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined; /** Gets the JSDoc template tag for the node if present */ function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined; + function getJSDocSatisfiesTag(node: Node): JSDocSatisfiesTag | undefined; /** Gets the JSDoc type tag for the node if present and valid */ function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined; /** @@ -8713,7 +8585,9 @@ declare namespace ts { function isNonNullChain(node: Node): node is NonNullChain; function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement; function isNamedExportBindings(node: Node): node is NamedExportBindings; + /** @deprecated */ function isUnparsedTextLike(node: Node): node is UnparsedTextLike; + /** @deprecated */ function isUnparsedNode(node: Node): node is UnparsedNode; function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag; /** @@ -8732,6 +8606,8 @@ declare namespace ts { function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken; function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier; + function isTypeOnlyImportDeclaration(node: Node): node is TypeOnlyImportDeclaration; + function isTypeOnlyExportDeclaration(node: Node): node is TypeOnlyExportDeclaration; function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyAliasDeclaration; function isAssertionKey(node: Node): node is AssertionKey; function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; @@ -8755,13 +8631,30 @@ declare namespace ts { */ function isTypeNode(node: Node): node is TypeNode; function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode; + function isArrayBindingElement(node: Node): node is ArrayBindingElement; function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName; function isCallLikeExpression(node: Node): node is CallLikeExpression; function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression; function isTemplateLiteral(node: Node): node is TemplateLiteral; + function isLeftHandSideExpression(node: Node): node is LeftHandSideExpression; + function isLiteralTypeLiteral(node: Node): node is NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression; + /** + * Determines whether a node is an expression based only on its kind. + */ + function isExpression(node: Node): node is Expression; function isAssertionExpression(node: Node): node is AssertionExpression; function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; + function isConciseBody(node: Node): node is ConciseBody; + function isForInitializer(node: Node): node is ForInitializer; + function isModuleBody(node: Node): node is ModuleBody; + function isNamedImportBindings(node: Node): node is NamedImportBindings; + function isStatement(node: Node): node is Statement; + function isModuleReference(node: Node): node is ModuleReference; + function isJsxTagNameExpression(node: Node): node is JsxTagNameExpression; + function isJsxChild(node: Node): node is JsxChild; + function isJsxAttributeLike(node: Node): node is JsxAttributeLike; + function isStringLiteralOrJsxExpression(node: Node): node is StringLiteral | JsxExpression; function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement; function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; /** True if node is of a kind that may contain comment text. */ @@ -8781,11 +8674,17 @@ declare namespace ts { name: Identifier; }; function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean; + /** @deprecated */ function createUnparsedSourceFile(text: string): UnparsedSource; + /** @deprecated */ function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource; + /** @deprecated */ function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; + /** @deprecated */ function createInputFiles(javascriptText: string, declarationText: string): InputFiles; + /** @deprecated */ function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles; + /** @deprecated */ function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles; /** * Create an external source map source file reference @@ -8874,8 +8773,15 @@ declare namespace ts { function isPlusToken(node: Node): node is PlusToken; function isMinusToken(node: Node): node is MinusToken; function isAsteriskToken(node: Node): node is AsteriskToken; + function isExclamationToken(node: Node): node is ExclamationToken; + function isQuestionToken(node: Node): node is QuestionToken; + function isColonToken(node: Node): node is ColonToken; + function isQuestionDotToken(node: Node): node is QuestionDotToken; + function isEqualsGreaterThanToken(node: Node): node is EqualsGreaterThanToken; function isIdentifier(node: Node): node is Identifier; function isPrivateIdentifier(node: Node): node is PrivateIdentifier; + function isAssertsKeyword(node: Node): node is AssertsKeyword; + function isAwaitKeyword(node: Node): node is AwaitKeyword; function isQualifiedName(node: Node): node is QualifiedName; function isComputedPropertyName(node: Node): node is ComputedPropertyName; function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration; @@ -9019,9 +8925,11 @@ declare namespace ts { function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment; function isSpreadAssignment(node: Node): node is SpreadAssignment; function isEnumMember(node: Node): node is EnumMember; + /** @deprecated */ function isUnparsedPrepend(node: Node): node is UnparsedPrepend; function isSourceFile(node: Node): node is SourceFile; function isBundle(node: Node): node is Bundle; + /** @deprecated */ function isUnparsedSource(node: Node): node is UnparsedSource; function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; function isJSDocNameReference(node: Node): node is JSDocNameReference; @@ -9062,7 +8970,14 @@ declare namespace ts { function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag; function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag; function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag; + function isJSDocSatisfiesTag(node: Node): node is JSDocSatisfiesTag; function isJSDocThrowsTag(node: Node): node is JSDocThrowsTag; + function isQuestionOrExclamationToken(node: Node): node is QuestionToken | ExclamationToken; + function isIdentifierOrThisTypeNode(node: Node): node is Identifier | ThisTypeNode; + function isReadonlyKeywordOrPlusOrMinusToken(node: Node): node is ReadonlyKeyword | PlusToken | MinusToken; + function isQuestionOrPlusOrMinusToken(node: Node): node is QuestionToken | PlusToken | MinusToken; + function isModuleName(node: Node): node is ModuleName; + function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken; function setTextRange(range: T, location: TextRange | undefined): T; function canHaveModifiers(node: Node): node is HasModifiers; function canHaveDecorators(node: Node): node is HasDecorators; @@ -9270,41 +9185,65 @@ declare namespace ts { /** * Visits a Node using the supplied visitor, possibly returning a new Node in its place. * + * - If the input node is undefined, then the output is undefined. + * - If the visitor returns undefined, then the output is undefined. + * - If the output node is not undefined, then it will satisfy the test function. + * - In order to obtain a return type that is more specific than `Node`, a test + * function _must_ be provided, and that function must be a type predicate. + * * @param node The Node to visit. * @param visitor The callback used to visit the Node. * @param test A callback to execute to verify the Node is valid. * @param lift An optional callback to execute to lift a NodeArray into a valid Node. */ - function visitNode(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T; + function visitNode(node: TIn, visitor: Visitor, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined); /** * Visits a Node using the supplied visitor, possibly returning a new Node in its place. * + * - If the input node is undefined, then the output is undefined. + * - If the visitor returns undefined, then the output is undefined. + * - If the output node is not undefined, then it will satisfy the test function. + * - In order to obtain a return type that is more specific than `Node`, a test + * function _must_ be provided, and that function must be a type predicate. + * * @param node The Node to visit. * @param visitor The callback used to visit the Node. * @param test A callback to execute to verify the Node is valid. * @param lift An optional callback to execute to lift a NodeArray into a valid Node. */ - function visitNode(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined; + function visitNode(node: TIn, visitor: Visitor, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined); /** * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. * + * - If the input node array is undefined, the output is undefined. + * - If the visitor can return undefined, the node it visits in the array will be reused. + * - If the output node array is not undefined, then its contents will satisfy the test. + * - In order to obtain a return type that is more specific than `NodeArray`, a test + * function _must_ be provided, and that function must be a type predicate. + * * @param nodes The NodeArray to visit. * @param visitor The callback used to visit a Node. * @param test A node test to execute for each node. * @param start An optional value indicating the starting offset at which to start visiting. * @param count An optional value indicating the maximum number of nodes to visit. */ - function visitNodes(nodes: NodeArray, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray; + function visitNodes | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray | (TInArray & undefined); /** * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. * + * - If the input node array is undefined, the output is undefined. + * - If the visitor can return undefined, the node it visits in the array will be reused. + * - If the output node array is not undefined, then its contents will satisfy the test. + * - In order to obtain a return type that is more specific than `NodeArray`, a test + * function _must_ be provided, and that function must be a type predicate. + * * @param nodes The NodeArray to visit. * @param visitor The callback used to visit a Node. * @param test A node test to execute for each node. * @param start An optional value indicating the starting offset at which to start visiting. * @param count An optional value indicating the maximum number of nodes to visit. */ - function visitNodes(nodes: NodeArray | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | undefined; + function visitNodes | undefined>(nodes: TInArray, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | (TInArray & undefined); /** * Starts a new lexical environment and visits a statement list, ending the lexical environment * and merging hoisted declarations upon completion. @@ -9335,6 +9274,12 @@ declare namespace ts { * Visits an iteration body, adding any block-scoped variables required by the transformation. */ function visitIterationBody(body: Statement, visitor: Visitor, context: TransformationContext): Statement; + /** + * Visits the elements of a {@link CommaListExpression}. + * @param visitor The visitor to use when visiting expressions whose result will not be discarded at runtime. + * @param discardVisitor The visitor to use when visiting expressions whose result will be discarded at runtime. Defaults to {@link visitor}. + */ + function visitCommaListElements(elements: NodeArray, visitor: Visitor, discardVisitor?: Visitor): NodeArray; /** * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. * @@ -9430,15 +9375,11 @@ declare namespace ts { * Note: The file might not exist. */ function resolveProjectReferencePath(ref: ProjectReference): ResolvedConfigFileName; - /** @deprecated */ function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName; interface FormatDiagnosticsHost { getCurrentDirectory(): string; getCanonicalFileName(fileName: string): string; getNewLine(): string; } - /** @deprecated */ interface ResolveProjectReferencePathHost { - fileExists(fileName: string): boolean; - } interface EmitOutput { outputFiles: OutputFile[]; emitSkipped: boolean; @@ -9781,7 +9722,7 @@ declare namespace ts { } enum InvalidatedProjectKind { Build = 0, - UpdateBundle = 1, + /** @deprecated */ UpdateBundle = 1, UpdateOutputFileStamps = 2 } interface InvalidatedProjectBase { @@ -9813,6 +9754,7 @@ declare namespace ts { getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult; emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined; } + /** @deprecated */ interface UpdateBundleProject extends InvalidatedProjectBase { readonly kind: InvalidatedProjectKind.UpdateBundle; emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject | undefined; @@ -11080,738 +11022,5 @@ declare namespace ts { * @param compilerOptions Optional compiler options. */ function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; - /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */ - const createNodeArray: typeof factory.createNodeArray; - /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */ - const createNumericLiteral: typeof factory.createNumericLiteral; - /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */ - const createBigIntLiteral: typeof factory.createBigIntLiteral; - /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */ - const createStringLiteral: typeof factory.createStringLiteral; - /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */ - const createStringLiteralFromNode: typeof factory.createStringLiteralFromNode; - /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */ - const createRegularExpressionLiteral: typeof factory.createRegularExpressionLiteral; - /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */ - const createLoopVariable: typeof factory.createLoopVariable; - /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */ - const createUniqueName: typeof factory.createUniqueName; - /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */ - const createPrivateIdentifier: typeof factory.createPrivateIdentifier; - /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */ - const createSuper: typeof factory.createSuper; - /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */ - const createThis: typeof factory.createThis; - /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */ - const createNull: typeof factory.createNull; - /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */ - const createTrue: typeof factory.createTrue; - /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */ - const createFalse: typeof factory.createFalse; - /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */ - const createModifier: typeof factory.createModifier; - /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */ - const createModifiersFromModifierFlags: typeof factory.createModifiersFromModifierFlags; - /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */ - const createQualifiedName: typeof factory.createQualifiedName; - /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */ - const updateQualifiedName: typeof factory.updateQualifiedName; - /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */ - const createComputedPropertyName: typeof factory.createComputedPropertyName; - /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */ - const updateComputedPropertyName: typeof factory.updateComputedPropertyName; - /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */ - const createTypeParameterDeclaration: typeof factory.createTypeParameterDeclaration; - /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */ - const updateTypeParameterDeclaration: typeof factory.updateTypeParameterDeclaration; - /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */ - const createParameter: typeof factory.createParameterDeclaration; - /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */ - const updateParameter: typeof factory.updateParameterDeclaration; - /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */ - const createDecorator: typeof factory.createDecorator; - /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */ - const updateDecorator: typeof factory.updateDecorator; - /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */ - const createProperty: typeof factory.createPropertyDeclaration; - /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */ - const updateProperty: typeof factory.updatePropertyDeclaration; - /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */ - const createMethod: typeof factory.createMethodDeclaration; - /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */ - const updateMethod: typeof factory.updateMethodDeclaration; - /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */ - const createConstructor: typeof factory.createConstructorDeclaration; - /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */ - const updateConstructor: typeof factory.updateConstructorDeclaration; - /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */ - const createGetAccessor: typeof factory.createGetAccessorDeclaration; - /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */ - const updateGetAccessor: typeof factory.updateGetAccessorDeclaration; - /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */ - const createSetAccessor: typeof factory.createSetAccessorDeclaration; - /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */ - const updateSetAccessor: typeof factory.updateSetAccessorDeclaration; - /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */ - const createCallSignature: typeof factory.createCallSignature; - /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */ - const updateCallSignature: typeof factory.updateCallSignature; - /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */ - const createConstructSignature: typeof factory.createConstructSignature; - /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */ - const updateConstructSignature: typeof factory.updateConstructSignature; - /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */ - const updateIndexSignature: typeof factory.updateIndexSignature; - /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */ - const createKeywordTypeNode: typeof factory.createKeywordTypeNode; - /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */ - const createTypePredicateNodeWithModifier: typeof factory.createTypePredicateNode; - /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */ - const updateTypePredicateNodeWithModifier: typeof factory.updateTypePredicateNode; - /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */ - const createTypeReferenceNode: typeof factory.createTypeReferenceNode; - /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */ - const updateTypeReferenceNode: typeof factory.updateTypeReferenceNode; - /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */ - const createFunctionTypeNode: typeof factory.createFunctionTypeNode; - /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */ - const updateFunctionTypeNode: typeof factory.updateFunctionTypeNode; - /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */ - const createConstructorTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => ConstructorTypeNode; - /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */ - const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode) => ConstructorTypeNode; - /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */ - const createTypeQueryNode: typeof factory.createTypeQueryNode; - /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */ - const updateTypeQueryNode: typeof factory.updateTypeQueryNode; - /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */ - const createTypeLiteralNode: typeof factory.createTypeLiteralNode; - /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */ - const updateTypeLiteralNode: typeof factory.updateTypeLiteralNode; - /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */ - const createArrayTypeNode: typeof factory.createArrayTypeNode; - /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */ - const updateArrayTypeNode: typeof factory.updateArrayTypeNode; - /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */ - const createTupleTypeNode: typeof factory.createTupleTypeNode; - /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */ - const updateTupleTypeNode: typeof factory.updateTupleTypeNode; - /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */ - const createOptionalTypeNode: typeof factory.createOptionalTypeNode; - /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */ - const updateOptionalTypeNode: typeof factory.updateOptionalTypeNode; - /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */ - const createRestTypeNode: typeof factory.createRestTypeNode; - /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */ - const updateRestTypeNode: typeof factory.updateRestTypeNode; - /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */ - const createUnionTypeNode: typeof factory.createUnionTypeNode; - /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */ - const updateUnionTypeNode: typeof factory.updateUnionTypeNode; - /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */ - const createIntersectionTypeNode: typeof factory.createIntersectionTypeNode; - /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */ - const updateIntersectionTypeNode: typeof factory.updateIntersectionTypeNode; - /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */ - const createConditionalTypeNode: typeof factory.createConditionalTypeNode; - /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */ - const updateConditionalTypeNode: typeof factory.updateConditionalTypeNode; - /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */ - const createInferTypeNode: typeof factory.createInferTypeNode; - /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */ - const updateInferTypeNode: typeof factory.updateInferTypeNode; - /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */ - const createImportTypeNode: typeof factory.createImportTypeNode; - /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */ - const updateImportTypeNode: typeof factory.updateImportTypeNode; - /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */ - const createParenthesizedType: typeof factory.createParenthesizedType; - /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */ - const updateParenthesizedType: typeof factory.updateParenthesizedType; - /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */ - const createThisTypeNode: typeof factory.createThisTypeNode; - /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */ - const updateTypeOperatorNode: typeof factory.updateTypeOperatorNode; - /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ - const createIndexedAccessTypeNode: typeof factory.createIndexedAccessTypeNode; - /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ - const updateIndexedAccessTypeNode: typeof factory.updateIndexedAccessTypeNode; - /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */ - const createMappedTypeNode: typeof factory.createMappedTypeNode; - /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */ - const updateMappedTypeNode: typeof factory.updateMappedTypeNode; - /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */ - const createLiteralTypeNode: typeof factory.createLiteralTypeNode; - /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */ - const updateLiteralTypeNode: typeof factory.updateLiteralTypeNode; - /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */ - const createObjectBindingPattern: typeof factory.createObjectBindingPattern; - /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */ - const updateObjectBindingPattern: typeof factory.updateObjectBindingPattern; - /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */ - const createArrayBindingPattern: typeof factory.createArrayBindingPattern; - /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */ - const updateArrayBindingPattern: typeof factory.updateArrayBindingPattern; - /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */ - const createBindingElement: typeof factory.createBindingElement; - /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */ - const updateBindingElement: typeof factory.updateBindingElement; - /** @deprecated Use `factory.createArrayLiteralExpression` or the factory supplied by your transformation context instead. */ - const createArrayLiteral: typeof factory.createArrayLiteralExpression; - /** @deprecated Use `factory.updateArrayLiteralExpression` or the factory supplied by your transformation context instead. */ - const updateArrayLiteral: typeof factory.updateArrayLiteralExpression; - /** @deprecated Use `factory.createObjectLiteralExpression` or the factory supplied by your transformation context instead. */ - const createObjectLiteral: typeof factory.createObjectLiteralExpression; - /** @deprecated Use `factory.updateObjectLiteralExpression` or the factory supplied by your transformation context instead. */ - const updateObjectLiteral: typeof factory.updateObjectLiteralExpression; - /** @deprecated Use `factory.createPropertyAccessExpression` or the factory supplied by your transformation context instead. */ - const createPropertyAccess: typeof factory.createPropertyAccessExpression; - /** @deprecated Use `factory.updatePropertyAccessExpression` or the factory supplied by your transformation context instead. */ - const updatePropertyAccess: typeof factory.updatePropertyAccessExpression; - /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */ - const createPropertyAccessChain: typeof factory.createPropertyAccessChain; - /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */ - const updatePropertyAccessChain: typeof factory.updatePropertyAccessChain; - /** @deprecated Use `factory.createElementAccessExpression` or the factory supplied by your transformation context instead. */ - const createElementAccess: typeof factory.createElementAccessExpression; - /** @deprecated Use `factory.updateElementAccessExpression` or the factory supplied by your transformation context instead. */ - const updateElementAccess: typeof factory.updateElementAccessExpression; - /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */ - const createElementAccessChain: typeof factory.createElementAccessChain; - /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */ - const updateElementAccessChain: typeof factory.updateElementAccessChain; - /** @deprecated Use `factory.createCallExpression` or the factory supplied by your transformation context instead. */ - const createCall: typeof factory.createCallExpression; - /** @deprecated Use `factory.updateCallExpression` or the factory supplied by your transformation context instead. */ - const updateCall: typeof factory.updateCallExpression; - /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */ - const createCallChain: typeof factory.createCallChain; - /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */ - const updateCallChain: typeof factory.updateCallChain; - /** @deprecated Use `factory.createNewExpression` or the factory supplied by your transformation context instead. */ - const createNew: typeof factory.createNewExpression; - /** @deprecated Use `factory.updateNewExpression` or the factory supplied by your transformation context instead. */ - const updateNew: typeof factory.updateNewExpression; - /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */ - const createTypeAssertion: typeof factory.createTypeAssertion; - /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */ - const updateTypeAssertion: typeof factory.updateTypeAssertion; - /** @deprecated Use `factory.createParenthesizedExpression` or the factory supplied by your transformation context instead. */ - const createParen: typeof factory.createParenthesizedExpression; - /** @deprecated Use `factory.updateParenthesizedExpression` or the factory supplied by your transformation context instead. */ - const updateParen: typeof factory.updateParenthesizedExpression; - /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */ - const createFunctionExpression: typeof factory.createFunctionExpression; - /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */ - const updateFunctionExpression: typeof factory.updateFunctionExpression; - /** @deprecated Use `factory.createDeleteExpression` or the factory supplied by your transformation context instead. */ - const createDelete: typeof factory.createDeleteExpression; - /** @deprecated Use `factory.updateDeleteExpression` or the factory supplied by your transformation context instead. */ - const updateDelete: typeof factory.updateDeleteExpression; - /** @deprecated Use `factory.createTypeOfExpression` or the factory supplied by your transformation context instead. */ - const createTypeOf: typeof factory.createTypeOfExpression; - /** @deprecated Use `factory.updateTypeOfExpression` or the factory supplied by your transformation context instead. */ - const updateTypeOf: typeof factory.updateTypeOfExpression; - /** @deprecated Use `factory.createVoidExpression` or the factory supplied by your transformation context instead. */ - const createVoid: typeof factory.createVoidExpression; - /** @deprecated Use `factory.updateVoidExpression` or the factory supplied by your transformation context instead. */ - const updateVoid: typeof factory.updateVoidExpression; - /** @deprecated Use `factory.createAwaitExpression` or the factory supplied by your transformation context instead. */ - const createAwait: typeof factory.createAwaitExpression; - /** @deprecated Use `factory.updateAwaitExpression` or the factory supplied by your transformation context instead. */ - const updateAwait: typeof factory.updateAwaitExpression; - /** @deprecated Use `factory.createPrefixExpression` or the factory supplied by your transformation context instead. */ - const createPrefix: typeof factory.createPrefixUnaryExpression; - /** @deprecated Use `factory.updatePrefixExpression` or the factory supplied by your transformation context instead. */ - const updatePrefix: typeof factory.updatePrefixUnaryExpression; - /** @deprecated Use `factory.createPostfixUnaryExpression` or the factory supplied by your transformation context instead. */ - const createPostfix: typeof factory.createPostfixUnaryExpression; - /** @deprecated Use `factory.updatePostfixUnaryExpression` or the factory supplied by your transformation context instead. */ - const updatePostfix: typeof factory.updatePostfixUnaryExpression; - /** @deprecated Use `factory.createBinaryExpression` or the factory supplied by your transformation context instead. */ - const createBinary: typeof factory.createBinaryExpression; - /** @deprecated Use `factory.updateConditionalExpression` or the factory supplied by your transformation context instead. */ - const updateConditional: typeof factory.updateConditionalExpression; - /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */ - const createTemplateExpression: typeof factory.createTemplateExpression; - /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */ - const updateTemplateExpression: typeof factory.updateTemplateExpression; - /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */ - const createTemplateHead: typeof factory.createTemplateHead; - /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */ - const createTemplateMiddle: typeof factory.createTemplateMiddle; - /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */ - const createTemplateTail: typeof factory.createTemplateTail; - /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */ - const createNoSubstitutionTemplateLiteral: typeof factory.createNoSubstitutionTemplateLiteral; - /** @deprecated Use `factory.updateYieldExpression` or the factory supplied by your transformation context instead. */ - const updateYield: typeof factory.updateYieldExpression; - /** @deprecated Use `factory.createSpreadExpression` or the factory supplied by your transformation context instead. */ - const createSpread: typeof factory.createSpreadElement; - /** @deprecated Use `factory.updateSpreadExpression` or the factory supplied by your transformation context instead. */ - const updateSpread: typeof factory.updateSpreadElement; - /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */ - const createOmittedExpression: typeof factory.createOmittedExpression; - /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */ - const createAsExpression: typeof factory.createAsExpression; - /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */ - const updateAsExpression: typeof factory.updateAsExpression; - /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */ - const createNonNullExpression: typeof factory.createNonNullExpression; - /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */ - const updateNonNullExpression: typeof factory.updateNonNullExpression; - /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */ - const createNonNullChain: typeof factory.createNonNullChain; - /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */ - const updateNonNullChain: typeof factory.updateNonNullChain; - /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */ - const createMetaProperty: typeof factory.createMetaProperty; - /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */ - const updateMetaProperty: typeof factory.updateMetaProperty; - /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */ - const createTemplateSpan: typeof factory.createTemplateSpan; - /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */ - const updateTemplateSpan: typeof factory.updateTemplateSpan; - /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */ - const createSemicolonClassElement: typeof factory.createSemicolonClassElement; - /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */ - const createBlock: typeof factory.createBlock; - /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */ - const updateBlock: typeof factory.updateBlock; - /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */ - const createVariableStatement: typeof factory.createVariableStatement; - /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */ - const updateVariableStatement: typeof factory.updateVariableStatement; - /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */ - const createEmptyStatement: typeof factory.createEmptyStatement; - /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */ - const createExpressionStatement: typeof factory.createExpressionStatement; - /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */ - const updateExpressionStatement: typeof factory.updateExpressionStatement; - /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */ - const createStatement: typeof factory.createExpressionStatement; - /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */ - const updateStatement: typeof factory.updateExpressionStatement; - /** @deprecated Use `factory.createIfStatement` or the factory supplied by your transformation context instead. */ - const createIf: typeof factory.createIfStatement; - /** @deprecated Use `factory.updateIfStatement` or the factory supplied by your transformation context instead. */ - const updateIf: typeof factory.updateIfStatement; - /** @deprecated Use `factory.createDoStatement` or the factory supplied by your transformation context instead. */ - const createDo: typeof factory.createDoStatement; - /** @deprecated Use `factory.updateDoStatement` or the factory supplied by your transformation context instead. */ - const updateDo: typeof factory.updateDoStatement; - /** @deprecated Use `factory.createWhileStatement` or the factory supplied by your transformation context instead. */ - const createWhile: typeof factory.createWhileStatement; - /** @deprecated Use `factory.updateWhileStatement` or the factory supplied by your transformation context instead. */ - const updateWhile: typeof factory.updateWhileStatement; - /** @deprecated Use `factory.createForStatement` or the factory supplied by your transformation context instead. */ - const createFor: typeof factory.createForStatement; - /** @deprecated Use `factory.updateForStatement` or the factory supplied by your transformation context instead. */ - const updateFor: typeof factory.updateForStatement; - /** @deprecated Use `factory.createForInStatement` or the factory supplied by your transformation context instead. */ - const createForIn: typeof factory.createForInStatement; - /** @deprecated Use `factory.updateForInStatement` or the factory supplied by your transformation context instead. */ - const updateForIn: typeof factory.updateForInStatement; - /** @deprecated Use `factory.createForOfStatement` or the factory supplied by your transformation context instead. */ - const createForOf: typeof factory.createForOfStatement; - /** @deprecated Use `factory.updateForOfStatement` or the factory supplied by your transformation context instead. */ - const updateForOf: typeof factory.updateForOfStatement; - /** @deprecated Use `factory.createContinueStatement` or the factory supplied by your transformation context instead. */ - const createContinue: typeof factory.createContinueStatement; - /** @deprecated Use `factory.updateContinueStatement` or the factory supplied by your transformation context instead. */ - const updateContinue: typeof factory.updateContinueStatement; - /** @deprecated Use `factory.createBreakStatement` or the factory supplied by your transformation context instead. */ - const createBreak: typeof factory.createBreakStatement; - /** @deprecated Use `factory.updateBreakStatement` or the factory supplied by your transformation context instead. */ - const updateBreak: typeof factory.updateBreakStatement; - /** @deprecated Use `factory.createReturnStatement` or the factory supplied by your transformation context instead. */ - const createReturn: typeof factory.createReturnStatement; - /** @deprecated Use `factory.updateReturnStatement` or the factory supplied by your transformation context instead. */ - const updateReturn: typeof factory.updateReturnStatement; - /** @deprecated Use `factory.createWithStatement` or the factory supplied by your transformation context instead. */ - const createWith: typeof factory.createWithStatement; - /** @deprecated Use `factory.updateWithStatement` or the factory supplied by your transformation context instead. */ - const updateWith: typeof factory.updateWithStatement; - /** @deprecated Use `factory.createSwitchStatement` or the factory supplied by your transformation context instead. */ - const createSwitch: typeof factory.createSwitchStatement; - /** @deprecated Use `factory.updateSwitchStatement` or the factory supplied by your transformation context instead. */ - const updateSwitch: typeof factory.updateSwitchStatement; - /** @deprecated Use `factory.createLabelStatement` or the factory supplied by your transformation context instead. */ - const createLabel: typeof factory.createLabeledStatement; - /** @deprecated Use `factory.updateLabelStatement` or the factory supplied by your transformation context instead. */ - const updateLabel: typeof factory.updateLabeledStatement; - /** @deprecated Use `factory.createThrowStatement` or the factory supplied by your transformation context instead. */ - const createThrow: typeof factory.createThrowStatement; - /** @deprecated Use `factory.updateThrowStatement` or the factory supplied by your transformation context instead. */ - const updateThrow: typeof factory.updateThrowStatement; - /** @deprecated Use `factory.createTryStatement` or the factory supplied by your transformation context instead. */ - const createTry: typeof factory.createTryStatement; - /** @deprecated Use `factory.updateTryStatement` or the factory supplied by your transformation context instead. */ - const updateTry: typeof factory.updateTryStatement; - /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */ - const createDebuggerStatement: typeof factory.createDebuggerStatement; - /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */ - const createVariableDeclarationList: typeof factory.createVariableDeclarationList; - /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */ - const updateVariableDeclarationList: typeof factory.updateVariableDeclarationList; - /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */ - const createFunctionDeclaration: typeof factory.createFunctionDeclaration; - /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */ - const updateFunctionDeclaration: typeof factory.updateFunctionDeclaration; - /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */ - const createClassDeclaration: typeof factory.createClassDeclaration; - /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */ - const updateClassDeclaration: typeof factory.updateClassDeclaration; - /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */ - const createInterfaceDeclaration: typeof factory.createInterfaceDeclaration; - /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */ - const updateInterfaceDeclaration: typeof factory.updateInterfaceDeclaration; - /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */ - const createTypeAliasDeclaration: typeof factory.createTypeAliasDeclaration; - /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */ - const updateTypeAliasDeclaration: typeof factory.updateTypeAliasDeclaration; - /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */ - const createEnumDeclaration: typeof factory.createEnumDeclaration; - /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */ - const updateEnumDeclaration: typeof factory.updateEnumDeclaration; - /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */ - const createModuleDeclaration: typeof factory.createModuleDeclaration; - /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */ - const updateModuleDeclaration: typeof factory.updateModuleDeclaration; - /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */ - const createModuleBlock: typeof factory.createModuleBlock; - /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */ - const updateModuleBlock: typeof factory.updateModuleBlock; - /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */ - const createCaseBlock: typeof factory.createCaseBlock; - /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */ - const updateCaseBlock: typeof factory.updateCaseBlock; - /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */ - const createNamespaceExportDeclaration: typeof factory.createNamespaceExportDeclaration; - /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */ - const updateNamespaceExportDeclaration: typeof factory.updateNamespaceExportDeclaration; - /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */ - const createImportEqualsDeclaration: typeof factory.createImportEqualsDeclaration; - /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */ - const updateImportEqualsDeclaration: typeof factory.updateImportEqualsDeclaration; - /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */ - const createImportDeclaration: typeof factory.createImportDeclaration; - /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */ - const updateImportDeclaration: typeof factory.updateImportDeclaration; - /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */ - const createNamespaceImport: typeof factory.createNamespaceImport; - /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */ - const updateNamespaceImport: typeof factory.updateNamespaceImport; - /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */ - const createNamedImports: typeof factory.createNamedImports; - /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */ - const updateNamedImports: typeof factory.updateNamedImports; - /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */ - const createImportSpecifier: typeof factory.createImportSpecifier; - /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */ - const updateImportSpecifier: typeof factory.updateImportSpecifier; - /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */ - const createExportAssignment: typeof factory.createExportAssignment; - /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */ - const updateExportAssignment: typeof factory.updateExportAssignment; - /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */ - const createNamedExports: typeof factory.createNamedExports; - /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */ - const updateNamedExports: typeof factory.updateNamedExports; - /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */ - const createExportSpecifier: typeof factory.createExportSpecifier; - /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */ - const updateExportSpecifier: typeof factory.updateExportSpecifier; - /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */ - const createExternalModuleReference: typeof factory.createExternalModuleReference; - /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */ - const updateExternalModuleReference: typeof factory.updateExternalModuleReference; - /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */ - const createJSDocTypeExpression: typeof factory.createJSDocTypeExpression; - /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */ - const createJSDocTypeTag: typeof factory.createJSDocTypeTag; - /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */ - const createJSDocReturnTag: typeof factory.createJSDocReturnTag; - /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */ - const createJSDocThisTag: typeof factory.createJSDocThisTag; - /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */ - const createJSDocComment: typeof factory.createJSDocComment; - /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */ - const createJSDocParameterTag: typeof factory.createJSDocParameterTag; - /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */ - const createJSDocClassTag: typeof factory.createJSDocClassTag; - /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */ - const createJSDocAugmentsTag: typeof factory.createJSDocAugmentsTag; - /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */ - const createJSDocEnumTag: typeof factory.createJSDocEnumTag; - /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */ - const createJSDocTemplateTag: typeof factory.createJSDocTemplateTag; - /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */ - const createJSDocTypedefTag: typeof factory.createJSDocTypedefTag; - /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */ - const createJSDocCallbackTag: typeof factory.createJSDocCallbackTag; - /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */ - const createJSDocSignature: typeof factory.createJSDocSignature; - /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */ - const createJSDocPropertyTag: typeof factory.createJSDocPropertyTag; - /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */ - const createJSDocTypeLiteral: typeof factory.createJSDocTypeLiteral; - /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */ - const createJSDocImplementsTag: typeof factory.createJSDocImplementsTag; - /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */ - const createJSDocAuthorTag: typeof factory.createJSDocAuthorTag; - /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */ - const createJSDocPublicTag: typeof factory.createJSDocPublicTag; - /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */ - const createJSDocPrivateTag: typeof factory.createJSDocPrivateTag; - /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */ - const createJSDocProtectedTag: typeof factory.createJSDocProtectedTag; - /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */ - const createJSDocReadonlyTag: typeof factory.createJSDocReadonlyTag; - /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */ - const createJSDocTag: typeof factory.createJSDocUnknownTag; - /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */ - const createJsxElement: typeof factory.createJsxElement; - /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */ - const updateJsxElement: typeof factory.updateJsxElement; - /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */ - const createJsxSelfClosingElement: typeof factory.createJsxSelfClosingElement; - /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */ - const updateJsxSelfClosingElement: typeof factory.updateJsxSelfClosingElement; - /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */ - const createJsxOpeningElement: typeof factory.createJsxOpeningElement; - /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */ - const updateJsxOpeningElement: typeof factory.updateJsxOpeningElement; - /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */ - const createJsxClosingElement: typeof factory.createJsxClosingElement; - /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */ - const updateJsxClosingElement: typeof factory.updateJsxClosingElement; - /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */ - const createJsxFragment: typeof factory.createJsxFragment; - /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */ - const createJsxText: typeof factory.createJsxText; - /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */ - const updateJsxText: typeof factory.updateJsxText; - /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */ - const createJsxOpeningFragment: typeof factory.createJsxOpeningFragment; - /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */ - const createJsxJsxClosingFragment: typeof factory.createJsxJsxClosingFragment; - /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ - const updateJsxFragment: typeof factory.updateJsxFragment; - /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ - const createJsxAttribute: typeof factory.createJsxAttribute; - /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxAttribute: typeof factory.updateJsxAttribute; - /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ - const createJsxAttributes: typeof factory.createJsxAttributes; - /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ - const updateJsxAttributes: typeof factory.updateJsxAttributes; - /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */ - const createJsxSpreadAttribute: typeof factory.createJsxSpreadAttribute; - /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxSpreadAttribute: typeof factory.updateJsxSpreadAttribute; - /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */ - const createJsxExpression: typeof factory.createJsxExpression; - /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */ - const updateJsxExpression: typeof factory.updateJsxExpression; - /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */ - const createCaseClause: typeof factory.createCaseClause; - /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */ - const updateCaseClause: typeof factory.updateCaseClause; - /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */ - const createDefaultClause: typeof factory.createDefaultClause; - /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */ - const updateDefaultClause: typeof factory.updateDefaultClause; - /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */ - const createHeritageClause: typeof factory.createHeritageClause; - /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */ - const updateHeritageClause: typeof factory.updateHeritageClause; - /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */ - const createCatchClause: typeof factory.createCatchClause; - /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */ - const updateCatchClause: typeof factory.updateCatchClause; - /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */ - const createPropertyAssignment: typeof factory.createPropertyAssignment; - /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */ - const updatePropertyAssignment: typeof factory.updatePropertyAssignment; - /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */ - const createShorthandPropertyAssignment: typeof factory.createShorthandPropertyAssignment; - /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */ - const updateShorthandPropertyAssignment: typeof factory.updateShorthandPropertyAssignment; - /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */ - const createSpreadAssignment: typeof factory.createSpreadAssignment; - /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */ - const updateSpreadAssignment: typeof factory.updateSpreadAssignment; - /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */ - const createEnumMember: typeof factory.createEnumMember; - /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */ - const updateEnumMember: typeof factory.updateEnumMember; - /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */ - const updateSourceFileNode: typeof factory.updateSourceFile; - /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */ - const createNotEmittedStatement: typeof factory.createNotEmittedStatement; - /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */ - const createPartiallyEmittedExpression: typeof factory.createPartiallyEmittedExpression; - /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */ - const updatePartiallyEmittedExpression: typeof factory.updatePartiallyEmittedExpression; - /** @deprecated Use `factory.createCommaListExpression` or the factory supplied by your transformation context instead. */ - const createCommaList: typeof factory.createCommaListExpression; - /** @deprecated Use `factory.updateCommaListExpression` or the factory supplied by your transformation context instead. */ - const updateCommaList: typeof factory.updateCommaListExpression; - /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */ - const createBundle: typeof factory.createBundle; - /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */ - const updateBundle: typeof factory.updateBundle; - /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */ - const createImmediatelyInvokedFunctionExpression: typeof factory.createImmediatelyInvokedFunctionExpression; - /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */ - const createImmediatelyInvokedArrowFunction: typeof factory.createImmediatelyInvokedArrowFunction; - /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */ - const createVoidZero: typeof factory.createVoidZero; - /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */ - const createExportDefault: typeof factory.createExportDefault; - /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */ - const createExternalModuleExport: typeof factory.createExternalModuleExport; - /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */ - const createNamespaceExport: typeof factory.createNamespaceExport; - /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */ - const updateNamespaceExport: typeof factory.updateNamespaceExport; - /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */ - const createToken: (kind: TKind) => Token; - /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */ - const createIdentifier: (text: string) => Identifier; - /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */ - const createTempVariable: (recordTempVariable: ((node: Identifier) => void) | undefined) => Identifier; - /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */ - const getGeneratedNameForNode: (node: Node | undefined) => Identifier; - /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */ - const createOptimisticUniqueName: (text: string) => Identifier; - /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */ - const createFileLevelUniqueName: (text: string) => Identifier; - /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */ - const createIndexSignature: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration; - /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */ - const createTypePredicateNode: (parameterName: Identifier | ThisTypeNode | string, type: TypeNode) => TypePredicateNode; - /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */ - const updateTypePredicateNode: (node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode) => TypePredicateNode; - /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */ - const createLiteral: { - (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral; - (value: number | PseudoBigInt): NumericLiteral; - (value: boolean): BooleanLiteral; - (value: string | number | PseudoBigInt | boolean): PrimaryExpression; - }; - /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */ - const createMethodSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined) => MethodSignature; - /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */ - const updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined) => MethodSignature; - /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */ - const createTypeOperatorNode: { - (type: TypeNode): TypeOperatorNode; - (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; - }; - /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */ - const createTaggedTemplate: { - (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; - (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; - }; - /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */ - const updateTaggedTemplate: { - (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; - (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; - }; - /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */ - const updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken) => BinaryExpression; - /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */ - const createConditional: { - (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; - (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; - }; - /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */ - const createYield: { - (expression?: Expression | undefined): YieldExpression; - (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression; - }; - /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */ - const createClassExpression: (modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression; - /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */ - const updateClassExpression: (node: ClassExpression, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression; - /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */ - const createPropertySignature: (modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer?: Expression | undefined) => PropertySignature; - /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */ - const updatePropertySignature: (node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertySignature; - /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */ - const createExpressionWithTypeArguments: (typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments; - /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */ - const updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments; - /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */ - const createArrowFunction: { - (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; - (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; - }; - /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */ - const updateArrowFunction: { - (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction; - (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; - }; - /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */ - const createVariableDeclaration: { - (name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration; - (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; - }; - /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */ - const updateVariableDeclaration: { - (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; - (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; - }; - /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */ - const createImportClause: (name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly?: any) => ImportClause; - /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */ - const updateImportClause: (node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) => ImportClause; - /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */ - const createExportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly?: any) => ExportDeclaration; - /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */ - const updateExportDeclaration: (node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, isTypeOnly: boolean) => ExportDeclaration; - /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */ - const createJSDocParamTag: (name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocParameterTag; - /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */ - const createComma: (left: Expression, right: Expression) => Expression; - /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */ - const createLessThan: (left: Expression, right: Expression) => Expression; - /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */ - const createAssignment: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */ - const createStrictEquality: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */ - const createStrictInequality: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */ - const createAdd: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */ - const createSubtract: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */ - const createLogicalAnd: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */ - const createLogicalOr: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */ - const createPostfixIncrement: (operand: Expression) => PostfixUnaryExpression; - /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */ - const createLogicalNot: (operand: Expression) => PrefixUnaryExpression; - /** @deprecated Use an appropriate `factory` method instead. */ - const createNode: (kind: SyntaxKind, pos?: any, end?: any) => Node; - /** - * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set. - * - * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be - * captured with respect to transformations. - * - * @deprecated Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`. - */ - const getMutableClone: (node: T) => T; - /** @deprecated Use `isTypeAssertionExpression` instead. */ - const isTypeAssertion: (node: Node) => node is TypeAssertion; - /** - * @deprecated Use `isMemberName` instead. - */ - const isIdentifierOrPrivateIdentifier: (node: Node) => node is MemberName; } export = ts; \ No newline at end of file diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 588b8663537a6..11d554ba63f83 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -42,7 +42,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = `${versionMajorMinor}.0-dev.20230112`; + version = `${versionMajorMinor}.0-beta`; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -590,25 +590,20 @@ var ts = (() => { } return true; } - function detectSortCaseSensitivity(array, useEslintOrdering, getString) { + function detectSortCaseSensitivity(array, getString, compareStringsCaseSensitive2, compareStringsCaseInsensitive2) { let kind = 3 /* Both */; if (array.length < 2) return kind; - const caseSensitiveComparer = getString ? (a, b) => compareStringsCaseSensitive(getString(a), getString(b)) : compareStringsCaseSensitive; - const compareCaseInsensitive = useEslintOrdering ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseInsensitive; - const caseInsensitiveComparer = getString ? (a, b) => compareCaseInsensitive(getString(a), getString(b)) : compareCaseInsensitive; - for (let i = 1, len = array.length; i < len; i++) { - const prevElement = array[i - 1]; - const element = array[i]; - if (kind & 1 /* CaseSensitive */ && caseSensitiveComparer(prevElement, element) === 1 /* GreaterThan */) { + let prevElement = getString(array[0]); + for (let i = 1, len = array.length; i < len && kind !== 0 /* None */; i++) { + const element = getString(array[i]); + if (kind & 1 /* CaseSensitive */ && compareStringsCaseSensitive2(prevElement, element) > 0) { kind &= ~1 /* CaseSensitive */; } - if (kind & 2 /* CaseInsensitive */ && caseInsensitiveComparer(prevElement, element) === 1 /* GreaterThan */) { + if (kind & 2 /* CaseInsensitive */ && compareStringsCaseInsensitive2(prevElement, element) > 0) { kind &= ~2 /* CaseInsensitive */; } - if (kind === 0 /* None */) { - return kind; - } + prevElement = element; } return kind; } @@ -943,6 +938,18 @@ var ts = (() => { function group(values, getGroupId, resultSelector = identity) { return arrayFrom(arrayToMultiMap(values, getGroupId).values(), resultSelector); } + function groupBy(values, keySelector) { + var _a2; + const result = {}; + if (values) { + for (const value of values) { + const key = `${keySelector(value)}`; + const array = (_a2 = result[key]) != null ? _a2 : result[key] = []; + array.push(value); + } + } + return result; + } function clone(object) { const result = {}; for (const id in object) { @@ -1229,6 +1236,35 @@ var ts = (() => { return value; }; } + function memoizeCached(callback, cache) { + return (...args) => { + let value = cache.get(args); + if (value === void 0 && !cache.has(args)) { + value = callback(...args); + cache.set(args, value); + } + return value; + }; + } + function compose(a, b, c, d, e) { + if (!!e) { + const args = []; + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + return (t) => reduceLeft(args, (u, f) => f(u), t); + } else if (d) { + return (t) => d(c(b(a(t)))); + } else if (c) { + return (t) => c(b(a(t))); + } else if (b) { + return (t) => b(a(t)); + } else if (a) { + return (t) => a(t); + } else { + return (t) => t; + } + } function equateValues(a, b) { return a === b; } @@ -1565,12 +1601,24 @@ var ts = (() => { return length2 <= s.length ? s : s + padString.repeat(length2 - s.length); } function takeWhile(array, predicate) { - const len = array.length; - let index = 0; - while (index < len && predicate(array[index])) { - index++; + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(0, index); + } + } + function skipWhile(array, predicate) { + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(index); } - return array.slice(0, index); } function trimEndImpl(s) { let end = s.length - 1; @@ -3541,7 +3589,7 @@ ${lanes.join("\n")} const name = DiagnosticCategory[d.category]; return lowerCase ? name.toLowerCase() : name; } - var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, DeprecationVersion; + var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, DeprecationVersion; var init_types = __esm({ "src/compiler/types.ts"() { "use strict"; @@ -3900,14 +3948,15 @@ ${lanes.join("\n")} SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 350] = "JSDocSeeTag"; SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 351] = "JSDocPropertyTag"; SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 352] = "JSDocThrowsTag"; - SyntaxKind5[SyntaxKind5["SyntaxList"] = 353] = "SyntaxList"; - SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 354] = "NotEmittedStatement"; - SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression"; - SyntaxKind5[SyntaxKind5["CommaListExpression"] = 356] = "CommaListExpression"; - SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 357] = "MergeDeclarationMarker"; - SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 358] = "EndOfDeclarationMarker"; - SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 359] = "SyntheticReferenceExpression"; - SyntaxKind5[SyntaxKind5["Count"] = 360] = "Count"; + SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag"; + SyntaxKind5[SyntaxKind5["SyntaxList"] = 354] = "SyntaxList"; + SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 355] = "NotEmittedStatement"; + SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression"; + SyntaxKind5[SyntaxKind5["CommaListExpression"] = 357] = "CommaListExpression"; + SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker"; + SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker"; + SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression"; + SyntaxKind5[SyntaxKind5["Count"] = 361] = "Count"; SyntaxKind5[SyntaxKind5["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment"; SyntaxKind5[SyntaxKind5["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment"; SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment"; @@ -3936,51 +3985,53 @@ ${lanes.join("\n")} SyntaxKind5[SyntaxKind5["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement"; SyntaxKind5[SyntaxKind5["FirstNode"] = 163 /* QualifiedName */] = "FirstNode"; SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocNode"; + SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocNode"; SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocTagNode"; + SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocTagNode"; SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword"; SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword"; return SyntaxKind5; })(SyntaxKind || {}); - NodeFlags = /* @__PURE__ */ ((NodeFlags4) => { - NodeFlags4[NodeFlags4["None"] = 0] = "None"; - NodeFlags4[NodeFlags4["Let"] = 1] = "Let"; - NodeFlags4[NodeFlags4["Const"] = 2] = "Const"; - NodeFlags4[NodeFlags4["NestedNamespace"] = 4] = "NestedNamespace"; - NodeFlags4[NodeFlags4["Synthesized"] = 8] = "Synthesized"; - NodeFlags4[NodeFlags4["Namespace"] = 16] = "Namespace"; - NodeFlags4[NodeFlags4["OptionalChain"] = 32] = "OptionalChain"; - NodeFlags4[NodeFlags4["ExportContext"] = 64] = "ExportContext"; - NodeFlags4[NodeFlags4["ContainsThis"] = 128] = "ContainsThis"; - NodeFlags4[NodeFlags4["HasImplicitReturn"] = 256] = "HasImplicitReturn"; - NodeFlags4[NodeFlags4["HasExplicitReturn"] = 512] = "HasExplicitReturn"; - NodeFlags4[NodeFlags4["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; - NodeFlags4[NodeFlags4["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; - NodeFlags4[NodeFlags4["DisallowInContext"] = 4096] = "DisallowInContext"; - NodeFlags4[NodeFlags4["YieldContext"] = 8192] = "YieldContext"; - NodeFlags4[NodeFlags4["DecoratorContext"] = 16384] = "DecoratorContext"; - NodeFlags4[NodeFlags4["AwaitContext"] = 32768] = "AwaitContext"; - NodeFlags4[NodeFlags4["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; - NodeFlags4[NodeFlags4["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; - NodeFlags4[NodeFlags4["JavaScriptFile"] = 262144] = "JavaScriptFile"; - NodeFlags4[NodeFlags4["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; - NodeFlags4[NodeFlags4["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; - NodeFlags4[NodeFlags4["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; - NodeFlags4[NodeFlags4["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; - NodeFlags4[NodeFlags4["JSDoc"] = 8388608] = "JSDoc"; - NodeFlags4[NodeFlags4["Ambient"] = 16777216] = "Ambient"; - NodeFlags4[NodeFlags4["InWithStatement"] = 33554432] = "InWithStatement"; - NodeFlags4[NodeFlags4["JsonFile"] = 67108864] = "JsonFile"; - NodeFlags4[NodeFlags4["TypeCached"] = 134217728] = "TypeCached"; - NodeFlags4[NodeFlags4["Deprecated"] = 268435456] = "Deprecated"; - NodeFlags4[NodeFlags4["BlockScoped"] = 3] = "BlockScoped"; - NodeFlags4[NodeFlags4["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; - NodeFlags4[NodeFlags4["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; - NodeFlags4[NodeFlags4["ContextFlags"] = 50720768] = "ContextFlags"; - NodeFlags4[NodeFlags4["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; - NodeFlags4[NodeFlags4["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; - return NodeFlags4; + NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { + NodeFlags3[NodeFlags3["None"] = 0] = "None"; + NodeFlags3[NodeFlags3["Let"] = 1] = "Let"; + NodeFlags3[NodeFlags3["Const"] = 2] = "Const"; + NodeFlags3[NodeFlags3["NestedNamespace"] = 4] = "NestedNamespace"; + NodeFlags3[NodeFlags3["Synthesized"] = 8] = "Synthesized"; + NodeFlags3[NodeFlags3["Namespace"] = 16] = "Namespace"; + NodeFlags3[NodeFlags3["OptionalChain"] = 32] = "OptionalChain"; + NodeFlags3[NodeFlags3["ExportContext"] = 64] = "ExportContext"; + NodeFlags3[NodeFlags3["ContainsThis"] = 128] = "ContainsThis"; + NodeFlags3[NodeFlags3["HasImplicitReturn"] = 256] = "HasImplicitReturn"; + NodeFlags3[NodeFlags3["HasExplicitReturn"] = 512] = "HasExplicitReturn"; + NodeFlags3[NodeFlags3["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; + NodeFlags3[NodeFlags3["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; + NodeFlags3[NodeFlags3["DisallowInContext"] = 4096] = "DisallowInContext"; + NodeFlags3[NodeFlags3["YieldContext"] = 8192] = "YieldContext"; + NodeFlags3[NodeFlags3["DecoratorContext"] = 16384] = "DecoratorContext"; + NodeFlags3[NodeFlags3["AwaitContext"] = 32768] = "AwaitContext"; + NodeFlags3[NodeFlags3["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; + NodeFlags3[NodeFlags3["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; + NodeFlags3[NodeFlags3["JavaScriptFile"] = 262144] = "JavaScriptFile"; + NodeFlags3[NodeFlags3["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags3[NodeFlags3["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; + NodeFlags3[NodeFlags3["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; + NodeFlags3[NodeFlags3["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; + NodeFlags3[NodeFlags3["JSDoc"] = 8388608] = "JSDoc"; + NodeFlags3[NodeFlags3["Ambient"] = 16777216] = "Ambient"; + NodeFlags3[NodeFlags3["InWithStatement"] = 33554432] = "InWithStatement"; + NodeFlags3[NodeFlags3["JsonFile"] = 67108864] = "JsonFile"; + NodeFlags3[NodeFlags3["TypeCached"] = 134217728] = "TypeCached"; + NodeFlags3[NodeFlags3["Deprecated"] = 268435456] = "Deprecated"; + NodeFlags3[NodeFlags3["BlockScoped"] = 3] = "BlockScoped"; + NodeFlags3[NodeFlags3["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; + NodeFlags3[NodeFlags3["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; + NodeFlags3[NodeFlags3["ContextFlags"] = 50720768] = "ContextFlags"; + NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; + NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; + NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape"; + NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace"; + return NodeFlags3; })(NodeFlags || {}); ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { ModifierFlags3[ModifierFlags3["None"] = 0] = "None"; @@ -4120,7 +4171,6 @@ ${lanes.join("\n")} ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; ExitStatus2[ExitStatus2["InvalidProject_OutputsSkipped"] = 3] = "InvalidProject_OutputsSkipped"; ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkipped"] = 4] = "ProjectReferenceCycle_OutputsSkipped"; - ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkupped"] = 4] = "ProjectReferenceCycle_OutputsSkupped"; return ExitStatus2; })(ExitStatus || {}); MemberOverrideStatus = /* @__PURE__ */ ((MemberOverrideStatus2) => { @@ -4165,7 +4215,6 @@ ${lanes.join("\n")} NodeBuilderFlags2[NodeBuilderFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; NodeBuilderFlags2[NodeBuilderFlags2["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifiedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifiedNameInPlaceOfIdentifier"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifedNameInPlaceOfIdentifier"] = 65536 /* AllowQualifiedNameInPlaceOfIdentifier */] = "AllowQualifedNameInPlaceOfIdentifier"; NodeBuilderFlags2[NodeBuilderFlags2["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; @@ -4203,7 +4252,6 @@ ${lanes.join("\n")} TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType"; TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; - TypeFormatFlags2[TypeFormatFlags2["WriteOwnNameForAnyLike"] = 0] = "WriteOwnNameForAnyLike"; TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330091] = "NodeBuilderFlagsMask"; return TypeFormatFlags2; })(TypeFormatFlags || {}); @@ -4995,18 +5043,24 @@ ${lanes.join("\n")} EmitFlags3[EmitFlags3["HasEndOfDeclarationMarker"] = 8388608] = "HasEndOfDeclarationMarker"; EmitFlags3[EmitFlags3["Iterator"] = 16777216] = "Iterator"; EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 33554432] = "NoAsciiEscaping"; - EmitFlags3[EmitFlags3["TypeScriptClassWrapper"] = 67108864] = "TypeScriptClassWrapper"; - EmitFlags3[EmitFlags3["NeverApplyImportHelper"] = 134217728] = "NeverApplyImportHelper"; - EmitFlags3[EmitFlags3["IgnoreSourceNewlines"] = 268435456] = "IgnoreSourceNewlines"; - EmitFlags3[EmitFlags3["Immutable"] = 536870912] = "Immutable"; - EmitFlags3[EmitFlags3["IndirectCall"] = 1073741824] = "IndirectCall"; return EmitFlags3; })(EmitFlags || {}); + InternalEmitFlags = /* @__PURE__ */ ((InternalEmitFlags3) => { + InternalEmitFlags3[InternalEmitFlags3["None"] = 0] = "None"; + InternalEmitFlags3[InternalEmitFlags3["TypeScriptClassWrapper"] = 1] = "TypeScriptClassWrapper"; + InternalEmitFlags3[InternalEmitFlags3["NeverApplyImportHelper"] = 2] = "NeverApplyImportHelper"; + InternalEmitFlags3[InternalEmitFlags3["IgnoreSourceNewlines"] = 4] = "IgnoreSourceNewlines"; + InternalEmitFlags3[InternalEmitFlags3["Immutable"] = 8] = "Immutable"; + InternalEmitFlags3[InternalEmitFlags3["IndirectCall"] = 16] = "IndirectCall"; + InternalEmitFlags3[InternalEmitFlags3["TransformPrivateStaticElements"] = 32] = "TransformPrivateStaticElements"; + return InternalEmitFlags3; + })(InternalEmitFlags || {}); ExternalEmitHelpers = /* @__PURE__ */ ((ExternalEmitHelpers2) => { ExternalEmitHelpers2[ExternalEmitHelpers2["Extends"] = 1] = "Extends"; ExternalEmitHelpers2[ExternalEmitHelpers2["Assign"] = 2] = "Assign"; ExternalEmitHelpers2[ExternalEmitHelpers2["Rest"] = 4] = "Rest"; ExternalEmitHelpers2[ExternalEmitHelpers2["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ESDecorateAndRunInitializers"] = 8 /* Decorate */] = "ESDecorateAndRunInitializers"; ExternalEmitHelpers2[ExternalEmitHelpers2["Metadata"] = 16] = "Metadata"; ExternalEmitHelpers2[ExternalEmitHelpers2["Param"] = 32] = "Param"; ExternalEmitHelpers2[ExternalEmitHelpers2["Awaiter"] = 64] = "Awaiter"; @@ -5026,8 +5080,10 @@ ${lanes.join("\n")} ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldSet"] = 1048576] = "ClassPrivateFieldSet"; ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldIn"] = 2097152] = "ClassPrivateFieldIn"; ExternalEmitHelpers2[ExternalEmitHelpers2["CreateBinding"] = 4194304] = "CreateBinding"; + ExternalEmitHelpers2[ExternalEmitHelpers2["SetFunctionName"] = 8388608] = "SetFunctionName"; + ExternalEmitHelpers2[ExternalEmitHelpers2["PropKey"] = 16777216] = "PropKey"; ExternalEmitHelpers2[ExternalEmitHelpers2["FirstEmitHelper"] = 1 /* Extends */] = "FirstEmitHelper"; - ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 4194304 /* CreateBinding */] = "LastEmitHelper"; + ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 16777216 /* PropKey */] = "LastEmitHelper"; ExternalEmitHelpers2[ExternalEmitHelpers2["ForOfIncludes"] = 256 /* Values */] = "ForOfIncludes"; ExternalEmitHelpers2[ExternalEmitHelpers2["ForAwaitOfIncludes"] = 16384 /* AsyncValues */] = "ForAwaitOfIncludes"; ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; @@ -7176,10 +7232,9 @@ ${lanes.join("\n")} Line_terminator_not_permitted_before_arrow: diag(1200, 1 /* Error */, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, 1 /* Error */, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, 1 /* Error */, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), - Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), + Re_exporting_a_type_when_0_is_enabled_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205", "Re-exporting a type when '{0}' is enabled requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, 1 /* Error */, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, 1 /* Error */, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, 1 /* Error */, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, 1 /* Error */, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, 1 /* Error */, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, 1 /* Error */, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), @@ -7189,7 +7244,6 @@ ${lanes.join("\n")} Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, 1 /* Error */, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, 1 /* Error */, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, 1 /* Error */, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, 1 /* Error */, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."), Generators_are_not_allowed_in_an_ambient_context: diag(1221, 1 /* Error */, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, 1 /* Error */, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), _0_tag_already_specified: diag(1223, 1 /* Error */, "_0_tag_already_specified_1223", "'{0}' tag already specified."), @@ -7236,7 +7290,7 @@ ${lanes.join("\n")} An_optional_element_cannot_follow_a_rest_element: diag(1266, 1 /* Error */, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, 1 /* Error */, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, 1 /* Error */, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), - Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."), + Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269", "Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."), Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, 1 /* Error */, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, 1 /* Error */, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, 1 /* Error */, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), @@ -7245,6 +7299,17 @@ ${lanes.join("\n")} accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1 /* Error */, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), An_accessor_property_cannot_be_declared_optional: diag(1276, 1 /* Error */, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), _0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: diag(1277, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0: diag(1278, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278", "The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0: diag(1279, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279", "The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."), + Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement: diag(1280, 1 /* Error */, "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280", "Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."), + Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead: diag(1281, 1 /* Error */, "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281", "Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."), + An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1282, 1 /* Error */, "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282", "An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), @@ -7316,7 +7381,6 @@ ${lanes.join("\n")} An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), - Only_named_exports_may_use_export_type: diag(1383, 1 /* Error */, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."), Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), @@ -7364,7 +7428,7 @@ ${lanes.join("\n")} The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."), - Decorators_may_not_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."), + Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."), Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, 1 /* Error */, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), @@ -7377,7 +7441,7 @@ ${lanes.join("\n")} Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, 1 /* Error */, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), - _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."), Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"), Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"), @@ -7405,6 +7469,8 @@ ${lanes.join("\n")} To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), + _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -7862,7 +7928,7 @@ ${lanes.join("\n")} This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1 /* Error */, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), - Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), + Cannot_access_ambient_const_enums_when_0_is_enabled: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."), _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1 /* Error */, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, 1 /* Error */, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), @@ -8110,12 +8176,12 @@ ${lanes.join("\n")} The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, 1 /* Error */, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, 1 /* Error */, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, 1 /* Error */, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), - Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."), + Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."), The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), - Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_eithe_5096", "Option 'allowImportingTsExtensions' can only be used when 'moduleResolution' is set to 'bundler' and either 'noEmit' or 'emitDeclarationOnly' is set."), + Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), @@ -8123,6 +8189,9 @@ ${lanes.join("\n")} Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), + Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), + Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), + Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8405,6 +8474,8 @@ ${lanes.join("\n")} package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."), + Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."), + There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`), Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), @@ -8529,7 +8600,7 @@ ${lanes.join("\n")} Filters_results_from_the_include_option: diag(6627, 3 /* Message */, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), Remove_a_list_of_directories_from_the_watch_process: diag(6628, 3 /* Message */, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, 3 /* Message */, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), - Enable_experimental_support_for_TC39_stage_2_draft_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630", "Enable experimental support for TC39 stage 2 draft decorators."), + Enable_experimental_support_for_legacy_experimental_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_legacy_experimental_decorators_6630", "Enable experimental support for legacy experimental decorators."), Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, 3 /* Message */, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), Output_more_detailed_compiler_performance_information_after_building: diag(6632, 3 /* Message */, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, 3 /* Message */, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), @@ -8615,6 +8686,7 @@ ${lanes.join("\n")} Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), + Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."), one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"), one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"), type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"), @@ -8750,6 +8822,7 @@ ${lanes.join("\n")} You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), + Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -9035,7 +9108,8 @@ ${lanes.join("\n")} _0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), _0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), - The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here.") + The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."), + Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.") }; } }); @@ -9488,10 +9562,7 @@ ${lanes.join("\n")} initial ); } - function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) { - if (!comments) { - comments = []; - } + function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments = []) { comments.push({ kind, pos, end, hasTrailingNewLine }); return comments; } @@ -11335,7 +11406,7 @@ ${lanes.join("\n")} } } function isParameterPropertyDeclaration(node, parent2) { - return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 173 /* Constructor */; + return isParameter(node) && hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 173 /* Constructor */; } function isEmptyBindingPattern(node) { if (isBindingPattern(node)) { @@ -11439,7 +11510,10 @@ ${lanes.join("\n")} node = node.original; } } - return !nodeTest || nodeTest(node) ? node : void 0; + if (!node || !nodeTest) { + return node; + } + return nodeTest(node) ? node : void 0; } function findAncestor(node, callback) { while (node) { @@ -11478,6 +11552,10 @@ ${lanes.join("\n")} function idText(identifierOrPrivateName) { return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); } + function identifierToKeywordKind(node) { + const token = stringToToken(node.escapedText); + return token ? tryCast(token, isKeyword) : void 0; + } function symbolName(symbol) { if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { return idText(symbol.valueDeclaration.name); @@ -11753,6 +11831,9 @@ ${lanes.join("\n")} function getJSDocTemplateTag(node) { return getFirstJSDocTag(node, isJSDocTemplateTag); } + function getJSDocSatisfiesTag(node) { + return getFirstJSDocTag(node, isJSDocSatisfiesTag); + } function getJSDocTypeTag(node) { const tag = getFirstJSDocTag(node, isJSDocTypeTag); if (tag && tag.typeExpression && tag.typeExpression.type) { @@ -11785,15 +11866,17 @@ ${lanes.join("\n")} } } function getJSDocTagsWorker(node, noCache) { + var _a2, _b; if (!canHaveJSDoc(node)) return emptyArray; - let tags = node.jsDocCache; + let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache; if (tags === void 0 || noCache) { const comments = getJSDocCommentsAndTags(node, noCache); Debug.assert(comments.length < 2 || comments[0] !== comments[1]); tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j); if (!noCache) { - node.jsDocCache = tags; + (_b = node.jsDoc) != null ? _b : node.jsDoc = []; + node.jsDoc.jsDocCache = tags; } } return tags; @@ -11971,19 +12054,31 @@ ${lanes.join("\n")} function isImportOrExportSpecifier(node) { return isImportSpecifier(node) || isExportSpecifier(node); } - function isTypeOnlyImportOrExportDeclaration(node) { + function isTypeOnlyImportDeclaration(node) { switch (node.kind) { case 273 /* ImportSpecifier */: - case 278 /* ExportSpecifier */: return node.isTypeOnly || node.parent.parent.isTypeOnly; case 271 /* NamespaceImport */: return node.parent.isTypeOnly; case 270 /* ImportClause */: case 268 /* ImportEqualsDeclaration */: return node.isTypeOnly; - default: - return false; } + return false; + } + function isTypeOnlyExportDeclaration(node) { + switch (node.kind) { + case 278 /* ExportSpecifier */: + return node.isTypeOnly || node.parent.parent.isTypeOnly; + case 275 /* ExportDeclaration */: + return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; + case 277 /* NamespaceExport */: + return node.parent.isTypeOnly; + } + return false; + } + function isTypeOnlyImportOrExportDeclaration(node) { + return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node); } function isAssertionKey(node) { return isStringLiteral(node) || isIdentifier(node); @@ -11992,10 +12087,12 @@ ${lanes.join("\n")} return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } function isGeneratedIdentifier(node) { - return isIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isGeneratedPrivateIdentifier(node) { - return isPrivateIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isPrivateIdentifierClassElementDeclaration(node) { return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name); @@ -12172,6 +12269,9 @@ ${lanes.join("\n")} } return false; } + function isBindingOrAssignmentElement(node) { + return isVariableDeclaration(node) || isParameter(node) || isObjectBindingOrAssignmentElement(node) || isArrayBindingOrAssignmentElement(node); + } function isBindingOrAssignmentPattern(node) { return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); } @@ -12201,6 +12301,24 @@ ${lanes.join("\n")} } return false; } + function isArrayBindingOrAssignmentElement(node) { + switch (node.kind) { + case 205 /* BindingElement */: + case 229 /* OmittedExpression */: + case 227 /* SpreadElement */: + case 206 /* ArrayLiteralExpression */: + case 207 /* ObjectLiteralExpression */: + case 79 /* Identifier */: + case 208 /* PropertyAccessExpression */: + case 209 /* ElementAccessExpression */: + return true; + } + return isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ); + } function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { const kind = node.kind; return kind === 208 /* PropertyAccessExpression */ || kind === 163 /* QualifiedName */ || kind === 202 /* ImportType */; @@ -12264,6 +12382,7 @@ ${lanes.join("\n")} case 230 /* ExpressionWithTypeArguments */: case 233 /* MetaProperty */: case 100 /* ImportKeyword */: + case 279 /* MissingDeclaration */: return true; default: return false; @@ -12296,6 +12415,17 @@ ${lanes.join("\n")} return false; } } + function isLiteralTypeLiteral(node) { + switch (node.kind) { + case 104 /* NullKeyword */: + case 110 /* TrueKeyword */: + case 95 /* FalseKeyword */: + case 221 /* PrefixUnaryExpression */: + return true; + default: + return isLiteralExpression(node); + } + } function isExpression(node) { return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); } @@ -12308,8 +12438,8 @@ ${lanes.join("\n")} case 227 /* SpreadElement */: case 231 /* AsExpression */: case 229 /* OmittedExpression */: - case 356 /* CommaListExpression */: - case 355 /* PartiallyEmittedExpression */: + case 357 /* CommaListExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: return true; default: @@ -12494,7 +12624,7 @@ ${lanes.join("\n")} return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 354 /* NotEmittedStatement */ || kind === 358 /* EndOfDeclarationMarker */ || kind === 357 /* MergeDeclarationMarker */; + return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 355 /* NotEmittedStatement */ || kind === 359 /* EndOfDeclarationMarker */ || kind === 358 /* MergeDeclarationMarker */; } function isDeclaration(node) { if (node.kind === 165 /* TypeParameter */) { @@ -12555,13 +12685,13 @@ ${lanes.join("\n")} return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */; } function isJSDocNode(node) { - return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */; + return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */; } function isJSDocCommentContainingNode(node) { return node.kind === 323 /* JSDoc */ || node.kind === 322 /* JSDocNamepathType */ || node.kind === 324 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } function isJSDocTag(node) { - return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 352 /* LastJSDocTagNode */; + return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */; } function isSetAccessor(node) { return node.kind === 175 /* SetAccessor */; @@ -12981,7 +13111,7 @@ ${lanes.join("\n")} if (includeJsDoc && hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 353 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return skipTrivia( @@ -13033,6 +13163,10 @@ ${lanes.join("\n")} const emitNode = node.emitNode; return emitNode && emitNode.flags || 0; } + function getInternalEmitFlags(node) { + const emitNode = node.emitNode; + return emitNode && emitNode.internalFlags || 0; + } function getScriptTargetFeatures() { return { es2015: { @@ -13282,6 +13416,7 @@ ${lanes.join("\n")} return false; } function isDeclarationWithTypeParameters(node) { + Debug.type(node); switch (node.kind) { case 341 /* JSDocCallbackTag */: case 349 /* JSDocTypedefTag */: @@ -13293,6 +13428,7 @@ ${lanes.join("\n")} } } function isDeclarationWithTypeParameterChildren(node) { + Debug.type(node); switch (node.kind) { case 176 /* CallSignature */: case 177 /* ConstructSignature */: @@ -13373,10 +13509,11 @@ ${lanes.join("\n")} return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } function tryGetTextOfPropertyName(name) { + var _a2; switch (name.kind) { case 79 /* Identifier */: case 80 /* PrivateIdentifier */: - return name.autoGenerate ? void 0 : name.escapedText; + return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: @@ -13425,11 +13562,14 @@ ${lanes.join("\n")} const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); } - function createDiagnosticForNodeFromMessageChain(node, messageChain, relatedInformation) { - const sourceFile = getSourceFileOfNode(node); + function createDiagnosticForNodeFromMessageChain(sourceFile, node, messageChain, relatedInformation) { const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation); } + function createDiagnosticForNodeArrayFromMessageChain(sourceFile, nodes, messageChain, relatedInformation) { + const start = skipTrivia(sourceFile.text, nodes.pos); + return createFileDiagnosticFromMessageChain(sourceFile, start, nodes.end - start, messageChain, relatedInformation); + } function assertDiagnosticLocation(file, start, length2) { Debug.assertGreaterThanOrEqual(start, 0); Debug.assertGreaterThanOrEqual(length2, 0); @@ -13494,6 +13634,20 @@ ${lanes.join("\n")} const start = scanner2.getTokenPos(); return createTextSpanFromBounds(start, scanner2.getTextPos()); } + function scanTokenAtPosition(sourceFile, pos) { + const scanner2 = createScanner( + sourceFile.languageVersion, + /*skipTrivia*/ + true, + sourceFile.languageVariant, + sourceFile.text, + /*onError:*/ + void 0, + pos + ); + scanner2.scan(); + return scanner2.getToken(); + } function getErrorSpanForArrowFunction(sourceFile, node) { const pos = skipTrivia(sourceFile.text, node.pos); if (node.body && node.body.kind === 238 /* Block */) { @@ -14082,47 +14236,90 @@ ${lanes.join("\n")} return node.expression; } } - function nodeCanBeDecorated(node, parent2, grandparent) { - if (isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { + function nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent) { + if (useLegacyDecorators && isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { return false; } switch (node.kind) { case 260 /* ClassDeclaration */: return true; + case 228 /* ClassExpression */: + return !useLegacyDecorators; case 169 /* PropertyDeclaration */: - return parent2.kind === 260 /* ClassDeclaration */; + return parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); case 174 /* GetAccessor */: case 175 /* SetAccessor */: case 171 /* MethodDeclaration */: - return node.body !== void 0 && parent2.kind === 260 /* ClassDeclaration */; + return node.body !== void 0 && parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2)); case 166 /* Parameter */: - return parent2.body !== void 0 && (parent2.kind === 173 /* Constructor */ || parent2.kind === 171 /* MethodDeclaration */ || parent2.kind === 175 /* SetAccessor */) && grandparent.kind === 260 /* ClassDeclaration */; + if (!useLegacyDecorators) + return false; + return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 173 /* Constructor */ || parent2.kind === 171 /* MethodDeclaration */ || parent2.kind === 175 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 260 /* ClassDeclaration */; } return false; } - function nodeIsDecorated(node, parent2, grandparent) { - return hasDecorators(node) && nodeCanBeDecorated(node, parent2, grandparent); + function nodeIsDecorated(useLegacyDecorators, node, parent2, grandparent) { + return hasDecorators(node) && nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent); } - function nodeOrChildIsDecorated(node, parent2, grandparent) { - return nodeIsDecorated(node, parent2, grandparent) || childIsDecorated(node, parent2); + function nodeOrChildIsDecorated(useLegacyDecorators, node, parent2, grandparent) { + return nodeIsDecorated(useLegacyDecorators, node, parent2, grandparent) || childIsDecorated(useLegacyDecorators, node, parent2); } - function childIsDecorated(node, parent2) { + function childIsDecorated(useLegacyDecorators, node, parent2) { switch (node.kind) { case 260 /* ClassDeclaration */: - return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2)); + return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); + case 228 /* ClassExpression */: + return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); case 171 /* MethodDeclaration */: case 175 /* SetAccessor */: case 173 /* Constructor */: - return some(node.parameters, (p) => nodeIsDecorated(p, node, parent2)); + return some(node.parameters, (p) => nodeIsDecorated(useLegacyDecorators, p, node, parent2)); default: return false; } } - function classOrConstructorParameterIsDecorated(node) { - if (nodeIsDecorated(node)) + function classOrConstructorParameterIsDecorated(useLegacyDecorators, node) { + if (nodeIsDecorated(useLegacyDecorators, node)) return true; const constructor = getFirstConstructorWithBody(node); - return !!constructor && childIsDecorated(constructor, node); + return !!constructor && childIsDecorated(useLegacyDecorators, constructor, node); + } + function classElementOrClassElementParameterIsDecorated(useLegacyDecorators, node, parent2) { + let parameters; + if (isAccessor(node)) { + const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(parent2.members, node); + const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0; + if (!firstAccessorWithDecorators || node !== firstAccessorWithDecorators) { + return false; + } + parameters = setAccessor == null ? void 0 : setAccessor.parameters; + } else if (isMethodDeclaration(node)) { + parameters = node.parameters; + } + if (nodeIsDecorated(useLegacyDecorators, node, parent2)) { + return true; + } + if (parameters) { + for (const parameter of parameters) { + if (parameterIsThisKeyword(parameter)) + continue; + if (nodeIsDecorated(useLegacyDecorators, parameter, node, parent2)) + return true; + } + } + return false; + } + function isEmptyStringLiteral(node) { + if (node.textSourceNode) { + switch (node.textSourceNode.kind) { + case 10 /* StringLiteral */: + return isEmptyStringLiteral(node.textSourceNode); + case 14 /* NoSubstitutionTemplateLiteral */: + return node.text === ""; + } + return false; + } + return node.text === ""; } function isJSXTagName(node) { const { parent: parent2 } = node; @@ -14319,6 +14516,9 @@ ${lanes.join("\n")} true ); } + function isBindingElementOfBareOrAccessedRequire(node) { + return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); + } function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) { return isVariableDeclaration(node) && !!node.initializer && isRequireCall( allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, @@ -14563,7 +14763,7 @@ ${lanes.join("\n")} } function setValueDeclaration(symbol, node) { const { valueDeclaration } = symbol; - if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { + if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !isInJSFile(node) && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { symbol.valueDeclaration = node; } } @@ -14578,6 +14778,7 @@ ${lanes.join("\n")} var _a2, _b; switch (node.kind) { case 257 /* VariableDeclaration */: + case 205 /* BindingElement */: return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall( node2, /*requireStringLiteralLikeArgument*/ @@ -14587,6 +14788,14 @@ ${lanes.join("\n")} return tryCast(node.moduleSpecifier, isStringLiteralLike); case 268 /* ImportEqualsDeclaration */: return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); + case 270 /* ImportClause */: + case 277 /* NamespaceExport */: + return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); + case 271 /* NamespaceImport */: + case 278 /* ExportSpecifier */: + return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); + case 273 /* ImportSpecifier */: + return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); default: Debug.assertNever(node); } @@ -14832,7 +15041,7 @@ ${lanes.join("\n")} return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0; } function ownsJSDocTag(hostNode, tag) { - return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; + return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; } function getNextJSDocCommentLocation(node) { const parent2 = node.parent; @@ -15176,7 +15385,8 @@ ${lanes.join("\n")} const token = stringToToken(name); return token !== void 0 && isKeyword(token); } - function isIdentifierANonContextualKeyword({ originalKeywordKind }) { + function isIdentifierANonContextualKeyword(node) { + const originalKeywordKind = identifierToKeywordKind(node); return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind); } function isTrivia(token) { @@ -15287,6 +15497,72 @@ ${lanes.join("\n")} function isESSymbolIdentifier(node) { return node.kind === 79 /* Identifier */ && node.escapedText === "Symbol"; } + function isProtoSetter(node) { + return isIdentifier(node) ? idText(node) === "__proto__" : isStringLiteral(node) && node.text === "__proto__"; + } + function isAnonymousFunctionDefinition(node, cb) { + node = skipOuterExpressions(node); + switch (node.kind) { + case 228 /* ClassExpression */: + case 215 /* FunctionExpression */: + if (node.name) { + return false; + } + break; + case 216 /* ArrowFunction */: + break; + default: + return false; + } + return typeof cb === "function" ? cb(node) : true; + } + function isNamedEvaluationSource(node) { + switch (node.kind) { + case 299 /* PropertyAssignment */: + return !isProtoSetter(node.name); + case 300 /* ShorthandPropertyAssignment */: + return !!node.objectAssignmentInitializer; + case 257 /* VariableDeclaration */: + return isIdentifier(node.name) && !!node.initializer; + case 166 /* Parameter */: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 205 /* BindingElement */: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 169 /* PropertyDeclaration */: + return !!node.initializer; + case 223 /* BinaryExpression */: + switch (node.operatorToken.kind) { + case 63 /* EqualsToken */: + case 76 /* AmpersandAmpersandEqualsToken */: + case 75 /* BarBarEqualsToken */: + case 77 /* QuestionQuestionEqualsToken */: + return isIdentifier(node.left); + } + break; + case 274 /* ExportAssignment */: + return true; + } + return false; + } + function isNamedEvaluation(node, cb) { + if (!isNamedEvaluationSource(node)) + return false; + switch (node.kind) { + case 299 /* PropertyAssignment */: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 300 /* ShorthandPropertyAssignment */: + return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); + case 257 /* VariableDeclaration */: + case 166 /* Parameter */: + case 205 /* BindingElement */: + case 169 /* PropertyDeclaration */: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 223 /* BinaryExpression */: + return isAnonymousFunctionDefinition(node.right, cb); + case 274 /* ExportAssignment */: + return isAnonymousFunctionDefinition(node.expression, cb); + } + } function isPushOrUnshiftIdentifier(node) { return node.escapedText === "push" || node.escapedText === "unshift"; } @@ -15367,7 +15643,7 @@ ${lanes.join("\n")} } function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return 0 /* Comma */; case 227 /* SpreadElement */: return 1 /* Spread */; @@ -15975,7 +16251,7 @@ ${lanes.join("\n")} return node.parent.kind === 183 /* TypeQuery */; } function identifierIsThisKeyword(id) { - return id.originalKeywordKind === 108 /* ThisKeyword */; + return id.escapedText === "this"; } function getAllAccessorDeclarations(declarations, accessor) { let firstAccessor; @@ -16286,7 +16562,7 @@ ${lanes.join("\n")} } function getSyntacticModifierFlagsNoCache(node) { let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */; - if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) { + if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { flags |= 1 /* Export */; } return flags; @@ -16337,14 +16613,23 @@ ${lanes.join("\n")} } return 0 /* None */; } + function isBinaryLogicalOperator(token) { + return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */; + } function isLogicalOperator(token) { - return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */ || token === 53 /* ExclamationToken */; + return isBinaryLogicalOperator(token) || token === 53 /* ExclamationToken */; } function isLogicalOrCoalescingAssignmentOperator(token) { return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */; } function isLogicalOrCoalescingAssignmentExpression(expr) { - return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); + return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); + } + function isLogicalOrCoalescingBinaryOperator(token) { + return isBinaryLogicalOperator(token) || token === 60 /* QuestionQuestionToken */; + } + function isLogicalOrCoalescingBinaryExpression(expr) { + return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind); } function isAssignmentOperator(token) { return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */; @@ -16581,14 +16866,14 @@ ${lanes.join("\n")} function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); } - function getNewLineCharacter(options, getNewLine) { + function getNewLineCharacter(options) { switch (options.newLine) { case 0 /* CarriageReturnLineFeed */: return carriageReturnLineFeed; case 1 /* LineFeed */: + case void 0: return lineFeed; } - return getNewLine ? getNewLine() : sys ? sys.newLine : carriageReturnLineFeed; } function createRange(pos, end = pos) { Debug.assert(end >= pos || end === -1); @@ -16605,6 +16890,9 @@ ${lanes.join("\n")} return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; } function moveRangePastModifiers(node) { + if (isPropertyDeclaration(node) || isMethodDeclaration(node)) { + return moveRangePos(node, node.name.pos); + } const lastModifier = canHaveModifiers(node) ? lastOrUndefined(node.modifiers) : void 0; return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); } @@ -16718,7 +17006,7 @@ ${lanes.join("\n")} return filter(node.declarations, isInitializedVariable); } function isInitializedVariable(node) { - return node.initializer !== void 0; + return isVariableDeclaration(node) && node.initializer !== void 0; } function isWatchSet(options) { return options.watch && hasProperty(options, "watch"); @@ -16899,7 +17187,7 @@ ${lanes.join("\n")} return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node); } function isTypeNodeKind(kind) { - return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; + return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 139 /* IntrinsicKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; } function isAccessExpression(node) { return node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */; @@ -16981,7 +17269,7 @@ ${lanes.join("\n")} case 209 /* ElementAccessExpression */: case 208 /* PropertyAccessExpression */: case 232 /* NonNullExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: node = node.expression; continue; @@ -17049,15 +17337,19 @@ ${lanes.join("\n")} this.parent = void 0; this.original = void 0; this.emitNode = void 0; - this.flowNode = void 0; } function SourceMapSource(fileName, text, skipTrivia2) { this.fileName = fileName; this.text = text; this.skipTrivia = skipTrivia2 || ((pos) => pos); } + function addObjectAllocatorPatcher(fn) { + objectAllocatorPatchers.push(fn); + fn(objectAllocator); + } function setObjectAllocator(alloc) { Object.assign(objectAllocator, alloc); + forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator)); } function formatStringFromArgs(text, args, baseIndex = 0) { return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index + baseIndex])); @@ -17343,6 +17635,12 @@ ${lanes.join("\n")} return false; } } + function getIsolatedModules(options) { + return !!(options.isolatedModules || options.verbatimModuleSyntax); + } + function importNameElisionDisabled(options) { + return options.verbatimModuleSyntax || options.isolatedModules && options.preserveValueImports; + } function unreachableCodeIsError(options) { return options.allowUnreachableCode === false; } @@ -18200,7 +18498,7 @@ ${lanes.join("\n")} return node.parent.templateSpans; case 167 /* Decorator */: { const { parent: parent4 } = node; - return canHaveDecorators(parent4) ? parent4.modifiers : canHaveIllegalDecorators(parent4) ? parent4.illegalDecorators : void 0; + return canHaveDecorators(parent4) ? parent4.modifiers : void 0; } case 294 /* HeritageClause */: return node.parent.heritageClauses; @@ -18218,7 +18516,7 @@ ${lanes.join("\n")} return parent2.types; case 186 /* TupleType */: case 206 /* ArrayLiteralExpression */: - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: case 272 /* NamedImports */: case 276 /* NamedExports */: return parent2.elements; @@ -18403,7 +18701,17 @@ ${lanes.join("\n")} const kind = node.kind; return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression); } - var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries; + function isJSDocSatisfiesExpression(node) { + return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); + } + function getJSDocSatisfiesExpressionType(node) { + return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node)); + } + function tryGetJSDocSatisfiesTypeNode(node) { + const tag = getJSDocSatisfiesTag(node); + return tag && tag.typeExpression && tag.typeExpression.type; + } + var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries; var init_utilities = __esm({ "src/compiler/utilities.ts"() { "use strict"; @@ -18524,6 +18832,7 @@ ${lanes.join("\n")} getSignatureConstructor: () => Signature2, getSourceMapSourceConstructor: () => SourceMapSource }; + objectAllocatorPatchers = []; reservedCharacterPattern = /[^\w\s\/]/g; wildcardCharCodes = [42 /* asterisk */, 63 /* question */]; commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; @@ -19064,7 +19373,7 @@ ${lanes.join("\n")} if (!node.body) return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); const updated = factory2.createFunctionExpression( - node.modifiers, + getModifiers(node), node.asteriskToken, node.name, node.typeParameters, @@ -19203,46 +19512,45 @@ ${lanes.join("\n")} }, baseFactory: baseFactory2, flags, - createNodeArray: createNodeArray2, - createNumericLiteral: createNumericLiteral2, - createBigIntLiteral: createBigIntLiteral2, - createStringLiteral: createStringLiteral2, - createStringLiteralFromNode: createStringLiteralFromNode2, - createRegularExpressionLiteral: createRegularExpressionLiteral2, + createNodeArray, + createNumericLiteral, + createBigIntLiteral, + createStringLiteral, + createStringLiteralFromNode, + createRegularExpressionLiteral, createLiteralLikeNode, - createIdentifier: createIdentifier3, - updateIdentifier, - createTempVariable: createTempVariable3, - createLoopVariable: createLoopVariable2, - createUniqueName: createUniqueName2, - getGeneratedNameForNode: getGeneratedNameForNode3, - createPrivateIdentifier: createPrivateIdentifier2, + createIdentifier, + createTempVariable, + createLoopVariable, + createUniqueName, + getGeneratedNameForNode, + createPrivateIdentifier, createUniquePrivateName, getGeneratedPrivateNameForNode, - createToken: createToken3, - createSuper: createSuper2, - createThis: createThis2, - createNull: createNull2, - createTrue: createTrue2, - createFalse: createFalse2, - createModifier: createModifier2, - createModifiersFromModifierFlags: createModifiersFromModifierFlags2, - createQualifiedName: createQualifiedName2, - updateQualifiedName: updateQualifiedName2, - createComputedPropertyName: createComputedPropertyName2, - updateComputedPropertyName: updateComputedPropertyName2, - createTypeParameterDeclaration: createTypeParameterDeclaration2, - updateTypeParameterDeclaration: updateTypeParameterDeclaration2, + createToken, + createSuper, + createThis, + createNull, + createTrue, + createFalse, + createModifier, + createModifiersFromModifierFlags, + createQualifiedName, + updateQualifiedName, + createComputedPropertyName, + updateComputedPropertyName, + createTypeParameterDeclaration, + updateTypeParameterDeclaration, createParameterDeclaration, updateParameterDeclaration, - createDecorator: createDecorator2, - updateDecorator: updateDecorator2, - createPropertySignature: createPropertySignature3, - updatePropertySignature: updatePropertySignature3, + createDecorator, + updateDecorator, + createPropertySignature, + updatePropertySignature, createPropertyDeclaration, updatePropertyDeclaration: updatePropertyDeclaration2, - createMethodSignature: createMethodSignature3, - updateMethodSignature: updateMethodSignature3, + createMethodSignature, + updateMethodSignature, createMethodDeclaration, updateMethodDeclaration, createConstructorDeclaration, @@ -19251,96 +19559,96 @@ ${lanes.join("\n")} updateGetAccessorDeclaration, createSetAccessorDeclaration, updateSetAccessorDeclaration, - createCallSignature: createCallSignature2, - updateCallSignature: updateCallSignature2, - createConstructSignature: createConstructSignature2, - updateConstructSignature: updateConstructSignature2, - createIndexSignature: createIndexSignature3, - updateIndexSignature: updateIndexSignature2, + createCallSignature, + updateCallSignature, + createConstructSignature, + updateConstructSignature, + createIndexSignature, + updateIndexSignature, createClassStaticBlockDeclaration, updateClassStaticBlockDeclaration, createTemplateLiteralTypeSpan, updateTemplateLiteralTypeSpan, - createKeywordTypeNode: createKeywordTypeNode2, - createTypePredicateNode: createTypePredicateNode3, - updateTypePredicateNode: updateTypePredicateNode3, - createTypeReferenceNode: createTypeReferenceNode2, - updateTypeReferenceNode: updateTypeReferenceNode2, - createFunctionTypeNode: createFunctionTypeNode2, - updateFunctionTypeNode: updateFunctionTypeNode2, - createConstructorTypeNode: createConstructorTypeNode2, - updateConstructorTypeNode: updateConstructorTypeNode2, - createTypeQueryNode: createTypeQueryNode2, - updateTypeQueryNode: updateTypeQueryNode2, - createTypeLiteralNode: createTypeLiteralNode2, - updateTypeLiteralNode: updateTypeLiteralNode2, - createArrayTypeNode: createArrayTypeNode2, - updateArrayTypeNode: updateArrayTypeNode2, - createTupleTypeNode: createTupleTypeNode2, - updateTupleTypeNode: updateTupleTypeNode2, + createKeywordTypeNode, + createTypePredicateNode, + updateTypePredicateNode, + createTypeReferenceNode, + updateTypeReferenceNode, + createFunctionTypeNode, + updateFunctionTypeNode, + createConstructorTypeNode, + updateConstructorTypeNode, + createTypeQueryNode, + updateTypeQueryNode, + createTypeLiteralNode, + updateTypeLiteralNode, + createArrayTypeNode, + updateArrayTypeNode, + createTupleTypeNode, + updateTupleTypeNode, createNamedTupleMember, updateNamedTupleMember, - createOptionalTypeNode: createOptionalTypeNode2, - updateOptionalTypeNode: updateOptionalTypeNode2, - createRestTypeNode: createRestTypeNode2, - updateRestTypeNode: updateRestTypeNode2, - createUnionTypeNode: createUnionTypeNode2, - updateUnionTypeNode: updateUnionTypeNode2, - createIntersectionTypeNode: createIntersectionTypeNode2, - updateIntersectionTypeNode: updateIntersectionTypeNode2, - createConditionalTypeNode: createConditionalTypeNode2, - updateConditionalTypeNode: updateConditionalTypeNode2, - createInferTypeNode: createInferTypeNode2, - updateInferTypeNode: updateInferTypeNode2, - createImportTypeNode: createImportTypeNode2, - updateImportTypeNode: updateImportTypeNode2, - createParenthesizedType: createParenthesizedType2, - updateParenthesizedType: updateParenthesizedType2, - createThisTypeNode: createThisTypeNode2, - createTypeOperatorNode: createTypeOperatorNode3, - updateTypeOperatorNode: updateTypeOperatorNode2, - createIndexedAccessTypeNode: createIndexedAccessTypeNode2, - updateIndexedAccessTypeNode: updateIndexedAccessTypeNode2, - createMappedTypeNode: createMappedTypeNode2, - updateMappedTypeNode: updateMappedTypeNode2, - createLiteralTypeNode: createLiteralTypeNode2, - updateLiteralTypeNode: updateLiteralTypeNode2, + createOptionalTypeNode, + updateOptionalTypeNode, + createRestTypeNode, + updateRestTypeNode, + createUnionTypeNode, + updateUnionTypeNode, + createIntersectionTypeNode, + updateIntersectionTypeNode, + createConditionalTypeNode, + updateConditionalTypeNode, + createInferTypeNode, + updateInferTypeNode, + createImportTypeNode, + updateImportTypeNode, + createParenthesizedType, + updateParenthesizedType, + createThisTypeNode, + createTypeOperatorNode, + updateTypeOperatorNode, + createIndexedAccessTypeNode, + updateIndexedAccessTypeNode, + createMappedTypeNode, + updateMappedTypeNode, + createLiteralTypeNode, + updateLiteralTypeNode, createTemplateLiteralType, updateTemplateLiteralType, - createObjectBindingPattern: createObjectBindingPattern2, - updateObjectBindingPattern: updateObjectBindingPattern2, - createArrayBindingPattern: createArrayBindingPattern2, - updateArrayBindingPattern: updateArrayBindingPattern2, - createBindingElement: createBindingElement2, - updateBindingElement: updateBindingElement2, + createObjectBindingPattern, + updateObjectBindingPattern, + createArrayBindingPattern, + updateArrayBindingPattern, + createBindingElement, + updateBindingElement, createArrayLiteralExpression, updateArrayLiteralExpression, createObjectLiteralExpression, updateObjectLiteralExpression, createPropertyAccessExpression: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, name) => setEmitFlags(createPropertyAccessExpression(expression, name), 262144 /* NoIndentation */) : createPropertyAccessExpression, updatePropertyAccessExpression, - createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain2(expression, questionDotToken, name), 262144 /* NoIndentation */) : createPropertyAccessChain2, - updatePropertyAccessChain: updatePropertyAccessChain2, + createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain(expression, questionDotToken, name), 262144 /* NoIndentation */) : createPropertyAccessChain, + updatePropertyAccessChain, createElementAccessExpression, updateElementAccessExpression, - createElementAccessChain: createElementAccessChain2, - updateElementAccessChain: updateElementAccessChain2, + createElementAccessChain, + updateElementAccessChain, createCallExpression, updateCallExpression, - createCallChain: createCallChain2, - updateCallChain: updateCallChain2, + createCallChain, + updateCallChain, createNewExpression, updateNewExpression, createTaggedTemplateExpression, updateTaggedTemplateExpression, - createTypeAssertion: createTypeAssertion2, - updateTypeAssertion: updateTypeAssertion2, + createTypeAssertion, + updateTypeAssertion, createParenthesizedExpression, updateParenthesizedExpression, - createFunctionExpression: createFunctionExpression2, - updateFunctionExpression: updateFunctionExpression2, - createArrowFunction: createArrowFunction3, - updateArrowFunction: updateArrowFunction3, + createFunctionExpression, + updateFunctionExpression, + createArrowFunction, + updateArrowFunction, createDeleteExpression, updateDeleteExpression, createTypeOfExpression, @@ -19357,42 +19665,42 @@ ${lanes.join("\n")} updateBinaryExpression, createConditionalExpression, updateConditionalExpression, - createTemplateExpression: createTemplateExpression2, - updateTemplateExpression: updateTemplateExpression2, - createTemplateHead: createTemplateHead2, - createTemplateMiddle: createTemplateMiddle2, - createTemplateTail: createTemplateTail2, - createNoSubstitutionTemplateLiteral: createNoSubstitutionTemplateLiteral2, + createTemplateExpression, + updateTemplateExpression, + createTemplateHead, + createTemplateMiddle, + createTemplateTail, + createNoSubstitutionTemplateLiteral, createTemplateLiteralLikeNode, createYieldExpression, updateYieldExpression, createSpreadElement, updateSpreadElement, - createClassExpression: createClassExpression3, - updateClassExpression: updateClassExpression3, - createOmittedExpression: createOmittedExpression2, - createExpressionWithTypeArguments: createExpressionWithTypeArguments3, - updateExpressionWithTypeArguments: updateExpressionWithTypeArguments3, - createAsExpression: createAsExpression2, - updateAsExpression: updateAsExpression2, - createNonNullExpression: createNonNullExpression2, - updateNonNullExpression: updateNonNullExpression2, + createClassExpression, + updateClassExpression, + createOmittedExpression, + createExpressionWithTypeArguments, + updateExpressionWithTypeArguments, + createAsExpression, + updateAsExpression, + createNonNullExpression, + updateNonNullExpression, createSatisfiesExpression, updateSatisfiesExpression, - createNonNullChain: createNonNullChain2, - updateNonNullChain: updateNonNullChain2, - createMetaProperty: createMetaProperty2, - updateMetaProperty: updateMetaProperty2, - createTemplateSpan: createTemplateSpan2, - updateTemplateSpan: updateTemplateSpan2, - createSemicolonClassElement: createSemicolonClassElement2, - createBlock: createBlock2, - updateBlock: updateBlock2, - createVariableStatement: createVariableStatement2, - updateVariableStatement: updateVariableStatement2, - createEmptyStatement: createEmptyStatement2, - createExpressionStatement: createExpressionStatement2, - updateExpressionStatement: updateExpressionStatement2, + createNonNullChain, + updateNonNullChain, + createMetaProperty, + updateMetaProperty, + createTemplateSpan, + updateTemplateSpan, + createSemicolonClassElement, + createBlock, + updateBlock, + createVariableStatement, + updateVariableStatement, + createEmptyStatement, + createExpressionStatement, + updateExpressionStatement, createIfStatement, updateIfStatement, createDoStatement, @@ -19421,60 +19729,60 @@ ${lanes.join("\n")} updateThrowStatement, createTryStatement, updateTryStatement, - createDebuggerStatement: createDebuggerStatement2, - createVariableDeclaration: createVariableDeclaration3, - updateVariableDeclaration: updateVariableDeclaration3, - createVariableDeclarationList: createVariableDeclarationList2, - updateVariableDeclarationList: updateVariableDeclarationList2, - createFunctionDeclaration: createFunctionDeclaration2, - updateFunctionDeclaration: updateFunctionDeclaration2, - createClassDeclaration: createClassDeclaration2, - updateClassDeclaration: updateClassDeclaration2, - createInterfaceDeclaration: createInterfaceDeclaration2, - updateInterfaceDeclaration: updateInterfaceDeclaration2, - createTypeAliasDeclaration: createTypeAliasDeclaration2, - updateTypeAliasDeclaration: updateTypeAliasDeclaration2, - createEnumDeclaration: createEnumDeclaration2, - updateEnumDeclaration: updateEnumDeclaration2, - createModuleDeclaration: createModuleDeclaration2, - updateModuleDeclaration: updateModuleDeclaration2, - createModuleBlock: createModuleBlock2, - updateModuleBlock: updateModuleBlock2, - createCaseBlock: createCaseBlock2, - updateCaseBlock: updateCaseBlock2, - createNamespaceExportDeclaration: createNamespaceExportDeclaration2, - updateNamespaceExportDeclaration: updateNamespaceExportDeclaration2, - createImportEqualsDeclaration: createImportEqualsDeclaration2, - updateImportEqualsDeclaration: updateImportEqualsDeclaration2, - createImportDeclaration: createImportDeclaration2, - updateImportDeclaration: updateImportDeclaration2, - createImportClause: createImportClause3, - updateImportClause: updateImportClause3, + createDebuggerStatement, + createVariableDeclaration, + updateVariableDeclaration, + createVariableDeclarationList, + updateVariableDeclarationList, + createFunctionDeclaration, + updateFunctionDeclaration, + createClassDeclaration, + updateClassDeclaration, + createInterfaceDeclaration, + updateInterfaceDeclaration, + createTypeAliasDeclaration, + updateTypeAliasDeclaration, + createEnumDeclaration, + updateEnumDeclaration, + createModuleDeclaration, + updateModuleDeclaration, + createModuleBlock, + updateModuleBlock, + createCaseBlock, + updateCaseBlock, + createNamespaceExportDeclaration, + updateNamespaceExportDeclaration, + createImportEqualsDeclaration, + updateImportEqualsDeclaration, + createImportDeclaration, + updateImportDeclaration, + createImportClause, + updateImportClause, createAssertClause, updateAssertClause, createAssertEntry, updateAssertEntry, createImportTypeAssertionContainer, updateImportTypeAssertionContainer, - createNamespaceImport: createNamespaceImport2, - updateNamespaceImport: updateNamespaceImport2, - createNamespaceExport: createNamespaceExport2, - updateNamespaceExport: updateNamespaceExport2, - createNamedImports: createNamedImports2, - updateNamedImports: updateNamedImports2, - createImportSpecifier: createImportSpecifier2, - updateImportSpecifier: updateImportSpecifier2, - createExportAssignment: createExportAssignment3, - updateExportAssignment: updateExportAssignment2, - createExportDeclaration: createExportDeclaration3, - updateExportDeclaration: updateExportDeclaration3, - createNamedExports: createNamedExports2, - updateNamedExports: updateNamedExports2, - createExportSpecifier: createExportSpecifier2, - updateExportSpecifier: updateExportSpecifier2, + createNamespaceImport, + updateNamespaceImport, + createNamespaceExport, + updateNamespaceExport, + createNamedImports, + updateNamedImports, + createImportSpecifier, + updateImportSpecifier, + createExportAssignment: createExportAssignment2, + updateExportAssignment, + createExportDeclaration, + updateExportDeclaration, + createNamedExports, + updateNamedExports, + createExportSpecifier, + updateExportSpecifier, createMissingDeclaration, - createExternalModuleReference: createExternalModuleReference2, - updateExternalModuleReference: updateExternalModuleReference2, + createExternalModuleReference, + updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(315 /* JSDocAllType */); @@ -19514,27 +19822,27 @@ ${lanes.join("\n")} }, createJSDocFunctionType, updateJSDocFunctionType, - createJSDocTypeLiteral: createJSDocTypeLiteral2, + createJSDocTypeLiteral, updateJSDocTypeLiteral, - createJSDocTypeExpression: createJSDocTypeExpression2, + createJSDocTypeExpression, updateJSDocTypeExpression, - createJSDocSignature: createJSDocSignature2, + createJSDocSignature, updateJSDocSignature, - createJSDocTemplateTag: createJSDocTemplateTag2, + createJSDocTemplateTag, updateJSDocTemplateTag, - createJSDocTypedefTag: createJSDocTypedefTag2, + createJSDocTypedefTag, updateJSDocTypedefTag, - createJSDocParameterTag: createJSDocParameterTag2, + createJSDocParameterTag, updateJSDocParameterTag, - createJSDocPropertyTag: createJSDocPropertyTag2, + createJSDocPropertyTag, updateJSDocPropertyTag, - createJSDocCallbackTag: createJSDocCallbackTag2, + createJSDocCallbackTag, updateJSDocCallbackTag, createJSDocOverloadTag, updateJSDocOverloadTag, - createJSDocAugmentsTag: createJSDocAugmentsTag2, + createJSDocAugmentsTag, updateJSDocAugmentsTag, - createJSDocImplementsTag: createJSDocImplementsTag2, + createJSDocImplementsTag, updateJSDocImplementsTag, createJSDocSeeTag, updateJSDocSeeTag, @@ -19621,57 +19929,63 @@ ${lanes.join("\n")} get updateJSDocThrowsTag() { return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */); }, - createJSDocEnumTag: createJSDocEnumTag2, + get createJSDocSatisfiesTag() { + return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */); + }, + get updateJSDocSatisfiesTag() { + return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */); + }, + createJSDocEnumTag, updateJSDocEnumTag, createJSDocUnknownTag, updateJSDocUnknownTag, createJSDocText, updateJSDocText, - createJSDocComment: createJSDocComment2, + createJSDocComment, updateJSDocComment, - createJsxElement: createJsxElement2, - updateJsxElement: updateJsxElement2, - createJsxSelfClosingElement: createJsxSelfClosingElement2, - updateJsxSelfClosingElement: updateJsxSelfClosingElement2, - createJsxOpeningElement: createJsxOpeningElement2, - updateJsxOpeningElement: updateJsxOpeningElement2, - createJsxClosingElement: createJsxClosingElement2, - updateJsxClosingElement: updateJsxClosingElement2, - createJsxFragment: createJsxFragment2, - createJsxText: createJsxText2, - updateJsxText: updateJsxText2, - createJsxOpeningFragment: createJsxOpeningFragment2, - createJsxJsxClosingFragment: createJsxJsxClosingFragment2, - updateJsxFragment: updateJsxFragment2, - createJsxAttribute: createJsxAttribute2, - updateJsxAttribute: updateJsxAttribute2, - createJsxAttributes: createJsxAttributes2, - updateJsxAttributes: updateJsxAttributes2, - createJsxSpreadAttribute: createJsxSpreadAttribute2, - updateJsxSpreadAttribute: updateJsxSpreadAttribute2, - createJsxExpression: createJsxExpression2, - updateJsxExpression: updateJsxExpression2, - createCaseClause: createCaseClause2, - updateCaseClause: updateCaseClause2, - createDefaultClause: createDefaultClause2, - updateDefaultClause: updateDefaultClause2, - createHeritageClause: createHeritageClause2, - updateHeritageClause: updateHeritageClause2, - createCatchClause: createCatchClause2, - updateCatchClause: updateCatchClause2, - createPropertyAssignment: createPropertyAssignment2, - updatePropertyAssignment: updatePropertyAssignment2, - createShorthandPropertyAssignment: createShorthandPropertyAssignment2, - updateShorthandPropertyAssignment: updateShorthandPropertyAssignment2, - createSpreadAssignment: createSpreadAssignment2, - updateSpreadAssignment: updateSpreadAssignment2, - createEnumMember: createEnumMember2, - updateEnumMember: updateEnumMember2, + createJsxElement, + updateJsxElement, + createJsxSelfClosingElement, + updateJsxSelfClosingElement, + createJsxOpeningElement, + updateJsxOpeningElement, + createJsxClosingElement, + updateJsxClosingElement, + createJsxFragment, + createJsxText, + updateJsxText, + createJsxOpeningFragment, + createJsxJsxClosingFragment, + updateJsxFragment, + createJsxAttribute, + updateJsxAttribute, + createJsxAttributes, + updateJsxAttributes, + createJsxSpreadAttribute, + updateJsxSpreadAttribute, + createJsxExpression, + updateJsxExpression, + createCaseClause, + updateCaseClause, + createDefaultClause, + updateDefaultClause, + createHeritageClause, + updateHeritageClause, + createCatchClause, + updateCatchClause, + createPropertyAssignment, + updatePropertyAssignment, + createShorthandPropertyAssignment, + updateShorthandPropertyAssignment, + createSpreadAssignment, + updateSpreadAssignment, + createEnumMember, + updateEnumMember, createSourceFile: createSourceFile2, updateSourceFile: updateSourceFile2, createRedirectedSourceFile, - createBundle: createBundle2, - updateBundle: updateBundle2, + createBundle, + updateBundle, createUnparsedSource, createUnparsedPrologue, createUnparsedPrepend, @@ -19680,9 +19994,9 @@ ${lanes.join("\n")} createInputFiles: createInputFiles2, createSyntheticExpression, createSyntaxList: createSyntaxList3, - createNotEmittedStatement: createNotEmittedStatement2, - createPartiallyEmittedExpression: createPartiallyEmittedExpression2, - updatePartiallyEmittedExpression: updatePartiallyEmittedExpression2, + createNotEmittedStatement, + createPartiallyEmittedExpression, + updatePartiallyEmittedExpression, createCommaListExpression, updateCommaListExpression, createEndOfDeclarationMarker, @@ -19788,11 +20102,11 @@ ${lanes.join("\n")} return getPostfixUnaryCreateFunction(46 /* MinusMinusToken */); }, // Compound nodes - createImmediatelyInvokedFunctionExpression: createImmediatelyInvokedFunctionExpression2, - createImmediatelyInvokedArrowFunction: createImmediatelyInvokedArrowFunction2, - createVoidZero: createVoidZero2, - createExportDefault: createExportDefault2, - createExternalModuleExport: createExternalModuleExport2, + createImmediatelyInvokedFunctionExpression, + createImmediatelyInvokedArrowFunction, + createVoidZero, + createExportDefault, + createExternalModuleExport, createTypeCheck, createMethodCall, createGlobalMethodCall, @@ -19802,6 +20116,7 @@ ${lanes.join("\n")} createArraySliceCall, createArrayConcatCall, createObjectDefinePropertyCall, + createObjectGetOwnPropertyDescriptorCall, createReflectGetCall, createReflectSetCall, createPropertyDescriptor, @@ -19828,7 +20143,7 @@ ${lanes.join("\n")} }; forEach(nodeFactoryPatchers, (fn) => fn(factory2)); return factory2; - function createNodeArray2(elements, hasTrailingComma) { + function createNodeArray(elements, hasTrailingComma) { if (elements === void 0 || elements === emptyArray) { elements = []; } else if (isNodeArray(elements)) { @@ -19872,7 +20187,7 @@ ${lanes.join("\n")} } return update(updated, original); } - function createNumericLiteral2(value, numericLiteralFlags = 0 /* None */) { + function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) { const node = createBaseDeclaration(8 /* NumericLiteral */); node.text = typeof value === "number" ? value + "" : value; node.numericLiteralFlags = numericLiteralFlags; @@ -19880,7 +20195,7 @@ ${lanes.join("\n")} node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createBigIntLiteral2(value) { + function createBigIntLiteral(value) { const node = createBaseToken(9 /* BigIntLiteral */); node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n"; node.transformFlags |= 4 /* ContainsESNext */; @@ -19892,14 +20207,14 @@ ${lanes.join("\n")} node.singleQuote = isSingleQuote; return node; } - function createStringLiteral2(text, isSingleQuote, hasExtendedUnicodeEscape) { + function createStringLiteral(text, isSingleQuote, hasExtendedUnicodeEscape) { const node = createBaseStringLiteral(text, isSingleQuote); node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; if (hasExtendedUnicodeEscape) node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createStringLiteralFromNode2(sourceNode) { + function createStringLiteralFromNode(sourceNode) { const node = createBaseStringLiteral( getTextOfIdentifierOrLiteral(sourceNode), /*isSingleQuote*/ @@ -19908,7 +20223,7 @@ ${lanes.join("\n")} node.textSourceNode = sourceNode; return node; } - function createRegularExpressionLiteral2(text) { + function createRegularExpressionLiteral(text) { const node = createBaseToken(13 /* RegularExpressionLiteral */); node.text = text; return node; @@ -19916,33 +20231,33 @@ ${lanes.join("\n")} function createLiteralLikeNode(kind, text) { switch (kind) { case 8 /* NumericLiteral */: - return createNumericLiteral2( + return createNumericLiteral( text, /*numericLiteralFlags*/ 0 ); case 9 /* BigIntLiteral */: - return createBigIntLiteral2(text); + return createBigIntLiteral(text); case 10 /* StringLiteral */: - return createStringLiteral2( + return createStringLiteral( text, /*isSingleQuote*/ void 0 ); case 11 /* JsxText */: - return createJsxText2( + return createJsxText( text, /*containsOnlyTriviaWhiteSpaces*/ false ); case 12 /* JsxTextAllWhiteSpaces */: - return createJsxText2( + return createJsxText( text, /*containsOnlyTriviaWhiteSpaces*/ true ); case 13 /* RegularExpressionLiteral */: - return createRegularExpressionLiteral2(text); + return createRegularExpressionLiteral(text); case 14 /* NoSubstitutionTemplateLiteral */: return createTemplateLiteralLikeNode( kind, @@ -19954,56 +20269,44 @@ ${lanes.join("\n")} ); } } - function createBaseIdentifier(escapedText, originalKeywordKind) { + function createBaseIdentifier(escapedText) { const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */); - node.originalKeywordKind = originalKeywordKind; node.escapedText = escapedText; - node.autoGenerate = void 0; - node.typeArguments = void 0; - node.hasExtendedUnicodeEscape = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.symbol = void 0; return node; } function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { - const node = createBaseIdentifier( - escapeLeadingUnderscores(text), - /*originalKeywordKind*/ - void 0 - ); - node.autoGenerate = { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } - function createIdentifier3(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) { + function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) { if (originalKeywordKind === void 0 && text) { originalKeywordKind = stringToToken(text); } if (originalKeywordKind === 79 /* Identifier */) { originalKeywordKind = void 0; } - const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind); - node.typeArguments = asNodeArray(typeArguments); - node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; - if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + if (hasExtendedUnicodeEscape) + node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */; + if (node.escapedText === "await") { node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */; } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { node.transformFlags |= 1024 /* ContainsES2015 */; } return node; } - function updateIdentifier(node, typeArguments) { - return node.typeArguments !== typeArguments ? update(createIdentifier3(idText(node), typeArguments), node) : node; - } - function createTempVariable3(recordTempVariable, reservedInNestedScopes, prefix, suffix) { + function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { let flags2 = 1 /* Auto */; if (reservedInNestedScopes) flags2 |= 8 /* ReservedInNestedScopes */; @@ -20013,7 +20316,7 @@ ${lanes.join("\n")} } return name; } - function createLoopVariable2(reservedInNestedScopes) { + function createLoopVariable(reservedInNestedScopes) { let flags2 = 2 /* Loop */; if (reservedInNestedScopes) flags2 |= 8 /* ReservedInNestedScopes */; @@ -20026,12 +20329,12 @@ ${lanes.join("\n")} void 0 ); } - function createUniqueName2(text, flags2 = 0 /* None */, prefix, suffix) { + function createUniqueName(text, flags2 = 0 /* None */, prefix, suffix) { Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); Debug.assert((flags2 & (16 /* Optimistic */ | 32 /* FileLevel */)) !== 32 /* FileLevel */, "GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"); return createBaseGeneratedIdentifier(text, 3 /* Unique */ | flags2, prefix, suffix); } - function getGeneratedNameForNode3(node, flags2 = 0, prefix, suffix) { + function getGeneratedNameForNode(node, flags2 = 0, prefix, suffix) { Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); const text = !node ? "" : isMemberName(node) ? formatGeneratedName( /*privateName*/ @@ -20050,23 +20353,22 @@ ${lanes.join("\n")} function createBasePrivateIdentifier(escapedText) { const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */); node.escapedText = escapedText; - node.autoGenerate = void 0; node.transformFlags |= 16777216 /* ContainsClassFields */; return node; } - function createPrivateIdentifier2(text) { + function createPrivateIdentifier(text) { if (!startsWith(text, "#")) Debug.fail("First character of private identifier must be #: " + text); return createBasePrivateIdentifier(escapeLeadingUnderscores(text)); } function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text)); - node.autoGenerate = { + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } @@ -20093,7 +20395,7 @@ ${lanes.join("\n")} function createBaseToken(kind) { return baseFactory2.createBaseTokenNode(kind); } - function createToken3(token) { + function createToken(token) { Debug.assert(token >= 0 /* FirstToken */ && token <= 162 /* LastToken */, "Invalid token"); Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); @@ -20147,59 +20449,59 @@ ${lanes.join("\n")} } return node; } - function createSuper2() { - return createToken3(106 /* SuperKeyword */); + function createSuper() { + return createToken(106 /* SuperKeyword */); } - function createThis2() { - return createToken3(108 /* ThisKeyword */); + function createThis() { + return createToken(108 /* ThisKeyword */); } - function createNull2() { - return createToken3(104 /* NullKeyword */); + function createNull() { + return createToken(104 /* NullKeyword */); } - function createTrue2() { - return createToken3(110 /* TrueKeyword */); + function createTrue() { + return createToken(110 /* TrueKeyword */); } - function createFalse2() { - return createToken3(95 /* FalseKeyword */); + function createFalse() { + return createToken(95 /* FalseKeyword */); } - function createModifier2(kind) { - return createToken3(kind); + function createModifier(kind) { + return createToken(kind); } - function createModifiersFromModifierFlags2(flags2) { + function createModifiersFromModifierFlags(flags2) { const result = []; if (flags2 & 1 /* Export */) - result.push(createModifier2(93 /* ExportKeyword */)); + result.push(createModifier(93 /* ExportKeyword */)); if (flags2 & 2 /* Ambient */) - result.push(createModifier2(136 /* DeclareKeyword */)); + result.push(createModifier(136 /* DeclareKeyword */)); if (flags2 & 1024 /* Default */) - result.push(createModifier2(88 /* DefaultKeyword */)); + result.push(createModifier(88 /* DefaultKeyword */)); if (flags2 & 2048 /* Const */) - result.push(createModifier2(85 /* ConstKeyword */)); + result.push(createModifier(85 /* ConstKeyword */)); if (flags2 & 4 /* Public */) - result.push(createModifier2(123 /* PublicKeyword */)); + result.push(createModifier(123 /* PublicKeyword */)); if (flags2 & 8 /* Private */) - result.push(createModifier2(121 /* PrivateKeyword */)); + result.push(createModifier(121 /* PrivateKeyword */)); if (flags2 & 16 /* Protected */) - result.push(createModifier2(122 /* ProtectedKeyword */)); + result.push(createModifier(122 /* ProtectedKeyword */)); if (flags2 & 256 /* Abstract */) - result.push(createModifier2(126 /* AbstractKeyword */)); + result.push(createModifier(126 /* AbstractKeyword */)); if (flags2 & 32 /* Static */) - result.push(createModifier2(124 /* StaticKeyword */)); + result.push(createModifier(124 /* StaticKeyword */)); if (flags2 & 16384 /* Override */) - result.push(createModifier2(161 /* OverrideKeyword */)); + result.push(createModifier(161 /* OverrideKeyword */)); if (flags2 & 64 /* Readonly */) - result.push(createModifier2(146 /* ReadonlyKeyword */)); + result.push(createModifier(146 /* ReadonlyKeyword */)); if (flags2 & 128 /* Accessor */) - result.push(createModifier2(127 /* AccessorKeyword */)); + result.push(createModifier(127 /* AccessorKeyword */)); if (flags2 & 512 /* Async */) - result.push(createModifier2(132 /* AsyncKeyword */)); + result.push(createModifier(132 /* AsyncKeyword */)); if (flags2 & 32768 /* In */) - result.push(createModifier2(101 /* InKeyword */)); + result.push(createModifier(101 /* InKeyword */)); if (flags2 & 65536 /* Out */) - result.push(createModifier2(145 /* OutKeyword */)); + result.push(createModifier(145 /* OutKeyword */)); return result.length ? result : void 0; } - function createQualifiedName2(left, right) { + function createQualifiedName(left, right) { const node = createBaseNode(163 /* QualifiedName */); node.left = left; node.right = asName(right); @@ -20207,19 +20509,19 @@ ${lanes.join("\n")} node.flowNode = void 0; return node; } - function updateQualifiedName2(node, left, right) { - return node.left !== left || node.right !== right ? update(createQualifiedName2(left, right), node) : node; + function updateQualifiedName(node, left, right) { + return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node; } - function createComputedPropertyName2(expression) { + function createComputedPropertyName(expression) { const node = createBaseNode(164 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */; return node; } - function updateComputedPropertyName2(node, expression) { - return node.expression !== expression ? update(createComputedPropertyName2(expression), node) : node; + function updateComputedPropertyName(node, expression) { + return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node; } - function createTypeParameterDeclaration2(modifiers, name, constraint, defaultType) { + function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) { const node = createBaseDeclaration(165 /* TypeParameter */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -20228,11 +20530,10 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; node.expression = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateTypeParameterDeclaration2(node, modifiers, name, constraint, defaultType) { - return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration2(modifiers, name, constraint, defaultType), node) : node; + function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) { + return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node; } function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) { var _a2, _b; @@ -20249,13 +20550,12 @@ ${lanes.join("\n")} node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */); } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node; } - function createDecorator2(expression) { + function createDecorator(expression) { const node = createBaseNode(167 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -20265,10 +20565,10 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */; return node; } - function updateDecorator2(node, expression) { - return node.expression !== expression ? update(createDecorator2(expression), node) : node; + function updateDecorator(node, expression) { + return node.expression !== expression ? update(createDecorator(expression), node) : node; } - function createPropertySignature3(modifiers, name, questionToken, type) { + function createPropertySignature(modifiers, name, questionToken, type) { const node = createBaseDeclaration(168 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -20277,11 +20577,10 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; node.initializer = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updatePropertySignature3(node, modifiers, name, questionToken, type) { - return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature3(modifiers, name, questionToken, type), node) : node; + function updatePropertySignature(node, modifiers, name, questionToken, type) { + return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature(modifiers, name, questionToken, type), node) : node; } function finishUpdatePropertySignature(updated, original) { if (updated !== original) { @@ -20300,13 +20599,12 @@ ${lanes.join("\n")} const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer) { return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } - function createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type) { + function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { const node = createBaseDeclaration(170 /* MethodSignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -20316,14 +20614,13 @@ ${lanes.join("\n")} node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateMethodSignature3(node, modifiers, name, questionToken, typeParameters, parameters, type) { - return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; + function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) { + return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; } function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { const node = createBaseDeclaration(171 /* MethodDeclaration */); @@ -20333,7 +20630,7 @@ ${lanes.join("\n")} node.questionToken = questionToken; node.exclamationToken = void 0; node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body) { @@ -20346,7 +20643,6 @@ ${lanes.join("\n")} } node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -20367,10 +20663,8 @@ ${lanes.join("\n")} const node = createBaseDeclaration(172 /* ClassStaticBlockDeclaration */); node.body = body; node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -20382,7 +20676,6 @@ ${lanes.join("\n")} } function finishUpdateClassStaticBlockDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); @@ -20390,15 +20683,13 @@ ${lanes.join("\n")} function createConstructorDeclaration(modifiers, parameters, body) { const node = createBaseDeclaration(173 /* Constructor */); node.modifiers = asNodeArray(modifiers); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.body = body; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */; - node.illegalDecorators = void 0; node.typeParameters = void 0; node.type = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -20410,7 +20701,6 @@ ${lanes.join("\n")} } function finishUpdateConstructorDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.typeParameters = original.typeParameters; updated.type = original.type; } @@ -20420,7 +20710,7 @@ ${lanes.join("\n")} const node = createBaseDeclaration(174 /* GetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body) { @@ -20431,7 +20721,6 @@ ${lanes.join("\n")} node.typeArguments = void 0; node.typeParameters = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -20452,7 +20741,7 @@ ${lanes.join("\n")} const node = createBaseDeclaration(175 /* SetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.body = body; if (!node.body) { node.transformFlags = 1 /* ContainsTypeScript */; @@ -20463,7 +20752,6 @@ ${lanes.join("\n")} node.typeParameters = void 0; node.type = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -20481,54 +20769,50 @@ ${lanes.join("\n")} } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createCallSignature2(typeParameters, parameters, type) { + function createCallSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(176 /* CallSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateCallSignature2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature2(typeParameters, parameters, type), node) : node; + function updateCallSignature(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node; } - function createConstructSignature2(typeParameters, parameters, type) { + function createConstructSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(177 /* ConstructSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateConstructSignature2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature2(typeParameters, parameters, type), node) : node; + function updateConstructSignature(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node; } - function createIndexSignature3(modifiers, parameters, type) { + function createIndexSignature(modifiers, parameters, type) { const node = createBaseDeclaration(178 /* IndexSignature */); node.modifiers = asNodeArray(modifiers); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateIndexSignature2(node, modifiers, parameters, type) { - return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature3(modifiers, parameters, type), node) : node; + function updateIndexSignature(node, modifiers, parameters, type) { + return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node; } function createTemplateLiteralTypeSpan(type, literal) { const node = createBaseNode(201 /* TemplateLiteralTypeSpan */); @@ -20540,10 +20824,10 @@ ${lanes.join("\n")} function updateTemplateLiteralTypeSpan(node, type, literal) { return node.type !== type || node.literal !== literal ? update(createTemplateLiteralTypeSpan(type, literal), node) : node; } - function createKeywordTypeNode2(kind) { - return createToken3(kind); + function createKeywordTypeNode(kind) { + return createToken(kind); } - function createTypePredicateNode3(assertsModifier, parameterName, type) { + function createTypePredicateNode(assertsModifier, parameterName, type) { const node = createBaseNode(179 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); @@ -20551,20 +20835,20 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypePredicateNode3(node, assertsModifier, parameterName, type) { - return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode3(assertsModifier, parameterName, type), node) : node; + function updateTypePredicateNode(node, assertsModifier, parameterName, type) { + return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node; } - function createTypeReferenceNode2(typeName, typeArguments) { + function createTypeReferenceNode(typeName, typeArguments) { const node = createBaseNode(180 /* TypeReference */); node.typeName = asName(typeName); - node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray2(typeArguments)); + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeReferenceNode2(node, typeName, typeArguments) { - return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode2(typeName, typeArguments), node) : node; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node; } - function createFunctionTypeNode2(typeParameters, parameters, type) { + function createFunctionTypeNode(typeParameters, parameters, type) { const node = createBaseDeclaration(181 /* FunctionType */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); @@ -20572,14 +20856,13 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateFunctionTypeNode2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(typeParameters, parameters, type), node) : node; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type), node) : node; } function finishUpdateFunctionTypeNode(updated, original) { if (updated !== original) { @@ -20587,8 +20870,8 @@ ${lanes.join("\n")} } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createConstructorTypeNode2(...args) { - return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode22(...args) : Debug.fail("Incorrect number of arguments specified."); + function createConstructorTypeNode(...args) { + return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) { const node = createBaseDeclaration(182 /* ConstructorType */); @@ -20598,13 +20881,12 @@ ${lanes.join("\n")} node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function createConstructorTypeNode22(typeParameters, parameters, type) { + function createConstructorTypeNode2(typeParameters, parameters, type) { return createConstructorTypeNode1( /*modifiers*/ void 0, @@ -20613,51 +20895,51 @@ ${lanes.join("\n")} type ); } - function updateConstructorTypeNode2(...args) { - return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode22(...args) : Debug.fail("Incorrect number of arguments specified."); + function updateConstructorTypeNode(...args) { + return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function updateConstructorTypeNode1(node, modifiers, typeParameters, parameters, type) { - return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode2(modifiers, typeParameters, parameters, type), node) : node; + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode(modifiers, typeParameters, parameters, type), node) : node; } - function updateConstructorTypeNode22(node, typeParameters, parameters, type) { + function updateConstructorTypeNode2(node, typeParameters, parameters, type) { return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type); } - function createTypeQueryNode2(exprName, typeArguments) { + function createTypeQueryNode(exprName, typeArguments) { const node = createBaseNode(183 /* TypeQuery */); node.exprName = exprName; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeQueryNode2(node, exprName, typeArguments) { - return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode2(exprName, typeArguments), node) : node; + function updateTypeQueryNode(node, exprName, typeArguments) { + return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node; } - function createTypeLiteralNode2(members) { + function createTypeLiteralNode(members) { const node = createBaseDeclaration(184 /* TypeLiteral */); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeLiteralNode2(node, members) { - return node.members !== members ? update(createTypeLiteralNode2(members), node) : node; + function updateTypeLiteralNode(node, members) { + return node.members !== members ? update(createTypeLiteralNode(members), node) : node; } - function createArrayTypeNode2(elementType) { + function createArrayTypeNode(elementType) { const node = createBaseNode(185 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateArrayTypeNode2(node, elementType) { - return node.elementType !== elementType ? update(createArrayTypeNode2(elementType), node) : node; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node; } - function createTupleTypeNode2(elements) { + function createTupleTypeNode(elements) { const node = createBaseNode(186 /* TupleType */); - node.elements = createNodeArray2(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); + node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTupleTypeNode2(node, elements) { - return node.elements !== elements ? update(createTupleTypeNode2(elements), node) : node; + function updateTupleTypeNode(node, elements) { + return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node; } function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { const node = createBaseDeclaration(199 /* NamedTupleMember */); @@ -20667,29 +20949,28 @@ ${lanes.join("\n")} node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) { return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node; } - function createOptionalTypeNode2(type) { + function createOptionalTypeNode(type) { const node = createBaseNode(187 /* OptionalType */); node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateOptionalTypeNode2(node, type) { - return node.type !== type ? update(createOptionalTypeNode2(type), node) : node; + function updateOptionalTypeNode(node, type) { + return node.type !== type ? update(createOptionalTypeNode(type), node) : node; } - function createRestTypeNode2(type) { + function createRestTypeNode(type) { const node = createBaseNode(188 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateRestTypeNode2(node, type) { - return node.type !== type ? update(createRestTypeNode2(type), node) : node; + function updateRestTypeNode(node, type) { + return node.type !== type ? update(createRestTypeNode(type), node) : node; } function createUnionOrIntersectionTypeNode(kind, types, parenthesize) { const node = createBaseNode(kind); @@ -20700,19 +20981,19 @@ ${lanes.join("\n")} function updateUnionOrIntersectionTypeNode(node, types, parenthesize) { return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node; } - function createUnionTypeNode2(types) { + function createUnionTypeNode(types) { return createUnionOrIntersectionTypeNode(189 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } - function updateUnionTypeNode2(node, types) { + function updateUnionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } - function createIntersectionTypeNode2(types) { + function createIntersectionTypeNode(types) { return createUnionOrIntersectionTypeNode(190 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } - function updateIntersectionTypeNode2(node, types) { + function updateIntersectionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } - function createConditionalTypeNode2(checkType, extendsType, trueType, falseType) { + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { const node = createBaseNode(191 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); @@ -20723,29 +21004,29 @@ ${lanes.join("\n")} node.nextContainer = void 0; return node; } - function updateConditionalTypeNode2(node, checkType, extendsType, trueType, falseType) { - return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode2(checkType, extendsType, trueType, falseType), node) : node; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; } - function createInferTypeNode2(typeParameter) { + function createInferTypeNode(typeParameter) { const node = createBaseNode(192 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateInferTypeNode2(node, typeParameter) { - return node.typeParameter !== typeParameter ? update(createInferTypeNode2(typeParameter), node) : node; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node; } function createTemplateLiteralType(head, templateSpans) { const node = createBaseNode(200 /* TemplateLiteralType */); node.head = head; - node.templateSpans = createNodeArray2(templateSpans); + node.templateSpans = createNodeArray(templateSpans); node.transformFlags = 1 /* ContainsTypeScript */; return node; } function updateTemplateLiteralType(node, head, templateSpans) { return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node; } - function createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf = false) { + function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) { const node = createBaseNode(202 /* ImportType */); node.argument = argument; node.assertions = assertions; @@ -20755,90 +21036,90 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateImportTypeNode2(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) { - return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; + function updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) { + return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; } - function createParenthesizedType2(type) { + function createParenthesizedType(type) { const node = createBaseNode(193 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateParenthesizedType2(node, type) { - return node.type !== type ? update(createParenthesizedType2(type), node) : node; + function updateParenthesizedType(node, type) { + return node.type !== type ? update(createParenthesizedType(type), node) : node; } - function createThisTypeNode2() { + function createThisTypeNode() { const node = createBaseNode(194 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function createTypeOperatorNode3(operator, type) { + function createTypeOperatorNode(operator, type) { const node = createBaseNode(195 /* TypeOperator */); node.operator = operator; node.type = operator === 146 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeOperatorNode2(node, type) { - return node.type !== type ? update(createTypeOperatorNode3(node.operator, type), node) : node; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node; } - function createIndexedAccessTypeNode2(objectType, indexType) { + function createIndexedAccessTypeNode(objectType, indexType) { const node = createBaseNode(196 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateIndexedAccessTypeNode2(node, objectType, indexType) { - return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode2(objectType, indexType), node) : node; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; } - function createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members) { + function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) { const node = createBaseDeclaration(197 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.nameType = nameType; node.questionToken = questionToken; node.type = type; - node.members = members && createNodeArray2(members); + node.members = members && createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateMappedTypeNode2(node, readonlyToken, typeParameter, nameType, questionToken, type, members) { - return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; + function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) { + return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; } - function createLiteralTypeNode2(literal) { + function createLiteralTypeNode(literal) { const node = createBaseNode(198 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateLiteralTypeNode2(node, literal) { - return node.literal !== literal ? update(createLiteralTypeNode2(literal), node) : node; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node; } - function createObjectBindingPattern2(elements) { + function createObjectBindingPattern(elements) { const node = createBaseNode(203 /* ObjectBindingPattern */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { node.transformFlags |= 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; } return node; } - function updateObjectBindingPattern2(node, elements) { - return node.elements !== elements ? update(createObjectBindingPattern2(elements), node) : node; + function updateObjectBindingPattern(node, elements) { + return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node; } - function createArrayBindingPattern2(elements) { + function createArrayBindingPattern(elements) { const node = createBaseNode(204 /* ArrayBindingPattern */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; return node; } - function updateArrayBindingPattern2(node, elements) { - return node.elements !== elements ? update(createArrayBindingPattern2(elements), node) : node; + function updateArrayBindingPattern(node, elements) { + return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node; } - function createBindingElement2(dotDotDotToken, propertyName, name, initializer) { + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { const node = createBaseDeclaration(205 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); @@ -20848,13 +21129,13 @@ ${lanes.join("\n")} node.flowNode = void 0; return node; } - function updateBindingElement2(node, dotDotDotToken, propertyName, name, initializer) { - return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement2(dotDotDotToken, propertyName, name, initializer), node) : node; + function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { + return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node; } function createArrayLiteralExpression(elements, multiLine) { const node = createBaseNode(206 /* ArrayLiteralExpression */); const lastElement = elements && lastOrUndefined(elements); - const elementsArray = createNodeArray2(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); + const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -20865,11 +21146,10 @@ ${lanes.join("\n")} } function createObjectLiteralExpression(properties, multiLine) { const node = createBaseDeclaration(207 /* ObjectLiteralExpression */); - node.properties = createNodeArray2(properties); + node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateObjectLiteralExpression(node, properties) { @@ -20882,7 +21162,6 @@ ${lanes.join("\n")} node.name = name; node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -20904,11 +21183,11 @@ ${lanes.join("\n")} } function updatePropertyAccessExpression(node, expression, name) { if (isPropertyAccessChain(node)) { - return updatePropertyAccessChain2(node, expression, node.questionDotToken, cast(name, isIdentifier)); + return updatePropertyAccessChain(node, expression, node.questionDotToken, cast(name, isIdentifier)); } return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node; } - function createPropertyAccessChain2(expression, questionDotToken, name) { + function createPropertyAccessChain(expression, questionDotToken, name) { const node = createBasePropertyAccessExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -20922,9 +21201,9 @@ ${lanes.join("\n")} node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updatePropertyAccessChain2(node, expression, questionDotToken, name) { + function updatePropertyAccessChain(node, expression, questionDotToken, name) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain2(expression, questionDotToken, name), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node; } function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) { const node = createBaseDeclaration(209 /* ElementAccessExpression */); @@ -20933,7 +21212,6 @@ ${lanes.join("\n")} node.argumentExpression = argumentExpression; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -20955,11 +21233,11 @@ ${lanes.join("\n")} } function updateElementAccessExpression(node, expression, argumentExpression) { if (isElementAccessChain(node)) { - return updateElementAccessChain2(node, expression, node.questionDotToken, argumentExpression); + return updateElementAccessChain(node, expression, node.questionDotToken, argumentExpression); } return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node; } - function createElementAccessChain2(expression, questionDotToken, index) { + function createElementAccessChain(expression, questionDotToken, index) { const node = createBaseElementAccessExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -20973,9 +21251,9 @@ ${lanes.join("\n")} node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updateElementAccessChain2(node, expression, questionDotToken, argumentExpression) { + function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain2(expression, questionDotToken, argumentExpression), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; } function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) { const node = createBaseDeclaration(210 /* CallExpression */); @@ -21002,7 +21280,7 @@ ${lanes.join("\n")} /*questionDotToken*/ void 0, asNodeArray(typeArguments), - parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray)) + parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) ); if (isImportKeyword(node.expression)) { node.transformFlags |= 8388608 /* ContainsDynamicImport */; @@ -21011,11 +21289,11 @@ ${lanes.join("\n")} } function updateCallExpression(node, expression, typeArguments, argumentsArray) { if (isCallChain(node)) { - return updateCallChain2(node, expression, node.questionDotToken, typeArguments, argumentsArray); + return updateCallChain(node, expression, node.questionDotToken, typeArguments, argumentsArray); } return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node; } - function createCallChain2(expression, questionDotToken, typeArguments, argumentsArray) { + function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { const node = createBaseCallExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -21024,15 +21302,15 @@ ${lanes.join("\n")} ), questionDotToken, asNodeArray(typeArguments), - parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray)) + parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) ); node.flags |= 32 /* OptionalChain */; node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updateCallChain2(node, expression, questionDotToken, typeArguments, argumentsArray) { + function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain2(expression, questionDotToken, typeArguments, argumentsArray), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; } function createNewExpression(expression, typeArguments, argumentsArray) { const node = createBaseDeclaration(211 /* NewExpression */); @@ -21069,34 +21347,33 @@ ${lanes.join("\n")} function updateTaggedTemplateExpression(node, tag, typeArguments, template) { return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node; } - function createTypeAssertion2(type, expression) { + function createTypeAssertion(type, expression) { const node = createBaseNode(213 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; return node; } - function updateTypeAssertion2(node, type, expression) { - return node.type !== type || node.expression !== expression ? update(createTypeAssertion2(type, expression), node) : node; + function updateTypeAssertion(node, type, expression) { + return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node; } function createParenthesizedExpression(expression) { const node = createBaseNode(214 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParenthesizedExpression(node, expression) { return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node; } - function createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { const node = createBaseDeclaration(215 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; @@ -21105,7 +21382,6 @@ ${lanes.join("\n")} node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21113,22 +21389,21 @@ ${lanes.join("\n")} node.returnFlowNode = void 0; return node; } - function updateFunctionExpression2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } - function createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { const node = createBaseDeclaration(216 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; - node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken3(38 /* EqualsGreaterThanToken */); + node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body); const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21136,8 +21411,8 @@ ${lanes.join("\n")} node.returnFlowNode = void 0; return node; } - function updateArrowFunction3(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; + function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; } function createDeleteExpression(expression) { const node = createBaseNode(217 /* DeleteExpression */); @@ -21226,7 +21501,6 @@ ${lanes.join("\n")} node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */; } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function propagateAssignmentPatternFlags(node) { @@ -21255,9 +21529,9 @@ ${lanes.join("\n")} function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { const node = createBaseNode(224 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); - node.questionToken = questionToken != null ? questionToken : createToken3(57 /* QuestionToken */); + node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); - node.colonToken = colonToken != null ? colonToken : createToken3(58 /* ColonToken */); + node.colonToken = colonToken != null ? colonToken : createToken(58 /* ColonToken */); node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse); node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse); return node; @@ -21265,15 +21539,15 @@ ${lanes.join("\n")} function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) { return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; } - function createTemplateExpression2(head, templateSpans) { + function createTemplateExpression(head, templateSpans) { const node = createBaseNode(225 /* TemplateExpression */); node.head = head; - node.templateSpans = createNodeArray2(templateSpans); + node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */; return node; } - function updateTemplateExpression2(node, head, templateSpans) { - return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression2(head, templateSpans), node) : node; + function updateTemplateExpression(node, head, templateSpans) { + return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression(head, templateSpans), node) : node; } function checkTemplateLiteralLikeNode(kind, text, rawText, templateFlags = 0 /* None */) { Debug.assert(!(templateFlags & ~2048 /* TemplateLiteralLikeFlags */), "Unsupported template flags."); @@ -21323,19 +21597,19 @@ ${lanes.join("\n")} } return createTemplateLiteralLikeToken(kind, text, rawText, templateFlags); } - function createTemplateHead2(text, rawText, templateFlags) { + function createTemplateHead(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); } - function createTemplateMiddle2(text, rawText, templateFlags) { + function createTemplateMiddle(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(16 /* TemplateMiddle */, text, rawText, templateFlags); } - function createTemplateTail2(text, rawText, templateFlags) { + function createTemplateTail(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(17 /* TemplateTail */, text, rawText, templateFlags); } - function createNoSubstitutionTemplateLiteral2(text, rawText, templateFlags) { + function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeDeclaration(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags); } @@ -21359,25 +21633,24 @@ ${lanes.join("\n")} function updateSpreadElement(node, expression) { return node.expression !== expression ? update(createSpreadElement(expression), node) : node; } - function createClassExpression3(modifiers, name, typeParameters, heritageClauses, members) { + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(228 /* ClassExpression */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateClassExpression3(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression3(modifiers, name, typeParameters, heritageClauses, members), node) : node; + function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function createOmittedExpression2() { + function createOmittedExpression() { return createBaseNode(229 /* OmittedExpression */); } - function createExpressionWithTypeArguments3(expression, typeArguments) { + function createExpressionWithTypeArguments(expression, typeArguments) { const node = createBaseNode(230 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -21388,20 +21661,20 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */; return node; } - function updateExpressionWithTypeArguments3(node, expression, typeArguments) { - return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments3(expression, typeArguments), node) : node; + function updateExpressionWithTypeArguments(node, expression, typeArguments) { + return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node; } - function createAsExpression2(expression, type) { + function createAsExpression(expression, type) { const node = createBaseNode(231 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; return node; } - function updateAsExpression2(node, expression, type) { - return node.expression !== expression || node.type !== type ? update(createAsExpression2(expression, type), node) : node; + function updateAsExpression(node, expression, type) { + return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node; } - function createNonNullExpression2(expression) { + function createNonNullExpression(expression) { const node = createBaseNode(232 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -21411,11 +21684,11 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; return node; } - function updateNonNullExpression2(node, expression) { + function updateNonNullExpression(node, expression) { if (isNonNullChain(node)) { - return updateNonNullChain2(node, expression); + return updateNonNullChain(node, expression); } - return node.expression !== expression ? update(createNonNullExpression2(expression), node) : node; + return node.expression !== expression ? update(createNonNullExpression(expression), node) : node; } function createSatisfiesExpression(expression, type) { const node = createBaseNode(235 /* SatisfiesExpression */); @@ -21427,7 +21700,7 @@ ${lanes.join("\n")} function updateSatisfiesExpression(node, expression, type) { return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node; } - function createNonNullChain2(expression) { + function createNonNullChain(expression) { const node = createBaseNode(232 /* NonNullExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( @@ -21438,11 +21711,11 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; return node; } - function updateNonNullChain2(node, expression) { + function updateNonNullChain(node, expression) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); - return node.expression !== expression ? update(createNonNullChain2(expression), node) : node; + return node.expression !== expression ? update(createNonNullChain(expression), node) : node; } - function createMetaProperty2(keywordToken, name) { + function createMetaProperty(keywordToken, name) { const node = createBaseNode(233 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; @@ -21460,72 +21733,67 @@ ${lanes.join("\n")} node.flowNode = void 0; return node; } - function updateMetaProperty2(node, name) { - return node.name !== name ? update(createMetaProperty2(node.keywordToken, name), node) : node; + function updateMetaProperty(node, name) { + return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node; } - function createTemplateSpan2(expression, literal) { + function createTemplateSpan(expression, literal) { const node = createBaseNode(236 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */; return node; } - function updateTemplateSpan2(node, expression, literal) { - return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan2(expression, literal), node) : node; + function updateTemplateSpan(node, expression, literal) { + return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node; } - function createSemicolonClassElement2() { + function createSemicolonClassElement() { const node = createBaseNode(237 /* SemicolonClassElement */); node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createBlock2(statements, multiLine) { + function createBlock(statements, multiLine) { const node = createBaseNode(238 /* Block */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateBlock2(node, statements) { - return node.statements !== statements ? update(createBlock2(statements, node.multiLine), node) : node; + function updateBlock(node, statements) { + return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node; } - function createVariableStatement2(modifiers, declarationList) { + function createVariableStatement(modifiers, declarationList) { const node = createBaseNode(240 /* VariableStatement */); node.modifiers = asNodeArray(modifiers); - node.declarationList = isArray(declarationList) ? createVariableDeclarationList2(declarationList) : declarationList; + node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function updateVariableStatement2(node, modifiers, declarationList) { - return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement2(modifiers, declarationList), node) : node; + function updateVariableStatement(node, modifiers, declarationList) { + return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node; } - function createEmptyStatement2() { + function createEmptyStatement() { const node = createBaseNode(239 /* EmptyStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function createExpressionStatement2(expression) { + function createExpressionStatement(expression) { const node = createBaseNode(241 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function updateExpressionStatement2(node, expression) { - return node.expression !== expression ? update(createExpressionStatement2(expression), node) : node; + function updateExpressionStatement(node, expression) { + return node.expression !== expression ? update(createExpressionStatement(expression), node) : node; } function createIfStatement(expression, thenStatement, elseStatement) { const node = createBaseNode(242 /* IfStatement */); @@ -21534,7 +21802,6 @@ ${lanes.join("\n")} node.elseStatement = asEmbeddedStatement(elseStatement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21547,7 +21814,6 @@ ${lanes.join("\n")} node.expression = expression; node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21560,7 +21826,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21575,7 +21840,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21591,7 +21855,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21610,7 +21873,6 @@ ${lanes.join("\n")} if (awaitModifier) node.transformFlags |= 128 /* ContainsES2018 */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21624,7 +21886,6 @@ ${lanes.join("\n")} node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21636,7 +21897,6 @@ ${lanes.join("\n")} node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21648,7 +21908,6 @@ ${lanes.join("\n")} node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21661,7 +21920,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21674,7 +21932,6 @@ ${lanes.join("\n")} node.caseBlock = caseBlock; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.possiblyExhaustive = false; return node; @@ -21688,7 +21945,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21700,7 +21956,6 @@ ${lanes.join("\n")} node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21714,21 +21969,19 @@ ${lanes.join("\n")} node.finallyBlock = finallyBlock; node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } function updateTryStatement(node, tryBlock, catchClause, finallyBlock) { return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; } - function createDebuggerStatement2() { + function createDebuggerStatement() { const node = createBaseNode(256 /* DebuggerStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function createVariableDeclaration3(name, exclamationToken, type, initializer) { + function createVariableDeclaration(name, exclamationToken, type, initializer) { var _a2; const node = createBaseDeclaration(257 /* VariableDeclaration */); node.name = asName(name); @@ -21737,32 +21990,31 @@ ${lanes.join("\n")} node.initializer = asInitializer(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateVariableDeclaration3(node, name, exclamationToken, type, initializer) { - return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration3(name, exclamationToken, type, initializer), node) : node; + function updateVariableDeclaration(node, name, exclamationToken, type, initializer) { + return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node; } - function createVariableDeclarationList2(declarations, flags2 = 0 /* None */) { + function createVariableDeclarationList(declarations, flags2 = 0 /* None */) { const node = createBaseNode(258 /* VariableDeclarationList */); node.flags |= flags2 & 3 /* BlockScoped */; - node.declarations = createNodeArray2(declarations); + node.declarations = createNodeArray(declarations); node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; if (flags2 & 3 /* BlockScoped */) { node.transformFlags |= 1024 /* ContainsES2015 */ | 262144 /* ContainsBlockScopedBinding */; } return node; } - function updateVariableDeclarationList2(node, declarations) { - return node.declarations !== declarations ? update(createVariableDeclarationList2(declarations, node.flags), node) : node; + function updateVariableDeclarationList(node, declarations) { + return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node; } - function createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { const node = createBaseDeclaration(259 /* FunctionDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body || modifiersToFlags(node.modifiers) & 2 /* Ambient */) { @@ -21773,32 +22025,32 @@ ${lanes.join("\n")} const isAsyncGenerator = isAsync && isGenerator; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; } - node.illegalDecorators = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; node.returnFlowNode = void 0; return node; } - function updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; + function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } function finishUpdateFunctionDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members) { + function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(260 /* ClassDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } else { @@ -21808,79 +22060,54 @@ ${lanes.join("\n")} } } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateClassDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members), node) : node; + function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members) { + function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(261 /* InterfaceDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? finishUpdateInterfaceDeclaration(createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members), node) : node; - } - function finishUpdateInterfaceDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function createTypeAliasDeclaration2(modifiers, name, typeParameters, type) { + function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { const node = createBaseDeclaration(262 /* TypeAliasDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? finishUpdateTypeAliasDeclaration(createTypeAliasDeclaration2(modifiers, name, typeParameters, type), node) : node; + function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? update(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; } - function finishUpdateTypeAliasDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createEnumDeclaration2(modifiers, name, members) { + function createEnumDeclaration(modifiers, name, members) { const node = createBaseDeclaration(263 /* EnumDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateEnumDeclaration2(node, modifiers, name, members) { - return node.modifiers !== modifiers || node.name !== name || node.members !== members ? finishUpdateEnumDeclaration(createEnumDeclaration2(modifiers, name, members), node) : node; + function updateEnumDeclaration(node, modifiers, name, members) { + return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createEnumDeclaration(modifiers, name, members), node) : node; } - function finishUpdateEnumDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createModuleDeclaration2(modifiers, name, body, flags2 = 0 /* None */) { + function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { const node = createBaseDeclaration(264 /* ModuleDeclaration */); node.modifiers = asNodeArray(modifiers); node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); @@ -21892,65 +22119,53 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateModuleDeclaration2(node, modifiers, name, body) { - return node.modifiers !== modifiers || node.name !== name || node.body !== body ? finishUpdateModuleDeclaration(createModuleDeclaration2(modifiers, name, body, node.flags), node) : node; - } - function finishUpdateModuleDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateModuleDeclaration(node, modifiers, name, body) { + return node.modifiers !== modifiers || node.name !== name || node.body !== body ? update(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; } - function createModuleBlock2(statements) { + function createModuleBlock(statements) { const node = createBaseNode(265 /* ModuleBlock */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateModuleBlock2(node, statements) { - return node.statements !== statements ? update(createModuleBlock2(statements), node) : node; + function updateModuleBlock(node, statements) { + return node.statements !== statements ? update(createModuleBlock(statements), node) : node; } - function createCaseBlock2(clauses) { + function createCaseBlock(clauses) { const node = createBaseNode(266 /* CaseBlock */); - node.clauses = createNodeArray2(clauses); + node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); node.locals = void 0; node.nextContainer = void 0; return node; } - function updateCaseBlock2(node, clauses) { - return node.clauses !== clauses ? update(createCaseBlock2(clauses), node) : node; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node; } - function createNamespaceExportDeclaration2(name) { + function createNamespaceExportDeclaration(name) { const node = createBaseDeclaration(267 /* NamespaceExportDeclaration */); node.name = asName(name); node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateNamespaceExportDeclaration2(node, name) { - return node.name !== name ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration2(name), node) : node; + function updateNamespaceExportDeclaration(node, name) { + return node.name !== name ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration(name), node) : node; } function finishUpdateNamespaceExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); } - function createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference) { + function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) { const node = createBaseDeclaration(268 /* ImportEqualsDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -21961,21 +22176,13 @@ ${lanes.join("\n")} node.transformFlags |= 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? finishUpdateImportEqualsDeclaration(createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference), node) : node; + function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; } - function finishUpdateImportEqualsDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause) { + function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) { const node = createBaseNode(269 /* ImportDeclaration */); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -21983,21 +22190,13 @@ ${lanes.join("\n")} node.assertClause = assertClause; node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateImportDeclaration(createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause), node) : node; - } - function finishUpdateImportDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) { + return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; } - function createImportClause3(isTypeOnly, name, namedBindings) { + function createImportClause(isTypeOnly, name, namedBindings) { const node = createBaseDeclaration(270 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; @@ -22009,12 +22208,12 @@ ${lanes.join("\n")} node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateImportClause3(node, isTypeOnly, name, namedBindings) { - return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause3(isTypeOnly, name, namedBindings), node) : node; + function updateImportClause(node, isTypeOnly, name, namedBindings) { + return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause(isTypeOnly, name, namedBindings), node) : node; } function createAssertClause(elements, multiLine) { const node = createBaseNode(296 /* AssertClause */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.multiLine = multiLine; node.transformFlags |= 4 /* ContainsESNext */; return node; @@ -22041,37 +22240,37 @@ ${lanes.join("\n")} function updateImportTypeAssertionContainer(node, clause, multiLine) { return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node; } - function createNamespaceImport2(name) { + function createNamespaceImport(name) { const node = createBaseDeclaration(271 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamespaceImport2(node, name) { - return node.name !== name ? update(createNamespaceImport2(name), node) : node; + function updateNamespaceImport(node, name) { + return node.name !== name ? update(createNamespaceImport(name), node) : node; } - function createNamespaceExport2(name) { + function createNamespaceExport(name) { const node = createBaseDeclaration(277 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamespaceExport2(node, name) { - return node.name !== name ? update(createNamespaceExport2(name), node) : node; + function updateNamespaceExport(node, name) { + return node.name !== name ? update(createNamespaceExport(name), node) : node; } - function createNamedImports2(elements) { + function createNamedImports(elements) { const node = createBaseNode(272 /* NamedImports */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamedImports2(node, elements) { - return node.elements !== elements ? update(createNamedImports2(elements), node) : node; + function updateNamedImports(node, elements) { + return node.elements !== elements ? update(createNamedImports(elements), node) : node; } - function createImportSpecifier2(isTypeOnly, propertyName, name) { + function createImportSpecifier(isTypeOnly, propertyName, name) { const node = createBaseDeclaration(273 /* ImportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = propertyName; @@ -22080,10 +22279,10 @@ ${lanes.join("\n")} node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateImportSpecifier2(node, isTypeOnly, propertyName, name) { - return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier2(isTypeOnly, propertyName, name), node) : node; + function updateImportSpecifier(node, isTypeOnly, propertyName, name) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node; } - function createExportAssignment3(modifiers, isExportEquals, expression) { + function createExportAssignment2(modifiers, isExportEquals, expression) { const node = createBaseDeclaration(274 /* ExportAssignment */); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -22095,21 +22294,13 @@ ${lanes.join("\n")} ) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportAssignment2(node, modifiers, expression) { - return node.modifiers !== modifiers || node.expression !== expression ? finishUpdateExportAssignment(createExportAssignment3(modifiers, node.isExportEquals, expression), node) : node; - } - function finishUpdateExportAssignment(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateExportAssignment(node, modifiers, expression) { + return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node; } - function createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { const node = createBaseDeclaration(275 /* ExportDeclaration */); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -22118,31 +22309,31 @@ ${lanes.join("\n")} node.assertClause = assertClause; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; + function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; } function finishUpdateExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return update(updated, original); } - function createNamedExports2(elements) { + function createNamedExports(elements) { const node = createBaseNode(276 /* NamedExports */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamedExports2(node, elements) { - return node.elements !== elements ? update(createNamedExports2(elements), node) : node; + function updateNamedExports(node, elements) { + return node.elements !== elements ? update(createNamedExports(elements), node) : node; } - function createExportSpecifier2(isTypeOnly, propertyName, name) { + function createExportSpecifier(isTypeOnly, propertyName, name) { const node = createBaseNode(278 /* ExportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = asName(propertyName); @@ -22150,27 +22341,25 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportSpecifier2(node, isTypeOnly, propertyName, name) { - return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier2(isTypeOnly, propertyName, name), node) : node; + function updateExportSpecifier(node, isTypeOnly, propertyName, name) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createMissingDeclaration() { const node = createBaseDeclaration(279 /* MissingDeclaration */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function createExternalModuleReference2(expression) { + function createExternalModuleReference(expression) { const node = createBaseNode(280 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateExternalModuleReference2(node, expression) { - return node.expression !== expression ? update(createExternalModuleReference2(expression), node) : node; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression ? update(createExternalModuleReference(expression), node) : node; } function createJSDocPrimaryTypeWorker(kind) { return createBaseNode(kind); @@ -22200,7 +22389,6 @@ ${lanes.join("\n")} node.type = type; node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -22209,40 +22397,39 @@ ${lanes.join("\n")} function updateJSDocFunctionType(node, parameters, type) { return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node; } - function createJSDocTypeLiteral2(propertyTags, isArrayType = false) { + function createJSDocTypeLiteral(propertyTags, isArrayType = false) { const node = createBaseDeclaration(325 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; } function updateJSDocTypeLiteral(node, propertyTags, isArrayType) { - return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral2(propertyTags, isArrayType), node) : node; + return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; } - function createJSDocTypeExpression2(type) { + function createJSDocTypeExpression(type) { const node = createBaseNode(312 /* JSDocTypeExpression */); node.type = type; return node; } function updateJSDocTypeExpression(node, type) { - return node.type !== type ? update(createJSDocTypeExpression2(type), node) : node; + return node.type !== type ? update(createJSDocTypeExpression(type), node) : node; } - function createJSDocSignature2(typeParameters, parameters, type) { + function createJSDocSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(326 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } function updateJSDocSignature(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? update(createJSDocSignature2(typeParameters, parameters, type), node) : node; + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? update(createJSDocSignature(typeParameters, parameters, type), node) : node; } function getDefaultTagName(node) { const defaultTagName = getDefaultTagNameForKind(node.kind); - return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier3(defaultTagName); + return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier(defaultTagName); } function createBaseJSDocTag(kind, tagName, comment) { const node = createBaseNode(kind); @@ -22256,17 +22443,17 @@ ${lanes.join("\n")} node.comment = comment; return node; } - function createJSDocTemplateTag2(tagName, constraint, typeParameters, comment) { - const node = createBaseJSDocTag(348 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment); + function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { + const node = createBaseJSDocTag(348 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment); node.constraint = constraint; - node.typeParameters = createNodeArray2(typeParameters); + node.typeParameters = createNodeArray(typeParameters); return node; } function updateJSDocTemplateTag(node, tagName = getDefaultTagName(node), constraint, typeParameters, comment) { - return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag2(tagName, constraint, typeParameters, comment), node) : node; + return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; } - function createJSDocTypedefTag2(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(349 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment); + function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { + const node = createBaseJSDocTagDeclaration(349 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -22275,10 +22462,10 @@ ${lanes.join("\n")} return node; } function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag2(tagName, typeExpression, fullName, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; } - function createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(344 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment); + function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { + const node = createBaseJSDocTagDeclaration(344 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -22286,10 +22473,10 @@ ${lanes.join("\n")} return node; } function updateJSDocParameterTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { - return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; + return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } - function createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(351 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment); + function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { + const node = createBaseJSDocTagDeclaration(351 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -22297,10 +22484,10 @@ ${lanes.join("\n")} return node; } function updateJSDocPropertyTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { - return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; + return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } - function createJSDocCallbackTag2(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment); + function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { + const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -22309,31 +22496,31 @@ ${lanes.join("\n")} return node; } function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag2(tagName, typeExpression, fullName, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocOverloadTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTag(342 /* JSDocOverloadTag */, tagName != null ? tagName : createIdentifier3("overload"), comment); + const node = createBaseJSDocTag(342 /* JSDocOverloadTag */, tagName != null ? tagName : createIdentifier("overload"), comment); node.typeExpression = typeExpression; return node; } function updateJSDocOverloadTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocOverloadTag(tagName, typeExpression, comment), node) : node; } - function createJSDocAugmentsTag2(tagName, className, comment) { - const node = createBaseJSDocTag(331 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment); + function createJSDocAugmentsTag(tagName, className, comment) { + const node = createBaseJSDocTag(331 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } function updateJSDocAugmentsTag(node, tagName = getDefaultTagName(node), className, comment) { - return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag2(tagName, className, comment), node) : node; + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node; } - function createJSDocImplementsTag2(tagName, className, comment) { - const node = createBaseJSDocTag(332 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment); + function createJSDocImplementsTag(tagName, className, comment) { + const node = createBaseJSDocTag(332 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } function createJSDocSeeTag(tagName, name, comment) { - const node = createBaseJSDocTag(350 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment); + const node = createBaseJSDocTag(350 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment); node.name = name; return node; } @@ -22386,17 +22573,17 @@ ${lanes.join("\n")} return node.name !== name ? update(createJSDocLinkPlain(name, text), node) : node; } function updateJSDocImplementsTag(node, tagName = getDefaultTagName(node), className, comment) { - return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocImplementsTag2(tagName, className, comment), node) : node; + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocImplementsTag(tagName, className, comment), node) : node; } function createJSDocSimpleTagWorker(kind, tagName, comment) { - const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(kind)), comment); + const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); return node; } function updateJSDocSimpleTagWorker(kind, node, tagName = getDefaultTagName(node), comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocSimpleTagWorker(kind, tagName, comment), node) : node; } function createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment) { - const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(kind)), comment); + const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); node.typeExpression = typeExpression; return node; } @@ -22410,15 +22597,15 @@ ${lanes.join("\n")} function updateJSDocUnknownTag(node, tagName, comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node; } - function createJSDocEnumTag2(tagName, typeExpression, comment) { - const node = createBaseJSDocTagDeclaration(343 /* JSDocEnumTag */, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(343 /* JSDocEnumTag */)), comment); + function createJSDocEnumTag(tagName, typeExpression, comment) { + const node = createBaseJSDocTagDeclaration(343 /* JSDocEnumTag */, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(343 /* JSDocEnumTag */)), comment); node.typeExpression = typeExpression; node.locals = void 0; node.nextContainer = void 0; return node; } function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag2(tagName, typeExpression, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node; } function createJSDocText(text) { const node = createBaseNode(324 /* JSDocText */); @@ -22428,27 +22615,27 @@ ${lanes.join("\n")} function updateJSDocText(node, text) { return node.text !== text ? update(createJSDocText(text), node) : node; } - function createJSDocComment2(comment, tags) { + function createJSDocComment(comment, tags) { const node = createBaseNode(323 /* JSDoc */); node.comment = comment; node.tags = asNodeArray(tags); return node; } function updateJSDocComment(node, comment, tags) { - return node.comment !== comment || node.tags !== tags ? update(createJSDocComment2(comment, tags), node) : node; + return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node; } - function createJsxElement2(openingElement, children, closingElement) { + function createJsxElement(openingElement, children, closingElement) { const node = createBaseNode(281 /* JsxElement */); node.openingElement = openingElement; - node.children = createNodeArray2(children); + node.children = createNodeArray(children); node.closingElement = closingElement; node.transformFlags |= propagateChildFlags(node.openingElement) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingElement) | 2 /* ContainsJsx */; return node; } - function updateJsxElement2(node, openingElement, children, closingElement) { - return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement2(openingElement, children, closingElement), node) : node; + function updateJsxElement(node, openingElement, children, closingElement) { + return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node; } - function createJsxSelfClosingElement2(tagName, typeArguments, attributes) { + function createJsxSelfClosingElement(tagName, typeArguments, attributes) { const node = createBaseNode(282 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); @@ -22459,10 +22646,10 @@ ${lanes.join("\n")} } return node; } - function updateJsxSelfClosingElement2(node, tagName, typeArguments, attributes) { - return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement2(tagName, typeArguments, attributes), node) : node; + function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; } - function createJsxOpeningElement2(tagName, typeArguments, attributes) { + function createJsxOpeningElement(tagName, typeArguments, attributes) { const node = createBaseNode(283 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); @@ -22473,112 +22660,111 @@ ${lanes.join("\n")} } return node; } - function updateJsxOpeningElement2(node, tagName, typeArguments, attributes) { - return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement2(tagName, typeArguments, attributes), node) : node; + function updateJsxOpeningElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; } - function createJsxClosingElement2(tagName) { + function createJsxClosingElement(tagName) { const node = createBaseNode(284 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */; return node; } - function updateJsxClosingElement2(node, tagName) { - return node.tagName !== tagName ? update(createJsxClosingElement2(tagName), node) : node; + function updateJsxClosingElement(node, tagName) { + return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node; } - function createJsxFragment2(openingFragment, children, closingFragment) { + function createJsxFragment(openingFragment, children, closingFragment) { const node = createBaseNode(285 /* JsxFragment */); node.openingFragment = openingFragment; - node.children = createNodeArray2(children); + node.children = createNodeArray(children); node.closingFragment = closingFragment; node.transformFlags |= propagateChildFlags(node.openingFragment) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingFragment) | 2 /* ContainsJsx */; return node; } - function updateJsxFragment2(node, openingFragment, children, closingFragment) { - return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update(createJsxFragment2(openingFragment, children, closingFragment), node) : node; + function updateJsxFragment(node, openingFragment, children, closingFragment) { + return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update(createJsxFragment(openingFragment, children, closingFragment), node) : node; } - function createJsxText2(text, containsOnlyTriviaWhiteSpaces) { + function createJsxText(text, containsOnlyTriviaWhiteSpaces) { const node = createBaseNode(11 /* JsxText */); node.text = text; node.containsOnlyTriviaWhiteSpaces = !!containsOnlyTriviaWhiteSpaces; node.transformFlags |= 2 /* ContainsJsx */; return node; } - function updateJsxText2(node, text, containsOnlyTriviaWhiteSpaces) { - return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText2(text, containsOnlyTriviaWhiteSpaces), node) : node; + function updateJsxText(node, text, containsOnlyTriviaWhiteSpaces) { + return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; } - function createJsxOpeningFragment2() { + function createJsxOpeningFragment() { const node = createBaseNode(286 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } - function createJsxJsxClosingFragment2() { + function createJsxJsxClosingFragment() { const node = createBaseNode(287 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } - function createJsxAttribute2(name, initializer) { + function createJsxAttribute(name, initializer) { const node = createBaseDeclaration(288 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */; return node; } - function updateJsxAttribute2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute2(name, initializer), node) : node; + function updateJsxAttribute(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node; } - function createJsxAttributes2(properties) { + function createJsxAttributes(properties) { const node = createBaseDeclaration(289 /* JsxAttributes */); - node.properties = createNodeArray2(properties); + node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */; return node; } - function updateJsxAttributes2(node, properties) { - return node.properties !== properties ? update(createJsxAttributes2(properties), node) : node; + function updateJsxAttributes(node, properties) { + return node.properties !== properties ? update(createJsxAttributes(properties), node) : node; } - function createJsxSpreadAttribute2(expression) { + function createJsxSpreadAttribute(expression) { const node = createBaseNode(290 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; } - function updateJsxSpreadAttribute2(node, expression) { - return node.expression !== expression ? update(createJsxSpreadAttribute2(expression), node) : node; + function updateJsxSpreadAttribute(node, expression) { + return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node; } - function createJsxExpression2(dotDotDotToken, expression) { + function createJsxExpression(dotDotDotToken, expression) { const node = createBaseNode(291 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; } - function updateJsxExpression2(node, expression) { - return node.expression !== expression ? update(createJsxExpression2(node.dotDotDotToken, expression), node) : node; + function updateJsxExpression(node, expression) { + return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node; } - function createCaseClause2(expression, statements) { + function createCaseClause(expression, statements) { const node = createBaseNode(292 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateCaseClause2(node, expression, statements) { - return node.expression !== expression || node.statements !== statements ? update(createCaseClause2(expression, statements), node) : node; + function updateCaseClause(node, expression, statements) { + return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node; } - function createDefaultClause2(statements) { + function createDefaultClause(statements) { const node = createBaseNode(293 /* DefaultClause */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; } - function updateDefaultClause2(node, statements) { - return node.statements !== statements ? update(createDefaultClause2(statements), node) : node; + function updateDefaultClause(node, statements) { + return node.statements !== statements ? update(createDefaultClause(statements), node) : node; } - function createHeritageClause2(token, types) { + function createHeritageClause(token, types) { const node = createBaseNode(294 /* HeritageClause */); node.token = token; - node.types = createNodeArray2(types); + node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); switch (token) { case 94 /* ExtendsKeyword */: @@ -22592,10 +22778,10 @@ ${lanes.join("\n")} } return node; } - function updateHeritageClause2(node, types) { - return node.types !== types ? update(createHeritageClause2(node.token, types), node) : node; + function updateHeritageClause(node, types) { + return node.types !== types ? update(createHeritageClause(node.token, types), node) : node; } - function createCatchClause2(variableDeclaration, block) { + function createCatchClause(variableDeclaration, block) { const node = createBaseNode(295 /* CatchClause */); node.variableDeclaration = asVariableDeclaration(variableDeclaration); node.block = block; @@ -22604,87 +22790,79 @@ ${lanes.join("\n")} node.nextContainer = void 0; return node; } - function updateCatchClause2(node, variableDeclaration, block) { - return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause2(variableDeclaration, block), node) : node; + function updateCatchClause(node, variableDeclaration, block) { + return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node; } - function createPropertyAssignment2(name, initializer) { + function createPropertyAssignment(name, initializer) { const node = createBaseDeclaration(299 /* PropertyAssignment */); node.name = asName(name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updatePropertyAssignment2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment2(name, initializer), node) : node; + function updatePropertyAssignment(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment(name, initializer), node) : node; } function finishUpdatePropertyAssignment(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; } return update(updated, original); } - function createShorthandPropertyAssignment2(name, objectAssignmentInitializer) { + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { const node = createBaseDeclaration(300 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; node.equalsToken = void 0; - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateShorthandPropertyAssignment2(node, name, objectAssignmentInitializer) { - return node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment2(name, objectAssignmentInitializer), node) : node; + function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { + return node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node) : node; } function finishUpdateShorthandPropertyAssignment(updated, original) { if (updated !== original) { - updated.equalsToken = original.equalsToken; - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; + updated.equalsToken = original.equalsToken; } return update(updated, original); } - function createSpreadAssignment2(expression) { + function createSpreadAssignment(expression) { const node = createBaseDeclaration(301 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateSpreadAssignment2(node, expression) { - return node.expression !== expression ? update(createSpreadAssignment2(expression), node) : node; + function updateSpreadAssignment(node, expression) { + return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node; } - function createEnumMember2(name, initializer) { + function createEnumMember(name, initializer) { const node = createBaseDeclaration(302 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateEnumMember2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? update(createEnumMember2(name, initializer), node) : node; + function updateEnumMember(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node; } function createSourceFile2(statements, endOfFileToken, flags2) { const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags2; node.text = ""; @@ -22785,7 +22963,7 @@ ${lanes.join("\n")} } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { const node = cloneSourceFile(source); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.isDeclarationFile = isDeclarationFile; node.referencedFiles = referencedFiles; node.typeReferenceDirectives = typeReferences; @@ -22797,7 +22975,7 @@ ${lanes.join("\n")} function updateSourceFile2(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) { return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; } - function createBundle2(sourceFiles, prepends = emptyArray) { + function createBundle(sourceFiles, prepends = emptyArray) { const node = createBaseNode(309 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; @@ -22807,8 +22985,8 @@ ${lanes.join("\n")} node.hasNoDefaultLib = void 0; return node; } - function updateBundle2(node, sourceFiles, prepends = emptyArray) { - return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle2(sourceFiles, prepends), node) : node; + function updateBundle(node, sourceFiles, prepends = emptyArray) { + return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle(sourceFiles, prepends), node) : node; } function createUnparsedSource(prologues, syntheticReferences, texts) { const node = createBaseNode(310 /* UnparsedSource */); @@ -22858,26 +23036,26 @@ ${lanes.join("\n")} return node; } function createSyntaxList3(children) { - const node = createBaseNode(353 /* SyntaxList */); + const node = createBaseNode(354 /* SyntaxList */); node._children = children; return node; } - function createNotEmittedStatement2(original) { - const node = createBaseNode(354 /* NotEmittedStatement */); + function createNotEmittedStatement(original) { + const node = createBaseNode(355 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; } - function createPartiallyEmittedExpression2(expression, original) { - const node = createBaseNode(355 /* PartiallyEmittedExpression */); + function createPartiallyEmittedExpression(expression, original) { + const node = createBaseNode(356 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; setTextRange(node, original); return node; } - function updatePartiallyEmittedExpression2(node, expression) { - return node.expression !== expression ? update(createPartiallyEmittedExpression2(expression, node.original), node) : node; + function updatePartiallyEmittedExpression(node, expression) { + return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node; } function flattenCommaElements(node) { if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { @@ -22891,8 +23069,8 @@ ${lanes.join("\n")} return node; } function createCommaListExpression(elements) { - const node = createBaseNode(356 /* CommaListExpression */); - node.elements = createNodeArray2(sameFlatMap(elements, flattenCommaElements)); + const node = createBaseNode(357 /* CommaListExpression */); + node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; } @@ -22900,19 +23078,19 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; } function createEndOfDeclarationMarker(original) { - const node = createBaseNode(358 /* EndOfDeclarationMarker */); + const node = createBaseNode(359 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createMergeDeclarationMarker(original) { - const node = createBaseNode(357 /* MergeDeclarationMarker */); + const node = createBaseNode(358 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(359 /* SyntheticReferenceExpression */); + const node = createBaseNode(360 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); @@ -22922,36 +23100,32 @@ ${lanes.join("\n")} return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node; } function cloneGeneratedIdentifier(node) { - const clone2 = createBaseIdentifier( - node.escapedText, - /*originalKeywordKind*/ - void 0 - ); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function cloneIdentifier(node) { - const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.typeArguments = node.typeArguments; - clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape; clone2.jsDoc = node.jsDoc; - clone2.jsDocCache = node.jsDocCache; clone2.flowNode = node.flowNode; clone2.symbol = node.symbol; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + const typeArguments = getIdentifierTypeArguments(node); + if (typeArguments) + setIdentifierTypeArguments(clone2, typeArguments); return clone2; } function cloneGeneratedPrivateIdentifier(node) { const clone2 = createBasePrivateIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function clonePrivateIdentifier(node) { @@ -22992,9 +23166,9 @@ ${lanes.join("\n")} } return clone2; } - function createImmediatelyInvokedFunctionExpression2(statements, param, paramValue) { + function createImmediatelyInvokedFunctionExpression(statements, param, paramValue) { return createCallExpression( - createFunctionExpression2( + createFunctionExpression( /*modifiers*/ void 0, /*asteriskToken*/ @@ -23007,7 +23181,7 @@ ${lanes.join("\n")} param ? [param] : [], /*type*/ void 0, - createBlock2( + createBlock( statements, /*multiLine*/ true @@ -23019,9 +23193,9 @@ ${lanes.join("\n")} paramValue ? [paramValue] : [] ); } - function createImmediatelyInvokedArrowFunction2(statements, param, paramValue) { + function createImmediatelyInvokedArrowFunction(statements, param, paramValue) { return createCallExpression( - createArrowFunction3( + createArrowFunction( /*modifiers*/ void 0, /*typeParameters*/ @@ -23032,7 +23206,7 @@ ${lanes.join("\n")} void 0, /*equalsGreaterThanToken*/ void 0, - createBlock2( + createBlock( statements, /*multiLine*/ true @@ -23044,11 +23218,11 @@ ${lanes.join("\n")} paramValue ? [paramValue] : [] ); } - function createVoidZero2() { - return createVoidExpression(createNumericLiteral2("0")); + function createVoidZero() { + return createVoidExpression(createNumericLiteral("0")); } - function createExportDefault2(expression) { - return createExportAssignment3( + function createExportDefault(expression) { + return createExportAssignment2( /*modifiers*/ void 0, /*isExportEquals*/ @@ -23056,14 +23230,14 @@ ${lanes.join("\n")} expression ); } - function createExternalModuleExport2(exportName) { - return createExportDeclaration3( + function createExternalModuleExport(exportName) { + return createExportDeclaration( /*modifiers*/ void 0, /*isTypeOnly*/ false, - createNamedExports2([ - createExportSpecifier2( + createNamedExports([ + createExportSpecifier( /*isTypeOnly*/ false, /*propertyName*/ @@ -23074,12 +23248,12 @@ ${lanes.join("\n")} ); } function createTypeCheck(value, tag) { - return tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero2()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral2(tag)); + return tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral(tag)); } function createMethodCall(object, methodName, argumentsList) { if (isCallChain(object)) { - return createCallChain2( - createPropertyAccessChain2( + return createCallChain( + createPropertyAccessChain( object, /*questionDotToken*/ void 0, @@ -23109,7 +23283,7 @@ ${lanes.join("\n")} return createMethodCall(target, "apply", [thisArg, argumentsExpression]); } function createGlobalMethodCall(globalObjectName, methodName, argumentsList) { - return createMethodCall(createIdentifier3(globalObjectName), methodName, argumentsList); + return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList); } function createArraySliceCall(array, start) { return createMethodCall(array, "slice", start === void 0 ? [] : [asExpression(start)]); @@ -23120,6 +23294,9 @@ ${lanes.join("\n")} function createObjectDefinePropertyCall(target, propertyName, attributes) { return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); } + function createObjectGetOwnPropertyDescriptorCall(target, propertyName) { + return createGlobalMethodCall("Object", "getOwnPropertyDescriptor", [target, asExpression(propertyName)]); + } function createReflectGetCall(target, propertyKey, receiver) { return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); } @@ -23128,7 +23305,7 @@ ${lanes.join("\n")} } function tryAddPropertyAssignment(properties, propertyName, expression) { if (expression) { - properties.push(createPropertyAssignment2(propertyName, expression)); + properties.push(createPropertyAssignment(propertyName, expression)); return true; } return false; @@ -23149,15 +23326,15 @@ ${lanes.join("\n")} case 214 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); case 213 /* TypeAssertionExpression */: - return updateTypeAssertion2(outerExpression, outerExpression.type, expression); + return updateTypeAssertion(outerExpression, outerExpression.type, expression); case 231 /* AsExpression */: - return updateAsExpression2(outerExpression, expression, outerExpression.type); + return updateAsExpression(outerExpression, expression, outerExpression.type); case 235 /* SatisfiesExpression */: return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); case 232 /* NonNullExpression */: - return updateNonNullExpression2(outerExpression, expression); - case 355 /* PartiallyEmittedExpression */: - return updatePartiallyEmittedExpression2(outerExpression, expression); + return updateNonNullExpression(outerExpression, expression); + case 356 /* PartiallyEmittedExpression */: + return updatePartiallyEmittedExpression(outerExpression, expression); } } function isIgnorableParen(node) { @@ -23213,13 +23390,13 @@ ${lanes.join("\n")} let thisArg; let target; if (isSuperProperty(callee)) { - thisArg = createThis2(); + thisArg = createThis(); target = callee; } else if (isSuperKeyword(callee)) { - thisArg = createThis2(); - target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier3("_super"), callee) : callee; + thisArg = createThis(); + target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier("_super"), callee) : callee; } else if (getEmitFlags(callee) & 8192 /* HelperName */) { - thisArg = createVoidZero2(); + thisArg = createVoidZero(); target = parenthesizerRules().parenthesizeLeftSideOfAccess( callee, /*optionalChain*/ @@ -23227,7 +23404,7 @@ ${lanes.join("\n")} ); } else if (isPropertyAccessExpression(callee)) { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable3(recordTempVariable); + thisArg = createTempVariable(recordTempVariable); target = createPropertyAccessExpression( setTextRange( factory2.createAssignment( @@ -23245,7 +23422,7 @@ ${lanes.join("\n")} } } else if (isElementAccessExpression(callee)) { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable3(recordTempVariable); + thisArg = createTempVariable(recordTempVariable); target = createElementAccessExpression( setTextRange( factory2.createAssignment( @@ -23262,7 +23439,7 @@ ${lanes.join("\n")} target = callee; } } else { - thisArg = createVoidZero2(); + thisArg = createVoidZero(); target = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -23293,8 +23470,8 @@ ${lanes.join("\n")} /*initializer*/ void 0 )], - createBlock2([ - createExpressionStatement2(expression) + createBlock([ + createExpressionStatement(expression) ]) ) ]) @@ -23318,7 +23495,7 @@ ${lanes.join("\n")} setEmitFlags(name, emitFlags); return name; } - return getGeneratedNameForNode3(node); + return getGeneratedNameForNode(node); } function getInternalName(node, allowComments, allowSourceMaps) { return getName(node, allowComments, allowSourceMaps, 32768 /* LocalName */ | 65536 /* InternalName */); @@ -23358,7 +23535,7 @@ ${lanes.join("\n")} return isStringLiteral(node.expression) && node.expression.text === "use strict"; } function createUseStrictPrologue() { - return startOnNewLine(createExpressionStatement2(createStringLiteral2("use strict"))); + return startOnNewLine(createExpressionStatement(createStringLiteral("use strict"))); } function copyStandardPrologue(source, target, statementOffset = 0, ensureUseStrict2) { Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); @@ -23397,13 +23574,13 @@ ${lanes.join("\n")} function ensureUseStrict(statements) { const foundUseStrict = findUseStrictPrologue(statements); if (!foundUseStrict) { - return setTextRange(createNodeArray2([createUseStrictPrologue(), ...statements]), statements); + return setTextRange(createNodeArray([createUseStrictPrologue(), ...statements]), statements); } return statements; } function liftToBlock(nodes) { Debug.assert(every(nodes, isStatementOrBlock), "Cannot lift nodes to a Block."); - return singleOrUndefined(nodes) || createBlock2(nodes); + return singleOrUndefined(nodes) || createBlock(nodes); } function findSpanEnd(array, test, start) { let i = start; @@ -23452,7 +23629,7 @@ ${lanes.join("\n")} } } if (isNodeArray(statements)) { - return setTextRange(createNodeArray2(left, statements.hasTrailingComma), statements); + return setTextRange(createNodeArray(left, statements.hasTrailingComma), statements); } return statements; } @@ -23460,33 +23637,33 @@ ${lanes.join("\n")} var _a2; let modifierArray; if (typeof modifiers === "number") { - modifierArray = createModifiersFromModifierFlags2(modifiers); + modifierArray = createModifiersFromModifierFlags(modifiers); } else { modifierArray = modifiers; } - return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node); + return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node); } function asNodeArray(array) { - return array ? createNodeArray2(array) : void 0; + return array ? createNodeArray(array) : void 0; } function asName(name) { - return typeof name === "string" ? createIdentifier3(name) : name; + return typeof name === "string" ? createIdentifier(name) : name; } function asExpression(value) { - return typeof value === "string" ? createStringLiteral2(value) : typeof value === "number" ? createNumericLiteral2(value) : typeof value === "boolean" ? value ? createTrue2() : createFalse2() : value; + return typeof value === "string" ? createStringLiteral(value) : typeof value === "number" ? createNumericLiteral(value) : typeof value === "boolean" ? value ? createTrue() : createFalse() : value; } function asInitializer(node) { return node && parenthesizerRules().parenthesizeExpressionForDisallowedComma(node); } function asToken(value) { - return typeof value === "number" ? createToken3(value) : value; + return typeof value === "number" ? createToken(value) : value; } function asEmbeddedStatement(statement) { - return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement2(), statement), statement) : statement; + return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement; } function asVariableDeclaration(variableDeclaration) { if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) { - return createVariableDeclaration3( + return createVariableDeclaration( variableDeclaration, /*exclamationToken*/ void 0, @@ -23690,7 +23867,7 @@ ${lanes.join("\n")} case 213 /* TypeAssertionExpression */: case 235 /* SatisfiesExpression */: case 231 /* AsExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 214 /* ParenthesizedExpression */: case 106 /* SuperKeyword */: return -2147483648 /* OuterExpressionExcludes */; @@ -23963,6 +24140,7 @@ ${lanes.join("\n")} function mergeEmitNode(sourceEmitNode, destEmitNode) { const { flags, + internalFlags, leadingComments, trailingComments, commentRange, @@ -23980,7 +24158,9 @@ ${lanes.join("\n")} if (trailingComments) destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); if (flags) - destEmitNode.flags = flags & ~536870912 /* Immutable */; + destEmitNode.flags = flags; + if (internalFlags) + destEmitNode.internalFlags = internalFlags & ~8 /* Immutable */; if (commentRange) destEmitNode.commentRange = commentRange; if (sourceMapRange) @@ -24049,7 +24229,7 @@ ${lanes.join("\n")} } node.emitNode = {}; } else { - Debug.assert(!(node.emitNode.flags & 536870912 /* Immutable */), "Invalid attempt to mutate an immutable node."); + Debug.assert(!(node.emitNode.internalFlags & 8 /* Immutable */), "Invalid attempt to mutate an immutable node."); } return node.emitNode; } @@ -24078,6 +24258,15 @@ ${lanes.join("\n")} emitNode.flags = emitNode.flags | emitFlags; return node; } + function setInternalEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).internalFlags = emitFlags; + return node; + } + function addInternalEmitFlags(node, emitFlags) { + const emitNode = getOrCreateEmitNode(node); + emitNode.internalFlags = emitNode.internalFlags | emitFlags; + return node; + } function getSourceMapRange(node) { var _a2, _b; return (_b = (_a2 = node.emitNode) == null ? void 0 : _a2.sourceMapRange) != null ? _b : node; @@ -24208,7 +24397,7 @@ ${lanes.join("\n")} return node; } function ignoreSourceNewlines(node) { - getOrCreateEmitNode(node).flags |= 268435456 /* IgnoreSourceNewlines */; + getOrCreateEmitNode(node).internalFlags |= 4 /* IgnoreSourceNewlines */; return node; } function setTypeNode(node, type) { @@ -24220,6 +24409,30 @@ ${lanes.join("\n")} var _a2; return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode; } + function setIdentifierTypeArguments(node, typeArguments) { + getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; + return node; + } + function getIdentifierTypeArguments(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments; + } + function setIdentifierAutoGenerate(node, autoGenerate) { + getOrCreateEmitNode(node).autoGenerate = autoGenerate; + return node; + } + function getIdentifierAutoGenerate(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + } + function setIdentifierGeneratedImportReference(node, value) { + getOrCreateEmitNode(node).generatedImportReference = value; + return node; + } + function getIdentifierGeneratedImportReference(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference; + } var init_emitNode = __esm({ "src/compiler/factory/emitNode.ts"() { "use strict"; @@ -24230,14 +24443,17 @@ ${lanes.join("\n")} // src/compiler/factory/emitHelpers.ts function createEmitHelperFactory(context) { const factory2 = context.factory; - const immutableTrue = memoize(() => setEmitFlags(factory2.createTrue(), 536870912 /* Immutable */)); - const immutableFalse = memoize(() => setEmitFlags(factory2.createFalse(), 536870912 /* Immutable */)); + const immutableTrue = memoize(() => setInternalEmitFlags(factory2.createTrue(), 8 /* Immutable */)); + const immutableFalse = memoize(() => setInternalEmitFlags(factory2.createFalse(), 8 /* Immutable */)); return { getUnscopedHelperName, // TypeScript Helpers createDecorateHelper, createMetadataHelper, createParamHelper, + // ES Decorators Helpers + createESDecorateHelper, + createRunInitializersHelper, // ES2018 Helpers createAssignHelper, createAwaitHelper, @@ -24252,6 +24468,8 @@ ${lanes.join("\n")} createExtendsHelper, createTemplateObjectHelper, createSpreadArrayHelper, + createPropKeyHelper, + createSetFunctionNameHelper, // ES2015 Destructuring Helpers createValuesHelper, createReadHelper, @@ -24320,6 +24538,50 @@ ${lanes.join("\n")} location ); } + function createESDecorateClassContextObject(contextIn) { + return factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral("class")), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) + ]); + } + function createESDecorateClassElementContextObject(contextIn) { + return factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), + factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()) + // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494 + // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) + ]); + } + function createESDecorateContextObject(contextIn) { + return contextIn.kind === "class" ? createESDecorateClassContextObject(contextIn) : createESDecorateClassElementContextObject(contextIn); + } + function createESDecorateHelper(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + context.requestEmitHelper(esDecorateHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__esDecorate"), + /*typeArguments*/ + void 0, + [ + ctor != null ? ctor : factory2.createNull(), + descriptorIn != null ? descriptorIn : factory2.createNull(), + decorators, + createESDecorateContextObject(contextIn), + initializers, + extraInitializers + ] + ); + } + function createRunInitializersHelper(thisArg, initializers, value) { + context.requestEmitHelper(runInitializersHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__runInitializers"), + /*typeArguments*/ + void 0, + value ? [thisArg, initializers, value] : [thisArg, initializers] + ); + } function createAssignHelper(attributesSegments) { if (getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { return factory2.createCallExpression( @@ -24476,6 +24738,24 @@ ${lanes.join("\n")} [to, from, packFrom ? immutableTrue() : immutableFalse()] ); } + function createPropKeyHelper(expr) { + context.requestEmitHelper(propKeyHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__propKey"), + /*typeArguments*/ + void 0, + [expr] + ); + } + function createSetFunctionNameHelper(f, name, prefix) { + context.requestEmitHelper(setFunctionNameHelper); + return context.factory.createCallExpression( + getUnscopedHelperName("__setFunctionName"), + /*typeArguments*/ + void 0, + prefix ? [f, name, context.factory.createStringLiteral(prefix)] : [f, name] + ); + } function createValuesHelper(expression) { context.requestEmitHelper(valuesHelper); return factory2.createCallExpression( @@ -24611,6 +24891,8 @@ ${lanes.join("\n")} decorateHelper, metadataHelper, paramHelper, + esDecorateHelper, + runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, @@ -24623,6 +24905,8 @@ ${lanes.join("\n")} spreadArrayHelper, valuesHelper, readHelper, + propKeyHelper, + setFunctionNameHelper, generatorHelper, importStarHelper, importDefaultHelper, @@ -24637,11 +24921,17 @@ ${lanes.join("\n")} function isCallToHelper(firstSegment, helperName) { return isCallExpression(firstSegment) && isIdentifier(firstSegment.expression) && (getEmitFlags(firstSegment.expression) & 8192 /* HelperName */) !== 0 && firstSegment.expression.escapedText === helperName; } - var decorateHelper, metadataHelper, paramHelper, assignHelper, awaitHelper, asyncGeneratorHelper, asyncDelegator, asyncValues, restHelper, awaiterHelper, extendsHelper, templateObjectHelper, readHelper, spreadArrayHelper, valuesHelper, generatorHelper, createBindingHelper, setModuleDefaultHelper, importStarHelper, importDefaultHelper, exportStarHelper, classPrivateFieldGetHelper, classPrivateFieldSetHelper, classPrivateFieldInHelper, allUnscopedEmitHelpers, asyncSuperHelper, advancedAsyncSuperHelper; + var PrivateIdentifierKind, decorateHelper, metadataHelper, paramHelper, esDecorateHelper, runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, asyncDelegator, asyncValues, restHelper, awaiterHelper, extendsHelper, templateObjectHelper, readHelper, spreadArrayHelper, propKeyHelper, setFunctionNameHelper, valuesHelper, generatorHelper, createBindingHelper, setModuleDefaultHelper, importStarHelper, importDefaultHelper, exportStarHelper, classPrivateFieldGetHelper, classPrivateFieldSetHelper, classPrivateFieldInHelper, allUnscopedEmitHelpers, asyncSuperHelper, advancedAsyncSuperHelper; var init_emitHelpers = __esm({ "src/compiler/factory/emitHelpers.ts"() { "use strict"; init_ts2(); + PrivateIdentifierKind = /* @__PURE__ */ ((PrivateIdentifierKind2) => { + PrivateIdentifierKind2["Field"] = "f"; + PrivateIdentifierKind2["Method"] = "m"; + PrivateIdentifierKind2["Accessor"] = "a"; + return PrivateIdentifierKind2; + })(PrivateIdentifierKind || {}); decorateHelper = { name: "typescript:decorate", importName: "__decorate", @@ -24675,6 +24965,54 @@ ${lanes.join("\n")} return function (target, key) { decorator(target, key, paramIndex); } };` }; + esDecorateHelper = { + name: "typescript:esDecorate", + importName: "__esDecorate", + scoped: false, + priority: 2, + text: ` + var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.push(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.push(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + };` + }; + runInitializersHelper = { + name: "typescript:runInitializers", + importName: "__runInitializers", + scoped: false, + priority: 2, + text: ` + var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + };` + }; assignHelper = { name: "typescript:assign", importName: "__assign", @@ -24847,6 +25185,25 @@ ${lanes.join("\n")} return to.concat(ar || Array.prototype.slice.call(from)); };` }; + propKeyHelper = { + name: "typescript:propKey", + importName: "__propKey", + scoped: false, + text: ` + var __propKey = (this && this.__propKey) || function (x) { + return typeof x === "symbol" ? x : "".concat(x); + };` + }; + setFunctionNameHelper = { + name: "typescript:setFunctionName", + importName: "__setFunctionName", + scoped: false, + text: ` + var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + };` + }; valuesHelper = { name: "typescript:values", importName: "__values", @@ -25081,6 +25438,9 @@ ${lanes.join("\n")} function isExportModifier(node) { return node.kind === 93 /* ExportKeyword */; } + function isDefaultModifier(node) { + return node.kind === 88 /* DefaultKeyword */; + } function isAsyncModifier(node) { return node.kind === 132 /* AsyncKeyword */; } @@ -25334,10 +25694,10 @@ ${lanes.join("\n")} return node.kind === 234 /* SyntheticExpression */; } function isPartiallyEmittedExpression(node) { - return node.kind === 355 /* PartiallyEmittedExpression */; + return node.kind === 356 /* PartiallyEmittedExpression */; } function isCommaListExpression(node) { - return node.kind === 356 /* CommaListExpression */; + return node.kind === 357 /* CommaListExpression */; } function isTemplateSpan(node) { return node.kind === 236 /* TemplateSpan */; @@ -25481,16 +25841,16 @@ ${lanes.join("\n")} return node.kind === 279 /* MissingDeclaration */; } function isNotEmittedStatement(node) { - return node.kind === 354 /* NotEmittedStatement */; + return node.kind === 355 /* NotEmittedStatement */; } function isSyntheticReference(node) { - return node.kind === 359 /* SyntheticReferenceExpression */; + return node.kind === 360 /* SyntheticReferenceExpression */; } function isMergeDeclarationMarker(node) { - return node.kind === 357 /* MergeDeclarationMarker */; + return node.kind === 358 /* MergeDeclarationMarker */; } function isEndOfDeclarationMarker(node) { - return node.kind === 358 /* EndOfDeclarationMarker */; + return node.kind === 359 /* EndOfDeclarationMarker */; } function isExternalModuleReference(node) { return node.kind === 280 /* ExternalModuleReference */; @@ -25681,11 +26041,14 @@ ${lanes.join("\n")} function isJSDocImplementsTag(node) { return node.kind === 332 /* JSDocImplementsTag */; } + function isJSDocSatisfiesTag(node) { + return node.kind === 353 /* JSDocSatisfiesTag */; + } function isJSDocThrowsTag(node) { return node.kind === 352 /* JSDocThrowsTag */; } function isSyntaxList(n) { - return n.kind === 353 /* SyntaxList */; + return n.kind === 354 /* SyntaxList */; } var init_nodeTests = __esm({ "src/compiler/factory/nodeTests.ts"() { @@ -25714,7 +26077,7 @@ ${lanes.join("\n")} isMemberName(memberName) ? factory2.createPropertyAccessExpression(target, memberName) : factory2.createElementAccessExpression(target, memberName), memberName ); - getOrCreateEmitNode(expression).flags |= 128 /* NoNestedSourceMaps */; + addEmitFlags(expression, 128 /* NoNestedSourceMaps */); return expression; } } @@ -26058,8 +26421,11 @@ ${lanes.join("\n")} const firstStatement = firstOrUndefined(statements); return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); } + function isCommaExpression(node) { + return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */; + } function isCommaSequence(node) { - return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 356 /* CommaListExpression */; + return isCommaExpression(node) || isCommaListExpression(node); } function isJSDocTypeAssertion(node) { return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node); @@ -26078,11 +26444,12 @@ ${lanes.join("\n")} return (kinds & 1 /* Parentheses */) !== 0; case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: + case 230 /* ExpressionWithTypeArguments */: case 235 /* SatisfiesExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; case 232 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -26093,6 +26460,14 @@ ${lanes.join("\n")} } return node; } + function walkUpOuterExpressions(node, kinds = 15 /* All */) { + let parent2 = node.parent; + while (isOuterExpression(parent2, kinds)) { + parent2 = parent2.parent; + Debug.assert(parent2); + } + return parent2; + } function skipAssertions(node) { return skipOuterExpressions(node, 6 /* Assertions */); } @@ -26174,7 +26549,7 @@ ${lanes.join("\n")} /*assertClause*/ void 0 ); - addEmitFlags(externalHelpersImportDeclaration, 134217728 /* NeverApplyImportHelper */); + addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */); return externalHelpersImportDeclaration; } } @@ -26386,6 +26761,21 @@ ${lanes.join("\n")} const kind = node.kind; return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; } + function isQuestionOrExclamationToken(node) { + return isQuestionToken(node) || isExclamationToken(node); + } + function isIdentifierOrThisTypeNode(node) { + return isIdentifier(node) || isThisTypeNode(node); + } + function isReadonlyKeywordOrPlusOrMinusToken(node) { + return isReadonlyKeyword(node) || isPlusToken(node) || isMinusToken(node); + } + function isQuestionOrPlusOrMinusToken(node) { + return isQuestionToken(node) || isPlusToken(node) || isMinusToken(node); + } + function isModuleName(node) { + return isIdentifier(node) || isStringLiteral(node); + } function isLiteralTypeLikeExpression(node) { const kind = node.kind; return kind === 104 /* NullKeyword */ || kind === 110 /* TrueKeyword */ || kind === 95 /* FalseKeyword */ || isLiteralExpression(node) || isPrefixUnaryExpression(node); @@ -26460,6 +26850,17 @@ ${lanes.join("\n")} return resultHolder.value; } } + function isExportOrDefaultKeywordKind(kind) { + return kind === 93 /* ExportKeyword */ || kind === 88 /* DefaultKeyword */; + } + function isExportOrDefaultModifier(node) { + const kind = node.kind; + return isExportOrDefaultKeywordKind(kind); + } + function isNonExportDefaultModifier(node) { + const kind = node.kind; + return isModifierKind(kind) && !isExportOrDefaultKeywordKind(kind); + } function elideNodes(factory2, nodes) { if (nodes === void 0) return void 0; @@ -26468,13 +26869,16 @@ ${lanes.join("\n")} return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes); } function getNodeForGeneratedName(name) { - if (name.autoGenerate.flags & 4 /* Node */) { - const autoGenerateId = name.autoGenerate.id; + var _a2; + const autoGenerate = name.emitNode.autoGenerate; + if (autoGenerate.flags & 4 /* Node */) { + const autoGenerateId = autoGenerate.id; let node = name; let original = node.original; while (original) { node = original; - if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) { + const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) { break; } original = node.original; @@ -26573,17 +26977,55 @@ ${lanes.join("\n")} ]) ); } - var isTypeNodeOrTypeParameterDeclaration, isQuestionOrExclamationToken, isIdentifierOrThisTypeNode, isReadonlyKeywordOrPlusOrMinusToken, isQuestionOrPlusOrMinusToken, isModuleName, BinaryExpressionState, BinaryExpressionStateMachine; + function findComputedPropertyNameCacheAssignment(name) { + let node = name.expression; + while (true) { + node = skipOuterExpressions(node); + if (isCommaListExpression(node)) { + node = last(node.elements); + continue; + } + if (isCommaExpression(node)) { + node = node.right; + continue; + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ) && isGeneratedIdentifier(node.left)) { + return node; + } + break; + } + } + function isSyntheticParenthesizedExpression(node) { + return isParenthesizedExpression(node) && nodeIsSynthesized(node) && !node.emitNode; + } + function flattenCommaListWorker(node, expressions) { + if (isSyntheticParenthesizedExpression(node)) { + flattenCommaListWorker(node.expression, expressions); + } else if (isCommaExpression(node)) { + flattenCommaListWorker(node.left, expressions); + flattenCommaListWorker(node.right, expressions); + } else if (isCommaListExpression(node)) { + for (const child of node.elements) { + flattenCommaListWorker(child, expressions); + } + } else { + expressions.push(node); + } + } + function flattenCommaList(node) { + const expressions = []; + flattenCommaListWorker(node, expressions); + return expressions; + } + var BinaryExpressionState, BinaryExpressionStateMachine; var init_utilities2 = __esm({ "src/compiler/factory/utilities.ts"() { "use strict"; init_ts2(); - isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration); - isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken); - isIdentifierOrThisTypeNode = or(isIdentifier, isThisTypeNode); - isReadonlyKeywordOrPlusOrMinusToken = or(isReadonlyKeyword, isPlusToken, isMinusToken); - isQuestionOrPlusOrMinusToken = or(isQuestionToken, isPlusToken, isMinusToken); - isModuleName = or(isIdentifier, isStringLiteral); ((BinaryExpressionState2) => { function enter(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, outerState) { const prevUserState = stackIndex > 0 ? userStateStack[stackIndex - 1] : void 0; @@ -27169,7 +27611,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); }, [300 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); }, [301 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); @@ -27184,7 +27626,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, [299 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); }, [257 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); @@ -27193,7 +27635,7 @@ ${lanes.join("\n")} return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [178 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [182 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -27210,7 +27652,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [173 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [174 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -27219,7 +27661,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [259 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [215 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -27228,7 +27670,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); }, [172 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); }, [180 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); @@ -27349,7 +27791,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); }, [240 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); }, [258 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.declarations); @@ -27413,25 +27855,25 @@ ${lanes.join("\n")} [260 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, [228 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, [261 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); }, [262 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); }, [263 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); }, [302 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [264 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); }, [268 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); }, [269 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [270 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); @@ -27443,7 +27885,7 @@ ${lanes.join("\n")} return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); }, [267 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); }, [271 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); @@ -27454,12 +27896,12 @@ ${lanes.join("\n")} [272 /* NamedImports */]: forEachChildInNamedImportsOrExports, [276 /* NamedExports */]: forEachChildInNamedImportsOrExports, [275 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [273 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, [278 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, [274 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); }, [225 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); @@ -27486,9 +27928,9 @@ ${lanes.join("\n")} return visitNode2(cbNode, node.expression); }, [279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers); + return visitNodes(cbNode, cbNodes, node.modifiers); }, - [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, [281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { @@ -27560,6 +28002,7 @@ ${lanes.join("\n")} [347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, [346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, [343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, + [353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, [352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, [342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, [326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { @@ -27579,7 +28022,7 @@ ${lanes.join("\n")} [339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, [334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, [340 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression + [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; ((Parser2) => { const scanner2 = createScanner( @@ -27709,7 +28152,7 @@ ${lanes.join("\n")} const pos = getNodePos(); let statements, endOfFileToken; if (token() === 1 /* EndOfFileToken */) { - statements = createNodeArray2([], pos, pos); + statements = createNodeArray([], pos, pos); endOfFileToken = parseTokenNode(); } else { let expressions; @@ -27755,7 +28198,7 @@ ${lanes.join("\n")} const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); const statement = factory2.createExpressionStatement(expression); finishNode(statement, pos); - statements = createNodeArray2([statement], pos); + statements = createNodeArray([statement], pos); endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); } const sourceFile = createSourceFile2( @@ -28403,7 +28846,7 @@ ${lanes.join("\n")} function parseSemicolon() { return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); } - function createNodeArray2(elements, pos, end, hasTrailingComma) { + function createNodeArray(elements, pos, end, hasTrailingComma) { const array = factory2.createNodeArray(elements, hasTrailingComma); setTextRangePosEnd(array, pos, end != null ? end : scanner2.getStartPos()); return array; @@ -28428,8 +28871,6 @@ ${lanes.join("\n")} const pos = getNodePos(); const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( "", - /*typeArguments*/ - void 0, /*originalKeywordKind*/ void 0 ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode( @@ -28456,7 +28897,7 @@ ${lanes.join("\n")} } return identifier; } - function createIdentifier3(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { + function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { if (isIdentifier3) { identifierCount++; const pos = getNodePos(); @@ -28464,23 +28905,17 @@ ${lanes.join("\n")} const text = internIdentifier(scanner2.getTokenValue()); const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind, - hasExtendedUnicodeEscape - ), pos); + return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - return createIdentifier3( + return createIdentifier( /*isIdentifier*/ true ); } if (token() === 0 /* Unknown */ && scanner2.tryScan(() => scanner2.reScanInvalidIdentifier() === 79 /* Identifier */)) { - return createIdentifier3( + return createIdentifier( /*isIdentifier*/ true ); @@ -28493,7 +28928,7 @@ ${lanes.join("\n")} return createMissingNode(79 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg); } function parseBindingIdentifier(privateIdentifierDiagnosticMessage) { - return createIdentifier3( + return createIdentifier( isBindingIdentifier(), /*diagnosticMessage*/ void 0, @@ -28501,10 +28936,10 @@ ${lanes.join("\n")} ); } function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) { - return createIdentifier3(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); + return createIdentifier(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); } function parseIdentifierName(diagnosticMessage) { - return createIdentifier3(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); + return createIdentifier(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); } function isLiteralPropertyName() { return tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */; @@ -28581,7 +29016,7 @@ ${lanes.join("\n")} } } function canFollowExportModifier() { - return token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); + return token() === 59 /* AtToken */ || token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); } function nextTokenCanFollowExportModifier() { nextToken(); @@ -28595,7 +29030,7 @@ ${lanes.join("\n")} } function nextTokenCanFollowDefaultKeyword() { nextToken(); - return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); + return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 59 /* AtToken */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); } function isListElement2(parsingContext2, inErrorRecovery) { const node = currentNode(parsingContext2); @@ -28802,7 +29237,7 @@ ${lanes.join("\n")} } } parsingContext = saveParsingContext; - return createNodeArray2(list, listPos); + return createNodeArray(list, listPos); } function parseListElement(parsingContext2, parseElement) { const node = currentNode(parsingContext2); @@ -28812,6 +29247,7 @@ ${lanes.join("\n")} return parseElement(); } function currentNode(parsingContext2, pos) { + var _a2; if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { return void 0; } @@ -28826,8 +29262,8 @@ ${lanes.join("\n")} if (!canReuseNode(node, parsingContext2)) { return void 0; } - if (canHaveJSDoc(node) && node.jsDocCache) { - node.jsDocCache = void 0; + if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) { + node.jsDoc.jsDocCache = void 0; } return node; } @@ -28886,7 +29322,7 @@ ${lanes.join("\n")} return true; case 171 /* MethodDeclaration */: const methodDeclaration = node; - const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 135 /* ConstructorKeyword */; + const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; } } @@ -29078,7 +29514,7 @@ ${lanes.join("\n")} } } parsingContext = saveParsingContext; - return createNodeArray2( + return createNodeArray( list, listPos, /*end*/ @@ -29090,7 +29526,7 @@ ${lanes.join("\n")} return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; } function createMissingList() { - const list = createNodeArray2([], getNodePos()); + const list = createNodeArray([], getNodePos()); list.isMissingList = true; return list; } @@ -29108,13 +29544,10 @@ ${lanes.join("\n")} function parseEntityName(allowReservedWords, diagnosticMessage) { const pos = getNodePos(); let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); - let dotPos = getNodePos(); while (parseOptional(24 /* DotToken */)) { if (token() === 29 /* LessThanToken */) { - entity.jsdocDotPos = dotPos; break; } - dotPos = getNodePos(); entity = finishNode( factory2.createQualifiedName( entity, @@ -29129,7 +29562,7 @@ ${lanes.join("\n")} } return entity; } - function createQualifiedName2(entity, name) { + function createQualifiedName(entity, name) { return finishNode(factory2.createQualifiedName(entity, name), entity.pos); } function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers) { @@ -29163,7 +29596,7 @@ ${lanes.join("\n")} node = parseTemplateSpan(isTaggedTemplate); list.push(node); } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray2(list, pos); + return createNodeArray(list, pos); } function parseTemplateExpression(isTaggedTemplate) { const pos = getNodePos(); @@ -29196,7 +29629,7 @@ ${lanes.join("\n")} node = parseTemplateTypeSpan(); list.push(node); } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray2(list, pos); + return createNodeArray(list, pos); } function parseTemplateTypeSpan() { const pos = getNodePos(); @@ -29444,6 +29877,8 @@ ${lanes.join("\n")} function parseTypeParameter() { const pos = getNodePos(); const modifiers = parseModifiers( + /*allowDecorators*/ + false, /*permitConstAsModifier*/ true ); @@ -29496,13 +29931,19 @@ ${lanes.join("\n")} function parseParameterWorker(inOuterAwaitContext, allowAmbiguity = true) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : doOutsideOfAwaitContext(parseDecorators); + const modifiers = inOuterAwaitContext ? doInAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )) : doOutsideOfAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )); if (token() === 108 /* ThisKeyword */) { const node2 = factory2.createParameterDeclaration( - decorators, + modifiers, /*dotDotDotToken*/ void 0, - createIdentifier3( + createIdentifier( /*isIdentifier*/ true ), @@ -29512,14 +29953,14 @@ ${lanes.join("\n")} /*initializer*/ void 0 ); - if (decorators) { - parseErrorAtRange(decorators[0], Diagnostics.Decorators_may_not_be_applied_to_this_parameters); + const modifier = firstOrUndefined(modifiers); + if (modifier) { + parseErrorAtRange(modifier, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); } return withJSDoc(finishNode(node2, pos), hasJSDoc); } const savedTopLevel = topLevel; topLevel = false; - const modifiers = combineDecoratorsAndModifiers(decorators, parseModifiers()); const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); if (!allowAmbiguity && !isParameterNameStart()) { return void 0; @@ -29631,7 +30072,7 @@ ${lanes.join("\n")} nextToken(); return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } - function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( /*inOuterAwaitContext*/ false @@ -29639,7 +30080,6 @@ ${lanes.join("\n")} const type = parseTypeAnnotation(); parseTypeMemberSemicolon(); const node = factory2.createIndexSignature(modifiers, parameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { @@ -29694,37 +30134,18 @@ ${lanes.join("\n")} } const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 174 /* GetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 4 /* Type */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 175 /* SetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 4 /* Type */); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers - ); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); } @@ -29868,7 +30289,7 @@ ${lanes.join("\n")} const pos = getNodePos(); nextToken(); const modifier = finishNode(factory2.createToken(126 /* AbstractKeyword */), pos); - modifiers = createNodeArray2([modifier], pos); + modifiers = createNodeArray([modifier], pos); } return modifiers; } @@ -30179,7 +30600,7 @@ ${lanes.join("\n")} while (parseOptional(operator)) { types.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType()); } - type = finishNode(createTypeNode(createNodeArray2(types, pos)), pos); + type = finishNode(createTypeNode(createNodeArray(types, pos)), pos); } return type; } @@ -30204,7 +30625,10 @@ ${lanes.join("\n")} } function skipParameterStart() { if (isModifierKind(token())) { - parseModifiers(); + parseModifiers( + /*allowDecorators*/ + false + ); } if (isIdentifier2() || token() === 108 /* ThisKeyword */) { nextToken(); @@ -30332,6 +30756,7 @@ ${lanes.join("\n")} case 133 /* AwaitKeyword */: case 125 /* YieldKeyword */: case 80 /* PrivateIdentifier */: + case 59 /* AtToken */: return true; default: if (isBinaryOperator2()) { @@ -30453,7 +30878,7 @@ ${lanes.join("\n")} void 0 ); finishNode(parameter, identifier.pos); - const parameters = createNodeArray2([parameter], parameter.pos, parameter.end); + const parameters = createNodeArray([parameter], parameter.pos, parameter.end); const equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */); const body = parseArrowFunctionExpressionBody( /*isAsync*/ @@ -30940,7 +31365,7 @@ ${lanes.join("\n")} lastChild.openingElement.pos, end ); - children = createNodeArray2([...children.slice(0, children.length - 1), newLast], children.pos, end); + children = createNodeArray([...children.slice(0, children.length - 1), newLast], children.pos, end); closingElement = lastChild.closingElement; } else { closingElement = parseJsxClosingElement(opening, inExpressionContext); @@ -31034,7 +31459,7 @@ ${lanes.join("\n")} } } parsingContext = saveParsingContext; - return createNodeArray2(list, listPos); + return createNodeArray(list, listPos); } function parseJsxAttributes() { const pos = getNodePos(); @@ -31423,6 +31848,8 @@ ${lanes.join("\n")} break; } return parseFunctionExpression(); + case 59 /* AtToken */: + return parseDecoratedExpression(); case 84 /* ClassKeyword */: return parseClassExpression(); case 98 /* FunctionKeyword */: @@ -31490,13 +31917,15 @@ ${lanes.join("\n")} ); return withJSDoc(finishNode(factory2.createSpreadAssignment(expression), pos), hasJSDoc); } - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const tokenIsIdentifier = isIdentifier2(); @@ -31504,7 +31933,7 @@ ${lanes.join("\n")} const questionToken = parseOptionalToken(57 /* QuestionToken */); const exclamationToken = parseOptionalToken(53 /* ExclamationToken */); if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken); + return parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken); } let node; const isShorthandPropertyAssignment2 = tokenIsIdentifier && token() !== 58 /* ColonToken */; @@ -31524,7 +31953,6 @@ ${lanes.join("\n")} )); node = factory2.createPropertyAssignment(name, initializer); } - node.illegalDecorators = decorators; node.modifiers = modifiers; node.questionToken = questionToken; node.exclamationToken = exclamationToken; @@ -31552,7 +31980,10 @@ ${lanes.join("\n")} ); const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); parseExpected(98 /* FunctionKeyword */); const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; @@ -31924,7 +32355,7 @@ ${lanes.join("\n")} if (currentToken2 === 154 /* TypeKeyword */) { currentToken2 = lookAhead(nextToken); } - if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */) { + if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */ || currentToken2 === 59 /* AtToken */) { return true; } continue; @@ -32008,8 +32439,6 @@ ${lanes.join("\n")} return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -32018,8 +32447,6 @@ ${lanes.join("\n")} return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -32029,8 +32456,6 @@ ${lanes.join("\n")} return parseFunctionDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -32038,8 +32463,6 @@ ${lanes.join("\n")} return parseClassDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -32102,8 +32525,10 @@ ${lanes.join("\n")} function parseDeclaration() { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); const isAmbient = some(modifiers, isDeclareModifier); if (isAmbient) { const node = tryReuseAmbientDeclaration(pos); @@ -32113,9 +32538,9 @@ ${lanes.join("\n")} for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); } else { - return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); + return parseDeclarationWorker(pos, hasJSDoc, modifiers); } } function tryReuseAmbientDeclaration(pos) { @@ -32126,41 +32551,41 @@ ${lanes.join("\n")} } }); } - function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) { + function parseDeclarationWorker(pos, hasJSDoc, modifiersIn) { switch (token()) { case 113 /* VarKeyword */: case 119 /* LetKeyword */: case 85 /* ConstKeyword */: - return parseVariableStatement(pos, hasJSDoc, decorators, modifiers); + return parseVariableStatement(pos, hasJSDoc, modifiersIn); case 98 /* FunctionKeyword */: - return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseFunctionDeclaration(pos, hasJSDoc, modifiersIn); case 84 /* ClassKeyword */: - return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassDeclaration(pos, hasJSDoc, modifiersIn); case 118 /* InterfaceKeyword */: - return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseInterfaceDeclaration(pos, hasJSDoc, modifiersIn); case 154 /* TypeKeyword */: - return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseTypeAliasDeclaration(pos, hasJSDoc, modifiersIn); case 92 /* EnumKeyword */: - return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseEnumDeclaration(pos, hasJSDoc, modifiersIn); case 159 /* GlobalKeyword */: case 142 /* ModuleKeyword */: case 143 /* NamespaceKeyword */: - return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseModuleDeclaration(pos, hasJSDoc, modifiersIn); case 100 /* ImportKeyword */: - return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiersIn); case 93 /* ExportKeyword */: nextToken(); switch (token()) { case 88 /* DefaultKeyword */: case 63 /* EqualsToken */: - return parseExportAssignment(pos, hasJSDoc, decorators, modifiers); + return parseExportAssignment(pos, hasJSDoc, modifiersIn); case 128 /* AsKeyword */: - return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseNamespaceExportDeclaration(pos, hasJSDoc, modifiersIn); default: - return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseExportDeclaration(pos, hasJSDoc, modifiersIn); } default: - if (decorators || modifiers) { + if (modifiersIn) { const missing = createMissingNode( 279 /* MissingDeclaration */, /*reportAtCurrentPosition*/ @@ -32168,8 +32593,7 @@ ${lanes.join("\n")} Diagnostics.Declaration_expected ); setTextRangePos(missing, pos); - missing.illegalDecorators = decorators; - missing.modifiers = modifiers; + missing.modifiers = modifiersIn; return missing; } return void 0; @@ -32302,17 +32726,16 @@ ${lanes.join("\n")} function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } - function parseVariableStatement(pos, hasJSDoc, decorators, modifiers) { + function parseVariableStatement(pos, hasJSDoc, modifiers) { const declarationList = parseVariableDeclarationList( /*inForStatementInitializer*/ false ); parseSemicolon(); const node = factory2.createVariableStatement(modifiers, declarationList); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); const modifierFlags = modifiersToFlags(modifiers); parseExpected(98 /* FunctionKeyword */); @@ -32335,7 +32758,6 @@ ${lanes.join("\n")} const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, Diagnostics.or_expected); setAwaitContext(savedAwaitContext); const node = factory2.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseConstructorName() { @@ -32349,7 +32771,7 @@ ${lanes.join("\n")} }); } } - function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) { + function tryParseConstructorDeclaration(pos, hasJSDoc, modifiers) { return tryParse(() => { if (parseConstructorName()) { const typeParameters = parseTypeParameters(); @@ -32361,14 +32783,13 @@ ${lanes.join("\n")} ); const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected); const node = factory2.createConstructorDeclaration(modifiers, parameters, body); - node.illegalDecorators = decorators; node.typeParameters = typeParameters; node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } }); } - function parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { + function parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; const typeParameters = parseTypeParameters(); @@ -32380,7 +32801,7 @@ ${lanes.join("\n")} ); const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage); const node = factory2.createMethodDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, asteriskToken, name, questionToken, @@ -32392,13 +32813,13 @@ ${lanes.join("\n")} node.exclamationToken = exclamationToken; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken) { + function parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken) { const exclamationToken = !questionToken && !scanner2.hasPrecedingLineBreak() ? parseOptionalToken(53 /* ExclamationToken */) : void 0; const type = parseTypeAnnotation(); const initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer); parseSemicolonAfterPropertyName(name, type, initializer); const node = factory2.createPropertyDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, name, questionToken || exclamationToken, type, @@ -32406,7 +32827,7 @@ ${lanes.join("\n")} ); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers) { const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const name = parsePropertyName(); const questionToken = parseOptionalToken(57 /* QuestionToken */); @@ -32414,7 +32835,6 @@ ${lanes.join("\n")} return parseMethodDeclaration( pos, hasJSDoc, - decorators, modifiers, asteriskToken, name, @@ -32424,9 +32844,9 @@ ${lanes.join("\n")} Diagnostics.or_expected ); } - return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken); + return parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken); } - function parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, kind, flags) { + function parseAccessorDeclaration(pos, hasJSDoc, modifiers, kind, flags) { const name = parsePropertyName(); const typeParameters = parseTypeParameters(); const parameters = parseParameters(0 /* None */); @@ -32436,7 +32856,7 @@ ${lanes.join("\n")} false ); const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body); + const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); node.typeParameters = typeParameters; if (isSetAccessorDeclaration(node)) node.type = type; @@ -32482,11 +32902,10 @@ ${lanes.join("\n")} } return false; } - function parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers) { parseExpectedToken(124 /* StaticKeyword */); const body = parseClassStaticBlockBody(); const node = withJSDoc(finishNode(factory2.createClassStaticBlockDeclaration(body), pos), hasJSDoc); - node.illegalDecorators = decorators; node.modifiers = modifiers; return node; } @@ -32526,15 +32945,7 @@ ${lanes.join("\n")} const expression = doInDecoratorContext(parseDecoratorExpression); return finishNode(factory2.createDecorator(expression), pos); } - function parseDecorators() { - const pos = getNodePos(); - let list, decorator; - while (decorator = tryParseDecorator()) { - list = append(list, decorator); - } - return list && createNodeArray2(list, pos); - } - function tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { + function tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); const kind = token(); if (token() === 85 /* ConstKeyword */ && permitConstAsModifier) { @@ -32552,24 +32963,27 @@ ${lanes.join("\n")} } return finishNode(factory2.createToken(kind), pos); } - function combineDecoratorsAndModifiers(decorators, modifiers) { - if (!decorators) - return modifiers; - if (!modifiers) - return decorators; - const decoratorsAndModifiers = factory2.createNodeArray(concatenate(decorators, modifiers)); - setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end); - return decoratorsAndModifiers; - } - function parseModifiers(permitConstAsModifier, stopOnStartOfClassStaticBlock) { + function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); - let list, modifier, hasSeenStatic = false; - while (modifier = tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) { + let list; + let modifier, hasSeenStaticModifier = false; + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) - hasSeenStatic = true; + hasSeenStaticModifier = true; list = append(list, modifier); } - return list && createNodeArray2(list, pos); + if (allowDecorators && token() === 59 /* AtToken */) { + let decorator; + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { + if (modifier.kind === 124 /* StaticKeyword */) + hasSeenStaticModifier = true; + list = append(list, modifier); + } + } + return list && createNodeArray(list, pos); } function parseModifiersForArrowFunction() { let modifiers; @@ -32577,7 +32991,7 @@ ${lanes.join("\n")} const pos = getNodePos(); nextToken(); const modifier = finishNode(factory2.createToken(132 /* AsyncKeyword */), pos); - modifiers = createNodeArray2([modifier], pos); + modifiers = createNodeArray([modifier], pos); } return modifiers; } @@ -32588,30 +33002,31 @@ ${lanes.join("\n")} return finishNode(factory2.createSemicolonClassElement(), pos); } const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); const modifiers = parseModifiers( + /*allowDecorators*/ + true, /*permitConstAsModifier*/ true, /*stopOnStartOfClassStaticBlock*/ true ); if (token() === 124 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { - return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); } if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } if (token() === 135 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { - const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); + const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); if (constructorDeclaration) { return constructorDeclaration; } } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) { const isAmbient = some(modifiers, isDeclareModifier); @@ -32619,12 +33034,12 @@ ${lanes.join("\n")} for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); } else { - return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); + return parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers); } } - if (decorators || modifiers) { + if (modifiers) { const name = createMissingNode( 79 /* Identifier */, /*reportAtCurrentPosition*/ @@ -32634,7 +33049,6 @@ ${lanes.join("\n")} return parsePropertyDeclaration( pos, hasJSDoc, - decorators, modifiers, name, /*questionToken*/ @@ -32643,21 +33057,39 @@ ${lanes.join("\n")} } return Debug.fail("Should not have attempted to parse class member declaration."); } + function parseDecoratedExpression() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); + if (token() === 84 /* ClassKeyword */) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 228 /* ClassExpression */); + } + const missing = createMissingNode( + 279 /* MissingDeclaration */, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Expression_expected + ); + setTextRangePos(missing, pos); + missing.modifiers = modifiers; + return missing; + } function parseClassExpression() { return parseClassDeclarationOrExpression( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0, 228 /* ClassExpression */ ); } - function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 260 /* ClassDeclaration */); + function parseClassDeclaration(pos, hasJSDoc, modifiers) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 260 /* ClassDeclaration */); } - function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { + function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { const savedAwaitContext = inAwaitContext(); parseExpected(84 /* ClassKeyword */); const name = parseNameOfClassDeclarationOrExpression(); @@ -32676,11 +33108,11 @@ ${lanes.join("\n")} members = createMissingList(); } setAwaitContext(savedAwaitContext); - const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members); + const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseNameOfClassDeclarationOrExpression() { - return isBindingIdentifier() && !isImplementsClause() ? createIdentifier3(isBindingIdentifier()) : void 0; + return isBindingIdentifier() && !isImplementsClause() ? createIdentifier(isBindingIdentifier()) : void 0; } function isImplementsClause() { return token() === 117 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); @@ -32717,17 +33149,16 @@ ${lanes.join("\n")} function parseClassMembers() { return parseList(ParsingContext.ClassMembers, parseClassElement); } - function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); const heritageClauses = parseHeritageClauses(); const members = parseObjectTypeMembers(); const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) { parseExpected(154 /* TypeKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); @@ -32735,7 +33166,6 @@ ${lanes.join("\n")} const type = token() === 139 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); parseSemicolon(); const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseEnumMember() { @@ -32745,7 +33175,7 @@ ${lanes.join("\n")} const initializer = allowInAnd(parseInitializer); return withJSDoc(finishNode(factory2.createEnumMember(name, initializer), pos), hasJSDoc); } - function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseEnumDeclaration(pos, hasJSDoc, modifiers) { parseExpected(92 /* EnumKeyword */); const name = parseIdentifier(); let members; @@ -32756,7 +33186,6 @@ ${lanes.join("\n")} members = createMissingList(); } const node = factory2.createEnumDeclaration(modifiers, name, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseModuleBlock() { @@ -32770,24 +33199,21 @@ ${lanes.join("\n")} } return finishNode(factory2.createModuleBlock(statements), pos); } - function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags) { + function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) { const namespaceFlag = flags & 16 /* Namespace */; const name = parseIdentifier(); const body = parseOptional(24 /* DotToken */) ? parseModuleOrNamespaceDeclaration( getNodePos(), /*hasJSDoc*/ false, - /*decorators*/ - void 0, /*modifiers*/ void 0, 4 /* NestedNamespace */ | namespaceFlag ) : parseModuleBlock(); const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; let name; if (token() === 159 /* GlobalKeyword */) { @@ -32803,23 +33229,22 @@ ${lanes.join("\n")} } else { parseSemicolon(); } - const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; + const node = factory2.createModuleDeclaration(modifiersIn, name, body, flags); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; if (token() === 159 /* GlobalKeyword */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } else if (parseOptional(143 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { parseExpected(142 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } } - return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); + return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiersIn, flags); } function isExternalModuleReference2() { return token() === 147 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); @@ -32833,17 +33258,16 @@ ${lanes.join("\n")} function nextTokenIsSlash() { return nextToken() === 43 /* SlashToken */; } - function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseNamespaceExportDeclaration(pos, hasJSDoc, modifiers) { parseExpected(128 /* AsKeyword */); parseExpected(143 /* NamespaceKeyword */); const name = parseIdentifier(); parseSemicolon(); const node = factory2.createNamespaceExportDeclaration(name); - node.illegalDecorators = decorators; node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) { parseExpected(100 /* ImportKeyword */); const afterImportPos = scanner2.getStartPos(); let identifier; @@ -32856,7 +33280,7 @@ ${lanes.join("\n")} identifier = isIdentifier2() ? parseIdentifier() : void 0; } if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { - return parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly); + return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly); } let importClause; if (identifier || // import id @@ -32872,7 +33296,6 @@ ${lanes.join("\n")} } parseSemicolon(); const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseAssertEntry() { @@ -32910,7 +33333,7 @@ ${lanes.join("\n")} } return finishNode(factory2.createAssertClause(elements, multiLine), pos); } else { - const elements = createNodeArray2( + const elements = createNodeArray( [], getNodePos(), /*end*/ @@ -32931,12 +33354,11 @@ ${lanes.join("\n")} function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { return token() === 27 /* CommaToken */ || token() === 158 /* FromKeyword */; } - function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { + function parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly) { parseExpected(63 /* EqualsToken */); const moduleReference = parseModuleReference(); parseSemicolon(); const node = factory2.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); - node.illegalDecorators = decorators; const finished = withJSDoc(finishNode(node, pos), hasJSDoc); return finished; } @@ -33046,7 +33468,7 @@ ${lanes.join("\n")} function parseNamespaceExport(pos) { return finishNode(factory2.createNamespaceExport(parseIdentifierName()), pos); } - function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseExportDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -33076,10 +33498,9 @@ ${lanes.join("\n")} parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) { + function parseExportAssignment(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -33098,7 +33519,6 @@ ${lanes.join("\n")} parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportAssignment(modifiers, isExportEquals, expression); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } let ParsingContext; @@ -33353,8 +33773,8 @@ ${lanes.join("\n")} } if (parts.length && tags) Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set"); - const tagsArray = tags && createNodeArray2(tags, tagsPos, tagsEnd); - return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray2(parts, start, commentsPos) : comments.length ? comments.join("") : void 0, tagsArray), start, end); + const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd); + return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : comments.length ? comments.join("") : void 0, tagsArray), start, end); }); function removeLeadingNewlines(comments2) { while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) { @@ -33482,6 +33902,9 @@ ${lanes.join("\n")} case "overload": tag = parseOverloadTag(start2, tagName, margin, indentText); break; + case "satisfies": + tag = parseSatisfiesTag(start2, tagName, margin, indentText); + break; case "see": tag = parseSeeTag(start2, tagName, margin, indentText); break; @@ -33594,7 +34017,7 @@ ${lanes.join("\n")} if (comments2.length) { parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2)); } - return createNodeArray2(parts2, commentsPos2, scanner2.getTextPos()); + return createNodeArray(parts2, commentsPos2, scanner2.getTextPos()); } else if (comments2.length) { return comments2.join(""); } @@ -33760,7 +34183,7 @@ ${lanes.join("\n")} if (!comments2) { commentEnd = scanner2.getStartPos(); } - const allParts = typeof comments2 !== "string" ? createNodeArray2(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; + const allParts = typeof comments2 !== "string" ? createNodeArray(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; return finishNode(factory2.createJSDocAuthorTag(tagName, allParts), start2); } function parseAuthorNameAndEmail() { @@ -33790,6 +34213,14 @@ ${lanes.join("\n")} const className = parseExpressionWithTypeArgumentsForAugments(); return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); } + function parseSatisfiesTag(start2, tagName, margin, indentText) { + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + false + ); + const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0; + return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2); + } function parseExpressionWithTypeArgumentsForAugments() { const usedBrace = parseOptional(18 /* OpenBraceToken */); const pos = getNodePos(); @@ -33894,7 +34325,7 @@ ${lanes.join("\n")} return finishNode(jsDocNamespaceNode, pos); } if (nested) { - typeNameOrNamespaceName.isInJSDocNamespace = true; + typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */; } return typeNameOrNamespaceName; } @@ -33905,7 +34336,7 @@ ${lanes.join("\n")} while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) { parameters = append(parameters, child); } - return createNodeArray2(parameters || [], pos); + return createNodeArray(parameters || [], pos); } function parseJSDocSignature(start2, indent3) { const parameters = parseCallbackTagParameters(indent3); @@ -34056,7 +34487,7 @@ ${lanes.join("\n")} } skipWhitespaceOrAsterisk(); } while (parseOptionalJsdoc(27 /* CommaToken */)); - return createNodeArray2(typeParameters, pos); + return createNodeArray(typeParameters, pos); } function parseTemplateTag(start2, tagName, indent3, indentText) { const constraint = token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0; @@ -34080,7 +34511,7 @@ ${lanes.join("\n")} if (parseOptional(22 /* OpenBracketToken */)) { parseExpected(23 /* CloseBracketToken */); } - entity = createQualifiedName2(entity, name); + entity = createQualifiedName(entity, name); } return entity; } @@ -34098,12 +34529,7 @@ ${lanes.join("\n")} const end2 = scanner2.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner2.getTokenValue()); - const result = finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind - ), pos, end2); + const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -34504,16 +34930,6 @@ ${lanes.join("\n")} function getOptionsNameMap() { return optionsNameMapCache || (optionsNameMapCache = createOptionNameMap(optionDeclarations)); } - function convertEnableAutoDiscoveryToEnable(typeAcquisition) { - if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== void 0 && typeAcquisition.enable === void 0) { - return { - enable: typeAcquisition.enableAutoDiscovery, - include: typeAcquisition.include || [], - exclude: typeAcquisition.exclude || [] - }; - } - return typeAcquisition; - } function createCompilerDiagnosticForInvalidCustomType(opt) { return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic); } @@ -34844,12 +35260,6 @@ ${lanes.join("\n")} elementOptions: getCommandLineWatchOptionsMap(), extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics }, - { - name: "typingOptions", - type: "object", - elementOptions: getCommandLineTypeAcquisitionMap(), - extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics - }, { name: "typeAcquisition", type: "object", @@ -35696,11 +36106,11 @@ ${lanes.join("\n")} errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } const options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName); - const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName); + const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition, basePath, errors, configFileName); const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors); json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors); let extendedConfigPath; - if (json.extends) { + if (json.extends || json.extends === "") { if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) { errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration))); } else { @@ -35723,7 +36133,7 @@ ${lanes.join("\n")} } function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { const options = getDefaultCompilerOptions(configFileName); - let typeAcquisition, typingOptionstypeAcquisition; + let typeAcquisition; let watchOptions; let extendedConfigPath; let rootCompilerOptions; @@ -35740,9 +36150,6 @@ ${lanes.join("\n")} case "typeAcquisition": currentOption = typeAcquisition || (typeAcquisition = getDefaultTypeAcquisition(configFileName)); break; - case "typingOptions": - currentOption = typingOptionstypeAcquisition || (typingOptionstypeAcquisition = getDefaultTypeAcquisition(configFileName)); - break; default: Debug.fail("Unknown option"); } @@ -35795,15 +36202,7 @@ ${lanes.join("\n")} optionsIterator ); if (!typeAcquisition) { - if (typingOptionstypeAcquisition) { - typeAcquisition = typingOptionstypeAcquisition.enableAutoDiscovery !== void 0 ? { - enable: typingOptionstypeAcquisition.enableAutoDiscovery, - include: typingOptionstypeAcquisition.include, - exclude: typingOptionstypeAcquisition.exclude - } : typingOptionstypeAcquisition; - } else { - typeAcquisition = getDefaultTypeAcquisition(configFileName); - } + typeAcquisition = getDefaultTypeAcquisition(configFileName); } if (rootCompilerOptions && json && json.compilerOptions === void 0) { errors.push(createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, getTextOfPropertyName(rootCompilerOptions[0]))); @@ -35827,7 +36226,11 @@ ${lanes.join("\n")} if (resolved.resolvedModule) { return resolved.resolvedModule.resolvedFileName; } - errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); + if (extendedConfig === "") { + errors.push(createDiagnostic(Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends")); + } else { + errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); + } return void 0; } function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) { @@ -35905,8 +36308,7 @@ ${lanes.join("\n")} } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { const options = getDefaultTypeAcquisition(configFileName); - const typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions); - convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), typeAcquisition, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); + convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), jsonOptions, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); return options; } function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) { @@ -36108,6 +36510,7 @@ ${lanes.join("\n")} } } function specToDiagnostic(spec, disallowTrailingRecursion) { + Debug.assert(typeof spec === "string"); if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return [Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; } else if (invalidDotDotAfterRecursiveWildcard(spec)) { @@ -36290,6 +36693,7 @@ ${lanes.join("\n")} ["es2020", "lib.es2020.d.ts"], ["es2021", "lib.es2021.d.ts"], ["es2022", "lib.es2022.d.ts"], + ["es2023", "lib.es2023.d.ts"], ["esnext", "lib.esnext.d.ts"], // Host only ["dom", "lib.dom.d.ts"], @@ -36343,14 +36747,17 @@ ${lanes.join("\n")} ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"], ["es2022.string", "lib.es2022.string.d.ts"], ["es2022.regexp", "lib.es2022.regexp.d.ts"], - ["esnext.array", "lib.es2022.array.d.ts"], + ["es2023.array", "lib.es2023.array.d.ts"], + ["esnext.array", "lib.es2023.array.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.es2022.string.d.ts"], ["esnext.promise", "lib.es2021.promise.d.ts"], - ["esnext.weakref", "lib.es2021.weakref.d.ts"] + ["esnext.weakref", "lib.es2021.weakref.d.ts"], + ["decorators", "lib.decorators.d.ts"], + ["decorators.legacy", "lib.decorators.legacy.d.ts"] ]; libs = libEntries.map((entry) => entry[0]); libMap = new Map(libEntries); @@ -36893,6 +37300,13 @@ ${lanes.join("\n")} transpileOptionValue: true, defaultValueDescription: false }, + { + name: "verbatimModuleSyntax", + type: "boolean", + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting, + defaultValueDescription: false + }, // Strict Type Checks { name: "strict", @@ -37194,7 +37608,7 @@ ${lanes.join("\n")} { name: "allowImportingTsExtensions", type: "boolean", - affectsModuleResolution: true, + affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, defaultValueDescription: false @@ -37258,10 +37672,11 @@ ${lanes.join("\n")} { name: "experimentalDecorators", type: "boolean", + affectsEmit: true, affectsSemanticDiagnostics: true, affectsBuildInfo: true, category: Diagnostics.Language_and_Environment, - description: Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators, + description: Diagnostics.Enable_experimental_support_for_legacy_experimental_decorators, defaultValueDescription: false }, { @@ -37375,7 +37790,7 @@ ${lanes.join("\n")} paramType: Diagnostics.NEWLINE, category: Diagnostics.Emit, description: Diagnostics.Set_the_newline_character_for_emitting_files, - defaultValueDescription: Diagnostics.Platform_specific + defaultValueDescription: "lf" }, { name: "noErrorTruncation", @@ -37551,7 +37966,7 @@ ${lanes.join("\n")} affectsModuleResolution: true, category: Diagnostics.Interop_Constraints, description: Diagnostics.Ensure_that_casing_is_correct_in_imports, - defaultValueDescription: false + defaultValueDescription: true }, { name: "maxNodeModuleJsDepth", @@ -37675,14 +38090,6 @@ ${lanes.join("\n")} ...optionsForBuild ]; typeAcquisitionDeclarations = [ - { - /* @deprecated typingOptions.enableAutoDiscovery - * Use typeAcquisition.enable instead. - */ - name: "enableAutoDiscovery", - type: "boolean", - defaultValueDescription: false - }, { name: "enable", type: "boolean", @@ -37822,7 +38229,7 @@ ${lanes.join("\n")} Debug.assert(extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations); @@ -37840,7 +38247,8 @@ ${lanes.join("\n")} }, failedLookupLocations: initializeResolutionField(failedLookupLocations), affectingLocations: initializeResolutionField(affectingLocations), - resolutionDiagnostics: initializeResolutionField(diagnostics) + resolutionDiagnostics: initializeResolutionField(diagnostics), + node10Result: legacyResult }; } function initializeResolutionField(value) { @@ -38880,7 +39288,7 @@ ${lanes.join("\n")} ); } function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) { - var _a2, _b; + var _a2, _b, _c, _d; const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations = []; const affectingLocations = []; @@ -38907,44 +39315,60 @@ ${lanes.join("\n")} if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) { const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */); const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */); - result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0; + result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0; } else { - result = tryResolve(extensions); + result = tryResolve(extensions, state); + } + let legacyResult; + if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) { + traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update); + const diagnosticState = { + ...state, + features: state.features & ~8 /* Exports */, + failedLookupLocations: [], + affectingLocations: [], + reportDiagnostic: noop + }; + const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState); + if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) { + legacyResult = diagnosticResult.value.resolved.path; + } } return createResolvedModuleWithFailedLookupLocations( - (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved, - (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport, + (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, + (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state.resultFromCache, + legacyResult ); - function tryResolve(extensions2) { - const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName( + function tryResolve(extensions2, state2) { + const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName( extensions3, candidate, onlyRecordFailures, - state2, + state3, /*considerPackageJson*/ true ); - const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state); + const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2); if (resolved) { return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) }); } if (!isExternalModuleNameRelative(moduleName)) { let resolved2; if (features & 2 /* Imports */ && startsWith(moduleName, "#")) { - resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2 && features & 4 /* SelfName */) { - resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) { if (traceEnabled) { trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2)); } - resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) return void 0; @@ -38963,7 +39387,7 @@ ${lanes.join("\n")} candidate, /*onlyRecordFailures*/ false, - state, + state2, /*considerPackageJson*/ true ); @@ -40164,7 +40588,7 @@ ${lanes.join("\n")} } } function shouldAllowImportingTsExtension(compilerOptions, fromFileName) { - return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && (!!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName)); + return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName); } function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) { const traceEnabled = isTraceEnabled(compilerOptions, host); @@ -40318,7 +40742,7 @@ ${lanes.join("\n")} case 264 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { return 0 /* NonInstantiated */; } } @@ -40754,6 +41178,7 @@ ${lanes.join("\n")} } else if (containerFlags & 64 /* IsInterface */) { seenThisKeyword = false; bindChildren(node); + Debug.assertNotNode(node, isIdentifier); node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */; } else { bindChildren(node); @@ -41054,13 +41479,12 @@ ${lanes.join("\n")} } else if (node.kind === 221 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 223 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); + return isLogicalOrCoalescingBinaryExpression(node); } } } function isLogicalAssignmentExpression(node) { - node = skipParentheses(node); - return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind); + return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node)); } function isTopLevelLogicalExpression(node) { while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) { @@ -41443,7 +41867,7 @@ ${lanes.join("\n")} }; } const operator = node.operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */ || isLogicalOrCoalescingAssignmentOperator(operator)) { + if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) { if (isTopLevelLogicalExpression(node)) { const postExpressionLabel = createBranchLabel(); bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); @@ -41913,13 +42337,17 @@ ${lanes.join("\n")} } function checkContextualIdentifier(node) { if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) { - if (inStrictMode && node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 125 /* LastFutureReservedWord */) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind === void 0) { + return; + } + if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, getStrictModeIdentifierMessage(node), declarationNameToString(node) )); - } else if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + } else if (originalKeywordKind === 133 /* AwaitKeyword */) { if (isExternalModule(file) && isInTopLevelContext(node)) { file.bindDiagnostics.push(createDiagnosticForNode2( node, @@ -41933,7 +42361,7 @@ ${lanes.join("\n")} declarationNameToString(node) )); } - } else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { + } else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, @@ -42145,7 +42573,7 @@ ${lanes.join("\n")} function bindWorker(node) { switch (node.kind) { case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { let parentNode = node.parent; while (parentNode && !isJSDocTypeAlias(parentNode)) { parentNode = parentNode.parent; @@ -44078,6 +44506,7 @@ ${lanes.join("\n")} deferredDiagnosticsCallbacks.push(arg); }; let cancellationToken; + const requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); let requestedExternalEmitHelpers; let externalHelpersModule; const Symbol46 = objectAllocator.getSymbolConstructor(); @@ -44096,6 +44525,7 @@ ${lanes.join("\n")} const compilerOptions = host.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); @@ -44120,6 +44550,7 @@ ${lanes.join("\n")} globals.set(globalThisSymbol.escapedName, globalThisSymbol); const argumentsSymbol = createSymbol(4 /* Property */, "arguments"); const requireSymbol = createSymbol(4 /* Property */, "require"); + const isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; let apparentArgumentCount; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), @@ -44540,6 +44971,7 @@ ${lanes.join("\n")} const stringMappingTypes = /* @__PURE__ */ new Map(); const substitutionTypes = /* @__PURE__ */ new Map(); const subtypeReductionCache = /* @__PURE__ */ new Map(); + const decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); const cachedTypes = /* @__PURE__ */ new Map(); const evolvingArrayTypes = []; const undefinedProperties = /* @__PURE__ */ new Map(); @@ -44779,6 +45211,14 @@ ${lanes.join("\n")} let deferredGlobalBigIntType; let deferredGlobalNaNSymbol; let deferredGlobalRecordSymbol; + let deferredGlobalClassDecoratorContextType; + let deferredGlobalClassMethodDecoratorContextType; + let deferredGlobalClassGetterDecoratorContextType; + let deferredGlobalClassSetterDecoratorContextType; + let deferredGlobalClassAccessorDecoratorContextType; + let deferredGlobalClassAccessorDecoratorTargetType; + let deferredGlobalClassAccessorDecoratorResultType; + let deferredGlobalClassFieldDecoratorContextType; const allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); let flowLoopStart = 0; let flowLoopCount = 0; @@ -44865,7 +45305,7 @@ ${lanes.join("\n")} if (jsxFragmentPragma) { const chosenPragma = isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma; file.localJsxFragmentFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFragmentFactory, markAsSynthetic); + visitNode(file.localJsxFragmentFactory, markAsSynthetic, isEntityName); if (file.localJsxFragmentFactory) { return file.localJsxFragmentNamespace = getFirstIdentifier(file.localJsxFragmentFactory).escapedText; } @@ -44908,7 +45348,7 @@ ${lanes.join("\n")} if (jsxPragma) { const chosenPragma = isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; file.localJsxFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFactory, markAsSynthetic); + visitNode(file.localJsxFactory, markAsSynthetic, isEntityName); if (file.localJsxFactory) { return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; } @@ -44961,7 +45401,7 @@ ${lanes.join("\n")} addErrorOrSuggestion(isError, "message" in message ? createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : createDiagnosticForFileFromMessageChain(file, message)); return; } - addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(location, message)); + addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(location), location, message)); } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { const diagnostic = error(location, message, arg0, arg1, arg2, arg3); @@ -45006,6 +45446,16 @@ ${lanes.join("\n")} symbol.links.checkFlags = checkFlags || 0 /* None */; return symbol; } + function createParameter(name, type) { + const symbol = createSymbol(1 /* FunctionScopedVariable */, name); + symbol.links.type = type; + return symbol; + } + function createProperty(name, type) { + const symbol = createSymbol(4 /* Property */, name); + symbol.links.type = type; + return symbol; + } function getExcludedSymbolFlags(flags) { let result = 0; if (flags & 2 /* BlockScopedVariable */) @@ -45552,6 +46002,15 @@ ${lanes.join("\n")} break; case 263 /* EnumDeclaration */: if (result = lookup(((_c = getSymbolOfDeclaration(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) { + if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 16777216 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { + error( + errorLocation, + Diagnostics.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead, + unescapeLeadingUnderscores(name), + isolatedModulesLikeFlagName, + `${unescapeLeadingUnderscores(getSymbolOfNode(location).escapedName)}.${unescapeLeadingUnderscores(name)}` + ); + } break loop; } break; @@ -45797,7 +46256,7 @@ ${lanes.join("\n")} if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */); if (typeOnlyDeclaration) { - const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; const unescapedName = unescapeLeadingUnderscores(name); addTypeOnlyDeclarationRelatedInfo( error(errorLocation, message, unescapedName), @@ -45817,7 +46276,7 @@ ${lanes.join("\n")} diagnostic, createDiagnosticForNode( typeOnlyDeclaration, - typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, + typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, unescapedName ) ); @@ -46196,10 +46655,10 @@ ${lanes.join("\n")} false ) && !node.isTypeOnly) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); - const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */; + const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */; const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here; - const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); + const name = typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); } } @@ -46419,6 +46878,7 @@ ${lanes.join("\n")} return valueSymbol; } const result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); + Debug.assert(valueSymbol.declarations || typeSymbol.declarations); result.declarations = deduplicate(concatenate(valueSymbol.declarations, typeSymbol.declarations), equateValues); result.parent = valueSymbol.parent || typeSymbol.parent; if (valueSymbol.valueDeclaration) @@ -46430,15 +46890,19 @@ ${lanes.join("\n")} return result; } function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + var _a2; if (symbol.flags & 1536 /* Module */) { const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); const resolved = resolveSymbol(exportSymbol, dontResolveAlias); + const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name.escapedText); markSymbolOfAliasDeclarationIfTypeOnly( specifier, exportSymbol, resolved, /*overwriteEmpty*/ - false + false, + exportStarDeclaration, + name.escapedText ); return resolved; } @@ -46765,7 +47229,7 @@ ${lanes.join("\n")} } return flags; } - function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { + function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) { if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration)) return false; const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration); @@ -46774,6 +47238,14 @@ ${lanes.join("\n")} links2.typeOnlyDeclaration = aliasDeclaration; return true; } + if (exportStarDeclaration) { + const links2 = getSymbolLinks(sourceSymbol); + links2.typeOnlyDeclaration = exportStarDeclaration; + if (sourceSymbol.escapedName !== exportStarName) { + links2.typeOnlyExportStarName = exportStarName; + } + return true; + } const links = getSymbolLinks(sourceSymbol); return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty); } @@ -46795,11 +47267,15 @@ ${lanes.join("\n")} return links.typeOnlyDeclaration || void 0; } if (links.typeOnlyDeclaration) { - return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : void 0; + const resolved = links.typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); + return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; } return void 0; } function markExportAsReferenced(node) { + if (compilerOptions.verbatimModuleSyntax) { + return; + } const symbol = getSymbolOfDeclaration(node); const target = resolveAlias(symbol); if (target) { @@ -46810,6 +47286,7 @@ ${lanes.join("\n")} } } function markAliasSymbolAsReferenced(symbol) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); const links = getSymbolLinks(symbol); if (!links.referenced) { links.referenced = true; @@ -47116,6 +47593,8 @@ ${lanes.join("\n")} /*isError*/ false, errorNode, + currentSourceFile, + mode, resolvedModule, moduleReference ); @@ -47167,7 +47646,7 @@ ${lanes.join("\n")} } } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chainDiagnosticMessages( + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chainDiagnosticMessages( diagnosticDetails, Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, moduleReference @@ -47201,6 +47680,8 @@ ${lanes.join("\n")} /*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, + currentSourceFile, + mode, resolvedModule, moduleReference ); @@ -47255,26 +47736,37 @@ ${lanes.join("\n")} return importSourceWithoutExtension; } } - function errorOnImplicitAnyModule(isError, errorNode, { packageId, resolvedFileName }, moduleReference) { - const errorInfo = !isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, - packageId.name, - mangleScopedPackageName(packageId.name) - ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, - packageId.name, - moduleReference - ) : chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, - moduleReference, - mangleScopedPackageName(packageId.name) - ) : void 0; + function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) { + var _a2, _b; + let errorInfo; + if (!isExternalModuleNameRelative(moduleReference) && packageId) { + const node10Result = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleReference, mode)) == null ? void 0 : _b.node10Result; + errorInfo = node10Result ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings, + node10Result, + node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageId.name)}` : packageId.name + ) : typesPackageExists(packageId.name) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, + packageId.name, + mangleScopedPackageName(packageId.name) + ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, + packageId.name, + moduleReference + ) : chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, + moduleReference, + mangleScopedPackageName(packageId.name) + ); + } errorOrSuggestion(isError, errorNode, chainDiagnosticMessages( errorInfo, Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, @@ -47434,7 +47926,12 @@ ${lanes.join("\n")} } function getExportsOfModule(moduleSymbol) { const links = getSymbolLinks(moduleSymbol); - return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol)); + if (!links.resolvedExports) { + const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol); + links.resolvedExports = exports; + links.typeOnlyExportStarMap = typeOnlyExportStarMap; + } + return links.resolvedExports; } function extendExportSymbols(target, source, lookupTable, exportNode) { if (!source) @@ -47462,9 +47959,21 @@ ${lanes.join("\n")} } function getExportsOfModuleWorker(moduleSymbol) { const visitedSymbols = []; + let typeOnlyExportStarMap; + const nonTypeOnlyNames = /* @__PURE__ */ new Set(); moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); - return visit(moduleSymbol) || emptySymbols; - function visit(symbol) { + const exports = visit(moduleSymbol) || emptySymbols; + if (typeOnlyExportStarMap) { + nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name)); + } + return { + exports, + typeOnlyExportStarMap + }; + function visit(symbol, exportStar, isTypeOnly) { + if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) { + symbol.exports.forEach((_, name) => nonTypeOnlyNames.add(name)); + } if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) { return; } @@ -47476,7 +47985,7 @@ ${lanes.join("\n")} if (exportStars.declarations) { for (const node of exportStars.declarations) { const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); - const exportedSymbols = visit(resolvedModule); + const exportedSymbols = visit(resolvedModule, node, isTypeOnly || node.isTypeOnly); extendExportSymbols( nestedSymbols, exportedSymbols, @@ -47500,6 +48009,13 @@ ${lanes.join("\n")} }); extendExportSymbols(symbols, nestedSymbols); } + if (exportStar == null ? void 0 : exportStar.isTypeOnly) { + typeOnlyExportStarMap != null ? typeOnlyExportStarMap : typeOnlyExportStarMap = /* @__PURE__ */ new Map(); + symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set( + escapedName, + exportStar + )); + } return symbols; } } @@ -48931,13 +49447,17 @@ ${lanes.join("\n")} let qualifier = root.qualifier; if (qualifier) { if (isIdentifier(qualifier)) { - qualifier = factory.updateIdentifier(qualifier, typeArguments); + if (typeArguments !== getIdentifierTypeArguments(qualifier)) { + qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments); + } } else { - qualifier = factory.updateQualifiedName( - qualifier, - qualifier.left, - factory.updateIdentifier(qualifier.right, typeArguments) - ); + if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) { + qualifier = factory.updateQualifiedName( + qualifier, + qualifier.left, + setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments) + ); + } } } typeArguments = ref.typeArguments; @@ -48957,13 +49477,17 @@ ${lanes.join("\n")} let typeArguments = root.typeArguments; let typeName = root.typeName; if (isIdentifier(typeName)) { - typeName = factory.updateIdentifier(typeName, typeArguments); + if (typeArguments !== getIdentifierTypeArguments(typeName)) { + typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments); + } } else { - typeName = factory.updateQualifiedName( - typeName, - typeName.left, - factory.updateIdentifier(typeName.right, typeArguments) - ); + if (typeArguments !== getIdentifierTypeArguments(typeName.right)) { + typeName = factory.updateQualifiedName( + typeName, + typeName.left, + setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments) + ); + } } typeArguments = ref.typeArguments; const ids = getAccessStack(ref); @@ -49677,7 +50201,11 @@ ${lanes.join("\n")} if (!nonRootParts || isEntityName(nonRootParts)) { if (nonRootParts) { const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; - lastId.typeArguments = void 0; + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); } return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf); } else { @@ -49694,8 +50222,12 @@ ${lanes.join("\n")} return factory.createTypeQueryNode(entityName); } else { const lastId = isIdentifier(entityName) ? entityName : entityName.right; - const lastTypeArgs = lastId.typeArguments; - lastId.typeArguments = void 0; + const lastTypeArgs = getIdentifierTypeArguments(lastId); + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); return factory.createTypeReferenceNode(entityName, lastTypeArgs); } function createAccessFromSymbolChain(chain2, index, stopper) { @@ -49739,7 +50271,9 @@ ${lanes.join("\n")} return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2))); } } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; if (index > stopper) { const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper); @@ -49797,7 +50331,9 @@ ${lanes.join("\n")} text = `${rawtext}_${i}`; } if (text !== rawtext) { - result = factory.createIdentifier(text, result.typeArguments); + const typeArguments = getIdentifierTypeArguments(result); + result = factory.createIdentifier(text); + setIdentifierTypeArguments(result, typeArguments); } (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i); (context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result); @@ -49821,7 +50357,9 @@ ${lanes.join("\n")} if (index === 0) { context.flags ^= 16777216 /* InInitialEntityName */; } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier; } @@ -49844,7 +50382,9 @@ ${lanes.join("\n")} return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context)); } if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) { - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier; } else { @@ -49859,8 +50399,11 @@ ${lanes.join("\n")} expression = factory.createNumericLiteral(+symbolName2); } if (!expression) { - expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); - expression.symbol = symbol2; + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); + identifier.symbol = symbol2; + expression = identifier; } return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression); } @@ -50016,7 +50559,7 @@ ${lanes.join("\n")} } let hadError = false; const file = getSourceFileOfNode(existing); - const transformed = visitNode(existing, visitExistingNodeTreeSymbols); + const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode); if (hadError) { return void 0; } @@ -50029,16 +50572,16 @@ ${lanes.join("\n")} return factory.createKeywordTypeNode(157 /* UnknownKeyword */); } if (isJSDocNullableType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), factory.createLiteralTypeNode(factory.createNull())]); + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createLiteralTypeNode(factory.createNull())]); } if (isJSDocOptionalType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), factory.createKeywordTypeNode(155 /* UndefinedKeyword */)]); + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createKeywordTypeNode(155 /* UndefinedKeyword */)]); } if (isJSDocNonNullableType(node)) { return visitNode(node.type, visitExistingNodeTreeSymbols); } if (isJSDocVariadicType(node)) { - return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols)); + return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode)); } if (isJSDocTypeLiteral(node)) { return factory.createTypeLiteralNode(map(node.jsDocPropertyTags, (t) => { @@ -50050,7 +50593,7 @@ ${lanes.join("\n")} void 0, name, t.isBracketed || t.typeExpression && isJSDocOptionalType(t.typeExpression.type) ? factory.createToken(57 /* QuestionToken */) : void 0, - overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); })); } @@ -50069,9 +50612,9 @@ ${lanes.join("\n")} "x", /*questionToken*/ void 0, - visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols) + visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols, isTypeNode) )], - visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols) + visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols, isTypeNode) )]); } if (isJSDocFunctionType(node)) { @@ -50080,33 +50623,33 @@ ${lanes.join("\n")} return factory.createConstructorTypeNode( /*modifiers*/ void 0, - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols), + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), mapDefined(node.parameters, (p, i) => p.name && isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode = p.type, void 0) : factory.createParameterDeclaration( /*modifiers*/ void 0, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, - visitNode(p.type, visitExistingNodeTreeSymbols), + visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), /*initializer*/ void 0 )), - visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); } else { return factory.createFunctionTypeNode( - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols), + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), map(node.parameters, (p, i) => factory.createParameterDeclaration( /*modifiers*/ void 0, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, - visitNode(p.type, visitExistingNodeTreeSymbols), + visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), /*initializer*/ void 0 )), - visitNode(node.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); } } @@ -50555,7 +51098,7 @@ ${lanes.join("\n")} /*modifiers*/ void 0, /*isTypeOnly*/ - false, + node.isTypeOnly, /*exportClause*/ void 0, factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context)) @@ -51028,7 +51571,7 @@ ${lanes.join("\n")} break; } case 268 /* ImportEqualsDeclaration */: - if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, isJsonSourceFile)) { + if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) { serializeMaybeAliasAssignment(symbol); break; } @@ -52123,6 +52666,12 @@ ${lanes.join("\n")} const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration); const isOptional = includeOptionality && isOptionalDeclaration(declaration); const declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { + if (declaredType) { + return isTypeAny(declaredType) || declaredType === unknownType ? declaredType : errorType; + } + return useUnknownInCatchVariables ? unknownType : anyType; + } if (declaredType) { return addOptionality(declaredType, isProperty, isOptional); } @@ -52701,14 +53250,6 @@ ${lanes.join("\n")} } Debug.assertIsDefined(symbol.valueDeclaration); const declaration = symbol.valueDeclaration; - if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode === void 0) { - return useUnknownInCatchVariables ? unknownType : anyType; - } - const type2 = getTypeOfNode(typeNode); - return isTypeAny(type2) || type2 === unknownType ? type2 : errorType; - } if (isSourceFile(declaration) && isJsonSourceFile(declaration)) { if (!declaration.statements.length) { return emptyObjectType; @@ -53300,7 +53841,7 @@ ${lanes.join("\n")} baseType ); const diagnostic = chainDiagnosticMessages(elaboration, Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(reducedBaseType)); - diagnostics.add(createDiagnosticForNodeFromMessageChain(baseTypeNode.expression, diagnostic)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(baseTypeNode.expression), baseTypeNode.expression, diagnostic)); return type.resolvedBaseTypes = emptyArray; } if (type === reducedBaseType || hasBaseType(reducedBaseType, type)) { @@ -53701,7 +54242,7 @@ ${lanes.join("\n")} const links = getSymbolLinks(symbol); if (!links[resolutionKind]) { const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */; - const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) : symbol.exports; + const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol).exports : symbol.exports; links[resolutionKind] = earlySymbols || emptySymbols; const lateSymbols = createSymbolTable(); for (const decl of symbol.declarations || emptyArray) { @@ -54690,7 +55231,7 @@ ${lanes.join("\n")} } function isConstTypeVariable(type) { var _a2; - return !!(type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType)); + return !!(type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || isGenericTupleType(type) && findIndex(getTypeArguments(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t)) >= 0 || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType)); } function getConstraintOfIndexedAccess(type) { return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0; @@ -55914,6 +56455,12 @@ ${lanes.join("\n")} } return result & 458752 /* PropagatingFlags */; } + function tryCreateTypeReference(target, typeArguments) { + if (some(typeArguments) && target === emptyGenericType) { + return unknownType; + } + return createTypeReference(target, typeArguments); + } function createTypeReference(target, typeArguments) { const id = getTypeListId(typeArguments); let type = target.instantiations.get(id); @@ -56608,6 +57155,78 @@ ${lanes.join("\n")} false )) || emptyObjectType; } + function getGlobalClassDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassDecoratorContextType != null ? deferredGlobalClassDecoratorContextType : deferredGlobalClassDecoratorContextType = getGlobalType( + "ClassDecoratorContext", + /*arity*/ + 1, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassMethodDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassMethodDecoratorContextType != null ? deferredGlobalClassMethodDecoratorContextType : deferredGlobalClassMethodDecoratorContextType = getGlobalType( + "ClassMethodDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassGetterDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassGetterDecoratorContextType != null ? deferredGlobalClassGetterDecoratorContextType : deferredGlobalClassGetterDecoratorContextType = getGlobalType( + "ClassGetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassSetterDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassSetterDecoratorContextType != null ? deferredGlobalClassSetterDecoratorContextType : deferredGlobalClassSetterDecoratorContextType = getGlobalType( + "ClassSetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorContextType != null ? deferredGlobalClassAccessorDecoratorContextType : deferredGlobalClassAccessorDecoratorContextType = getGlobalType( + "ClassAccessorDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorTargetType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorTargetType != null ? deferredGlobalClassAccessorDecoratorTargetType : deferredGlobalClassAccessorDecoratorTargetType = getGlobalType( + "ClassAccessorDecoratorTarget", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorResultType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorResultType != null ? deferredGlobalClassAccessorDecoratorResultType : deferredGlobalClassAccessorDecoratorResultType = getGlobalType( + "ClassAccessorDecoratorResult", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassFieldDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassFieldDecoratorContextType != null ? deferredGlobalClassFieldDecoratorContextType : deferredGlobalClassFieldDecoratorContextType = getGlobalType( + "ClassFieldDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } function getGlobalNaNSymbol() { return deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol( "NaN", @@ -57918,7 +58537,7 @@ ${lanes.join("\n")} typeToString(fullIndexType), typeToString(objectType) ); - diagnostics.add(createDiagnosticForNodeFromMessageChain(accessExpression, errorInfo)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(accessExpression), accessExpression, errorInfo)); } } } @@ -60332,7 +60951,7 @@ ${lanes.join("\n")} } } } - const diag2 = createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, errorInfo, relatedInformation); if (relatedInfo) { addRelatedInfo(diag2, ...relatedInfo); } @@ -63375,19 +63994,22 @@ ${lanes.join("\n")} break; case 166 /* Parameter */: const param = declaration; - if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( - param, - param.name.escapedText, - 788968 /* Type */, - void 0, - param.name.escapedText, - /*isUse*/ - true - ) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) { - const newName = "arg" + param.parent.parameters.indexOf(param); - const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); - errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); - return; + if (isIdentifier(param.name)) { + const originalKeywordKind = identifierToKeywordKind(param.name); + if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( + param, + param.name.escapedText, + 788968 /* Type */, + void 0, + param.name.escapedText, + /*isUse*/ + true + ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) { + const newName = "arg" + param.parent.parameters.indexOf(param); + const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); + errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); + return; + } } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; @@ -63575,6 +64197,10 @@ ${lanes.join("\n")} function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); } + function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { + const typePredicate = getTypePredicateOfSignature(signature); + return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter); + } function createEmptyObjectTypeFromStringLiteral(type) { const members = createSymbolTable(); forEachType(type, (t) => { @@ -64298,7 +64924,7 @@ ${lanes.join("\n")} } else { const middleLength = targetArity - startLength - endLength; if (middleLength === 2) { - if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) { + if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */) { const targetInfo = getInferenceInfoForType(elementTypes[startLength]); if (targetInfo && targetInfo.impliedArity !== void 0) { inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]); @@ -64312,7 +64938,7 @@ ${lanes.join("\n")} inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]); inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]); } - } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) { + } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */) { const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter; const constraint = param && getBaseConstraintOfType(param); if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) { @@ -64332,10 +64958,10 @@ ${lanes.join("\n")} } } else if (middleLength === 1 && elementFlags[startLength] & 8 /* Variadic */) { const endsInOptional = target.target.elementFlags[targetArity - 1] & 2 /* Optional */; - const sourceSlice = isTupleType(source) ? sliceTupleType(source, startLength, endLength) : createArrayType(getTypeArguments(source)[0]); + const sourceSlice = sliceTupleType(source, startLength, endLength); inferWithPriority(sourceSlice, elementTypes[startLength], endsInOptional ? 2 /* SpeculativeTuple */ : 0); } else if (middleLength === 1 && elementFlags[startLength] & 4 /* Rest */) { - const restType = isTupleType(source) ? getElementTypeOfSliceOfTupleType(source, startLength, endLength) : getTypeArguments(source)[0]; + const restType = getElementTypeOfSliceOfTupleType(source, startLength, endLength); if (restType) { inferFromTypes(restType, elementTypes[startLength]); } @@ -64446,7 +65072,7 @@ ${lanes.join("\n")} function getCovariantInference(inference, signature) { const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates); const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter); - const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); + const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter)); const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates; const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates); return getWidenedType(unwidenedType); @@ -66501,7 +67127,7 @@ ${lanes.join("\n")} return getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */); } function isSymbolAssigned(symbol) { if (!symbol.valueDeclaration) { @@ -66583,6 +67209,9 @@ ${lanes.join("\n")} }); } function markAliasReferenced(symbol, location) { + if (compilerOptions.verbatimModuleSyntax) { + return; + } if (isNonLocalAlias( symbol, /*excludes*/ @@ -66590,7 +67219,7 @@ ${lanes.join("\n")} ) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) { const target = resolveAlias(symbol); if (getAllSymbolFlags(target) & (111551 /* Value */ | 1048576 /* ExportValue */)) { - if (compilerOptions.isolatedModules || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { + if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { markAliasSymbolAsReferenced(symbol); } else { markConstEnumAliasAsReferenced(symbol); @@ -66599,6 +67228,7 @@ ${lanes.join("\n")} } } function getNarrowedTypeOfSymbol(symbol, location) { + var _a2; const type = getTypeOfSymbol(symbol); const declaration = symbol.valueDeclaration; if (declaration) { @@ -66634,7 +67264,7 @@ ${lanes.join("\n")} if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) { const contextualSignature = getContextualSignature(func); if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) { - const restType = getReducedApparentType(getTypeOfSymbol(contextualSignature.parameters[0])); + const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a2 = getInferenceContext(func)) == null ? void 0 : _a2.nonFixingMapper)); if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) { const narrowedType = getFlowTypeOfReference( func, @@ -66687,7 +67317,7 @@ ${lanes.join("\n")} } let declaration = localOrExportSymbol.valueDeclaration; if (declaration && localOrExportSymbol.flags & 32 /* Class */) { - if (declaration.kind === 260 /* ClassDeclaration */ && nodeIsDecorated(declaration)) { + if (declaration.kind === 260 /* ClassDeclaration */ && nodeIsDecorated(legacyDecorators, declaration)) { let container = getContainingClass(node); while (container !== void 0) { if (container === declaration && container.name !== node) { @@ -66758,13 +67388,14 @@ ${lanes.join("\n")} const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); + const isCatch = flowContainer.kind === 295 /* CatchClause */; const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -66911,7 +67542,7 @@ ${lanes.join("\n")} } } function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) { - if (isPropertyDeclaration(container) && hasStaticModifier(container) && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { + if (isPropertyDeclaration(container) && hasStaticModifier(container) && legacyDecorators && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { error(thisExpression, Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); } } @@ -67289,7 +67920,7 @@ ${lanes.join("\n")} } } function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0); if (typeNode) { return getTypeFromTypeNode(typeNode); } @@ -67455,6 +68086,10 @@ ${lanes.join("\n")} const restIndex = signature.parameters.length - 1; return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex); } + function getContextualTypeForDecorator(decorator) { + const signature = getDecoratorCallSignature(decorator); + return signature ? getOrCreateTypeFromSignature(signature) : void 0; + } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { if (template.parent.kind === 212 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); @@ -67855,7 +68490,9 @@ ${lanes.join("\n")} } const index = findContextualNode(node); if (index >= 0) { - return contextualTypes[index]; + const cached = contextualTypes[index]; + if (cached || !contextFlags) + return cached; } const { parent: parent2 } = node; switch (parent2.kind) { @@ -67875,6 +68512,8 @@ ${lanes.join("\n")} case 210 /* CallExpression */: case 211 /* NewExpression */: return getContextualTypeForArgument(parent2, node); + case 167 /* Decorator */: + return getContextualTypeForDecorator(parent2); case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: return isConstTypeReference(parent2.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(parent2.type); @@ -67896,8 +68535,16 @@ ${lanes.join("\n")} Debug.assert(parent2.parent.kind === 225 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent2.parent, node); case 214 /* ParenthesizedExpression */: { - const tag = isInJSFile(parent2) ? getJSDocTypeTag(parent2) : void 0; - return !tag ? getContextualType2(parent2, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(tag.typeExpression.type); + if (isInJSFile(parent2)) { + if (isJSDocSatisfiesExpression(parent2)) { + return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent2)); + } + const typeTag = getJSDocTypeTag(parent2); + if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) { + return getTypeFromTypeNode(typeTag.typeExpression.type); + } + } + return getContextualType2(parent2, contextFlags); } case 232 /* NonNullExpression */: return getContextualType2(parent2, contextFlags); @@ -69049,7 +69696,7 @@ ${lanes.join("\n")} } if (jsxFactorySym) { jsxFactorySym.isReferenced = 67108863 /* All */; - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + if (!compilerOptions.verbatimModuleSyntax && jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { markAliasSymbolAsReferenced(jsxFactorySym); } } @@ -69506,7 +70153,7 @@ ${lanes.join("\n")} node.kind === 163 /* QualifiedName */ ); } - if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 302 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { + if (isIdentifier(left) && parentSymbol && (getIsolatedModules(compilerOptions) || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 302 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { markAliasReferenced(parentSymbol, node); } let propType; @@ -69715,7 +70362,7 @@ ${lanes.join("\n")} } } } - const resultDiagnostic = createDiagnosticForNodeFromMessageChain(propNode, errorInfo); + const resultDiagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(propNode), propNode, errorInfo); if (relatedInfo) { addRelatedInfo(resultDiagnostic, relatedInfo); } @@ -70577,35 +71224,22 @@ ${lanes.join("\n")} return args; } function getEffectiveDecoratorArguments(node) { - const parent2 = node.parent; const expr = node.expression; - switch (parent2.kind) { - case 260 /* ClassDeclaration */: - case 228 /* ClassExpression */: - return [ - createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfDeclaration(parent2))) - ]; - case 166 /* Parameter */: - const func = parent2.parent; - return [ - createSyntheticExpression(expr, parent2.parent.kind === 173 /* Constructor */ ? getTypeOfSymbol(getSymbolOfDeclaration(func)) : errorType), - createSyntheticExpression(expr, anyType), - createSyntheticExpression(expr, numberType) - ]; - case 169 /* PropertyDeclaration */: - case 171 /* MethodDeclaration */: - case 174 /* GetAccessor */: - case 175 /* SetAccessor */: - const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2)); - return [ - createSyntheticExpression(expr, getParentTypeOfClassElement(parent2)), - createSyntheticExpression(expr, getClassElementPropertyKeyType(parent2)), - createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent2)) : anyType) - ]; + const signature = getDecoratorCallSignature(node); + if (signature) { + const args = []; + for (const param of signature.parameters) { + const type = getTypeOfSymbol(param); + args.push(createSyntheticExpression(expr, type)); + } + return args; } return Debug.fail(); } function getDecoratorArgumentCount(node, signature) { + return compilerOptions.experimentalDecorators ? getLegacyDecoratorArgumentCount(node, signature) : 2; + } + function getLegacyDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { case 260 /* ClassDeclaration */: case 228 /* ClassExpression */: @@ -70640,9 +71274,15 @@ ${lanes.join("\n")} function getDiagnosticForCallNode(node, message, arg0, arg1, arg2, arg3) { if (isCallExpression(node)) { const { sourceFile, start, length: length2 } = getDiagnosticSpanForCallNode(node); - return createFileDiagnostic(sourceFile, start, length2, message, arg0, arg1, arg2, arg3); + if ("message" in message) { + return createFileDiagnostic(sourceFile, start, length2, message, arg0, arg1, arg2, arg3); + } + return createDiagnosticForFileFromMessageChain(sourceFile, message); } else { - return createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + if ("message" in message) { + return createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + } + return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, message); } } function isPromiseResolveArityError(node) { @@ -70666,7 +71306,7 @@ ${lanes.join("\n")} ); return constructorSymbol === globalPromiseSymbol; } - function getArgumentArityError(node, signatures, args) { + function getArgumentArityError(node, signatures, args, headMessage) { var _a2; const spreadIndex = getSpreadArgumentIndex(args); if (spreadIndex > -1) { @@ -70696,11 +71336,36 @@ ${lanes.join("\n")} if (isVoidPromiseError && isInJSFile(node)) { return getDiagnosticForCallNode(node, Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments); } - const error2 = hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; + const error2 = isDecorator(node) ? hasRestParameter2 ? Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 : Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 : hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; if (min2 < args.length && args.length < max) { + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, + args.length, + maxBelow, + minAbove + ); + chain = chainDiagnosticMessages(chain, headMessage); + return getDiagnosticForCallNode(node, chain); + } return getDiagnosticForCallNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove); } else if (args.length < min2) { - const diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + let diagnostic; + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + error2, + parameterRange, + args.length + ); + chain = chainDiagnosticMessages(chain, headMessage); + diagnostic = getDiagnosticForCallNode(node, chain); + } else { + diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + } const parameter = (_a2 = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a2.parameters[closestSignature.thisParameter ? args.length + 1 : args.length]; if (parameter) { const parameterError = createDiagnosticForNode( @@ -70719,15 +71384,37 @@ ${lanes.join("\n")} end++; } setTextRangePosEnd(errorSpan, pos, end); + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + error2, + parameterRange, + args.length + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), errorSpan, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error2, parameterRange, args.length); } } - function getTypeArgumentArityError(node, signatures, typeArguments) { + function getTypeArgumentArityError(node, signatures, typeArguments, headMessage) { const argCount = typeArguments.length; if (signatures.length === 1) { const sig = signatures[0]; const min2 = getMinTypeArgumentCount(sig.typeParameters); const max = length(sig.typeParameters); + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + min2 < max ? min2 + "-" + max : min2, + argCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min2 < max ? min2 + "-" + max : min2, argCount); } let belowArgCount = -Infinity; @@ -70742,11 +71429,34 @@ ${lanes.join("\n")} } } if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, + argCount, + belowArgCount, + aboveArgCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); } + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + belowArgCount === -Infinity ? aboveArgCount : belowArgCount, + argCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } - function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { + function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) { const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */; const isDecorator2 = node.kind === 167 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); @@ -70795,6 +71505,9 @@ ${lanes.join("\n")} chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call); } + if (headMessage) { + chain = chainDiagnosticMessages(chain, headMessage); + } const diags = getSignatureApplicabilityError( node, args, @@ -70855,39 +71568,40 @@ ${lanes.join("\n")} } const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures"); - const chain = chainDiagnosticMessages( + let chain = chainDiagnosticMessages( map(diags, createDiagnosticMessageChainFromDiagnostic), Diagnostics.No_overload_matches_this_call ); + if (headMessage) { + chain = chainDiagnosticMessages(chain, headMessage); + } const related = [...flatMap(diags, (d) => d.relatedInformation)]; let diag2; if (every(diags, (d) => d.start === diags[0].start && d.length === diags[0].length && d.file === diags[0].file)) { const { file, start, length: length2 } = diags[0]; diag2 = { file, start, length: length2, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; } else { - diag2 = createDiagnosticForNodeFromMessageChain(node, chain, related); + diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, chain, related); } addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2); diagnostics.add(diag2); } } else if (candidateForArgumentArityError) { - diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args)); + diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args, headMessage)); } else if (candidateForTypeArgumentError) { checkTypeArguments( candidateForTypeArgumentError, node.typeArguments, /*reportErrors*/ true, - fallbackError + headMessage ); } else { const signaturesWithCorrectTypeArgumentArity = filter(signatures, (s) => hasCorrectTypeArgumentArity(s, typeArguments)); if (signaturesWithCorrectTypeArgumentArity.length === 0) { - diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments)); - } else if (!isDecorator2) { - diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args)); - } else if (fallbackError) { - diagnostics.add(getDiagnosticForCallNode(node, fallbackError)); + diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments, headMessage)); + } else { + diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args, headMessage)); } } } @@ -71390,7 +72104,7 @@ ${lanes.join("\n")} } function invocationError(errorTarget, apparentType, kind, relatedInformation) { const { messageChain, relatedMessage: relatedInfo } = invocationErrorDetails(errorTarget, apparentType, kind); - const diagnostic = createDiagnosticForNodeFromMessageChain(errorTarget, messageChain); + const diagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorTarget), errorTarget, messageChain); if (relatedInfo) { addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo)); } @@ -71471,7 +72185,7 @@ ${lanes.join("\n")} if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { return resolveUntypedCall(node); } - if (isPotentiallyUncalledDecorator(node, callSignatures)) { + if (isPotentiallyUncalledDecorator(node, callSignatures) && !isParenthesizedExpression(node.expression)) { const nodeStr = getTextOfNode( node.expression, /*includeTrivia*/ @@ -71484,7 +72198,7 @@ ${lanes.join("\n")} if (!callSignatures.length) { const errorDetails = invocationErrorDetails(node.expression, apparentType, 0 /* Call */); const messageChain = chainDiagnosticMessages(errorDetails.messageChain, headMessage); - const diag2 = createDiagnosticForNodeFromMessageChain(node.expression, messageChain); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node.expression), node.expression, messageChain); if (errorDetails.relatedMessage) { addRelatedInfo(diag2, createDiagnosticForNode(node.expression, errorDetails.relatedMessage)); } @@ -72101,12 +72815,15 @@ ${lanes.join("\n")} } function checkSatisfiesExpression(node) { checkSourceElement(node.type); - const exprType = checkExpression(node.expression); - const targetType = getTypeFromTypeNode(node.type); + return checkSatisfiesExpressionWorker(node.expression, node.type); + } + function checkSatisfiesExpressionWorker(expression, target, checkMode) { + const exprType = checkExpression(expression, checkMode); + const targetType = getTypeFromTypeNode(target); if (isErrorType(targetType)) { return targetType; } - checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); + checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); return exprType; } function checkMetaProperty(node) { @@ -72444,6 +73161,243 @@ ${lanes.join("\n")} } } } + function createClassDecoratorContextType(classType) { + return tryCreateTypeReference(getGlobalClassDecoratorContextType( + /*reportErrors*/ + true + ), [classType]); + } + function createClassMethodDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassMethodDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassGetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassGetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassSetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassSetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassFieldDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2) { + const key = `${isPrivate ? "p" : "P"}${isStatic2 ? "s" : "S"}${nameType.id}`; + let overrideType = decoratorContextOverrideTypeCache.get(key); + if (!overrideType) { + const members = createSymbolTable(); + members.set("name", createProperty("name", nameType)); + members.set("private", createProperty("private", isPrivate ? trueType : falseType)); + members.set("static", createProperty("static", isStatic2 ? trueType : falseType)); + overrideType = createAnonymousType( + /*symbol*/ + void 0, + members, + emptyArray, + emptyArray, + emptyArray + ); + decoratorContextOverrideTypeCache.set(key, overrideType); + } + return overrideType; + } + function createClassMemberDecoratorContextTypeForNode(node, thisType, valueType) { + const isStatic2 = hasStaticModifier(node); + const isPrivate = isPrivateIdentifier(node.name); + const nameType = isPrivate ? getStringLiteralType(idText(node.name)) : getLiteralTypeFromPropertyName(node.name); + const contextType = isMethodDeclaration(node) ? createClassMethodDecoratorContextType(thisType, valueType) : isGetAccessorDeclaration(node) ? createClassGetterDecoratorContextType(thisType, valueType) : isSetAccessorDeclaration(node) ? createClassSetterDecoratorContextType(thisType, valueType) : isAutoAccessorPropertyDeclaration(node) ? createClassAccessorDecoratorContextType(thisType, valueType) : isPropertyDeclaration(node) ? createClassFieldDecoratorContextType(thisType, valueType) : Debug.failBadSyntaxKind(node); + const overrideType = getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2); + return getIntersectionType([contextType, overrideType]); + } + function createClassAccessorDecoratorTargetType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorTargetType( + /*reportError*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorResultType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorResultType( + /*reportError*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorInitializerMutatorType(thisType, valueType) { + const thisParam = createParameter("this", thisType); + const valueParam = createParameter("value", valueType); + return createFunctionType( + /*typeParameters*/ + void 0, + thisParam, + [valueParam], + valueType, + /*typePredicate*/ + void 0, + 1 + ); + } + function createESDecoratorCallSignature(targetType, contextType, nonOptionalReturnType) { + const targetParam = createParameter("target", targetType); + const contextParam = createParameter("context", contextType); + const returnType = getUnionType([nonOptionalReturnType, voidType]); + return createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, contextParam], + returnType + ); + } + function getESDecoratorCallSignature(decorator) { + const { parent: parent2 } = decorator; + const links = getNodeLinks(parent2); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent2.kind) { + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: { + const node = parent2; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const contextType = createClassDecoratorContextType(targetType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); + break; + } + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const valueType = isMethodDeclaration(node) ? getOrCreateTypeFromSignature(getSignatureFromDeclaration(node)) : getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + case 169 /* PropertyDeclaration */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const valueType = getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = hasAccessorModifier(node) ? createClassAccessorDecoratorTargetType(thisType, valueType) : undefinedType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = hasAccessorModifier(node) ? createClassAccessorDecoratorResultType(thisType, valueType) : createClassFieldDecoratorInitializerMutatorType(thisType, valueType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getLegacyDecoratorCallSignature(decorator) { + const { parent: parent2 } = decorator; + const links = getNodeLinks(parent2); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent2.kind) { + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: { + const node = parent2; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const targetParam = createParameter("target", targetType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam], + getUnionType([targetType, voidType]) + ); + break; + } + case 166 /* Parameter */: { + const node = parent2; + if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { + break; + } + if (getThisParameter(node.parent) === node) { + break; + } + const index = getThisParameter(node.parent) ? node.parent.parameters.indexOf(node) - 1 : node.parent.parameters.indexOf(node); + Debug.assert(index >= 0); + const targetType = isConstructorDeclaration(node.parent) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent.parent)) : getParentTypeOfClassElement(node.parent); + const keyType = isConstructorDeclaration(node.parent) ? undefinedType : getClassElementPropertyKeyType(node.parent); + const indexType = getNumberLiteralType(index); + const targetParam = createParameter("target", targetType); + const keyParam = createParameter("propertyKey", keyType); + const indexParam = createParameter("parameterIndex", indexType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, indexParam], + voidType + ); + break; + } + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: + case 169 /* PropertyDeclaration */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const targetType = getParentTypeOfClassElement(node); + const targetParam = createParameter("target", targetType); + const keyType = getClassElementPropertyKeyType(node); + const keyParam = createParameter("propertyKey", keyType); + const returnType = isPropertyDeclaration(node) ? voidType : createTypedPropertyDescriptorType(getTypeOfNode(node)); + const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2)); + if (hasPropDesc) { + const descriptorType = createTypedPropertyDescriptorType(getTypeOfNode(node)); + const descriptorParam = createParameter("descriptor", descriptorType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, descriptorParam], + getUnionType([returnType, voidType]) + ); + } else { + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam], + getUnionType([returnType, voidType]) + ); + } + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getDecoratorCallSignature(decorator) { + return legacyDecorators ? getLegacyDecoratorCallSignature(decorator) : getESDecoratorCallSignature(decorator); + } function createPromiseType(promisedType) { const globalPromiseType = getGlobalPromiseType( /*reportErrors*/ @@ -73513,12 +74467,12 @@ ${lanes.join("\n")} void 0 ); const operator = operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) { - if (operator === 55 /* AmpersandAmpersandToken */) { - let parent2 = node.parent; - while (parent2.kind === 214 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) { - parent2 = parent2.parent; - } + if (isLogicalOrCoalescingBinaryOperator(operator)) { + let parent2 = node.parent; + while (parent2.kind === 214 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { + parent2 = parent2.parent; + } + if (operator === 55 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) { checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0); } checkTruthinessOfType(leftType, node.left); @@ -73595,7 +74549,7 @@ ${lanes.join("\n")} return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 108 /* ThisKeyword */); } let leftType; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) { + if (isLogicalOrCoalescingBinaryOperator(operator)) { leftType = checkTruthinessExpression(left, checkMode); } else { leftType = checkExpression(left, checkMode); @@ -73746,7 +74700,14 @@ ${lanes.join("\n")} if (checkForDisallowedESSymbolOperand(operator)) { leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); - reportOperatorErrorUnless((left2, right2) => isTypeComparableTo(left2, right2) || isTypeComparableTo(right2, left2) || isTypeAssignableTo(left2, numberOrBigIntType) && isTypeAssignableTo(right2, numberOrBigIntType)); + reportOperatorErrorUnless((left2, right2) => { + if (isTypeAny(left2) || isTypeAny(right2)) { + return true; + } + const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType); + const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType); + return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2); + }); } return booleanType; case 34 /* EqualsEqualsToken */: @@ -73879,7 +74840,7 @@ ${lanes.join("\n")} left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access - ) && (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) { + )) { let headMessage; if (exactOptionalPropertyTypes && isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768 /* Undefined */)) { const target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText); @@ -74128,7 +75089,7 @@ ${lanes.join("\n")} } return links.resolvedType; } - function isTypeAssertion3(node) { + function isTypeAssertion(node) { node = skipParentheses( node, /*excludeJSDocTypeAssertions*/ @@ -74138,6 +75099,12 @@ ${lanes.join("\n")} } function checkDeclarationInitializer(declaration, checkMode, contextualType) { const initializer = getEffectiveInitializer(declaration); + if (isInJSFile(declaration)) { + const typeNode = tryGetJSDocSatisfiesTypeNode(declaration); + if (typeNode) { + return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode); + } + } const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType( initializer, contextualType, @@ -74206,7 +75173,7 @@ ${lanes.join("\n")} } function checkExpressionForMutableLocation(node, checkMode, forceTuple) { const type = checkExpression(node, checkMode, forceTuple); - return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion3(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType( + return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType( getContextualType2( node, /*contextFlags*/ @@ -74456,18 +75423,23 @@ ${lanes.join("\n")} if (!ok) { error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } - if (compilerOptions.isolatedModules) { + if (getIsolatedModules(compilerOptions)) { Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */)); const constEnumDeclaration = type.symbol.valueDeclaration; if (constEnumDeclaration.flags & 16777216 /* Ambient */) { - error(node, Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided); + error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } } } function checkParenthesizedExpression(node, checkMode) { - if (hasJSDocNodes(node) && isJSDocTypeAssertion(node)) { - const type = getJSDocTypeAssertionType(node); - return checkAssertionWorker(type, type, node.expression, checkMode); + if (hasJSDocNodes(node)) { + if (isJSDocSatisfiesExpression(node)) { + return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode); + } + if (isJSDocTypeAssertion(node)) { + const type = getJSDocTypeAssertionType(node); + return checkAssertionWorker(type, type, node.expression, checkMode); + } } return checkExpression(node.expression, checkMode); } @@ -74630,7 +75602,7 @@ ${lanes.join("\n")} } } function checkParameter(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkVariableLikeDeclaration(node); const func = getContainingFunction(node); if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) { @@ -74951,7 +75923,7 @@ ${lanes.join("\n")} } } function checkPropertyDeclaration(node) { - if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarProperty(node)) + if (!checkGrammarModifiers(node) && !checkGrammarProperty(node)) checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); setNodeLinksForPrivateIdentifierScope(node); @@ -74995,7 +75967,7 @@ ${lanes.join("\n")} } } function checkClassStaticBlockDeclaration(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); forEachChild(node, checkSourceElement); } function checkConstructorDeclaration(node) { @@ -75175,8 +76147,11 @@ ${lanes.join("\n")} } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 180 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) { - grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + if (node.kind === 180 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { + const sourceFile = getSourceFileOfNode(node); + if (scanTokenAtPosition(sourceFile, node.typeName.end) === 24 /* DotToken */) { + grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + } } forEach(node.typeArguments, checkSourceElement); const type = getTypeFromTypeReference(node); @@ -75869,7 +76844,7 @@ ${lanes.join("\n")} chain = chainDiagnosticMessages(chain, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForErrorOut.value)); } chain = chainDiagnosticMessages(chain, diagnosticMessage, arg0); - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chain)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chain)); } return void 0; } @@ -75960,36 +76935,66 @@ ${lanes.join("\n")} if (returnType.flags & 1 /* Any */) { return; } + const decoratorSignature = getDecoratorCallSignature(node); + if (!(decoratorSignature == null ? void 0 : decoratorSignature.resolvedReturnType)) + return; let headMessage; - let expectedReturnType; + const expectedReturnType = decoratorSignature.resolvedReturnType; switch (node.parent.kind) { case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - const classSymbol = getSymbolOfDeclaration(node.parent); - const classConstructorType = getTypeOfSymbol(classSymbol); - expectedReturnType = getUnionType([classConstructorType, voidType]); break; case 169 /* PropertyDeclaration */: + if (!legacyDecorators) { + headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + break; + } case 166 /* Parameter */: headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; - expectedReturnType = voidType; break; case 171 /* MethodDeclaration */: case 174 /* GetAccessor */: case 175 /* SetAccessor */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - const methodType = getTypeOfNode(node.parent); - const descriptorType = createTypedPropertyDescriptorType(methodType); - expectedReturnType = getUnionType([descriptorType, voidType]); break; default: - return Debug.fail(); + return Debug.failBadSyntaxKind(node.parent); } - checkTypeAssignableTo( - returnType, - expectedReturnType, - node, - headMessage + checkTypeAssignableTo(returnType, expectedReturnType, node.expression, headMessage); + } + function createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount = parameters.length, flags = 0 /* None */) { + const decl = factory.createFunctionTypeNode( + /*typeParameters*/ + void 0, + emptyArray, + factory.createKeywordTypeNode(131 /* AnyKeyword */) + ); + return createSignature(decl, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + } + function createFunctionType(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags) { + const signature = createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + return getOrCreateTypeFromSignature(signature); + } + function createGetterFunctionType(type) { + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + type + ); + } + function createSetterFunctionType(type) { + const valueParam = createParameter("value", type); + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [valueParam], + voidType ); } function markTypeNodeAsReferenced(node) { @@ -76016,9 +77021,9 @@ ${lanes.join("\n")} true ); if (rootSymbol && rootSymbol.flags & 2097152 /* Alias */) { - if (symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { + if (!compilerOptions.verbatimModuleSyntax && symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { markAliasSymbolAsReferenced(rootSymbol); - } else if (forDecoratorMetadata && compilerOptions.isolatedModules && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { + } else if (forDecoratorMetadata && getIsolatedModules(compilerOptions) && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { const diag2 = error(typeName, Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled); const aliasDeclaration = find(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration2); if (aliasDeclaration) { @@ -76084,19 +77089,37 @@ ${lanes.join("\n")} return isRestParameter(node) ? getRestParameterElementType(typeNode) : typeNode; } function checkDecorators(node) { - if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(node, node.parent, node.parent.parent)) { + if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { return; } - if (!compilerOptions.experimentalDecorators) { - error(node, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning); - } const firstDecorator = find(node.modifiers, isDecorator); if (!firstDecorator) { return; } - checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 166 /* Parameter */) { - checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + if (legacyDecorators) { + checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); + if (node.kind === 166 /* Parameter */) { + checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + } + } else if (languageVersion < 99 /* ESNext */) { + checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */); + if (isClassDeclaration(node)) { + if (!node.name) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } else { + const member = getFirstTransformableStaticClassElement(node); + if (member) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } + } + } else if (!isClassExpression(node)) { + if (isPrivateIdentifier(node.name) && (isMethodDeclaration(node) || isAccessor(node) || isAutoAccessorPropertyDeclaration(node))) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } + if (isComputedPropertyName(node.name)) { + checkExternalEmitHelpers(firstDecorator, 16777216 /* PropKey */); + } + } } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); @@ -76166,6 +77189,19 @@ ${lanes.join("\n")} function checkJSDocTypeTag(node) { checkSourceElement(node.typeExpression); } + function checkJSDocSatisfiesTag(node) { + checkSourceElement(node.typeExpression); + const host2 = getEffectiveJSDocHost(node); + if (host2) { + const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag); + if (length(tags) > 1) { + for (let i = 1; i < length(tags); i++) { + const tagName = tags[i].tagName; + error(tagName, Diagnostics._0_tag_already_specified, idText(tagName)); + } + } + } + } function checkJSDocLinkLikeTag(node) { if (node.name) { resolveJSDocMemberName( @@ -76838,7 +77874,7 @@ ${lanes.join("\n")} return; } const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 205 /* BindingElement */ ? node.parent.parent : node)) { + if (symbol.flags & 2097152 /* Alias */ && (isVariableDeclarationInitializedToBareOrAccessedRequire(node) || isBindingElementOfBareOrAccessedRequire(node))) { checkAliasSymbol(node); return; } @@ -76930,7 +77966,7 @@ ${lanes.join("\n")} return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { - if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) + if (!checkGrammarModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) checkGrammarForDisallowedLetOrConstStatement(node); forEach(node.declarationList.declarations, checkSourceElement); } @@ -76951,17 +77987,26 @@ ${lanes.join("\n")} function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) { if (!strictNullChecks) return; - helper(condExpr, body); - while (isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56 /* BarBarToken */) { - condExpr = condExpr.left; - helper(condExpr, body); + bothHelper(condExpr, body); + function bothHelper(condExpr2, body2) { + condExpr2 = skipParentheses(condExpr2); + helper(condExpr2, body2); + while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 60 /* QuestionQuestionToken */)) { + condExpr2 = skipParentheses(condExpr2.left); + helper(condExpr2, body2); + } } function helper(condExpr2, body2) { - const location = isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 55 /* AmpersandAmpersandToken */) ? condExpr2.right : condExpr2; - if (isModuleExportsAccessExpression(location)) + const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2; + if (isModuleExportsAccessExpression(location)) { + return; + } + if (isLogicalOrCoalescingBinaryExpression(location)) { + bothHelper(location, body2); return; + } const type = location === condExpr2 ? condType : checkTruthinessExpression(location); - const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion3(location.expression); + const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression); if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast) return; const callSignatures = getSignaturesOfType(type, 0 /* Call */); @@ -76969,7 +78014,7 @@ ${lanes.join("\n")} if (callSignatures.length === 0 && !isPromise) { return; } - const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : isBinaryExpression(location) && isIdentifier(location.right) ? location.right : void 0; + const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0; const testedSymbol = testedNode && getSymbolAtLocation(testedNode); if (!testedSymbol && !isPromise) { return; @@ -77927,14 +78972,10 @@ ${lanes.join("\n")} if (catchClause) { if (catchClause.variableDeclaration) { const declaration = catchClause.variableDeclaration; - const typeNode = getEffectiveTypeAnnotationNode(getRootDeclaration(declaration)); + checkVariableLikeDeclaration(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration); if (typeNode) { - const type = getTypeForVariableLikeDeclaration( - declaration, - /*includeOptionality*/ - false, - 0 /* Normal */ - ); + const type = getTypeFromTypeNode(typeNode); if (type && !(type.flags & 3 /* AnyOrUnknown */)) { grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } @@ -78189,9 +79230,65 @@ ${lanes.join("\n")} } return true; } + function getFirstTransformableStaticClassElement(node) { + var _a2; + const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ESNext */ && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + ); + const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */; + const willTransformInitializers = !useDefineForClassFields || languageVersion < 9 /* ES2022 */; + if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) { + for (const member of node.members) { + if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated( + /*useLegacyDecorators*/ + false, + member, + node + )) { + return (_a2 = firstOrUndefined(getDecorators(node))) != null ? _a2 : node; + } else if (willTransformPrivateElementsOrClassStaticBlocks) { + if (isClassStaticBlockDeclaration(member)) { + return member; + } else if (isStatic(member)) { + if (isPrivateIdentifierClassElementDeclaration(member) || willTransformInitializers && isInitializedProperty(member)) { + return member; + } + } + } + } + } + } + function checkClassExpressionExternalHelpers(node) { + var _a2; + if (node.name) + return; + const parent2 = walkUpOuterExpressions(node); + if (!isNamedEvaluationSource(parent2)) + return; + const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ESNext */; + let location; + if (willTransformESDecorators && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + )) { + location = (_a2 = firstOrUndefined(getDecorators(node))) != null ? _a2 : node; + } else { + location = getFirstTransformableStaticClassElement(node); + } + if (location) { + checkExternalEmitHelpers(location, 8388608 /* SetFunctionName */); + if ((isPropertyAssignment(parent2) || isPropertyDeclaration(parent2) || isBindingElement(parent2)) && isComputedPropertyName(parent2.name)) { + checkExternalEmitHelpers(location, 16777216 /* PropKey */); + } + } + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); + checkClassExpressionExternalHelpers(node); return getTypeOfSymbol(getSymbolOfDeclaration(node)); } function checkClassExpressionDeferred(node) { @@ -78200,7 +79297,7 @@ ${lanes.join("\n")} } function checkClassDeclaration(node) { const firstDecorator = find(node.modifiers, isDecorator); - if (firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { + if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator); } if (!node.name && !hasSyntacticModifier(node, 1024 /* Default */)) { @@ -78674,7 +79771,7 @@ ${lanes.join("\n")} typeName2 ); errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); - diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(typeNode), typeNode, errorInfo)); } } } @@ -78730,7 +79827,7 @@ ${lanes.join("\n")} return !containsUndefinedType(flowType); } function checkInterfaceDeclaration(node) { - if (!checkGrammarDecoratorsAndModifiers(node)) + if (!checkGrammarModifiers(node)) checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); addLazyDiagnostic(() => { @@ -78764,7 +79861,7 @@ ${lanes.join("\n")} }); } function checkTypeAliasDeclaration(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); @@ -78960,7 +80057,7 @@ ${lanes.join("\n")} addLazyDiagnostic(() => checkEnumDeclarationWorker(node)); } function checkEnumDeclarationWorker(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkCollisionsForDeclarationName(node, node.name); checkExportsOnMergedDeclarations(node); node.members.forEach(checkEnumMember); @@ -79035,6 +80132,7 @@ ${lanes.join("\n")} } addLazyDiagnostic(checkModuleDeclarationDiagnostics); function checkModuleDeclarationDiagnostics() { + var _a2, _b; const isGlobalAugmentation = isGlobalScopeAugmentation(node); const inAmbientContext = node.flags & 16777216 /* Ambient */; if (isGlobalAugmentation && !inAmbientContext) { @@ -79045,7 +80143,7 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, contextErrorMessage)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node)) { + if (!checkGrammarModifiers(node)) { if (!inAmbientContext && node.name.kind === 10 /* StringLiteral */) { grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -79055,18 +80153,29 @@ ${lanes.join("\n")} } checkExportsOnMergedDeclarations(node); const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && symbol.declarations && symbol.declarations.length > 1 && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { - const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (firstNonAmbientClassOrFunc) { - if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { + if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) { + error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); + } + if (((_a2 = symbol.declarations) == null ? void 0 : _a2.length) > 1) { + const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + } else if (node.pos < firstNonAmbientClassOrFunc.pos) { + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + } + } + const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */); + if (mergedClass && inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */); - if (mergedClass && inSameLexicalScope(node, mergedClass)) { - getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */) { + const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 93 /* ExportKeyword */); + if (exportModifier) { + error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } } } if (isAmbientExternalModule) { @@ -79222,7 +80331,7 @@ ${lanes.join("\n")} const message = node.kind === 278 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } - if (compilerOptions.isolatedModules && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) { + if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) { const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol); const isType = !(targetFlags & 111551 /* Value */); if (isType || typeOnlyAlias) { @@ -79230,9 +80339,9 @@ ${lanes.join("\n")} case 270 /* ImportClause */: case 273 /* ImportSpecifier */: case 268 /* ImportEqualsDeclaration */: { - if (compilerOptions.preserveValueImports) { + if (compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) { Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); - const message = isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; + const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? compilerOptions.verbatimModuleSyntax ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : compilerOptions.verbatimModuleSyntax ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; const name = idText(node.kind === 273 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); addTypeOnlyDeclarationRelatedInfo( error(node, message, name), @@ -79241,24 +80350,23 @@ ${lanes.join("\n")} ); } if (isType && node.kind === 268 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) { - error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided); + error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); } break; } case 278 /* ExportSpecifier */: { - if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { - const message = isType ? Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled; + if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { const name = idText(node.propertyName || node.name); - addTypeOnlyDeclarationRelatedInfo( - error(node, message, name), - isType ? void 0 : typeOnlyAlias, - name - ); - return; + const diagnostic = isType ? error(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName); + addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name); + break; } } } } + if (compilerOptions.verbatimModuleSyntax && node.kind !== 268 /* ImportEqualsDeclaration */ && !isInJSFile(node) && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } } if (isImportSpecifier(node)) { const targetSymbol = checkDeprecatedAliasedSymbol(symbol, node); @@ -79338,7 +80446,7 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -79368,7 +80476,7 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (hasSyntacticModifier(node, 1 /* Export */)) { @@ -79404,7 +80512,7 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasSyntacticModifiers(node)) { + if (!checkGrammarModifiers(node) && hasSyntacticModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers); } if (node.moduleSpecifier && node.exportClause && isNamedExports(node.exportClause) && length(node.exportClause.elements) && languageVersion === 0 /* ES3 */) { @@ -79441,12 +80549,8 @@ ${lanes.join("\n")} } function checkGrammarExportDeclaration(node) { var _a2; - if (node.isTypeOnly) { - if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) { - return checkGrammarNamedImportsOrExports(node.exportClause); - } else { - return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type); - } + if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) { + return checkGrammarNamedImportsOrExports(node.exportClause); } return false; } @@ -79544,13 +80648,14 @@ ${lanes.join("\n")} } return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); } const typeAnnotationNode = getEffectiveTypeAnnotationNode(node); if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } + const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; const sym = resolveEntityName( @@ -79564,16 +80669,28 @@ ${lanes.join("\n")} ); if (sym) { markAliasReferenced(sym, id); - const target = sym.flags & 2097152 /* Alias */ ? resolveAlias(sym) : sym; - if (getAllSymbolFlags(target) & 111551 /* Value */) { - checkExpressionCached(node.expression); + if (getAllSymbolFlags(sym) & 111551 /* Value */) { + checkExpressionCached(id); + if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { + error( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, + idText(id) + ); + } + } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + error( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, + idText(id) + ); } } else { - checkExpressionCached(node.expression); + checkExpressionCached(id); } if (getEmitDeclarations(compilerOptions)) { collectLinkedAliases( - node.expression, + id, /*setVisibility*/ true ); @@ -79581,6 +80698,9 @@ ${lanes.join("\n")} } else { checkExpressionCached(node.expression); } + if (isIllegalExportDefaultInCJS) { + error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } checkExternalModuleExports(container); if (node.flags & 16777216 /* Ambient */ && !isEntityNameExpression(node.expression)) { grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context); @@ -79770,6 +80890,8 @@ ${lanes.join("\n")} case 338 /* JSDocProtectedTag */: case 337 /* JSDocPrivateTag */: return checkJSDocAccessibilityModifiers(node); + case 353 /* JSDocSatisfiesTag */: + return checkJSDocSatisfiesTag(node); case 196 /* IndexedAccessType */: return checkIndexedAccessType(node); case 197 /* MappedType */: @@ -80785,8 +81907,9 @@ ${lanes.join("\n")} } } function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; + const specifier = getIdentifierGeneratedImportReference(nodeIn); + if (specifier) { + return specifier; } const node = getParseTreeNode(nodeIn, isIdentifier); if (node) { @@ -80868,6 +81991,7 @@ ${lanes.join("\n")} return false; } function isValueAliasDeclaration(node) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); switch (node.kind) { case 268 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfDeclaration(node)); @@ -80908,6 +82032,7 @@ ${lanes.join("\n")} return isConstEnumSymbol(s) || !!s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); if (isAliasSymbolDeclaration2(node)) { const symbol = getSymbolOfDeclaration(node); const links = symbol && getSymbolLinks(symbol); @@ -81624,23 +82749,27 @@ ${lanes.join("\n")} const helpersModule = resolveHelpersModule(sourceFile, location); if (helpersModule !== unknownSymbol) { const uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; - for (let helper = 1 /* FirstEmitHelper */; helper <= 4194304 /* LastEmitHelper */; helper <<= 1) { + for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) { if (uncheckedHelpers & helper) { - const name = getHelperName(helper); - const symbol = getSymbol2(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */); - if (!symbol) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); - } else if (helper & 524288 /* ClassPrivateFieldGet */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); - } - } else if (helper & 1048576 /* ClassPrivateFieldSet */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); - } - } else if (helper & 1024 /* SpreadArray */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + for (const name of getHelperNames(helper)) { + if (requestedExternalEmitHelperNames.has(name)) + continue; + requestedExternalEmitHelperNames.add(name); + const symbol = getSymbol2(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */); + if (!symbol) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); + } else if (helper & 524288 /* ClassPrivateFieldGet */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); + } + } else if (helper & 1048576 /* ClassPrivateFieldSet */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); + } + } else if (helper & 1024 /* SpreadArray */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + } } } } @@ -81650,54 +82779,58 @@ ${lanes.join("\n")} } } } - function getHelperName(helper) { + function getHelperNames(helper) { switch (helper) { case 1 /* Extends */: - return "__extends"; + return ["__extends"]; case 2 /* Assign */: - return "__assign"; + return ["__assign"]; case 4 /* Rest */: - return "__rest"; + return ["__rest"]; case 8 /* Decorate */: - return "__decorate"; + return legacyDecorators ? ["__decorate"] : ["__esDecorate", "__runInitializers"]; case 16 /* Metadata */: - return "__metadata"; + return ["__metadata"]; case 32 /* Param */: - return "__param"; + return ["__param"]; case 64 /* Awaiter */: - return "__awaiter"; + return ["__awaiter"]; case 128 /* Generator */: - return "__generator"; + return ["__generator"]; case 256 /* Values */: - return "__values"; + return ["__values"]; case 512 /* Read */: - return "__read"; + return ["__read"]; case 1024 /* SpreadArray */: - return "__spreadArray"; + return ["__spreadArray"]; case 2048 /* Await */: - return "__await"; + return ["__await"]; case 4096 /* AsyncGenerator */: - return "__asyncGenerator"; + return ["__asyncGenerator"]; case 8192 /* AsyncDelegator */: - return "__asyncDelegator"; + return ["__asyncDelegator"]; case 16384 /* AsyncValues */: - return "__asyncValues"; + return ["__asyncValues"]; case 32768 /* ExportStar */: - return "__exportStar"; + return ["__exportStar"]; case 65536 /* ImportStar */: - return "__importStar"; + return ["__importStar"]; case 131072 /* ImportDefault */: - return "__importDefault"; + return ["__importDefault"]; case 262144 /* MakeTemplateObject */: - return "__makeTemplateObject"; + return ["__makeTemplateObject"]; case 524288 /* ClassPrivateFieldGet */: - return "__classPrivateFieldGet"; + return ["__classPrivateFieldGet"]; case 1048576 /* ClassPrivateFieldSet */: - return "__classPrivateFieldSet"; + return ["__classPrivateFieldSet"]; case 2097152 /* ClassPrivateFieldIn */: - return "__classPrivateFieldIn"; + return ["__classPrivateFieldIn"]; case 4194304 /* CreateBinding */: - return "__createBinding"; + return ["__createBinding"]; + case 8388608 /* SetFunctionName */: + return ["__setFunctionName"]; + case 16777216 /* PropKey */: + return ["__propKey"]; default: return Debug.fail("Unrecognized helper"); } @@ -81708,257 +82841,264 @@ ${lanes.join("\n")} } return externalHelpersModule; } - function checkGrammarDecoratorsAndModifiers(node) { - return checkGrammarDecorators(node) || checkGrammarModifiers(node); - } - function checkGrammarDecorators(node) { - if (canHaveIllegalDecorators(node) && some(node.illegalDecorators)) { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); - } - if (!canHaveDecorators(node) || !hasDecorators(node)) { - return false; - } - if (!nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 171 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { - return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); - } else { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); - } - } else if (node.kind === 174 /* GetAccessor */ || node.kind === 175 /* SetAccessor */) { - const accessors = getAllAccessorDeclarations(node.parent.members, node); - if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); - } - } - return false; - } function checkGrammarModifiers(node) { - const quickResult = reportObviousModifierErrors(node); + const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node); if (quickResult !== void 0) { return quickResult; } - let lastStatic, lastDeclare, lastAsync, lastOverride; + if (isParameter(node) && parameterIsThisKeyword(node)) { + return grammarErrorOnFirstToken(node, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); + } + let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; + let sawExportBeforeDecorators = false; for (const modifier of node.modifiers) { - if (isDecorator(modifier)) - continue; - if (modifier.kind !== 146 /* ReadonlyKeyword */) { - if (node.kind === 168 /* PropertySignature */ || node.kind === 170 /* MethodSignature */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); + if (isDecorator(modifier)) { + if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { + if (node.kind === 171 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } else { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); + } + } else if (legacyDecorators && (node.kind === 174 /* GetAccessor */ || node.kind === 175 /* SetAccessor */)) { + const accessors = getAllAccessorDeclarations(node.parent.members, node); + if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } } - if (node.kind === 178 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !isClassLike(node.parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); + if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { + return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } - } - if (modifier.kind !== 101 /* InKeyword */ && modifier.kind !== 145 /* OutKeyword */ && modifier.kind !== 85 /* ConstKeyword */) { - if (node.kind === 165 /* TypeParameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); + flags |= 131072 /* Decorator */; + if (flags & 1 /* Export */) { + sawExportBeforeDecorators = true; } - } - switch (modifier.kind) { - case 85 /* ConstKeyword */: - if (node.kind !== 263 /* EnumDeclaration */ && node.kind !== 165 /* TypeParameter */) { - return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(85 /* ConstKeyword */)); - } - const parent2 = node.parent; - if (node.kind === 165 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); + firstDecorator != null ? firstDecorator : firstDecorator = modifier; + } else { + if (modifier.kind !== 146 /* ReadonlyKeyword */) { + if (node.kind === 168 /* PropertySignature */ || node.kind === 170 /* MethodSignature */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); } - break; - case 161 /* OverrideKeyword */: - if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); - } - flags |= 16384 /* Override */; - lastOverride = modifier; - break; - case 123 /* PublicKeyword */: - case 122 /* ProtectedKeyword */: - case 121 /* PrivateKeyword */: - const text = visibilityToString(modifierToFlag(modifier.kind)); - if (flags & 28 /* AccessibilityModifier */) { - return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); - } else if (flags & 32 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); - } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); - } else if (flags & 256 /* Abstract */) { - if (modifier.kind === 121 /* PrivateKeyword */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); - } else { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); - } - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + if (node.kind === 178 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !isClassLike(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); } - flags |= modifierToFlag(modifier.kind); - break; - case 124 /* StaticKeyword */: - if (flags & 32 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); - } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } else if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); - } - flags |= 32 /* Static */; - lastStatic = modifier; - break; - case 127 /* AccessorKeyword */: - if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); - } else if (node.kind !== 169 /* PropertyDeclaration */) { - return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); - } - flags |= 128 /* Accessor */; - break; - case 146 /* ReadonlyKeyword */: - if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); - } else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); - } - flags |= 64 /* Readonly */; - break; - case 93 /* ExportKeyword */: - if (flags & 1 /* Export */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } else if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); - } else if (isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 88 /* DefaultKeyword */: - const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 264 /* ModuleDeclaration */ && !isAmbientModule(container)) { - return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); - } else if (!(flags & 1 /* Export */)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); - } - flags |= 1024 /* Default */; - break; - case 136 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); - } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 265 /* ModuleBlock */) { - return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); - } - flags |= 2 /* Ambient */; - lastDeclare = modifier; - break; - case 126 /* AbstractKeyword */: - if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); + } + if (modifier.kind !== 101 /* InKeyword */ && modifier.kind !== 145 /* OutKeyword */ && modifier.kind !== 85 /* ConstKeyword */) { + if (node.kind === 165 /* TypeParameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); } - if (node.kind !== 260 /* ClassDeclaration */ && node.kind !== 182 /* ConstructorType */) { - if (node.kind !== 171 /* MethodDeclaration */ && node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 174 /* GetAccessor */ && node.kind !== 175 /* SetAccessor */) { - return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + switch (modifier.kind) { + case 85 /* ConstKeyword */: + if (node.kind !== 263 /* EnumDeclaration */ && node.kind !== 165 /* TypeParameter */) { + return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(85 /* ConstKeyword */)); + } + const parent2 = node.parent; + if (node.kind === 165 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); } - if (!(node.parent.kind === 260 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { - return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + break; + case 161 /* OverrideKeyword */: + if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); + } + flags |= 16384 /* Override */; + lastOverride = modifier; + break; + case 123 /* PublicKeyword */: + case 122 /* ProtectedKeyword */: + case 121 /* PrivateKeyword */: + const text = visibilityToString(modifierToFlag(modifier.kind)); + if (flags & 28 /* AccessibilityModifier */) { + return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); + } else if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); + } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); + } else if (flags & 256 /* Abstract */) { + if (modifier.kind === 121 /* PrivateKeyword */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); + } else { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); + } + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); } + flags |= modifierToFlag(modifier.kind); + break; + case 124 /* StaticKeyword */: if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); + } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } else if (flags & 256 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); } - if (flags & 8 /* Private */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + flags |= 32 /* Static */; + lastStatic = modifier; + break; + case 127 /* AccessorKeyword */: + if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); + } else if (node.kind !== 169 /* PropertyDeclaration */) { + return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); + } + flags |= 128 /* Accessor */; + break; + case 146 /* ReadonlyKeyword */: + if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); + } else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); + } + flags |= 64 /* Readonly */; + break; + case 93 /* ExportKeyword */: + if (compilerOptions.verbatimModuleSyntax && !(node.flags & 16777216 /* Ambient */) && node.kind !== 262 /* TypeAliasDeclaration */ && node.kind !== 261 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later + node.kind !== 264 /* ModuleDeclaration */ && node.parent.kind === 308 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } + if (flags & 1 /* Export */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } else if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); + } else if (isClassLike(node.parent)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1 /* Export */; + break; + case 88 /* DefaultKeyword */: + const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 264 /* ModuleDeclaration */ && !isAmbientModule(container)) { + return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } else if (!(flags & 1 /* Export */)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); + } else if (sawExportBeforeDecorators) { + return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here); + } + flags |= 1024 /* Default */; + break; + case 136 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); + } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 265 /* ModuleBlock */) { + return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); + } + flags |= 2 /* Ambient */; + lastDeclare = modifier; + break; + case 126 /* AbstractKeyword */: + if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); } - if (flags & 512 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + if (node.kind !== 260 /* ClassDeclaration */ && node.kind !== 182 /* ConstructorType */) { + if (node.kind !== 171 /* MethodDeclaration */ && node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 174 /* GetAccessor */ && node.kind !== 175 /* SetAccessor */) { + return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + if (!(node.parent.kind === 260 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { + return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + } + if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } + if (flags & 8 /* Private */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + } + if (flags & 512 /* Async */ && lastAsync) { + return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + } + if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + } } - if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + if (isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); } - if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + flags |= 256 /* Abstract */; + break; + case 132 /* AsyncKeyword */: + if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); + } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); + } + if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + flags |= 512 /* Async */; + lastAsync = modifier; + break; + case 101 /* InKeyword */: + case 145 /* OutKeyword */: + const inOutFlag = modifier.kind === 101 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; + const inOutText = modifier.kind === 101 /* InKeyword */ ? "in" : "out"; + if (node.kind !== 165 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); } - } - if (isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); - } - flags |= 256 /* Abstract */; - break; - case 132 /* AsyncKeyword */: - if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); - } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); - } - if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } - flags |= 512 /* Async */; - lastAsync = modifier; - break; - case 101 /* InKeyword */: - case 145 /* OutKeyword */: - const inOutFlag = modifier.kind === 101 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; - const inOutText = modifier.kind === 101 /* InKeyword */ ? "in" : "out"; - if (node.kind !== 165 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); - } - if (flags & inOutFlag) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); - } - if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); - } - flags |= inOutFlag; - break; + if (flags & inOutFlag) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); + } + if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); + } + flags |= inOutFlag; + break; + } } } if (node.kind === 173 /* Constructor */) { @@ -81985,9 +83125,16 @@ ${lanes.join("\n")} return false; } function reportObviousModifierErrors(node) { - return !node.modifiers ? false : shouldReportBadModifier(node) ? grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here) : void 0; + if (!node.modifiers) + return false; + const modifier = findFirstIllegalModifier(node); + return modifier && grammarErrorOnFirstToken(modifier, Diagnostics.Modifiers_cannot_appear_here); + } + function findFirstModifierExcept(node, allowedModifier) { + const modifier = find(node.modifiers, isModifier); + return modifier && modifier.kind !== allowedModifier ? modifier : void 0; } - function shouldReportBadModifier(node) { + function findFirstIllegalModifier(node) { switch (node.kind) { case 174 /* GetAccessor */: case 175 /* SetAccessor */: @@ -82006,43 +83153,42 @@ ${lanes.join("\n")} case 216 /* ArrowFunction */: case 166 /* Parameter */: case 165 /* TypeParameter */: - return false; + return void 0; case 172 /* ClassStaticBlockDeclaration */: case 299 /* PropertyAssignment */: case 300 /* ShorthandPropertyAssignment */: case 267 /* NamespaceExportDeclaration */: case 181 /* FunctionType */: case 279 /* MissingDeclaration */: - return true; + return find(node.modifiers, isModifier); default: if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return false; + return void 0; } switch (node.kind) { case 259 /* FunctionDeclaration */: - return nodeHasAnyModifiersExcept(node, 132 /* AsyncKeyword */); + return findFirstModifierExcept(node, 132 /* AsyncKeyword */); case 260 /* ClassDeclaration */: case 182 /* ConstructorType */: - return nodeHasAnyModifiersExcept(node, 126 /* AbstractKeyword */); + return findFirstModifierExcept(node, 126 /* AbstractKeyword */); case 228 /* ClassExpression */: case 261 /* InterfaceDeclaration */: case 240 /* VariableStatement */: case 262 /* TypeAliasDeclaration */: - return true; + return find(node.modifiers, isModifier); case 263 /* EnumDeclaration */: - return nodeHasAnyModifiersExcept(node, 85 /* ConstKeyword */); + return findFirstModifierExcept(node, 85 /* ConstKeyword */); default: Debug.assertNever(node); } } } - function nodeHasAnyModifiersExcept(node, allowedModifier) { - for (const modifier of node.modifiers) { - if (isDecorator(modifier)) - continue; - return modifier.kind !== allowedModifier; - } - return false; + function reportObviousDecoratorErrors(node) { + const decorator = findFirstIllegalDecorator(node); + return decorator && grammarErrorOnFirstToken(decorator, Diagnostics.Decorators_are_not_valid_here); + } + function findFirstIllegalDecorator(node) { + return canHaveIllegalDecorators(node) ? find(node.modifiers, isDecorator) : void 0; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { @@ -82121,7 +83267,7 @@ ${lanes.join("\n")} } function checkGrammarFunctionLikeDeclaration(node) { const file = getSourceFileOfNode(node); - return checkGrammarDecoratorsAndModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); + return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); } function checkGrammarClassLikeDeclaration(node) { const file = getSourceFileOfNode(node); @@ -82179,7 +83325,7 @@ ${lanes.join("\n")} return false; } function checkGrammarIndexSignature(node) { - return checkGrammarDecoratorsAndModifiers(node) || checkGrammarIndexSignatureParameters(node); + return checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { if (typeArguments && typeArguments.length === 0) { @@ -82219,7 +83365,7 @@ ${lanes.join("\n")} function checkGrammarClassDeclarationHeritageClauses(node) { let seenExtendsClause = false; let seenImplementsClause = false; - if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) { + if (!checkGrammarModifiers(node) && node.heritageClauses) { for (const heritageClause of node.heritageClauses) { if (heritageClause.token === 94 /* ExtendsKeyword */) { if (seenExtendsClause) { @@ -82320,7 +83466,9 @@ ${lanes.join("\n")} } } else if (canHaveIllegalModifiers(prop) && prop.modifiers) { for (const mod of prop.modifiers) { - grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); + if (isModifier(mod)) { + grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); + } } } let currentKind; @@ -82764,7 +83912,7 @@ ${lanes.join("\n")} } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 79 /* Identifier */) { - if (name.originalKeywordKind === 119 /* LetKeyword */) { + if (name.escapedText === "let") { return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { @@ -83052,6 +84200,9 @@ ${lanes.join("\n")} }); } function checkGrammarImportCallExpression(node) { + if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) { + return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } if (moduleKind === 5 /* ES2015 */) { return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext); } @@ -83460,13 +84611,10 @@ ${lanes.join("\n")} // src/compiler/visitorPublic.ts function visitNode(node, visitor, test, lift) { - if (node === void 0 || visitor === void 0) { + if (node === void 0) { return node; } const visited = visitor(node); - if (visited === node) { - return node; - } let visitedNode; if (visited === void 0) { return void 0; @@ -83479,7 +84627,7 @@ ${lanes.join("\n")} return visitedNode; } function visitNodes2(nodes, visitor, test, start, count) { - if (nodes === void 0 || visitor === void 0) { + if (nodes === void 0) { return nodes; } const length2 = nodes.length; @@ -83528,25 +84676,30 @@ ${lanes.join("\n")} } for (let i = 0; i < count; i++) { const node = nodes[i + start]; - const visited = node !== void 0 ? visitor(node) : void 0; + const visited = node !== void 0 ? visitor ? visitor(node) : node : void 0; if (updated !== void 0 || visited === void 0 || visited !== node) { if (updated === void 0) { updated = nodes.slice(0, i); + Debug.assertEachNode(updated, test); } if (visited) { if (isArray(visited)) { for (const visitedNode of visited) { - void Debug.assertNode(visitedNode, test); + Debug.assertNode(visitedNode, test); updated.push(visitedNode); } } else { - void Debug.assertNode(visited, test); + Debug.assertNode(visited, test); updated.push(visited); } } } } - return updated != null ? updated : nodes; + if (updated) { + return updated; + } + Debug.assertEachNode(nodes, test); + return nodes; } function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict, nodesVisitor = visitNodes2) { context.startLexicalEnvironment(); @@ -83560,7 +84713,7 @@ ${lanes.join("\n")} context.startLexicalEnvironment(); if (nodes) { context.setLexicalEnvironmentFlags(1 /* InParameters */, true); - updated = nodesVisitor(nodes, visitor, isParameterDeclaration); + updated = nodesVisitor(nodes, visitor, isParameter); if (context.getLexicalEnvironmentFlags() & 2 /* VariablesHoistedInParameters */ && getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { updated = addDefaultValueAssignmentsIfNeeded(updated, context); } @@ -83682,6 +84835,7 @@ ${lanes.join("\n")} function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { context.startBlockScope(); const updated = nodeVisitor(body, visitor, isStatement, context.factory.liftToBlock); + Debug.assert(updated); const declarations = context.endBlockScope(); if (some(declarations)) { if (isBlock(updated)) { @@ -83693,6 +84847,18 @@ ${lanes.join("\n")} } return updated; } + function visitCommaListElements(elements, visitor, discardVisitor = visitor) { + if (discardVisitor === visitor || elements.length <= 1) { + return visitNodes2(elements, visitor, isExpression); + } + let i = 0; + const length2 = elements.length; + return visitNodes2(elements, (node) => { + const discarded = i < length2 - 1; + i++; + return discarded ? discardVisitor(node) : visitor(node); + }, isExpression); + } function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) { if (node === void 0) { return void 0; @@ -83710,23 +84876,17 @@ ${lanes.join("\n")} "use strict"; init_ts2(); visitEachChildTable = { - [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateIdentifier( - node, - nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration) - ); - }, [163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateQualifiedName( node, - nodeVisitor(node.left, visitor, isEntityName), - nodeVisitor(node.right, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), + Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) ); }, [164 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateComputedPropertyName( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Signature elements @@ -83734,7 +84894,7 @@ ${lanes.join("\n")} return context.factory.updateTypeParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.constraint, visitor, isTypeNode), nodeVisitor(node.default, visitor, isTypeNode) ); @@ -83743,9 +84903,9 @@ ${lanes.join("\n")} return context.factory.updateParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -83753,7 +84913,7 @@ ${lanes.join("\n")} [167 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDecorator( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Type elements @@ -83761,19 +84921,19 @@ ${lanes.join("\n")} return context.factory.updatePropertySignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode) ); }, [169 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - var _a2; + var _a2, _b; return context.factory.updatePropertyDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration - nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken), + tokenVisitor ? nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken) : (_b = node.questionToken) != null ? _b : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -83782,10 +84942,10 @@ ${lanes.join("\n")} return context.factory.updateMethodSignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -83793,9 +84953,9 @@ ${lanes.join("\n")} return context.factory.updateMethodDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), @@ -83805,7 +84965,7 @@ ${lanes.join("\n")} [173 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -83814,7 +84974,7 @@ ${lanes.join("\n")} return context.factory.updateGetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor) @@ -83824,7 +84984,7 @@ ${lanes.join("\n")} return context.factory.updateSetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -83841,7 +85001,7 @@ ${lanes.join("\n")} return context.factory.updateCallSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -83849,16 +85009,16 @@ ${lanes.join("\n")} return context.factory.updateConstructSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, [178 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexSignature( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, // Types @@ -83866,14 +85026,14 @@ ${lanes.join("\n")} return context.factory.updateTypePredicateNode( node, nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), - nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode), + Debug.checkDefined(nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode)), nodeVisitor(node.type, visitor, isTypeNode) ); }, [180 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeReferenceNode( node, - nodeVisitor(node.typeName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -83881,8 +85041,8 @@ ${lanes.join("\n")} return context.factory.updateFunctionTypeNode( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [182 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -83890,14 +85050,14 @@ ${lanes.join("\n")} node, nodesVisitor(node.modifiers, visitor, isModifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [183 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeQueryNode( node, - nodeVisitor(node.exprName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -83910,7 +85070,7 @@ ${lanes.join("\n")} [185 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateArrayTypeNode( node, - nodeVisitor(node.elementType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) ); }, [186 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -83922,13 +85082,13 @@ ${lanes.join("\n")} [187 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateOptionalTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [188 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateRestTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [189 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -83946,22 +85106,22 @@ ${lanes.join("\n")} [191 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConditionalTypeNode( node, - nodeVisitor(node.checkType, visitor, isTypeNode), - nodeVisitor(node.extendsType, visitor, isTypeNode), - nodeVisitor(node.trueType, visitor, isTypeNode), - nodeVisitor(node.falseType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.extendsType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.trueType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) ); }, [192 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInferTypeNode( node, - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration) + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) ); }, [202 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeNode( node, - nodeVisitor(node.argument, visitor, isTypeNode), + Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer), nodeVisitor(node.qualifier, visitor, isEntityName), nodesVisitor(node.typeArguments, visitor, isTypeNode), @@ -83971,45 +85131,45 @@ ${lanes.join("\n")} [298 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeAssertionContainer( node, - nodeVisitor(node.assertClause, visitor, isAssertClause), + Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), node.multiLine ); }, [199 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateNamedTupleMember( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.type, visitor, isTypeNode) + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [193 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedType( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [195 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOperatorNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [196 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexedAccessTypeNode( node, - nodeVisitor(node.objectType, visitor, isTypeNode), - nodeVisitor(node.indexType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) ); }, [197 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMappedTypeNode( node, - nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken), - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration), + tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)), nodeVisitor(node.nameType, visitor, isTypeNode), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodesVisitor(node.members, visitor, isTypeElement) ); @@ -84017,21 +85177,21 @@ ${lanes.join("\n")} [198 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLiteralTypeNode( node, - nodeVisitor(node.literal, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) ); }, [200 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralType( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) ); }, [201 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralTypeSpan( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Binding patterns @@ -84050,9 +85210,9 @@ ${lanes.join("\n")} [205 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBindingElement( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, nodeVisitor(node.propertyName, visitor, isPropertyName), - nodeVisitor(node.name, visitor, isBindingName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -84072,37 +85232,37 @@ ${lanes.join("\n")} [208 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ) : context.factory.updatePropertyAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ); }, [209 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isElementAccessChain(node) ? context.factory.updateElementAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ) : context.factory.updateElementAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ); }, [210 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return isCallChain(node) ? context.factory.updateCallChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ) : context.factory.updateCallExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -84110,7 +85270,7 @@ ${lanes.join("\n")} [211 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNewExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -84118,29 +85278,29 @@ ${lanes.join("\n")} [212 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTaggedTemplateExpression( node, - nodeVisitor(node.tag, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.template, visitor, isTemplateLiteral) + Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) ); }, [213 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAssertion( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [214 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [215 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionExpression( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -84155,82 +85315,82 @@ ${lanes.join("\n")} nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken)) : node.equalsGreaterThanToken, visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, [217 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDeleteExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [218 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOfExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [219 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVoidExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [220 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAwaitExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [221 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePrefixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [222 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePostfixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [223 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBinaryExpression( node, - nodeVisitor(node.left, visitor, isExpression), - nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken), - nodeVisitor(node.right, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken)) : node.operatorToken, + Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) ); }, [224 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateConditionalExpression( node, - nodeVisitor(node.condition, visitor, isExpression), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.whenTrue, visitor, isExpression), - nodeVisitor(node.colonToken, tokenVisitor, isColonToken), - nodeVisitor(node.whenFalse, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken)) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.whenTrue, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.colonToken, tokenVisitor, isColonToken)) : node.colonToken, + Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) ); }, [225 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateExpression( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateSpan) ); }, [226 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateYieldExpression( node, - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.expression, visitor, isExpression) ); }, [227 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadElement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [228 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -84246,45 +85406,45 @@ ${lanes.join("\n")} [230 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionWithTypeArguments( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, [231 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAsExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [235 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSatisfiesExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [232 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return isOptionalChain(node) ? context.factory.updateNonNullChain( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ) : context.factory.updateNonNullExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [233 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateMetaProperty( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Misc [236 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateSpan( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Element @@ -84297,21 +85457,21 @@ ${lanes.join("\n")} [240 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVariableStatement( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.declarationList, visitor, isVariableDeclarationList) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) ); }, [241 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [242 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIfStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock)), nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) ); }, @@ -84319,13 +85479,13 @@ ${lanes.join("\n")} return context.factory.updateDoStatement( node, visitIterationBody(node.statement, visitor, context, nodeVisitor), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [244 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWhileStatement( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -84341,17 +85501,17 @@ ${lanes.join("\n")} [246 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForInStatement( node, - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, [247 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateForOfStatement( node, - nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword), - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -84376,34 +85536,34 @@ ${lanes.join("\n")} [251 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWithStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [252 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSwitchStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.caseBlock, visitor, isCaseBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) ); }, [253 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLabeledStatement( node, - nodeVisitor(node.label, visitor, isIdentifier), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [254 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateThrowStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [255 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTryStatement( node, - nodeVisitor(node.tryBlock, visitor, isBlock), + Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), nodeVisitor(node.catchClause, visitor, isCatchClause), nodeVisitor(node.finallyBlock, visitor, isBlock) ); @@ -84411,8 +85571,8 @@ ${lanes.join("\n")} [257 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateVariableDeclaration( node, - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken) : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -84427,7 +85587,7 @@ ${lanes.join("\n")} return context.factory.updateFunctionDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -84448,8 +85608,8 @@ ${lanes.join("\n")} [261 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInterfaceDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, isHeritageClause), nodesVisitor(node.members, visitor, isTypeElement) @@ -84458,25 +85618,25 @@ ${lanes.join("\n")} [262 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAliasDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [263 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.members, visitor, isEnumMember) ); }, [264 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateModuleDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isModuleName), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleName)), nodeVisitor(node.body, visitor, isModuleBody) ); }, @@ -84495,24 +85655,24 @@ ${lanes.join("\n")} [267 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExportDeclaration( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [268 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportEqualsDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.moduleReference, visitor, isModuleReference) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) ); }, [269 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), nodeVisitor(node.importClause, visitor, isImportClause), - nodeVisitor(node.moduleSpecifier, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)), nodeVisitor(node.assertClause, visitor, isAssertClause) ); }, @@ -84526,8 +85686,8 @@ ${lanes.join("\n")} [297 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAssertEntry( node, - nodeVisitor(node.name, visitor, isAssertionKey), - nodeVisitor(node.value, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)), + Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) ); }, [270 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -84541,13 +85701,13 @@ ${lanes.join("\n")} [271 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceImport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [277 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [272 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -84561,20 +85721,20 @@ ${lanes.join("\n")} node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [274 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportAssignment( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.expression, visitor, isExpression) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [275 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, isExpression), @@ -84592,59 +85752,59 @@ ${lanes.join("\n")} node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Module references [280 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExternalModuleReference( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // JSX [281 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxElement( node, - nodeVisitor(node.openingElement, visitor, isJsxOpeningElement), + Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingElement, visitor, isJsxClosingElement) + Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) ); }, [282 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSelfClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [283 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxOpeningElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [284 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression) + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) ); }, [285 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxFragment( node, - nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment), + Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment) + Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) ); }, [288 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) ); }, @@ -84657,20 +85817,20 @@ ${lanes.join("\n")} [290 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSpreadAttribute( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Clauses [292 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCaseClause( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.statements, visitor, isStatement) ); }, @@ -84690,35 +85850,35 @@ ${lanes.join("\n")} return context.factory.updateCatchClause( node, nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), - nodeVisitor(node.block, visitor, isBlock) + Debug.checkDefined(nodeVisitor(node.block, visitor, isBlock)) ); }, // Property assignments [299 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePropertyAssignment( node, - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.initializer, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) ); }, [300 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateShorthandPropertyAssignment( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) ); }, [301 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadAssignment( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Enum [302 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumMember( node, - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -84730,13 +85890,13 @@ ${lanes.join("\n")} ); }, // Transformation nodes - [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePartiallyEmittedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCommaListExpression( node, nodesVisitor(node.elements, visitor, isExpression) @@ -85622,10 +86782,13 @@ ${lanes.join("\n")} parameters }; } - function getAllDecoratorsOfClassElement(member, parent2) { + function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { switch (member.kind) { case 174 /* GetAccessor */: case 175 /* SetAccessor */: + if (!useLegacyDecorators) { + return getAllDecoratorsOfMethod(member); + } return getAllDecoratorsOfAccessors(member, parent2); case 171 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); @@ -85674,6 +86837,34 @@ ${lanes.join("\n")} } return { decorators }; } + function walkUpLexicalEnvironments(env, cb) { + while (env) { + const result = cb(env); + if (result !== void 0) + return result; + env = env.previous; + } + } + function newPrivateEnvironment(data) { + return { data }; + } + function getPrivateIdentifier(privateEnv, name) { + var _a2, _b; + return isGeneratedPrivateIdentifier(name) ? (_a2 = privateEnv == null ? void 0 : privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(getNodeForGeneratedName(name)) : (_b = privateEnv == null ? void 0 : privateEnv.identifiers) == null ? void 0 : _b.get(name.escapedText); + } + function setPrivateIdentifier(privateEnv, name, entry) { + var _a2, _b; + if (isGeneratedPrivateIdentifier(name)) { + (_a2 = privateEnv.generatedIdentifiers) != null ? _a2 : privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map(); + privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), entry); + } else { + (_b = privateEnv.identifiers) != null ? _b : privateEnv.identifiers = /* @__PURE__ */ new Map(); + privateEnv.identifiers.set(name.escapedText, entry); + } + } + function accessPrivateIdentifier(env, name) { + return walkUpLexicalEnvironments(env, (env2) => getPrivateIdentifier(env2.privateEnv, name)); + } var init_utilities3 = __esm({ "src/compiler/transformers/utilities.ts"() { "use strict"; @@ -85692,7 +86883,7 @@ ${lanes.join("\n")} location = node = value; value = node.right; } else { - return visitNode(value, visitor, isExpression); + return Debug.checkDefined(visitNode(value, visitor, isExpression)); } } } @@ -85711,6 +86902,7 @@ ${lanes.join("\n")} }; if (value) { value = visitNode(value, visitor, isExpression); + Debug.assert(value); if (isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node)) { value = ensureIdentifier( flattenContext, @@ -85752,7 +86944,7 @@ ${lanes.join("\n")} function emitBindingOrAssignment(target, value2, location2, original) { Debug.assertNode(target, createAssignmentCallback ? isIdentifier : isExpression); const expression = createAssignmentCallback ? createAssignmentCallback(target, value2, location2) : setTextRange( - context.factory.createAssignment(visitNode(target, visitor, isExpression), value2), + context.factory.createAssignment(Debug.checkDefined(visitNode(target, visitor, isExpression)), value2), location2 ); expression.original = original; @@ -85809,7 +87001,7 @@ ${lanes.join("\n")} if (initializer && (isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node))) { initializer = ensureIdentifier( flattenContext, - visitNode(initializer, flattenContext.visitor), + Debug.checkDefined(visitNode(initializer, flattenContext.visitor, isExpression)), /*reuseIdentifierExpressions*/ false, initializer @@ -85930,7 +87122,7 @@ ${lanes.join("\n")} if (!getRestIndicatorOfBindingOrAssignmentElement(element)) { const propertyName = getPropertyNameOfBindingOrAssignmentElement(element); if (flattenContext.level >= 1 /* ObjectRest */ && !(element.transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !(getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !isComputedPropertyName(propertyName)) { - bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor)); + bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor, isBindingOrAssignmentElement)); } else { if (bindingElements) { flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern); @@ -86068,7 +87260,7 @@ ${lanes.join("\n")} if (isComputedPropertyName(propertyName)) { const argumentExpression = ensureIdentifier( flattenContext, - visitNode(propertyName.expression, flattenContext.visitor), + Debug.checkDefined(visitNode(propertyName.expression, flattenContext.visitor, isExpression)), /*reuseIdentifierExpressions*/ false, /*location*/ @@ -86111,6 +87303,7 @@ ${lanes.join("\n")} return factory2.createArrayBindingPattern(elements); } function makeArrayAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isArrayBindingOrAssignmentElement); return factory2.createArrayLiteralExpression(map(elements, factory2.converters.convertToArrayAssignmentElement)); } function makeObjectBindingPattern(factory2, elements) { @@ -86118,6 +87311,7 @@ ${lanes.join("\n")} return factory2.createObjectBindingPattern(elements); } function makeObjectAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isObjectBindingOrAssignmentElement); return factory2.createObjectLiteralExpression(map(elements, factory2.converters.convertToObjectAssignmentElement)); } function makeBindingElement(factory2, name) { @@ -86148,6 +87342,7 @@ ${lanes.join("\n")} // src/compiler/transformers/taggedTemplate.ts function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) { const tag = visitNode(node.tag, visitor, isExpression); + Debug.assert(tag); const templateArguments = [void 0]; const cookedStrings = []; const rawStrings = []; @@ -86164,7 +87359,7 @@ ${lanes.join("\n")} for (const templateSpan of template.templateSpans) { cookedStrings.push(createTemplateCooked(templateSpan.literal)); rawStrings.push(getRawLiteral(templateSpan.literal, currentSourceFile)); - templateArguments.push(visitNode(templateSpan.expression, visitor, isExpression)); + templateArguments.push(Debug.checkDefined(visitNode(templateSpan.expression, visitor, isExpression))); } } const helperCall = context.getEmitHelperFactory().createTemplateObjectHelper( @@ -86235,6 +87430,7 @@ ${lanes.join("\n")} const compilerOptions = context.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const typeSerializer = compilerOptions.emitDecoratorMetadata ? createRuntimeTypeSerializer(context) : void 0; const previousOnEmitNode = context.onEmitNode; const previousOnSubstituteNode = context.onSubstituteNode; @@ -86409,6 +87605,12 @@ ${lanes.join("\n")} return Debug.failBadSyntaxKind(node); } } + function decoratorElidingVisitor(node) { + return isDecorator(node) ? void 0 : visitor(node); + } + function modifierElidingVisitor(node) { + return isModifier(node) ? void 0 : visitor(node); + } function modifierVisitor(node) { if (isDecorator(node)) return void 0; @@ -86548,19 +87750,25 @@ ${lanes.join("\n")} function visitObjectLiteralExpression(node) { return factory2.updateObjectLiteralExpression( node, - visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElement) + visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElementLike) ); } - function getClassFacts(node, staticProperties) { + function getClassFacts(node) { let facts = 0 /* None */; - if (some(staticProperties)) + if (some(getProperties( + node, + /*requireInitialized*/ + true, + /*isStatic*/ + true + ))) facts |= 1 /* HasStaticInitializedProperties */; const extendsClauseElement = getEffectiveBaseTypeNode(node); if (extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */) facts |= 64 /* IsDerivedClass */; - if (classOrConstructorParameterIsDecorated(node)) - facts |= 2 /* HasConstructorDecorators */; - if (childIsDecorated(node)) + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) + facts |= 2 /* HasClassOrConstructorParameterDecorators */; + if (childIsDecorated(legacyDecorators, node)) facts |= 4 /* HasMemberDecorators */; if (isExportOfNamespace(node)) facts |= 8 /* IsExportOfNamespace */; @@ -86568,8 +87776,6 @@ ${lanes.join("\n")} facts |= 32 /* IsDefaultExternalExport */; else if (isNamedExternalModuleExport(node)) facts |= 16 /* IsNamedExternalExport */; - if (languageVersion <= 1 /* ES5 */ && facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */) - facts |= 128 /* UseImmediatelyInvokedFunctionExpression */; return facts; } function hasTypeScriptClassSyntax(node) { @@ -86579,7 +87785,10 @@ ${lanes.join("\n")} return hasDecorators(node) || some(node.typeParameters) || some(node.heritageClauses, hasTypeScriptClassSyntax) || some(node.members, hasTypeScriptClassSyntax); } function visitClassDeclaration(node) { - if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !(currentNamespace && hasSyntacticModifier(node, 1 /* Export */))) { + var _a2; + const facts = getClassFacts(node); + const promoteToIIFE = languageVersion <= 1 /* ES5 */ && !!(facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */); + if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !classOrConstructorParameterIsDecorated(legacyDecorators, node) && !isExportOfNamespace(node)) { return factory2.updateClassDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), @@ -86590,24 +87799,19 @@ ${lanes.join("\n")} visitNodes2(node.members, getClassElementVisitor(node), isClassElement) ); } - const staticProperties = getProperties( - node, - /*requireInitializer*/ - true, - /*isStatic*/ - true - ); - const facts = getClassFacts(node, staticProperties); - if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) { + if (promoteToIIFE) { context.startLexicalEnvironment(); } - const name = node.name || (facts & 5 /* NeedsName */ ? factory2.getGeneratedNameForNode(node) : void 0); - const allDecorators = getAllDecoratorsOfClass(node); - const decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); - const modifiers = !(facts & 128 /* UseImmediatelyInvokedFunctionExpression */) ? visitNodes2(node.modifiers, modifierVisitor, isModifier) : elideNodes(factory2, node.modifiers); - const classStatement = factory2.updateClassDeclaration( + const moveModifiers = promoteToIIFE || facts & 8 /* IsExportOfNamespace */ || facts & 2 /* HasClassOrConstructorParameterDecorators */ && legacyDecorators || facts & 1 /* HasStaticInitializedProperties */; + let modifiers = moveModifiers ? visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, visitor, isModifierLike); + if (facts & 2 /* HasClassOrConstructorParameterDecorators */) { + modifiers = injectClassTypeMetadata(modifiers, node); + } + const needsName = moveModifiers && !node.name || facts & 4 /* HasMemberDecorators */ || facts & 1 /* HasStaticInitializedProperties */; + const name = needsName ? (_a2 = node.name) != null ? _a2 : factory2.getGeneratedNameForNode(node) : node.name; + const classDeclaration = factory2.updateClassDeclaration( node, - concatenate(decorators, modifiers), + modifiers, name, /*typeParameters*/ void 0, @@ -86618,24 +87822,25 @@ ${lanes.join("\n")} if (facts & 1 /* HasStaticInitializedProperties */) { emitFlags |= 64 /* NoTrailingSourceMap */; } - setEmitFlags(classStatement, emitFlags); - let statements = [classStatement]; - if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) { + setEmitFlags(classDeclaration, emitFlags); + let statement; + if (promoteToIIFE) { + const statements = [classDeclaration]; const closingBraceLocation = createTokenRange(skipTrivia(currentSourceFile.text, node.members.end), 19 /* CloseBraceToken */); const localName = factory2.getInternalName(node); const outer = factory2.createPartiallyEmittedExpression(localName); setTextRangeEnd(outer, closingBraceLocation.end); setEmitFlags(outer, 3072 /* NoComments */); - const statement = factory2.createReturnStatement(outer); - setTextRangePos(statement, closingBraceLocation.pos); - setEmitFlags(statement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); - statements.push(statement); + const returnStatement = factory2.createReturnStatement(outer); + setTextRangePos(returnStatement, closingBraceLocation.pos); + setEmitFlags(returnStatement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); + statements.push(returnStatement); insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment()); const iife = factory2.createImmediatelyInvokedArrowFunction(statements); - setEmitFlags(iife, 67108864 /* TypeScriptClassWrapper */); + setInternalEmitFlags(iife, 1 /* TypeScriptClassWrapper */); + const modifiers2 = facts & 16 /* IsNamedExternalExport */ ? factory2.createModifiersFromModifierFlags(1 /* Export */) : void 0; const varStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, + modifiers2, factory2.createVariableDeclarationList([ factory2.createVariableDeclaration( factory2.getLocalName( @@ -86651,114 +87856,133 @@ ${lanes.join("\n")} void 0, iife ) - ]) + ], 1 /* Let */) ); setOriginalNode(varStatement, node); setCommentRange(varStatement, node); setSourceMapRange(varStatement, moveRangePastDecorators(node)); startOnNewLine(varStatement); - statements = [varStatement]; + statement = varStatement; + } else { + statement = classDeclaration; } - if (facts & 8 /* IsExportOfNamespace */) { - addExportMemberAssignment(statements, node); - } else if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) { + if (moveModifiers) { + if (facts & 8 /* IsExportOfNamespace */) { + return demarcateMultiStatementExport( + statement, + createExportMemberAssignmentStatement(node) + ); + } if (facts & 32 /* IsDefaultExternalExport */) { - statements.push(factory2.createExportDefault(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ))); - } else if (facts & 16 /* IsNamedExternalExport */) { - statements.push(factory2.createExternalModuleExport(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ))); + return demarcateMultiStatementExport( + statement, + factory2.createExportDefault(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ); + } + if (facts & 16 /* IsNamedExternalExport */ && !promoteToIIFE) { + return demarcateMultiStatementExport( + statement, + factory2.createExternalModuleExport(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ); } } - if (statements.length > 1) { - statements.push(factory2.createEndOfDeclarationMarker(node)); - setEmitFlags(classStatement, getEmitFlags(classStatement) | 8388608 /* HasEndOfDeclarationMarker */); - } - return singleOrMany(statements); + return statement; + } + function demarcateMultiStatementExport(declarationStatement, exportStatement) { + addEmitFlags(declarationStatement, 8388608 /* HasEndOfDeclarationMarker */); + return [ + declarationStatement, + exportStatement, + factory2.createEndOfDeclarationMarker(declarationStatement) + ]; } function visitClassExpression(node) { - const allDecorators = getAllDecoratorsOfClass(node); - const decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); + let modifiers = visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike); + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) { + modifiers = injectClassTypeMetadata(modifiers, node); + } return factory2.updateClassExpression( node, - decorators, + modifiers, node.name, /*typeParameters*/ void 0, visitNodes2(node.heritageClauses, visitor, isHeritageClause), - isClassLikeDeclarationWithTypeScriptSyntax(node) ? transformClassMembers(node) : visitNodes2(node.members, getClassElementVisitor(node), isClassElement) + transformClassMembers(node) ); } function transformClassMembers(node) { - const members = []; + const members = visitNodes2(node.members, getClassElementVisitor(node), isClassElement); + let newMembers; const constructor = getFirstConstructorWithBody(node); const parametersWithPropertyAssignments = constructor && filter(constructor.parameters, (p) => isParameterPropertyDeclaration(p, constructor)); if (parametersWithPropertyAssignments) { for (const parameter of parametersWithPropertyAssignments) { - if (isIdentifier(parameter.name)) { - members.push(setOriginalNode(factory2.createPropertyDeclaration( - /*modifiers*/ - void 0, - parameter.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ), parameter)); - } + const parameterProperty = factory2.createPropertyDeclaration( + /*modifiers*/ + void 0, + parameter.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + setOriginalNode(parameterProperty, parameter); + newMembers = append(newMembers, parameterProperty); } } - addRange(members, visitNodes2(node.members, getClassElementVisitor(node), isClassElement)); - return setTextRange( - factory2.createNodeArray(members), - /*location*/ - node.members - ); + if (newMembers) { + newMembers = addRange(newMembers, members); + return setTextRange( + factory2.createNodeArray(newMembers), + /*location*/ + node.members + ); + } + return members; } - function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { - var _a2, _b, _c, _d; - if (!allDecorators) { - return void 0; + function injectClassTypeMetadata(modifiers, node) { + const metadata = getTypeMetadata(node, node); + if (some(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, takeWhile(modifiers, isExportOrDefaultModifier)); + addRange(modifiersArray, filter(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter(skipWhile(modifiers, isExportOrDefaultModifier), isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); } - const decorators = visitArray(allDecorators.decorators, visitor, isDecorator); - const parameterDecorators = flatMap(allDecorators.parameters, transformDecoratorsOfParameter); - const metadataDecorators = some(decorators) || some(parameterDecorators) ? getTypeMetadata(node, container) : void 0; - const result = factory2.createNodeArray(concatenate(concatenate(decorators, parameterDecorators), metadataDecorators)); - const pos = (_b = (_a2 = firstOrUndefined(allDecorators.decorators)) == null ? void 0 : _a2.pos) != null ? _b : -1; - const end = (_d = (_c = lastOrUndefined(allDecorators.decorators)) == null ? void 0 : _c.end) != null ? _d : -1; - setTextRangePosEnd(result, pos, end); - return result; + return modifiers; } - function transformDecoratorsOfParameter(parameterDecorators, parameterOffset) { - if (parameterDecorators) { - const decorators = []; - for (const parameterDecorator of parameterDecorators) { - const expression = visitNode(parameterDecorator.expression, visitor, isExpression); - const helper = emitHelpers().createParamHelper(expression, parameterOffset); - setTextRange(helper, parameterDecorator.expression); - setEmitFlags(helper, 3072 /* NoComments */); - const decorator = factory2.createDecorator(helper); - setSourceMapRange(decorator, parameterDecorator.expression); - setCommentRange(decorator, parameterDecorator.expression); - setEmitFlags(decorator, 3072 /* NoComments */); - decorators.push(decorator); + function injectClassElementTypeMetadata(modifiers, node, container) { + if (isClassLike(container) && classElementOrClassElementParameterIsDecorated(legacyDecorators, node, container)) { + const metadata = getTypeMetadata(node, container); + if (some(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, filter(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter(modifiers, isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); } - return decorators; } + return modifiers; } function getTypeMetadata(node, container) { + if (!legacyDecorators) + return void 0; return USE_NEW_TYPE_METADATA_FORMAT ? getNewTypeMetadata(node, container) : getOldTypeMetadata(node, container); } function getOldTypeMetadata(node, container) { @@ -86867,8 +88091,9 @@ ${lanes.join("\n")} } function visitPropertyNameOfClassElement(member) { const name = member.name; - if (isComputedPropertyName(name) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member))) { + if (isComputedPropertyName(name) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member) && legacyDecorators)) { const expression = visitNode(name.expression, visitor, isExpression); + Debug.assert(expression); const innerExpression = skipPartiallyEmittedExpressions(expression); if (!isSimpleInlineableExpression(innerExpression)) { const generatedName = factory2.getGeneratedNameForNode(name); @@ -86876,7 +88101,7 @@ ${lanes.join("\n")} return factory2.updateComputedPropertyName(name, factory2.createAssignment(generatedName, expression)); } } - return visitNode(name, visitor, isPropertyName); + return Debug.checkDefined(visitNode(name, visitor, isPropertyName)); } function visitHeritageClause(node) { if (node.token === 117 /* ImplementsKeyword */) { @@ -86887,7 +88112,7 @@ ${lanes.join("\n")} function visitExpressionWithTypeArguments(node) { return factory2.updateExpressionWithTypeArguments( node, - visitNode(node.expression, visitor, isLeftHandSideExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression)), /*typeArguments*/ void 0 ); @@ -86897,16 +88122,16 @@ ${lanes.join("\n")} } function visitPropertyDeclaration(node, parent2) { const isAmbient = node.flags & 16777216 /* Ambient */ || hasSyntacticModifier(node, 256 /* Abstract */); - if (isAmbient && !hasDecorators(node)) { + if (isAmbient && !(legacyDecorators && hasDecorators(node))) { return void 0; } - const allDecorators = getAllDecoratorsOfClassElement(node, parent2); - const decorators = transformAllDecoratorsOfDeclaration(node, parent2, allDecorators); + let modifiers = isClassLike(parent2) ? !isAmbient ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); if (isAmbient) { return factory2.updatePropertyDeclaration( node, - concatenate(decorators, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), - visitNode(node.name, visitor, isPropertyName), + concatenate(modifiers, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, /*type*/ @@ -86917,13 +88142,13 @@ ${lanes.join("\n")} } return factory2.updatePropertyDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), /*questionOrExclamationToken*/ void 0, /*type*/ void 0, - visitNode(node.initializer, visitor) + visitNode(node.initializer, visitor, isExpression) ); } function visitConstructor(node) { @@ -87024,11 +88249,11 @@ ${lanes.join("\n")} if (!shouldEmitFunctionLikeDeclaration(node)) { return void 0; } - const allDecorators = isClassLike(parent2) ? getAllDecoratorsOfClassElement(node, parent2) : void 0; - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, allDecorators) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateMethodDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, node.asteriskToken, visitPropertyNameOfClassElement(node), /*questionToken*/ @@ -87051,10 +88276,11 @@ ${lanes.join("\n")} if (!shouldEmitAccessorDeclaration(node)) { return void 0; } - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, getAllDecoratorsOfClassElement(node, parent2)) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateGetAccessorDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), visitParameterList(node.parameters, visitor, context), /*type*/ @@ -87069,10 +88295,11 @@ ${lanes.join("\n")} if (!shouldEmitAccessorDeclaration(node)) { return void 0; } - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, getAllDecoratorsOfClassElement(node, parent2)) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateSetAccessorDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context) || factory2.createBlock([]) @@ -87139,10 +88366,9 @@ ${lanes.join("\n")} } const updated = factory2.updateParameterDeclaration( node, - elideNodes(factory2, node.modifiers), - // preserve positions, if available + visitNodes2(node.modifiers, (node2) => isDecorator(node2) ? visitor(node2) : void 0, isModifierLike), node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*questionToken*/ void 0, /*type*/ @@ -87191,7 +88417,7 @@ ${lanes.join("\n")} return setTextRange( factory2.createAssignment( getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), - visitNode(node.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) ), /*location*/ node @@ -87201,7 +88427,7 @@ ${lanes.join("\n")} function visitVariableDeclaration(node) { const updated = factory2.updateVariableDeclaration( node, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*exclamationToken*/ void 0, /*type*/ @@ -87217,26 +88443,30 @@ ${lanes.join("\n")} const innerExpression = skipOuterExpressions(node.expression, ~6 /* Assertions */); if (isAssertionExpression(innerExpression)) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } return visitEachChild(node, visitor, context); } function visitAssertionExpression(node) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitNonNullExpression(node) { const expression = visitNode(node.expression, visitor, isLeftHandSideExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitSatisfiesExpression(node) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitCallExpression(node) { return factory2.updateCallExpression( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -87245,7 +88475,7 @@ ${lanes.join("\n")} function visitNewExpression(node) { return factory2.updateNewExpression( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -87254,28 +88484,28 @@ ${lanes.join("\n")} function visitTaggedTemplateExpression(node) { return factory2.updateTaggedTemplateExpression( node, - visitNode(node.tag, visitor, isExpression), + Debug.checkDefined(visitNode(node.tag, visitor, isExpression)), /*typeArguments*/ void 0, - visitNode(node.template, visitor, isExpression) + Debug.checkDefined(visitNode(node.template, visitor, isTemplateLiteral)) ); } function visitJsxSelfClosingElement(node) { return factory2.updateJsxSelfClosingElement( node, - visitNode(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), /*typeArguments*/ void 0, - visitNode(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) ); } function visitJsxJsxOpeningElement(node) { return factory2.updateJsxOpeningElement( node, - visitNode(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), /*typeArguments*/ void 0, - visitNode(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) ); } function shouldEmitEnumDeclaration(node) { @@ -87421,7 +88651,7 @@ ${lanes.join("\n")} } else { enableSubstitutionForNonQualifiedEnumMembers(); if (member.initializer) { - return visitNode(member.initializer, visitor, isExpression); + return Debug.checkDefined(visitNode(member.initializer, visitor, isExpression)); } else { return factory2.createVoidZero(); } @@ -87663,7 +88893,7 @@ ${lanes.join("\n")} if (node.kind === 271 /* NamespaceImport */) { return shouldEmitAliasDeclaration(node) ? node : void 0; } else { - const allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); + const allowEmpty = compilerOptions.verbatimModuleSyntax || compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); const elements = visitNodes2(node.elements, visitImportSpecifier, isImportSpecifier); return allowEmpty || some(elements) ? factory2.updateNamedImports(node, elements) : void 0; } @@ -87672,7 +88902,7 @@ ${lanes.join("\n")} return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : void 0; } function visitExportAssignment(node) { - return resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; + return compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; } function visitExportDeclaration(node) { if (node.isTypeOnly) { @@ -87681,7 +88911,7 @@ ${lanes.join("\n")} if (!node.exportClause || isNamespaceExport(node.exportClause)) { return node; } - const allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); + const allowEmpty = compilerOptions.verbatimModuleSyntax || !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); const exportClause = visitNode( node.exportClause, (bindings) => visitNamedExportBindings(bindings, allowEmpty), @@ -87702,13 +88932,13 @@ ${lanes.join("\n")} return allowEmpty || some(elements) ? factory2.updateNamedExports(node, elements) : void 0; } function visitNamespaceExports(node) { - return factory2.updateNamespaceExport(node, visitNode(node.name, visitor, isIdentifier)); + return factory2.updateNamespaceExport(node, Debug.checkDefined(visitNode(node.name, visitor, isIdentifier))); } function visitNamedExportBindings(node, allowEmpty) { return isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty); } function visitExportSpecifier(node) { - return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : void 0; + return !node.isTypeOnly && (compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node)) ? node : void 0; } function shouldEmitImportEqualsDeclaration(node) { return shouldEmitAliasDeclaration(node) || !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node); @@ -87768,7 +88998,7 @@ ${lanes.join("\n")} ); } else { return setOriginalNode( - createNamespaceExport2( + createNamespaceExport( node.name, moduleReference, node @@ -87789,7 +89019,7 @@ ${lanes.join("\n")} function isDefaultExternalModuleExport(node) { return isExternalModuleExport(node) && hasSyntacticModifier(node, 1024 /* Default */); } - function addExportMemberAssignment(statements, node) { + function createExportMemberAssignmentStatement(node) { const expression = factory2.createAssignment( factory2.getExternalModuleOrNamespaceExportName( currentNamespaceContainerName, @@ -87804,9 +89034,12 @@ ${lanes.join("\n")} setSourceMapRange(expression, createRange(node.name ? node.name.pos : node.pos, node.end)); const statement = factory2.createExpressionStatement(expression); setSourceMapRange(statement, createRange(-1, node.end)); - statements.push(statement); + return statement; } - function createNamespaceExport2(exportName, exportValue, location) { + function addExportMemberAssignment(statements, node) { + statements.push(createExportMemberAssignmentStatement(node)); + } + function createNamespaceExport(exportName, exportValue, location) { return setTextRange( factory2.createExpressionStatement( factory2.createAssignment( @@ -87967,7 +89200,7 @@ ${lanes.join("\n")} return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; } function shouldEmitAliasDeclaration(node) { - return isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); + return compilerOptions.verbatimModuleSyntax || isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); } } var USE_NEW_TYPE_METADATA_FORMAT; @@ -87983,6 +89216,7 @@ ${lanes.join("\n")} function transformClassFields(context) { const { factory: factory2, + getEmitHelperFactory: emitHelpers, hoistVariableDeclaration, endLexicalEnvironment, startLexicalEnvironment, @@ -87993,6 +89227,7 @@ ${lanes.join("\n")} const compilerOptions = context.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const shouldTransformInitializersUsingSet = !useDefineForClassFields; const shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9 /* ES2022 */; const shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine; @@ -88005,42 +89240,69 @@ ${lanes.join("\n")} context.onSubstituteNode = onSubstituteNode; const previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; + let shouldTransformPrivateStaticElementsInFile = false; let enabledSubstitutions; let classAliases; let pendingExpressions; let pendingStatements; - const classLexicalEnvironmentStack = []; - const classLexicalEnvironmentMap = /* @__PURE__ */ new Map(); - let currentClassLexicalEnvironment; + let lexicalEnvironment; + const lexicalEnvironmentMap = /* @__PURE__ */ new Map(); let currentClassContainer; - let currentComputedPropertyNameClassLexicalEnvironment; let currentStaticPropertyDeclarationOrStaticBlock; + let shouldSubstituteThisWithClassThis = false; + let previousShouldSubstituteThisWithClassThis = false; return chainBundle(context, transformSourceFile); function transformSourceFile(node) { - if (node.isDeclarationFile || !shouldTransformAnything) { + if (node.isDeclarationFile) { + return node; + } + lexicalEnvironment = void 0; + shouldTransformPrivateStaticElementsInFile = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); + if (!shouldTransformAnything && !shouldTransformPrivateStaticElementsInFile) { return node; } const visited = visitEachChild(node, visitor, context); addEmitHelpers(visited, context.readEmitHelpers()); return visited; } + function modifierVisitor(node) { + switch (node.kind) { + case 127 /* AccessorKeyword */: + return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + default: + return tryCast(node, isModifier); + } + } function visitor(node) { if (!(node.transformFlags & 16777216 /* ContainsClassFields */) && !(node.transformFlags & 134234112 /* ContainsLexicalThisOrSuper */)) { return node; } switch (node.kind) { case 127 /* AccessorKeyword */: - return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + return Debug.fail("Use `modifierVisitor` instead."); case 260 /* ClassDeclaration */: return visitClassDeclaration(node); case 228 /* ClassExpression */: - return visitClassExpression(node); + return visitClassExpression( + node, + /*referencedName*/ + void 0 + ); case 172 /* ClassStaticBlockDeclaration */: - return visitClassStaticBlockDeclaration(node); case 169 /* PropertyDeclaration */: - return visitPropertyDeclaration(node); + return Debug.fail("Use `classElementVisitor` instead."); + case 299 /* PropertyAssignment */: + return visitPropertyAssignment(node); case 240 /* VariableStatement */: return visitVariableStatement(node); + case 257 /* VariableDeclaration */: + return visitVariableDeclaration(node); + case 166 /* Parameter */: + return visitParameterDeclaration(node); + case 205 /* BindingElement */: + return visitBindingElement(node); + case 274 /* ExportAssignment */: + return visitExportAssignment(node); case 80 /* PrivateIdentifier */: return visitPrivateIdentifier(node); case 208 /* PropertyAccessExpression */: @@ -88051,15 +89313,23 @@ ${lanes.join("\n")} case 222 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ false ); case 223 /* BinaryExpression */: return visitBinaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ false ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); case 210 /* CallExpression */: return visitCallExpression(node); case 241 /* ExpressionStatement */: @@ -88088,21 +89358,57 @@ ${lanes.join("\n")} function fallbackVisitor(node) { return visitEachChild(node, visitor, context); } + function namedEvaluationVisitor(node, referencedName) { + switch (node.kind) { + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 228 /* ClassExpression */: + return visitClassExpression(node, referencedName); + default: + return visitor(node); + } + } function discardedValueVisitor(node) { switch (node.kind) { case 221 /* PrefixUnaryExpression */: case 222 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ true ); case 223 /* BinaryExpression */: return visitBinaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ + true + ); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ true ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + true, + /*referencedName*/ + void 0 + ); default: return visitor(node); } @@ -88146,10 +89452,20 @@ ${lanes.join("\n")} visitPropertyDeclaration, node ); + case 172 /* ClassStaticBlockDeclaration */: + return visitClassStaticBlockDeclaration(node); case 164 /* ComputedPropertyName */: return visitComputedPropertyName(node); case 237 /* SemicolonClassElement */: return node; + default: + return isModifierLike(node) ? modifierVisitor(node) : visitor(node); + } + } + function propertyNameVisitor(node) { + switch (node.kind) { + case 164 /* ComputedPropertyName */: + return visitComputedPropertyName(node); default: return visitor(node); } @@ -88175,20 +89491,25 @@ ${lanes.join("\n")} } return setOriginalNode(factory2.createIdentifier(""), node); } - function isPrivateIdentifierInExpression(node) { - return isPrivateIdentifier(node.left) && node.operatorToken.kind === 101 /* InKeyword */; - } function transformPrivateIdentifierInInExpression(node) { - const info = accessPrivateIdentifier(node.left); + const info = accessPrivateIdentifier2(node.left); if (info) { const receiver = visitNode(node.right, visitor, isExpression); return setOriginalNode( - context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), + emitHelpers().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node ); } return visitEachChild(node, visitor, context); } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updatePropertyAssignment(node, name, initializer); + } + return visitEachChild(node, visitor, context); + } function visitVariableStatement(node) { const savedPendingStatements = pendingStatements; pendingStatements = []; @@ -88197,17 +89518,90 @@ ${lanes.join("\n")} pendingStatements = savedPendingStatements; return statement; } - function visitComputedPropertyName(node) { - let expression = visitNode(node.expression, visitor, isExpression); + function getAssignedNameOfIdentifier(name, initializer) { + const originalClass = getOriginalNode(initializer, isClassLike); + return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateVariableDeclaration( + node, + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitParameterDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const propertyName = visitNode(node.propertyName, visitor, isPropertyName); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBindingElement( + node, + /*dotDotDotToken*/ + void 0, + propertyName, + name, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateExportAssignment(node, modifiers, expression); + } + return visitEachChild(node, visitor, context); + } + function injectPendingExpressions(expression) { if (some(pendingExpressions)) { if (isParenthesizedExpression(expression)) { - expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions([...pendingExpressions, expression.expression])); + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); } else { - expression = factory2.inlineExpressions([...pendingExpressions, expression]); + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); } pendingExpressions = void 0; } - return factory2.updateComputedPropertyName(node, expression); + return expression; + } + function visitComputedPropertyName(node) { + const expression = visitNode(node.expression, visitor, isExpression); + return factory2.updateComputedPropertyName(node, injectPendingExpressions(expression)); } function visitConstructorDeclaration(node) { if (currentClassContainer) { @@ -88215,12 +89609,19 @@ ${lanes.join("\n")} } return fallbackVisitor(node); } + function shouldTransformClassElementToWeakMap(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) + return true; + if (hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) + return true; + return false; + } function visitMethodOrAccessorDeclaration(node) { Debug.assert(!hasDecorators(node)); - if (!shouldTransformPrivateElementsOrClassStaticBlocks || !isPrivateIdentifier(node.name)) { + if (!isPrivateIdentifierClassElementDeclaration(node) || !shouldTransformClassElementToWeakMap(node)) { return visitEachChild(node, classElementVisitor, context); } - const info = accessPrivateIdentifier(node.name); + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); if (!info.isValid) { return node; @@ -88255,7 +89656,7 @@ ${lanes.join("\n")} } function getHoistedFunctionName(node) { Debug.assert(isPrivateIdentifier(node.name)); - const info = accessPrivateIdentifier(node.name); + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); if (info.kind === "m" /* Method */) { return info.methodName; @@ -88270,42 +89671,61 @@ ${lanes.join("\n")} } } function transformAutoAccessor(node) { - Debug.assertEachNode(node.modifiers, isModifier); const commentRange = getCommentRange(node); const sourceMapRange = getSourceMapRange(node); const name = node.name; let getterName = name; let setterName = name; if (isComputedPropertyName(name) && !isSimpleInlineableExpression(name.expression)) { - const temp = factory2.createTempVariable(hoistVariableDeclaration); - setSourceMapRange(temp, name.expression); - const expression = visitNode(name.expression, visitor, isExpression); - const assignment = factory2.createAssignment(temp, expression); - setSourceMapRange(assignment, name.expression); - getterName = factory2.updateComputedPropertyName(name, factory2.inlineExpressions([assignment, temp])); - setterName = factory2.updateComputedPropertyName(name, temp); + const cacheAssignment = findComputedPropertyNameCacheAssignment(name); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name, visitNode(name.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name.expression); + const expression = visitNode(name.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name.expression); + getterName = factory2.updateComputedPropertyName(name, assignment); + setterName = factory2.updateComputedPropertyName(name, temp); + } } - const backingField = createAccessorPropertyBackingField(factory2, node, node.modifiers, node.initializer); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiers, node.initializer); setOriginalNode(backingField, node); setEmitFlags(backingField, 3072 /* NoComments */); setSourceMapRange(backingField, sourceMapRange); - const getter = createAccessorPropertyGetRedirector(factory2, node, node.modifiers, getterName); + const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName); setOriginalNode(getter, node); setCommentRange(getter, commentRange); setSourceMapRange(getter, sourceMapRange); - const setter = createAccessorPropertySetRedirector(factory2, node, node.modifiers, setterName); + const setter = createAccessorPropertySetRedirector(factory2, node, modifiers, setterName); setOriginalNode(setter, node); setEmitFlags(setter, 3072 /* NoComments */); setSourceMapRange(setter, sourceMapRange); return visitArray([backingField, getter, setter], accessorFieldResultVisitor, isClassElement); } function transformPrivateFieldInitializer(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { - const info = accessPrivateIdentifier(node.name); + if (shouldTransformClassElementToWeakMap(node)) { + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); - return info.isValid ? void 0 : node; + if (!info.isValid) { + return node; + } + if (info.isStatic && !shouldTransformPrivateElementsOrClassStaticBlocks) { + const statement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); + if (statement) { + return factory2.createClassStaticBlockDeclaration(factory2.createBlock( + [statement], + /*multiLine*/ + true + )); + } + } + return void 0; } - if (shouldTransformInitializersUsingSet && !isStatic(node) && currentClassLexicalEnvironment && currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */) { + if (shouldTransformInitializersUsingSet && !isStatic(node) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */) { return factory2.updatePropertyDeclaration( node, visitNodes2(node.modifiers, visitor, isModifierLike), @@ -88318,6 +89738,19 @@ ${lanes.join("\n")} void 0 ); } + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) + ); + } return visitEachChild(node, visitor, context); } function transformPublicFieldInitializer(node) { @@ -88325,10 +89758,12 @@ ${lanes.join("\n")} const expr = getPropertyNameExpressionIfNeeded( node.name, /*shouldHoist*/ - !!node.initializer || useDefineForClassFields + !!node.initializer || useDefineForClassFields, + /*captureReferencedName*/ + isNamedEvaluation(node, isAnonymousClassNeedingAssignedName) ); if (expr) { - getPendingExpressions().push(expr); + getPendingExpressions().push(...flattenCommaList(expr)); } if (isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks) { const initializerStatement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); @@ -88346,17 +89781,26 @@ ${lanes.join("\n")} } return void 0; } - return visitEachChild(node, classElementVisitor, context); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); } function transformFieldInitializer(node) { Debug.assert(!hasDecorators(node), "Decorators should already have been transformed and elided."); return isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node); } function shouldTransformAutoAccessorsInCurrentClass() { - return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!currentClassLexicalEnvironment && !!(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */); + return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !!(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */); } function visitPropertyDeclaration(node) { - if (shouldTransformAutoAccessorsInCurrentClass() && isAutoAccessorPropertyDeclaration(node)) { + if (isAutoAccessorPropertyDeclaration(node) && (shouldTransformAutoAccessorsInCurrentClass() || hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */)) { return transformAutoAccessor(node); } return transformFieldInitializer(node); @@ -88368,33 +89812,35 @@ ${lanes.join("\n")} setCommentRange(receiver, moveRangePos(receiver, -1)); switch (info.kind) { case "a" /* Accessor */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, info.getterName ); case "m" /* Method */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, info.methodName ); case "f" /* Field */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, - info.variableName + info.isStatic ? info.variableName : void 0 ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); default: Debug.assertNever(info, "Unknown private element type"); } } function visitPropertyAccessExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(node.name)) { - const privateIdentifierInfo = accessPrivateIdentifier(node.name); + if (isPrivateIdentifier(node.name)) { + const privateIdentifierInfo = accessPrivateIdentifier2(node.name); if (privateIdentifierInfo) { return setTextRange( setOriginalNode( @@ -88405,8 +89851,8 @@ ${lanes.join("\n")} ); } } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); } @@ -88424,8 +89870,8 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitElementAccessExpression(node) { - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); } @@ -88442,16 +89888,16 @@ ${lanes.join("\n")} } return visitEachChild(node, visitor, context); } - function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) { + function visitPreOrPostfixUnaryExpression(node, discarded) { if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { const operand = skipParentheses(node.operand); - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(operand)) { + if (isPrivateIdentifierPropertyAccessExpression(operand)) { let info; - if (info = accessPrivateIdentifier(operand.name)) { + if (info = accessPrivateIdentifier2(operand.name)) { const receiver = visitNode(operand.expression, visitor, isExpression); const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver); let expression = createPrivateIdentifierAccess(info, readExpression); - const temp = isPrefixUnaryExpression(node) || valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = isPrefixUnaryExpression(node) || discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); expression = createPrivateIdentifierAssignment( info, @@ -88467,8 +89913,8 @@ ${lanes.join("\n")} } return expression; } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { const expression = visitInvalidSuperProperty(operand); return isPrefixUnaryExpression(node) ? factory2.updatePrefixUnaryExpression(node, expression) : factory2.updatePostfixUnaryExpression(node, expression); @@ -88491,7 +89937,7 @@ ${lanes.join("\n")} if (setterName && getterName) { let expression = factory2.createReflectGetCall(superClassReference, getterName, classConstructor); setTextRange(expression, operand); - const temp = valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); expression = factory2.createReflectSetCall(superClassReference, setterName, expression, classConstructor); setOriginalNode(expression, node); @@ -88532,12 +89978,13 @@ ${lanes.join("\n")} return { readExpression, initializeExpression }; } function visitCallExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.expression)) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.expression) && accessPrivateIdentifier2(node.expression.name)) { const { thisArg, target } = factory2.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion); if (isCallChain(node)) { return factory2.updateCallChain( node, - factory2.createPropertyAccessChain(visitNode(target, visitor), node.questionDotToken, "call"), + factory2.createPropertyAccessChain(visitNode(target, visitor, isExpression), node.questionDotToken, "call"), /*questionDotToken*/ void 0, /*typeArguments*/ @@ -88547,16 +89994,16 @@ ${lanes.join("\n")} } return factory2.updateCallExpression( node, - factory2.createPropertyAccessExpression(visitNode(target, visitor), "call"), + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "call"), /*typeArguments*/ void 0, [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { const invocation = factory2.createFunctionCallCall( visitNode(node.expression, visitor, isExpression), - currentClassLexicalEnvironment.classConstructor, + lexicalEnvironment.data.classConstructor, visitNodes2(node.arguments, visitor, isExpression) ); setOriginalNode(invocation, node); @@ -88566,12 +90013,13 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitTaggedTemplateExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.tag)) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.tag) && accessPrivateIdentifier2(node.tag.name)) { const { thisArg, target } = factory2.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion); return factory2.updateTaggedTemplateExpression( node, factory2.createCallExpression( - factory2.createPropertyAccessExpression(visitNode(target, visitor), "bind"), + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "bind"), /*typeArguments*/ void 0, [visitNode(thisArg, visitor, isExpression)] @@ -88581,10 +90029,10 @@ ${lanes.join("\n")} visitNode(node.template, visitor, isTemplateLiteral) ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { const invocation = factory2.createFunctionBindCall( visitNode(node.tag, visitor, isExpression), - currentClassLexicalEnvironment.classConstructor, + lexicalEnvironment.data.classConstructor, [] ); setOriginalNode(invocation, node); @@ -88600,10 +90048,10 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function transformClassStaticBlockDeclaration(node) { + if (lexicalEnvironment) { + lexicalEnvironmentMap.set(getOriginalNode(node), lexicalEnvironment); + } if (shouldTransformPrivateElementsOrClassStaticBlocks) { - if (currentClassLexicalEnvironment) { - classLexicalEnvironmentMap.set(getOriginalNodeId(node), currentClassLexicalEnvironment); - } startLexicalEnvironment(); let statements = setCurrentStaticPropertyDeclarationOrStaticBlockAnd( node, @@ -88618,23 +90066,45 @@ ${lanes.join("\n")} return iife; } } - function visitBinaryExpression(node, valueIsDiscarded) { + function isAnonymousClassNeedingAssignedName(node) { + if (isClassExpression(node) && !node.name) { + const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); + const classStaticBlock = find(staticPropertiesOrClassStaticBlocks, isClassStaticBlockDeclaration); + if (classStaticBlock) { + for (const statement of classStaticBlock.body.statements) { + if (isExpressionStatement(statement) && isCallToHelper(statement.expression, "___setFunctionName")) { + return false; + } + } + } + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || !!(getInternalEmitFlags(node) && 32 /* TransformPrivateStaticElements */)) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + return hasTransformableStatics; + } + return false; + } + function visitBinaryExpression(node, discarded) { if (isDestructuringAssignment(node)) { const savedPendingExpressions = pendingExpressions; pendingExpressions = void 0; node = factory2.updateBinaryExpression( node, - visitNode(node.left, assignmentTargetVisitor), + visitNode(node.left, assignmentTargetVisitor, isExpression), node.operatorToken, - visitNode(node.right, visitor) + visitNode(node.right, visitor, isExpression) ); const expr = some(pendingExpressions) ? factory2.inlineExpressions(compact([...pendingExpressions, node])) : node; pendingExpressions = savedPendingExpressions; return expr; } if (isAssignmentExpression(node)) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.left)) { - const info = accessPrivateIdentifier(node.left.name); + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isPrivateIdentifierPropertyAccessExpression(node.left)) { + const info = accessPrivateIdentifier2(node.left.name); if (info) { return setTextRange( setOriginalNode( @@ -88644,8 +90114,8 @@ ${lanes.join("\n")} node ); } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return factory2.updateBinaryExpression( node, @@ -88678,7 +90148,7 @@ ${lanes.join("\n")} ); setTextRange(expression, node); } - const temp = valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); if (temp) { expression = factory2.createAssignment(temp, expression); setTextRange(temp, node); @@ -88700,11 +90170,42 @@ ${lanes.join("\n")} } } } - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierInExpression(node)) { + if (isPrivateIdentifierInExpression(node)) { return transformPrivateIdentifierInInExpression(node); } return visitEachChild(node, visitor, context); } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitParenthesizedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function visitPartiallyEmittedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + const referencedName = factory2.createTempVariable(hoistVariableDeclaration); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name }; + } function createPrivateIdentifierAssignment(info, receiver, right, operator) { receiver = visitNode(receiver, visitor, isExpression); right = visitNode(right, visitor, isExpression); @@ -88720,7 +90221,7 @@ ${lanes.join("\n")} setCommentRange(receiver, moveRangePos(receiver, -1)); switch (info.kind) { case "a" /* Accessor */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, @@ -88728,7 +90229,7 @@ ${lanes.join("\n")} info.setterName ); case "m" /* Method */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, @@ -88737,13 +90238,15 @@ ${lanes.join("\n")} void 0 ); case "f" /* Field */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, info.kind, - info.variableName + info.isStatic ? info.variableName : void 0 ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); default: Debug.assertNever(info, "Unknown private element type"); } @@ -88754,7 +90257,7 @@ ${lanes.join("\n")} function getClassFacts(node) { let facts = 0 /* None */; const original = getOriginalNode(node); - if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(original)) { + if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) { facts |= 1 /* ClassWasDecorated */; } let containsPublicInstanceFields = false; @@ -88798,7 +90301,8 @@ ${lanes.join("\n")} return facts; } function visitExpressionWithTypeArgumentsInHeritageClause(node) { - const facts = (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts) || 0 /* None */; + var _a2; + const facts = ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts) || 0 /* None */; if (facts & 4 /* NeedsClassSuperReference */) { const temp = factory2.createTempVariable( hoistVariableDeclaration, @@ -88818,20 +90322,24 @@ ${lanes.join("\n")} } return visitEachChild(node, visitor, context); } - function visitInNewClassLexicalEnvironment(node, visitor2) { + function visitInNewClassLexicalEnvironment(node, referencedName, visitor2) { const savedCurrentClassContainer = currentClassContainer; const savedPendingExpressions = pendingExpressions; + const savedLexicalEnvironment = lexicalEnvironment; currentClassContainer = node; pendingExpressions = void 0; startClassLexicalEnvironment(); - if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const shouldAlwaysTransformPrivateStaticElements = getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */; + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldAlwaysTransformPrivateStaticElements) { const name = getNameOfDeclaration(node); if (name && isIdentifier(name)) { - getPrivateIdentifierEnvironment().className = name; + getPrivateIdentifierEnvironment().data.className = name; } + } + if (shouldTransformPrivateElementsOrClassStaticBlocks) { const privateInstanceMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); if (some(privateInstanceMethodsAndAccessors)) { - getPrivateIdentifierEnvironment().weakSetName = createHoistedVariableForClass( + getPrivateIdentifierEnvironment().data.weakSetName = createHoistedVariableForClass( "instances", privateInstanceMethodsAndAccessors[0].name ); @@ -88844,27 +90352,42 @@ ${lanes.join("\n")} if (facts & 8 /* NeedsSubstitutionForThisInClassStaticField */) { enableSubstitutionForClassStaticThisOrSuperReference(); } - const result = visitor2(node, facts); + const result = visitor2(node, facts, referencedName); endClassLexicalEnvironment(); + Debug.assert(lexicalEnvironment === savedLexicalEnvironment); currentClassContainer = savedCurrentClassContainer; pendingExpressions = savedPendingExpressions; return result; } function visitClassDeclaration(node) { - return visitInNewClassLexicalEnvironment(node, visitClassDeclarationInNewClassLexicalEnvironment); + return visitInNewClassLexicalEnvironment( + node, + /*referencedName*/ + void 0, + visitClassDeclarationInNewClassLexicalEnvironment + ); } function visitClassDeclarationInNewClassLexicalEnvironment(node, facts) { + var _a2, _b; let pendingClassReferenceAssignment; if (facts & 2 /* NeedsClassConstructorReference */) { - const temp = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); - pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) { + getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + pendingClassReferenceAssignment = factory2.createAssignment(node.emitNode.classThis, factory2.getInternalName(node)); + } else { + const temp = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + } + if ((_b = node.emitNode) == null ? void 0 : _b.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; + } } - const modifiers = visitNodes2(node.modifiers, visitor, isModifierLike); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); const classDecl = factory2.updateClassDeclaration( @@ -88887,7 +90410,7 @@ ${lanes.join("\n")} if (some(pendingExpressions)) { statements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); } - if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks) { + if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) { const staticProperties = getStaticPropertiesAndClassStaticBlock(node); if (some(staticProperties)) { addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory2.getInternalName(node)); @@ -88895,28 +90418,37 @@ ${lanes.join("\n")} } return statements; } - function visitClassExpression(node) { - return visitInNewClassLexicalEnvironment(node, visitClassExpressionInNewClassLexicalEnvironment); + function visitClassExpression(node, referencedName) { + return visitInNewClassLexicalEnvironment(node, referencedName, visitClassExpressionInNewClassLexicalEnvironment); } - function visitClassExpressionInNewClassLexicalEnvironment(node, facts) { + function visitClassExpressionInNewClassLexicalEnvironment(node, facts, referencedName) { + var _a2, _b, _c, _d, _e, _f; const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */); const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */; let temp; function createClassTempVar() { + var _a3; + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a3 = node.emitNode) == null ? void 0 : _a3.classThis)) { + return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + } const classCheckFlags = resolver.getNodeCheckFlags(node); const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */; const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */; - return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2); + return temp2; + } + if ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; } if (facts & 2 /* NeedsClassConstructorReference */) { - temp = createClassTempVar(); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + temp != null ? temp : temp = createClassTempVar(); } - const modifiers = visitNodes2(node.modifiers, visitor, isModifierLike); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); - const classExpression = factory2.updateClassExpression( + let classExpression = factory2.updateClassExpression( node, modifiers, node.name, @@ -88929,46 +90461,68 @@ ${lanes.join("\n")} if (prologue) { expressions.push(prologue); } - const hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); - if (hasTransformableStatics || some(pendingExpressions)) { + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + if (hasTransformableStatics || some(pendingExpressions) || referencedName) { if (isDecoratedClassDeclaration) { Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration."); - if (pendingStatements && pendingExpressions && some(pendingExpressions)) { - pendingStatements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); + if (some(pendingExpressions)) { + addRange(pendingStatements, map(pendingExpressions, factory2.createExpressionStatement)); + } + if (referencedName) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const setNameExpression = emitHelpers().createSetFunctionNameHelper((_c = temp != null ? temp : (_b = node.emitNode) == null ? void 0 : _b.classThis) != null ? _c : factory2.getInternalName(node), referencedName); + pendingStatements.push(factory2.createExpressionStatement(setNameExpression)); + } else { + const setNameExpression = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), referencedName); + classExpression = factory2.updateClassExpression( + classExpression, + classExpression.modifiers, + classExpression.name, + classExpression.typeParameters, + classExpression.heritageClauses, + [ + factory2.createClassStaticBlockDeclaration( + factory2.createBlock([ + factory2.createExpressionStatement(setNameExpression) + ]) + ), + ...classExpression.members + ] + ); + } } - if (pendingStatements && some(staticPropertiesOrClassStaticBlocks)) { - addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, factory2.getInternalName(node)); + if (some(staticPropertiesOrClassStaticBlocks)) { + addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, (_e = (_d = node.emitNode) == null ? void 0 : _d.classThis) != null ? _e : factory2.getInternalName(node)); } if (temp) { - expressions.push( - startOnNewLine(factory2.createAssignment(temp, classExpression)), - startOnNewLine(temp) - ); + expressions.push(factory2.createAssignment(temp, classExpression)); + } else if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_f = node.emitNode) == null ? void 0 : _f.classThis)) { + expressions.push(factory2.createAssignment(node.emitNode.classThis, classExpression)); } else { expressions.push(classExpression); - if (prologue) { - startOnNewLine(classExpression); - } } } else { - temp || (temp = createClassTempVar()); + temp != null ? temp : temp = createClassTempVar(); if (isClassWithConstructorReference) { enableSubstitutionForClassAliases(); const alias = factory2.cloneNode(temp); - alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; + alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; classAliases[getOriginalNodeId(node)] = alias; } - setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression)); - expressions.push(startOnNewLine(factory2.createAssignment(temp, classExpression))); - addRange(expressions, map(pendingExpressions, startOnNewLine)); + expressions.push(factory2.createAssignment(temp, classExpression)); + addRange(expressions, pendingExpressions); + if (referencedName) { + expressions.push(emitHelpers().createSetFunctionNameHelper(temp, referencedName)); + } addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp)); - expressions.push(startOnNewLine(temp)); + expressions.push(factory2.cloneNode(temp)); } } else { expressions.push(classExpression); - if (prologue) { - startOnNewLine(classExpression); - } + } + if (expressions.length > 1) { + addEmitFlags(classExpression, 131072 /* Indented */); + expressions.forEach(startOnNewLine); } return factory2.inlineExpressions(expressions); } @@ -88979,16 +90533,24 @@ ${lanes.join("\n")} return void 0; } function transformClassMembers(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const shouldTransformPrivateStaticElementsInClass = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInFile) { for (const member of node.members) { if (isPrivateIdentifierClassElementDeclaration(member)) { - addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + if (shouldTransformClassElementToWeakMap(member)) { + addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, member.name, { kind: "untransformed" }); + } } } - if (some(getPrivateInstanceMethodsAndAccessors(node))) { - createBrandCheckWeakSetForPrivateMethods(); + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + if (some(getPrivateInstanceMethodsAndAccessors(node))) { + createBrandCheckWeakSetForPrivateMethods(); + } } - if (shouldTransformAutoAccessors) { + if (shouldTransformAutoAccessorsInCurrentClass()) { for (const member of node.members) { if (isAutoAccessorPropertyDeclaration(member)) { const storageName = factory2.getGeneratedPrivateNameForNode( @@ -88997,7 +90559,12 @@ ${lanes.join("\n")} void 0, "_accessor_storage" ); - addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInClass && hasStaticModifier(member)) { + addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, storageName, { kind: "untransformed" }); + } } } } @@ -89056,7 +90623,7 @@ ${lanes.join("\n")} return { members, prologue }; } function createBrandCheckWeakSetForPrivateMethods() { - const { weakSetName } = getPrivateIdentifierEnvironment(); + const { weakSetName } = getPrivateIdentifierEnvironment().data; Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); getPendingExpressions().push( factory2.createAssignment( @@ -89072,7 +90639,7 @@ ${lanes.join("\n")} } function transformConstructor(constructor, container) { constructor = visitNode(constructor, visitor, isConstructorDeclaration); - if (!currentClassLexicalEnvironment || !(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */)) { + if (!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) || !(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */)) { return constructor; } const extendsClauseElement = getEffectiveBaseTypeNode(container); @@ -89109,13 +90676,14 @@ ${lanes.join("\n")} } function transformConstructorBody(node, constructor, isDerivedClass) { var _a2, _b; - let properties = getProperties( + const instanceProperties = getProperties( node, /*requireInitializer*/ false, /*isStatic*/ false ); + let properties = instanceProperties; if (!useDefineForClassFields) { properties = filter(properties, (property) => !!property.initializer || isPrivateIdentifier(property.name) || hasAccessorModifier(property)); } @@ -89169,37 +90737,30 @@ ${lanes.join("\n")} } let parameterPropertyDeclarationCount = 0; if (constructor == null ? void 0 : constructor.body) { - if (useDefineForClassFields) { - statements = statements.filter((statement) => !isParameterPropertyDeclaration(getOriginalNode(statement), constructor)); - } else { - for (const statement of constructor.body.statements) { - if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - parameterPropertyDeclarationCount++; - } - } - if (parameterPropertyDeclarationCount > 0) { - const parameterProperties = visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount); - if (superStatementIndex >= 0) { - addRange(statements, parameterProperties); - } else { - let superAndPrologueStatementCount = prologueStatementCount; - if (needsSyntheticConstructor) - superAndPrologueStatementCount++; - statements = [ - ...statements.slice(0, superAndPrologueStatementCount), - ...parameterProperties, - ...statements.slice(superAndPrologueStatementCount) - ]; - } - indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + for (let i = indexOfFirstStatementAfterSuperAndPrologue; i < constructor.body.statements.length; i++) { + const statement = constructor.body.statements[i]; + if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { + parameterPropertyDeclarationCount++; + } else { + break; } } + if (parameterPropertyDeclarationCount > 0) { + indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + } } const receiver = factory2.createThis(); - addMethodStatements(statements, privateMethodsAndAccessors, receiver); - addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + addInstanceMethodStatements(statements, privateMethodsAndAccessors, receiver); + if (constructor) { + const parameterProperties = filter(instanceProperties, (prop) => isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + const nonParameterProperties = filter(properties, (prop) => !isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + addPropertyOrClassStaticBlockStatements(statements, parameterProperties, receiver); + addPropertyOrClassStaticBlockStatements(statements, nonParameterProperties, receiver); + } else { + addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + } if (constructor) { - addRange(statements, visitNodes2(constructor.body.statements, visitBodyStatement, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); + addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); } statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); if (statements.length === 0 && !constructor) { @@ -89218,16 +90779,10 @@ ${lanes.join("\n")} /*location*/ constructor ? constructor.body : void 0 ); - function visitBodyStatement(statement) { - if (useDefineForClassFields && isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - return void 0; - } - return visitor(statement); - } } function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) { for (const property of properties) { - if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) { + if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks) { continue; } const statement = transformPropertyOrClassStaticBlock(property, receiver); @@ -89245,10 +90800,19 @@ ${lanes.join("\n")} const statement = factory2.createExpressionStatement(expression); setOriginalNode(statement, property); addEmitFlags(statement, getEmitFlags(property) & 3072 /* NoComments */); - setSourceMapRange(statement, moveRangePastModifiers(property)); setCommentRange(statement, property); + const propertyOriginalNode = getOriginalNode(property); + if (isParameter(propertyOriginalNode)) { + setSourceMapRange(statement, propertyOriginalNode); + removeAllComments(statement); + } else { + setSourceMapRange(statement, moveRangePastModifiers(property)); + } setSyntheticLeadingComments(expression, void 0); setSyntheticTrailingComments(expression, void 0); + if (hasAccessorModifier(propertyOriginalNode)) { + addEmitFlags(statement, 3072 /* NoComments */); + } return statement; } function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) { @@ -89268,37 +90832,49 @@ ${lanes.join("\n")} return expressions; } function transformProperty(property, receiver) { + var _a2; const savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock; const transformed = transformPropertyWorker(property, receiver); - if (transformed && hasStaticModifier(property) && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts)) { + if (transformed && hasStaticModifier(property) && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts)) { setOriginalNode(transformed, property); addEmitFlags(transformed, 4 /* AdviseOnEmitNode */); - classLexicalEnvironmentMap.set(getOriginalNodeId(transformed), currentClassLexicalEnvironment); + setSourceMapRange(transformed, getSourceMapRange(property.name)); + lexicalEnvironmentMap.set(getOriginalNode(property), lexicalEnvironment); } currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock; return transformed; } function transformPropertyWorker(property, receiver) { - var _a2; const emitAssignment = !useDefineForClassFields; + let referencedName; + if (isNamedEvaluation(property, isAnonymousClassNeedingAssignedName)) { + if (isPropertyNameLiteral(property.name) || isPrivateIdentifier(property.name)) { + referencedName = factory2.createStringLiteralFromNode(property.name); + } else if (isPropertyNameLiteral(property.name.expression) && !isIdentifier(property.name.expression)) { + referencedName = factory2.createStringLiteralFromNode(property.name.expression); + } else { + referencedName = factory2.getGeneratedNameForNode(property.name); + } + } const propertyName = hasAccessorModifier(property) ? factory2.getGeneratedPrivateNameForNode(property.name) : isComputedPropertyName(property.name) && !isSimpleInlineableExpression(property.name.expression) ? factory2.updateComputedPropertyName(property.name, factory2.getGeneratedNameForNode(property.name)) : property.name; if (hasStaticModifier(property)) { currentStaticPropertyDeclarationOrStaticBlock = property; } - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(propertyName)) { - const privateIdentifierInfo = accessPrivateIdentifier(propertyName); + const initializerVisitor = referencedName ? (child) => namedEvaluationVisitor(child, referencedName) : visitor; + if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property)) { + const privateIdentifierInfo = accessPrivateIdentifier2(propertyName); if (privateIdentifierInfo) { if (privateIdentifierInfo.kind === "f" /* Field */) { if (!privateIdentifierInfo.isStatic) { return createPrivateInstanceFieldInitializer( receiver, - visitNode(property.initializer, visitor, isExpression), + visitNode(property.initializer, initializerVisitor, isExpression), privateIdentifierInfo.brandCheckIdentifier ); } else { return createPrivateStaticFieldInitializer( privateIdentifierInfo.variableName, - visitNode(property.initializer, visitor, isExpression) + visitNode(property.initializer, initializerVisitor, isExpression) ); } } else { @@ -89315,7 +90891,23 @@ ${lanes.join("\n")} if (hasSyntacticModifier(propertyOriginalNode, 256 /* Abstract */)) { return void 0; } - const initializer = property.initializer || emitAssignment ? (_a2 = visitNode(property.initializer, visitor, isExpression)) != null ? _a2 : factory2.createVoidZero() : isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName) ? propertyName : factory2.createVoidZero(); + let initializer = visitNode(property.initializer, initializerVisitor, isExpression); + if (isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName)) { + const localName = factory2.cloneNode(propertyName); + if (initializer) { + if (isParenthesizedExpression(initializer) && isCommaExpression(initializer.expression) && isCallToHelper(initializer.expression.left, "___runInitializers") && isVoidExpression(initializer.expression.right) && isNumericLiteral(initializer.expression.right.expression)) { + initializer = initializer.expression.left; + } + initializer = factory2.inlineExpressions([initializer, localName]); + } else { + initializer = localName; + } + setEmitFlags(propertyName, 3072 /* NoComments */ | 96 /* NoSourceMap */); + setSourceMapRange(localName, propertyOriginalNode.name); + setEmitFlags(localName, 3072 /* NoComments */); + } else { + initializer != null ? initializer : initializer = factory2.createVoidZero(); + } if (emitAssignment || isPrivateIdentifier(propertyName)) { const memberAccess = createMemberAccessForPropertyName( factory2, @@ -89324,7 +90916,9 @@ ${lanes.join("\n")} /*location*/ propertyName ); - return factory2.createAssignment(memberAccess, initializer); + addEmitFlags(memberAccess, 1024 /* NoLeadingComments */); + const expression = factory2.createAssignment(memberAccess, initializer); + return expression; } else { const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; const descriptor = factory2.createPropertyDescriptor({ value: initializer, configurable: true, writable: true, enumerable: true }); @@ -89352,11 +90946,11 @@ ${lanes.join("\n")} context.enableEmitNotification(164 /* ComputedPropertyName */); } } - function addMethodStatements(statements, methods, receiver) { + function addInstanceMethodStatements(statements, methods, receiver) { if (!shouldTransformPrivateElementsOrClassStaticBlocks || !some(methods)) { return; } - const { weakSetName } = getPrivateIdentifierEnvironment(); + const { weakSetName } = getPrivateIdentifierEnvironment().data; Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); statements.push( factory2.createExpressionStatement( @@ -89375,20 +90969,352 @@ ${lanes.join("\n")} visitNode(node.argumentExpression, visitor, isExpression) ); } + function getPropertyNameExpressionIfNeeded(name, shouldHoist, captureReferencedName) { + if (isComputedPropertyName(name)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name); + let expression = visitNode(name.expression, visitor, isExpression); + const innerExpression = skipPartiallyEmittedExpressions(expression); + const inlinable = isSimpleInlineableExpression(innerExpression); + const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); + if (!alreadyTransformed && !inlinable && shouldHoist) { + const generatedName = factory2.getGeneratedNameForNode(name); + if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) { + addBlockScopedVariable(generatedName); + } else { + hoistVariableDeclaration(generatedName); + } + if (captureReferencedName) { + expression = emitHelpers().createPropKeyHelper(expression); + } + return factory2.createAssignment(generatedName, expression); + } + return inlinable || isIdentifier(innerExpression) ? void 0 : expression; + } + } + function startClassLexicalEnvironment() { + lexicalEnvironment = { previous: lexicalEnvironment, data: void 0 }; + } + function endClassLexicalEnvironment() { + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + } + function getClassLexicalEnvironment() { + var _a2; + Debug.assert(lexicalEnvironment); + return (_a2 = lexicalEnvironment.data) != null ? _a2 : lexicalEnvironment.data = { + facts: 0 /* None */, + classConstructor: void 0, + classThis: void 0, + superClassReference: void 0 + // privateIdentifierEnvironment: undefined, + }; + } + function getPrivateIdentifierEnvironment() { + var _a2; + Debug.assert(lexicalEnvironment); + return (_a2 = lexicalEnvironment.privateEnv) != null ? _a2 : lexicalEnvironment.privateEnv = newPrivateEnvironment({ + className: void 0, + weakSetName: void 0 + }); + } + function getPendingExpressions() { + return pendingExpressions != null ? pendingExpressions : pendingExpressions = []; + } + function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + if (isAutoAccessorPropertyDeclaration(node)) { + addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isPropertyDeclaration(node)) { + addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isMethodDeclaration(node)) { + addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isGetAccessorDeclaration(node)) { + addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isSetAccessorDeclaration(node)) { + addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } + } + function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + if (isStatic2) { + const brandCheckIdentifier = Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment"); + const variableName = createHoistedVariableForPrivateName(name); + setPrivateIdentifier(privateEnv, name, { + kind: "f" /* Field */, + isStatic: true, + brandCheckIdentifier, + variableName, + isValid + }); + } else { + const weakMapName = createHoistedVariableForPrivateName(name); + setPrivateIdentifier(privateEnv, name, { + kind: "f" /* Field */, + isStatic: false, + brandCheckIdentifier: weakMapName, + isValid + }); + getPendingExpressions().push(factory2.createAssignment( + weakMapName, + factory2.createNewExpression( + factory2.createIdentifier("WeakMap"), + /*typeArguments*/ + void 0, + [] + ) + )); + } + } + function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + const methodName = createHoistedVariableForPrivateName(name); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name, { + kind: "m" /* Method */, + methodName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + var _a2; + const getterName = createHoistedVariableForPrivateName(name, "_get"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { + previousInfo.getterName = getterName; + } else { + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName, + setterName: void 0, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + } + function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + var _a2; + const setterName = createHoistedVariableForPrivateName(name, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { + previousInfo.setterName = setterName; + } else { + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName: void 0, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + } + function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + const getterName = createHoistedVariableForPrivateName(name, "_get"); + const setterName = createHoistedVariableForPrivateName(name, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { + const lex = getClassLexicalEnvironment(); + const privateEnv = getPrivateIdentifierEnvironment(); + const previousInfo = getPrivateIdentifier(privateEnv, name); + const isStatic2 = hasStaticModifier(node); + const isValid = !isReservedPrivateName(name) && previousInfo === void 0; + addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } + function createHoistedVariableForClass(name, node, suffix) { + const { className } = getPrivateIdentifierEnvironment().data; + const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; + const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0, + /*reserveInNestedScopes*/ + true, + prefix, + suffix + ); + if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) { + addBlockScopedVariable(identifier); + } else { + hoistVariableDeclaration(identifier); + } + return identifier; + } + function createHoistedVariableForPrivateName(name, suffix) { + var _a2; + const text = tryGetTextOfPropertyName(name); + return createHoistedVariableForClass((_a2 = text == null ? void 0 : text.substring(1)) != null ? _a2 : name, name, suffix); + } + function accessPrivateIdentifier2(name) { + const info = accessPrivateIdentifier(lexicalEnvironment, name); + return (info == null ? void 0 : info.kind) === "untransformed" ? void 0 : info; + } + function wrapPrivateIdentifierForDestructuringTarget(node) { + const parameter = factory2.getGeneratedNameForNode(node); + const info = accessPrivateIdentifier2(node.name); + if (!info) { + return visitEachChild(node, visitor, context); + } + let receiver = node.expression; + if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { + receiver = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getPendingExpressions().push(factory2.createBinaryExpression(receiver, 63 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); + } + return factory2.createAssignmentTargetWrapper( + parameter, + createPrivateIdentifierAssignment( + info, + receiver, + parameter, + 63 /* EqualsToken */ + ) + ); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isPrivateIdentifierPropertyAccessExpression(node)) { + return wrapPrivateIdentifierForDestructuringTarget(node); + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1 /* ClassWasDecorated */) { + return visitInvalidSuperProperty(node); + } else if (classConstructor && superClassReference) { + const name = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (name) { + const temp = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + return factory2.createAssignmentTargetWrapper( + temp, + factory2.createReflectSetCall( + superClassReference, + name, + temp, + classConstructor + ) + ); + } + } + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const left = visitDestructuringAssignmentTarget(node.left); + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const left = visitDestructuringAssignmentTarget(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitDestructuringAssignmentTarget(node); + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentProperty(node) { + const name = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + return visitEachChild(node, visitor, context); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); + const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateShorthandPropertyAssignment(node, node.name, objectAssignmentInitializer); + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + return factory2.updateArrayLiteralExpression( + node, + visitNodes2(node.elements, visitArrayAssignmentElement, isExpression) + ); + } else { + return factory2.updateObjectLiteralExpression( + node, + visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike) + ); + } + } function onEmitNode(hint, node, emitCallback) { const original = getOriginalNode(node); - if (original.id) { - const classLexicalEnvironment = classLexicalEnvironmentMap.get(original.id); - if (classLexicalEnvironment) { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = classLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = classLexicalEnvironment; - previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; - return; - } + const lex = lexicalEnvironmentMap.get(original); + if (lex) { + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = lex; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = !isClassStaticBlockDeclaration(original) || !(getInternalEmitFlags(original) & 32 /* TransformPrivateStaticElements */); + previousOnEmitNode(hint, node, emitCallback); + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; + return; } switch (node.kind) { case 215 /* FunctionExpression */: @@ -89396,37 +91322,30 @@ ${lanes.join("\n")} break; } case 259 /* FunctionDeclaration */: - case 173 /* Constructor */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = void 0; - currentComputedPropertyNameClassLexicalEnvironment = void 0; - previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; - return; - } + case 173 /* Constructor */: case 174 /* GetAccessor */: case 175 /* SetAccessor */: case 171 /* MethodDeclaration */: case 169 /* PropertyDeclaration */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment; - currentClassLexicalEnvironment = void 0; + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = void 0; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = false; previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; return; } case 164 /* ComputedPropertyName */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = void 0; + const savedLexicalEnvironment = lexicalEnvironment; + const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + shouldSubstituteThisWithClassThis = savedShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; return; } } @@ -89449,15 +91368,16 @@ ${lanes.join("\n")} return node; } function substituteThisExpression(node) { - if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && currentClassLexicalEnvironment) { - const { facts, classConstructor } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { + if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { facts, classConstructor, classThis } = lexicalEnvironment.data; + if (facts & 1 /* ClassWasDecorated */ && legacyDecorators) { return factory2.createParenthesizedExpression(factory2.createVoidZero()); } - if (classConstructor) { + const substituteThis = shouldSubstituteThisWithClassThis ? classThis != null ? classThis : classConstructor : classConstructor; + if (substituteThis) { return setTextRange( setOriginalNode( - factory2.cloneNode(classConstructor), + factory2.cloneNode(substituteThis), node ), node @@ -89486,350 +91406,6 @@ ${lanes.join("\n")} } return void 0; } - function getPropertyNameExpressionIfNeeded(name, shouldHoist) { - if (isComputedPropertyName(name)) { - const expression = visitNode(name.expression, visitor, isExpression); - const innerExpression = skipPartiallyEmittedExpressions(expression); - const inlinable = isSimpleInlineableExpression(innerExpression); - const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); - if (!alreadyTransformed && !inlinable && shouldHoist) { - const generatedName = factory2.getGeneratedNameForNode(name); - if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) { - addBlockScopedVariable(generatedName); - } else { - hoistVariableDeclaration(generatedName); - } - return factory2.createAssignment(generatedName, expression); - } - return inlinable || isIdentifier(innerExpression) ? void 0 : expression; - } - } - function startClassLexicalEnvironment() { - classLexicalEnvironmentStack.push(currentClassLexicalEnvironment); - currentClassLexicalEnvironment = void 0; - } - function endClassLexicalEnvironment() { - currentClassLexicalEnvironment = classLexicalEnvironmentStack.pop(); - } - function getClassLexicalEnvironment() { - return currentClassLexicalEnvironment || (currentClassLexicalEnvironment = { - facts: 0 /* None */, - classConstructor: void 0, - superClassReference: void 0, - privateIdentifierEnvironment: void 0 - }); - } - function getPrivateIdentifierEnvironment() { - const lex = getClassLexicalEnvironment(); - lex.privateIdentifierEnvironment || (lex.privateIdentifierEnvironment = { - className: void 0, - weakSetName: void 0, - identifiers: void 0, - generatedIdentifiers: void 0 - }); - return lex.privateIdentifierEnvironment; - } - function getPendingExpressions() { - return pendingExpressions != null ? pendingExpressions : pendingExpressions = []; - } - function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - if (isAutoAccessorPropertyDeclaration(node)) { - addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isPropertyDeclaration(node)) { - addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isMethodDeclaration(node)) { - addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isGetAccessorDeclaration(node)) { - addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isSetAccessorDeclaration(node)) { - addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - } - function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - if (isStatic2) { - Debug.assert(lex.classConstructor, "classConstructor should be set in private identifier environment"); - const variableName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - brandCheckIdentifier: lex.classConstructor, - variableName, - isStatic: true, - isValid - }); - } else { - const weakMapName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - brandCheckIdentifier: weakMapName, - variableName: void 0, - isStatic: false, - isValid - }); - getPendingExpressions().push(factory2.createAssignment( - weakMapName, - factory2.createNewExpression( - factory2.createIdentifier("WeakMap"), - /*typeArguments*/ - void 0, - [] - ) - )); - } - } - function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const methodName = createHoistedVariableForPrivateName(name); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "m" /* Method */, - methodName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { - previousInfo.getterName = getterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName: void 0, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { - previousInfo.setterName = setterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName: void 0, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { - const lex = getClassLexicalEnvironment(); - const privateEnv = getPrivateIdentifierEnvironment(); - const previousInfo = getPrivateIdentifier(privateEnv, name); - const isStatic2 = hasStaticModifier(node); - const isValid = !isReservedPrivateName(name) && previousInfo === void 0; - addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - function createHoistedVariableForClass(name, node, suffix) { - const { className } = getPrivateIdentifierEnvironment(); - const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; - const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0, - /*reserveInNestedScopes*/ - true, - prefix, - suffix - ); - if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) { - addBlockScopedVariable(identifier); - } else { - hoistVariableDeclaration(identifier); - } - return identifier; - } - function createHoistedVariableForPrivateName(name, suffix) { - var _a2; - const text = tryGetTextOfPropertyName(name); - return createHoistedVariableForClass((_a2 = text == null ? void 0 : text.substring(1)) != null ? _a2 : name, name, suffix); - } - function accessPrivateIdentifier(name) { - if (isGeneratedPrivateIdentifier(name)) { - return accessGeneratedPrivateIdentifier(name); - } else { - return accessPrivateIdentifierByText(name.escapedText); - } - } - function accessPrivateIdentifierByText(text) { - return accessPrivateIdentifierWorker(getPrivateIdentifierInfo, text); - } - function accessGeneratedPrivateIdentifier(name) { - return accessPrivateIdentifierWorker(getGeneratedPrivateIdentifierInfo, getNodeForGeneratedName(name)); - } - function accessPrivateIdentifierWorker(getPrivateIdentifierInfo2, privateIdentifierKey) { - if (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.privateIdentifierEnvironment) { - const info = getPrivateIdentifierInfo2(currentClassLexicalEnvironment.privateIdentifierEnvironment, privateIdentifierKey); - if (info) { - return info; - } - } - for (let i = classLexicalEnvironmentStack.length - 1; i >= 0; --i) { - const env = classLexicalEnvironmentStack[i]; - if (!env) { - continue; - } - if (env.privateIdentifierEnvironment) { - const info = getPrivateIdentifierInfo2(env.privateIdentifierEnvironment, privateIdentifierKey); - if (info) { - return info; - } - } - } - return void 0; - } - function wrapPrivateIdentifierForDestructuringTarget(node) { - const parameter = factory2.getGeneratedNameForNode(node); - const info = accessPrivateIdentifier(node.name); - if (!info) { - return visitEachChild(node, visitor, context); - } - let receiver = node.expression; - if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { - receiver = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getPendingExpressions().push(factory2.createBinaryExpression(receiver, 63 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); - } - return factory2.createAssignmentTargetWrapper( - parameter, - createPrivateIdentifierAssignment( - info, - receiver, - parameter, - 63 /* EqualsToken */ - ) - ); - } - function visitArrayAssignmentTarget(node) { - const target = getTargetOfBindingOrAssignmentElement(node); - if (target) { - let wrapped; - if (isPrivateIdentifierPropertyAccessExpression(target)) { - wrapped = wrapPrivateIdentifierForDestructuringTarget(target); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { - wrapped = visitInvalidSuperProperty(target); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(target) ? visitNode(target.argumentExpression, visitor, isExpression) : isIdentifier(target.name) ? factory2.createStringLiteralFromNode(target.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - wrapped = factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - if (wrapped) { - if (isAssignmentExpression(node)) { - return factory2.updateBinaryExpression( - node, - wrapped, - node.operatorToken, - visitNode(node.right, visitor, isExpression) - ); - } else if (isSpreadElement(node)) { - return factory2.updateSpreadElement(node, wrapped); - } else { - return wrapped; - } - } - } - return visitNode(node, assignmentTargetVisitor); - } - function visitObjectAssignmentTarget(node) { - if (isObjectBindingOrAssignmentElement(node) && !isShorthandPropertyAssignment(node)) { - const target = getTargetOfBindingOrAssignmentElement(node); - let wrapped; - if (target) { - if (isPrivateIdentifierPropertyAccessExpression(target)) { - wrapped = wrapPrivateIdentifierForDestructuringTarget(target); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { - wrapped = visitInvalidSuperProperty(target); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(target) ? visitNode(target.argumentExpression, visitor, isExpression) : isIdentifier(target.name) ? factory2.createStringLiteralFromNode(target.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - wrapped = factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - } - if (isPropertyAssignment(node)) { - const initializer = getInitializerOfBindingOrAssignmentElement(node); - return factory2.updatePropertyAssignment( - node, - visitNode(node.name, visitor, isPropertyName), - wrapped ? initializer ? factory2.createAssignment(wrapped, visitNode(initializer, visitor)) : wrapped : visitNode(node.initializer, assignmentTargetVisitor, isExpression) - ); - } - if (isSpreadAssignment(node)) { - return factory2.updateSpreadAssignment( - node, - wrapped || visitNode(node.expression, assignmentTargetVisitor, isExpression) - ); - } - Debug.assert(wrapped === void 0, "Should not have generated a wrapped target"); - } - return visitNode(node, visitor); - } - function visitAssignmentPattern(node) { - if (isArrayLiteralExpression(node)) { - return factory2.updateArrayLiteralExpression( - node, - visitNodes2(node.elements, visitArrayAssignmentTarget, isExpression) - ); - } else { - return factory2.updateObjectLiteralExpression( - node, - visitNodes2(node.properties, visitObjectAssignmentTarget, isObjectLiteralElementLike) - ); - } - } } function createPrivateStaticFieldInitializer(variableName, initializer) { return factory.createAssignment( @@ -89858,38 +91434,13 @@ ${lanes.join("\n")} function isReservedPrivateName(node) { return !isGeneratedPrivateIdentifier(node) && node.escapedText === "#constructor"; } - function getPrivateIdentifier(privateEnv, name) { - return isGeneratedPrivateIdentifier(name) ? getGeneratedPrivateIdentifierInfo(privateEnv, getNodeForGeneratedName(name)) : getPrivateIdentifierInfo(privateEnv, name.escapedText); - } - function setPrivateIdentifier(privateEnv, name, info) { - var _a2, _b; - if (isGeneratedPrivateIdentifier(name)) { - (_a2 = privateEnv.generatedIdentifiers) != null ? _a2 : privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map(); - privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), info); - } else { - (_b = privateEnv.identifiers) != null ? _b : privateEnv.identifiers = /* @__PURE__ */ new Map(); - privateEnv.identifiers.set(name.escapedText, info); - } - } - function getPrivateIdentifierInfo(privateEnv, key) { - var _a2; - return (_a2 = privateEnv.identifiers) == null ? void 0 : _a2.get(key); - } - function getGeneratedPrivateIdentifierInfo(privateEnv, key) { - var _a2; - return (_a2 = privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(key); + function isPrivateIdentifierInExpression(node) { + return isPrivateIdentifier(node.left) && node.operatorToken.kind === 101 /* InKeyword */; } - var PrivateIdentifierKind2; var init_classFields = __esm({ "src/compiler/transformers/classFields.ts"() { "use strict"; init_ts2(); - PrivateIdentifierKind2 = /* @__PURE__ */ ((PrivateIdentifierKind3) => { - PrivateIdentifierKind3["Field"] = "f"; - PrivateIdentifierKind3["Method"] = "m"; - PrivateIdentifierKind3["Accessor"] = "a"; - return PrivateIdentifierKind3; - })(PrivateIdentifierKind2 || {}); } }); @@ -90302,9 +91853,22 @@ ${lanes.join("\n")} } } function visitClassDeclaration(node) { - if (!(classOrConstructorParameterIsDecorated(node) || childIsDecorated(node))) + if (!(classOrConstructorParameterIsDecorated( + /*legacyDecorators*/ + true, + node + ) || childIsDecorated( + /*legacyDecorators*/ + true, + node + ))) { return visitEachChild(node, visitor, context); - const statements = hasDecorators(node) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); + } + const statements = classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + true, + node + ) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); if (statements.length > 1) { statements.push(factory2.createEndOfDeclarationMarker(node)); setEmitFlags(statements[0], getEmitFlags(statements[0]) | 8388608 /* HasEndOfDeclarationMarker */); @@ -90321,7 +91885,12 @@ ${lanes.join("\n")} for (const member of node.members) { if (!canHaveDecorators(member)) continue; - const allDecorators = getAllDecoratorsOfClassElement(member, node); + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); if (some(allDecorators == null ? void 0 : allDecorators.decorators, decoratorContainsPrivateIdentifierInExpression)) return true; if (some(allDecorators == null ? void 0 : allDecorators.parameters, parameterDecoratorsContainPrivateIdentifierInExpression)) @@ -90398,7 +91967,7 @@ ${lanes.join("\n")} const classExpression = factory2.createClassExpression( /*modifiers*/ void 0, - name, + name && isGeneratedIdentifier(name) ? void 0 : name, /*typeParameters*/ void 0, heritageClauses, @@ -90443,7 +92012,7 @@ ${lanes.join("\n")} return factory2.updateConstructorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), visitNode(node.body, visitor, isBlock) ); } @@ -90459,12 +92028,12 @@ ${lanes.join("\n")} node, visitNodes2(node.modifiers, modifierVisitor, isModifier), node.asteriskToken, - visitNode(node.name, visitor, isPropertyName), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionToken*/ void 0, /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -90474,8 +92043,8 @@ ${lanes.join("\n")} return finishClassElement(factory2.updateGetAccessorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -90485,8 +92054,8 @@ ${lanes.join("\n")} return finishClassElement(factory2.updateSetAccessorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), visitNode(node.body, visitor, isBlock) ), node); } @@ -90497,7 +92066,7 @@ ${lanes.join("\n")} return finishClassElement(factory2.updatePropertyDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, /*type*/ @@ -90510,7 +92079,7 @@ ${lanes.join("\n")} node, elideNodes(factory2, node.modifiers), node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*questionToken*/ void 0, /*type*/ @@ -90525,20 +92094,30 @@ ${lanes.join("\n")} } return updated; } + function isSyntheticMetadataDecorator(node) { + return isCallToHelper(node.expression, "___metadata"); + } function transformAllDecoratorsOfDeclaration(allDecorators) { if (!allDecorators) { return void 0; } + const { false: decorators, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator); const decoratorExpressions = []; - addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); + addRange(decoratorExpressions, map(decorators, transformDecorator)); addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); + addRange(decoratorExpressions, map(metadata, transformDecorator)); return decoratorExpressions; } function addClassElementDecorationStatements(statements, node, isStatic2) { addRange(statements, map(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr))); } function isDecoratedClassElement(member, isStaticElement, parent2) { - return nodeOrChildIsDecorated(member, parent2) && isStaticElement === isStatic(member); + return nodeOrChildIsDecorated( + /*legacyDecorators*/ + true, + member, + parent2 + ) && isStaticElement === isStatic(member); } function getDecoratedClassElements(node, isStatic2) { return filter(node.members, (m) => isDecoratedClassElement(m, isStatic2, node)); @@ -90552,7 +92131,12 @@ ${lanes.join("\n")} return expressions; } function generateClassElementDecorationExpression(node, member) { - const allDecorators = getAllDecoratorsOfClassElement(member, node); + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); if (!decoratorExpressions) { return void 0; @@ -90607,7 +92191,7 @@ ${lanes.join("\n")} return expression; } function transformDecorator(decorator) { - return visitNode(decorator.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(decorator.expression, visitor, isExpression)); } function transformDecoratorsOfParameter(decorators, parameterOffset) { let expressions; @@ -90701,6 +92285,1719 @@ ${lanes.join("\n")} } }); + // src/compiler/transformers/esDecorators.ts + function transformESDecorators(context) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + startLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context; + let top; + let classInfo; + let classThis; + let classSuper; + let pendingExpressions; + let shouldTransformPrivateStaticElementsInFile; + return chainBundle(context, transformSourceFile); + function transformSourceFile(node) { + top = void 0; + shouldTransformPrivateStaticElementsInFile = false; + const visited = visitEachChild(node, visitor, context); + addEmitHelpers(visited, context.readEmitHelpers()); + if (shouldTransformPrivateStaticElementsInFile) { + addInternalEmitFlags(visited, 32 /* TransformPrivateStaticElements */); + shouldTransformPrivateStaticElementsInFile = false; + } + return visited; + } + function updateState() { + classInfo = void 0; + classThis = void 0; + classSuper = void 0; + switch (top == null ? void 0 : top.kind) { + case "class": + classInfo = top.classInfo; + break; + case "class-element": + classInfo = top.next.classInfo; + classThis = top.classThis; + classSuper = top.classSuper; + break; + case "name": + const grandparent = top.next.next.next; + if ((grandparent == null ? void 0 : grandparent.kind) === "class-element") { + classInfo = grandparent.next.classInfo; + classThis = grandparent.classThis; + classSuper = grandparent.classSuper; + } + break; + } + } + function enterClass(classInfo2) { + top = { kind: "class", next: top, classInfo: classInfo2, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + function exitClass() { + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + function enterClassElement(node) { + var _a2, _b; + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "class-element", next: top }; + if (isClassStaticBlockDeclaration(node) || isPropertyDeclaration(node) && hasStaticModifier(node)) { + top.classThis = (_a2 = top.next.classInfo) == null ? void 0 : _a2.classThis; + top.classSuper = (_b = top.next.classInfo) == null ? void 0 : _b.classSuper; + } + updateState(); + } + function exitClassElement() { + var _a2; + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + Debug.assert(((_a2 = top.next) == null ? void 0 : _a2.kind) === "class", "Incorrect value for top.next.kind.", () => { + var _a3; + return `Expected top.next.kind to be 'class' but got '${(_a3 = top.next) == null ? void 0 : _a3.kind}' instead.`; + }); + top = top.next; + updateState(); + } + function enterName() { + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "name", next: top }; + updateState(); + } + function exitName() { + Debug.assert((top == null ? void 0 : top.kind) === "name", "Incorrect value for top.kind.", () => `Expected top.kind to be 'name' but got '${top == null ? void 0 : top.kind}' instead.`); + top = top.next; + updateState(); + } + function enterOther() { + if ((top == null ? void 0 : top.kind) === "other") { + Debug.assert(!pendingExpressions); + top.depth++; + } else { + top = { kind: "other", next: top, depth: 0, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + } + function exitOther() { + Debug.assert((top == null ? void 0 : top.kind) === "other", "Incorrect value for top.kind.", () => `Expected top.kind to be 'other' but got '${top == null ? void 0 : top.kind}' instead.`); + if (top.depth > 0) { + Debug.assert(!pendingExpressions); + top.depth--; + } else { + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + } + function shouldVisitNode(node) { + return !!(node.transformFlags & 33554432 /* ContainsDecorators */) || !!classThis && !!(node.transformFlags & 16384 /* ContainsLexicalThis */) || !!classThis && !!classSuper && !!(node.transformFlags & 134217728 /* ContainsLexicalSuper */); + } + function visitor(node) { + if (!shouldVisitNode(node)) { + return node; + } + switch (node.kind) { + case 167 /* Decorator */: + return Debug.fail("Use `modifierVisitor` instead."); + case 260 /* ClassDeclaration */: + return visitClassDeclaration(node); + case 228 /* ClassExpression */: + return visitClassExpression( + node, + /*referencedName*/ + void 0 + ); + case 173 /* Constructor */: + case 169 /* PropertyDeclaration */: + case 172 /* ClassStaticBlockDeclaration */: + return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); + case 166 /* Parameter */: + return visitParameterDeclaration(node); + case 223 /* BinaryExpression */: + return visitBinaryExpression( + node, + /*discarded*/ + false + ); + case 299 /* PropertyAssignment */: + return visitPropertyAssignment(node); + case 257 /* VariableDeclaration */: + return visitVariableDeclaration(node); + case 205 /* BindingElement */: + return visitBindingElement(node); + case 274 /* ExportAssignment */: + return visitExportAssignment(node); + case 108 /* ThisKeyword */: + return visitThisExpression(node); + case 245 /* ForStatement */: + return visitForStatement(node); + case 241 /* ExpressionStatement */: + return visitExpressionStatement(node); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ + false + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); + case 210 /* CallExpression */: + return visitCallExpression(node); + case 212 /* TaggedTemplateExpression */: + return visitTaggedTemplateExpression(node); + case 221 /* PrefixUnaryExpression */: + case 222 /* PostfixUnaryExpression */: + return visitPreOrPostfixUnaryExpression( + node, + /*discard*/ + false + ); + case 208 /* PropertyAccessExpression */: + return visitPropertyAccessExpression(node); + case 209 /* ElementAccessExpression */: + return visitElementAccessExpression(node); + case 164 /* ComputedPropertyName */: + return visitComputedPropertyName(node); + case 171 /* MethodDeclaration */: + case 175 /* SetAccessor */: + case 174 /* GetAccessor */: + case 215 /* FunctionExpression */: + case 259 /* FunctionDeclaration */: { + enterOther(); + const result = visitEachChild(node, fallbackVisitor, context); + exitOther(); + return result; + } + default: + return visitEachChild(node, fallbackVisitor, context); + } + } + function fallbackVisitor(node) { + switch (node.kind) { + case 167 /* Decorator */: + return void 0; + default: + return visitor(node); + } + } + function modifierVisitor(node) { + switch (node.kind) { + case 167 /* Decorator */: + return void 0; + default: + return node; + } + } + function classElementVisitor(node) { + switch (node.kind) { + case 173 /* Constructor */: + return visitConstructorDeclaration(node); + case 171 /* MethodDeclaration */: + return visitMethodDeclaration(node); + case 174 /* GetAccessor */: + return visitGetAccessorDeclaration(node); + case 175 /* SetAccessor */: + return visitSetAccessorDeclaration(node); + case 169 /* PropertyDeclaration */: + return visitPropertyDeclaration(node); + case 172 /* ClassStaticBlockDeclaration */: + return visitClassStaticBlockDeclaration(node); + default: + return visitor(node); + } + } + function namedEvaluationVisitor(node, referencedName) { + switch (node.kind) { + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 228 /* ClassExpression */: + return visitClassExpression(node, referencedName); + default: + return visitor(node); + } + } + function discardedValueVisitor(node) { + switch (node.kind) { + case 221 /* PrefixUnaryExpression */: + case 222 /* PostfixUnaryExpression */: + return visitPreOrPostfixUnaryExpression( + node, + /*discarded*/ + true + ); + case 223 /* BinaryExpression */: + return visitBinaryExpression( + node, + /*discarded*/ + true + ); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ + true + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + true, + /*referencedName*/ + void 0 + ); + default: + return visitor(node); + } + } + function getHelperVariableName(node) { + let declarationName = node.name && isIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name) : node.name && isPrivateIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name).slice(1) : node.name && isStringLiteral(node.name) && isIdentifierText(node.name.text, 99 /* ESNext */) ? node.name.text : isClassLike(node) ? "class" : "member"; + if (isGetAccessor(node)) + declarationName = `get_${declarationName}`; + if (isSetAccessor(node)) + declarationName = `set_${declarationName}`; + if (node.name && isPrivateIdentifier(node.name)) + declarationName = `private_${declarationName}`; + if (isStatic(node)) + declarationName = `static_${declarationName}`; + return "_" + declarationName; + } + function createHelperVariable(node, suffix) { + return factory2.createUniqueName(`${getHelperVariableName(node)}_${suffix}`, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */); + } + function createLet(name, initializer) { + return factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ) + ], 1 /* Let */) + ); + } + function createClassInfo(node) { + let instanceExtraInitializersName; + let staticExtraInitializersName; + let hasStaticInitializers = false; + let hasNonAmbientInstanceFields = false; + let hasStaticPrivateClassElements = false; + for (const member of node.members) { + if (isNamedClassElement(member) && nodeOrChildIsDecorated( + /*legacyDecorators*/ + false, + member, + node + )) { + if (hasStaticModifier(member)) { + staticExtraInitializersName != null ? staticExtraInitializersName : staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */); + } else { + instanceExtraInitializersName != null ? instanceExtraInitializersName : instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */); + } + } + if (isClassStaticBlockDeclaration(member)) { + hasStaticInitializers = true; + } else if (isPropertyDeclaration(member)) { + if (hasStaticModifier(member)) { + hasStaticInitializers || (hasStaticInitializers = !!member.initializer || hasDecorators(member)); + } else { + hasNonAmbientInstanceFields || (hasNonAmbientInstanceFields = !isAmbientPropertyDeclaration(member)); + } + } + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + hasStaticPrivateClassElements = true; + } + if (staticExtraInitializersName && instanceExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) { + break; + } + } + return { + class: node, + instanceExtraInitializersName, + staticExtraInitializersName, + hasStaticInitializers, + hasNonAmbientInstanceFields, + hasStaticPrivateClassElements + }; + } + function containsLexicalSuperInStaticInitializer(node) { + for (const member of node.members) { + if (isClassStaticBlockDeclaration(member) || isPropertyDeclaration(member) && hasStaticModifier(member)) { + if (member.transformFlags & 134217728 /* ContainsLexicalSuper */) { + return true; + } + } + } + return false; + } + function transformClassLike(node, className) { + var _a2, _b, _c, _d, _e; + startLexicalEnvironment(); + const classReference = (_a2 = node.name) != null ? _a2 : factory2.getGeneratedNameForNode(node); + const classInfo2 = createClassInfo(node); + const classDefinitionStatements = []; + let leadingBlockStatements; + let trailingBlockStatements; + let syntheticConstructor; + let heritageClauses; + let shouldTransformPrivateStaticElementsInClass = false; + const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(node)); + if (classDecorators) { + classInfo2.classDecoratorsName = factory2.createUniqueName("_classDecorators", 16 /* Optimistic */); + classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */); + classInfo2.classExtraInitializersName = factory2.createUniqueName("_classExtraInitializers", 16 /* Optimistic */); + classInfo2.classThis = factory2.createUniqueName("_classThis", 16 /* Optimistic */); + classDefinitionStatements.push( + createLet(classInfo2.classDecoratorsName, factory2.createArrayLiteralExpression(classDecorators)), + createLet(classInfo2.classDescriptorName), + createLet(classInfo2.classExtraInitializersName, factory2.createArrayLiteralExpression()), + createLet(classInfo2.classThis) + ); + if (classInfo2.hasStaticPrivateClassElements) { + shouldTransformPrivateStaticElementsInClass = true; + shouldTransformPrivateStaticElementsInFile = true; + } + } + if (classDecorators && containsLexicalSuperInStaticInitializer(node)) { + const extendsClause = getHeritageClause(node.heritageClauses, 94 /* ExtendsKeyword */); + const extendsElement = extendsClause && firstOrUndefined(extendsClause.types); + const extendsExpression = extendsElement && visitNode(extendsElement.expression, visitor, isExpression); + if (extendsExpression) { + classInfo2.classSuper = factory2.createUniqueName("_classSuper", 16 /* Optimistic */); + const unwrapped = skipOuterExpressions(extendsExpression); + const safeExtendsExpression = isClassExpression(unwrapped) && !unwrapped.name || isFunctionExpression(unwrapped) && !unwrapped.name || isArrowFunction(unwrapped) ? factory2.createComma(factory2.createNumericLiteral(0), extendsExpression) : extendsExpression; + classDefinitionStatements.push(createLet(classInfo2.classSuper, safeExtendsExpression)); + const updatedExtendsElement = factory2.updateExpressionWithTypeArguments( + extendsElement, + classInfo2.classSuper, + /*typeArguments*/ + void 0 + ); + const updatedExtendsClause = factory2.updateHeritageClause(extendsClause, [updatedExtendsElement]); + heritageClauses = factory2.createNodeArray([updatedExtendsClause]); + } + } else { + heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + } + const renamedClassThis = (_b = classInfo2.classThis) != null ? _b : factory2.createThis(); + const needsSetNameHelper = !((_c = getOriginalNode(node, isClassLike)) == null ? void 0 : _c.name) && (classDecorators || !isStringLiteral(className) || !isEmptyStringLiteral(className)); + if (needsSetNameHelper) { + const setNameExpr = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), className); + leadingBlockStatements = append(leadingBlockStatements, factory2.createExpressionStatement(setNameExpr)); + } + enterClass(classInfo2); + let members = visitNodes2(node.members, classElementVisitor, isClassElement); + if (pendingExpressions) { + let outerThis; + for (let expression of pendingExpressions) { + expression = visitNode(expression, function thisVisitor(node2) { + if (!(node2.transformFlags & 16384 /* ContainsLexicalThis */)) { + return node2; + } + switch (node2.kind) { + case 108 /* ThisKeyword */: + if (!outerThis) { + outerThis = factory2.createUniqueName("_outerThis", 16 /* Optimistic */); + classDefinitionStatements.unshift(createLet(outerThis, factory2.createThis())); + } + return outerThis; + default: + return visitEachChild(node2, thisVisitor, context); + } + }, isExpression); + const statement = factory2.createExpressionStatement(expression); + leadingBlockStatements = append(leadingBlockStatements, statement); + } + pendingExpressions = void 0; + } + exitClass(); + if (classInfo2.instanceExtraInitializersName && !getFirstConstructorWithBody(node)) { + const initializerStatements = prepareConstructor(node, classInfo2); + if (initializerStatements) { + const extendsClauseElement = getEffectiveBaseTypeNode(node); + const isDerivedClass = !!(extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */); + const constructorStatements = []; + if (isDerivedClass) { + const spreadArguments = factory2.createSpreadElement(factory2.createIdentifier("arguments")); + const superCall = factory2.createCallExpression( + factory2.createSuper(), + /*typeArguments*/ + void 0, + [spreadArguments] + ); + constructorStatements.push(factory2.createExpressionStatement(superCall)); + } + addRange(constructorStatements, initializerStatements); + const constructorBody = factory2.createBlock( + constructorStatements, + /*multiLine*/ + true + ); + syntheticConstructor = factory2.createConstructorDeclaration( + /*modifiers*/ + void 0, + [], + constructorBody + ); + } + } + if (classInfo2.staticExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.staticExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.instanceExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.instanceExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (!isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticFieldDecorationStatements); + if (classInfo2.classDescriptorName && classInfo2.classDecoratorsName && classInfo2.classExtraInitializersName && classInfo2.classThis) { + leadingBlockStatements != null ? leadingBlockStatements : leadingBlockStatements = []; + const valueProperty = factory2.createPropertyAssignment("value", factory2.createThis()); + const classDescriptor = factory2.createObjectLiteralExpression([valueProperty]); + const classDescriptorAssignment = factory2.createAssignment(classInfo2.classDescriptorName, classDescriptor); + const classNameReference = factory2.createPropertyAccessExpression(factory2.createThis(), "name"); + const esDecorateHelper2 = emitHelpers().createESDecorateHelper( + factory2.createNull(), + classDescriptorAssignment, + classInfo2.classDecoratorsName, + { kind: "class", name: classNameReference }, + factory2.createNull(), + classInfo2.classExtraInitializersName + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateHelper2); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(node)); + leadingBlockStatements.push(esDecorateStatement); + const classDescriptorValueReference = factory2.createPropertyAccessExpression(classInfo2.classDescriptorName, "value"); + const classThisAssignment = factory2.createAssignment(classInfo2.classThis, classDescriptorValueReference); + const classReferenceAssignment = factory2.createAssignment(classReference, classThisAssignment); + leadingBlockStatements.push(factory2.createExpressionStatement(classReferenceAssignment)); + } + if (classInfo2.staticExtraInitializersName) { + const runStaticInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.staticExtraInitializersName); + const runStaticInitializersStatement = factory2.createExpressionStatement(runStaticInitializersHelper); + setSourceMapRange(runStaticInitializersStatement, (_d = node.name) != null ? _d : moveRangePastDecorators(node)); + leadingBlockStatements = append(leadingBlockStatements, runStaticInitializersStatement); + } + if (classInfo2.classExtraInitializersName) { + const runClassInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.classExtraInitializersName); + const runClassInitializersStatement = factory2.createExpressionStatement(runClassInitializersHelper); + setSourceMapRange(runClassInitializersStatement, (_e = node.name) != null ? _e : moveRangePastDecorators(node)); + trailingBlockStatements = append(trailingBlockStatements, runClassInitializersStatement); + } + if (leadingBlockStatements && trailingBlockStatements && !classInfo2.hasStaticInitializers) { + addRange(leadingBlockStatements, trailingBlockStatements); + trailingBlockStatements = void 0; + } + let newMembers = members; + if (leadingBlockStatements) { + const leadingStaticBlockBody = factory2.createBlock( + leadingBlockStatements, + /*multiline*/ + true + ); + const leadingStaticBlock = factory2.createClassStaticBlockDeclaration(leadingStaticBlockBody); + if (shouldTransformPrivateStaticElementsInClass) { + setInternalEmitFlags(leadingStaticBlock, 32 /* TransformPrivateStaticElements */); + } + newMembers = [leadingStaticBlock, ...newMembers]; + } + if (syntheticConstructor) { + newMembers = [...newMembers, syntheticConstructor]; + } + if (trailingBlockStatements) { + const trailingStaticBlockBody = factory2.createBlock( + trailingBlockStatements, + /*multiline*/ + true + ); + const trailingStaticBlock = factory2.createClassStaticBlockDeclaration(trailingStaticBlockBody); + newMembers = [...newMembers, trailingStaticBlock]; + } + if (newMembers !== members) { + members = setTextRange(factory2.createNodeArray(newMembers), members); + } + const lexicalEnvironment = endLexicalEnvironment(); + let classExpression; + if (classDecorators) { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + const classReferenceDeclaration = factory2.createVariableDeclaration( + classReference, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + classExpression + ); + const classReferenceVarDeclList = factory2.createVariableDeclarationList([classReferenceDeclaration]); + const returnExpr = classInfo2.classThis ? factory2.createAssignment(classReference, classInfo2.classThis) : classReference; + classDefinitionStatements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + classReferenceVarDeclList + ), + factory2.createReturnStatement(returnExpr) + ); + } else { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + classDefinitionStatements.push(factory2.createReturnStatement(classExpression)); + } + if (shouldTransformPrivateStaticElementsInClass) { + addInternalEmitFlags(classExpression, 32 /* TransformPrivateStaticElements */); + for (const member of classExpression.members) { + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + addInternalEmitFlags(member, 32 /* TransformPrivateStaticElements */); + } + } + } + setOriginalNode(classExpression, node); + getOrCreateEmitNode(classExpression).classThis = classInfo2.classThis; + return factory2.createImmediatelyInvokedArrowFunction(factory2.mergeLexicalEnvironment(classDefinitionStatements, lexicalEnvironment)); + } + function isDecoratedClassLike(node) { + return classOrConstructorParameterIsDecorated( + /*legacyDecorators*/ + false, + node + ) || childIsDecorated( + /*legacyDecorators*/ + false, + node + ); + } + function visitClassDeclaration(node) { + var _a2; + if (isDecoratedClassLike(node)) { + if (hasSyntacticModifier(node, 1 /* Export */) && hasSyntacticModifier(node, 1024 /* Default */)) { + const originalClass = (_a2 = getOriginalNode(node, isClassLike)) != null ? _a2 : node; + const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default"); + const iife = transformClassLike(node, className); + const statement = factory2.createExportDefault(iife); + setOriginalNode(statement, node); + setCommentRange(statement, getCommentRange(node)); + setSourceMapRange(statement, moveRangePastDecorators(node)); + return statement; + } else { + Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name."); + const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name)); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const varDecl = factory2.createVariableDeclaration( + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + const varDecls = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); + const statement = factory2.createVariableStatement(modifiers, varDecls); + setOriginalNode(statement, node); + setCommentRange(statement, getCommentRange(node)); + return statement; + } + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassDeclaration( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function visitClassExpression(node, referencedName) { + if (isDecoratedClassLike(node)) { + const className = node.name ? factory2.createStringLiteralFromNode(node.name) : referencedName != null ? referencedName : factory2.createStringLiteral(""); + const iife = transformClassLike(node, className); + setOriginalNode(iife, node); + return iife; + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassExpression( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function prepareConstructor(_parent, classInfo2) { + if (classInfo2.instanceExtraInitializersName && !classInfo2.hasNonAmbientInstanceFields) { + const statements = []; + statements.push( + factory2.createExpressionStatement( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + classInfo2.instanceExtraInitializersName + ) + ) + ); + return statements; + } + } + function visitConstructorDeclaration(node) { + enterClassElement(node); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const parameters = visitNodes2(node.parameters, visitor, isParameter); + let body; + if (node.body && classInfo) { + const initializerStatements = prepareConstructor(classInfo.class, classInfo); + if (initializerStatements) { + const statements = []; + const nonPrologueStart = factory2.copyPrologue( + node.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart)); + body = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + setOriginalNode(body, node.body); + setTextRange(body, node.body); + } + } + body != null ? body : body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return factory2.updateConstructorDeclaration(node, modifiers, parameters, body); + } + function finishClassElement(updated, original) { + if (updated !== original) { + setCommentRange(updated, original); + setSourceMapRange(updated, moveRangePastDecorators(original)); + } + return updated; + } + function partialTransformClassElement(member, useNamedEvaluation, classInfo2, createDescriptor) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let referencedName; + let name; + let initializersName; + let thisArg; + let descriptorName; + if (!classInfo2) { + const modifiers2 = visitNodes2(member.modifiers, modifierVisitor, isModifier); + enterName(); + if (useNamedEvaluation) { + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + } else { + name = visitPropertyName(member.name); + } + exitName(); + return { modifiers: modifiers2, referencedName, name, initializersName, descriptorName, thisArg }; + } + const memberDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClassElement( + member, + classInfo2.class, + /*useLegacyDecorators*/ + false + )); + const modifiers = visitNodes2(member.modifiers, modifierVisitor, isModifier); + if (memberDecorators) { + const memberDecoratorsName = createHelperVariable(member, "decorators"); + const memberDecoratorsArray = factory2.createArrayLiteralExpression(memberDecorators); + const memberDecoratorsAssignment = factory2.createAssignment(memberDecoratorsName, memberDecoratorsArray); + const memberInfo = { memberDecoratorsName }; + (_a2 = classInfo2.memberInfos) != null ? _a2 : classInfo2.memberInfos = /* @__PURE__ */ new Map(); + classInfo2.memberInfos.set(member, memberInfo); + pendingExpressions != null ? pendingExpressions : pendingExpressions = []; + pendingExpressions.push(memberDecoratorsAssignment); + const statements = isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? (_b = classInfo2.staticNonFieldDecorationStatements) != null ? _b : classInfo2.staticNonFieldDecorationStatements = [] : (_c = classInfo2.nonStaticNonFieldDecorationStatements) != null ? _c : classInfo2.nonStaticNonFieldDecorationStatements = [] : isPropertyDeclaration(member) && !isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? (_d = classInfo2.staticFieldDecorationStatements) != null ? _d : classInfo2.staticFieldDecorationStatements = [] : (_e = classInfo2.nonStaticFieldDecorationStatements) != null ? _e : classInfo2.nonStaticFieldDecorationStatements = [] : Debug.fail(); + const kind = isGetAccessorDeclaration(member) ? "getter" : isSetAccessorDeclaration(member) ? "setter" : isMethodDeclaration(member) ? "method" : isAutoAccessorPropertyDeclaration(member) ? "accessor" : isPropertyDeclaration(member) ? "field" : Debug.fail(); + let propertyName; + if (isIdentifier(member.name) || isPrivateIdentifier(member.name)) { + propertyName = { computed: false, name: member.name }; + } else if (isPropertyNameLiteral(member.name)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(member.name) }; + } else { + const expression = member.name.expression; + if (isPropertyNameLiteral(expression) && !isIdentifier(expression)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(expression) }; + } else { + enterName(); + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + propertyName = { computed: true, name: referencedName }; + exitName(); + } + } + const context2 = { + kind, + name: propertyName, + static: isStatic(member), + private: isPrivateIdentifier(member.name), + access: { + // 15.7.3 CreateDecoratorAccessObject (kind, name) + // 2. If _kind_ is ~field~, ~method~, ~accessor~, or ~getter~, then ... + get: isPropertyDeclaration(member) || isGetAccessorDeclaration(member) || isMethodDeclaration(member), + // 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ... + set: isPropertyDeclaration(member) || isSetAccessorDeclaration(member) + } + }; + const extraInitializers = isStatic(member) ? (_f = classInfo2.staticExtraInitializersName) != null ? _f : classInfo2.staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */) : (_g = classInfo2.instanceExtraInitializersName) != null ? _g : classInfo2.instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */); + if (isMethodOrAccessor(member)) { + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && createDescriptor) { + descriptor = createDescriptor(member, visitNodes2(modifiers, (node) => tryCast(node, isAsyncModifier), isModifier)); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper(factory2.createThis(), descriptor != null ? descriptor : factory2.createNull(), memberDecoratorsName, context2, factory2.createNull(), extraInitializers); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } else if (isPropertyDeclaration(member)) { + initializersName = (_h = memberInfo.memberInitializersName) != null ? _h : memberInfo.memberInitializersName = createHelperVariable(member, "initializers"); + if (isStatic(member)) { + thisArg = classInfo2.classThis; + } + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && hasAccessorModifier(member) && createDescriptor) { + descriptor = createDescriptor( + member, + /*modifiers*/ + void 0 + ); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper( + isAutoAccessorPropertyDeclaration(member) ? factory2.createThis() : factory2.createNull(), + descriptor != null ? descriptor : factory2.createNull(), + memberDecoratorsName, + context2, + initializersName, + extraInitializers + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } + } + if (name === void 0) { + enterName(); + if (useNamedEvaluation) { + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + } else { + name = visitPropertyName(member.name); + } + exitName(); + } + if (!some(modifiers) && (isMethodDeclaration(member) || isPropertyDeclaration(member))) { + setEmitFlags(name, 1024 /* NoLeadingComments */); + } + return { modifiers, referencedName, name, initializersName, descriptorName, thisArg }; + } + function visitMethodDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createMethodDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createMethodDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateMethodDeclaration( + node, + modifiers, + node.asteriskToken, + name, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitGetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createGetAccessorDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createGetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateGetAccessorDeclaration( + node, + modifiers, + name, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitSetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createSetAccessorDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createSetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateSetAccessorDeclaration(node, modifiers, name, parameters, body), node); + } + } + function visitClassStaticBlockDeclaration(node) { + enterClassElement(node); + if (classInfo) + classInfo.hasStaticInitializers = true; + const result = visitEachChild(node, visitor, context); + exitClassElement(); + return result; + } + function visitPropertyDeclaration(node) { + enterClassElement(node); + Debug.assert(!isAmbientPropertyDeclaration(node), "Not yet implemented."); + const useNamedEvaluation = isNamedEvaluation(node, isAnonymousClassNeedingAssignedName); + const { modifiers, name, referencedName, initializersName, descriptorName, thisArg } = partialTransformClassElement(node, useNamedEvaluation, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0); + startLexicalEnvironment(); + let initializer = referencedName ? visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression) : visitNode(node.initializer, visitor, isExpression); + if (initializersName) { + initializer = emitHelpers().createRunInitializersHelper( + thisArg != null ? thisArg : factory2.createThis(), + initializersName, + initializer != null ? initializer : factory2.createVoidZero() + ); + } + if (!isStatic(node) && (classInfo == null ? void 0 : classInfo.instanceExtraInitializersName) && !(classInfo == null ? void 0 : classInfo.hasInjectedInstanceInitializers)) { + classInfo.hasInjectedInstanceInitializers = true; + initializer != null ? initializer : initializer = factory2.createVoidZero(); + initializer = factory2.createParenthesizedExpression(factory2.createComma( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + classInfo.instanceExtraInitializersName + ), + initializer + )); + } + if (isStatic(node) && classInfo && initializer) { + classInfo.hasStaticInitializers = true; + } + const declarations = endLexicalEnvironment(); + if (some(declarations)) { + initializer = factory2.createImmediatelyInvokedArrowFunction([ + ...declarations, + factory2.createReturnStatement(initializer) + ]); + } + exitClassElement(); + if (hasAccessorModifier(node) && descriptorName) { + const commentRange = getCommentRange(node); + const sourceMapRange = getSourceMapRange(node); + const name2 = node.name; + let getterName = name2; + let setterName = name2; + if (isComputedPropertyName(name2) && !isSimpleInlineableExpression(name2.expression)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name2); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name2, visitNode(name2.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name2, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name2.expression); + const expression = visitNode(name2.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name2.expression); + getterName = factory2.updateComputedPropertyName(name2, assignment); + setterName = factory2.updateComputedPropertyName(name2, temp); + } + } + const modifiersWithoutAccessor = visitNodes2(modifiers, (node2) => node2.kind !== 127 /* AccessorKeyword */ ? node2 : void 0, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiersWithoutAccessor, initializer); + setOriginalNode(backingField, node); + setEmitFlags(backingField, 3072 /* NoComments */); + setSourceMapRange(backingField, sourceMapRange); + setSourceMapRange(backingField.name, node.name); + const getter = createGetAccessorDescriptorForwarder(modifiersWithoutAccessor, getterName, descriptorName); + setOriginalNode(getter, node); + setCommentRange(getter, commentRange); + setSourceMapRange(getter, sourceMapRange); + const setter = createSetAccessorDescriptorForwarder(modifiersWithoutAccessor, setterName, descriptorName); + setOriginalNode(setter, node); + setEmitFlags(setter, 3072 /* NoComments */); + setSourceMapRange(setter, sourceMapRange); + return [backingField, getter, setter]; + } + return finishClassElement(factory2.updatePropertyDeclaration( + node, + modifiers, + name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node); + } + function visitThisExpression(node) { + return classThis != null ? classThis : node; + } + function visitCallExpression(node) { + if (isSuperProperty(node.expression) && classThis) { + const expression = visitNode(node.expression, visitor, isExpression); + const argumentsList = visitNodes2(node.arguments, visitor, isExpression); + const invocation = factory2.createFunctionCallCall(expression, classThis, argumentsList); + setOriginalNode(invocation, node); + setTextRange(invocation, node); + return invocation; + } + return visitEachChild(node, visitor, context); + } + function visitTaggedTemplateExpression(node) { + if (isSuperProperty(node.tag) && classThis) { + const tag = visitNode(node.tag, visitor, isExpression); + const boundTag = factory2.createFunctionBindCall(tag, classThis, []); + setOriginalNode(boundTag, node); + setTextRange(boundTag, node); + const template = visitNode(node.template, visitor, isTemplateLiteral); + return factory2.updateTaggedTemplateExpression( + node, + boundTag, + /*typeArguments*/ + void 0, + template + ); + } + return visitEachChild(node, visitor, context); + } + function visitPropertyAccessExpression(node) { + if (isSuperProperty(node) && isIdentifier(node.name) && classThis && classSuper) { + const propertyName = factory2.createStringLiteralFromNode(node.name); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context); + } + function visitElementAccessExpression(node) { + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = visitNode(node.argumentExpression, visitor, isExpression); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context); + } + function visitParameterDeclaration(node) { + let updated; + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } else { + updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + visitNode(node.name, visitor, isBindingName), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + } + if (updated !== node) { + setCommentRange(updated, node); + setTextRange(updated, moveRangePastModifiers(node)); + setSourceMapRange(updated, moveRangePastModifiers(node)); + setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */); + } + return updated; + } + function isAnonymousClassNeedingAssignedName(node) { + return isClassExpression(node) && !node.name && isDecoratedClassLike(node); + } + function visitForStatement(node) { + return factory2.updateForStatement( + node, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, discardedValueVisitor, isExpression), + visitIterationBody(node.statement, visitor, context) + ); + } + function visitExpressionStatement(node) { + return visitEachChild(node, discardedValueVisitor, context); + } + function visitBinaryExpression(node, discarded) { + if (isDestructuringAssignment(node)) { + const left = visitAssignmentPattern(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression(node)) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isSuperProperty(node.left) && classThis && classSuper) { + let setterName = isElementAccessExpression(node.left) ? visitNode(node.left.argumentExpression, visitor, isExpression) : isIdentifier(node.left.name) ? factory2.createStringLiteralFromNode(node.left.name) : void 0; + if (setterName) { + let expression = visitNode(node.right, visitor, isExpression); + if (isCompoundAssignment(node.operatorToken.kind)) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + const superPropertyGet = factory2.createReflectGetCall( + classSuper, + getterName, + classThis + ); + setOriginalNode(superPropertyGet, node.left); + setTextRange(superPropertyGet, node.left); + expression = factory2.createBinaryExpression( + superPropertyGet, + getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), + expression + ); + setTextRange(expression, node); + } + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + if (temp) { + expression = factory2.createAssignment(temp, expression); + setTextRange(temp, node); + } + expression = factory2.createReflectSetCall( + classSuper, + setterName, + expression, + classThis + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + if (node.operatorToken.kind === 27 /* CommaToken */) { + const left = visitNode(node.left, discardedValueVisitor, isExpression); + const right = visitNode(node.right, discarded ? discardedValueVisitor : visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitEachChild(node, visitor, context); + } + function visitPreOrPostfixUnaryExpression(node, discarded) { + if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { + const operand = skipParentheses(node.operand); + if (isSuperProperty(operand) && classThis && classSuper) { + let setterName = isElementAccessExpression(operand) ? visitNode(operand.argumentExpression, visitor, isExpression) : isIdentifier(operand.name) ? factory2.createStringLiteralFromNode(operand.name) : void 0; + if (setterName) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + let expression = factory2.createReflectGetCall(classSuper, getterName, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); + expression = factory2.createReflectSetCall(classSuper, setterName, expression, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + return visitEachChild(node, visitor, context); + } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + const referencedName = factory2.getGeneratedNameForNode(node); + hoistVariableDeclaration(referencedName); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name }; + } + function visitPropertyName(node) { + if (isComputedPropertyName(node)) { + return visitComputedPropertyName(node); + } + return visitNode(node, visitor, isPropertyName); + } + function visitComputedPropertyName(node) { + let expression = visitNode(node.expression, visitor, isExpression); + if (!isSimpleInlineableExpression(expression)) { + expression = injectPendingExpressions(expression); + } + return factory2.updateComputedPropertyName(node, expression); + } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updatePropertyAssignment(node, name, initializer); + } + return visitEachChild(node, visitor, context); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateVariableDeclaration( + node, + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const propertyName = visitNode(node.propertyName, visitor, isPropertyName); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBindingElement( + node, + /*dotDotDotToken*/ + void 0, + propertyName, + name, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (propertyName) { + const paramName = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const expression = factory2.createAssignmentTargetWrapper( + paramName, + factory2.createReflectSetCall( + classSuper, + propertyName, + paramName, + classThis + ) + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + return expression; + } + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentElement(node) { + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentTarget = visitDestructuringAssignmentTarget(node.left); + let initializer; + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + initializer = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + } else { + initializer = visitNode(node.right, visitor, isExpression); + } + return factory2.updateBinaryExpression(node, assignmentTarget, node.operatorToken, initializer); + } else { + return visitDestructuringAssignmentTarget(node); + } + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentProperty(node) { + const name = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + return visitEachChild(node, visitor, context); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); + const name = visitNode(node.name, visitor, isIdentifier); + const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer); + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + const elements = visitNodes2(node.elements, visitArrayAssignmentElement, isExpression); + return factory2.updateArrayLiteralExpression(node, elements); + } else { + const properties = visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike); + return factory2.updateObjectLiteralExpression(node, properties); + } + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const referencedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updateExportAssignment(node, modifiers, expression); + } + return visitEachChild(node, visitor, context); + } + function visitParenthesizedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function visitPartiallyEmittedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function injectPendingExpressions(expression) { + if (some(pendingExpressions)) { + if (isParenthesizedExpression(expression)) { + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); + } else { + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); + } + pendingExpressions = void 0; + } + return expression; + } + function transformAllDecoratorsOfDeclaration(allDecorators) { + if (!allDecorators) { + return void 0; + } + const decoratorExpressions = []; + addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); + return decoratorExpressions; + } + function transformDecorator(decorator) { + const expression = visitNode(decorator.expression, visitor, isExpression); + setEmitFlags(expression, 3072 /* NoComments */); + return expression; + } + function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) { + const func = factory2.createFunctionExpression( + modifiers, + asteriskToken, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body != null ? body : factory2.createBlock([]) + ); + setOriginalNode(func, original); + setSourceMapRange(func, moveRangePastDecorators(original)); + setEmitFlags(func, 3072 /* NoComments */); + const prefix = kind === "get" || kind === "set" ? kind : void 0; + const functionName = factory2.createStringLiteralFromNode( + name, + /*isSingleQuote*/ + void 0 + ); + const namedFunction = emitHelpers().createSetFunctionNameHelper(func, functionName, prefix); + const method = factory2.createPropertyAssignment(factory2.createIdentifier(kind), namedFunction); + setOriginalNode(method, original); + setSourceMapRange(method, moveRangePastDecorators(original)); + setEmitFlags(method, 3072 /* NoComments */); + return method; + } + function createMethodDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + node.asteriskToken, + "value", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createGetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createSetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createAccessorPropertyDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ) + ) + ]) + ), + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ), + factory2.createIdentifier("value") + ) + ) + ]) + ) + ]); + } + function createMethodDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("value") + ) + ) + ]) + ); + } + function createGetAccessorDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("get") + ), + factory2.createThis(), + [] + ) + ) + ]) + ); + } + function createSetAccessorDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createSetAccessorDeclaration( + modifiers, + name, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("set") + ), + factory2.createThis(), + [factory2.createIdentifier("value")] + ) + ) + ]) + ); + } + function getAssignedNameOfIdentifier(name, initializer) { + const originalClass = getOriginalNode(initializer, isClassLike); + return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); + } + } + var init_esDecorators = __esm({ + "src/compiler/transformers/esDecorators.ts"() { + "use strict"; + init_ts2(); + } + }); + // src/compiler/transformers/es2017.ts function transformES2017(context) { const { @@ -90879,21 +94176,21 @@ ${lanes.join("\n")} node.initializer, /*hasReceiver*/ true - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), visitIterationBody(node.statement, asyncBodyVisitor, context) ); } function visitForOfStatementInAsyncBody(node) { return factory2.updateForOfStatement( node, - visitNode(node.awaitModifier, visitor, isToken), + visitNode(node.awaitModifier, visitor, isAwaitKeyword), isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( node.initializer, /*hasReceiver*/ true - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), visitIterationBody(node.statement, asyncBodyVisitor, context) ); } @@ -90930,7 +94227,7 @@ ${lanes.join("\n")} function visitConstructorDeclaration(node) { return factory2.updateConstructorDeclaration( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), visitParameterList(node.parameters, visitor, context), transformMethodBody(node) ); @@ -90988,7 +94285,7 @@ ${lanes.join("\n")} function visitFunctionExpression(node) { return factory2.updateFunctionExpression( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), node.asteriskToken, node.name, /*typeParameters*/ @@ -91002,7 +94299,7 @@ ${lanes.join("\n")} function visitArrowFunction(node) { return factory2.updateArrowFunction( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), /*typeParameters*/ void 0, visitParameterList(node.parameters, visitor, context), @@ -91059,7 +94356,7 @@ ${lanes.join("\n")} ), node ); - return visitNode(converted, visitor, isExpression); + return Debug.checkDefined(visitNode(converted, visitor, isExpression)); } function collidesWithParameterName({ name }) { if (isIdentifier(name)) { @@ -91191,7 +94488,7 @@ ${lanes.join("\n")} if (isBlock(body)) { return factory2.updateBlock(body, visitNodes2(body.statements, asyncBodyVisitor, isStatement, start)); } else { - return factory2.converters.convertToFunctionBlock(visitNode(body, asyncBodyVisitor, isConciseBody)); + return factory2.converters.convertToFunctionBlock(Debug.checkDefined(visitNode(body, asyncBodyVisitor, isConciseBody))); } } function getPromiseConstructor(type) { @@ -91552,7 +94849,7 @@ ${lanes.join("\n")} return visitObjectLiteralExpression(node); case 223 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 295 /* CatchClause */: return visitCatchClause(node); @@ -92310,7 +95607,7 @@ ${lanes.join("\n")} /*questionToken*/ void 0, visitor, - isToken + isQuestionToken ), /*typeParameters*/ void 0, @@ -93002,15 +96299,10 @@ ${lanes.join("\n")} if ((node.transformFlags & 16 /* ContainsES2021 */) === 0) { return node; } - switch (node.kind) { - case 223 /* BinaryExpression */: - const binaryExpression = node; - if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { - return transformLogicalAssignment(binaryExpression); - } - default: - return visitEachChild(node, visitor, context); + if (isLogicalOrCoalescingAssignmentExpression(node)) { + return transformLogicalAssignment(node); } + return visitEachChild(node, visitor, context); } function transformLogicalAssignment(binaryExpression) { const operator = binaryExpression.operatorToken; @@ -93152,7 +96444,7 @@ ${lanes.join("\n")} factory2.createIdentifier(name), generatedName ); - generatedName.generatedImportReference = specifier; + setIdentifierGeneratedImportReference(generatedName, specifier); specifierSourceImports.set(name, specifier); return generatedName; } @@ -93468,7 +96760,7 @@ ${lanes.join("\n")} return element; } function transformJsxSpreadAttributeToSpreadAssignment(node) { - return factory2.createSpreadAssignment(visitNode(node.expression, visitor, isExpression)); + return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); } function transformJsxAttributesToObjectProps(attrs, children) { const target = getEmitScriptTarget(compilerOptions); @@ -93498,7 +96790,7 @@ ${lanes.join("\n")} return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions); } function transformJsxSpreadAttributeToExpression(node) { - return visitNode(node.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); } function transformJsxAttributeToObjectLiteralElement(node) { const name = getAttributeName(node); @@ -93518,7 +96810,7 @@ ${lanes.join("\n")} if (node.expression === void 0) { return factory2.createTrue(); } - return visitNode(node.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); } if (isJsxElement(node)) { return visitJsxElement( @@ -94042,7 +97334,7 @@ ${lanes.join("\n")} node, /*lookInLabeledStatements*/ false - ) && shouldConvertIterationStatement(node) || (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) !== 0; + ) && shouldConvertIterationStatement(node) || (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { return shouldVisitNode(node) ? visitorWorker( @@ -94173,7 +97465,7 @@ ${lanes.join("\n")} return visitParenthesizedExpression(node, expressionResultIsUnused2); case 223 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -94276,7 +97568,7 @@ ${lanes.join("\n")} [ factory2.createPropertyAssignment( factory2.createIdentifier("value"), - node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() + node.expression ? Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) : factory2.createVoidZero() ) ] ) @@ -94308,7 +97600,7 @@ ${lanes.join("\n")} return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments")); } } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { return setOriginalNode(setTextRange( factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)), node @@ -94447,7 +97739,7 @@ ${lanes.join("\n")} outer, /*typeArguments*/ void 0, - extendsClauseElement ? [visitNode(extendsClauseElement.expression, visitor, isExpression)] : [] + extendsClauseElement ? [Debug.checkDefined(visitNode(extendsClauseElement.expression, visitor, isExpression))] : [] ) ); addSyntheticLeadingComment(result, 3 /* MultiLineCommentTrivia */, "* @class "); @@ -94789,7 +98081,7 @@ ${lanes.join("\n")} factory2.createExpressionStatement( factory2.createAssignment( factory2.getGeneratedNameForNode(parameter), - visitNode(initializer, visitor, isExpression) + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) ) ), 2097152 /* CustomPrologue */ @@ -94800,7 +98092,7 @@ ${lanes.join("\n")} return false; } function insertDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { - initializer = visitNode(initializer, visitor, isExpression); + initializer = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); const statement = factory2.createIfStatement( factory2.createTypeCheck(factory2.cloneNode(name), "undefined"), setEmitFlags( @@ -95076,6 +98368,7 @@ ${lanes.join("\n")} container ); const propertyName = visitNode(member.name, visitor, isPropertyName); + Debug.assert(propertyName); let e; if (!isPrivateIdentifier(propertyName) && getUseDefineForClassFields(context.getCompilerOptions())) { const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; @@ -95119,6 +98412,7 @@ ${lanes.join("\n")} setEmitFlags(target, 3072 /* NoComments */ | 64 /* NoTrailingSourceMap */); setSourceMapRange(target, firstAccessor.name); const visitedAccessorName = visitNode(firstAccessor.name, visitor, isPropertyName); + Debug.assert(visitedAccessorName); if (isPrivateIdentifier(visitedAccessorName)) { return Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015."); } @@ -95391,9 +98685,9 @@ ${lanes.join("\n")} if (node.operatorToken.kind === 27 /* CommaToken */) { return factory2.updateBinaryExpression( node, - visitNode(node.left, visitorWithUnusedExpressionResult, isExpression), + Debug.checkDefined(visitNode(node.left, visitorWithUnusedExpressionResult, isExpression)), node.operatorToken, - visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression) + Debug.checkDefined(visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -95408,6 +98702,7 @@ ${lanes.join("\n")} const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression); if (result || visited !== element) { result || (result = node.elements.slice(0, i)); + Debug.assert(visited); result.push(visited); } } @@ -95415,7 +98710,7 @@ ${lanes.join("\n")} return factory2.updateCommaListExpression(node, elements); } function isVariableStatementOfTypeScriptClassWrapper(node) { - return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getEmitFlags(node.declarationList.declarations[0].initializer) & 67108864 /* TypeScriptClassWrapper */); + return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */); } function visitVariableStatement(node) { const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); @@ -95434,7 +98729,7 @@ ${lanes.join("\n")} 0 /* All */ ); } else { - assignment = factory2.createBinaryExpression(decl.name, 63 /* EqualsToken */, visitNode(decl.initializer, visitor, isExpression)); + assignment = factory2.createBinaryExpression(decl.name, 63 /* EqualsToken */, Debug.checkDefined(visitNode(decl.initializer, visitor, isExpression))); setTextRange(assignment, decl); } assignments = append(assignments, assignment); @@ -95456,7 +98751,7 @@ ${lanes.join("\n")} if (node.flags & 3 /* BlockScoped */) { enableSubstitutionsForBlockScopedBindings(); } - const declarations = flatMap(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration); + const declarations = visitNodes2(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration, isVariableDeclaration); const declarationList = factory2.createVariableDeclarationList(declarations); setOriginalNode(declarationList, node); setTextRange(declarationList, node); @@ -95540,7 +98835,7 @@ ${lanes.join("\n")} statement, /*outermostLabeledStatement*/ node - ) : factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node, convertedLoopState && resetLabel); + ) : factory2.restoreEnclosingLabel(Debug.checkDefined(visitNode(statement, visitor, isStatement, factory2.liftToBlock)), node, convertedLoopState && resetLabel); } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { @@ -95583,7 +98878,7 @@ ${lanes.join("\n")} visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer), visitNode(node.condition, visitor, isExpression), visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression), - visitNode(node.statement, visitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) ); } function visitForInStatement(node, outermostLabeledStatement) { @@ -95669,13 +98964,14 @@ ${lanes.join("\n")} ))); } else { setTextRangeEnd(assignment, initializer.end); - statements.push(setTextRange(factory2.createExpressionStatement(visitNode(assignment, visitor, isExpression)), moveRangeEnd(initializer, -1))); + statements.push(setTextRange(factory2.createExpressionStatement(Debug.checkDefined(visitNode(assignment, visitor, isExpression))), moveRangeEnd(initializer, -1))); } } if (convertedLoopBodyStatements) { return createSyntheticBlockForConvertedStatements(addRange(statements, convertedLoopBodyStatements)); } else { const statement = visitNode(node.statement, visitor, isStatement, factory2.liftToBlock); + Debug.assert(statement); if (isBlock(statement)) { return factory2.updateBlock(statement, setTextRange(factory2.createNodeArray(concatenate(statements, statement.statements)), statement.statements)); } else { @@ -95696,6 +98992,7 @@ ${lanes.join("\n")} } function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const counter = factory2.createLoopVariable(); const rhsReference = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( /*recordTempVariable*/ @@ -95755,6 +99052,7 @@ ${lanes.join("\n")} } function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const iterator = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( /*recordTempVariable*/ void 0 @@ -96012,7 +99310,7 @@ ${lanes.join("\n")} loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); } } else { - const clone2 = convertIterationStatementCore(node, initializerFunction, visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)); + const clone2 = convertIterationStatementCore(node, initializerFunction, Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))); loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); } statements.push(loop); @@ -96050,16 +99348,16 @@ ${lanes.join("\n")} node, /*awaitModifier*/ void 0, - visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } function convertForInStatement(node, convertedLoopBody) { return factory2.updateForInStatement( node, - visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } @@ -96067,13 +99365,13 @@ ${lanes.join("\n")} return factory2.updateDoStatement( node, convertedLoopBody, - visitNode(node.expression, visitor, isExpression) + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) ); } function convertWhileStatement(node, convertedLoopBody) { return factory2.updateWhileStatement( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } @@ -96235,7 +99533,7 @@ ${lanes.join("\n")} void 0, /*type*/ void 0, - visitNode( + Debug.checkDefined(visitNode( factory2.createBlock( statements, /*multiLine*/ @@ -96243,7 +99541,7 @@ ${lanes.join("\n")} ), visitor, isBlock - ) + )) ), emitFlags ) @@ -96266,7 +99564,7 @@ ${lanes.join("\n")} if (node.incrementor) { statements.push(factory2.createIfStatement( currentState.conditionVariable, - factory2.createExpressionStatement(visitNode(node.incrementor, visitor, isExpression)), + factory2.createExpressionStatement(Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression))), factory2.createExpressionStatement(factory2.createAssignment(currentState.conditionVariable, factory2.createTrue())) )); } else { @@ -96277,11 +99575,12 @@ ${lanes.join("\n")} } if (shouldConvertConditionOfForStatement(node)) { statements.push(factory2.createIfStatement( - factory2.createPrefixUnaryExpression(53 /* ExclamationToken */, visitNode(node.condition, visitor, isExpression)), - visitNode(factory2.createBreakStatement(), visitor, isStatement) + factory2.createPrefixUnaryExpression(53 /* ExclamationToken */, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))), + Debug.checkDefined(visitNode(factory2.createBreakStatement(), visitor, isStatement)) )); } } + Debug.assert(statement); if (isBlock(statement)) { addRange(statements, statement.statements); } else { @@ -96549,9 +99848,9 @@ ${lanes.join("\n")} createMemberAccessForPropertyName( factory2, receiver, - visitNode(property.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) ), - visitNode(property.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(property.initializer, visitor, isExpression)) ); setTextRange(expression, property); if (startsOnNewLine) { @@ -96564,7 +99863,7 @@ ${lanes.join("\n")} createMemberAccessForPropertyName( factory2, receiver, - visitNode(property.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) ), factory2.cloneNode(property.name) ); @@ -96579,7 +99878,7 @@ ${lanes.join("\n")} createMemberAccessForPropertyName( factory2, receiver, - visitNode(method.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(method.name, visitor, isPropertyName)) ), transformFunctionLikeToExpression( method, @@ -96700,7 +99999,7 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitCallExpression(node) { - if (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) { + if (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) { return visitTypeScriptClassWrapper(node); } const expression = skipOuterExpressions(node.expression); @@ -96713,7 +100012,7 @@ ${lanes.join("\n")} } return factory2.updateCallExpression( node, - visitNode(node.expression, callExpressionVisitor, isExpression), + Debug.checkDefined(visitNode(node.expression, callExpressionVisitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -96765,7 +100064,14 @@ ${lanes.join("\n")} if (classBodyEnd < -1) { addRange(statements, funcStatements, classBodyEnd + 1); } - addRange(statements, remainingStatements); + const returnStatement = tryCast(elementAt(funcStatements, classBodyEnd), isReturnStatement); + for (const statement of remainingStatements) { + if (isReturnStatement(statement) && (returnStatement == null ? void 0 : returnStatement.expression) && !isIdentifier(returnStatement.expression)) { + statements.push(returnStatement); + } else { + statements.push(statement); + } + } addRange( statements, classStatements, @@ -96825,8 +100131,8 @@ ${lanes.join("\n")} let resultingCall; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { resultingCall = factory2.createFunctionApplyCall( - visitNode(target, callExpressionVisitor, isExpression), - node.expression.kind === 106 /* SuperKeyword */ ? thisArg : visitNode(thisArg, visitor, isExpression), + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 106 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), transformAndSpreadElements( node.arguments, /*isArgumentList*/ @@ -96840,8 +100146,8 @@ ${lanes.join("\n")} } else { resultingCall = setTextRange( factory2.createFunctionCallCall( - visitNode(target, callExpressionVisitor, isExpression), - node.expression.kind === 106 /* SuperKeyword */ ? thisArg : visitNode(thisArg, visitor, isExpression), + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 106 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), visitNodes2(node.arguments, visitor, isExpression) ), node @@ -96863,7 +100169,7 @@ ${lanes.join("\n")} const { target, thisArg } = factory2.createCallBinding(factory2.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration); return factory2.createNewExpression( factory2.createFunctionApplyCall( - visitNode(target, visitor, isExpression), + Debug.checkDefined(visitNode(target, visitor, isExpression)), thisArg, transformAndSpreadElements( factory2.createNodeArray([factory2.createVoidZero(), ...node.arguments]), @@ -96920,7 +100226,9 @@ ${lanes.join("\n")} return map(chunk, visitExpressionOfSpread); } function visitExpressionOfSpread(node) { + Debug.assertNode(node, isSpreadElement); let expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const isCallToReadHelper = isCallToHelper(expression, "___read"); let kind = isCallToReadHelper || isPackedArrayLiteral(expression) ? 2 /* PackedSpread */ : 1 /* UnpackedSpread */; if (compilerOptions.downlevelIteration && kind === 1 /* UnpackedSpread */ && !isArrayLiteralExpression(expression) && !isCallToReadHelper) { @@ -96971,7 +100279,7 @@ ${lanes.join("\n")} function visitTemplateExpression(node) { let expression = factory2.createStringLiteral(node.head.text); for (const span of node.templateSpans) { - const args = [visitNode(span.expression, visitor, isExpression)]; + const args = [Debug.checkDefined(visitNode(span.expression, visitor, isExpression))]; if (span.literal.text.length > 0) { args.push(factory2.createStringLiteral(span.literal.text)); } @@ -97195,7 +100503,7 @@ ${lanes.join("\n")} return node; } function trySubstituteReservedName(name) { - const token = name.originalKeywordKind || (nodeIsSynthesized(name) ? stringToToken(idText(name)) : void 0); + const token = identifierToKeywordKind(name); if (token !== void 0 && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) { return setTextRange(factory2.createStringLiteralFromNode(name), name); } @@ -97337,7 +100645,7 @@ ${lanes.join("\n")} switch (node.kind) { case 223 /* BinaryExpression */: return visitBinaryExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node); case 224 /* ConditionalExpression */: return visitConditionalExpression(node); @@ -97549,19 +100857,19 @@ ${lanes.join("\n")} case 208 /* PropertyAccessExpression */: target = factory2.updatePropertyAccessExpression( left, - cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)), + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), left.name ); break; case 209 /* ElementAccessExpression */: target = factory2.updateElementAccessExpression( left, - cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)), - cacheExpression(visitNode(left.argumentExpression, visitor, isExpression)) + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), + cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression))) ); break; default: - target = visitNode(left, visitor, isExpression); + target = Debug.checkDefined(visitNode(left, visitor, isExpression)); break; } const operator = node.operatorToken.kind; @@ -97573,7 +100881,7 @@ ${lanes.join("\n")} factory2.createBinaryExpression( cacheExpression(target), getNonAssignmentOperatorForCompoundAssignment(operator), - visitNode(right, visitor, isExpression) + Debug.checkDefined(visitNode(right, visitor, isExpression)) ), node ) @@ -97581,7 +100889,7 @@ ${lanes.join("\n")} node ); } else { - return factory2.updateBinaryExpression(node, target, node.operatorToken, visitNode(right, visitor, isExpression)); + return factory2.updateBinaryExpression(node, target, node.operatorToken, Debug.checkDefined(visitNode(right, visitor, isExpression))); } } return visitEachChild(node, visitor, context); @@ -97595,9 +100903,9 @@ ${lanes.join("\n")} } return factory2.updateBinaryExpression( node, - cacheExpression(visitNode(node.left, visitor, isExpression)), + cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))), node.operatorToken, - visitNode(node.right, visitor, isExpression) + Debug.checkDefined(visitNode(node.right, visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -97616,7 +100924,7 @@ ${lanes.join("\n")} emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); pendingExpressions = []; } - pendingExpressions.push(visitNode(node2, visitor, isExpression)); + pendingExpressions.push(Debug.checkDefined(visitNode(node2, visitor, isExpression))); } } } @@ -97630,7 +100938,7 @@ ${lanes.join("\n")} emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); pendingExpressions = []; } - pendingExpressions.push(visitNode(elem, visitor, isExpression)); + pendingExpressions.push(Debug.checkDefined(visitNode(elem, visitor, isExpression))); } } return factory2.inlineExpressions(pendingExpressions); @@ -97640,7 +100948,7 @@ ${lanes.join("\n")} const resultLocal = declareLocal(); emitAssignment( resultLocal, - visitNode(node.left, visitor, isExpression), + Debug.checkDefined(visitNode(node.left, visitor, isExpression)), /*location*/ node.left ); @@ -97661,7 +100969,7 @@ ${lanes.join("\n")} } emitAssignment( resultLocal, - visitNode(node.right, visitor, isExpression), + Debug.checkDefined(visitNode(node.right, visitor, isExpression)), /*location*/ node.right ); @@ -97675,13 +100983,13 @@ ${lanes.join("\n")} const resultLocal = declareLocal(); emitBreakWhenFalse( whenFalseLabel, - visitNode(node.condition, visitor, isExpression), + Debug.checkDefined(visitNode(node.condition, visitor, isExpression)), /*location*/ node.condition ); emitAssignment( resultLocal, - visitNode(node.whenTrue, visitor, isExpression), + Debug.checkDefined(visitNode(node.whenTrue, visitor, isExpression)), /*location*/ node.whenTrue ); @@ -97689,7 +100997,7 @@ ${lanes.join("\n")} markLabel(whenFalseLabel); emitAssignment( resultLocal, - visitNode(node.whenFalse, visitor, isExpression), + Debug.checkDefined(visitNode(node.whenFalse, visitor, isExpression)), /*location*/ node.whenFalse ); @@ -97769,7 +101077,7 @@ ${lanes.join("\n")} leadingElement = void 0; expressions2 = []; } - expressions2.push(visitNode(element, visitor, isExpression)); + expressions2.push(Debug.checkDefined(visitNode(element, visitor, isExpression))); return expressions2; } } @@ -97808,8 +101116,8 @@ ${lanes.join("\n")} if (containsYield(node.argumentExpression)) { return factory2.updateElementAccessExpression( node, - cacheExpression(visitNode(node.expression, visitor, isLeftHandSideExpression)), - visitNode(node.argumentExpression, visitor, isExpression) + cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))), + Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -97826,7 +101134,7 @@ ${lanes.join("\n")} return setOriginalNode( setTextRange( factory2.createFunctionApplyCall( - cacheExpression(visitNode(target, visitor, isLeftHandSideExpression)), + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isLeftHandSideExpression))), thisArg, visitElements(node.arguments) ), @@ -97844,7 +101152,7 @@ ${lanes.join("\n")} setTextRange( factory2.createNewExpression( factory2.createFunctionApplyCall( - cacheExpression(visitNode(target, visitor, isExpression)), + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isExpression))), thisArg, visitElements( node.arguments, @@ -97960,7 +101268,7 @@ ${lanes.join("\n")} return setSourceMapRange( factory2.createAssignment( setSourceMapRange(factory2.cloneNode(node.name), node.name), - visitNode(node.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) ), node ); @@ -97972,7 +101280,7 @@ ${lanes.join("\n")} const elseLabel = node.elseStatement ? defineLabel() : void 0; emitBreakWhenFalse( node.elseStatement ? elseLabel : endLabel, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*location*/ node.expression ); @@ -98001,7 +101309,7 @@ ${lanes.join("\n")} markLabel(loopLabel); transformAndEmitEmbeddedStatement(node.statement); markLabel(conditionLabel); - emitBreakWhenTrue(loopLabel, visitNode(node.expression, visitor, isExpression)); + emitBreakWhenTrue(loopLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); endLoopBlock(); } else { emitStatement(visitNode(node, visitor, isStatement)); @@ -98022,7 +101330,7 @@ ${lanes.join("\n")} const loopLabel = defineLabel(); const endLabel = beginLoopBlock(loopLabel); markLabel(loopLabel); - emitBreakWhenFalse(endLabel, visitNode(node.expression, visitor, isExpression)); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); transformAndEmitEmbeddedStatement(node.statement); emitBreak(loopLabel); endLoopBlock(); @@ -98053,7 +101361,7 @@ ${lanes.join("\n")} emitStatement( setTextRange( factory2.createExpressionStatement( - visitNode(initializer, visitor, isExpression) + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) ), initializer ) @@ -98062,7 +101370,7 @@ ${lanes.join("\n")} } markLabel(conditionLabel); if (node.condition) { - emitBreakWhenFalse(endLabel, visitNode(node.condition, visitor, isExpression)); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))); } transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); @@ -98070,7 +101378,7 @@ ${lanes.join("\n")} emitStatement( setTextRange( factory2.createExpressionStatement( - visitNode(node.incrementor, visitor, isExpression) + Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression)) ), node.incrementor ) @@ -98115,7 +101423,7 @@ ${lanes.join("\n")} const keysIndex = factory2.createLoopVariable(); const initializer = node.initializer; hoistVariableDeclaration(keysIndex); - emitAssignment(obj, visitNode(node.expression, visitor, isExpression)); + emitAssignment(obj, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); emitAssignment(keysArray, factory2.createArrayLiteralExpression()); emitStatement( factory2.createForInStatement( @@ -98146,7 +101454,7 @@ ${lanes.join("\n")} } variable = factory2.cloneNode(initializer.declarations[0].name); } else { - variable = visitNode(initializer, visitor, isExpression); + variable = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); Debug.assert(isLeftHandSideExpression(variable)); } emitAssignment(variable, key); @@ -98171,8 +101479,8 @@ ${lanes.join("\n")} node = factory2.updateForInStatement( node, initializer.declarations[0].name, - visitNode(node.expression, visitor, isExpression), - visitNode(node.statement, visitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) ); } else { node = visitEachChild(node, visitor, context); @@ -98248,7 +101556,7 @@ ${lanes.join("\n")} } function transformAndEmitWithStatement(node) { if (containsYield(node)) { - beginWithBlock(cacheExpression(visitNode(node.expression, visitor, isExpression))); + beginWithBlock(cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)))); transformAndEmitEmbeddedStatement(node.statement); endWithBlock(); } else { @@ -98260,7 +101568,7 @@ ${lanes.join("\n")} const caseBlock = node.caseBlock; const numClauses = caseBlock.clauses.length; const endLabel = beginSwitchBlock(); - const expression = cacheExpression(visitNode(node.expression, visitor, isExpression)); + const expression = cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); const clauseLabels = []; let defaultClauseIndex = -1; for (let i = 0; i < numClauses; i++) { @@ -98282,7 +101590,7 @@ ${lanes.join("\n")} } pendingClauses.push( factory2.createCaseClause( - visitNode(clause.expression, visitor, isExpression), + Debug.checkDefined(visitNode(clause.expression, visitor, isExpression)), [ createInlineBreak( clauseLabels[i], @@ -98352,7 +101660,7 @@ ${lanes.join("\n")} function transformAndEmitThrowStatement(node) { var _a2; emitThrow( - visitNode((_a2 = node.expression) != null ? _a2 : factory2.createVoidZero(), visitor, isExpression), + Debug.checkDefined(visitNode((_a2 = node.expression) != null ? _a2 : factory2.createVoidZero(), visitor, isExpression)), /*location*/ node ); @@ -98708,7 +102016,7 @@ ${lanes.join("\n")} } return 0; } - function createLabel2(label) { + function createLabel(label) { if (label !== void 0 && label > 0) { if (labelExpressions === void 0) { labelExpressions = []; @@ -98734,7 +102042,7 @@ ${lanes.join("\n")} factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), location @@ -98939,10 +102247,10 @@ ${lanes.join("\n")} void 0, [ factory2.createArrayLiteralExpression([ - createLabel2(startLabel), - createLabel2(catchLabel), - createLabel2(finallyLabel), - createLabel2(endLabel) + createLabel(startLabel), + createLabel(catchLabel), + createLabel(finallyLabel), + createLabel(endLabel) ]) ] ) @@ -99118,7 +102426,7 @@ ${lanes.join("\n")} factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -99137,7 +102445,7 @@ ${lanes.join("\n")} factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -99159,7 +102467,7 @@ ${lanes.join("\n")} factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -99642,7 +102950,7 @@ ${lanes.join("\n")} } function addExportEqualsIfNeeded(statements, emitAsReturn) { if (currentModuleInfo.exportEquals) { - const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor); + const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor, isExpression); if (expressionResult) { if (emitAsReturn) { const statement = factory2.createReturnStatement(expressionResult); @@ -99682,9 +102990,9 @@ ${lanes.join("\n")} return visitFunctionDeclaration(node); case 260 /* ClassDeclaration */: return visitClassDeclaration(node); - case 357 /* MergeDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 358 /* EndOfDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return visitor(node); @@ -99701,7 +103009,7 @@ ${lanes.join("\n")} return visitExpressionStatement(node); case 214 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); case 210 /* CallExpression */: if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) { @@ -99837,7 +103145,7 @@ ${lanes.join("\n")} } function visitImportCallExpression(node) { const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; const containsLexicalThis = !!(node.transformFlags & 16384 /* ContainsLexicalThis */); switch (compilerOptions.module) { @@ -100046,7 +103354,7 @@ ${lanes.join("\n")} return downleveledImport; } function getHelperExpressionForExport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { return innerExpr; } if (getExportNeedsImportStarHelper(node)) { @@ -100055,7 +103363,7 @@ ${lanes.join("\n")} return innerExpr; } function getHelperExpressionForImport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { return innerExpr; } if (getImportNeedsImportStarHelper(node)) { @@ -100300,7 +103608,7 @@ ${lanes.join("\n")} ) ); } else { - const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default"; + const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default"; const exportedValue = factory2.createPropertyAccessExpression( exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, specifier.propertyName || specifier.name @@ -100366,7 +103674,7 @@ ${lanes.join("\n")} deferredExports[id] = appendExportStatement( deferredExports[id], factory2.createIdentifier("default"), - visitNode(node.expression, visitor), + visitNode(node.expression, visitor, isExpression), /*location*/ node, /*allowComments*/ @@ -100376,7 +103684,7 @@ ${lanes.join("\n")} statements = appendExportStatement( statements, factory2.createIdentifier("default"), - visitNode(node.expression, visitor), + visitNode(node.expression, visitor, isExpression), /*location*/ node, /*allowComments*/ @@ -100404,7 +103712,7 @@ ${lanes.join("\n")} ), /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitEachChild(node.body, visitor, context) @@ -100445,8 +103753,8 @@ ${lanes.join("\n")} ), /*typeParameters*/ void 0, - visitNodes2(node.heritageClauses, visitor), - visitNodes2(node.members, visitor) + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + visitNodes2(node.members, visitor, isClassElement) ), node ), @@ -100476,7 +103784,23 @@ ${lanes.join("\n")} if (!modifiers) { modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); } - variables = append(variables, variable); + if (variable.initializer) { + const updatedVariable = factory2.updateVariableDeclaration( + variable, + variable.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createExportExpression( + variable.name, + visitNode(variable.initializer, visitor, isExpression) + ) + ); + variables = append(variables, updatedVariable); + } else { + variables = append(variables, variable); + } } else if (variable.initializer) { if (!isBindingPattern(variable.name) && (isArrowFunction(variable.initializer) || isFunctionExpression(variable.initializer) || isClassExpression(variable.initializer))) { const expression = factory2.createAssignment( @@ -100494,7 +103818,7 @@ ${lanes.join("\n")} variable.name, variable.exclamationToken, variable.type, - visitNode(variable.initializer, visitor) + visitNode(variable.initializer, visitor, isExpression) ); variables = append(variables, updatedVariable); expressions = append(expressions, expression); @@ -100545,9 +103869,8 @@ ${lanes.join("\n")} function transformInitializedVariable(node) { if (isBindingPattern(node.name)) { return flattenDestructuringAssignment( - visitNode(node, visitor), - /*visitor*/ - void 0, + visitNode(node, visitor, isInitializedVariable), + visitor, context, 0 /* All */, /*needsValue*/ @@ -100564,7 +103887,7 @@ ${lanes.join("\n")} /*location*/ node.name ), - node.initializer ? visitNode(node.initializer, visitor) : factory2.createVoidZero() + node.initializer ? visitNode(node.initializer, visitor, isExpression) : factory2.createVoidZero() ); } } @@ -100834,7 +104157,7 @@ ${lanes.join("\n")} const expression = substituteExpressionIdentifier(node.expression); noSubstitution[getNodeId(expression)] = true; if (!isIdentifier(expression) && !(getEmitFlags(node.expression) & 8192 /* HelperName */)) { - return addEmitFlags( + return addInternalEmitFlags( factory2.updateCallExpression( node, expression, @@ -100842,7 +104165,7 @@ ${lanes.join("\n")} void 0, node.arguments ), - 1073741824 /* IndirectCall */ + 16 /* IndirectCall */ ); } } @@ -100853,7 +104176,7 @@ ${lanes.join("\n")} const tag = substituteExpressionIdentifier(node.tag); noSubstitution[getNodeId(tag)] = true; if (!isIdentifier(tag) && !(getEmitFlags(node.tag) & 8192 /* HelperName */)) { - return addEmitFlags( + return addInternalEmitFlags( factory2.updateTaggedTemplateExpression( node, tag, @@ -100861,7 +104184,7 @@ ${lanes.join("\n")} void 0, node.template ), - 1073741824 /* IndirectCall */ + 16 /* IndirectCall */ ); } } @@ -100875,7 +104198,7 @@ ${lanes.join("\n")} return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); } return node; - } else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { + } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node)); if (exportContainer && exportContainer.kind === 308 /* SourceFile */) { return setTextRange( @@ -101514,7 +104837,7 @@ ${lanes.join("\n")} ), /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -101611,7 +104934,7 @@ ${lanes.join("\n")} return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 308 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { - const createAssignment3 = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; + const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; return isBindingPattern(node.name) ? flattenDestructuringAssignment( node, visitor, @@ -101619,8 +104942,8 @@ ${lanes.join("\n")} 0 /* All */, /*needsValue*/ false, - createAssignment3 - ) : node.initializer ? createAssignment3(node.name, visitNode(node.initializer, visitor, isExpression)) : node.name; + createAssignment + ) : node.initializer ? createAssignment(node.name, visitNode(node.initializer, visitor, isExpression)) : node.name; } function createExportedVariableAssignment(name, value, location) { return createVariableAssignment( @@ -101824,9 +105147,9 @@ ${lanes.join("\n")} return visitCatchClause(node); case 238 /* Block */: return visitBlock(node); - case 357 /* MergeDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 358 /* EndOfDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return visitor(node); @@ -101888,7 +105211,7 @@ ${lanes.join("\n")} } return expressions ? factory2.inlineExpressions(expressions) : factory2.createOmittedExpression(); } else { - return visitNode(node, discardedValueVisitor, isExpression); + return visitNode(node, discardedValueVisitor, isForInitializer); } } function visitDoStatement(node) { @@ -101909,21 +105232,21 @@ ${lanes.join("\n")} return factory2.updateLabeledStatement( node, node.label, - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) ); } function visitWithStatement(node) { return factory2.updateWithStatement( node, visitNode(node.expression, visitor, isExpression), - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) ); } function visitSwitchStatement(node) { return factory2.updateSwitchStatement( node, visitNode(node.expression, visitor, isExpression), - visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock) + Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock)) ); } function visitCaseBlock(node) { @@ -101955,7 +105278,7 @@ ${lanes.join("\n")} node = factory2.updateCatchClause( node, node.variableDeclaration, - visitNode(node.block, topLevelNestedVisitor, isBlock) + Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock)) ); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; @@ -101982,7 +105305,7 @@ ${lanes.join("\n")} return visitExpressionStatement(node); case 214 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); case 223 /* BinaryExpression */: if (isDestructuringAssignment(node)) { @@ -102025,7 +105348,7 @@ ${lanes.join("\n")} } function visitImportCallExpression(node) { const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; return factory2.createCallExpression( factory2.createPropertyAccessExpression( @@ -103169,7 +106492,7 @@ ${lanes.join("\n")} sourceFile, /*bundled*/ true - )) : visitNodes2(sourceFile.statements, visitDeclarationStatements); + )) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); const newFile = factory2.updateSourceFile( sourceFile, [factory2.createModuleDeclaration( @@ -103191,7 +106514,7 @@ ${lanes.join("\n")} return newFile; } needsDeclare = true; - const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements); + const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); return factory2.updateSourceFile( sourceFile, transformAndReplaceLatePaintedStatements(updated2), @@ -103260,7 +106583,7 @@ ${lanes.join("\n")} refs.forEach(referenceVisitor); emittedImports = filter(combinedStatements, isAnyImportSyntax); } else { - const statements = visitNodes2(node.statements, visitDeclarationStatements); + const statements = visitNodes2(node.statements, visitDeclarationStatements, isStatement); combinedStatements = setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements); refs.forEach(referenceVisitor); emittedImports = filter(combinedStatements, isAnyImportSyntax); @@ -103377,9 +106700,9 @@ ${lanes.join("\n")} return name; } else { if (name.kind === 204 /* ArrayBindingPattern */) { - return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement)); + return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement)); } else { - return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement)); + return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement)); } } function visitBindingElement(elem) { @@ -103449,10 +106772,10 @@ ${lanes.join("\n")} } const shouldUseResolverType = node.kind === 166 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { - return visitNode(type, visitDeclarationSubtree); + return visitNode(type, visitDeclarationSubtree, isTypeNode); } if (!getParseTreeNode(node)) { - return type ? visitNode(type, visitDeclarationSubtree) : factory2.createKeywordTypeNode(131 /* AnyKeyword */); + return type ? visitNode(type, visitDeclarationSubtree, isTypeNode) : factory2.createKeywordTypeNode(131 /* AnyKeyword */); } if (node.kind === 175 /* SetAccessor */) { return factory2.createKeywordTypeNode(131 /* AnyKeyword */); @@ -103522,11 +106845,11 @@ ${lanes.join("\n")} } function updateParamsList(node, params, modifierMask) { if (hasEffectiveModifier(node, 8 /* Private */)) { - return void 0; + return factory2.createNodeArray(); } const newParams = map(params, (p) => ensureParameter(p, modifierMask)); if (!newParams) { - return void 0; + return factory2.createNodeArray(); } return factory2.createNodeArray(newParams, params.hasTrailingComma); } @@ -103566,7 +106889,7 @@ ${lanes.join("\n")} return factory2.createNodeArray(newParams || emptyArray); } function ensureTypeParams(node, params) { - return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree); + return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration); } function isEnclosingDeclaration(node) { return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node); @@ -103701,7 +107024,7 @@ ${lanes.join("\n")} needsDeclare = priorNeedsDeclare; lateStatementReplacementMap.set(getOriginalNodeId(i), result); } - return visitNodes2(statements, visitLateVisibilityMarkedStatements); + return visitNodes2(statements, visitLateVisibilityMarkedStatements, isStatement); function visitLateVisibilityMarkedStatements(statement) { if (isLateVisibilityPaintedStatement(statement)) { const key = getOriginalNodeId(statement); @@ -103915,7 +107238,7 @@ ${lanes.join("\n")} input, ensureModifiers(input), updateParamsList(input, input.parameters), - visitNode(input.type, visitDeclarationSubtree) || factory2.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode(131 /* AnyKeyword */) )); } case 257 /* VariableDeclaration */: { @@ -103948,20 +107271,24 @@ ${lanes.join("\n")} return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); } case 191 /* ConditionalType */: { - const checkType = visitNode(input.checkType, visitDeclarationSubtree); - const extendsType = visitNode(input.extendsType, visitDeclarationSubtree); + const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); + const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); const oldEnclosingDecl = enclosingDeclaration; enclosingDeclaration = input.trueType; - const trueType = visitNode(input.trueType, visitDeclarationSubtree); + const trueType = visitNode(input.trueType, visitDeclarationSubtree, isTypeNode); enclosingDeclaration = oldEnclosingDecl; - const falseType = visitNode(input.falseType, visitDeclarationSubtree); + const falseType = visitNode(input.falseType, visitDeclarationSubtree, isTypeNode); + Debug.assert(checkType); + Debug.assert(extendsType); + Debug.assert(trueType); + Debug.assert(falseType); return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } case 181 /* FunctionType */: { - return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree))); + return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); } case 182 /* ConstructorType */: { - return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree))); + return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); } case 202 /* ImportType */: { if (!isLiteralImportTypeNode(input)) @@ -104105,7 +107432,7 @@ ${lanes.join("\n")} ensureModifiers(input), input.name, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), - visitNode(input.type, visitDeclarationSubtree, isTypeNode) + Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) )); needsDeclare = previousNeedsDeclare; return clean2; @@ -104117,7 +107444,7 @@ ${lanes.join("\n")} input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), - visitNodes2(input.members, visitDeclarationSubtree) + visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) )); } case 259 /* FunctionDeclaration */: { @@ -104234,7 +107561,7 @@ ${lanes.join("\n")} const oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; needsScopeFixMarker = false; - const statements = visitNodes2(inner.statements, visitDeclarationStatements); + const statements = visitNodes2(inner.statements, visitDeclarationStatements, isStatement); let lateStatements = transformAndReplaceLatePaintedStatements(statements); if (input.flags & 16777216 /* Ambient */) { needsScopeFixMarker = false; @@ -104243,7 +107570,7 @@ ${lanes.join("\n")} if (needsScopeFixMarker) { lateStatements = factory2.createNodeArray([...lateStatements, createEmptyExports(factory2)]); } else { - lateStatements = visitNodes2(lateStatements, stripExportModifiers); + lateStatements = visitNodes2(lateStatements, stripExportModifiers, isStatement); } } const body = factory2.updateModuleBlock(inner, lateStatements); @@ -104339,7 +107666,7 @@ ${lanes.join("\n")} void 0 ) ] : void 0; - const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree)); + const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement)); const members = factory2.createNodeArray(memberNodes); const extendsClause = getEffectiveBaseTypeNode(input); if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 104 /* NullKeyword */) { @@ -104363,11 +107690,11 @@ ${lanes.join("\n")} if (clause.token === 94 /* ExtendsKeyword */) { const oldDiag2 = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]); - const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree)))); + const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree, isTypeNode)))); getSymbolAccessibilityDiagnostic = oldDiag2; return newClause; } - return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */)), visitDeclarationSubtree)); + return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */)), visitDeclarationSubtree, isExpressionWithTypeArguments)); })); return [statement, cleanup(factory2.updateClassDeclaration( input, @@ -104423,7 +107750,7 @@ ${lanes.join("\n")} function transformVariableStatement(input) { if (!forEach(input.declarationList.declarations, getBindingNameVisible)) return; - const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree); + const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree, isVariableDeclaration); if (!length(nodes)) return; return factory2.updateVariableStatement(input, factory2.createNodeArray(ensureModifiers(input)), factory2.updateVariableDeclarationList(input.declarationList, nodes)); @@ -104514,7 +107841,7 @@ ${lanes.join("\n")} function transformHeritageClauses(nodes) { return factory2.createNodeArray(filter(map(nodes, (clause) => factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => { return isEntityNameExpression(t.expression) || clause.token === 94 /* ExtendsKeyword */ && t.expression.kind === 104 /* NullKeyword */; - })), visitDeclarationSubtree))), (clause) => clause.types && !!clause.types.length)); + })), visitDeclarationSubtree, isExpressionWithTypeArguments))), (clause) => clause.types && !!clause.types.length)); } } function isAlwaysType(node) { @@ -104631,10 +107958,15 @@ ${lanes.join("\n")} return emptyArray; const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); const transformers = []; addRange(transformers, customTransformers && map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(transformTypeScript); - transformers.push(transformLegacyDecorators); + if (compilerOptions.experimentalDecorators) { + transformers.push(transformLegacyDecorators); + } else if (languageVersion < 99 /* ESNext */ || !useDefineForClassFields) { + transformers.push(transformESDecorators); + } transformers.push(transformClassFields); if (getJSXTransformEnabled(compilerOptions)) { transformers.push(transformJsx); @@ -104700,7 +108032,7 @@ ${lanes.join("\n")} } function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { var _a2, _b; - const enabledSyntaxKindFeatures = new Array(360 /* Count */); + const enabledSyntaxKindFeatures = new Array(361 /* Count */); let lexicalEnvironmentVariableDeclarations; let lexicalEnvironmentFunctionDeclarations; let lexicalEnvironmentStatements; @@ -105270,7 +108602,7 @@ ${lanes.join("\n")} const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; const emitterDiagnostics = createDiagnosticCollection(); - const newLine = getNewLineCharacter(compilerOptions, () => host.getNewLine()); + const newLine = getNewLineCharacter(compilerOptions); const writer = createTextWriter(newLine); const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); let bundleBuildInfo; @@ -105727,7 +109059,6 @@ ${lanes.join("\n")} getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory), getCompilerOptions: () => config.options, getCurrentDirectory: () => host.getCurrentDirectory(), - getNewLine: () => host.getNewLine(), getSourceFile: returnUndefined, getSourceFileByPath: returnUndefined, getSourceFiles: () => sourceFilesForJsEmit, @@ -105813,6 +109144,7 @@ ${lanes.join("\n")} const bundledHelpers = /* @__PURE__ */ new Map(); let currentSourceFile; let nodeIdToGeneratedName; + let nodeIdToGeneratedPrivateName; let autoGeneratedIdToGeneratedName; let generatedNames; let formattedNameTempFlagsStack; @@ -106109,6 +109441,7 @@ ${lanes.join("\n")} } function reset2() { nodeIdToGeneratedName = []; + nodeIdToGeneratedPrivateName = []; autoGeneratedIdToGeneratedName = []; generatedNames = /* @__PURE__ */ new Set(); formattedNameTempFlagsStack = []; @@ -106160,7 +109493,7 @@ ${lanes.join("\n")} pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node); } function beforeEmitNode(node) { - if (preserveSourceNewlines && getEmitFlags(node) & 268435456 /* IgnoreSourceNewlines */) { + if (preserveSourceNewlines && getInternalEmitFlags(node) & 4 /* IgnoreSourceNewlines */) { preserveSourceNewlines = false; } } @@ -106550,6 +109883,7 @@ ${lanes.join("\n")} case 346 /* JSDocThisTag */: case 347 /* JSDocTypeTag */: case 352 /* JSDocThrowsTag */: + case 353 /* JSDocSatisfiesTag */: return emitJSDocSimpleTypedTag(node); case 348 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); @@ -106557,9 +109891,9 @@ ${lanes.join("\n")} return emitJSDocTypedefTag(node); case 350 /* JSDocSeeTag */: return emitJSDocSeeTag(node); - case 354 /* NotEmittedStatement */: - case 358 /* EndOfDeclarationMarker */: - case 357 /* MergeDeclarationMarker */: + case 355 /* NotEmittedStatement */: + case 359 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return; } if (isExpression(node)) { @@ -106652,24 +109986,26 @@ ${lanes.join("\n")} return emitMetaProperty(node); case 234 /* SyntheticExpression */: return Debug.fail("SyntheticExpression should never be printed."); + case 279 /* MissingDeclaration */: + return; case 281 /* JsxElement */: return emitJsxElement(node); case 282 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); case 285 /* JsxFragment */: return emitJsxFragment(node); - case 353 /* SyntaxList */: + case 354 /* SyntaxList */: return Debug.fail("SyntaxList should not be printed"); - case 354 /* NotEmittedStatement */: + case 355 /* NotEmittedStatement */: return; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return emitCommaList(node); - case 357 /* MergeDeclarationMarker */: - case 358 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return; - case 359 /* SyntheticReferenceExpression */: + case 360 /* SyntheticReferenceExpression */: return Debug.fail("SyntheticReferenceExpression should not be printed"); } } @@ -106842,7 +110178,7 @@ ${lanes.join("\n")} /*includeTrivia*/ false ), node.symbol); - emitList(node, node.typeArguments, 53776 /* TypeParameters */); + emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */); } function emitPrivateIdentifier(node) { write(getTextOfNode2( @@ -106873,7 +110209,7 @@ ${lanes.join("\n")} pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames); } function emitTypeParameter(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emit(node.name); if (node.constraint) { writeSpace(); @@ -106889,7 +110225,12 @@ ${lanes.join("\n")} } } function emitParameter(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); @@ -106905,14 +110246,19 @@ ${lanes.join("\n")} emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); } function emitPropertySignature(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emitNodeWithWriter(node.name, writeProperty); emit(node.questionToken); emitTypeAnnotation(node.type); writeTrailingSemicolon(); } function emitPropertyDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.name); emit(node.questionToken); emit(node.exclamationToken); @@ -106922,7 +110268,7 @@ ${lanes.join("\n")} } function emitMethodSignature(node) { pushNameGenerationScope(node); - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emit(node.name); emit(node.questionToken); emitTypeParameters(node, node.typeParameters); @@ -106932,7 +110278,12 @@ ${lanes.join("\n")} popNameGenerationScope(node); } function emitMethodDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.asteriskToken); emit(node.name); emit(node.questionToken); @@ -106943,13 +110294,24 @@ ${lanes.join("\n")} emitBlockFunctionBody(node.body); } function emitConstructor(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); - writeKeyword(node.kind === 174 /* GetAccessor */ ? "get" : "set"); + const pos = emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + const token = node.kind === 174 /* GetAccessor */ ? 137 /* GetKeyword */ : 151 /* SetKeyword */; + emitTokenWithComment(token, pos, writeKeyword, node); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -106973,7 +110335,12 @@ ${lanes.join("\n")} popNameGenerationScope(node); } function emitIndexSignature(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitParametersForIndexSignature(node, node.parameters); emitTypeAnnotation(node.type); writeTrailingSemicolon(); @@ -107032,7 +110399,7 @@ ${lanes.join("\n")} } function emitConstructorType(node) { pushNameGenerationScope(node); - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); writeKeyword("new"); writeSpace(); emitTypeParameters(node, node.typeParameters); @@ -107308,7 +110675,7 @@ ${lanes.join("\n")} emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node); } function emitCallExpression(node) { - const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */; + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; if (indirectCall) { writePunctuation("("); writeLiteral("0"); @@ -107331,7 +110698,7 @@ ${lanes.join("\n")} emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); } function emitTaggedTemplateExpression(node) { - const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */; + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; if (indirectCall) { writePunctuation("("); writeLiteral("0"); @@ -107369,7 +110736,7 @@ ${lanes.join("\n")} emitFunctionDeclarationOrExpression(node); } function emitArrowFunction(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emitSignatureAndBody(node, emitArrowFunctionHead); } function emitArrowFunctionHead(node) { @@ -107635,7 +111002,12 @@ ${lanes.join("\n")} ); } function emitVariableStatement(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emit(node.declarationList); writeTrailingSemicolon(); } @@ -107893,7 +111265,12 @@ ${lanes.join("\n")} emitFunctionDeclarationOrExpression(node); } function emitFunctionDeclarationOrExpression(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("function"); emit(node.asteriskToken); writeSpace(); @@ -108001,8 +111378,13 @@ ${lanes.join("\n")} void 0 ); forEach(node.members, generateMemberNames); - emitDecoratorsAndModifiers(node, node.modifiers); - writeKeyword("class"); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emitTokenWithComment(84 /* ClassKeyword */, moveRangePastModifiers(node).pos, writeKeyword, node); if (node.name) { writeSpace(); emitIdentifierName(node.name); @@ -108028,7 +111410,12 @@ ${lanes.join("\n")} /*newReservedMemberNames*/ void 0 ); - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("interface"); writeSpace(); emit(node.name); @@ -108041,7 +111428,12 @@ ${lanes.join("\n")} popPrivateNameGenerationScope(); } function emitTypeAliasDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("type"); writeSpace(); emit(node.name); @@ -108053,7 +111445,12 @@ ${lanes.join("\n")} writeTrailingSemicolon(); } function emitEnumDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("enum"); writeSpace(); emit(node.name); @@ -108063,7 +111460,12 @@ ${lanes.join("\n")} writePunctuation("}"); } function emitModuleDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); if (~node.flags & 1024 /* GlobalAugmentation */) { writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); writeSpace(); @@ -108103,7 +111505,12 @@ ${lanes.join("\n")} ); } function emitImportEqualsDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { @@ -108125,7 +111532,12 @@ ${lanes.join("\n")} } } function emitImportDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.importClause) { @@ -108178,7 +111590,12 @@ ${lanes.join("\n")} writeTrailingSemicolon(); } function emitExportDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); let nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { @@ -108801,23 +112218,27 @@ ${lanes.join("\n")} emit(node); write = savedWrite; } - function emitDecoratorsAndModifiers(node, modifiers) { + function emitDecoratorsAndModifiers(node, modifiers, allowDecorators) { if (modifiers == null ? void 0 : modifiers.length) { if (every(modifiers, isModifier)) { - return emitModifiers(node, modifiers); + return emitModifierList(node, modifiers); } if (every(modifiers, isDecorator)) { - return emitDecorators(node, modifiers); + if (allowDecorators) { + return emitDecoratorList(node, modifiers); + } + return node.pos; } onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); let lastMode; let mode; let start = 0; let pos = 0; + let lastModifier; while (start < modifiers.length) { while (pos < modifiers.length) { - const modifier = modifiers[pos]; - mode = isDecorator(modifier) ? "decorators" : "modifiers"; + lastModifier = modifiers[pos]; + mode = isDecorator(lastModifier) ? "decorators" : "modifiers"; if (lastMode === void 0) { lastMode = mode; } else if (mode !== lastMode) { @@ -108830,28 +112251,36 @@ ${lanes.join("\n")} textRange.pos = modifiers.pos; if (pos === modifiers.length - 1) textRange.end = modifiers.end; - emitNodeListItems( - emit, - node, - modifiers, - lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, - /*parenthesizerRule*/ - void 0, - start, - pos - start, - /*hasTrailingComma*/ - false, - textRange - ); + if (lastMode === "modifiers" || allowDecorators) { + emitNodeListItems( + emit, + node, + modifiers, + lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, + /*parenthesizerRule*/ + void 0, + start, + pos - start, + /*hasTrailingComma*/ + false, + textRange + ); + } start = pos; lastMode = mode; pos++; } onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); + if (lastModifier && !positionIsSynthesized(lastModifier.end)) { + return lastModifier.end; + } } + return node.pos; } - function emitModifiers(node, modifiers) { + function emitModifierList(node, modifiers) { emitList(node, modifiers, 2359808 /* Modifiers */); + const lastModifier = lastOrUndefined(modifiers); + return lastModifier && !positionIsSynthesized(lastModifier.end) ? lastModifier.end : node.pos; } function emitTypeAnnotation(node) { if (node) { @@ -108907,8 +112336,10 @@ ${lanes.join("\n")} decreaseIndent(); } } - function emitDecorators(parentNode, decorators) { + function emitDecoratorList(parentNode, decorators) { emitList(parentNode, decorators, 2146305 /* Decorators */); + const lastDecorator = lastOrUndefined(decorators); + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos; } function emitTypeArguments(parentNode, typeArguments) { emitList(parentNode, typeArguments, 53776 /* TypeArguments */, typeArgumentParenthesizerRuleSelector); @@ -109035,7 +112466,10 @@ ${lanes.join("\n")} writeDelimiter(format); } else if (previousSibling) { if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) { - emitLeadingCommentsOfPosition(previousSibling.end); + const previousSiblingEmitFlags = getEmitFlags(previousSibling); + if (!(previousSiblingEmitFlags & 2048 /* NoTrailingComments */)) { + emitLeadingCommentsOfPosition(previousSibling.end); + } } writeDelimiter(format); recordBundleFileInternalSectionEnd(previousSourceFileTextKind); @@ -109560,16 +112994,18 @@ ${lanes.join("\n")} } } function generateName(name) { - if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { - return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix); + const autoGenerate = name.emitNode.autoGenerate; + if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { + return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix); } else { - const autoGenerateId = name.autoGenerate.id; + const autoGenerateId = autoGenerate.id; return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name)); } } function generateNameCached(node, privateName, flags, prefix, suffix) { const nodeId = getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); + const cache = privateName ? nodeIdToGeneratedPrivateName : nodeIdToGeneratedName; + return cache[nodeId] || (cache[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); } function isUniqueName(name, privateName) { return isFileLevelUniqueName2(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name); @@ -109811,7 +113247,21 @@ ${lanes.join("\n")} Debug.assert(!prefix && !suffix && !privateName); return generateNameForImportOrExportDeclaration(node); case 259 /* FunctionDeclaration */: - case 260 /* ClassDeclaration */: + case 260 /* ClassDeclaration */: { + Debug.assert(!prefix && !suffix && !privateName); + const name = node.name; + if (name && !isGeneratedIdentifier(name)) { + return generateNameForNode( + name, + /*privateName*/ + false, + flags, + prefix, + suffix + ); + } + return generateNameForExportDefault(); + } case 274 /* ExportAssignment */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForExportDefault(); @@ -109843,16 +113293,17 @@ ${lanes.join("\n")} } } function makeName(name) { - const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName); - const suffix = formatGeneratedNamePart(name.autoGenerate.suffix); - switch (name.autoGenerate.flags & 7 /* KindMask */) { + const autoGenerate = name.emitNode.autoGenerate; + const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName); + const suffix = formatGeneratedNamePart(autoGenerate.suffix); + switch (autoGenerate.flags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); case 2 /* Loop */: Debug.assertNode(name, isIdentifier); return makeTempVariableName( TempFlags._i, - !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), /*privateName*/ false, prefix, @@ -109861,16 +113312,16 @@ ${lanes.join("\n")} case 3 /* Unique */: return makeUniqueName2( idText(name), - name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, - !!(name.autoGenerate.flags & 16 /* Optimistic */), - !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), + autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, + !!(autoGenerate.flags & 16 /* Optimistic */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix ); } return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum( - name.autoGenerate.flags & 7 /* KindMask */, + autoGenerate.flags & 7 /* KindMask */, GeneratedIdentifierFlags, /*isFlags*/ true @@ -109915,7 +113366,7 @@ ${lanes.join("\n")} emitLeadingComments( pos, /*isEmittedNode*/ - node.kind !== 354 /* NotEmittedStatement */ + node.kind !== 355 /* NotEmittedStatement */ ); } if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { @@ -109939,7 +113390,7 @@ ${lanes.join("\n")} containerPos = savedContainerPos; containerEnd = savedContainerEnd; declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 354 /* NotEmittedStatement */) { + if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) { emitTrailingComments(end); } } @@ -110211,7 +113662,7 @@ ${lanes.join("\n")} } } else { const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); } if (emitFlags & 128 /* NoNestedSourceMaps */) { @@ -110226,7 +113677,7 @@ ${lanes.join("\n")} if (emitFlags & 128 /* NoNestedSourceMaps */) { sourceMapsDisabled = false; } - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); } } @@ -110997,7 +114448,7 @@ ${lanes.join("\n")} function getDefaultLibLocation() { return getDirectoryPath(normalizePath(system.getExecutingFilePath())); } - const newLine = getNewLineCharacter(options, () => system.newLine); + const newLine = getNewLineCharacter(options); const realpath = system.realpath && ((path) => system.realpath(path)); const compilerHost = { getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes), @@ -112399,7 +115850,6 @@ ${lanes.join("\n")} getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: () => currentDirectory, - getNewLine: () => host.getNewLine(), getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, @@ -112778,8 +116228,26 @@ ${lanes.join("\n")} } } function walkArray(nodes, parent2) { - if (canHaveModifiers(parent2) && parent2.modifiers === nodes && some(nodes, isDecorator) && !options.experimentalDecorators) { - diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); + if (canHaveIllegalDecorators(parent2)) { + const decorator = find(parent2.modifiers, isDecorator); + if (decorator) { + diagnostics.push(createDiagnosticForNode2(decorator, Diagnostics.Decorators_are_not_valid_here)); + } + } else if (canHaveDecorators(parent2) && parent2.modifiers) { + const decoratorIndex = findIndex(parent2.modifiers, isDecorator); + if (decoratorIndex >= 0) { + if (isParameter(parent2) && !options.experimentalDecorators) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (isClassDeclaration(parent2)) { + const exportIndex = findIndex(parent2.modifiers, isExportModifier); + const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); + if (exportIndex >= 0 && decoratorIndex < exportIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files)); + } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } + } + } } switch (parent2.kind) { case 260 /* ClassDeclaration */: @@ -112938,7 +116406,7 @@ ${lanes.join("\n")} /*assertClause*/ void 0 ); - addEmitFlags(importDecl, 134217728 /* NeverApplyImportHelper */); + addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */); setParent(externalHelpersModuleReference, importDecl); setParent(importDecl, file); externalHelpersModuleReference.flags &= ~8 /* Synthesized */; @@ -113205,7 +116673,7 @@ ${lanes.join("\n")} if (filesByName.has(path)) { const file2 = filesByName.get(path); addFileIncludeReason(file2 || void 0, reason); - if (file2 && options.forceConsistentCasingInFileNames) { + if (file2 && !(options.forceConsistentCasingInFileNames === false)) { const checkedName = file2.fileName; const isRedirect = toPath3(checkedName) !== toPath3(fileName); if (isRedirect) { @@ -113804,24 +117272,12 @@ ${lanes.join("\n")} } const languageVersion = getEmitScriptTarget(options); const firstNonAmbientExternalModuleSourceFile = find(files, (f) => isExternalModule(f) && !f.isDeclarationFile); - if (options.isolatedModules) { - if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */) { + if (options.isolatedModules || options.verbatimModuleSyntax) { + if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */ && options.isolatedModules) { createDiagnosticForOptionName(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"); } if (options.preserveConstEnums === false) { - createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules"); - } - for (const file of files) { - if (!isExternalModule(file) && !isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* JSON */) { - const span = getErrorSpanForNode(file, file); - programDiagnostics.add(createFileDiagnostic( - file, - span.start, - span.length, - Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, - getBaseFileName(file.fileName) - )); - } + createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled, options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", "preserveConstEnums"); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === 0 /* None */) { const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); @@ -113903,10 +117359,25 @@ ${lanes.join("\n")} } } if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) { - createOptionValueDiagnostic("importsNotUsedAsValues", Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later); + createDiagnosticForOptionName(Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); + } + if (options.verbatimModuleSyntax) { + const moduleKind = getEmitModuleKind(options); + if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { + createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); + } + if (options.isolatedModules) { + createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); + } + if (options.preserveValueImports) { + createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); + } + if (options.importsNotUsedAsValues) { + createRedundantOptionDiagnostic("importsNotUsedAsValues", "verbatimModuleSyntax"); + } } if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) { - createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set); + createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set); } const moduleResolution = getEmitModuleResolutionKind(options); if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { @@ -113952,16 +117423,25 @@ ${lanes.join("\n")} } } } - function verifyDeprecatedCompilerOptions() { + function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) { const version2 = typeScriptVersion3 || versionMajorMinor; const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) { return; - } else { + } else if (reportInvalidIgnoreDeprecations) { createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); } } + return version2; + } + function verifyDeprecatedCompilerOptions() { + const version2 = getVersionForDeprecationDiagnostics( + /*reportInvalidIgnoreDeprecations*/ + true + ); + if (!version2) + return; if (options.target === 0 /* ES3 */) { createDeprecatedDiagnosticForOption(version2, "target", "ES3"); } @@ -113986,32 +117466,85 @@ ${lanes.join("\n")} if (options.out) { createDeprecatedDiagnosticForOption(version2, "out"); } - } - function createDeprecatedDiagnosticForOption(version2, name, value) { - if (version2 === "6.0" /* v6_0 */) { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnosticForOption( + version2, + "importsNotUsedAsValues", + /*value*/ void 0, - Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, - value || name + "verbatimModuleSyntax" ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ + } + if (options.preserveValueImports) { + createDeprecatedDiagnosticForOption( + version2, + "preserveValueImports", + /*value*/ void 0, - Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, - value || name, - "5.5" /* v5_5 */, - "5.0" /* v5_0 */ + "verbatimModuleSyntax" ); } } + function verifyDeprecatedProjectReference(ref, parentFile, index) { + if (ref.prepend) { + const version2 = getVersionForDeprecationDiagnostics( + /*reportInvalidIgnoreDeprecations*/ + false + ); + if (version2) { + createDeprecatedOptionForVersionDiagnostic( + version2, + (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), + "prepend" + ); + } + } + } + function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) { + return createDeprecatedOptionForVersionDiagnostic( + version2, + (message, arg0, arg1, arg2) => { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + chain + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + message, + arg0, + arg1, + arg2 + ); + } + }, + name, + value + ); + } + function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) { + if (version2 === "6.0" /* v6_0 */) { + createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); + } else { + createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + } + } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { var _a3; let fileIncludeReasons; @@ -114155,6 +117688,7 @@ ${lanes.join("\n")} forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent2, index) => { const ref = (parent2 ? parent2.commandLine.projectReferences : projectReferences)[index]; const parentFile = parent2 && parent2.sourceFile; + verifyDeprecatedProjectReference(ref, parentFile, index); if (!resolvedRef) { createDiagnosticForReference(parentFile, index, Diagnostics.File_0_not_found, ref.path); return; @@ -114262,22 +117796,26 @@ ${lanes.join("\n")} arg1 ); } - function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) { + function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) { const referencesSyntax = firstDefined( getTsConfigPropArray(sourceFile || options.configFile, "references"), (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 ); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); } } function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); if (needCompilerDiagnostic) { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + if ("messageText" in message) { + programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); + } else { + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + } } } function getCompilerOptionsObjectLiteralSyntax() { @@ -114298,10 +117836,32 @@ ${lanes.join("\n")} function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + if ("messageText" in message) { + programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); + } else { + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + } } return !!props.length; } + function createRedundantOptionDiagnostic(errorOnOption, redundantWithOption) { + const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + if (compilerOptionsObjectLiteralSyntax) { + createOptionDiagnosticInObjectLiteralSyntax( + compilerOptionsObjectLiteralSyntax, + /*onKey*/ + true, + errorOnOption, + /*key2*/ + void 0, + Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, + errorOnOption, + redundantWithOption + ); + } else { + createDiagnosticForOptionName(Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, errorOnOption, redundantWithOption); + } + } function blockEmittingOfFile(emitFileName, diag2) { hasEmitBlockingDiagnostics.set(toPath3(emitFileName), true); programDiagnostics.add(diag2); @@ -114552,9 +118112,8 @@ ${lanes.join("\n")} } return nodes || emptyArray; } - function resolveProjectReferencePath(hostOrRef, ref) { - const passedInRef = ref ? ref : hostOrRef; - return resolveConfigFileProjectName(passedInRef.path); + function resolveProjectReferencePath(ref) { + return resolveConfigFileProjectName(ref.path); } function getResolutionDiagnostic(options, { extension }, { isDeclarationFile }) { switch (extension) { @@ -117323,6 +120882,9 @@ ${lanes.join("\n")} } ); return filesInError.map((fileName) => { + if (fileName === void 0) { + return void 0; + } const diagnosticForFileName = find( diagnostics, (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName @@ -117693,7 +121255,6 @@ ${lanes.join("\n")} } function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) { const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); - const hostGetNewLine = memoize(() => host.getNewLine()); const compilerHost = { getSourceFile: createGetSourceFile( (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding), @@ -117711,7 +121272,7 @@ ${lanes.join("\n")} getCurrentDirectory: memoize(() => host.getCurrentDirectory()), useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames), - getNewLine: () => getNewLineCharacter(getCompilerOptions(), hostGetNewLine), + getNewLine: () => getNewLineCharacter(getCompilerOptions()), fileExists: (f) => host.fileExists(f), readFile: (f) => host.readFile(f), trace: maybeBind(host, host.trace), @@ -117797,7 +121358,7 @@ ${lanes.join("\n")} copyProperties(result, createWatchHost(system, reportWatchStatus2)); result.afterProgramCreate = (builderProgram) => { const compilerOptions = builderProgram.getCompilerOptions(); - const newLine = getNewLineCharacter(compilerOptions, () => system.newLine); + const newLine = getNewLineCharacter(compilerOptions); emitFilesAndReportErrors( builderProgram, reportDiagnostic, @@ -118007,11 +121568,13 @@ ${lanes.join("\n")} } reportWatchDiagnostic(Diagnostics.Starting_compilation_in_watch_mode); if (configFileName && !host.configFileParsingResult) { - newLine = getNewLineCharacter(optionsToExtendForConfigFile, () => host.getNewLine()); + newLine = getNewLineCharacter(optionsToExtendForConfigFile); Debug.assert(!rootFileNames); parseConfigFile2(); newLine = updateNewLine(); } + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions); const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`); @@ -118114,6 +121677,8 @@ ${lanes.join("\n")} } function synchronizeProgram() { writeLog(`Synchronizing program`); + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); clearInvalidateResolutionsOfFailedLookupLocations(); const program = getCurrentBuilderProgram(); if (hasChangedCompilerOptions) { @@ -118199,7 +121764,7 @@ ${lanes.join("\n")} scheduleProgramUpdate(); } function updateNewLine() { - return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile, () => host.getNewLine()); + return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile); } function toPath3(fileName) { return toPath(fileName, currentDirectory, getCanonicalFileName); @@ -118353,6 +121918,8 @@ ${lanes.join("\n")} } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); + Debug.assert(configFileName); reloadLevel = 0 /* None */; rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { @@ -118361,6 +121928,7 @@ ${lanes.join("\n")} synchronizeProgram(); } function reloadConfigFile() { + Debug.assert(configFileName); writeLog(`Reloading config file: ${configFileName}`); reloadLevel = 0 /* None */; if (cachedDirectoryStructureHost) { @@ -118373,6 +121941,7 @@ ${lanes.join("\n")} updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile); } function parseConfigFile2() { + Debug.assert(configFileName); setConfigFileParsingResult(getParsedCommandLineOfConfigFile( configFileName, optionsToExtendForConfigFile, @@ -118400,6 +121969,7 @@ ${lanes.join("\n")} return config.parsedCommandLine; if (config.parsedCommandLine && config.reloadLevel === 1 /* Partial */ && !host.getParsedCommandLine) { writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); const fileNames = getFileNamesFromConfigSpecs( config.parsedCommandLine.options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName2), currentDirectory), @@ -118491,7 +122061,8 @@ ${lanes.join("\n")} return watchDirectory( directory, (fileOrDirectory) => { - Debug.assert(!!configFileName); + Debug.assert(configFileName); + Debug.assert(compilerOptions); const fileOrDirectoryPath = toPath3(fileOrDirectory); if (cachedDirectoryStructureHost) { cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); @@ -118522,6 +122093,7 @@ ${lanes.join("\n")} ); } function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { + Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, @@ -120678,6 +124250,7 @@ ${lanes.join("\n")} init_classFields(); init_typeSerializer(); init_legacyDecorators(); + init_esDecorators(); init_es2017(); init_es2018(); init_es2019(); @@ -121987,7 +125560,7 @@ ${lanes.join("\n")} Debug.assert(!syntaxList || contains(syntaxList.getChildren(), node)); return syntaxList; } - function isDefaultModifier(node) { + function isDefaultModifier2(node) { return node.kind === 88 /* DefaultKeyword */; } function isClassKeyword(node) { @@ -122001,7 +125574,7 @@ ${lanes.join("\n")} return node.name; } if (isClassDeclaration(node)) { - const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier); + const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier2); if (defaultModifier) return defaultModifier; } @@ -122016,7 +125589,7 @@ ${lanes.join("\n")} return node.name; } if (isFunctionDeclaration(node)) { - const defaultModifier = find(node.modifiers, isDefaultModifier); + const defaultModifier = find(node.modifiers, isDefaultModifier2); if (defaultModifier) return defaultModifier; } @@ -122934,16 +126507,19 @@ ${lanes.join("\n")} function findModifier(node, kind) { return canHaveModifiers(node) ? find(node.modifiers, (m) => m.kind === kind) : void 0; } - function insertImports(changes, sourceFile, imports, blankLineBetween) { + function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) { const decl = isArray(imports) ? imports[0] : imports; const importKindPredicate = decl.kind === 240 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; const existingImportStatements = filter(sourceFile.statements, importKindPredicate); - const sortedNewImports = isArray(imports) ? stableSort(imports, ts_OrganizeImports_exports.compareImportsOrRequireStatements) : [imports]; + let sortKind = isArray(imports) ? ts_OrganizeImports_exports.detectImportDeclarationSorting(imports, preferences) : 3 /* Both */; + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); + const sortedNewImports = isArray(imports) ? stableSort(imports, (a, b) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a, b, comparer)) : [imports]; if (!existingImportStatements.length) { changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); - } else if (existingImportStatements && ts_OrganizeImports_exports.detectImportDeclarationSorting(existingImportStatements)) { + } else if (existingImportStatements && (sortKind = ts_OrganizeImports_exports.detectImportDeclarationSorting(existingImportStatements, preferences))) { + const comparer2 = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); for (const newImport of sortedNewImports) { - const insertionIndex = ts_OrganizeImports_exports.getImportDeclarationInsertionIndex(existingImportStatements, newImport); + const insertionIndex = ts_OrganizeImports_exports.getImportDeclarationInsertionIndex(existingImportStatements, newImport, comparer2); if (insertionIndex === 0) { const options = existingImportStatements[0] === sourceFile.statements[0] ? { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude } : {}; changes.insertNodeBefore( @@ -123274,7 +126850,7 @@ ${lanes.join("\n")} } function getNewLineOrDefaultFromHost(host, formatSettings) { var _a2; - return (formatSettings == null ? void 0 : formatSettings.newLineCharacter) || ((_a2 = host.getNewLine) == null ? void 0 : _a2.call(host)) || carriageReturnLineFeed2; + return (formatSettings == null ? void 0 : formatSettings.newLineCharacter) || ((_a2 = host.getNewLine) == null ? void 0 : _a2.call(host)) || lineFeed2; } function lineBreakPart() { return displayPart("\n", 6 /* lineBreak */); @@ -123987,7 +127563,7 @@ ${lanes.join("\n")} if (!sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) { return false; } - return isInJSFile(declaration) || !findAncestor(declaration, isGlobalScopeAugmentation); + return isInJSFile(declaration) || !findAncestor(declaration, (d) => isModuleDeclaration(d) && isGlobalScopeAugmentation(d)); } function isDeprecatedDeclaration(decl) { return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 8192 /* Deprecated */); @@ -124020,7 +127596,7 @@ ${lanes.join("\n")} function isSourceFileFromLibrary(program, node) { return program.isSourceFileFromExternalLibrary(node) || program.isSourceFileDefaultLibrary(node); } - var scanner, SemanticMeaning, tripleSlashDirectivePrefixRegex, typeKeywords, QuotePreference, displayPartWriter, carriageReturnLineFeed2, ANONYMOUS, syntaxMayBeASICandidate; + var scanner, SemanticMeaning, tripleSlashDirectivePrefixRegex, typeKeywords, QuotePreference, displayPartWriter, lineFeed2, ANONYMOUS, syntaxMayBeASICandidate; var init_utilities4 = __esm({ "src/services/utilities.ts"() { "use strict"; @@ -124066,7 +127642,7 @@ ${lanes.join("\n")} return QuotePreference5; })(QuotePreference || {}); displayPartWriter = getDisplayPartWriter(); - carriageReturnLineFeed2 = "\r\n"; + lineFeed2 = "\n"; ANONYMOUS = "anonymous function"; syntaxMayBeASICandidate = or( syntaxRequiresTrailingCommaOrSemicolonOrASI, @@ -124328,7 +127904,7 @@ ${lanes.join("\n")} } function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) { var _a2; - const isExcluded = (fileName) => excludePatterns == null ? void 0 : excludePatterns.some((p) => p.test(fileName)); + const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName))); for (const ambient of checker.getAmbientModules()) { if (!stringContains(ambient.name, "*") && !(excludePatterns && ((_a2 = ambient.declarations) == null ? void 0 : _a2.every((d) => isExcluded(d.getSourceFile().fileName))))) { cb( @@ -124339,7 +127915,7 @@ ${lanes.join("\n")} } } for (const sourceFile of allSourceFiles) { - if (isExternalOrCommonJsModule(sourceFile) && !isExcluded(sourceFile.fileName)) { + if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile.fileName))) { cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile); } } @@ -124436,10 +128012,10 @@ ${lanes.join("\n")} function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) { const localSymbol = getLocalSymbolForExportDefault(defaultExport); if (localSymbol) - return { symbolForMeaning: localSymbol, name: localSymbol.name }; + return { resolvedSymbol: localSymbol, name: localSymbol.name }; const name = getNameForExportDefault(defaultExport); if (name !== void 0) - return { symbolForMeaning: defaultExport, name }; + return { resolvedSymbol: defaultExport, name }; if (defaultExport.flags & 2097152 /* Alias */) { const aliased = checker.getImmediateAliasedSymbol(defaultExport); if (aliased && aliased.parent) { @@ -124447,9 +128023,9 @@ ${lanes.join("\n")} } } if (defaultExport.escapedName !== "default" /* Default */ && defaultExport.escapedName !== "export=" /* ExportEquals */) { - return { symbolForMeaning: defaultExport, name: defaultExport.getName() }; + return { resolvedSymbol: defaultExport, name: defaultExport.getName() }; } - return { symbolForMeaning: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) }; + return { resolvedSymbol: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) }; } function getNameForExportDefault(symbol) { return symbol.declarations && firstDefined(symbol.declarations, (declaration) => { @@ -128338,7 +131914,7 @@ ${lanes.join("\n")} } } function createSyntaxList(nodes, parent2) { - const list = createNode(353 /* SyntaxList */, nodes.pos, nodes.end, parent2); + const list = createNode(354 /* SyntaxList */, nodes.pos, nodes.end, parent2); list._children = []; let pos = nodes.pos; for (const node of nodes) { @@ -128583,7 +132159,7 @@ ${lanes.join("\n")} getCancellationToken: () => cancellationToken, getCanonicalFileName, useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, - getNewLine: () => getNewLineCharacter(newSettings, () => getNewLineOrDefaultFromHost(host)), + getNewLine: () => getNewLineCharacter(newSettings), getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2), writeFile: noop, getCurrentDirectory: () => currentDirectory, @@ -129129,22 +132705,22 @@ ${lanes.join("\n")} } return []; } - function getCodeFixesAtPosition(fileName, start, end, errorCodes64, formatOptions, preferences = emptyOptions) { + function getCodeFixesAtPosition(fileName, start, end, errorCodes63, formatOptions, preferences = emptyOptions) { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); const span = createTextSpanFromBounds(start, end); const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - return flatMap(deduplicate(errorCodes64, equateValues, compareValues), (errorCode) => { + return flatMap(deduplicate(errorCodes63, equateValues, compareValues), (errorCode) => { cancellationToken.throwIfCancellationRequested(); return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences }); }); } - function getCombinedCodeFix(scope, fixId52, formatOptions, preferences = emptyOptions) { + function getCombinedCodeFix(scope, fixId51, formatOptions, preferences = emptyOptions) { synchronizeHostData(); Debug.assert(scope.type === "file"); const sourceFile = getValidSourceFile(scope.fileName); const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - return ts_codefix_exports.getAllFixes({ fixId: fixId52, sourceFile, program, host, cancellationToken, formatContext, preferences }); + return ts_codefix_exports.getAllFixes({ fixId: fixId51, sourceFile, program, host, cancellationToken, formatContext, preferences }); } function organizeImports2(args, formatOptions, preferences = emptyOptions) { var _a3; @@ -129168,7 +132744,11 @@ ${lanes.join("\n")} return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); } function getDocCommentTemplateAtPosition2(fileName, position, options) { - return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost( + host, + /*formatSettings*/ + void 0 + ), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); } function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { if (openingBrace === 60 /* lessThan */) { @@ -129799,7 +133379,7 @@ ${lanes.join("\n")} if (!children.length) { return void 0; } - const child = find(children, (kid) => kid.kind < 312 /* FirstJSDocNode */ || kid.kind > 352 /* LastJSDocNode */); + const child = find(children, (kid) => kid.kind < 312 /* FirstJSDocNode */ || kid.kind > 353 /* LastJSDocNode */); return child.kind < 163 /* FirstNode */ ? child : child.getFirstToken(sourceFile); } getLastToken(sourceFile) { @@ -130762,7 +134342,11 @@ ${lanes.join("\n")} ); } realizeDiagnostics(diagnostics) { - const newLine = getNewLineOrDefaultFromHost(this.host); + const newLine = getNewLineOrDefaultFromHost( + this.host, + /*formatSettings*/ + void 0 + ); return realizeDiagnostics(diagnostics, newLine); } getSyntacticClassifications(fileName, start, length2) { @@ -131895,9 +135479,9 @@ ${lanes.join("\n")} return node.name; if (isConstNamedExpression(node)) return node.parent.name; - return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier2)); + return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier3)); } - function isDefaultModifier2(node) { + function isDefaultModifier3(node) { return node.kind === 88 /* DefaultKeyword */; } function getSymbolOfCallHierarchyDeclaration(typeChecker, node) { @@ -131909,7 +135493,7 @@ ${lanes.join("\n")} return { text: node.fileName, pos: 0, end: 0 }; } if ((isFunctionDeclaration(node) || isClassDeclaration(node)) && !isNamedDeclaration(node)) { - const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier2); + const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier3); if (defaultModifier) { return { text: "default", pos: defaultModifier.getStart(), end: defaultModifier.getEnd() }; } @@ -132610,23 +136194,23 @@ ${lanes.join("\n")} void 0 ); } - function createCodeFixAction(fixName8, changes, description2, fixId52, fixAllDescription, command) { - return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId52, diagnosticToString(fixAllDescription), command); + function createCodeFixAction(fixName8, changes, description2, fixId51, fixAllDescription, command) { + return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId51, diagnosticToString(fixAllDescription), command); } - function createCodeFixActionMaybeFixAll(fixName8, changes, description2, fixId52, fixAllDescription, command) { - return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId52, fixAllDescription && diagnosticToString(fixAllDescription), command); + function createCodeFixActionMaybeFixAll(fixName8, changes, description2, fixId51, fixAllDescription, command) { + return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId51, fixAllDescription && diagnosticToString(fixAllDescription), command); } - function createCodeFixActionWorker(fixName8, description2, changes, fixId52, fixAllDescription, command) { - return { fixName: fixName8, description: description2, changes, fixId: fixId52, fixAllDescription, commands: command ? [command] : void 0 }; + function createCodeFixActionWorker(fixName8, description2, changes, fixId51, fixAllDescription, command) { + return { fixName: fixName8, description: description2, changes, fixId: fixId51, fixAllDescription, commands: command ? [command] : void 0 }; } function registerCodeFix(reg) { for (const error of reg.errorCodes) { errorCodeToFixes.add(String(error), reg); } if (reg.fixIds) { - for (const fixId52 of reg.fixIds) { - Debug.assert(!fixIdToRegistration.has(fixId52)); - fixIdToRegistration.set(fixId52, reg); + for (const fixId51 of reg.fixIds) { + Debug.assert(!fixIdToRegistration.has(fixId51)); + fixIdToRegistration.set(fixId51, reg); } } } @@ -132634,17 +136218,17 @@ ${lanes.join("\n")} return arrayFrom(errorCodeToFixes.keys()); } function removeFixIdIfFixAllUnavailable(registration, diagnostics) { - const { errorCodes: errorCodes64 } = registration; + const { errorCodes: errorCodes63 } = registration; let maybeFixableDiagnostics = 0; for (const diag2 of diagnostics) { - if (contains(errorCodes64, diag2.code)) + if (contains(errorCodes63, diag2.code)) maybeFixableDiagnostics++; if (maybeFixableDiagnostics > 1) break; } const fixAllUnavailable = maybeFixableDiagnostics < 2; - return ({ fixId: fixId52, fixAllDescription, ...action }) => { - return fixAllUnavailable ? action : { ...action, fixId: fixId52, fixAllDescription }; + return ({ fixId: fixId51, fixAllDescription, ...action }) => { + return fixAllUnavailable ? action : { ...action, fixId: fixId51, fixAllDescription }; }; } function getFixes(context) { @@ -132661,14 +136245,14 @@ ${lanes.join("\n")} function createFileTextChanges(fileName, textChanges2) { return { fileName, textChanges: textChanges2 }; } - function codeFixAll(context, errorCodes64, use) { + function codeFixAll(context, errorCodes63, use) { const commands = []; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes64, (diag2) => use(t, diag2, commands))); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes63, (diag2) => use(t, diag2, commands))); return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands); } - function eachDiagnostic(context, errorCodes64, cb) { + function eachDiagnostic(context, errorCodes63, cb) { for (const diag2 of getDiagnostics(context)) { - if (contains(errorCodes64, diag2.code)) { + if (contains(errorCodes63, diag2.code)) { cb(diag2); } } @@ -133411,7 +136995,7 @@ ${lanes.join("\n")} if (!param.type) { const paramType = getJSDocType(param); if (paramType) - changes.tryInsertTypeAnnotation(sourceFile, param, transformJSDocType(paramType)); + changes.tryInsertTypeAnnotation(sourceFile, param, visitNode(paramType, transformJSDocType, isTypeNode)); } } if (needParens) @@ -133419,12 +137003,12 @@ ${lanes.join("\n")} if (!decl.type) { const returnType = getJSDocReturnType(decl); if (returnType) - changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType)); + changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(returnType, transformJSDocType, isTypeNode)); } } else { const jsdocType = Debug.checkDefined(getJSDocType(decl), "A JSDocType for this declaration should exist"); Debug.assert(!decl.type, "The JSDocType decl should have a type"); - changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType)); + changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(jsdocType, transformJSDocType, isTypeNode)); } } function isDeclarationWithType(node) { @@ -133461,19 +137045,19 @@ ${lanes.join("\n")} void 0, isIdentifier(tag.name) ? tag.name : tag.name.right, isOptionalJSDocPropertyLikeTag(tag) ? factory.createToken(57 /* QuestionToken */) : void 0, - tag.typeExpression && visitNode(tag.typeExpression.type, transformJSDocType) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + tag.typeExpression && visitNode(tag.typeExpression.type, transformJSDocType, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ))); setEmitFlags(typeNode, 1 /* SingleLine */); return typeNode; } function transformJSDocOptionalType(node) { - return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType), factory.createTypeReferenceNode("undefined", emptyArray)]); + return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("undefined", emptyArray)]); } function transformJSDocNullableType(node) { - return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType), factory.createTypeReferenceNode("null", emptyArray)]); + return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("null", emptyArray)]); } function transformJSDocVariadicType(node) { - return factory.createArrayTypeNode(visitNode(node.type, transformJSDocType)); + return factory.createArrayTypeNode(visitNode(node.type, transformJSDocType, isTypeNode)); } function transformJSDocFunctionType(node) { var _a2; @@ -133484,7 +137068,7 @@ ${lanes.join("\n")} const isRest = node.type.kind === 321 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; const name = node.name || (isRest ? "rest" : "arg" + index); const dotdotdot = isRest ? factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; - return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType), node.initializer); + return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType, isTypeNode), node.initializer); } function transformJSDocTypeReference(node) { let name = node.typeName; @@ -133511,7 +137095,7 @@ ${lanes.join("\n")} if ((text === "Array" || text === "Promise") && !node.typeArguments) { args = factory.createNodeArray([factory.createTypeReferenceNode("any", emptyArray)]); } else { - args = visitNodes2(node.typeArguments, transformJSDocType); + args = visitNodes2(node.typeArguments, transformJSDocType, isTypeNode); } } return factory.createTypeReferenceNode(name, args); @@ -134624,8 +138208,8 @@ ${lanes.join("\n")} function collectExportRenames(sourceFile, checker, identifiers) { const res = /* @__PURE__ */ new Map(); forEachExportReference(sourceFile, (node) => { - const { text, originalKeywordKind } = node.name; - if (!res.has(text) && (originalKeywordKind !== void 0 && isNonContextualKeyword(originalKeywordKind) || checker.resolveName( + const { text } = node.name; + if (!res.has(text) && (isIdentifierANonContextualKeyword(node.name) || checker.resolveName( text, node, 111551 /* Value */, @@ -135225,7 +138809,7 @@ ${lanes.join("\n")} "use strict"; init_ts4(); init_ts_codefix(); - errorCodes13 = [Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code]; + errorCodes13 = [Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code]; fixId12 = "convertToTypeOnlyExport"; registerCodeFix({ errorCodes: errorCodes13, @@ -135509,7 +139093,7 @@ ${lanes.join("\n")} Debug.checkDefined(exportInfo), moduleSymbol, program, - /*useNamespaceInfo*/ + /*position*/ void 0, !!isValidTypeOnlyUseSite, useRequire, @@ -135654,7 +139238,8 @@ ${lanes.join("\n")} sourceFile, newDeclarations, /*blankLineBetween*/ - true + true, + preferences ); } } @@ -135666,10 +139251,10 @@ ${lanes.join("\n")} const packageJsonImportFilter = createPackageJsonImportFilter(importingFile, preferences, host); const importMap = createExistingImportMap(program.getTypeChecker(), importingFile, program.getCompilerOptions()); return { getModuleSpecifierForBestExportInfo }; - function getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite, fromCacheOnly) { + function getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, fromCacheOnly) { const { fixes, computedWithoutCacheCount } = getImportFixes( exportInfo, - { symbolName: symbolName2, position }, + position, isValidTypeOnlyUseSite, /*useRequire*/ false, @@ -135690,7 +139275,7 @@ ${lanes.join("\n")} Debug.assertIsDefined(exportInfos); const useRequire = shouldUseRequire(sourceFile, program); const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); - const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, { symbolName: symbolName2, position }, isValidTypeOnlyUseSite, useRequire, host, preferences)); + const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); return { moduleSpecifier: fix.moduleSpecifier, codeAction: codeFixActionToCodeAction(codeActionForFix( @@ -135712,10 +139297,10 @@ ${lanes.join("\n")} const includeSymbolNameInDescription = symbolName2 !== symbolToken.text; return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences)); } - function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, host, preferences) { + function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol"); const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); - return getBestFix(getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); + return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); } function codeFixActionToCodeAction({ description: description2, changes, commands }) { return { description: description2, changes, commands }; @@ -135756,10 +139341,10 @@ ${lanes.join("\n")} } } } - function getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()), fromCacheOnly) { + function getImportFixes(exportInfos, usagePosition, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()), fromCacheOnly) { const checker = program.getTypeChecker(); const existingImports = flatMap(exportInfos, importMap.getImportsForExportInfo); - const useNamespace = useNamespaceInfo && tryUseExistingNamespaceImport(existingImports, useNamespaceInfo.symbolName, useNamespaceInfo.position, checker); + const useNamespace = usagePosition !== void 0 && tryUseExistingNamespaceImport(existingImports, usagePosition); const addToExisting = tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, program.getCompilerOptions()); if (addToExisting) { return { @@ -135772,7 +139357,7 @@ ${lanes.join("\n")} existingImports, program, sourceFile, - useNamespaceInfo == null ? void 0 : useNamespaceInfo.position, + usagePosition, isValidTypeOnlyUseSite, useRequire, host, @@ -135784,33 +139369,18 @@ ${lanes.join("\n")} fixes: [...useNamespace ? [useNamespace] : emptyArray, ...fixes] }; } - function tryUseExistingNamespaceImport(existingImports, symbolName2, position, checker) { - return firstDefined(existingImports, ({ declaration }) => { + function tryUseExistingNamespaceImport(existingImports, position) { + return firstDefined(existingImports, ({ declaration, importKind }) => { var _a2; + if (importKind !== 0 /* Named */) + return void 0; const namespacePrefix = getNamespaceLikeImportText(declaration); - const moduleSpecifier = (_a2 = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a2.text; - if (namespacePrefix && moduleSpecifier) { - const moduleSymbol = getTargetModuleFromNamespaceLikeImport(declaration, checker); - if (moduleSymbol && moduleSymbol.exports.has(escapeLeadingUnderscores(symbolName2))) { - return { kind: 0 /* UseNamespace */, namespacePrefix, position, moduleSpecifier }; - } + const moduleSpecifier = namespacePrefix && ((_a2 = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a2.text); + if (moduleSpecifier) { + return { kind: 0 /* UseNamespace */, namespacePrefix, usagePosition: position, moduleSpecifier }; } }); } - function getTargetModuleFromNamespaceLikeImport(declaration, checker) { - var _a2; - switch (declaration.kind) { - case 257 /* VariableDeclaration */: - return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 268 /* ImportEqualsDeclaration */: - return checker.getAliasedSymbol(declaration.symbol); - case 269 /* ImportDeclaration */: - const namespaceImport = tryCast((_a2 = declaration.importClause) == null ? void 0 : _a2.namedBindings, isNamespaceImport); - return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); - default: - return Debug.assertNever(declaration); - } - } function getNamespaceLikeImportText(declaration) { var _a2, _b, _c; switch (declaration.kind) { @@ -135831,7 +139401,7 @@ ${lanes.join("\n")} if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2 /* Error */) { return 2 /* Required */; } - if (compilerOptions.isolatedModules && compilerOptions.preserveValueImports && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { + if ((compilerOptions.isolatedModules && compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { return 2 /* Required */; } return 1 /* Allowed */; @@ -135926,7 +139496,7 @@ ${lanes.join("\n")} function createGetChecker(program, host) { return memoizeOne((isFromPackageJson) => isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker()); } - function getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { + function getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { const isJs = isSourceFileJS(sourceFile); const compilerOptions = program.getCompilerOptions(); const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); @@ -135949,27 +139519,47 @@ ${lanes.join("\n")} compilerOptions ); computedWithoutCacheCount += computedWithoutCache ? 1 : 0; - return mapDefined( - moduleSpecifiers, - (moduleSpecifier) => rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier) ? void 0 : ( - // `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types. - !importedSymbolHasValueMeaning && isJs && position !== void 0 ? { kind: 1 /* JsdocTypeImport */, moduleSpecifier, position, exportInfo: exportInfo2, isReExport: i > 0 } : { - kind: 3 /* AddNew */, - moduleSpecifier, - importKind: getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions), - useRequire, - addAsTypeOnly, - exportInfo: exportInfo2, - isReExport: i > 0 - } - ) - ); + return mapDefined(moduleSpecifiers, (moduleSpecifier) => { + var _a2; + if (rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier)) { + return void 0; + } + if (!importedSymbolHasValueMeaning && isJs && usagePosition !== void 0) { + return { kind: 1 /* JsdocTypeImport */, moduleSpecifier, usagePosition, exportInfo: exportInfo2, isReExport: i > 0 }; + } + const importKind = getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions); + let qualification; + if (usagePosition !== void 0 && importKind === 3 /* CommonJS */ && exportInfo2.exportKind === 0 /* Named */) { + const exportEquals = checker.resolveExternalModuleSymbol(exportInfo2.moduleSymbol); + let namespacePrefix; + if (exportEquals !== exportInfo2.moduleSymbol) { + namespacePrefix = (_a2 = getDefaultExportInfoWorker(exportEquals, checker, compilerOptions)) == null ? void 0 : _a2.name; + } + namespacePrefix || (namespacePrefix = moduleSymbolToValidIdentifier( + exportInfo2.moduleSymbol, + getEmitScriptTarget(compilerOptions), + /*forceCapitalize*/ + false + )); + qualification = { namespacePrefix, usagePosition }; + } + return { + kind: 3 /* AddNew */, + moduleSpecifier, + importKind, + useRequire, + addAsTypeOnly, + exportInfo: exportInfo2, + isReExport: i > 0, + qualification + }; + }); }); return { computedWithoutCacheCount, fixes }; } - function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { + function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { const existingDeclaration = firstDefined(existingImports, (info) => newImportInfoFromExistingSpecifier(info, isValidTypeOnlyUseSite, useRequire, program.getTypeChecker(), program.getCompilerOptions())); - return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); + return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); } function newImportInfoFromExistingSpecifier({ declaration, importKind, symbol, targetFlags }, isValidTypeOnlyUseSite, useRequire, checker, compilerOptions) { var _a2; @@ -136069,10 +139659,10 @@ ${lanes.join("\n")} const symbolName2 = umdSymbol.name; const exportInfo = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: void 0, exportKind: 3 /* UMD */, targetFlags: symbol.flags, isFromPackageJson: false }]; const useRequire = shouldUseRequire(sourceFile, program); - const position = isIdentifier(token) ? token.getStart(sourceFile) : void 0; const fixes = getImportFixes( exportInfo, - position ? { position, symbolName: symbolName2 } : void 0, + /*usagePosition*/ + void 0, /*isValidTypeOnlyUseSite*/ false, useRequire, @@ -136091,15 +139681,24 @@ ${lanes.join("\n")} if (isUMDExportSymbol(umdSymbol)) return umdSymbol; const { parent: parent2 } = token; - return isJsxOpeningLikeElement(parent2) && parent2.tagName === token || isJsxOpeningFragment(parent2) ? tryCast(checker.resolveName( - checker.getJsxNamespace(parent2), - isJsxOpeningLikeElement(parent2) ? token : parent2, - 111551 /* Value */, - /*excludeGlobals*/ - false - ), isUMDExportSymbol) : void 0; + if (isJsxOpeningLikeElement(parent2) && parent2.tagName === token || isJsxOpeningFragment(parent2)) { + const parentSymbol = checker.resolveName( + checker.getJsxNamespace(parent2), + isJsxOpeningLikeElement(parent2) ? token : parent2, + 111551 /* Value */, + /*excludeGlobals*/ + false + ); + if (isUMDExportSymbol(parentSymbol)) { + return parentSymbol; + } + } + return void 0; } function getImportKind(importingFile, exportKind, compilerOptions, forceImportKeyword) { + if (compilerOptions.verbatimModuleSyntax && (getEmitModuleKind(compilerOptions) === 1 /* CommonJS */ || importingFile.impliedNodeFormat === 1 /* CommonJS */)) { + return 3 /* CommonJS */; + } switch (exportKind) { case 0 /* Named */: return 0 /* Named */; @@ -136151,7 +139750,7 @@ ${lanes.join("\n")} const useRequire = shouldUseRequire(sourceFile, program); const exportInfo = getExportInfos(symbolName2, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences); return arrayFrom( - flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, { symbolName: symbolName2, position: symbolToken.getStart(sourceFile) }, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes), + flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, symbolToken.getStart(sourceFile), isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes), (fix) => ({ fix, symbolName: symbolName2, errorIdentifierText: symbolToken.text, isJsxNamespaceFix: symbolName2 !== symbolToken.text }) ); }); @@ -136221,7 +139820,7 @@ ${lanes.join("\n")} cancellationToken.throwIfCancellationRequested(); const compilerOptions = program2.getCompilerOptions(); const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName2 || moduleSymbolToValidIdentifier(moduleSymbol, getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName2) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { + if (defaultInfo && (defaultInfo.name === symbolName2 || moduleSymbolToValidIdentifier(moduleSymbol, getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName2) && symbolHasMeaning(defaultInfo.resolvedSymbol, currentTokenMeaning)) { addSymbol(moduleSymbol, sourceFile, defaultInfo.symbol, defaultInfo.exportKind, program2, isFromPackageJson); } const exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); @@ -136278,23 +139877,27 @@ ${lanes.join("\n")} return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifierWithoutQuotes] : [Diagnostics.Update_import_from_0, moduleSpecifierWithoutQuotes]; } case 3 /* AddNew */: { - const { importKind, moduleSpecifier, addAsTypeOnly, useRequire } = fix; + const { importKind, moduleSpecifier, addAsTypeOnly, useRequire, qualification } = fix; const getDeclarations = useRequire ? getNewRequires : getNewImports; const defaultImport = importKind === 1 /* Default */ ? { name: symbolName2, addAsTypeOnly } : void 0; const namedImports = importKind === 0 /* Named */ ? [{ name: symbolName2, addAsTypeOnly }] : void 0; - const namespaceLikeImport = importKind === 2 /* Namespace */ || importKind === 3 /* CommonJS */ ? { importKind, name: symbolName2, addAsTypeOnly } : void 0; + const namespaceLikeImport = importKind === 2 /* Namespace */ || importKind === 3 /* CommonJS */ ? { importKind, name: (qualification == null ? void 0 : qualification.namespacePrefix) || symbolName2, addAsTypeOnly } : void 0; insertImports( changes, sourceFile, getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport), /*blankLineBetween*/ - true + true, + preferences ); + if (qualification) { + addNamespaceQualifier(changes, sourceFile, qualification); + } return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifier] : [Diagnostics.Add_import_from_0, moduleSpecifier]; } case 4 /* PromoteTypeOnly */: { const { typeOnlyAliasDeclaration } = fix; - const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile); + const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile, preferences); return promotedDeclaration.kind === 273 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; } default: @@ -136305,12 +139908,12 @@ ${lanes.join("\n")} var _a2, _b; return promotedDeclaration.kind === 268 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } - function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile) { - const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules; + function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) { + const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax; switch (aliasDeclaration.kind) { case 273 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { - const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements); + const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements, preferences); if (aliasDeclaration.parent.elements.length > 1 && sortKind) { changes.delete(sourceFile, aliasDeclaration); const newSpecifier = factory.updateImportSpecifier( @@ -136320,7 +139923,8 @@ ${lanes.join("\n")} aliasDeclaration.propertyName, aliasDeclaration.name ); - const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, sortKind === 2 /* CaseInsensitive */); + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); + const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, comparer); changes.insertImportSpecifierAtIndex(sourceFile, newSpecifier, aliasDeclaration.parent, insertionIndex); } else { changes.deleteRange(sourceFile, aliasDeclaration.getFirstToken()); @@ -136348,7 +139952,7 @@ ${lanes.join("\n")} if (convertExistingToTypeOnly) { const namedImports = tryCast(importClause.namedBindings, isNamedImports); if (namedImports && namedImports.elements.length > 1) { - if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements) && aliasDeclaration.kind === 273 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { + if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements, preferences) && aliasDeclaration.kind === 273 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { changes.delete(sourceFile, aliasDeclaration); changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); } @@ -136379,7 +139983,7 @@ ${lanes.join("\n")} } const promoteFromTypeOnly2 = clause.isTypeOnly && some([defaultImport, ...namedImports], (i) => (i == null ? void 0 : i.addAsTypeOnly) === 4 /* NotAllowed */); const existingSpecifiers = clause.namedBindings && ((_a2 = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a2.elements); - const convertExistingToTypeOnly = promoteFromTypeOnly2 && compilerOptions.preserveValueImports && compilerOptions.isolatedModules; + const convertExistingToTypeOnly = promoteFromTypeOnly2 && (compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax); if (defaultImport) { Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " }); @@ -136389,14 +139993,15 @@ ${lanes.join("\n")} if (typeof preferences.organizeImportsIgnoreCase === "boolean") { ignoreCaseForSorting = preferences.organizeImportsIgnoreCase; } else if (existingSpecifiers) { - const targetImportSorting = ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers); + const targetImportSorting = ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences); if (targetImportSorting !== 3 /* Both */) { ignoreCaseForSorting = targetImportSorting === 2 /* CaseInsensitive */; } } if (ignoreCaseForSorting === void 0) { - ignoreCaseForSorting = ts_OrganizeImports_exports.detectSorting(sourceFile) === 2 /* CaseInsensitive */; + ignoreCaseForSorting = ts_OrganizeImports_exports.detectSorting(sourceFile, preferences) === 2 /* CaseInsensitive */; } + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, ignoreCaseForSorting); const newSpecifiers = stableSort( namedImports.map((namedImport) => factory.createImportSpecifier( (!clause.isTypeOnly || promoteFromTypeOnly2) && needsTypeOnly(namedImport), @@ -136404,12 +140009,12 @@ ${lanes.join("\n")} void 0, factory.createIdentifier(namedImport.name) )), - (s1, s2) => ts_OrganizeImports_exports.compareImportOrExportSpecifiers(s1, s2, ignoreCaseForSorting) + (s1, s2) => ts_OrganizeImports_exports.compareImportOrExportSpecifiers(s1, s2, comparer) ); - const specifierSort = (existingSpecifiers == null ? void 0 : existingSpecifiers.length) && ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers); + const specifierSort = (existingSpecifiers == null ? void 0 : existingSpecifiers.length) && ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences); if (specifierSort && !(ignoreCaseForSorting && specifierSort === 1 /* CaseSensitive */)) { for (const spec of newSpecifiers) { - const insertionIndex = convertExistingToTypeOnly && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, ignoreCaseForSorting); + const insertionIndex = convertExistingToTypeOnly && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, comparer); changes.insertImportSpecifierAtIndex(sourceFile, spec, clause.namedBindings, insertionIndex); } } else if (existingSpecifiers == null ? void 0 : existingSpecifiers.length) { @@ -136449,10 +140054,10 @@ ${lanes.join("\n")} } } } - function addNamespaceQualifier(changes, sourceFile, { namespacePrefix, position }) { - changes.insertText(sourceFile, position, namespacePrefix + "."); + function addNamespaceQualifier(changes, sourceFile, { namespacePrefix, usagePosition }) { + changes.insertText(sourceFile, usagePosition, namespacePrefix + "."); } - function addImportType(changes, sourceFile, { moduleSpecifier, position }, quotePreference) { + function addImportType(changes, sourceFile, { moduleSpecifier, usagePosition: position }, quotePreference) { changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference)); } function getImportTypePrefix(moduleSpecifier, quotePreference) { @@ -136928,10 +140533,10 @@ ${lanes.join("\n")} const info = errorCodeFixIdMap[errorCode]; if (!info) return emptyArray; - const { descriptions, fixId: fixId52, fixAllDescriptions } = info; + const { descriptions, fixId: fixId51, fixAllDescriptions } = info; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => dispatchChanges(changes2, context, errorCode, span.start)); return [ - createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId52, fixAllDescriptions) + createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId51, fixAllDescriptions) ]; }, fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId], @@ -138263,7 +141868,7 @@ ${lanes.join("\n")} }, fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes], getAllCodeActions: (context) => { - const { program, fixId: fixId52 } = context; + const { program, fixId: fixId51 } = context; const checker = program.getTypeChecker(); const seen = /* @__PURE__ */ new Map(); const typeDeclToMembers = /* @__PURE__ */ new Map(); @@ -138273,11 +141878,11 @@ ${lanes.join("\n")} if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + info.token.text)) { return; } - if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) { + if (fixId51 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) { addFunctionDeclaration(changes, context, info); - } else if (fixId52 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) { + } else if (fixId51 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) { addObjectLiteralProperties(changes, context, info); - } else if (fixId52 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) { + } else if (fixId51 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) { addJsxAttributes(changes, context, info); } else { if (info.kind === 1 /* Enum */) { @@ -138565,56 +142170,20 @@ ${lanes.join("\n")} } }); - // src/services/codefixes/fixEnableExperimentalDecorators.ts - function doChange12(changeTracker, configFile) { - setJsonCompilerOptionValue(changeTracker, configFile, "experimentalDecorators", factory.createTrue()); - } - var fixId27, errorCodes32; - var init_fixEnableExperimentalDecorators = __esm({ - "src/services/codefixes/fixEnableExperimentalDecorators.ts"() { - "use strict"; - init_ts4(); - init_ts_codefix(); - fixId27 = "enableExperimentalDecorators"; - errorCodes32 = [ - Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning.code - ]; - registerCodeFix({ - errorCodes: errorCodes32, - getCodeActions: function getCodeActionsToEnableExperimentalDecorators(context) { - const { configFile } = context.program.getCompilerOptions(); - if (configFile === void 0) { - return void 0; - } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => doChange12(changeTracker, configFile)); - return [createCodeFixActionWithoutFixAll(fixId27, changes, Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]; - }, - fixIds: [fixId27], - getAllCodeActions: (context) => codeFixAll(context, errorCodes32, (changes) => { - const { configFile } = context.program.getCompilerOptions(); - if (configFile === void 0) { - return void 0; - } - doChange12(changes, configFile); - }) - }); - } - }); - // src/services/codefixes/fixEnableJsxFlag.ts - function doChange13(changeTracker, configFile) { + function doChange12(changeTracker, configFile) { setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react")); } - var fixID, errorCodes33; + var fixID, errorCodes32; var init_fixEnableJsxFlag = __esm({ "src/services/codefixes/fixEnableJsxFlag.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixID = "fixEnableJsxFlag"; - errorCodes33 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; + errorCodes32 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; registerCodeFix({ - errorCodes: errorCodes33, + errorCodes: errorCodes32, getCodeActions: function getCodeActionsToFixEnableJsxFlag(context) { const { configFile } = context.program.getCompilerOptions(); if (configFile === void 0) { @@ -138622,19 +142191,19 @@ ${lanes.join("\n")} } const changes = ts_textChanges_exports.ChangeTracker.with( context, - (changeTracker) => doChange13(changeTracker, configFile) + (changeTracker) => doChange12(changeTracker, configFile) ); return [ createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) ]; }, fixIds: [fixID], - getAllCodeActions: (context) => codeFixAll(context, errorCodes33, (changes) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes32, (changes) => { const { configFile } = context.program.getCompilerOptions(); if (configFile === void 0) { return void 0; } - doChange13(changes, configFile); + doChange12(changes, configFile); }) }); } @@ -138656,7 +142225,7 @@ ${lanes.join("\n")} } return void 0; } - function doChange14(changes, sourceFile, arg, expression) { + function doChange13(changes, sourceFile, arg, expression) { const callExpression = factory.createCallExpression( factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")), /*typeArguments*/ @@ -138674,33 +142243,33 @@ ${lanes.join("\n")} const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/\'(.*)\'/) || []; return suggestion; } - var fixId28, errorCodes34; + var fixId27, errorCodes33; var init_fixNaNEquality = __esm({ "src/services/codefixes/fixNaNEquality.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId28 = "fixNaNEquality"; - errorCodes34 = [ + fixId27 = "fixNaNEquality"; + errorCodes33 = [ Diagnostics.This_condition_will_always_return_0.code ]; registerCodeFix({ - errorCodes: errorCodes34, + errorCodes: errorCodes33, getCodeActions(context) { const { sourceFile, span, program } = context; const info = getInfo8(program, sourceFile, span); if (info === void 0) return; const { suggestion, expression, arg } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, sourceFile, arg, expression)); - return [createCodeFixAction(fixId28, changes, [Diagnostics.Use_0, suggestion], fixId28, Diagnostics.Use_Number_isNaN_in_all_conditions)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange13(t, sourceFile, arg, expression)); + return [createCodeFixAction(fixId27, changes, [Diagnostics.Use_0, suggestion], fixId27, Diagnostics.Use_Number_isNaN_in_all_conditions)]; }, - fixIds: [fixId28], + fixIds: [fixId27], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes34, (changes, diag2) => { + return codeFixAll(context, errorCodes33, (changes, diag2) => { const info = getInfo8(context.program, diag2.file, createTextSpan(diag2.start, diag2.length)); if (info) { - doChange14(changes, diag2.file, info.arg, info.expression); + doChange13(changes, diag2.file, info.arg, info.expression); } }); } @@ -138756,32 +142325,32 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixPropertyAssignment.ts - function doChange15(changes, sourceFile, node) { + function doChange14(changes, sourceFile, node) { changes.replaceNode(sourceFile, node, factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer)); } function getProperty2(sourceFile, pos) { return cast(getTokenAtPosition(sourceFile, pos).parent, isShorthandPropertyAssignment); } - var fixId29, errorCodes35; + var fixId28, errorCodes34; var init_fixPropertyAssignment = __esm({ "src/services/codefixes/fixPropertyAssignment.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId29 = "fixPropertyAssignment"; - errorCodes35 = [ + fixId28 = "fixPropertyAssignment"; + errorCodes34 = [ Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code ]; registerCodeFix({ - errorCodes: errorCodes35, - fixIds: [fixId29], + errorCodes: errorCodes34, + fixIds: [fixId28], getCodeActions(context) { const { sourceFile, span } = context; const property = getProperty2(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, context.sourceFile, property)); - return [createCodeFixAction(fixId29, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId29, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile, property)); + return [createCodeFixAction(fixId28, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId28, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes, diag2) => doChange15(changes, diag2.file, getProperty2(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange14(changes, diag2.file, getProperty2(diag2.file, diag2.start))) }); } }); @@ -138807,16 +142376,16 @@ ${lanes.join("\n")} changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end }); } } - var fixId30, errorCodes36; + var fixId29, errorCodes35; var init_fixExtendsInterfaceBecomesImplements = __esm({ "src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId30 = "extendsInterfaceBecomesImplements"; - errorCodes36 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; + fixId29 = "extendsInterfaceBecomesImplements"; + errorCodes35 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; registerCodeFix({ - errorCodes: errorCodes36, + errorCodes: errorCodes35, getCodeActions(context) { const { sourceFile } = context; const nodes = getNodes2(sourceFile, context.span.start); @@ -138824,10 +142393,10 @@ ${lanes.join("\n")} return void 0; const { extendsToken, heritageClauses } = nodes; const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChanges2(t, sourceFile, extendsToken, heritageClauses)); - return [createCodeFixAction(fixId30, changes, Diagnostics.Change_extends_to_implements, fixId30, Diagnostics.Change_all_extended_interfaces_to_implements)]; + return [createCodeFixAction(fixId29, changes, Diagnostics.Change_extends_to_implements, fixId29, Diagnostics.Change_all_extended_interfaces_to_implements)]; }, - fixIds: [fixId30], - getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { + fixIds: [fixId29], + getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes, diag2) => { const nodes = getNodes2(diag2.file, diag2.start); if (nodes) doChanges2(changes, diag2.file, nodes.extendsToken, nodes.heritageClauses); @@ -138843,39 +142412,39 @@ ${lanes.join("\n")} return { node, className: diagCode === didYouMeanStaticMemberCode ? getContainingClass(node).name.text : void 0 }; } } - function doChange16(changes, sourceFile, { node, className }) { + function doChange15(changes, sourceFile, { node, className }) { suppressLeadingAndTrailingTrivia(node); changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node)); } - var fixId31, didYouMeanStaticMemberCode, errorCodes37; + var fixId30, didYouMeanStaticMemberCode, errorCodes36; var init_fixForgottenThisPropertyAccess = __esm({ "src/services/codefixes/fixForgottenThisPropertyAccess.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId31 = "forgottenThisPropertyAccess"; + fixId30 = "forgottenThisPropertyAccess"; didYouMeanStaticMemberCode = Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code; - errorCodes37 = [ + errorCodes36 = [ Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, didYouMeanStaticMemberCode ]; registerCodeFix({ - errorCodes: errorCodes37, + errorCodes: errorCodes36, getCodeActions(context) { const { sourceFile } = context; const info = getInfo9(sourceFile, context.span.start, context.errorCode); if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16(t, sourceFile, info)); - return [createCodeFixAction(fixId31, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId31, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, sourceFile, info)); + return [createCodeFixAction(fixId30, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId30, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; }, - fixIds: [fixId31], - getAllCodeActions: (context) => codeFixAll(context, errorCodes37, (changes, diag2) => { + fixIds: [fixId30], + getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { const info = getInfo9(diag2.file, diag2.start, diag2.code); if (info) - doChange16(changes, context.sourceFile, info); + doChange15(changes, context.sourceFile, info); }) }); } @@ -138885,7 +142454,7 @@ ${lanes.join("\n")} function isValidCharacter(character) { return hasProperty(htmlEntity, character); } - function doChange17(changes, preferences, sourceFile, start, useHtmlEntity) { + function doChange16(changes, preferences, sourceFile, start, useHtmlEntity) { const character = sourceFile.getText()[start]; if (!isValidCharacter(character)) { return; @@ -138893,7 +142462,7 @@ ${lanes.join("\n")} const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(sourceFile, preferences, character)}}`; changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); } - var fixIdExpression, fixIdHtmlEntity, errorCodes38, htmlEntity; + var fixIdExpression, fixIdHtmlEntity, errorCodes37, htmlEntity; var init_fixInvalidJsxCharacters = __esm({ "src/services/codefixes/fixInvalidJsxCharacters.ts"() { "use strict"; @@ -138901,16 +142470,16 @@ ${lanes.join("\n")} init_ts_codefix(); fixIdExpression = "fixInvalidJsxCharacters_expression"; fixIdHtmlEntity = "fixInvalidJsxCharacters_htmlEntity"; - errorCodes38 = [ + errorCodes37 = [ Diagnostics.Unexpected_token_Did_you_mean_or_gt.code, Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code ]; registerCodeFix({ - errorCodes: errorCodes38, + errorCodes: errorCodes37, fixIds: [fixIdExpression, fixIdHtmlEntity], getCodeActions(context) { const { sourceFile, preferences, span } = context; - const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( + const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( t, preferences, sourceFile, @@ -138918,7 +142487,7 @@ ${lanes.join("\n")} /* useHtmlEntity */ false )); - const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( + const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( t, preferences, sourceFile, @@ -138932,7 +142501,7 @@ ${lanes.join("\n")} ]; }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes38, (changes, diagnostic) => doChange17(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); + return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange16(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); } }); htmlEntity = { @@ -138943,8 +142512,8 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixUnmatchedParameter.ts - function getDeleteAction(context, { name, signature, jsDocParameterTag }) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.filterJSDocTags(context.sourceFile, signature, (t) => t !== jsDocParameterTag)); + function getDeleteAction(context, { name, jsDocHost, jsDocParameterTag }) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.filterJSDocTags(context.sourceFile, jsDocHost, (t) => t !== jsDocParameterTag)); return createCodeFixAction( deleteUnmatchedParameter, changes, @@ -138983,14 +142552,15 @@ ${lanes.join("\n")} const token = getTokenAtPosition(sourceFile, pos); if (token.parent && isJSDocParameterTag(token.parent) && isIdentifier(token.parent.name)) { const jsDocParameterTag = token.parent; + const jsDocHost = getJSDocHost(jsDocParameterTag); const signature = getHostSignatureFromJSDoc(jsDocParameterTag); - if (signature) { - return { signature, name: token.parent.name, jsDocParameterTag }; + if (jsDocHost && signature) { + return { jsDocHost, signature, name: token.parent.name, jsDocParameterTag }; } } return void 0; } - var deleteUnmatchedParameter, renameUnmatchedParameter, errorCodes39; + var deleteUnmatchedParameter, renameUnmatchedParameter, errorCodes38; var init_fixUnmatchedParameter = __esm({ "src/services/codefixes/fixUnmatchedParameter.ts"() { "use strict"; @@ -138998,12 +142568,12 @@ ${lanes.join("\n")} init_ts_codefix(); deleteUnmatchedParameter = "deleteUnmatchedParameter"; renameUnmatchedParameter = "renameUnmatchedParameter"; - errorCodes39 = [ + errorCodes38 = [ Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code ]; registerCodeFix({ fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter], - errorCodes: errorCodes39, + errorCodes: errorCodes38, getCodeActions: function getCodeActionsToFixUnmatchedParameter(context) { const { sourceFile, span } = context; const actions2 = []; @@ -139018,7 +142588,7 @@ ${lanes.join("\n")} getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context) { const tagsToSignature = /* @__PURE__ */ new Map(); return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes39, ({ file, start }) => { + eachDiagnostic(context, errorCodes38, ({ file, start }) => { const info = getInfo10(file, start); if (info) { tagsToSignature.set(info.signature, append(tagsToSignature.get(info.signature), info.jsDocParameterTag)); @@ -139067,16 +142637,16 @@ ${lanes.join("\n")} function doNamespaceImportChange(changes, sourceFile, importDeclaration, program) { ts_refactor_exports.doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, importDeclaration.parent); } - var fixId32, errorCodes40; + var fixId31, errorCodes39; var init_fixUnreferenceableDecoratorMetadata = __esm({ "src/services/codefixes/fixUnreferenceableDecoratorMetadata.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId32 = "fixUnreferenceableDecoratorMetadata"; - errorCodes40 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code]; + fixId31 = "fixUnreferenceableDecoratorMetadata"; + errorCodes39 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code]; registerCodeFix({ - errorCodes: errorCodes40, + errorCodes: errorCodes39, getCodeActions: (context) => { const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start); if (!importDeclaration) @@ -139085,14 +142655,14 @@ ${lanes.join("\n")} const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program)); let actions2; if (namespaceChanges.length) { - actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId31, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); } if (typeOnlyChanges.length) { - actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, typeOnlyChanges, Diagnostics.Convert_to_type_only_import)); + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId31, typeOnlyChanges, Diagnostics.Convert_to_type_only_import)); } return actions2; }, - fixIds: [fixId32] + fixIds: [fixId31] }); } }); @@ -139245,7 +142815,7 @@ ${lanes.join("\n")} function mayDeleteExpression(node) { return (isBinaryExpression(node.parent) && node.parent.left === node || (isPostfixUnaryExpression(node.parent) || isPrefixUnaryExpression(node.parent)) && node.parent.operand === node) && isExpressionStatement(node.parent.parent); } - var fixName3, fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer, errorCodes41; + var fixName3, fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer, errorCodes40; var init_fixUnusedIdentifier = __esm({ "src/services/codefixes/fixUnusedIdentifier.ts"() { "use strict"; @@ -139256,7 +142826,7 @@ ${lanes.join("\n")} fixIdDelete = "unusedIdentifier_delete"; fixIdDeleteImports = "unusedIdentifier_deleteImports"; fixIdInfer = "unusedIdentifier_infer"; - errorCodes41 = [ + errorCodes40 = [ Diagnostics._0_is_declared_but_its_value_is_never_read.code, Diagnostics._0_is_declared_but_never_used.code, Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, @@ -139266,7 +142836,7 @@ ${lanes.join("\n")} Diagnostics.All_type_parameters_are_unused.code ]; registerCodeFix({ - errorCodes: errorCodes41, + errorCodes: errorCodes40, getCodeActions(context) { const { errorCode, sourceFile, program, cancellationToken } = context; const checker = program.getTypeChecker(); @@ -139352,7 +142922,7 @@ ${lanes.join("\n")} const { sourceFile, program, cancellationToken } = context; const checker = program.getTypeChecker(); const sourceFiles = program.getSourceFiles(); - return codeFixAll(context, errorCodes41, (changes, diag2) => { + return codeFixAll(context, errorCodes40, (changes, diag2) => { const token = getTokenAtPosition(sourceFile, diag2.start); switch (context.fixId) { case fixIdPrefix: @@ -139424,7 +142994,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixUnreachableCode.ts - function doChange18(changes, sourceFile, start, length2, errorCode) { + function doChange17(changes, sourceFile, start, length2, errorCode) { const token = getTokenAtPosition(sourceFile, start); const statement = findAncestor(token, isStatement); if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { @@ -139472,31 +143042,31 @@ ${lanes.join("\n")} } return last2; } - var fixId33, errorCodes42; + var fixId32, errorCodes41; var init_fixUnreachableCode = __esm({ "src/services/codefixes/fixUnreachableCode.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId33 = "fixUnreachableCode"; - errorCodes42 = [Diagnostics.Unreachable_code_detected.code]; + fixId32 = "fixUnreachableCode"; + errorCodes41 = [Diagnostics.Unreachable_code_detected.code]; registerCodeFix({ - errorCodes: errorCodes42, + errorCodes: errorCodes41, getCodeActions(context) { const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken); if (syntacticDiagnostics.length) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); - return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unreachable_code, fixId33, Diagnostics.Remove_all_unreachable_code)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); + return [createCodeFixAction(fixId32, changes, Diagnostics.Remove_unreachable_code, fixId32, Diagnostics.Remove_all_unreachable_code)]; }, - fixIds: [fixId33], - getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start, diag2.length, diag2.code)) + fixIds: [fixId32], + getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange17(changes, diag2.file, diag2.start, diag2.length, diag2.code)) }); } }); // src/services/codefixes/fixUnusedLabel.ts - function doChange19(changes, sourceFile, start) { + function doChange18(changes, sourceFile, start) { const token = getTokenAtPosition(sourceFile, start); const labeledStatement = cast(token.parent, isLabeledStatement); const pos = token.getStart(sourceFile); @@ -139509,28 +143079,28 @@ ${lanes.join("\n")} ); changes.deleteRange(sourceFile, { pos, end }); } - var fixId34, errorCodes43; + var fixId33, errorCodes42; var init_fixUnusedLabel = __esm({ "src/services/codefixes/fixUnusedLabel.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId34 = "fixUnusedLabel"; - errorCodes43 = [Diagnostics.Unused_label.code]; + fixId33 = "fixUnusedLabel"; + errorCodes42 = [Diagnostics.Unused_label.code]; registerCodeFix({ - errorCodes: errorCodes43, + errorCodes: errorCodes42, getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, context.sourceFile, context.span.start)); - return [createCodeFixAction(fixId34, changes, Diagnostics.Remove_unused_label, fixId34, Diagnostics.Remove_all_unused_labels)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start)); + return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unused_label, fixId33, Diagnostics.Remove_all_unused_labels)]; }, - fixIds: [fixId34], - getAllCodeActions: (context) => codeFixAll(context, errorCodes43, (changes, diag2) => doChange19(changes, diag2.file, diag2.start)) + fixIds: [fixId33], + getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start)) }); } }); // src/services/codefixes/fixJSDocTypes.ts - function doChange20(changes, sourceFile, oldTypeNode, newType, checker) { + function doChange19(changes, sourceFile, oldTypeNode, newType, checker) { changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( newType, /*enclosingDeclaration*/ @@ -139579,7 +143149,7 @@ ${lanes.join("\n")} } return checker.getTypeFromTypeNode(node); } - var fixIdPlain, fixIdNullable, errorCodes44; + var fixIdPlain, fixIdNullable, errorCodes43; var init_fixJSDocTypes = __esm({ "src/services/codefixes/fixJSDocTypes.ts"() { "use strict"; @@ -139587,13 +143157,13 @@ ${lanes.join("\n")} init_ts_codefix(); fixIdPlain = "fixJSDocTypes_plain"; fixIdNullable = "fixJSDocTypes_nullable"; - errorCodes44 = [ + errorCodes43 = [ Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code, Diagnostics._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code, Diagnostics._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code ]; registerCodeFix({ - errorCodes: errorCodes44, + errorCodes: errorCodes43, getCodeActions(context) { const { sourceFile } = context; const checker = context.program.getTypeChecker(); @@ -139607,22 +143177,22 @@ ${lanes.join("\n")} actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); } return actions2; - function fix(type2, fixId52, fixAllDescription) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, sourceFile, typeNode, type2, checker)); - return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId52, fixAllDescription); + function fix(type2, fixId51, fixAllDescription) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, sourceFile, typeNode, type2, checker)); + return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId51, fixAllDescription); } }, fixIds: [fixIdPlain, fixIdNullable], getAllCodeActions(context) { - const { fixId: fixId52, program, sourceFile } = context; + const { fixId: fixId51, program, sourceFile } = context; const checker = program.getTypeChecker(); - return codeFixAll(context, errorCodes44, (changes, err) => { + return codeFixAll(context, errorCodes43, (changes, err) => { const info = getInfo11(err.file, err.start, checker); if (!info) return; const { typeNode, type } = info; - const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; - doChange20(changes, sourceFile, typeNode, fixedType, checker); + const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId51 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + doChange19(changes, sourceFile, typeNode, fixedType, checker); }); } }); @@ -139630,7 +143200,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixMissingCallParentheses.ts - function doChange21(changes, sourceFile, name) { + function doChange20(changes, sourceFile, name) { changes.replaceNodeWithText(sourceFile, name, `${name.text}()`); } function getCallName(sourceFile, start) { @@ -139647,31 +143217,31 @@ ${lanes.join("\n")} } return void 0; } - var fixId35, errorCodes45; + var fixId34, errorCodes44; var init_fixMissingCallParentheses = __esm({ "src/services/codefixes/fixMissingCallParentheses.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId35 = "fixMissingCallParentheses"; - errorCodes45 = [ + fixId34 = "fixMissingCallParentheses"; + errorCodes44 = [ Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code ]; registerCodeFix({ - errorCodes: errorCodes45, - fixIds: [fixId35], + errorCodes: errorCodes44, + fixIds: [fixId34], getCodeActions(context) { const { sourceFile, span } = context; const callName = getCallName(sourceFile, span.start); if (!callName) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, context.sourceFile, callName)); - return [createCodeFixAction(fixId35, changes, Diagnostics.Add_missing_call_parentheses, fixId35, Diagnostics.Add_all_missing_call_parentheses)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, context.sourceFile, callName)); + return [createCodeFixAction(fixId34, changes, Diagnostics.Add_missing_call_parentheses, fixId34, Diagnostics.Add_all_missing_call_parentheses)]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes45, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => { const callName = getCallName(diag2.file, diag2.start); if (callName) - doChange21(changes, diag2.file, callName); + doChange20(changes, diag2.file, callName); }) }); } @@ -139713,7 +143283,7 @@ ${lanes.join("\n")} returnType: getReturnType(containingFunction) }; } - function doChange22(changes, sourceFile, { insertBefore, returnType }) { + function doChange21(changes, sourceFile, { insertBefore, returnType }) { if (returnType) { const entityName = getEntityNameFromTypeNode(returnType); if (!entityName || entityName.kind !== 79 /* Identifier */ || entityName.text !== "Promise") { @@ -139722,36 +143292,36 @@ ${lanes.join("\n")} } changes.insertModifierBefore(sourceFile, 132 /* AsyncKeyword */, insertBefore); } - var fixId36, errorCodes46; + var fixId35, errorCodes45; var init_fixAwaitInSyncFunction = __esm({ "src/services/codefixes/fixAwaitInSyncFunction.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId36 = "fixAwaitInSyncFunction"; - errorCodes46 = [ + fixId35 = "fixAwaitInSyncFunction"; + errorCodes45 = [ Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code ]; registerCodeFix({ - errorCodes: errorCodes46, + errorCodes: errorCodes45, getCodeActions(context) { const { sourceFile, span } = context; const nodes = getNodes3(sourceFile, span.start); if (!nodes) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange22(t, sourceFile, nodes)); - return [createCodeFixAction(fixId36, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId36, Diagnostics.Add_all_missing_async_modifiers)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, sourceFile, nodes)); + return [createCodeFixAction(fixId35, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId35, Diagnostics.Add_all_missing_async_modifiers)]; }, - fixIds: [fixId36], + fixIds: [fixId35], getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) { const seen = /* @__PURE__ */ new Map(); - return codeFixAll(context, errorCodes46, (changes, diag2) => { + return codeFixAll(context, errorCodes45, (changes, diag2) => { const nodes = getNodes3(diag2.file, diag2.start); if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return; - doChange22(changes, context.sourceFile, nodes); + doChange21(changes, context.sourceFile, nodes); }); } }); @@ -139759,7 +143329,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixPropertyOverrideAccessor.ts - function doChange23(file, start, length2, code, context) { + function doChange22(file, start, length2, code, context) { let startPosition; let endPosition; if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) { @@ -139786,28 +143356,28 @@ ${lanes.join("\n")} } return generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, Diagnostics.Generate_get_and_set_accessors.message); } - var errorCodes47, fixId37; + var errorCodes46, fixId36; var init_fixPropertyOverrideAccessor = __esm({ "src/services/codefixes/fixPropertyOverrideAccessor.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - errorCodes47 = [ + errorCodes46 = [ Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code, Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code ]; - fixId37 = "fixPropertyOverrideAccessor"; + fixId36 = "fixPropertyOverrideAccessor"; registerCodeFix({ - errorCodes: errorCodes47, + errorCodes: errorCodes46, getCodeActions(context) { - const edits = doChange23(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); + const edits = doChange22(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); if (edits) { - return [createCodeFixAction(fixId37, edits, Diagnostics.Generate_get_and_set_accessors, fixId37, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; + return [createCodeFixAction(fixId36, edits, Diagnostics.Generate_get_and_set_accessors, fixId36, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; } }, - fixIds: [fixId37], - getAllCodeActions: (context) => codeFixAll(context, errorCodes47, (changes, diag2) => { - const edits = doChange23(diag2.file, diag2.start, diag2.length, diag2.code, context); + fixIds: [fixId36], + getAllCodeActions: (context) => codeFixAll(context, errorCodes46, (changes, diag2) => { + const edits = doChange22(diag2.file, diag2.start, diag2.length, diag2.code, context); if (edits) { for (const edit of edits) { changes.pushRaw(context.sourceFile, edit); @@ -139854,7 +143424,7 @@ ${lanes.join("\n")} } return errorCode; } - function doChange24(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { + function doChange23(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { if (!isParameterPropertyModifier(token.kind) && token.kind !== 79 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 108 /* ThisKeyword */) { return void 0; } @@ -140748,14 +144318,14 @@ ${lanes.join("\n")} } } } - var fixId38, errorCodes48; + var fixId37, errorCodes47; var init_inferFromUsage = __esm({ "src/services/codefixes/inferFromUsage.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId38 = "inferFromUsage"; - errorCodes48 = [ + fixId37 = "inferFromUsage"; + errorCodes47 = [ // Variable declarations Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, // Variable uses @@ -140789,13 +144359,13 @@ ${lanes.join("\n")} Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code ]; registerCodeFix({ - errorCodes: errorCodes48, + errorCodes: errorCodes47, getCodeActions(context) { const { sourceFile, program, span: { start }, errorCode, cancellationToken, host, preferences } = context; const token = getTokenAtPosition(sourceFile, start); let declaration; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - declaration = doChange24( + declaration = doChange23( changes2, sourceFile, token, @@ -140809,14 +144379,14 @@ ${lanes.join("\n")} ); }); const name = declaration && getNameOfDeclaration(declaration); - return !name || changes.length === 0 ? void 0 : [createCodeFixAction(fixId38, changes, [getDiagnostic(errorCode, token), getTextOfNode(name)], fixId38, Diagnostics.Infer_all_types_from_usage)]; + return !name || changes.length === 0 ? void 0 : [createCodeFixAction(fixId37, changes, [getDiagnostic(errorCode, token), getTextOfNode(name)], fixId37, Diagnostics.Infer_all_types_from_usage)]; }, - fixIds: [fixId38], + fixIds: [fixId37], getAllCodeActions(context) { const { sourceFile, program, cancellationToken, host, preferences } = context; const markSeen = nodeSeenTracker(); - return codeFixAll(context, errorCodes48, (changes, err) => { - doChange24(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); + return codeFixAll(context, errorCodes47, (changes, err) => { + doChange23(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); }); } }); @@ -140847,22 +144417,22 @@ ${lanes.join("\n")} return { returnTypeNode, returnType, promisedTypeNode, promisedType }; } } - function doChange25(changes, sourceFile, returnTypeNode, promisedTypeNode) { + function doChange24(changes, sourceFile, returnTypeNode, promisedTypeNode) { changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode])); } - var fixId39, errorCodes49; + var fixId38, errorCodes48; var init_fixReturnTypeInAsyncFunction = __esm({ "src/services/codefixes/fixReturnTypeInAsyncFunction.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId39 = "fixReturnTypeInAsyncFunction"; - errorCodes49 = [ + fixId38 = "fixReturnTypeInAsyncFunction"; + errorCodes48 = [ Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code ]; registerCodeFix({ - errorCodes: errorCodes49, - fixIds: [fixId39], + errorCodes: errorCodes48, + fixIds: [fixId38], getCodeActions: function getCodeActionsToFixReturnTypeInAsyncFunction(context) { const { sourceFile, program, span } = context; const checker = program.getTypeChecker(); @@ -140871,23 +144441,23 @@ ${lanes.join("\n")} return void 0; } const { returnTypeNode, returnType, promisedTypeNode, promisedType } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, sourceFile, returnTypeNode, promisedTypeNode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, sourceFile, returnTypeNode, promisedTypeNode)); return [createCodeFixAction( - fixId39, + fixId38, changes, [ Diagnostics.Replace_0_with_Promise_1, checker.typeToString(returnType), checker.typeToString(promisedType) ], - fixId39, + fixId38, Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions )]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes49, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes48, (changes, diag2) => { const info = getInfo12(diag2.file, context.program.getTypeChecker(), diag2.start); if (info) { - doChange25(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); + doChange24(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); } }) }); @@ -140901,20 +144471,20 @@ ${lanes.join("\n")} changes.insertCommentBeforeLine(sourceFile, lineNumber, position, " @ts-ignore"); } } - var fixName4, fixId40, errorCodes50; + var fixName4, fixId39, errorCodes49; var init_disableJsDiagnostics = __esm({ "src/services/codefixes/disableJsDiagnostics.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixName4 = "disableJsDiagnostics"; - fixId40 = "disableJsDiagnostics"; - errorCodes50 = mapDefined(Object.keys(Diagnostics), (key) => { + fixId39 = "disableJsDiagnostics"; + errorCodes49 = mapDefined(Object.keys(Diagnostics), (key) => { const diag2 = Diagnostics[key]; return diag2.category === 1 /* Error */ ? diag2.code : void 0; }); registerCodeFix({ - errorCodes: errorCodes50, + errorCodes: errorCodes49, getCodeActions: function getCodeActionsToDisableJsDiagnostics(context) { const { sourceFile, program, span, host, formatContext } = context; if (!isInJSFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { @@ -140932,14 +144502,14 @@ ${lanes.join("\n")} ) ]; if (ts_textChanges_exports.isValidLocationToAddComment(sourceFile, span.start)) { - fixes.unshift(createCodeFixAction(fixName4, ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange8(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId40, Diagnostics.Add_ts_ignore_to_all_error_messages)); + fixes.unshift(createCodeFixAction(fixName4, ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange8(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId39, Diagnostics.Add_ts_ignore_to_all_error_messages)); } return fixes; }, - fixIds: [fixId40], + fixIds: [fixId39], getAllCodeActions: (context) => { const seenLines = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes50, (changes, diag2) => { + return codeFixAll(context, errorCodes49, (changes, diag2) => { if (ts_textChanges_exports.isValidLocationToAddComment(diag2.file, diag2.start)) { makeChange8(changes, diag2.file, diag2.start, seenLines); } @@ -141549,18 +145119,17 @@ ${lanes.join("\n")} } function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) { let symbols; - const typeNode = visitNode(importTypeNode, visit); + const typeNode = visitNode(importTypeNode, visit, isTypeNode); if (symbols && typeNode) { return { typeNode, symbols }; } function visit(node) { - var _a2; if (isLiteralImportTypeNode(node) && node.qualifier) { const firstIdentifier = getFirstIdentifier(node.qualifier); const name = getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget); const qualifier = name !== firstIdentifier.text ? replaceFirstIdentifierOfEntityName(node.qualifier, factory.createIdentifier(name)) : node.qualifier; symbols = append(symbols, firstIdentifier.symbol); - const typeArguments = (_a2 = node.typeArguments) == null ? void 0 : _a2.map(visit); + const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode); return factory.createTypeReferenceNode(qualifier, typeArguments); } return visitEachChild(node, visit, nullTransformationContext); @@ -141711,9 +145280,7 @@ ${lanes.join("\n")} return factory.createGetAccessorDeclaration( modifiers, accessorName, - /*parameters*/ - void 0, - // TODO: GH#18217 + [], type, factory.createBlock( [ @@ -142038,7 +145605,7 @@ ${lanes.join("\n")} } return void 0; } - var fixName6, fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer, errorCodes51; + var fixName6, fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer, errorCodes50; var init_fixStrictClassInitialization = __esm({ "src/services/codefixes/fixStrictClassInitialization.ts"() { "use strict"; @@ -142048,9 +145615,9 @@ ${lanes.join("\n")} fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; fixIdAddInitializer = "addMissingPropertyInitializer"; - errorCodes51 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; + errorCodes50 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; registerCodeFix({ - errorCodes: errorCodes51, + errorCodes: errorCodes50, getCodeActions: function getCodeActionsForStrictClassInitializationErrors(context) { const info = getInfo13(context.sourceFile, context.span.start); if (!info) @@ -142063,7 +145630,7 @@ ${lanes.join("\n")} }, fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes51, (changes, diag2) => { + return codeFixAll(context, errorCodes50, (changes, diag2) => { const info = getInfo13(diag2.file, diag2.start); if (!info) return; @@ -142091,7 +145658,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/requireInTs.ts - function doChange26(changes, sourceFile, info) { + function doChange25(changes, sourceFile, info) { const { allowSyntheticDefaults, defaultImportName, namedImports, statement, required } = info; changes.replaceNode(sourceFile, statement, defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( /*modifiers*/ @@ -142153,29 +145720,29 @@ ${lanes.join("\n")} return factory.createNamedImports(importSpecifiers); } } - var fixId41, errorCodes52; + var fixId40, errorCodes51; var init_requireInTs = __esm({ "src/services/codefixes/requireInTs.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId41 = "requireInTs"; - errorCodes52 = [Diagnostics.require_call_may_be_converted_to_an_import.code]; + fixId40 = "requireInTs"; + errorCodes51 = [Diagnostics.require_call_may_be_converted_to_an_import.code]; registerCodeFix({ - errorCodes: errorCodes52, + errorCodes: errorCodes51, getCodeActions(context) { const info = getInfo14(context.sourceFile, context.program, context.span.start); if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, context.sourceFile, info)); - return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_require_to_import, fixId41, Diagnostics.Convert_all_require_to_import)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, context.sourceFile, info)); + return [createCodeFixAction(fixId40, changes, Diagnostics.Convert_require_to_import, fixId40, Diagnostics.Convert_all_require_to_import)]; }, - fixIds: [fixId41], - getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { + fixIds: [fixId40], + getAllCodeActions: (context) => codeFixAll(context, errorCodes51, (changes, diag2) => { const info = getInfo14(diag2.file, context.program, diag2.start); if (info) { - doChange26(changes, context.sourceFile, info); + doChange25(changes, context.sourceFile, info); } }) }); @@ -142195,7 +145762,7 @@ ${lanes.join("\n")} return { importNode, name, moduleSpecifier: importNode.moduleSpecifier }; } } - function doChange27(changes, sourceFile, info, preferences) { + function doChange26(changes, sourceFile, info, preferences) { changes.replaceNode(sourceFile, info.importNode, makeImport( info.name, /*namedImports*/ @@ -142204,29 +145771,29 @@ ${lanes.join("\n")} getQuotePreference(sourceFile, preferences) )); } - var fixId42, errorCodes53; + var fixId41, errorCodes52; var init_useDefaultImport = __esm({ "src/services/codefixes/useDefaultImport.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId42 = "useDefaultImport"; - errorCodes53 = [Diagnostics.Import_may_be_converted_to_a_default_import.code]; + fixId41 = "useDefaultImport"; + errorCodes52 = [Diagnostics.Import_may_be_converted_to_a_default_import.code]; registerCodeFix({ - errorCodes: errorCodes53, + errorCodes: errorCodes52, getCodeActions(context) { const { sourceFile, span: { start } } = context; const info = getInfo15(sourceFile, start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, info, context.preferences)); - return [createCodeFixAction(fixId42, changes, Diagnostics.Convert_to_default_import, fixId42, Diagnostics.Convert_all_to_default_imports)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, sourceFile, info, context.preferences)); + return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_to_default_import, fixId41, Diagnostics.Convert_all_to_default_imports)]; }, - fixIds: [fixId42], - getAllCodeActions: (context) => codeFixAll(context, errorCodes53, (changes, diag2) => { + fixIds: [fixId41], + getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { const info = getInfo15(diag2.file, diag2.start); if (info) - doChange27(changes, diag2.file, info, context.preferences); + doChange26(changes, diag2.file, info, context.preferences); }) }); } @@ -142241,27 +145808,27 @@ ${lanes.join("\n")} const newText = numericLiteral.getText(sourceFile) + "n"; changeTracker.replaceNode(sourceFile, numericLiteral, factory.createBigIntLiteral(newText)); } - var fixId43, errorCodes54; + var fixId42, errorCodes53; var init_useBigintLiteral = __esm({ "src/services/codefixes/useBigintLiteral.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId43 = "useBigintLiteral"; - errorCodes54 = [ + fixId42 = "useBigintLiteral"; + errorCodes53 = [ Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code ]; registerCodeFix({ - errorCodes: errorCodes54, + errorCodes: errorCodes53, getCodeActions: function getCodeActionsToUseBigintLiteral(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange9(t, context.sourceFile, context.span)); if (changes.length > 0) { - return [createCodeFixAction(fixId43, changes, Diagnostics.Convert_to_a_bigint_numeric_literal, fixId43, Diagnostics.Convert_all_to_bigint_numeric_literals)]; + return [createCodeFixAction(fixId42, changes, Diagnostics.Convert_to_a_bigint_numeric_literal, fixId42, Diagnostics.Convert_all_to_bigint_numeric_literals)]; } }, - fixIds: [fixId43], + fixIds: [fixId42], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes54, (changes, diag2) => makeChange9(changes, diag2.file, diag2)); + return codeFixAll(context, errorCodes53, (changes, diag2) => makeChange9(changes, diag2.file, diag2)); } }); } @@ -142274,7 +145841,7 @@ ${lanes.join("\n")} Debug.assert(token.parent.kind === 202 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } - function doChange28(changes, sourceFile, importType) { + function doChange27(changes, sourceFile, importType) { const newTypeNode = factory.updateImportTypeNode( importType, importType.argument, @@ -142286,25 +145853,25 @@ ${lanes.join("\n")} ); changes.replaceNode(sourceFile, importType, newTypeNode); } - var fixIdAddMissingTypeof, fixId44, errorCodes55; + var fixIdAddMissingTypeof, fixId43, errorCodes54; var init_fixAddModuleReferTypeMissingTypeof = __esm({ "src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixIdAddMissingTypeof = "fixAddModuleReferTypeMissingTypeof"; - fixId44 = fixIdAddMissingTypeof; - errorCodes55 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code]; + fixId43 = fixIdAddMissingTypeof; + errorCodes54 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code]; registerCodeFix({ - errorCodes: errorCodes55, + errorCodes: errorCodes54, getCodeActions: function getCodeActionsToAddMissingTypeof(context) { const { sourceFile, span } = context; const importType = getImportTypeNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, importType)); - return [createCodeFixAction(fixId44, changes, Diagnostics.Add_missing_typeof, fixId44, Diagnostics.Add_missing_typeof)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, importType)); + return [createCodeFixAction(fixId43, changes, Diagnostics.Add_missing_typeof, fixId43, Diagnostics.Add_missing_typeof)]; }, - fixIds: [fixId44], - getAllCodeActions: (context) => codeFixAll(context, errorCodes55, (changes, diag2) => doChange28(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) + fixIds: [fixId43], + getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange27(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) }); } }); @@ -142323,7 +145890,7 @@ ${lanes.join("\n")} return void 0; return binaryExpr; } - function doChange29(changeTracker, sf, node) { + function doChange28(changeTracker, sf, node) { const jsx = flattenInvalidBinaryExpr(node); if (jsx) changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment())); @@ -142346,30 +145913,30 @@ ${lanes.join("\n")} return void 0; } } - var fixID2, errorCodes56; + var fixID2, errorCodes55; var init_wrapJsxInFragment = __esm({ "src/services/codefixes/wrapJsxInFragment.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixID2 = "wrapJsxInFragment"; - errorCodes56 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code]; + errorCodes55 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code]; registerCodeFix({ - errorCodes: errorCodes56, + errorCodes: errorCodes55, getCodeActions: function getCodeActionsToWrapJsxInFragment(context) { const { sourceFile, span } = context; const node = findNodeToFix(sourceFile, span.start); if (!node) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, node)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, node)); return [createCodeFixAction(fixID2, changes, Diagnostics.Wrap_in_JSX_fragment, fixID2, Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]; }, fixIds: [fixID2], - getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes55, (changes, diag2) => { const node = findNodeToFix(context.sourceFile, diag2.start); if (!node) return void 0; - doChange29(changes, context.sourceFile, node); + doChange28(changes, context.sourceFile, node); }) }); } @@ -142389,7 +145956,7 @@ ${lanes.join("\n")} function createTypeAliasFromInterface(declaration, type) { return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type); } - function doChange30(changes, sourceFile, { indexSignature, container }) { + function doChange29(changes, sourceFile, { indexSignature, container }) { const members = isInterfaceDeclaration(container) ? container.members : container.type.members; const otherMembers = members.filter((member) => !isIndexSignatureDeclaration(member)); const parameter = first(indexSignature.parameters); @@ -142416,48 +145983,48 @@ ${lanes.join("\n")} ]); changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType)); } - var fixId45, errorCodes57; + var fixId44, errorCodes56; var init_convertToMappedObjectType = __esm({ "src/services/codefixes/convertToMappedObjectType.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId45 = "fixConvertToMappedObjectType"; - errorCodes57 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; + fixId44 = "fixConvertToMappedObjectType"; + errorCodes56 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; registerCodeFix({ - errorCodes: errorCodes57, + errorCodes: errorCodes56, getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) { const { sourceFile, span } = context; const info = getInfo16(sourceFile, span.start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, info)); const name = idText(info.container.name); - return [createCodeFixAction(fixId45, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId45, [Diagnostics.Convert_0_to_mapped_object_type, name])]; + return [createCodeFixAction(fixId44, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId44, [Diagnostics.Convert_0_to_mapped_object_type, name])]; }, - fixIds: [fixId45], - getAllCodeActions: (context) => codeFixAll(context, errorCodes57, (changes, diag2) => { + fixIds: [fixId44], + getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { const info = getInfo16(diag2.file, diag2.start); if (info) - doChange30(changes, diag2.file, info); + doChange29(changes, diag2.file, info); }) }); } }); // src/services/codefixes/removeAccidentalCallParentheses.ts - var fixId46, errorCodes58; + var fixId45, errorCodes57; var init_removeAccidentalCallParentheses = __esm({ "src/services/codefixes/removeAccidentalCallParentheses.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId46 = "removeAccidentalCallParentheses"; - errorCodes58 = [ + fixId45 = "removeAccidentalCallParentheses"; + errorCodes57 = [ Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code ]; registerCodeFix({ - errorCodes: errorCodes58, + errorCodes: errorCodes57, getCodeActions(context) { const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression); if (!callExpression) { @@ -142466,9 +146033,9 @@ ${lanes.join("\n")} const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { t.deleteRange(context.sourceFile, { pos: callExpression.expression.end, end: callExpression.end }); }); - return [createCodeFixActionWithoutFixAll(fixId46, changes, Diagnostics.Remove_parentheses)]; + return [createCodeFixActionWithoutFixAll(fixId45, changes, Diagnostics.Remove_parentheses)]; }, - fixIds: [fixId46] + fixIds: [fixId45] }); } }); @@ -142497,27 +146064,27 @@ ${lanes.join("\n")} } changeTracker.replaceNode(sourceFile, expressionToReplace, awaitExpression.expression); } - var fixId47, errorCodes59; + var fixId46, errorCodes58; var init_removeUnnecessaryAwait = __esm({ "src/services/codefixes/removeUnnecessaryAwait.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId47 = "removeUnnecessaryAwait"; - errorCodes59 = [ + fixId46 = "removeUnnecessaryAwait"; + errorCodes58 = [ Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code ]; registerCodeFix({ - errorCodes: errorCodes59, + errorCodes: errorCodes58, getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span)); if (changes.length > 0) { - return [createCodeFixAction(fixId47, changes, Diagnostics.Remove_unnecessary_await, fixId47, Diagnostics.Remove_all_unnecessary_uses_of_await)]; + return [createCodeFixAction(fixId46, changes, Diagnostics.Remove_unnecessary_await, fixId46, Diagnostics.Remove_all_unnecessary_uses_of_await)]; } }, - fixIds: [fixId47], + fixIds: [fixId46], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes59, (changes, diag2) => makeChange10(changes, diag2.file, diag2)); + return codeFixAll(context, errorCodes58, (changes, diag2) => makeChange10(changes, diag2.file, diag2)); } }); } @@ -142559,26 +146126,26 @@ ${lanes.join("\n")} importDeclaration.assertClause )); } - var errorCodes60, fixId48; + var errorCodes59, fixId47; var init_splitTypeOnlyImport = __esm({ "src/services/codefixes/splitTypeOnlyImport.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - errorCodes60 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; - fixId48 = "splitTypeOnlyImport"; + errorCodes59 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; + fixId47 = "splitTypeOnlyImport"; registerCodeFix({ - errorCodes: errorCodes60, - fixIds: [fixId48], + errorCodes: errorCodes59, + fixIds: [fixId47], getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { return splitTypeOnlyImport(t, getImportDeclaration2(context.sourceFile, context.span), context); }); if (changes.length) { - return [createCodeFixAction(fixId48, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId48, Diagnostics.Split_all_invalid_type_only_imports)]; + return [createCodeFixAction(fixId47, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId47, Diagnostics.Split_all_invalid_type_only_imports)]; } }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes60, (changes, error) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes59, (changes, error) => { splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error), context); }) }); @@ -142600,43 +146167,43 @@ ${lanes.join("\n")} return; return { symbol, token: constToken }; } - function doChange31(changes, sourceFile, token) { + function doChange30(changes, sourceFile, token) { changes.replaceNode(sourceFile, token, factory.createToken(119 /* LetKeyword */)); } - var fixId49, errorCodes61; + var fixId48, errorCodes60; var init_convertConstToLet = __esm({ "src/services/codefixes/convertConstToLet.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId49 = "fixConvertConstToLet"; - errorCodes61 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; + fixId48 = "fixConvertConstToLet"; + errorCodes60 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; registerCodeFix({ - errorCodes: errorCodes61, + errorCodes: errorCodes60, getCodeActions: function getCodeActionsToConvertConstToLet(context) { const { sourceFile, span, program } = context; const info = getInfo17(sourceFile, span.start, program); if (info === void 0) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info.token)); - return [createCodeFixActionMaybeFixAll(fixId49, changes, Diagnostics.Convert_const_to_let, fixId49, Diagnostics.Convert_all_const_to_let)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info.token)); + return [createCodeFixActionMaybeFixAll(fixId48, changes, Diagnostics.Convert_const_to_let, fixId48, Diagnostics.Convert_all_const_to_let)]; }, getAllCodeActions: (context) => { const { program } = context; const seen = /* @__PURE__ */ new Map(); return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes61, (diag2) => { + eachDiagnostic(context, errorCodes60, (diag2) => { const info = getInfo17(diag2.file, diag2.start, program); if (info) { if (addToSeen(seen, getSymbolId(info.symbol))) { - return doChange31(changes, diag2.file, info.token); + return doChange30(changes, diag2.file, info.token); } } return void 0; }); })); }, - fixIds: [fixId49] + fixIds: [fixId48] }); } }); @@ -142646,40 +146213,40 @@ ${lanes.join("\n")} const node = getTokenAtPosition(sourceFile, pos); return node.kind === 26 /* SemicolonToken */ && node.parent && (isObjectLiteralExpression(node.parent) || isArrayLiteralExpression(node.parent)) ? { node } : void 0; } - function doChange32(changes, sourceFile, { node }) { + function doChange31(changes, sourceFile, { node }) { const newNode = factory.createToken(27 /* CommaToken */); changes.replaceNode(sourceFile, node, newNode); } - var fixId50, expectedErrorCode, errorCodes62; + var fixId49, expectedErrorCode, errorCodes61; var init_fixExpectedComma = __esm({ "src/services/codefixes/fixExpectedComma.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId50 = "fixExpectedComma"; + fixId49 = "fixExpectedComma"; expectedErrorCode = Diagnostics._0_expected.code; - errorCodes62 = [expectedErrorCode]; + errorCodes61 = [expectedErrorCode]; registerCodeFix({ - errorCodes: errorCodes62, + errorCodes: errorCodes61, getCodeActions(context) { const { sourceFile } = context; const info = getInfo18(sourceFile, context.span.start, context.errorCode); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info)); return [createCodeFixAction( - fixId50, + fixId49, changes, [Diagnostics.Change_0_to_1, ";", ","], - fixId50, + fixId49, [Diagnostics.Change_0_to_1, ";", ","] )]; }, - fixIds: [fixId50], - getAllCodeActions: (context) => codeFixAll(context, errorCodes62, (changes, diag2) => { + fixIds: [fixId49], + getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, diag2) => { const info = getInfo18(diag2.file, diag2.start, diag2.code); if (info) - doChange32(changes, context.sourceFile, info); + doChange31(changes, context.sourceFile, info); }) }); } @@ -142735,29 +146302,29 @@ ${lanes.join("\n")} return node.typeArguments; } } - var fixName7, fixId51, errorCodes63; + var fixName7, fixId50, errorCodes62; var init_fixAddVoidToPromise = __esm({ "src/services/codefixes/fixAddVoidToPromise.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixName7 = "addVoidToPromise"; - fixId51 = "addVoidToPromise"; - errorCodes63 = [ + fixId50 = "addVoidToPromise"; + errorCodes62 = [ Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code, Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code ]; registerCodeFix({ - errorCodes: errorCodes63, - fixIds: [fixId51], + errorCodes: errorCodes62, + fixIds: [fixId50], getCodeActions(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span, context.program)); if (changes.length > 0) { - return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId51, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; + return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId50, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; } }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes63, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set())); + return codeFixAll(context, errorCodes62, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set())); } }); } @@ -142843,7 +146410,6 @@ ${lanes.join("\n")} init_fixClassDoesntImplementInheritedAbstractMember(); init_fixClassSuperMustPrecedeThisAccess(); init_fixConstructorForDerivedNeedSuperCall(); - init_fixEnableExperimentalDecorators(); init_fixEnableJsxFlag(); init_fixNaNEquality(); init_fixModuleAndTargetOptions(); @@ -142936,9 +146502,9 @@ ${lanes.join("\n")} (_b = host.log) == null ? void 0 : _b.call(host, `${logPrefix}: response is ${skippedAny ? "incomplete" : "complete"}`); (_c = host.log) == null ? void 0 : _c.call(host, `${logPrefix}: ${timestamp() - start}`); return result; - function tryResolve(exportInfo, symbolName2, isFromAmbientModule) { + function tryResolve(exportInfo, isFromAmbientModule) { if (isFromAmbientModule) { - const result3 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite); + const result3 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite); if (result3) { ambientCount++; } @@ -142946,7 +146512,7 @@ ${lanes.join("\n")} } const shouldResolveModuleSpecifier = needsFullResolution || preferences.allowIncompleteCompletions && resolvedCount < moduleSpecifierResolutionLimit; const shouldGetModuleSpecifierFromCache = !shouldResolveModuleSpecifier && preferences.allowIncompleteCompletions && cacheAttemptCount < moduleSpecifierResolutionCacheAttemptLimit; - const result2 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; + const result2 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; if (!shouldResolveModuleSpecifier && !shouldGetModuleSpecifierFromCache || shouldGetModuleSpecifierFromCache && !result2) { skippedAny = true; } @@ -142973,7 +146539,7 @@ ${lanes.join("\n")} const compilerOptions = program.getCompilerOptions(); const incompleteCompletionsCache = preferences.allowIncompleteCompletions ? (_a2 = host.getIncompleteCompletionsCache) == null ? void 0 : _a2.call(host) : void 0; if (incompleteCompletionsCache && completionKind === 3 /* TriggerForIncompleteCompletions */ && previousToken && isIdentifier(previousToken)) { - const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken); + const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken, position); if (incompleteContinuation) { return incompleteContinuation; } @@ -143042,10 +146608,11 @@ ${lanes.join("\n")} function completionEntryDataIsResolved(data) { return !!(data == null ? void 0 : data.moduleSpecifier); } - function continuePreviousIncompleteResponse(cache, file, location, program, host, preferences, cancellationToken) { + function continuePreviousIncompleteResponse(cache, file, location, program, host, preferences, cancellationToken, position) { const previousResponse = cache.get(); if (!previousResponse) return void 0; + const touchNode = getTouchingPropertyName(file, position); const lowerCaseTokenText = location.text.toLowerCase(); const exportMap = getExportInfoMap(file, host, program, preferences, cancellationToken); const newEntries = resolvingModuleSpecifiers( @@ -143069,7 +146636,7 @@ ${lanes.join("\n")} } const { origin } = Debug.checkDefined(getAutoImportSymbolFromCompletionEntryData(entry.name, entry.data, program, host)); const info = exportMap.get(file.path, entry.data.exportMapKey); - const result = info && context.tryResolve(info, entry.name, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); + const result = info && context.tryResolve(info, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); if (result === "skipped") return entry; if (!result || result === "failed") { @@ -143094,6 +146661,7 @@ ${lanes.join("\n")} ); previousResponse.entries = newEntries; previousResponse.flags = (previousResponse.flags || 0) | 4 /* IsContinuation */; + previousResponse.optionalReplacementSpan = getOptionalReplacementSpan(touchNode); return previousResponse; } function jsdocCompletionInfo(entries) { @@ -143188,6 +146756,7 @@ ${lanes.join("\n")} void 0, contextToken, location, + position, sourceFile, host, program, @@ -143301,10 +146870,10 @@ ${lanes.join("\n")} } else if (!tracker.hasValue(type.value)) { switch (typeof type.value) { case "object": - elements.push(factory.createBigIntLiteral(type.value)); + elements.push(type.value.negative ? factory.createPrefixUnaryExpression(40 /* MinusToken */, factory.createBigIntLiteral({ negative: false, base10Value: type.value.base10Value })) : factory.createBigIntLiteral(type.value)); break; case "number": - elements.push(factory.createNumericLiteral(type.value)); + elements.push(type.value < 0 ? factory.createPrefixUnaryExpression(40 /* MinusToken */, factory.createNumericLiteral(-type.value)) : factory.createNumericLiteral(type.value)); break; case "string": elements.push(factory.createStringLiteral(type.value, quotePreference === 0 /* Single */)); @@ -143316,7 +146885,7 @@ ${lanes.join("\n")} return void 0; } const newClauses = map(elements, (element) => factory.createCaseClause(element, [])); - const newLineChar = getNewLineCharacter(options, maybeBind(host, host.getNewLine)); + const newLineChar = getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options); const printer = createSnippetPrinter({ removeComments: true, module: options.module, @@ -143513,7 +147082,7 @@ ${lanes.join("\n")} function createCompletionEntryForLiteral(sourceFile, preferences, literal) { return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } - function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { + function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { let insertText; let replacementSpan = getReplacementSpanForContextToken(replacementToken); let data; @@ -143571,7 +147140,7 @@ ${lanes.join("\n")} } if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) { let importAdder; - ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext)); + ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext)); sortText = SortText.ClassMemberSnippets; if (importAdder == null ? void 0 : importAdder.hasFixes()) { hasAction = true; @@ -143635,7 +147204,7 @@ ${lanes.join("\n")} const memberFlags = 106500 /* ClassMember */ & 900095 /* EnumMemberExcludes */; return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent)); } - function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext) { + function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) { const classLikeDeclaration = findAncestor(location, isClassLike); if (!classLikeDeclaration) { return { insertText: name }; @@ -143650,7 +147219,7 @@ ${lanes.join("\n")} module: options.module, target: options.target, omitTrailingSemicolon: false, - newLine: getNewLineKind(getNewLineCharacter(options, maybeBind(host, host.getNewLine))) + newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) }); const importAdder = ts_codefix_exports.createImportAdder(sourceFile, program, preferences, host); let body; @@ -143671,7 +147240,7 @@ ${lanes.join("\n")} ); } let modifiers = 0 /* None */; - const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken); + const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken, sourceFile, position); const isAbstract = !!(presentModifiers & 256 /* Abstract */); const completionNodes = []; ts_codefix_exports.addNewNodeForMemberSymbol( @@ -143726,8 +147295,8 @@ ${lanes.join("\n")} } return { insertText, isSnippet, importAdder, replacementSpan }; } - function getPresentModifiers(contextToken) { - if (!contextToken) { + function getPresentModifiers(contextToken, sourceFile, position) { + if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) { return { modifiers: 0 /* None */ }; } let modifiers = 0 /* None */; @@ -143747,8 +147316,11 @@ ${lanes.join("\n")} if (isModifier(node)) { return node.kind; } - if (isIdentifier(node) && node.originalKeywordKind && isModifierKind(node.originalKeywordKind)) { - return node.originalKeywordKind; + if (isIdentifier(node)) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind && isModifierKind(originalKeywordKind)) { + return originalKeywordKind; + } } return void 0; } @@ -143765,7 +147337,7 @@ ${lanes.join("\n")} module: options.module, target: options.target, omitTrailingSemicolon: false, - newLine: getNewLineKind(getNewLineCharacter(options, maybeBind(host, host.getNewLine))) + newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) }); if (formatContext) { insertText = printer.printAndFormatSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, factory.createNodeArray( @@ -144090,7 +147662,7 @@ ${lanes.join("\n")} return "TypeOnlyAlias/" /* TypeOnlyAlias */; } } - function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { + function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { var _a2; const start = timestamp(); const variableDeclaration = getVariableDeclaration(location); @@ -144113,6 +147685,7 @@ ${lanes.join("\n")} replacementToken, contextToken, location, + position, sourceFile, host, program, @@ -144356,6 +147929,7 @@ ${lanes.join("\n")} name, symbol, location, + position, contextToken, formatContext ); @@ -144396,7 +147970,7 @@ ${lanes.join("\n")} targetSymbol, moduleSymbol, sourceFile, - getNameForExportedSymbol(symbol, getEmitScriptTarget(compilerOptions), isJsxOpeningTagName), + name, isJsxOpeningTagName, host, program, @@ -144719,6 +148293,7 @@ ${lanes.join("\n")} case 347 /* JSDocTypeTag */: case 349 /* JSDocTypedefTag */: case 352 /* JSDocThrowsTag */: + case 353 /* JSDocSatisfiesTag */: return true; case 348 /* JSDocTemplateTag */: return !!tag.constraint; @@ -144861,7 +148436,7 @@ ${lanes.join("\n")} moduleSymbol, symbol: firstAccessibleSymbol, targetFlags: skipAlias(firstAccessibleSymbol, typeChecker).flags - }], firstAccessibleSymbol.name, position, isValidTypeOnlyAliasUseSite(location)) || {}; + }], position, isValidTypeOnlyAliasUseSite(location)) || {}; if (moduleSpecifier) { const origin = { kind: getNullableSymbolOriginInfoKind(6 /* SymbolMemberExport */), @@ -144957,7 +148532,7 @@ ${lanes.join("\n")} symbolToSortTextMap[getSymbolId(symbol)] = SortText.GlobalsOrKeywords; } if (typeOnlyAliasNeedsPromotion && !(symbol.flags & 111551 /* Value */)) { - const typeOnlyAliasDeclaration = symbol.declarations && find(symbol.declarations, isTypeOnlyImportOrExportDeclaration); + const typeOnlyAliasDeclaration = symbol.declarations && find(symbol.declarations, isTypeOnlyImportDeclaration); if (typeOnlyAliasDeclaration) { const origin = { kind: 64 /* TypeOnlyAlias */, declaration: typeOnlyAliasDeclaration }; symbolToOriginInfoMap[i] = origin; @@ -145087,7 +148662,7 @@ ${lanes.join("\n")} if (!firstImportableExportInfo) { return; } - const result = context.tryResolve(info, symbolName2, isFromAmbientModule) || {}; + const result = context.tryResolve(info, isFromAmbientModule) || {}; if (result === "failed") return; let exportInfo2 = firstImportableExportInfo, moduleSpecifier; @@ -145917,7 +149492,8 @@ ${lanes.join("\n")} return kind === 132 /* AsyncKeyword */ || kind === 133 /* AwaitKeyword */ || kind === 128 /* AsKeyword */ || kind === 150 /* SatisfiesKeyword */ || kind === 154 /* TypeKeyword */ || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node) { - return isIdentifier(node) ? node.originalKeywordKind || 0 /* Unknown */ : node.kind; + var _a2; + return isIdentifier(node) ? (_a2 = identifierToKeywordKind(node)) != null ? _a2 : 0 /* Unknown */ : node.kind; } function getContextualKeywords(contextToken, position) { const entries = []; @@ -145963,8 +149539,9 @@ ${lanes.join("\n")} return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { + var _a2; switch (location.kind) { - case 353 /* SyntaxList */: + case 354 /* SyntaxList */: return tryCast(location.parent, isObjectTypeDeclaration); case 1 /* EndOfFileToken */: const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration); @@ -145973,8 +149550,8 @@ ${lanes.join("\n")} } break; case 79 /* Identifier */: { - const originalKeywordKind = location.originalKeywordKind; - if (originalKeywordKind && isKeyword(originalKeywordKind)) { + const originalKeywordKind = identifierToKeywordKind(location); + if (originalKeywordKind) { return void 0; } if (isPropertyDeclaration(location.parent) && location.parent.initializer === location) { @@ -146000,14 +149577,14 @@ ${lanes.join("\n")} case 27 /* CommaToken */: return tryCast(contextToken.parent, isObjectTypeDeclaration); default: - if (!isFromObjectTypeDeclaration(contextToken)) { - if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line && isObjectTypeDeclaration(location)) { + if (isObjectTypeDeclaration(location)) { + if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { return location; } - return void 0; + const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; + return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword((_a2 = identifierToKeywordKind(contextToken)) != null ? _a2 : 0 /* Unknown */) ? contextToken.parent.parent : void 0; } - const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; - return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword(stringToToken(contextToken.text)) ? contextToken.parent.parent : void 0; + return void 0; } } function tryGetTypeLiteralNode(node) { @@ -146382,10 +149959,10 @@ ${lanes.join("\n")} if (!contextToken || !isStringLiteralLike(contextToken)) return void 0; const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences); - return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences); + return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position); } } - function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences) { + function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) { if (completion === void 0) { return void 0; } @@ -146401,6 +149978,7 @@ ${lanes.join("\n")} contextToken, contextToken, sourceFile, + position, sourceFile, host, program, @@ -147030,7 +150608,7 @@ ${lanes.join("\n")} } function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) { const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name)); - const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment)); + const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.indexOf("*") < 0); if (fragmentDirectory !== void 0) { const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory); return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator)); @@ -149052,7 +152630,7 @@ ${lanes.join("\n")} } } if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { - const isDefaultExport = referenceLocation.originalKeywordKind === 88 /* DefaultKeyword */ || exportSpecifier.name.originalKeywordKind === 88 /* DefaultKeyword */; + const isDefaultExport = referenceLocation.escapedText === "default" || exportSpecifier.name.escapedText === "default"; const exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */; const exportSymbol = Debug.checkDefined(exportSpecifier.symbol); const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker); @@ -150565,6 +154143,7 @@ ${lanes.join("\n")} } return displayParts; case 347 /* JSDocTypeTag */: + case 353 /* JSDocSatisfiesTag */: return withNode(tag.typeExpression); case 349 /* JSDocTypedefTag */: case 341 /* JSDocCallbackTag */: @@ -150854,6 +154433,7 @@ ${lanes.join("\n")} "readonly", "requires", "returns", + "satisfies", "see", "since", "static", @@ -150901,18 +154481,21 @@ ${lanes.join("\n")} const shouldSort = mode === "SortAndCombine" /* SortAndCombine */ || mode === "All" /* All */; const shouldCombine = shouldSort; const shouldRemove = mode === "RemoveUnused" /* RemoveUnused */ || mode === "All" /* All */; - const maybeRemove = shouldRemove ? removeUnusedImports : identity; - const maybeCoalesce = shouldCombine ? coalesceImports : identity; const topLevelImportGroupDecls = groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)); - const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : shouldSort && detectSortingWorker(topLevelImportGroupDecls) === 2 /* CaseInsensitive */; + const comparer = getOrganizeImportsComparerWithDetection(preferences, shouldSort ? () => detectSortingWorker(topLevelImportGroupDecls, preferences) === 2 /* CaseInsensitive */ : void 0); const processImportsOfSameModuleSpecifier = (importGroup) => { - const processedDeclarations = maybeCoalesce(maybeRemove(importGroup, sourceFile, program), ignoreCase, sourceFile); - return shouldSort ? stableSort(processedDeclarations, (s1, s2) => compareImportsOrRequireStatements(s1, s2)) : processedDeclarations; + if (shouldRemove) + importGroup = removeUnusedImports(importGroup, sourceFile, program); + if (shouldCombine) + importGroup = coalesceImportsWorker(importGroup, comparer, sourceFile); + if (shouldSort) + importGroup = stableSort(importGroup, (s1, s2) => compareImportsOrRequireStatements(s1, s2, comparer)); + return importGroup; }; topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier)); if (mode !== "RemoveUnused" /* RemoveUnused */) { const topLevelExportDecls = sourceFile.statements.filter(isExportDeclaration); - organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExports(group2, ignoreCase)); + organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExportsWorker(group2, comparer)); } for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) { if (!ambientModule.body) @@ -150921,7 +154504,7 @@ ${lanes.join("\n")} ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier)); if (mode !== "RemoveUnused" /* RemoveUnused */) { const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration); - organizeImportsWorker(ambientModuleExportDecls, (group2) => coalesceExports(group2, ignoreCase)); + organizeImportsWorker(ambientModuleExportDecls, (group2) => coalesceExportsWorker(group2, comparer)); } } return changeTracker.getChanges(); @@ -150931,7 +154514,7 @@ ${lanes.join("\n")} } suppressLeadingTrivia(oldImportDecls[0]); const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls]; - const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiers2(group1[0].moduleSpecifier, group2[0].moduleSpecifier)) : oldImportGroups; + const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer)) : oldImportGroups; const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup); if (newImportDecls.length === 0) { changeTracker.deleteNodes( @@ -151054,12 +154637,14 @@ ${lanes.join("\n")} return specifier !== void 0 && isStringLiteralLike(specifier) ? specifier.text : void 0; } function coalesceImports(importGroup, ignoreCase, sourceFile) { - var _a2, _b, _c, _d; + const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); + return coalesceImportsWorker(importGroup, comparer, sourceFile); + } + function coalesceImportsWorker(importGroup, comparer, sourceFile) { if (importGroup.length === 0) { return importGroup; } const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroup); - const compareIdentifiers = ignoreCase ? compareIdentifiersCaseInsensitive : compareIdentifiersCaseSensitive; const coalescedImports = []; if (importWithoutClause) { coalescedImports.push(importWithoutClause); @@ -151074,7 +154659,7 @@ ${lanes.join("\n")} ); continue; } - const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => compareIdentifiers(i1.importClause.namedBindings.name, i2.importClause.namedBindings.name)); + const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text)); for (const namespaceImport of sortedNamespaceImports) { coalescedImports.push( updateImportDeclarationAndClause( @@ -151085,7 +154670,10 @@ ${lanes.join("\n")} ) ); } - if (defaultImports.length === 0 && namedImports.length === 0) { + const firstDefaultImport = firstOrUndefined(defaultImports); + const firstNamedImport = firstOrUndefined(namedImports); + const importDecl = firstDefaultImport != null ? firstDefaultImport : firstNamedImport; + if (!importDecl) { continue; } let newDefaultImport; @@ -151106,12 +154694,11 @@ ${lanes.join("\n")} } newImportSpecifiers.push(...getNewImportSpecifiers(namedImports)); const sortedImportSpecifiers = factory.createNodeArray( - sortSpecifiers(newImportSpecifiers, ignoreCase), - (_b = (_a2 = namedImports[0]) == null ? void 0 : _a2.importClause.namedBindings) == null ? void 0 : _b.elements.hasTrailingComma + sortSpecifiers(newImportSpecifiers, comparer), + firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma ); - const importDecl = defaultImports.length > 0 ? defaultImports[0] : namedImports[0]; - const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : namedImports.length === 0 ? factory.createNamedImports(sortedImportSpecifiers) : factory.updateNamedImports(namedImports[0].importClause.namedBindings, sortedImportSpecifiers); - if (sourceFile && newNamedImports && ((_c = namedImports[0]) == null ? void 0 : _c.importClause.namedBindings) && !rangeIsOnSingleLine(namedImports[0].importClause.namedBindings, sourceFile)) { + const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers); + if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) { setEmitFlags(newNamedImports, 2 /* MultiLine */); } if (isTypeOnly && newDefaultImport && newNamedImports) { @@ -151125,7 +154712,7 @@ ${lanes.join("\n")} ); coalescedImports.push( updateImportDeclarationAndClause( - (_d = namedImports[0]) != null ? _d : importDecl, + firstNamedImport != null ? firstNamedImport : importDecl, /*name*/ void 0, newNamedImports @@ -151168,6 +154755,10 @@ ${lanes.join("\n")} }; } function coalesceExports(exportGroup, ignoreCase) { + const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); + return coalesceExportsWorker(exportGroup, comparer); + } + function coalesceExportsWorker(exportGroup, comparer) { if (exportGroup.length === 0) { return exportGroup; } @@ -151182,7 +154773,7 @@ ${lanes.join("\n")} } const newExportSpecifiers = []; newExportSpecifiers.push(...flatMap(exportGroup2, (i) => i.exportClause && isNamedExports(i.exportClause) ? i.exportClause.elements : emptyArray)); - const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, ignoreCase); + const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, comparer); const exportDecl = exportGroup2[0]; coalescedExports.push( factory.updateExportDeclaration( @@ -151226,25 +154817,21 @@ ${lanes.join("\n")} importDeclaration.assertClause ); } - function sortSpecifiers(specifiers, ignoreCase) { - return stableSort(specifiers, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, ignoreCase)); - } - function compareImportOrExportSpecifiers(s1, s2, ignoreCase) { - const compareIdentifiers = ignoreCase ? compareIdentifiersCaseInsensitive : compareIdentifiersCaseSensitive; - return compareBooleans(s1.isTypeOnly, s2.isTypeOnly) || compareIdentifiers(s1.name, s2.name); + function sortSpecifiers(specifiers, comparer) { + return stableSort(specifiers, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer)); } - function compareIdentifiersCaseSensitive(s1, s2) { - return compareStringsCaseSensitive(s1.text, s2.text); - } - function compareIdentifiersCaseInsensitive(s1, s2) { - return compareStringsCaseInsensitiveEslintCompatible(s1.text, s2.text); + function compareImportOrExportSpecifiers(s1, s2, comparer) { + return compareBooleans(s1.isTypeOnly, s2.isTypeOnly) || comparer(s1.name.text, s2.name.text); } function compareModuleSpecifiers2(m1, m2, ignoreCase) { + const comparer = getOrganizeImportsOrdinalStringComparer(!!ignoreCase); + return compareModuleSpecifiersWorker(m1, m2, comparer); + } + function compareModuleSpecifiersWorker(m1, m2, comparer) { const name1 = m1 === void 0 ? void 0 : getExternalModuleName2(m1); const name2 = m2 === void 0 ? void 0 : getExternalModuleName2(m2); - const compareStrings = ignoreCase ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseSensitive; return compareBooleans(name1 === void 0, name2 === void 0) || compareBooleans(isExternalModuleNameRelative(name1), isExternalModuleNameRelative(name2)) || // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - compareStrings(name1, name2); + comparer(name1, name2); } function getModuleSpecifierExpression(declaration) { var _a2; @@ -151257,24 +154844,40 @@ ${lanes.join("\n")} return declaration.declarationList.declarations[0].initializer.arguments[0]; } } - function detectSorting(sourceFile) { + function detectSorting(sourceFile, preferences) { return detectSortingWorker( - groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)) + groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)), + preferences ); } - function detectSortingWorker(importGroups) { + function detectSortingWorker(importGroups, preferences) { + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); let sortState = 3 /* Both */; + let seenUnsortedGroup = false; for (const importGroup of importGroups) { if (importGroup.length > 1) { - sortState &= detectSortCaseSensitivity( + const moduleSpecifierSort = detectSortCaseSensitivity( importGroup, - /*useEslintOrdering*/ - true, (i) => { var _a2, _b; return (_b = (_a2 = tryCast(i.moduleSpecifier, isStringLiteral)) == null ? void 0 : _a2.text) != null ? _b : ""; - } + }, + collateCaseSensitive, + collateCaseInsensitive ); + if (moduleSpecifierSort) { + sortState &= moduleSpecifierSort; + seenUnsortedGroup = true; + } if (!sortState) { return sortState; } @@ -151287,7 +154890,11 @@ ${lanes.join("\n")} } ); if (declarationWithNamedImports) { - sortState &= detectImportSpecifierSorting(declarationWithNamedImports.importClause.namedBindings.elements); + const namedImportSort = detectImportSpecifierSorting(declarationWithNamedImports.importClause.namedBindings.elements, preferences); + if (namedImportSort) { + sortState &= namedImportSort; + seenUnsortedGroup = true; + } if (!sortState) { return sortState; } @@ -151296,26 +154903,36 @@ ${lanes.join("\n")} return sortState; } } - return sortState; + return seenUnsortedGroup ? 0 /* None */ : sortState; } - function detectImportDeclarationSorting(imports) { + function detectImportDeclarationSorting(imports, preferences) { + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); return detectSortCaseSensitivity( imports, - /*useEslintOrdering*/ - true, - (s) => getExternalModuleName2(getModuleSpecifierExpression(s)) || "" + (s) => getExternalModuleName2(getModuleSpecifierExpression(s)) || "", + collateCaseSensitive, + collateCaseInsensitive ); } - function getImportDeclarationInsertionIndex(sortedImports, newImport, ignoreCase) { - const index = binarySearch(sortedImports, newImport, identity, (a, b) => compareImportsOrRequireStatements(a, b, ignoreCase)); + function getImportDeclarationInsertionIndex(sortedImports, newImport, comparer) { + const index = binarySearch(sortedImports, newImport, identity, (a, b) => compareImportsOrRequireStatements(a, b, comparer)); return index < 0 ? ~index : index; } - function getImportSpecifierInsertionIndex(sortedImports, newImport, ignoreCase) { - const index = binarySearch(sortedImports, newImport, identity, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, ignoreCase)); + function getImportSpecifierInsertionIndex(sortedImports, newImport, comparer) { + const index = binarySearch(sortedImports, newImport, identity, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer)); return index < 0 ? ~index : index; } - function compareImportsOrRequireStatements(s1, s2, ignoreCase) { - return compareModuleSpecifiers2(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), ignoreCase) || compareImportKind(s1, s2); + function compareImportsOrRequireStatements(s1, s2, comparer) { + return compareModuleSpecifiersWorker(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), comparer) || compareImportKind(s1, s2); } function compareImportKind(s1, s2) { return compareValues(getImportKindOrder(s1), getImportKindOrder(s2)); @@ -151358,22 +154975,86 @@ ${lanes.join("\n")} var _a2; return ((_a2 = namedImport.importClause) == null ? void 0 : _a2.namedBindings) && isNamedImports(namedImport.importClause.namedBindings) ? namedImport.importClause.namedBindings.elements : void 0; } - var detectImportSpecifierSorting; + function getOrganizeImportsOrdinalStringComparer(ignoreCase) { + return ignoreCase ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseSensitive; + } + function getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) { + var _a2, _b, _c; + const resolvedLocale = getOrganizeImportsLocale(preferences); + const caseFirst = (_a2 = preferences.organizeImportsCaseFirst) != null ? _a2 : false; + const numeric = (_b = preferences.organizeImportsNumericCollation) != null ? _b : false; + const accents = (_c = preferences.organizeImportsAccentCollation) != null ? _c : true; + const sensitivity = ignoreCase ? accents ? "accent" : "base" : accents ? "variant" : "case"; + const collator = new Intl.Collator(resolvedLocale, { + usage: "sort", + caseFirst: caseFirst || "false", + sensitivity, + numeric + }); + return collator.compare; + } + function getOrganizeImportsLocale(preferences) { + let locale = preferences.organizeImportsLocale; + if (locale === "auto") + locale = getUILocale(); + if (locale === void 0) + locale = "en"; + const supportedLocales = Intl.Collator.supportedLocalesOf(locale); + const resolvedLocale = supportedLocales.length ? supportedLocales[0] : "en"; + return resolvedLocale; + } + function getOrganizeImportsComparer(preferences, ignoreCase) { + var _a2; + const collation = (_a2 = preferences.organizeImportsCollation) != null ? _a2 : "ordinal"; + return collation === "unicode" ? getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) : getOrganizeImportsOrdinalStringComparer(ignoreCase); + } + function getOrganizeImportsComparerWithDetection(preferences, detectIgnoreCase) { + var _a2; + const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : (_a2 = detectIgnoreCase == null ? void 0 : detectIgnoreCase()) != null ? _a2 : false; + return getOrganizeImportsComparer(preferences, ignoreCase); + } + var ImportSpecifierSortingCache, detectImportSpecifierSorting; var init_organizeImports = __esm({ "src/services/organizeImports.ts"() { "use strict"; init_ts4(); - detectImportSpecifierSorting = memoizeWeak((specifiers) => { + ImportSpecifierSortingCache = class { + has([specifiers, preferences]) { + if (this._lastPreferences !== preferences || !this._cache) + return false; + return this._cache.has(specifiers); + } + get([specifiers, preferences]) { + if (this._lastPreferences !== preferences || !this._cache) + return void 0; + return this._cache.get(specifiers); + } + set([specifiers, preferences], value) { + var _a2; + if (this._lastPreferences !== preferences) { + this._lastPreferences = preferences; + this._cache = void 0; + } + (_a2 = this._cache) != null ? _a2 : this._cache = /* @__PURE__ */ new WeakMap(); + this._cache.set(specifiers, value); + } + }; + detectImportSpecifierSorting = memoizeCached((specifiers, preferences) => { if (!arrayIsSorted(specifiers, (s1, s2) => compareBooleans(s1.isTypeOnly, s2.isTypeOnly))) { return 0 /* None */; } - return detectSortCaseSensitivity( - specifiers, - /*useEslintOrdering*/ - true, - (specifier) => specifier.name.text + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false ); - }); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); + return detectSortCaseSensitivity(specifiers, (specifier) => specifier.name.text, collateCaseSensitive, collateCaseInsensitive); + }, new ImportSpecifierSortingCache()); } }); @@ -151390,6 +155071,7 @@ ${lanes.join("\n")} detectSorting: () => detectSorting, getImportDeclarationInsertionIndex: () => getImportDeclarationInsertionIndex, getImportSpecifierInsertionIndex: () => getImportSpecifierInsertionIndex, + getOrganizeImportsComparer: () => getOrganizeImportsComparer, organizeImports: () => organizeImports }); var init_ts_OrganizeImports = __esm({ @@ -151869,7 +155551,7 @@ ${lanes.join("\n")} return void 0; } } - function doChange33(exportingSourceFile, program, info, changes, cancellationToken) { + function doChange32(exportingSourceFile, program, info, changes, cancellationToken) { changeExport(exportingSourceFile, info, changes, program.getTypeChecker()); changeImports(program, info, changes, cancellationToken); } @@ -152065,7 +155747,7 @@ ${lanes.join("\n")} Debug.assert(actionName2 === defaultToNamedAction.name || actionName2 === namedToDefaultAction.name, "Unexpected action name"); const info = getInfo19(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, info, t, context.cancellationToken)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(context.file, context.program, info, t, context.cancellationToken)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -152100,7 +155782,7 @@ ${lanes.join("\n")} function getShouldUseDefault(program, importClause) { return getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); } - function doChange34(sourceFile, program, changes, info) { + function doChange33(sourceFile, program, changes, info) { const checker = program.getTypeChecker(); if (info.convertTo === 0 /* Named */) { doChangeNamespaceToNamed(sourceFile, checker, changes, info.import, getAllowSyntheticDefaultImports(program.getCompilerOptions())); @@ -152292,7 +155974,7 @@ ${lanes.join("\n")} Debug.assert(some(getOwnValues(actions), (action) => action.name === actionName2), "Unexpected action name"); const info = getImportConversionInfo(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, t, info)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, t, info)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -152634,7 +156316,7 @@ ${lanes.join("\n")} afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex] }; } - function doChange35(oldFile, program, toMove, changes, host, preferences) { + function doChange34(oldFile, program, toMove, changes, host, preferences) { const checker = program.getTypeChecker(); const usage = getUsageInfo(oldFile, toMove.all, checker); const currentDirectory = getDirectoryPath(oldFile.fileName); @@ -152715,7 +156397,8 @@ ${lanes.join("\n")} oldFile, importsFromNewFile, /*blankLineBetween*/ - true + true, + preferences ); } deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker); @@ -153408,7 +157091,7 @@ ${lanes.join("\n")} getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) { Debug.assert(actionName2 === refactorName4, "Wrong refactor invoked"); const statements = Debug.checkDefined(getStatementsToMove(context)); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(context.file, context.program, statements, t, context.host, context.preferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, statements, t, context.host, context.preferences)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -154069,12 +157752,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; const groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); if (groupedReferences.valid) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(file, program, host, t, functionDeclaration, groupedReferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(file, program, host, t, functionDeclaration, groupedReferences)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return { edits: [] }; } - function doChange36(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { + function doChange35(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { const signature = groupedReferences.signature; const newFunctionDeclarationParams = map(createNewParameters(functionDeclaration, program, host), (param) => getSynthesizedDeepClone(param)); if (signature) { @@ -154867,7 +158550,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); const edits = ts_textChanges_exports.ChangeTracker.with( context, - (t) => doChange37(context.file, context.program.getTypeChecker(), t, info, actionName2) + (t) => doChange36(context.file, context.program.getTypeChecker(), t, info, actionName2) ); return { edits, renameFilename: void 0, renameLocation: void 0 }; } @@ -155023,7 +158706,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return toConvert; } - function doChange37(sourceFile, checker, changes, info, _actionName) { + function doChange36(sourceFile, checker, changes, info, _actionName) { const { finalExpression, occurrences, expression } = info; const firstOccurrence = occurrences[occurrences.length - 1]; const convertedChain = convertOccurrences(checker, finalExpression, occurrences); @@ -155931,7 +159614,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} 111551 /* Value */, /*excludeGlobals*/ false - ) && !isPrivateIdentifier(node.name) && !isKeyword(node.name.originalKeywordKind) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); + ) && !isPrivateIdentifier(node.name) && !identifierToKeywordKind(node.name) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); const isJS = isInJSFile(scope); let variableType = isJS || !checker.isContextSensitive(node) ? void 0 : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */); let initializer = transformConstantInitializer(skipParentheses(node), substitutions); @@ -156168,7 +159851,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} let ignoreReturns = false; const statements = factory.createNodeArray(isBlock(body) ? body.statements.slice(0) : [isStatement(body) ? body : factory.createReturnStatement(skipParentheses(body))]); if (hasWritesOrVariableDeclarations || substitutions.size) { - const rewrittenStatements = visitNodes2(statements, visitor).slice(); + const rewrittenStatements = visitNodes2(statements, visitor, isStatement).slice(); if (hasWritesOrVariableDeclarations && !hasReturn2 && isStatement(body)) { const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (assignments.length === 1) { @@ -156196,7 +159879,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!returnValueProperty) { returnValueProperty = "__return"; } - assignments.unshift(factory.createPropertyAssignment(returnValueProperty, visitNode(node.expression, visitor))); + assignments.unshift(factory.createPropertyAssignment(returnValueProperty, visitNode(node.expression, visitor, isExpression))); } if (assignments.length === 1) { return factory.createReturnStatement(assignments[0].name); @@ -156769,7 +160452,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getRefactorEditsToInferReturnType(context) { const info = getInfo21(context); if (info && !isRefactorErrorInfo(info)) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange38(context.file, t, info.declaration, info.returnTypeNode)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(context.file, t, info.declaration, info.returnTypeNode)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return void 0; @@ -156794,7 +160477,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return emptyArray; } - function doChange38(sourceFile, changes, declaration, typeNode) { + function doChange37(sourceFile, changes, declaration, typeNode) { const closeParen = findChildOfKind(declaration, 21 /* CloseParenToken */, sourceFile); const needParens = isArrowFunction(declaration) && closeParen === void 0; const endNode2 = needParens ? first(declaration.parameters) : closeParen; @@ -156946,7 +160629,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (declarations.some((declaration) => isDefinedInLibraryFile(program, declaration))) { return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } - if (isIdentifier(node) && node.originalKeywordKind === 88 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) { + if (isIdentifier(node) && node.escapedText === "default" && symbol.parent && symbol.parent.flags & 1536 /* Module */) { return void 0; } if (isStringLiteralLike(node) && tryGetImportFromModuleSpecifier(node)) { @@ -158651,7 +162334,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } const jsDocNode = parent2.parent.kind === 169 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; jsDocNode.jsDoc = parent2.jsDoc; - jsDocNode.jsDocCache = parent2.jsDocCache; return jsDocNode; } function tryMergeJsdocTags(oldTag, newTag) { @@ -158765,6 +162447,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!visited) { return visited; } + Debug.assert(nodes); const nodeArray = visited === nodes ? factory.createNodeArray(visited.slice(0)) : visited; setTextRangePosEnd(nodeArray, getPos2(nodes), getEnd(nodes)); return nodeArray; @@ -162703,7 +166386,7 @@ ${options.prefix}` : "\n" : options.prefix const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter; const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter; const since = typeof options.since === "string" ? new Version(options.since) : (_b = options.since) != null ? _b : warnAfter; - const error = options.error || errorAfter && version2.compareTo(errorAfter) <= 0; + const error = options.error || errorAfter && version2.compareTo(errorAfter) >= 0; const warn = !warnAfter || version2.compareTo(warnAfter) >= 0; return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop; } @@ -162779,1338 +166462,51 @@ ${options.prefix}` : "\n" : options.prefix } }); - // src/deprecatedCompat/4.0/nodeFactoryTopLevelExports.ts - var factoryDeprecation, createNodeArray, createNumericLiteral, createBigIntLiteral, createStringLiteral, createStringLiteralFromNode, createRegularExpressionLiteral, createLoopVariable, createUniqueName, createPrivateIdentifier, createSuper, createThis, createNull, createTrue, createFalse, createModifier, createModifiersFromModifierFlags, createQualifiedName, updateQualifiedName, createComputedPropertyName, updateComputedPropertyName, createTypeParameterDeclaration, updateTypeParameterDeclaration, createParameter, updateParameter, createDecorator, updateDecorator, createProperty, updateProperty, createMethod, updateMethod, createConstructor, updateConstructor, createGetAccessor, updateGetAccessor, createSetAccessor, updateSetAccessor, createCallSignature, updateCallSignature, createConstructSignature, updateConstructSignature, updateIndexSignature, createKeywordTypeNode, createTypePredicateNodeWithModifier, updateTypePredicateNodeWithModifier, createTypeReferenceNode, updateTypeReferenceNode, createFunctionTypeNode, updateFunctionTypeNode, createConstructorTypeNode, updateConstructorTypeNode, createTypeQueryNode, updateTypeQueryNode, createTypeLiteralNode, updateTypeLiteralNode, createArrayTypeNode, updateArrayTypeNode, createTupleTypeNode, updateTupleTypeNode, createOptionalTypeNode, updateOptionalTypeNode, createRestTypeNode, updateRestTypeNode, createUnionTypeNode, updateUnionTypeNode, createIntersectionTypeNode, updateIntersectionTypeNode, createConditionalTypeNode, updateConditionalTypeNode, createInferTypeNode, updateInferTypeNode, createImportTypeNode, updateImportTypeNode, createParenthesizedType, updateParenthesizedType, createThisTypeNode, updateTypeOperatorNode, createIndexedAccessTypeNode, updateIndexedAccessTypeNode, createMappedTypeNode, updateMappedTypeNode, createLiteralTypeNode, updateLiteralTypeNode, createObjectBindingPattern, updateObjectBindingPattern, createArrayBindingPattern, updateArrayBindingPattern, createBindingElement, updateBindingElement, createArrayLiteral, updateArrayLiteral, createObjectLiteral, updateObjectLiteral, createPropertyAccess, updatePropertyAccess, createPropertyAccessChain, updatePropertyAccessChain, createElementAccess, updateElementAccess, createElementAccessChain, updateElementAccessChain, createCall, updateCall, createCallChain, updateCallChain, createNew, updateNew, createTypeAssertion, updateTypeAssertion, createParen, updateParen, createFunctionExpression, updateFunctionExpression, createDelete, updateDelete, createTypeOf, updateTypeOf, createVoid, updateVoid, createAwait, updateAwait, createPrefix, updatePrefix, createPostfix, updatePostfix, createBinary, updateConditional, createTemplateExpression, updateTemplateExpression, createTemplateHead, createTemplateMiddle, createTemplateTail, createNoSubstitutionTemplateLiteral, updateYield, createSpread, updateSpread, createOmittedExpression, createAsExpression, updateAsExpression, createNonNullExpression, updateNonNullExpression, createNonNullChain, updateNonNullChain, createMetaProperty, updateMetaProperty, createTemplateSpan, updateTemplateSpan, createSemicolonClassElement, createBlock, updateBlock, createVariableStatement, updateVariableStatement, createEmptyStatement, createExpressionStatement, updateExpressionStatement, createStatement, updateStatement, createIf, updateIf, createDo, updateDo, createWhile, updateWhile, createFor, updateFor, createForIn, updateForIn, createForOf, updateForOf, createContinue, updateContinue, createBreak, updateBreak, createReturn, updateReturn, createWith, updateWith, createSwitch, updateSwitch, createLabel, updateLabel, createThrow, updateThrow, createTry, updateTry, createDebuggerStatement, createVariableDeclarationList, updateVariableDeclarationList, createFunctionDeclaration, updateFunctionDeclaration, createClassDeclaration, updateClassDeclaration, createInterfaceDeclaration, updateInterfaceDeclaration, createTypeAliasDeclaration, updateTypeAliasDeclaration, createEnumDeclaration, updateEnumDeclaration, createModuleDeclaration, updateModuleDeclaration, createModuleBlock, updateModuleBlock, createCaseBlock, updateCaseBlock, createNamespaceExportDeclaration, updateNamespaceExportDeclaration, createImportEqualsDeclaration, updateImportEqualsDeclaration, createImportDeclaration, updateImportDeclaration, createNamespaceImport, updateNamespaceImport, createNamedImports, updateNamedImports, createImportSpecifier, updateImportSpecifier, createExportAssignment2, updateExportAssignment, createNamedExports, updateNamedExports, createExportSpecifier, updateExportSpecifier, createExternalModuleReference, updateExternalModuleReference, createJSDocTypeExpression, createJSDocTypeTag, createJSDocReturnTag, createJSDocThisTag, createJSDocComment, createJSDocParameterTag, createJSDocClassTag, createJSDocAugmentsTag, createJSDocEnumTag, createJSDocTemplateTag, createJSDocTypedefTag, createJSDocCallbackTag, createJSDocSignature, createJSDocPropertyTag, createJSDocTypeLiteral, createJSDocImplementsTag, createJSDocAuthorTag, createJSDocPublicTag, createJSDocPrivateTag, createJSDocProtectedTag, createJSDocReadonlyTag, createJSDocTag, createJsxElement, updateJsxElement, createJsxSelfClosingElement, updateJsxSelfClosingElement, createJsxOpeningElement, updateJsxOpeningElement, createJsxClosingElement, updateJsxClosingElement, createJsxFragment, createJsxText, updateJsxText, createJsxOpeningFragment, createJsxJsxClosingFragment, updateJsxFragment, createJsxAttribute, updateJsxAttribute, createJsxAttributes, updateJsxAttributes, createJsxSpreadAttribute, updateJsxSpreadAttribute, createJsxExpression, updateJsxExpression, createCaseClause, updateCaseClause, createDefaultClause, updateDefaultClause, createHeritageClause, updateHeritageClause, createCatchClause, updateCatchClause, createPropertyAssignment, updatePropertyAssignment, createShorthandPropertyAssignment, updateShorthandPropertyAssignment, createSpreadAssignment, updateSpreadAssignment, createEnumMember, updateEnumMember, updateSourceFileNode, createNotEmittedStatement, createPartiallyEmittedExpression, updatePartiallyEmittedExpression, createCommaList, updateCommaList, createBundle, updateBundle, createImmediatelyInvokedFunctionExpression, createImmediatelyInvokedArrowFunction, createVoidZero, createExportDefault, createExternalModuleExport, createNamespaceExport, updateNamespaceExport, createToken, createIdentifier, createTempVariable, getGeneratedNameForNode, createOptimisticUniqueName, createFileLevelUniqueName, createIndexSignature, createTypePredicateNode, updateTypePredicateNode, createLiteral, createMethodSignature, updateMethodSignature, createTypeOperatorNode, createTaggedTemplate, updateTaggedTemplate, updateBinary, createConditional, createYield, createClassExpression, updateClassExpression, createPropertySignature, updatePropertySignature, createExpressionWithTypeArguments, updateExpressionWithTypeArguments, createArrowFunction, updateArrowFunction, createVariableDeclaration, updateVariableDeclaration, createImportClause, updateImportClause, createExportDeclaration, updateExportDeclaration, createJSDocParamTag, createComma, createLessThan, createAssignment, createStrictEquality, createStrictInequality, createAdd, createSubtract, createLogicalAnd, createLogicalOr, createPostfixIncrement, createLogicalNot, createNode2, getMutableClone; - var init_nodeFactoryTopLevelExports = __esm({ - "src/deprecatedCompat/4.0/nodeFactoryTopLevelExports.ts"() { + // src/deprecatedCompat/5.0/identifierProperties.ts + var init_identifierProperties = __esm({ + "src/deprecatedCompat/5.0/identifierProperties.ts"() { "use strict"; init_ts5(); init_deprecate(); - factoryDeprecation = { since: "4.0", warnAfter: "4.1", message: "Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead." }; - createNodeArray = deprecate(factory.createNodeArray, factoryDeprecation); - createNumericLiteral = deprecate(factory.createNumericLiteral, factoryDeprecation); - createBigIntLiteral = deprecate(factory.createBigIntLiteral, factoryDeprecation); - createStringLiteral = deprecate(factory.createStringLiteral, factoryDeprecation); - createStringLiteralFromNode = deprecate(factory.createStringLiteralFromNode, factoryDeprecation); - createRegularExpressionLiteral = deprecate(factory.createRegularExpressionLiteral, factoryDeprecation); - createLoopVariable = deprecate(factory.createLoopVariable, factoryDeprecation); - createUniqueName = deprecate(factory.createUniqueName, factoryDeprecation); - createPrivateIdentifier = deprecate(factory.createPrivateIdentifier, factoryDeprecation); - createSuper = deprecate(factory.createSuper, factoryDeprecation); - createThis = deprecate(factory.createThis, factoryDeprecation); - createNull = deprecate(factory.createNull, factoryDeprecation); - createTrue = deprecate(factory.createTrue, factoryDeprecation); - createFalse = deprecate(factory.createFalse, factoryDeprecation); - createModifier = deprecate(factory.createModifier, factoryDeprecation); - createModifiersFromModifierFlags = deprecate(factory.createModifiersFromModifierFlags, factoryDeprecation); - createQualifiedName = deprecate(factory.createQualifiedName, factoryDeprecation); - updateQualifiedName = deprecate(factory.updateQualifiedName, factoryDeprecation); - createComputedPropertyName = deprecate(factory.createComputedPropertyName, factoryDeprecation); - updateComputedPropertyName = deprecate(factory.updateComputedPropertyName, factoryDeprecation); - createTypeParameterDeclaration = deprecate(factory.createTypeParameterDeclaration, factoryDeprecation); - updateTypeParameterDeclaration = deprecate(factory.updateTypeParameterDeclaration, factoryDeprecation); - createParameter = deprecate(factory.createParameterDeclaration, factoryDeprecation); - updateParameter = deprecate(factory.updateParameterDeclaration, factoryDeprecation); - createDecorator = deprecate(factory.createDecorator, factoryDeprecation); - updateDecorator = deprecate(factory.updateDecorator, factoryDeprecation); - createProperty = deprecate(factory.createPropertyDeclaration, factoryDeprecation); - updateProperty = deprecate(factory.updatePropertyDeclaration, factoryDeprecation); - createMethod = deprecate(factory.createMethodDeclaration, factoryDeprecation); - updateMethod = deprecate(factory.updateMethodDeclaration, factoryDeprecation); - createConstructor = deprecate(factory.createConstructorDeclaration, factoryDeprecation); - updateConstructor = deprecate(factory.updateConstructorDeclaration, factoryDeprecation); - createGetAccessor = deprecate(factory.createGetAccessorDeclaration, factoryDeprecation); - updateGetAccessor = deprecate(factory.updateGetAccessorDeclaration, factoryDeprecation); - createSetAccessor = deprecate(factory.createSetAccessorDeclaration, factoryDeprecation); - updateSetAccessor = deprecate(factory.updateSetAccessorDeclaration, factoryDeprecation); - createCallSignature = deprecate(factory.createCallSignature, factoryDeprecation); - updateCallSignature = deprecate(factory.updateCallSignature, factoryDeprecation); - createConstructSignature = deprecate(factory.createConstructSignature, factoryDeprecation); - updateConstructSignature = deprecate(factory.updateConstructSignature, factoryDeprecation); - updateIndexSignature = deprecate(factory.updateIndexSignature, factoryDeprecation); - createKeywordTypeNode = deprecate(factory.createKeywordTypeNode, factoryDeprecation); - createTypePredicateNodeWithModifier = deprecate(factory.createTypePredicateNode, factoryDeprecation); - updateTypePredicateNodeWithModifier = deprecate(factory.updateTypePredicateNode, factoryDeprecation); - createTypeReferenceNode = deprecate(factory.createTypeReferenceNode, factoryDeprecation); - updateTypeReferenceNode = deprecate(factory.updateTypeReferenceNode, factoryDeprecation); - createFunctionTypeNode = deprecate(factory.createFunctionTypeNode, factoryDeprecation); - updateFunctionTypeNode = deprecate(factory.updateFunctionTypeNode, factoryDeprecation); - createConstructorTypeNode = deprecate((typeParameters, parameters, type) => { - return factory.createConstructorTypeNode( - /*modifiers*/ - void 0, - typeParameters, - parameters, - type - ); - }, factoryDeprecation); - updateConstructorTypeNode = deprecate((node, typeParameters, parameters, type) => { - return factory.updateConstructorTypeNode(node, node.modifiers, typeParameters, parameters, type); - }, factoryDeprecation); - createTypeQueryNode = deprecate(factory.createTypeQueryNode, factoryDeprecation); - updateTypeQueryNode = deprecate(factory.updateTypeQueryNode, factoryDeprecation); - createTypeLiteralNode = deprecate(factory.createTypeLiteralNode, factoryDeprecation); - updateTypeLiteralNode = deprecate(factory.updateTypeLiteralNode, factoryDeprecation); - createArrayTypeNode = deprecate(factory.createArrayTypeNode, factoryDeprecation); - updateArrayTypeNode = deprecate(factory.updateArrayTypeNode, factoryDeprecation); - createTupleTypeNode = deprecate(factory.createTupleTypeNode, factoryDeprecation); - updateTupleTypeNode = deprecate(factory.updateTupleTypeNode, factoryDeprecation); - createOptionalTypeNode = deprecate(factory.createOptionalTypeNode, factoryDeprecation); - updateOptionalTypeNode = deprecate(factory.updateOptionalTypeNode, factoryDeprecation); - createRestTypeNode = deprecate(factory.createRestTypeNode, factoryDeprecation); - updateRestTypeNode = deprecate(factory.updateRestTypeNode, factoryDeprecation); - createUnionTypeNode = deprecate(factory.createUnionTypeNode, factoryDeprecation); - updateUnionTypeNode = deprecate(factory.updateUnionTypeNode, factoryDeprecation); - createIntersectionTypeNode = deprecate(factory.createIntersectionTypeNode, factoryDeprecation); - updateIntersectionTypeNode = deprecate(factory.updateIntersectionTypeNode, factoryDeprecation); - createConditionalTypeNode = deprecate(factory.createConditionalTypeNode, factoryDeprecation); - updateConditionalTypeNode = deprecate(factory.updateConditionalTypeNode, factoryDeprecation); - createInferTypeNode = deprecate(factory.createInferTypeNode, factoryDeprecation); - updateInferTypeNode = deprecate(factory.updateInferTypeNode, factoryDeprecation); - createImportTypeNode = deprecate(factory.createImportTypeNode, factoryDeprecation); - updateImportTypeNode = deprecate(factory.updateImportTypeNode, factoryDeprecation); - createParenthesizedType = deprecate(factory.createParenthesizedType, factoryDeprecation); - updateParenthesizedType = deprecate(factory.updateParenthesizedType, factoryDeprecation); - createThisTypeNode = deprecate(factory.createThisTypeNode, factoryDeprecation); - updateTypeOperatorNode = deprecate(factory.updateTypeOperatorNode, factoryDeprecation); - createIndexedAccessTypeNode = deprecate(factory.createIndexedAccessTypeNode, factoryDeprecation); - updateIndexedAccessTypeNode = deprecate(factory.updateIndexedAccessTypeNode, factoryDeprecation); - createMappedTypeNode = deprecate(factory.createMappedTypeNode, factoryDeprecation); - updateMappedTypeNode = deprecate(factory.updateMappedTypeNode, factoryDeprecation); - createLiteralTypeNode = deprecate(factory.createLiteralTypeNode, factoryDeprecation); - updateLiteralTypeNode = deprecate(factory.updateLiteralTypeNode, factoryDeprecation); - createObjectBindingPattern = deprecate(factory.createObjectBindingPattern, factoryDeprecation); - updateObjectBindingPattern = deprecate(factory.updateObjectBindingPattern, factoryDeprecation); - createArrayBindingPattern = deprecate(factory.createArrayBindingPattern, factoryDeprecation); - updateArrayBindingPattern = deprecate(factory.updateArrayBindingPattern, factoryDeprecation); - createBindingElement = deprecate(factory.createBindingElement, factoryDeprecation); - updateBindingElement = deprecate(factory.updateBindingElement, factoryDeprecation); - createArrayLiteral = deprecate(factory.createArrayLiteralExpression, factoryDeprecation); - updateArrayLiteral = deprecate(factory.updateArrayLiteralExpression, factoryDeprecation); - createObjectLiteral = deprecate(factory.createObjectLiteralExpression, factoryDeprecation); - updateObjectLiteral = deprecate(factory.updateObjectLiteralExpression, factoryDeprecation); - createPropertyAccess = deprecate(factory.createPropertyAccessExpression, factoryDeprecation); - updatePropertyAccess = deprecate(factory.updatePropertyAccessExpression, factoryDeprecation); - createPropertyAccessChain = deprecate(factory.createPropertyAccessChain, factoryDeprecation); - updatePropertyAccessChain = deprecate(factory.updatePropertyAccessChain, factoryDeprecation); - createElementAccess = deprecate(factory.createElementAccessExpression, factoryDeprecation); - updateElementAccess = deprecate(factory.updateElementAccessExpression, factoryDeprecation); - createElementAccessChain = deprecate(factory.createElementAccessChain, factoryDeprecation); - updateElementAccessChain = deprecate(factory.updateElementAccessChain, factoryDeprecation); - createCall = deprecate(factory.createCallExpression, factoryDeprecation); - updateCall = deprecate(factory.updateCallExpression, factoryDeprecation); - createCallChain = deprecate(factory.createCallChain, factoryDeprecation); - updateCallChain = deprecate(factory.updateCallChain, factoryDeprecation); - createNew = deprecate(factory.createNewExpression, factoryDeprecation); - updateNew = deprecate(factory.updateNewExpression, factoryDeprecation); - createTypeAssertion = deprecate(factory.createTypeAssertion, factoryDeprecation); - updateTypeAssertion = deprecate(factory.updateTypeAssertion, factoryDeprecation); - createParen = deprecate(factory.createParenthesizedExpression, factoryDeprecation); - updateParen = deprecate(factory.updateParenthesizedExpression, factoryDeprecation); - createFunctionExpression = deprecate(factory.createFunctionExpression, factoryDeprecation); - updateFunctionExpression = deprecate(factory.updateFunctionExpression, factoryDeprecation); - createDelete = deprecate(factory.createDeleteExpression, factoryDeprecation); - updateDelete = deprecate(factory.updateDeleteExpression, factoryDeprecation); - createTypeOf = deprecate(factory.createTypeOfExpression, factoryDeprecation); - updateTypeOf = deprecate(factory.updateTypeOfExpression, factoryDeprecation); - createVoid = deprecate(factory.createVoidExpression, factoryDeprecation); - updateVoid = deprecate(factory.updateVoidExpression, factoryDeprecation); - createAwait = deprecate(factory.createAwaitExpression, factoryDeprecation); - updateAwait = deprecate(factory.updateAwaitExpression, factoryDeprecation); - createPrefix = deprecate(factory.createPrefixUnaryExpression, factoryDeprecation); - updatePrefix = deprecate(factory.updatePrefixUnaryExpression, factoryDeprecation); - createPostfix = deprecate(factory.createPostfixUnaryExpression, factoryDeprecation); - updatePostfix = deprecate(factory.updatePostfixUnaryExpression, factoryDeprecation); - createBinary = deprecate(factory.createBinaryExpression, factoryDeprecation); - updateConditional = deprecate(factory.updateConditionalExpression, factoryDeprecation); - createTemplateExpression = deprecate(factory.createTemplateExpression, factoryDeprecation); - updateTemplateExpression = deprecate(factory.updateTemplateExpression, factoryDeprecation); - createTemplateHead = deprecate(factory.createTemplateHead, factoryDeprecation); - createTemplateMiddle = deprecate(factory.createTemplateMiddle, factoryDeprecation); - createTemplateTail = deprecate(factory.createTemplateTail, factoryDeprecation); - createNoSubstitutionTemplateLiteral = deprecate(factory.createNoSubstitutionTemplateLiteral, factoryDeprecation); - updateYield = deprecate(factory.updateYieldExpression, factoryDeprecation); - createSpread = deprecate(factory.createSpreadElement, factoryDeprecation); - updateSpread = deprecate(factory.updateSpreadElement, factoryDeprecation); - createOmittedExpression = deprecate(factory.createOmittedExpression, factoryDeprecation); - createAsExpression = deprecate(factory.createAsExpression, factoryDeprecation); - updateAsExpression = deprecate(factory.updateAsExpression, factoryDeprecation); - createNonNullExpression = deprecate(factory.createNonNullExpression, factoryDeprecation); - updateNonNullExpression = deprecate(factory.updateNonNullExpression, factoryDeprecation); - createNonNullChain = deprecate(factory.createNonNullChain, factoryDeprecation); - updateNonNullChain = deprecate(factory.updateNonNullChain, factoryDeprecation); - createMetaProperty = deprecate(factory.createMetaProperty, factoryDeprecation); - updateMetaProperty = deprecate(factory.updateMetaProperty, factoryDeprecation); - createTemplateSpan = deprecate(factory.createTemplateSpan, factoryDeprecation); - updateTemplateSpan = deprecate(factory.updateTemplateSpan, factoryDeprecation); - createSemicolonClassElement = deprecate(factory.createSemicolonClassElement, factoryDeprecation); - createBlock = deprecate(factory.createBlock, factoryDeprecation); - updateBlock = deprecate(factory.updateBlock, factoryDeprecation); - createVariableStatement = deprecate(factory.createVariableStatement, factoryDeprecation); - updateVariableStatement = deprecate(factory.updateVariableStatement, factoryDeprecation); - createEmptyStatement = deprecate(factory.createEmptyStatement, factoryDeprecation); - createExpressionStatement = deprecate(factory.createExpressionStatement, factoryDeprecation); - updateExpressionStatement = deprecate(factory.updateExpressionStatement, factoryDeprecation); - createStatement = deprecate(factory.createExpressionStatement, factoryDeprecation); - updateStatement = deprecate(factory.updateExpressionStatement, factoryDeprecation); - createIf = deprecate(factory.createIfStatement, factoryDeprecation); - updateIf = deprecate(factory.updateIfStatement, factoryDeprecation); - createDo = deprecate(factory.createDoStatement, factoryDeprecation); - updateDo = deprecate(factory.updateDoStatement, factoryDeprecation); - createWhile = deprecate(factory.createWhileStatement, factoryDeprecation); - updateWhile = deprecate(factory.updateWhileStatement, factoryDeprecation); - createFor = deprecate(factory.createForStatement, factoryDeprecation); - updateFor = deprecate(factory.updateForStatement, factoryDeprecation); - createForIn = deprecate(factory.createForInStatement, factoryDeprecation); - updateForIn = deprecate(factory.updateForInStatement, factoryDeprecation); - createForOf = deprecate(factory.createForOfStatement, factoryDeprecation); - updateForOf = deprecate(factory.updateForOfStatement, factoryDeprecation); - createContinue = deprecate(factory.createContinueStatement, factoryDeprecation); - updateContinue = deprecate(factory.updateContinueStatement, factoryDeprecation); - createBreak = deprecate(factory.createBreakStatement, factoryDeprecation); - updateBreak = deprecate(factory.updateBreakStatement, factoryDeprecation); - createReturn = deprecate(factory.createReturnStatement, factoryDeprecation); - updateReturn = deprecate(factory.updateReturnStatement, factoryDeprecation); - createWith = deprecate(factory.createWithStatement, factoryDeprecation); - updateWith = deprecate(factory.updateWithStatement, factoryDeprecation); - createSwitch = deprecate(factory.createSwitchStatement, factoryDeprecation); - updateSwitch = deprecate(factory.updateSwitchStatement, factoryDeprecation); - createLabel = deprecate(factory.createLabeledStatement, factoryDeprecation); - updateLabel = deprecate(factory.updateLabeledStatement, factoryDeprecation); - createThrow = deprecate(factory.createThrowStatement, factoryDeprecation); - updateThrow = deprecate(factory.updateThrowStatement, factoryDeprecation); - createTry = deprecate(factory.createTryStatement, factoryDeprecation); - updateTry = deprecate(factory.updateTryStatement, factoryDeprecation); - createDebuggerStatement = deprecate(factory.createDebuggerStatement, factoryDeprecation); - createVariableDeclarationList = deprecate(factory.createVariableDeclarationList, factoryDeprecation); - updateVariableDeclarationList = deprecate(factory.updateVariableDeclarationList, factoryDeprecation); - createFunctionDeclaration = deprecate(factory.createFunctionDeclaration, factoryDeprecation); - updateFunctionDeclaration = deprecate(factory.updateFunctionDeclaration, factoryDeprecation); - createClassDeclaration = deprecate(factory.createClassDeclaration, factoryDeprecation); - updateClassDeclaration = deprecate(factory.updateClassDeclaration, factoryDeprecation); - createInterfaceDeclaration = deprecate(factory.createInterfaceDeclaration, factoryDeprecation); - updateInterfaceDeclaration = deprecate(factory.updateInterfaceDeclaration, factoryDeprecation); - createTypeAliasDeclaration = deprecate(factory.createTypeAliasDeclaration, factoryDeprecation); - updateTypeAliasDeclaration = deprecate(factory.updateTypeAliasDeclaration, factoryDeprecation); - createEnumDeclaration = deprecate(factory.createEnumDeclaration, factoryDeprecation); - updateEnumDeclaration = deprecate(factory.updateEnumDeclaration, factoryDeprecation); - createModuleDeclaration = deprecate(factory.createModuleDeclaration, factoryDeprecation); - updateModuleDeclaration = deprecate(factory.updateModuleDeclaration, factoryDeprecation); - createModuleBlock = deprecate(factory.createModuleBlock, factoryDeprecation); - updateModuleBlock = deprecate(factory.updateModuleBlock, factoryDeprecation); - createCaseBlock = deprecate(factory.createCaseBlock, factoryDeprecation); - updateCaseBlock = deprecate(factory.updateCaseBlock, factoryDeprecation); - createNamespaceExportDeclaration = deprecate(factory.createNamespaceExportDeclaration, factoryDeprecation); - updateNamespaceExportDeclaration = deprecate(factory.updateNamespaceExportDeclaration, factoryDeprecation); - createImportEqualsDeclaration = deprecate(factory.createImportEqualsDeclaration, factoryDeprecation); - updateImportEqualsDeclaration = deprecate(factory.updateImportEqualsDeclaration, factoryDeprecation); - createImportDeclaration = deprecate(factory.createImportDeclaration, factoryDeprecation); - updateImportDeclaration = deprecate(factory.updateImportDeclaration, factoryDeprecation); - createNamespaceImport = deprecate(factory.createNamespaceImport, factoryDeprecation); - updateNamespaceImport = deprecate(factory.updateNamespaceImport, factoryDeprecation); - createNamedImports = deprecate(factory.createNamedImports, factoryDeprecation); - updateNamedImports = deprecate(factory.updateNamedImports, factoryDeprecation); - createImportSpecifier = deprecate(factory.createImportSpecifier, factoryDeprecation); - updateImportSpecifier = deprecate(factory.updateImportSpecifier, factoryDeprecation); - createExportAssignment2 = deprecate(factory.createExportAssignment, factoryDeprecation); - updateExportAssignment = deprecate(factory.updateExportAssignment, factoryDeprecation); - createNamedExports = deprecate(factory.createNamedExports, factoryDeprecation); - updateNamedExports = deprecate(factory.updateNamedExports, factoryDeprecation); - createExportSpecifier = deprecate(factory.createExportSpecifier, factoryDeprecation); - updateExportSpecifier = deprecate(factory.updateExportSpecifier, factoryDeprecation); - createExternalModuleReference = deprecate(factory.createExternalModuleReference, factoryDeprecation); - updateExternalModuleReference = deprecate(factory.updateExternalModuleReference, factoryDeprecation); - createJSDocTypeExpression = deprecate(factory.createJSDocTypeExpression, factoryDeprecation); - createJSDocTypeTag = deprecate(factory.createJSDocTypeTag, factoryDeprecation); - createJSDocReturnTag = deprecate(factory.createJSDocReturnTag, factoryDeprecation); - createJSDocThisTag = deprecate(factory.createJSDocThisTag, factoryDeprecation); - createJSDocComment = deprecate(factory.createJSDocComment, factoryDeprecation); - createJSDocParameterTag = deprecate(factory.createJSDocParameterTag, factoryDeprecation); - createJSDocClassTag = deprecate(factory.createJSDocClassTag, factoryDeprecation); - createJSDocAugmentsTag = deprecate(factory.createJSDocAugmentsTag, factoryDeprecation); - createJSDocEnumTag = deprecate(factory.createJSDocEnumTag, factoryDeprecation); - createJSDocTemplateTag = deprecate(factory.createJSDocTemplateTag, factoryDeprecation); - createJSDocTypedefTag = deprecate(factory.createJSDocTypedefTag, factoryDeprecation); - createJSDocCallbackTag = deprecate(factory.createJSDocCallbackTag, factoryDeprecation); - createJSDocSignature = deprecate(factory.createJSDocSignature, factoryDeprecation); - createJSDocPropertyTag = deprecate(factory.createJSDocPropertyTag, factoryDeprecation); - createJSDocTypeLiteral = deprecate(factory.createJSDocTypeLiteral, factoryDeprecation); - createJSDocImplementsTag = deprecate(factory.createJSDocImplementsTag, factoryDeprecation); - createJSDocAuthorTag = deprecate(factory.createJSDocAuthorTag, factoryDeprecation); - createJSDocPublicTag = deprecate(factory.createJSDocPublicTag, factoryDeprecation); - createJSDocPrivateTag = deprecate(factory.createJSDocPrivateTag, factoryDeprecation); - createJSDocProtectedTag = deprecate(factory.createJSDocProtectedTag, factoryDeprecation); - createJSDocReadonlyTag = deprecate(factory.createJSDocReadonlyTag, factoryDeprecation); - createJSDocTag = deprecate(factory.createJSDocUnknownTag, factoryDeprecation); - createJsxElement = deprecate(factory.createJsxElement, factoryDeprecation); - updateJsxElement = deprecate(factory.updateJsxElement, factoryDeprecation); - createJsxSelfClosingElement = deprecate(factory.createJsxSelfClosingElement, factoryDeprecation); - updateJsxSelfClosingElement = deprecate(factory.updateJsxSelfClosingElement, factoryDeprecation); - createJsxOpeningElement = deprecate(factory.createJsxOpeningElement, factoryDeprecation); - updateJsxOpeningElement = deprecate(factory.updateJsxOpeningElement, factoryDeprecation); - createJsxClosingElement = deprecate(factory.createJsxClosingElement, factoryDeprecation); - updateJsxClosingElement = deprecate(factory.updateJsxClosingElement, factoryDeprecation); - createJsxFragment = deprecate(factory.createJsxFragment, factoryDeprecation); - createJsxText = deprecate(factory.createJsxText, factoryDeprecation); - updateJsxText = deprecate(factory.updateJsxText, factoryDeprecation); - createJsxOpeningFragment = deprecate(factory.createJsxOpeningFragment, factoryDeprecation); - createJsxJsxClosingFragment = deprecate(factory.createJsxJsxClosingFragment, factoryDeprecation); - updateJsxFragment = deprecate(factory.updateJsxFragment, factoryDeprecation); - createJsxAttribute = deprecate(factory.createJsxAttribute, factoryDeprecation); - updateJsxAttribute = deprecate(factory.updateJsxAttribute, factoryDeprecation); - createJsxAttributes = deprecate(factory.createJsxAttributes, factoryDeprecation); - updateJsxAttributes = deprecate(factory.updateJsxAttributes, factoryDeprecation); - createJsxSpreadAttribute = deprecate(factory.createJsxSpreadAttribute, factoryDeprecation); - updateJsxSpreadAttribute = deprecate(factory.updateJsxSpreadAttribute, factoryDeprecation); - createJsxExpression = deprecate(factory.createJsxExpression, factoryDeprecation); - updateJsxExpression = deprecate(factory.updateJsxExpression, factoryDeprecation); - createCaseClause = deprecate(factory.createCaseClause, factoryDeprecation); - updateCaseClause = deprecate(factory.updateCaseClause, factoryDeprecation); - createDefaultClause = deprecate(factory.createDefaultClause, factoryDeprecation); - updateDefaultClause = deprecate(factory.updateDefaultClause, factoryDeprecation); - createHeritageClause = deprecate(factory.createHeritageClause, factoryDeprecation); - updateHeritageClause = deprecate(factory.updateHeritageClause, factoryDeprecation); - createCatchClause = deprecate(factory.createCatchClause, factoryDeprecation); - updateCatchClause = deprecate(factory.updateCatchClause, factoryDeprecation); - createPropertyAssignment = deprecate(factory.createPropertyAssignment, factoryDeprecation); - updatePropertyAssignment = deprecate(factory.updatePropertyAssignment, factoryDeprecation); - createShorthandPropertyAssignment = deprecate(factory.createShorthandPropertyAssignment, factoryDeprecation); - updateShorthandPropertyAssignment = deprecate(factory.updateShorthandPropertyAssignment, factoryDeprecation); - createSpreadAssignment = deprecate(factory.createSpreadAssignment, factoryDeprecation); - updateSpreadAssignment = deprecate(factory.updateSpreadAssignment, factoryDeprecation); - createEnumMember = deprecate(factory.createEnumMember, factoryDeprecation); - updateEnumMember = deprecate(factory.updateEnumMember, factoryDeprecation); - updateSourceFileNode = deprecate(factory.updateSourceFile, factoryDeprecation); - createNotEmittedStatement = deprecate(factory.createNotEmittedStatement, factoryDeprecation); - createPartiallyEmittedExpression = deprecate(factory.createPartiallyEmittedExpression, factoryDeprecation); - updatePartiallyEmittedExpression = deprecate(factory.updatePartiallyEmittedExpression, factoryDeprecation); - createCommaList = deprecate(factory.createCommaListExpression, factoryDeprecation); - updateCommaList = deprecate(factory.updateCommaListExpression, factoryDeprecation); - createBundle = deprecate(factory.createBundle, factoryDeprecation); - updateBundle = deprecate(factory.updateBundle, factoryDeprecation); - createImmediatelyInvokedFunctionExpression = deprecate(factory.createImmediatelyInvokedFunctionExpression, factoryDeprecation); - createImmediatelyInvokedArrowFunction = deprecate(factory.createImmediatelyInvokedArrowFunction, factoryDeprecation); - createVoidZero = deprecate(factory.createVoidZero, factoryDeprecation); - createExportDefault = deprecate(factory.createExportDefault, factoryDeprecation); - createExternalModuleExport = deprecate(factory.createExternalModuleExport, factoryDeprecation); - createNamespaceExport = deprecate(factory.createNamespaceExport, factoryDeprecation); - updateNamespaceExport = deprecate(factory.updateNamespaceExport, factoryDeprecation); - createToken = deprecate(function createToken2(kind) { - return factory.createToken(kind); - }, factoryDeprecation); - createIdentifier = deprecate(function createIdentifier2(text) { - return factory.createIdentifier( - text, - /*typeArguments*/ - void 0, - /*originalKeywordKind*/ - void 0 - ); - }, factoryDeprecation); - createTempVariable = deprecate(function createTempVariable2(recordTempVariable) { - return factory.createTempVariable( - recordTempVariable, - /*reserveInNestedScopes*/ - void 0 - ); - }, factoryDeprecation); - getGeneratedNameForNode = deprecate(function getGeneratedNameForNode2(node) { - return factory.getGeneratedNameForNode( - node, - /*flags*/ - void 0 - ); - }, factoryDeprecation); - createOptimisticUniqueName = deprecate(function createOptimisticUniqueName2(text) { - return factory.createUniqueName(text, 16 /* Optimistic */); - }, factoryDeprecation); - createFileLevelUniqueName = deprecate(function createFileLevelUniqueName2(text) { - return factory.createUniqueName(text, 16 /* Optimistic */ | 32 /* FileLevel */); - }, factoryDeprecation); - createIndexSignature = deprecate(function createIndexSignature2(decorators, modifiers, parameters, type) { - return factory.createIndexSignature(decorators, modifiers, parameters, type); - }, factoryDeprecation); - createTypePredicateNode = deprecate(function createTypePredicateNode2(parameterName, type) { - return factory.createTypePredicateNode( - /*assertsModifier*/ - void 0, - parameterName, - type - ); - }, factoryDeprecation); - updateTypePredicateNode = deprecate(function updateTypePredicateNode2(node, parameterName, type) { - return factory.updateTypePredicateNode( - node, - /*assertsModifier*/ - void 0, - parameterName, - type - ); - }, factoryDeprecation); - createLiteral = deprecate(function createLiteral2(value) { - if (typeof value === "number") { - return factory.createNumericLiteral(value); - } - if (typeof value === "object" && "base10Value" in value) { - return factory.createBigIntLiteral(value); - } - if (typeof value === "boolean") { - return value ? factory.createTrue() : factory.createFalse(); - } - if (typeof value === "string") { - return factory.createStringLiteral( - value, - /*isSingleQuote*/ - void 0 - ); - } - return factory.createStringLiteralFromNode(value); - }, { since: "4.0", warnAfter: "4.1", message: "Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead." }); - createMethodSignature = deprecate(function createMethodSignature2(typeParameters, parameters, type, name, questionToken) { - return factory.createMethodSignature( - /*modifiers*/ - void 0, - name, - questionToken, - typeParameters, - parameters, - type - ); - }, factoryDeprecation); - updateMethodSignature = deprecate(function updateMethodSignature2(node, typeParameters, parameters, type, name, questionToken) { - return factory.updateMethodSignature(node, node.modifiers, name, questionToken, typeParameters, parameters, type); - }, factoryDeprecation); - createTypeOperatorNode = deprecate(function createTypeOperatorNode2(operatorOrType, type) { - let operator; - if (type) { - operator = operatorOrType; - } else { - type = operatorOrType; - operator = 141 /* KeyOfKeyword */; - } - return factory.createTypeOperatorNode(operator, type); - }, factoryDeprecation); - createTaggedTemplate = deprecate(function createTaggedTemplate2(tag, typeArgumentsOrTemplate, template) { - let typeArguments; - if (template) { - typeArguments = typeArgumentsOrTemplate; - } else { - template = typeArgumentsOrTemplate; + addObjectAllocatorPatcher((objectAllocator2) => { + const Identifier73 = objectAllocator2.getIdentifierConstructor(); + if (!hasProperty(Identifier73.prototype, "originalKeywordKind")) { + Object.defineProperty(Identifier73.prototype, "originalKeywordKind", { + get: deprecate(function() { + return identifierToKeywordKind(this); + }, { + name: "originalKeywordKind", + since: "5.0", + warnAfter: "5.1", + errorAfter: "5.2", + message: "Use 'identifierToKeywordKind(identifier)' instead." + }) + }); } - return factory.createTaggedTemplateExpression(tag, typeArguments, template); - }, factoryDeprecation); - updateTaggedTemplate = deprecate(function updateTaggedTemplate2(node, tag, typeArgumentsOrTemplate, template) { - let typeArguments; - if (template) { - typeArguments = typeArgumentsOrTemplate; - } else { - template = typeArgumentsOrTemplate; - } - return factory.updateTaggedTemplateExpression(node, tag, typeArguments, template); - }, factoryDeprecation); - updateBinary = deprecate(function updateBinary2(node, left, right, operator = node.operatorToken) { - if (typeof operator === "number") { - operator = operator === node.operatorToken.kind ? node.operatorToken : factory.createToken(operator); - } - return factory.updateBinaryExpression(node, left, operator, right); - }, factoryDeprecation); - createConditional = deprecate(function createConditional2(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - return arguments.length === 5 ? factory.createConditionalExpression(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) : arguments.length === 3 ? factory.createConditionalExpression(condition, factory.createToken(57 /* QuestionToken */), questionTokenOrWhenTrue, factory.createToken(58 /* ColonToken */), whenTrueOrWhenFalse) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - createYield = deprecate(function createYield2(asteriskTokenOrExpression, expression) { - let asteriskToken; - if (expression) { - asteriskToken = asteriskTokenOrExpression; - } else { - expression = asteriskTokenOrExpression; + if (!hasProperty(Identifier73.prototype, "isInJSDocNamespace")) { + Object.defineProperty(Identifier73.prototype, "isInJSDocNamespace", { + get: deprecate(function() { + return this.flags & 2048 /* IdentifierIsInJSDocNamespace */ ? true : void 0; + }, { + name: "isInJSDocNamespace", + since: "5.0", + warnAfter: "5.1", + errorAfter: "5.2", + message: "Use '.parent' or the surrounding context to determine this instead." + }) + }); } - return factory.createYieldExpression(asteriskToken, expression); - }, factoryDeprecation); - createClassExpression = deprecate(function createClassExpression2(modifiers, name, typeParameters, heritageClauses, members) { - return factory.createClassExpression( - /*decorators*/ - void 0, - modifiers, - name, - typeParameters, - heritageClauses, - members - ); - }, factoryDeprecation); - updateClassExpression = deprecate(function updateClassExpression2(node, modifiers, name, typeParameters, heritageClauses, members) { - return factory.updateClassExpression( - node, - /*decorators*/ - void 0, - modifiers, - name, - typeParameters, - heritageClauses, - members - ); - }, factoryDeprecation); - createPropertySignature = deprecate(function createPropertySignature2(modifiers, name, questionToken, type, initializer) { - const node = factory.createPropertySignature(modifiers, name, questionToken, type); - node.initializer = initializer; - return node; - }, factoryDeprecation); - updatePropertySignature = deprecate(function updatePropertySignature2(node, modifiers, name, questionToken, type, initializer) { - let updated = factory.updatePropertySignature(node, modifiers, name, questionToken, type); - if (node.initializer !== initializer) { - if (updated === node) { - updated = factory.cloneNode(node); - } - updated.initializer = initializer; - } - return updated; - }, factoryDeprecation); - createExpressionWithTypeArguments = deprecate(function createExpressionWithTypeArguments2(typeArguments, expression) { - return factory.createExpressionWithTypeArguments(expression, typeArguments); - }, factoryDeprecation); - updateExpressionWithTypeArguments = deprecate(function updateExpressionWithTypeArguments2(node, typeArguments, expression) { - return factory.updateExpressionWithTypeArguments(node, expression, typeArguments); - }, factoryDeprecation); - createArrowFunction = deprecate(function createArrowFunction2(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) { - return arguments.length === 6 ? factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) : arguments.length === 5 ? factory.createArrowFunction( - modifiers, - typeParameters, - parameters, - type, - /*equalsGreaterThanToken*/ - void 0, - equalsGreaterThanTokenOrBody - ) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - updateArrowFunction = deprecate(function updateArrowFunction2(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) { - return arguments.length === 7 ? factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) : arguments.length === 6 ? factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, equalsGreaterThanTokenOrBody) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - createVariableDeclaration = deprecate(function createVariableDeclaration2(name, exclamationTokenOrType, typeOrInitializer, initializer) { - return arguments.length === 4 ? factory.createVariableDeclaration(name, exclamationTokenOrType, typeOrInitializer, initializer) : arguments.length >= 1 && arguments.length <= 3 ? factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - exclamationTokenOrType, - typeOrInitializer - ) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - updateVariableDeclaration = deprecate(function updateVariableDeclaration2(node, name, exclamationTokenOrType, typeOrInitializer, initializer) { - return arguments.length === 5 ? factory.updateVariableDeclaration(node, name, exclamationTokenOrType, typeOrInitializer, initializer) : arguments.length === 4 ? factory.updateVariableDeclaration(node, name, node.exclamationToken, exclamationTokenOrType, typeOrInitializer) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - createImportClause = deprecate(function createImportClause2(name, namedBindings, isTypeOnly = false) { - return factory.createImportClause(isTypeOnly, name, namedBindings); - }, factoryDeprecation); - updateImportClause = deprecate(function updateImportClause2(node, name, namedBindings, isTypeOnly) { - return factory.updateImportClause(node, isTypeOnly, name, namedBindings); - }, factoryDeprecation); - createExportDeclaration = deprecate(function createExportDeclaration2(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly = false) { - return factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier); - }, factoryDeprecation); - updateExportDeclaration = deprecate(function updateExportDeclaration2(node, decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { - return factory.updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, node.assertClause); - }, factoryDeprecation); - createJSDocParamTag = deprecate(function createJSDocParamTag2(name, isBracketed, typeExpression, comment) { - return factory.createJSDocParameterTag( - /*tagName*/ - void 0, - name, - isBracketed, - typeExpression, - /*isNameFirst*/ - false, - comment ? factory.createNodeArray([factory.createJSDocText(comment)]) : void 0 - ); - }, factoryDeprecation); - createComma = deprecate(function createComma2(left, right) { - return factory.createComma(left, right); - }, factoryDeprecation); - createLessThan = deprecate(function createLessThan2(left, right) { - return factory.createLessThan(left, right); - }, factoryDeprecation); - createAssignment = deprecate(function createAssignment2(left, right) { - return factory.createAssignment(left, right); - }, factoryDeprecation); - createStrictEquality = deprecate(function createStrictEquality2(left, right) { - return factory.createStrictEquality(left, right); - }, factoryDeprecation); - createStrictInequality = deprecate(function createStrictInequality2(left, right) { - return factory.createStrictInequality(left, right); - }, factoryDeprecation); - createAdd = deprecate(function createAdd2(left, right) { - return factory.createAdd(left, right); - }, factoryDeprecation); - createSubtract = deprecate(function createSubtract2(left, right) { - return factory.createSubtract(left, right); - }, factoryDeprecation); - createLogicalAnd = deprecate(function createLogicalAnd2(left, right) { - return factory.createLogicalAnd(left, right); - }, factoryDeprecation); - createLogicalOr = deprecate(function createLogicalOr2(left, right) { - return factory.createLogicalOr(left, right); - }, factoryDeprecation); - createPostfixIncrement = deprecate(function createPostfixIncrement2(operand) { - return factory.createPostfixIncrement(operand); - }, factoryDeprecation); - createLogicalNot = deprecate(function createLogicalNot2(operand) { - return factory.createLogicalNot(operand); - }, factoryDeprecation); - createNode2 = deprecate(function createNode3(kind, pos = 0, end = 0) { - return setTextRangePosEnd( - kind === 308 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind), - pos, - end - ); - }, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory` method instead." }); - getMutableClone = deprecate(function getMutableClone2(node) { - const clone2 = factory.cloneNode(node); - setTextRange(clone2, node); - setParent(clone2, node.parent); - return clone2; - }, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`." }); - } - }); - - // src/deprecatedCompat/4.0/renamedNodeTests.ts - var isTypeAssertion; - var init_renamedNodeTests = __esm({ - "src/deprecatedCompat/4.0/renamedNodeTests.ts"() { - "use strict"; - init_ts5(); - init_deprecate(); - isTypeAssertion = deprecate(function isTypeAssertion2(node) { - return node.kind === 213 /* TypeAssertionExpression */; - }, { - since: "4.0", - warnAfter: "4.1", - message: "Use `isTypeAssertionExpression` instead." - }); - } - }); - - // src/deprecatedCompat/4.2/renamedNodeTests.ts - var isIdentifierOrPrivateIdentifier; - var init_renamedNodeTests2 = __esm({ - "src/deprecatedCompat/4.2/renamedNodeTests.ts"() { - "use strict"; - init_ts5(); - init_deprecate(); - isIdentifierOrPrivateIdentifier = deprecate(function isIdentifierOrPrivateIdentifier2(node) { - return isMemberName(node); - }, { - since: "4.2", - warnAfter: "4.3", - message: "Use `isMemberName` instead." }); } }); - // src/deprecatedCompat/4.2/abstractConstructorTypes.ts - function patchNodeFactory(factory2) { - const { - createConstructorTypeNode: createConstructorTypeNode2, - updateConstructorTypeNode: updateConstructorTypeNode2 - } = factory2; - factory2.createConstructorTypeNode = buildOverload("createConstructorTypeNode").overload({ - 0(modifiers, typeParameters, parameters, type) { - return createConstructorTypeNode2(modifiers, typeParameters, parameters, type); - }, - 1(typeParameters, parameters, type) { - return createConstructorTypeNode2( - /*modifiers*/ - void 0, - typeParameters, - parameters, - type - ); - } - }).bind({ - 0: (args) => args.length === 4, - 1: (args) => args.length === 3 - }).deprecate({ - 1: { since: "4.2", warnAfter: "4.3", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - factory2.updateConstructorTypeNode = buildOverload("updateConstructorTypeNode").overload({ - 0(node, modifiers, typeParameters, parameters, type) { - return updateConstructorTypeNode2(node, modifiers, typeParameters, parameters, type); - }, - 1(node, typeParameters, parameters, type) { - return updateConstructorTypeNode2(node, node.modifiers, typeParameters, parameters, type); - } - }).bind({ - 0: (args) => args.length === 5, - 1: (args) => args.length === 4 - }).deprecate({ - 1: { since: "4.2", warnAfter: "4.3", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - } - var init_abstractConstructorTypes = __esm({ - "src/deprecatedCompat/4.2/abstractConstructorTypes.ts"() { - "use strict"; - init_ts5(); - addNodeFactoryPatcher(patchNodeFactory); - patchNodeFactory(factory); - } - }); - - // src/deprecatedCompat/4.6/importTypeAssertions.ts - function patchNodeFactory2(factory2) { - const { - createImportTypeNode: createImportTypeNode2, - updateImportTypeNode: updateImportTypeNode2 - } = factory2; - factory2.createImportTypeNode = buildOverload("createImportTypeNode").overload({ - 0(argument, assertions, qualifier, typeArguments, isTypeOf) { - return createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf); - }, - 1(argument, qualifier, typeArguments, isTypeOf) { - return createImportTypeNode2( - argument, - /*assertions*/ - void 0, - qualifier, - typeArguments, - isTypeOf - ); - } - }).bind({ - 0: ([, assertions, qualifier, typeArguments, isTypeOf]) => (assertions === void 0 || isImportTypeAssertionContainer(assertions)) && (qualifier === void 0 || !isArray(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"), - 1: ([, qualifier, typeArguments, isTypeOf, other]) => other === void 0 && (qualifier === void 0 || isEntityName(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean") - }).deprecate({ - 1: { since: "4.6", warnAfter: "4.7", message: "Use the overload that accepts 'assertions'" } - }).finish(); - factory2.updateImportTypeNode = buildOverload("updateImportTypeNode").overload({ - 0(node, argument, assertions, qualifier, typeArguments, isTypeOf) { - return updateImportTypeNode2(node, argument, assertions, qualifier, typeArguments, isTypeOf); - }, - 1(node, argument, qualifier, typeArguments, isTypeOf) { - return updateImportTypeNode2(node, argument, node.assertions, qualifier, typeArguments, isTypeOf); - } - }).bind({ - 0: ([, , assertions, qualifier, typeArguments, isTypeOf]) => (assertions === void 0 || isImportTypeAssertionContainer(assertions)) && (qualifier === void 0 || !isArray(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"), - 1: ([, , qualifier, typeArguments, isTypeOf, other]) => other === void 0 && (qualifier === void 0 || isEntityName(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean") - }).deprecate({ - 1: { since: "4.6", warnAfter: "4.7", message: "Use the overload that accepts 'assertions'" } - }).finish(); - } - var init_importTypeAssertions = __esm({ - "src/deprecatedCompat/4.6/importTypeAssertions.ts"() { - "use strict"; - init_ts5(); - addNodeFactoryPatcher(patchNodeFactory2); - patchNodeFactory2(factory); - } - }); - - // src/deprecatedCompat/4.7/typeParameterModifiers.ts - function patchNodeFactory3(factory2) { - const { - createTypeParameterDeclaration: createTypeParameterDeclaration2, - updateTypeParameterDeclaration: updateTypeParameterDeclaration2 - } = factory2; - factory2.createTypeParameterDeclaration = buildOverload("createTypeParameterDeclaration").overload({ - 0(modifiers, name, constraint, defaultType) { - return createTypeParameterDeclaration2(modifiers, name, constraint, defaultType); - }, - 1(name, constraint, defaultType) { - return createTypeParameterDeclaration2( - /*modifiers*/ - void 0, - name, - constraint, - defaultType - ); - } - }).bind({ - 0: ([modifiers]) => modifiers === void 0 || isArray(modifiers), - 1: ([name]) => name !== void 0 && !isArray(name) - }).deprecate({ - 1: { since: "4.7", warnAfter: "4.8", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - factory2.updateTypeParameterDeclaration = buildOverload("updateTypeParameterDeclaration").overload({ - 0(node, modifiers, name, constraint, defaultType) { - return updateTypeParameterDeclaration2(node, modifiers, name, constraint, defaultType); - }, - 1(node, name, constraint, defaultType) { - return updateTypeParameterDeclaration2(node, node.modifiers, name, constraint, defaultType); - } - }).bind({ - 0: ([, modifiers]) => modifiers === void 0 || isArray(modifiers), - 1: ([, name]) => name !== void 0 && !isArray(name) - }).deprecate({ - 1: { since: "4.7", warnAfter: "4.8", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - } - var init_typeParameterModifiers = __esm({ - "src/deprecatedCompat/4.7/typeParameterModifiers.ts"() { - "use strict"; - init_ts5(); - addNodeFactoryPatcher(patchNodeFactory3); - patchNodeFactory3(factory); - } - }); - - // src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts - function patchNodeFactory4(factory2) { - const { - createParameterDeclaration, - updateParameterDeclaration, - createPropertyDeclaration, - updatePropertyDeclaration: updatePropertyDeclaration2, - createMethodDeclaration, - updateMethodDeclaration, - createConstructorDeclaration, - updateConstructorDeclaration, - createGetAccessorDeclaration, - updateGetAccessorDeclaration, - createSetAccessorDeclaration, - updateSetAccessorDeclaration, - createIndexSignature: createIndexSignature3, - updateIndexSignature: updateIndexSignature2, - createClassStaticBlockDeclaration, - updateClassStaticBlockDeclaration, - createClassExpression: createClassExpression3, - updateClassExpression: updateClassExpression3, - createFunctionDeclaration: createFunctionDeclaration2, - updateFunctionDeclaration: updateFunctionDeclaration2, - createClassDeclaration: createClassDeclaration2, - updateClassDeclaration: updateClassDeclaration2, - createInterfaceDeclaration: createInterfaceDeclaration2, - updateInterfaceDeclaration: updateInterfaceDeclaration2, - createTypeAliasDeclaration: createTypeAliasDeclaration2, - updateTypeAliasDeclaration: updateTypeAliasDeclaration2, - createEnumDeclaration: createEnumDeclaration2, - updateEnumDeclaration: updateEnumDeclaration2, - createModuleDeclaration: createModuleDeclaration2, - updateModuleDeclaration: updateModuleDeclaration2, - createImportEqualsDeclaration: createImportEqualsDeclaration2, - updateImportEqualsDeclaration: updateImportEqualsDeclaration2, - createImportDeclaration: createImportDeclaration2, - updateImportDeclaration: updateImportDeclaration2, - createExportAssignment: createExportAssignment3, - updateExportAssignment: updateExportAssignment2, - createExportDeclaration: createExportDeclaration3, - updateExportDeclaration: updateExportDeclaration3 - } = factory2; - factory2.createParameterDeclaration = buildOverload("createParameterDeclaration").overload({ - 0(modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer); - }, - 1(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return createParameterDeclaration(concatenate(decorators, modifiers), dotDotDotToken, name, questionToken, type, initializer); - } - }).bind({ - 0: ([, dotDotDotToken, name, questionToken, type, initializer, other]) => other === void 0 && (dotDotDotToken === void 0 || !isArray(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, modifiers, dotDotDotToken, name, questionToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (dotDotDotToken === void 0 || typeof dotDotDotToken === "object" && isDotDotDotToken(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateParameterDeclaration = buildOverload("updateParameterDeclaration").overload({ - 0(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer); - }, - 1(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return updateParameterDeclaration(node, concatenate(decorators, modifiers), dotDotDotToken, name, questionToken, type, initializer); - } - }).bind({ - 0: ([, , dotDotDotToken, name, questionToken, type, initializer, other]) => other === void 0 && (dotDotDotToken === void 0 || !isArray(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, , modifiers, dotDotDotToken, name, questionToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (dotDotDotToken === void 0 || typeof dotDotDotToken === "object" && isDotDotDotToken(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createPropertyDeclaration = buildOverload("createPropertyDeclaration").overload({ - 0(modifiers, name, questionOrExclamationToken, type, initializer) { - return createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer); - }, - 1(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - return createPropertyDeclaration(concatenate(decorators, modifiers), name, questionOrExclamationToken, type, initializer); - } - }).bind({ - 0: ([, name, questionOrExclamationToken, type, initializer, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (questionOrExclamationToken === void 0 || typeof questionOrExclamationToken === "object" && isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, modifiers, name, questionOrExclamationToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionOrExclamationToken === void 0 || isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updatePropertyDeclaration = buildOverload("updatePropertyDeclaration").overload({ - 0(node, modifiers, name, questionOrExclamationToken, type, initializer) { - return updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer); - }, - 1(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - return updatePropertyDeclaration2(node, concatenate(decorators, modifiers), name, questionOrExclamationToken, type, initializer); - } - }).bind({ - 0: ([, , name, questionOrExclamationToken, type, initializer, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (questionOrExclamationToken === void 0 || typeof questionOrExclamationToken === "object" && isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, , modifiers, name, questionOrExclamationToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionOrExclamationToken === void 0 || isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createMethodDeclaration = buildOverload("createMethodDeclaration").overload({ - 0(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body); - }, - 1(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return createMethodDeclaration(concatenate(decorators, modifiers), asteriskToken, name, questionToken, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, asteriskToken, name, questionToken, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || !some(parameters, isTypeParameterDeclaration)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken === "object" && isAsteriskToken(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || !isArray(questionToken)) && (typeParameters === void 0 || !some(typeParameters, isParameter)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateMethodDeclaration = buildOverload("updateMethodDeclaration").overload({ - 0(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return updateMethodDeclaration(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body); - }, - 1(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return updateMethodDeclaration(node, concatenate(decorators, modifiers), asteriskToken, name, questionToken, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, , asteriskToken, name, questionToken, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || !some(parameters, isTypeParameterDeclaration)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken === "object" && isAsteriskToken(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || !isArray(questionToken)) && (typeParameters === void 0 || !some(typeParameters, isParameter)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createConstructorDeclaration = buildOverload("createConstructorDeclaration").overload({ - 0(modifiers, parameters, body) { - return createConstructorDeclaration(modifiers, parameters, body); - }, - 1(_decorators, modifiers, parameters, body) { - return createConstructorDeclaration(modifiers, parameters, body); - } - }).bind({ - 0: ([modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)), - 1: ([decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateConstructorDeclaration = buildOverload("updateConstructorDeclaration").overload({ - 0(node, modifiers, parameters, body) { - return updateConstructorDeclaration(node, modifiers, parameters, body); - }, - 1(node, _decorators, modifiers, parameters, body) { - return updateConstructorDeclaration(node, modifiers, parameters, body); - } - }).bind({ - 0: ([, modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)), - 1: ([, decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createGetAccessorDeclaration = buildOverload("createGetAccessorDeclaration").overload({ - 0(modifiers, name, parameters, type, body) { - return createGetAccessorDeclaration(modifiers, name, parameters, type, body); - }, - 1(decorators, modifiers, name, parameters, type, body) { - return createGetAccessorDeclaration(concatenate(decorators, modifiers), name, parameters, type, body); - } - }).bind({ - 0: ([, name, parameters, type, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, name, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateGetAccessorDeclaration = buildOverload("updateGetAccessorDeclaration").overload({ - 0(node, modifiers, name, parameters, type, body) { - return updateGetAccessorDeclaration(node, modifiers, name, parameters, type, body); - }, - 1(node, decorators, modifiers, name, parameters, type, body) { - return updateGetAccessorDeclaration(node, concatenate(decorators, modifiers), name, parameters, type, body); - } - }).bind({ - 0: ([, , name, parameters, type, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, name, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createSetAccessorDeclaration = buildOverload("createSetAccessorDeclaration").overload({ - 0(modifiers, name, parameters, body) { - return createSetAccessorDeclaration(modifiers, name, parameters, body); - }, - 1(decorators, modifiers, name, parameters, body) { - return createSetAccessorDeclaration(concatenate(decorators, modifiers), name, parameters, body); - } - }).bind({ - 0: ([, name, parameters, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || !isArray(body)), - 1: ([, modifiers, name, parameters, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateSetAccessorDeclaration = buildOverload("updateSetAccessorDeclaration").overload({ - 0(node, modifiers, name, parameters, body) { - return updateSetAccessorDeclaration(node, modifiers, name, parameters, body); - }, - 1(node, decorators, modifiers, name, parameters, body) { - return updateSetAccessorDeclaration(node, concatenate(decorators, modifiers), name, parameters, body); - } - }).bind({ - 0: ([, , name, parameters, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || !isArray(body)), - 1: ([, , modifiers, name, parameters, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createIndexSignature = buildOverload("createIndexSignature").overload({ - 0(modifiers, parameters, type) { - return createIndexSignature3(modifiers, parameters, type); - }, - 1(_decorators, modifiers, parameters, type) { - return createIndexSignature3(modifiers, parameters, type); - } - }).bind({ - 0: ([modifiers, parameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)), - 1: ([decorators, modifiers, parameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateIndexSignature = buildOverload("updateIndexSignature").overload({ - 0(node, modifiers, parameters, type) { - return updateIndexSignature2(node, modifiers, parameters, type); - }, - 1(node, _decorators, modifiers, parameters, type) { - return updateIndexSignature2(node, modifiers, parameters, type); - } - }).bind({ - 0: ([, modifiers, parameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)), - 1: ([, decorators, modifiers, parameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createClassStaticBlockDeclaration = buildOverload("createClassStaticBlockDeclaration").overload({ - 0(body) { - return createClassStaticBlockDeclaration(body); - }, - 1(_decorators, _modifiers, body) { - return createClassStaticBlockDeclaration(body); - } - }).bind({ - 0: ([body, other1, other2]) => other1 === void 0 && other2 === void 0 && (body === void 0 || !isArray(body)), - 1: ([decorators, modifiers, body]) => (decorators === void 0 || isArray(decorators)) && (modifiers === void 0 || isArray(decorators)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS_AND_MODIFIERS - }).finish(); - factory2.updateClassStaticBlockDeclaration = buildOverload("updateClassStaticBlockDeclaration").overload({ - 0(node, body) { - return updateClassStaticBlockDeclaration(node, body); - }, - 1(node, _decorators, _modifiers, body) { - return updateClassStaticBlockDeclaration(node, body); - } - }).bind({ - 0: ([, body, other1, other2]) => other1 === void 0 && other2 === void 0 && (body === void 0 || !isArray(body)), - 1: ([, decorators, modifiers, body]) => (decorators === void 0 || isArray(decorators)) && (modifiers === void 0 || isArray(decorators)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS_AND_MODIFIERS - }).finish(); - factory2.createClassExpression = buildOverload("createClassExpression").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createClassExpression3(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createClassExpression3(concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateClassExpression = buildOverload("updateClassExpression").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassExpression3(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassExpression3(node, concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, , name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, , modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createFunctionDeclaration = buildOverload("createFunctionDeclaration").overload({ - 0(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - }, - 1(_decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, asteriskToken, name, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isIdentifier(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, asteriskToken, name, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken !== "string" && isAsteriskToken(asteriskToken)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateFunctionDeclaration = buildOverload("updateFunctionDeclaration").overload({ - 0(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body); - }, - 1(node, _decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, , asteriskToken, name, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || isIdentifier(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, asteriskToken, name, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken !== "string" && isAsteriskToken(asteriskToken)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createClassDeclaration = buildOverload("createClassDeclaration").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createClassDeclaration2(concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: () => true - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateClassDeclaration = buildOverload("updateClassDeclaration").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassDeclaration2(node, concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, , name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, , modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createInterfaceDeclaration = buildOverload("createInterfaceDeclaration").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(_decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)), - 1: ([decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateInterfaceDeclaration = buildOverload("updateInterfaceDeclaration").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, _decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)), - 1: ([, decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createTypeAliasDeclaration = buildOverload("createTypeAliasDeclaration").overload({ - 0(modifiers, name, typeParameters, type) { - return createTypeAliasDeclaration2(modifiers, name, typeParameters, type); - }, - 1(_decorators, modifiers, name, typeParameters, type) { - return createTypeAliasDeclaration2(modifiers, name, typeParameters, type); - } - }).bind({ - 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)), - 1: ([decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateTypeAliasDeclaration = buildOverload("updateTypeAliasDeclaration").overload({ - 0(node, modifiers, name, typeParameters, type) { - return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type); - }, - 1(node, _decorators, modifiers, name, typeParameters, type) { - return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type); - } - }).bind({ - 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)), - 1: ([, decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createEnumDeclaration = buildOverload("createEnumDeclaration").overload({ - 0(modifiers, name, members) { - return createEnumDeclaration2(modifiers, name, members); - }, - 1(_decorators, modifiers, name, members) { - return createEnumDeclaration2(modifiers, name, members); - } - }).bind({ - 0: ([modifiers, name, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)), - 1: ([decorators, modifiers, name, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateEnumDeclaration = buildOverload("updateEnumDeclaration").overload({ - 0(node, modifiers, name, members) { - return updateEnumDeclaration2(node, modifiers, name, members); - }, - 1(node, _decorators, modifiers, name, members) { - return updateEnumDeclaration2(node, modifiers, name, members); - } - }).bind({ - 0: ([, modifiers, name, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)), - 1: ([, decorators, modifiers, name, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createModuleDeclaration = buildOverload("createModuleDeclaration").overload({ - 0(modifiers, name, body, flags) { - return createModuleDeclaration2(modifiers, name, body, flags); - }, - 1(_decorators, modifiers, name, body, flags) { - return createModuleDeclaration2(modifiers, name, body, flags); - } - }).bind({ - 0: ([modifiers, name, body, flags, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name !== void 0 && !isArray(name)) && (body === void 0 || isModuleBody(body)) && (flags === void 0 || typeof flags === "number"), - 1: ([decorators, modifiers, name, body, flags]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name !== void 0 && isModuleName(name)) && (body === void 0 || typeof body === "object") && (flags === void 0 || typeof flags === "number") - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateModuleDeclaration = buildOverload("updateModuleDeclaration").overload({ - 0(node, modifiers, name, body) { - return updateModuleDeclaration2(node, modifiers, name, body); - }, - 1(node, _decorators, modifiers, name, body) { - return updateModuleDeclaration2(node, modifiers, name, body); - } - }).bind({ - 0: ([, modifiers, name, body, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (body === void 0 || isModuleBody(body)), - 1: ([, decorators, modifiers, name, body]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name !== void 0 && isModuleName(name)) && (body === void 0 || isModuleBody(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createImportEqualsDeclaration = buildOverload("createImportEqualsDeclaration").overload({ - 0(modifiers, isTypeOnly, name, moduleReference) { - return createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference); - }, - 1(_decorators, modifiers, isTypeOnly, name, moduleReference) { - return createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference); - } - }).bind({ - 0: ([modifiers, isTypeOnly, name, moduleReference, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && typeof name !== "boolean" && typeof moduleReference !== "string", - 1: ([decorators, modifiers, isTypeOnly, name, moduleReference]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && (typeof name === "string" || isIdentifier(name)) && (moduleReference !== void 0 && isModuleReference(moduleReference)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateImportEqualsDeclaration = buildOverload("updateImportEqualsDeclaration").overload({ - 0(node, modifiers, isTypeOnly, name, moduleReference) { - return updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference); - }, - 1(node, _decorators, modifiers, isTypeOnly, name, moduleReference) { - return updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference); - } - }).bind({ - 0: ([, modifiers, isTypeOnly, name, moduleReference, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && typeof name !== "boolean" && typeof moduleReference !== "string", - 1: ([, decorators, modifiers, isTypeOnly, name, moduleReference]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && (typeof name === "string" || isIdentifier(name)) && (moduleReference !== void 0 && isModuleReference(moduleReference)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createImportDeclaration = buildOverload("createImportDeclaration").overload({ - 0(modifiers, importClause, moduleSpecifier, assertClause) { - return createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause); - }, - 1(_decorators, modifiers, importClause, moduleSpecifier, assertClause) { - return createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([modifiers, importClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (importClause === void 0 || !isArray(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (importClause === void 0 || isImportClause(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateImportDeclaration = buildOverload("updateImportDeclaration").overload({ - 0(node, modifiers, importClause, moduleSpecifier, assertClause) { - return updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause); - }, - 1(node, _decorators, modifiers, importClause, moduleSpecifier, assertClause) { - return updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (importClause === void 0 || !isArray(importClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (importClause === void 0 || isImportClause(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createExportAssignment = buildOverload("createExportAssignment").overload({ - 0(modifiers, isExportEquals, expression) { - return createExportAssignment3(modifiers, isExportEquals, expression); - }, - 1(_decorators, modifiers, isExportEquals, expression) { - return createExportAssignment3(modifiers, isExportEquals, expression); - } - }).bind({ - 0: ([modifiers, isExportEquals, expression, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isExportEquals === void 0 || typeof isExportEquals === "boolean") && typeof expression === "object", - 1: ([decorators, modifiers, isExportEquals, expression]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isExportEquals === void 0 || typeof isExportEquals === "boolean") && (expression !== void 0 && isExpression(expression)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateExportAssignment = buildOverload("updateExportAssignment").overload({ - 0(node, modifiers, expression) { - return updateExportAssignment2(node, modifiers, expression); - }, - 1(node, _decorators, modifiers, expression) { - return updateExportAssignment2(node, modifiers, expression); - } - }).bind({ - 0: ([, modifiers, expression, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (expression !== void 0 && !isArray(expression)), - 1: ([, decorators, modifiers, expression]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (expression !== void 0 && isExpression(expression)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createExportDeclaration = buildOverload("createExportDeclaration").overload({ - 0(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - }, - 1(_decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && typeof isTypeOnly === "boolean" && typeof exportClause !== "boolean" && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && typeof isTypeOnly === "boolean" && (exportClause === void 0 || isNamedExportBindings(exportClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateExportDeclaration = buildOverload("updateExportDeclaration").overload({ - 0(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - }, - 1(node, _decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && typeof isTypeOnly === "boolean" && typeof exportClause !== "boolean" && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && typeof isTypeOnly === "boolean" && (exportClause === void 0 || isNamedExportBindings(exportClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - } - var MUST_MERGE, DISALLOW_DECORATORS, DISALLOW_DECORATORS_AND_MODIFIERS; - var init_mergeDecoratorsAndModifiers = __esm({ - "src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts"() { - "use strict"; - init_ts5(); - MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload that does not accept a 'decorators' parameter." }; - DISALLOW_DECORATORS = { since: "4.8", warnAfter: "4.9.0-0", message: `Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter.` }; - DISALLOW_DECORATORS_AND_MODIFIERS = { since: "4.8", warnAfter: "4.9.0-0", message: `Decorators and modifiers are no longer supported for this function. Callers should switch to an overload that does not accept the 'decorators' and 'modifiers' parameters.` }; - addNodeFactoryPatcher(patchNodeFactory4); - patchNodeFactory4(factory); - } - }); - // src/deprecatedCompat/_namespaces/ts.ts var init_ts5 = __esm({ "src/deprecatedCompat/_namespaces/ts.ts"() { "use strict"; init_ts2(); init_deprecations(); - init_nodeFactoryTopLevelExports(); - init_renamedNodeTests(); - init_renamedNodeTests2(); - init_abstractConstructorTypes(); - init_importTypeAssertions(); - init_typeParameterModifiers(); - init_mergeDecoratorsAndModifiers(); + init_identifierProperties(); } }); @@ -167816,13 +170212,8 @@ ${options.prefix}` : "\n" : options.prefix this.session = opts.session; if (opts.serverMode !== void 0) { this.serverMode = opts.serverMode; - this.syntaxOnly = this.serverMode === 2 /* Syntactic */; - } else if (opts.syntaxOnly) { - this.serverMode = 2 /* Syntactic */; - this.syntaxOnly = true; } else { this.serverMode = 0 /* Semantic */; - this.syntaxOnly = false; } if (this.host.realpath) { this.realpathToScriptInfos = createMultiMap(); @@ -170361,7 +172752,7 @@ Dynamic files must always be opened with service's current directory or service excludedFiles.push(normalizedNames[i]); } else { let exclude = false; - if (typeAcquisition.enable || typeAcquisition.enableAutoDiscovery) { + if (typeAcquisition.enable) { const baseName = getBaseFileName(toFileNameLowerCase(normalizedNames[i])); if (fileExtensionIs(baseName, "js")) { const inferredTypingName = removeFileExtension(baseName); @@ -170390,10 +172781,6 @@ Dynamic files must always be opened with service's current directory or service return excludedFiles; } openExternalProject(proj) { - if (proj.typingOptions && !proj.typeAcquisition) { - const typeAcquisition = convertEnableAutoDiscoveryToEnable(proj.typingOptions); - proj.typeAcquisition = typeAcquisition; - } proj.typeAcquisition = proj.typeAcquisition || {}; proj.typeAcquisition.include = proj.typeAcquisition.include || []; proj.typeAcquisition.exclude = proj.typeAcquisition.exclude || []; @@ -171249,12 +173636,13 @@ ${json}${newLine}`; "use strict"; init_ts6(); init_ts_server2(); + init_protocol(); nullCancellationToken = { isCancellationRequested: () => false, setRequest: () => void 0, resetRequest: () => void 0 }; - CommandNames = ts_server_protocol_exports.CommandTypes; + CommandNames = CommandTypes; MultistepOperation = class { constructor(operationHost) { this.operationHost = operationHost; @@ -171331,96 +173719,97 @@ ${json}${newLine}`; } }; invalidPartialSemanticModeCommands = [ - CommandNames.OpenExternalProject, - CommandNames.OpenExternalProjects, - CommandNames.CloseExternalProject, - CommandNames.SynchronizeProjectList, - CommandNames.EmitOutput, - CommandNames.CompileOnSaveAffectedFileList, - CommandNames.CompileOnSaveEmitFile, - CommandNames.CompilerOptionsDiagnosticsFull, - CommandNames.EncodedSemanticClassificationsFull, - CommandNames.SemanticDiagnosticsSync, - CommandNames.SuggestionDiagnosticsSync, - CommandNames.GeterrForProject, - CommandNames.Reload, - CommandNames.ReloadProjects, - CommandNames.GetCodeFixes, - CommandNames.GetCodeFixesFull, - CommandNames.GetCombinedCodeFix, - CommandNames.GetCombinedCodeFixFull, - CommandNames.ApplyCodeActionCommand, - CommandNames.GetSupportedCodeFixes, - CommandNames.GetApplicableRefactors, - CommandNames.GetEditsForRefactor, - CommandNames.GetEditsForRefactorFull, - CommandNames.OrganizeImports, - CommandNames.OrganizeImportsFull, - CommandNames.GetEditsForFileRename, - CommandNames.GetEditsForFileRenameFull, - CommandNames.PrepareCallHierarchy, - CommandNames.ProvideCallHierarchyIncomingCalls, - CommandNames.ProvideCallHierarchyOutgoingCalls + "openExternalProject" /* OpenExternalProject */, + "openExternalProjects" /* OpenExternalProjects */, + "closeExternalProject" /* CloseExternalProject */, + "synchronizeProjectList" /* SynchronizeProjectList */, + "emit-output" /* EmitOutput */, + "compileOnSaveAffectedFileList" /* CompileOnSaveAffectedFileList */, + "compileOnSaveEmitFile" /* CompileOnSaveEmitFile */, + "compilerOptionsDiagnostics-full" /* CompilerOptionsDiagnosticsFull */, + "encodedSemanticClassifications-full" /* EncodedSemanticClassificationsFull */, + "semanticDiagnosticsSync" /* SemanticDiagnosticsSync */, + "suggestionDiagnosticsSync" /* SuggestionDiagnosticsSync */, + "geterrForProject" /* GeterrForProject */, + "reload" /* Reload */, + "reloadProjects" /* ReloadProjects */, + "getCodeFixes" /* GetCodeFixes */, + "getCodeFixes-full" /* GetCodeFixesFull */, + "getCombinedCodeFix" /* GetCombinedCodeFix */, + "getCombinedCodeFix-full" /* GetCombinedCodeFixFull */, + "applyCodeActionCommand" /* ApplyCodeActionCommand */, + "getSupportedCodeFixes" /* GetSupportedCodeFixes */, + "getApplicableRefactors" /* GetApplicableRefactors */, + "getEditsForRefactor" /* GetEditsForRefactor */, + "getEditsForRefactor-full" /* GetEditsForRefactorFull */, + "organizeImports" /* OrganizeImports */, + "organizeImports-full" /* OrganizeImportsFull */, + "getEditsForFileRename" /* GetEditsForFileRename */, + "getEditsForFileRename-full" /* GetEditsForFileRenameFull */, + "prepareCallHierarchy" /* PrepareCallHierarchy */, + "provideCallHierarchyIncomingCalls" /* ProvideCallHierarchyIncomingCalls */, + "provideCallHierarchyOutgoingCalls" /* ProvideCallHierarchyOutgoingCalls */ ]; invalidSyntacticModeCommands = [ ...invalidPartialSemanticModeCommands, - CommandNames.Definition, - CommandNames.DefinitionFull, - CommandNames.DefinitionAndBoundSpan, - CommandNames.DefinitionAndBoundSpanFull, - CommandNames.TypeDefinition, - CommandNames.Implementation, - CommandNames.ImplementationFull, - CommandNames.References, - CommandNames.ReferencesFull, - CommandNames.Rename, - CommandNames.RenameLocationsFull, - CommandNames.RenameInfoFull, - CommandNames.Quickinfo, - CommandNames.QuickinfoFull, - CommandNames.CompletionInfo, - CommandNames.Completions, - CommandNames.CompletionsFull, - CommandNames.CompletionDetails, - CommandNames.CompletionDetailsFull, - CommandNames.SignatureHelp, - CommandNames.SignatureHelpFull, - CommandNames.Navto, - CommandNames.NavtoFull, - CommandNames.Occurrences, - CommandNames.DocumentHighlights, - CommandNames.DocumentHighlightsFull + "definition" /* Definition */, + "definition-full" /* DefinitionFull */, + "definitionAndBoundSpan" /* DefinitionAndBoundSpan */, + "definitionAndBoundSpan-full" /* DefinitionAndBoundSpanFull */, + "typeDefinition" /* TypeDefinition */, + "implementation" /* Implementation */, + "implementation-full" /* ImplementationFull */, + "references" /* References */, + "references-full" /* ReferencesFull */, + "rename" /* Rename */, + "renameLocations-full" /* RenameLocationsFull */, + "rename-full" /* RenameInfoFull */, + "quickinfo" /* Quickinfo */, + "quickinfo-full" /* QuickinfoFull */, + "completionInfo" /* CompletionInfo */, + "completions" /* Completions */, + "completions-full" /* CompletionsFull */, + "completionEntryDetails" /* CompletionDetails */, + "completionEntryDetails-full" /* CompletionDetailsFull */, + "signatureHelp" /* SignatureHelp */, + "signatureHelp-full" /* SignatureHelpFull */, + "navto" /* Navto */, + "navto-full" /* NavtoFull */, + "occurrences" /* Occurrences */, + "documentHighlights" /* DocumentHighlights */, + "documentHighlights-full" /* DocumentHighlightsFull */ ]; Session3 = class { constructor(opts) { this.changeSeq = 0; this.handlers = new Map(Object.entries({ - [CommandNames.Status]: () => { + // TODO(jakebailey): correctly type the handlers + ["status" /* Status */]: () => { const response = { version }; return this.requiredResponse(response); }, - [CommandNames.OpenExternalProject]: (request) => { + ["openExternalProject" /* OpenExternalProject */]: (request) => { this.projectService.openExternalProject(request.arguments); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.OpenExternalProjects]: (request) => { + ["openExternalProjects" /* OpenExternalProjects */]: (request) => { this.projectService.openExternalProjects(request.arguments.projects); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.CloseExternalProject]: (request) => { + ["closeExternalProject" /* CloseExternalProject */]: (request) => { this.projectService.closeExternalProject(request.arguments.projectFileName); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.SynchronizeProjectList]: (request) => { + ["synchronizeProjectList" /* SynchronizeProjectList */]: (request) => { const result = this.projectService.synchronizeProjectList(request.arguments.knownProjects, request.arguments.includeProjectReferenceRedirectInfo); if (!result.some((p) => p.projectErrors && p.projectErrors.length !== 0)) { return this.requiredResponse(result); @@ -171442,7 +173831,7 @@ ${json}${newLine}`; }); return this.requiredResponse(converted); }, - [CommandNames.UpdateOpen]: (request) => { + ["updateOpen" /* UpdateOpen */]: (request) => { this.changeSeq++; this.projectService.applyChangesInOpenFiles( request.arguments.openFiles && mapIterator(request.arguments.openFiles, (file) => ({ @@ -171467,7 +173856,7 @@ ${json}${newLine}`; true ); }, - [CommandNames.ApplyChangedToOpenFiles]: (request) => { + ["applyChangedToOpenFiles" /* ApplyChangedToOpenFiles */]: (request) => { this.changeSeq++; this.projectService.applyChangesInOpenFiles( request.arguments.openFiles, @@ -171483,93 +173872,93 @@ ${json}${newLine}`; true ); }, - [CommandNames.Exit]: () => { + ["exit" /* Exit */]: () => { this.exit(); return this.notRequired(); }, - [CommandNames.Definition]: (request) => { + ["definition" /* Definition */]: (request) => { return this.requiredResponse(this.getDefinition( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.DefinitionFull]: (request) => { + ["definition-full" /* DefinitionFull */]: (request) => { return this.requiredResponse(this.getDefinition( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.DefinitionAndBoundSpan]: (request) => { + ["definitionAndBoundSpan" /* DefinitionAndBoundSpan */]: (request) => { return this.requiredResponse(this.getDefinitionAndBoundSpan( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.DefinitionAndBoundSpanFull]: (request) => { + ["definitionAndBoundSpan-full" /* DefinitionAndBoundSpanFull */]: (request) => { return this.requiredResponse(this.getDefinitionAndBoundSpan( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.FindSourceDefinition]: (request) => { + ["findSourceDefinition" /* FindSourceDefinition */]: (request) => { return this.requiredResponse(this.findSourceDefinition(request.arguments)); }, - [CommandNames.EmitOutput]: (request) => { + ["emit-output" /* EmitOutput */]: (request) => { return this.requiredResponse(this.getEmitOutput(request.arguments)); }, - [CommandNames.TypeDefinition]: (request) => { + ["typeDefinition" /* TypeDefinition */]: (request) => { return this.requiredResponse(this.getTypeDefinition(request.arguments)); }, - [CommandNames.Implementation]: (request) => { + ["implementation" /* Implementation */]: (request) => { return this.requiredResponse(this.getImplementation( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.ImplementationFull]: (request) => { + ["implementation-full" /* ImplementationFull */]: (request) => { return this.requiredResponse(this.getImplementation( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.References]: (request) => { + ["references" /* References */]: (request) => { return this.requiredResponse(this.getReferences( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.ReferencesFull]: (request) => { + ["references-full" /* ReferencesFull */]: (request) => { return this.requiredResponse(this.getReferences( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.Rename]: (request) => { + ["rename" /* Rename */]: (request) => { return this.requiredResponse(this.getRenameLocations( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.RenameLocationsFull]: (request) => { + ["renameLocations-full" /* RenameLocationsFull */]: (request) => { return this.requiredResponse(this.getRenameLocations( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.RenameInfoFull]: (request) => { + ["rename-full" /* RenameInfoFull */]: (request) => { return this.requiredResponse(this.getRenameInfo(request.arguments)); }, - [CommandNames.Open]: (request) => { + ["open" /* Open */]: (request) => { this.openClientFile( toNormalizedPath(request.arguments.file), request.arguments.fileContent, @@ -171579,451 +173968,451 @@ ${json}${newLine}`; ); return this.notRequired(); }, - [CommandNames.Quickinfo]: (request) => { + ["quickinfo" /* Quickinfo */]: (request) => { return this.requiredResponse(this.getQuickInfoWorker( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.QuickinfoFull]: (request) => { + ["quickinfo-full" /* QuickinfoFull */]: (request) => { return this.requiredResponse(this.getQuickInfoWorker( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.GetOutliningSpans]: (request) => { + ["getOutliningSpans" /* GetOutliningSpans */]: (request) => { return this.requiredResponse(this.getOutliningSpans( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetOutliningSpansFull]: (request) => { + ["outliningSpans" /* GetOutliningSpansFull */]: (request) => { return this.requiredResponse(this.getOutliningSpans( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.TodoComments]: (request) => { + ["todoComments" /* TodoComments */]: (request) => { return this.requiredResponse(this.getTodoComments(request.arguments)); }, - [CommandNames.Indentation]: (request) => { + ["indentation" /* Indentation */]: (request) => { return this.requiredResponse(this.getIndentation(request.arguments)); }, - [CommandNames.NameOrDottedNameSpan]: (request) => { + ["nameOrDottedNameSpan" /* NameOrDottedNameSpan */]: (request) => { return this.requiredResponse(this.getNameOrDottedNameSpan(request.arguments)); }, - [CommandNames.BreakpointStatement]: (request) => { + ["breakpointStatement" /* BreakpointStatement */]: (request) => { return this.requiredResponse(this.getBreakpointStatement(request.arguments)); }, - [CommandNames.BraceCompletion]: (request) => { + ["braceCompletion" /* BraceCompletion */]: (request) => { return this.requiredResponse(this.isValidBraceCompletion(request.arguments)); }, - [CommandNames.DocCommentTemplate]: (request) => { + ["docCommentTemplate" /* DocCommentTemplate */]: (request) => { return this.requiredResponse(this.getDocCommentTemplate(request.arguments)); }, - [CommandNames.GetSpanOfEnclosingComment]: (request) => { + ["getSpanOfEnclosingComment" /* GetSpanOfEnclosingComment */]: (request) => { return this.requiredResponse(this.getSpanOfEnclosingComment(request.arguments)); }, - [CommandNames.FileReferences]: (request) => { + ["fileReferences" /* FileReferences */]: (request) => { return this.requiredResponse(this.getFileReferences( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.FileReferencesFull]: (request) => { + ["fileReferences-full" /* FileReferencesFull */]: (request) => { return this.requiredResponse(this.getFileReferences( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.Format]: (request) => { + ["format" /* Format */]: (request) => { return this.requiredResponse(this.getFormattingEditsForRange(request.arguments)); }, - [CommandNames.Formatonkey]: (request) => { + ["formatonkey" /* Formatonkey */]: (request) => { return this.requiredResponse(this.getFormattingEditsAfterKeystroke(request.arguments)); }, - [CommandNames.FormatFull]: (request) => { + ["format-full" /* FormatFull */]: (request) => { return this.requiredResponse(this.getFormattingEditsForDocumentFull(request.arguments)); }, - [CommandNames.FormatonkeyFull]: (request) => { + ["formatonkey-full" /* FormatonkeyFull */]: (request) => { return this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(request.arguments)); }, - [CommandNames.FormatRangeFull]: (request) => { + ["formatRange-full" /* FormatRangeFull */]: (request) => { return this.requiredResponse(this.getFormattingEditsForRangeFull(request.arguments)); }, - [CommandNames.CompletionInfo]: (request) => { - return this.requiredResponse(this.getCompletions(request.arguments, CommandNames.CompletionInfo)); + ["completionInfo" /* CompletionInfo */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completionInfo" /* CompletionInfo */)); }, - [CommandNames.Completions]: (request) => { - return this.requiredResponse(this.getCompletions(request.arguments, CommandNames.Completions)); + ["completions" /* Completions */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completions" /* Completions */)); }, - [CommandNames.CompletionsFull]: (request) => { - return this.requiredResponse(this.getCompletions(request.arguments, CommandNames.CompletionsFull)); + ["completions-full" /* CompletionsFull */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completions-full" /* CompletionsFull */)); }, - [CommandNames.CompletionDetails]: (request) => { + ["completionEntryDetails" /* CompletionDetails */]: (request) => { return this.requiredResponse(this.getCompletionEntryDetails( request.arguments, /*fullResult*/ false )); }, - [CommandNames.CompletionDetailsFull]: (request) => { + ["completionEntryDetails-full" /* CompletionDetailsFull */]: (request) => { return this.requiredResponse(this.getCompletionEntryDetails( request.arguments, /*fullResult*/ true )); }, - [CommandNames.CompileOnSaveAffectedFileList]: (request) => { + ["compileOnSaveAffectedFileList" /* CompileOnSaveAffectedFileList */]: (request) => { return this.requiredResponse(this.getCompileOnSaveAffectedFileList(request.arguments)); }, - [CommandNames.CompileOnSaveEmitFile]: (request) => { + ["compileOnSaveEmitFile" /* CompileOnSaveEmitFile */]: (request) => { return this.requiredResponse(this.emitFile(request.arguments)); }, - [CommandNames.SignatureHelp]: (request) => { + ["signatureHelp" /* SignatureHelp */]: (request) => { return this.requiredResponse(this.getSignatureHelpItems( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.SignatureHelpFull]: (request) => { + ["signatureHelp-full" /* SignatureHelpFull */]: (request) => { return this.requiredResponse(this.getSignatureHelpItems( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.CompilerOptionsDiagnosticsFull]: (request) => { + ["compilerOptionsDiagnostics-full" /* CompilerOptionsDiagnosticsFull */]: (request) => { return this.requiredResponse(this.getCompilerOptionsDiagnostics(request.arguments)); }, - [CommandNames.EncodedSyntacticClassificationsFull]: (request) => { + ["encodedSyntacticClassifications-full" /* EncodedSyntacticClassificationsFull */]: (request) => { return this.requiredResponse(this.getEncodedSyntacticClassifications(request.arguments)); }, - [CommandNames.EncodedSemanticClassificationsFull]: (request) => { + ["encodedSemanticClassifications-full" /* EncodedSemanticClassificationsFull */]: (request) => { return this.requiredResponse(this.getEncodedSemanticClassifications(request.arguments)); }, - [CommandNames.Cleanup]: () => { + ["cleanup" /* Cleanup */]: () => { this.cleanup(); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.SemanticDiagnosticsSync]: (request) => { + ["semanticDiagnosticsSync" /* SemanticDiagnosticsSync */]: (request) => { return this.requiredResponse(this.getSemanticDiagnosticsSync(request.arguments)); }, - [CommandNames.SyntacticDiagnosticsSync]: (request) => { + ["syntacticDiagnosticsSync" /* SyntacticDiagnosticsSync */]: (request) => { return this.requiredResponse(this.getSyntacticDiagnosticsSync(request.arguments)); }, - [CommandNames.SuggestionDiagnosticsSync]: (request) => { + ["suggestionDiagnosticsSync" /* SuggestionDiagnosticsSync */]: (request) => { return this.requiredResponse(this.getSuggestionDiagnosticsSync(request.arguments)); }, - [CommandNames.Geterr]: (request) => { + ["geterr" /* Geterr */]: (request) => { this.errorCheck.startNew((next) => this.getDiagnostics(next, request.arguments.delay, request.arguments.files)); return this.notRequired(); }, - [CommandNames.GeterrForProject]: (request) => { + ["geterrForProject" /* GeterrForProject */]: (request) => { this.errorCheck.startNew((next) => this.getDiagnosticsForProject(next, request.arguments.delay, request.arguments.file)); return this.notRequired(); }, - [CommandNames.Change]: (request) => { + ["change" /* Change */]: (request) => { this.change(request.arguments); return this.notRequired(); }, - [CommandNames.Configure]: (request) => { + ["configure" /* Configure */]: (request) => { this.projectService.setHostConfiguration(request.arguments); this.doOutput( /*info*/ void 0, - CommandNames.Configure, + "configure" /* Configure */, request.seq, /*success*/ true ); return this.notRequired(); }, - [CommandNames.Reload]: (request) => { + ["reload" /* Reload */]: (request) => { this.reload(request.arguments, request.seq); return this.requiredResponse({ reloadFinished: true }); }, - [CommandNames.Saveto]: (request) => { + ["saveto" /* Saveto */]: (request) => { const savetoArgs = request.arguments; this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); return this.notRequired(); }, - [CommandNames.Close]: (request) => { + ["close" /* Close */]: (request) => { const closeArgs = request.arguments; this.closeClientFile(closeArgs.file); return this.notRequired(); }, - [CommandNames.Navto]: (request) => { + ["navto" /* Navto */]: (request) => { return this.requiredResponse(this.getNavigateToItems( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.NavtoFull]: (request) => { + ["navto-full" /* NavtoFull */]: (request) => { return this.requiredResponse(this.getNavigateToItems( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.Brace]: (request) => { + ["brace" /* Brace */]: (request) => { return this.requiredResponse(this.getBraceMatching( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.BraceFull]: (request) => { + ["brace-full" /* BraceFull */]: (request) => { return this.requiredResponse(this.getBraceMatching( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.NavBar]: (request) => { + ["navbar" /* NavBar */]: (request) => { return this.requiredResponse(this.getNavigationBarItems( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.NavBarFull]: (request) => { + ["navbar-full" /* NavBarFull */]: (request) => { return this.requiredResponse(this.getNavigationBarItems( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.NavTree]: (request) => { + ["navtree" /* NavTree */]: (request) => { return this.requiredResponse(this.getNavigationTree( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.NavTreeFull]: (request) => { + ["navtree-full" /* NavTreeFull */]: (request) => { return this.requiredResponse(this.getNavigationTree( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.Occurrences]: (request) => { + ["occurrences" /* Occurrences */]: (request) => { return this.requiredResponse(this.getOccurrences(request.arguments)); }, - [CommandNames.DocumentHighlights]: (request) => { + ["documentHighlights" /* DocumentHighlights */]: (request) => { return this.requiredResponse(this.getDocumentHighlights( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.DocumentHighlightsFull]: (request) => { + ["documentHighlights-full" /* DocumentHighlightsFull */]: (request) => { return this.requiredResponse(this.getDocumentHighlights( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.CompilerOptionsForInferredProjects]: (request) => { + ["compilerOptionsForInferredProjects" /* CompilerOptionsForInferredProjects */]: (request) => { this.setCompilerOptionsForInferredProjects(request.arguments); return this.requiredResponse( /*response*/ true ); }, - [CommandNames.ProjectInfo]: (request) => { + ["projectInfo" /* ProjectInfo */]: (request) => { return this.requiredResponse(this.getProjectInfo(request.arguments)); }, - [CommandNames.ReloadProjects]: () => { + ["reloadProjects" /* ReloadProjects */]: () => { this.projectService.reloadProjects(); return this.notRequired(); }, - [CommandNames.JsxClosingTag]: (request) => { + ["jsxClosingTag" /* JsxClosingTag */]: (request) => { return this.requiredResponse(this.getJsxClosingTag(request.arguments)); }, - [CommandNames.GetCodeFixes]: (request) => { + ["getCodeFixes" /* GetCodeFixes */]: (request) => { return this.requiredResponse(this.getCodeFixes( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetCodeFixesFull]: (request) => { + ["getCodeFixes-full" /* GetCodeFixesFull */]: (request) => { return this.requiredResponse(this.getCodeFixes( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.GetCombinedCodeFix]: (request) => { + ["getCombinedCodeFix" /* GetCombinedCodeFix */]: (request) => { return this.requiredResponse(this.getCombinedCodeFix( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetCombinedCodeFixFull]: (request) => { + ["getCombinedCodeFix-full" /* GetCombinedCodeFixFull */]: (request) => { return this.requiredResponse(this.getCombinedCodeFix( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.ApplyCodeActionCommand]: (request) => { + ["applyCodeActionCommand" /* ApplyCodeActionCommand */]: (request) => { return this.requiredResponse(this.applyCodeActionCommand(request.arguments)); }, - [CommandNames.GetSupportedCodeFixes]: (request) => { + ["getSupportedCodeFixes" /* GetSupportedCodeFixes */]: (request) => { return this.requiredResponse(this.getSupportedCodeFixes(request.arguments)); }, - [CommandNames.GetApplicableRefactors]: (request) => { + ["getApplicableRefactors" /* GetApplicableRefactors */]: (request) => { return this.requiredResponse(this.getApplicableRefactors(request.arguments)); }, - [CommandNames.GetEditsForRefactor]: (request) => { + ["getEditsForRefactor" /* GetEditsForRefactor */]: (request) => { return this.requiredResponse(this.getEditsForRefactor( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetEditsForRefactorFull]: (request) => { + ["getEditsForRefactor-full" /* GetEditsForRefactorFull */]: (request) => { return this.requiredResponse(this.getEditsForRefactor( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.OrganizeImports]: (request) => { + ["organizeImports" /* OrganizeImports */]: (request) => { return this.requiredResponse(this.organizeImports( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.OrganizeImportsFull]: (request) => { + ["organizeImports-full" /* OrganizeImportsFull */]: (request) => { return this.requiredResponse(this.organizeImports( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.GetEditsForFileRename]: (request) => { + ["getEditsForFileRename" /* GetEditsForFileRename */]: (request) => { return this.requiredResponse(this.getEditsForFileRename( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.GetEditsForFileRenameFull]: (request) => { + ["getEditsForFileRename-full" /* GetEditsForFileRenameFull */]: (request) => { return this.requiredResponse(this.getEditsForFileRename( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.ConfigurePlugin]: (request) => { + ["configurePlugin" /* ConfigurePlugin */]: (request) => { this.configurePlugin(request.arguments); this.doOutput( /*info*/ void 0, - CommandNames.ConfigurePlugin, + "configurePlugin" /* ConfigurePlugin */, request.seq, /*success*/ true ); return this.notRequired(); }, - [CommandNames.SelectionRange]: (request) => { + ["selectionRange" /* SelectionRange */]: (request) => { return this.requiredResponse(this.getSmartSelectionRange( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.SelectionRangeFull]: (request) => { + ["selectionRange-full" /* SelectionRangeFull */]: (request) => { return this.requiredResponse(this.getSmartSelectionRange( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.PrepareCallHierarchy]: (request) => { + ["prepareCallHierarchy" /* PrepareCallHierarchy */]: (request) => { return this.requiredResponse(this.prepareCallHierarchy(request.arguments)); }, - [CommandNames.ProvideCallHierarchyIncomingCalls]: (request) => { + ["provideCallHierarchyIncomingCalls" /* ProvideCallHierarchyIncomingCalls */]: (request) => { return this.requiredResponse(this.provideCallHierarchyIncomingCalls(request.arguments)); }, - [CommandNames.ProvideCallHierarchyOutgoingCalls]: (request) => { + ["provideCallHierarchyOutgoingCalls" /* ProvideCallHierarchyOutgoingCalls */]: (request) => { return this.requiredResponse(this.provideCallHierarchyOutgoingCalls(request.arguments)); }, - [CommandNames.ToggleLineComment]: (request) => { + ["toggleLineComment" /* ToggleLineComment */]: (request) => { return this.requiredResponse(this.toggleLineComment( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.ToggleLineCommentFull]: (request) => { + ["toggleLineComment-full" /* ToggleLineCommentFull */]: (request) => { return this.requiredResponse(this.toggleLineComment( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.ToggleMultilineComment]: (request) => { + ["toggleMultilineComment" /* ToggleMultilineComment */]: (request) => { return this.requiredResponse(this.toggleMultilineComment( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.ToggleMultilineCommentFull]: (request) => { + ["toggleMultilineComment-full" /* ToggleMultilineCommentFull */]: (request) => { return this.requiredResponse(this.toggleMultilineComment( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.CommentSelection]: (request) => { + ["commentSelection" /* CommentSelection */]: (request) => { return this.requiredResponse(this.commentSelection( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.CommentSelectionFull]: (request) => { + ["commentSelection-full" /* CommentSelectionFull */]: (request) => { return this.requiredResponse(this.commentSelection( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.UncommentSelection]: (request) => { + ["uncommentSelection" /* UncommentSelection */]: (request) => { return this.requiredResponse(this.uncommentSelection( request.arguments, /*simplifiedResult*/ true )); }, - [CommandNames.UncommentSelectionFull]: (request) => { + ["uncommentSelection-full" /* UncommentSelectionFull */]: (request) => { return this.requiredResponse(this.uncommentSelection( request.arguments, /*simplifiedResult*/ false )); }, - [CommandNames.ProvideInlayHints]: (request) => { + ["provideInlayHints" /* ProvideInlayHints */]: (request) => { return this.requiredResponse(this.provideInlayHints(request.arguments)); } })); @@ -172061,7 +174450,6 @@ ${json}${newLine}`; pluginProbeLocations: opts.pluginProbeLocations, allowLocalPluginLoads: opts.allowLocalPluginLoads, typesMapLocation: opts.typesMapLocation, - syntaxOnly: opts.syntaxOnly, serverMode: opts.serverMode, session: this }; @@ -172254,18 +174642,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter event(body, eventName) { this.send(toEvent(eventName, body)); } - // For backwards-compatibility only. - /** @deprecated */ - output(info, cmdName, reqSeq, errorMsg) { - this.doOutput( - info, - cmdName, - reqSeq, - /*success*/ - !errorMsg, - errorMsg - ); - } + /** @internal */ doOutput(info, cmdName, reqSeq, success, message) { const res = { seq: 0, @@ -173273,7 +175650,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter ); if (completions === void 0) return void 0; - if (kind === ts_server_protocol_exports.CommandTypes.CompletionsFull) + if (kind === "completions-full" /* CompletionsFull */) return completions; const prefix = args.prefix || ""; const entries = mapDefined(completions.entries, (entry) => { @@ -173315,7 +175692,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter }; } }); - if (kind === ts_server_protocol_exports.CommandTypes.Completions) { + if (kind === "completions" /* Completions */) { if (completions.metadata) entries.metadata = completions.metadata; return entries; @@ -173467,7 +175844,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter this.doOutput( /*info*/ void 0, - CommandNames.Reload, + "reload" /* Reload */, reqSeq, /*success*/ true @@ -173738,10 +176115,10 @@ ${e.message}`; } return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions; } - getCombinedCodeFix({ scope, fixId: fixId52 }, simplifiedResult) { + getCombinedCodeFix({ scope, fixId: fixId51 }, simplifiedResult) { Debug.assert(scope.type === "file"); const { file, project } = this.getFileAndProject(scope.args); - const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId52, this.getFormatOptions(file), this.getPreferences(file)); + const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId51, this.getFormatOptions(file), this.getPreferences(file)); if (simplifiedResult) { return { changes: this.mapTextChangesToCodeEdits(res.changes), commands: res.commands }; } else { @@ -173780,8 +176157,8 @@ ${e.message}`; mapCodeAction({ description: description2, changes, commands }) { return { description: description2, changes: this.mapTextChangesToCodeEdits(changes), commands }; } - mapCodeFixAction({ fixName: fixName8, description: description2, changes, commands, fixId: fixId52, fixAllDescription }) { - return { fixName: fixName8, description: description2, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId52, fixAllDescription }; + mapCodeFixAction({ fixName: fixName8, description: description2, changes, commands, fixId: fixId51, fixAllDescription }) { + return { fixName: fixName8, description: description2, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId51, fixAllDescription }; } mapTextChangesToCodeEdits(textChanges2) { return textChanges2.map((change) => this.mapTextChangeToCodeEdit(change)); @@ -174031,7 +176408,7 @@ ${e.message}`; this.doOutput( /*info*/ void 0, - CommandNames.Unknown, + "unknown" /* Unknown */, request.seq, /*success*/ false, @@ -174116,7 +176493,7 @@ ${e.message}`; this.doOutput( /*info*/ void 0, - request ? request.command : CommandNames.Unknown, + request ? request.command : "unknown" /* Unknown */, request ? request.seq : 0, /*success*/ false, @@ -175026,6 +177403,7 @@ ${e.message}`; InferencePriority: () => InferencePriority, InlayHintKind: () => InlayHintKind, InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, InternalSymbolName: () => InternalSymbolName, InvalidatedProjectKind: () => InvalidatedProjectKind, JsDoc: () => ts_JsDoc_exports, @@ -175069,7 +177447,7 @@ ${e.message}`; PollingInterval: () => PollingInterval, PollingWatchKind: () => PollingWatchKind, PragmaKindFlags: () => PragmaKindFlags, - PrivateIdentifierKind: () => PrivateIdentifierKind2, + PrivateIdentifierKind: () => PrivateIdentifierKind, ProcessLevel: () => ProcessLevel, QuotePreference: () => QuotePreference, RelationComparisonResult: () => RelationComparisonResult, @@ -175119,10 +177497,13 @@ ${e.message}`; WatchFileKind: () => WatchFileKind, WatchLogLevel: () => WatchLogLevel, WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, addEmitFlags: () => addEmitFlags, addEmitHelper: () => addEmitHelper, addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, addRange: () => addRange, addRelatedInfo: () => addRelatedInfo, addSyntheticLeadingComment: () => addSyntheticLeadingComment, @@ -175193,6 +177574,7 @@ ${e.message}`; changesAffectModuleResolution: () => changesAffectModuleResolution, changesAffectingProgramStructure: () => changesAffectingProgramStructure, childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, classPrivateFieldInHelper: () => classPrivateFieldInHelper, @@ -175241,6 +177623,7 @@ ${e.message}`; compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, computeLineOfPosition: () => computeLineOfPosition, @@ -175258,7 +177641,6 @@ ${e.message}`; containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, - convertEnableAutoDiscoveryToEnable: () => convertEnableAutoDiscoveryToEnable, convertJsonOption: () => convertJsonOption, convertToBase64: () => convertToBase64, convertToObject: () => convertToObject, @@ -175279,41 +177661,17 @@ ${e.message}`; createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, - createAdd: () => createAdd, - createArrayBindingPattern: () => createArrayBindingPattern, - createArrayLiteral: () => createArrayLiteral, - createArrayTypeNode: () => createArrayTypeNode, - createArrowFunction: () => createArrowFunction, - createAsExpression: () => createAsExpression, - createAssignment: () => createAssignment, - createAwait: () => createAwait, createBaseNodeFactory: () => createBaseNodeFactory, - createBigIntLiteral: () => createBigIntLiteral, - createBinary: () => createBinary, createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, - createBindingElement: () => createBindingElement, createBindingHelper: () => createBindingHelper, - createBlock: () => createBlock, - createBreak: () => createBreak, createBuildInfo: () => createBuildInfo, createBuilderProgram: () => createBuilderProgram, createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, createBuilderStatusReporter: () => createBuilderStatusReporter, - createBundle: () => createBundle, createCacheWithRedirects: () => createCacheWithRedirects, createCacheableExportInfoMap: () => createCacheableExportInfoMap, createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, - createCall: () => createCall, - createCallChain: () => createCallChain, - createCallSignature: () => createCallSignature, - createCaseBlock: () => createCaseBlock, - createCaseClause: () => createCaseClause, - createCatchClause: () => createCatchClause, - createClassDeclaration: () => createClassDeclaration, - createClassExpression: () => createClassExpression, createClassifier: () => createClassifier, - createComma: () => createComma, - createCommaList: () => createCommaList, createCommentDirectivesMap: () => createCommentDirectivesMap, createCompilerDiagnostic: () => createCompilerDiagnostic, createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, @@ -175321,212 +177679,73 @@ ${e.message}`; createCompilerHost: () => createCompilerHost, createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, createCompilerHostWorker: () => createCompilerHostWorker, - createComputedPropertyName: () => createComputedPropertyName, - createConditional: () => createConditional, - createConditionalTypeNode: () => createConditionalTypeNode, - createConstructSignature: () => createConstructSignature, - createConstructor: () => createConstructor, - createConstructorTypeNode: () => createConstructorTypeNode, - createContinue: () => createContinue, - createDebuggerStatement: () => createDebuggerStatement, - createDecorator: () => createDecorator, - createDefaultClause: () => createDefaultClause, - createDelete: () => createDelete, createDetachedDiagnostic: () => createDetachedDiagnostic, createDiagnosticCollection: () => createDiagnosticCollection, createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, createDiagnosticForNode: () => createDiagnosticForNode, createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, createDiagnosticForRange: () => createDiagnosticForRange, createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, createDiagnosticReporter: () => createDiagnosticReporter, - createDo: () => createDo, createDocumentPositionMapper: () => createDocumentPositionMapper, createDocumentRegistry: () => createDocumentRegistry, createDocumentRegistryInternal: () => createDocumentRegistryInternal, - createElementAccess: () => createElementAccess, - createElementAccessChain: () => createElementAccessChain, createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, createEmitHelperFactory: () => createEmitHelperFactory, createEmptyExports: () => createEmptyExports, - createEmptyStatement: () => createEmptyStatement, - createEnumDeclaration: () => createEnumDeclaration, - createEnumMember: () => createEnumMember, - createExportAssignment: () => createExportAssignment2, - createExportDeclaration: () => createExportDeclaration, - createExportDefault: () => createExportDefault, - createExportSpecifier: () => createExportSpecifier, createExpressionForJsxElement: () => createExpressionForJsxElement, createExpressionForJsxFragment: () => createExpressionForJsxFragment, createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, createExpressionForPropertyName: () => createExpressionForPropertyName, createExpressionFromEntityName: () => createExpressionFromEntityName, - createExpressionStatement: () => createExpressionStatement, - createExpressionWithTypeArguments: () => createExpressionWithTypeArguments, createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createExternalModuleExport: () => createExternalModuleExport, - createExternalModuleReference: () => createExternalModuleReference, - createFalse: () => createFalse, createFileDiagnostic: () => createFileDiagnostic, createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createFileLevelUniqueName: () => createFileLevelUniqueName, - createFor: () => createFor, - createForIn: () => createForIn, - createForOf: () => createForOf, createForOfBindingStatement: () => createForOfBindingStatement, - createFunctionDeclaration: () => createFunctionDeclaration, - createFunctionExpression: () => createFunctionExpression, - createFunctionTypeNode: () => createFunctionTypeNode, - createGetAccessor: () => createGetAccessor, createGetCanonicalFileName: () => createGetCanonicalFileName, createGetSourceFile: () => createGetSourceFile, createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, createGetSymbolWalker: () => createGetSymbolWalker, - createHeritageClause: () => createHeritageClause, - createIdentifier: () => createIdentifier, - createIf: () => createIf, - createImmediatelyInvokedArrowFunction: () => createImmediatelyInvokedArrowFunction, - createImmediatelyInvokedFunctionExpression: () => createImmediatelyInvokedFunctionExpression, - createImportClause: () => createImportClause, - createImportDeclaration: () => createImportDeclaration, - createImportEqualsDeclaration: () => createImportEqualsDeclaration, - createImportSpecifier: () => createImportSpecifier, - createImportTypeNode: () => createImportTypeNode, createIncrementalCompilerHost: () => createIncrementalCompilerHost, createIncrementalProgram: () => createIncrementalProgram, - createIndexSignature: () => createIndexSignature, - createIndexedAccessTypeNode: () => createIndexedAccessTypeNode, - createInferTypeNode: () => createInferTypeNode, createInputFiles: () => createInputFiles, createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, - createInterfaceDeclaration: () => createInterfaceDeclaration, - createIntersectionTypeNode: () => createIntersectionTypeNode, - createJSDocAugmentsTag: () => createJSDocAugmentsTag, - createJSDocAuthorTag: () => createJSDocAuthorTag, - createJSDocCallbackTag: () => createJSDocCallbackTag, - createJSDocClassTag: () => createJSDocClassTag, - createJSDocComment: () => createJSDocComment, - createJSDocEnumTag: () => createJSDocEnumTag, - createJSDocImplementsTag: () => createJSDocImplementsTag, - createJSDocParamTag: () => createJSDocParamTag, - createJSDocParameterTag: () => createJSDocParameterTag, - createJSDocPrivateTag: () => createJSDocPrivateTag, - createJSDocPropertyTag: () => createJSDocPropertyTag, - createJSDocProtectedTag: () => createJSDocProtectedTag, - createJSDocPublicTag: () => createJSDocPublicTag, - createJSDocReadonlyTag: () => createJSDocReadonlyTag, - createJSDocReturnTag: () => createJSDocReturnTag, - createJSDocSignature: () => createJSDocSignature, - createJSDocTag: () => createJSDocTag, - createJSDocTemplateTag: () => createJSDocTemplateTag, - createJSDocThisTag: () => createJSDocThisTag, - createJSDocTypeExpression: () => createJSDocTypeExpression, - createJSDocTypeLiteral: () => createJSDocTypeLiteral, - createJSDocTypeTag: () => createJSDocTypeTag, - createJSDocTypedefTag: () => createJSDocTypedefTag, - createJsxAttribute: () => createJsxAttribute, - createJsxAttributes: () => createJsxAttributes, - createJsxClosingElement: () => createJsxClosingElement, - createJsxElement: () => createJsxElement, - createJsxExpression: () => createJsxExpression, createJsxFactoryExpression: () => createJsxFactoryExpression, - createJsxFragment: () => createJsxFragment, - createJsxJsxClosingFragment: () => createJsxJsxClosingFragment, - createJsxOpeningElement: () => createJsxOpeningElement, - createJsxOpeningFragment: () => createJsxOpeningFragment, - createJsxSelfClosingElement: () => createJsxSelfClosingElement, - createJsxSpreadAttribute: () => createJsxSpreadAttribute, - createJsxText: () => createJsxText, - createKeywordTypeNode: () => createKeywordTypeNode, - createLabel: () => createLabel, createLanguageService: () => createLanguageService, createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createLessThan: () => createLessThan, - createLiteral: () => createLiteral, - createLiteralTypeNode: () => createLiteralTypeNode, - createLogicalAnd: () => createLogicalAnd, - createLogicalNot: () => createLogicalNot, - createLogicalOr: () => createLogicalOr, - createLoopVariable: () => createLoopVariable, - createMappedTypeNode: () => createMappedTypeNode, createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createMetaProperty: () => createMetaProperty, - createMethod: () => createMethod, - createMethodSignature: () => createMethodSignature, createModeAwareCache: () => createModeAwareCache, createModeAwareCacheKey: () => createModeAwareCacheKey, - createModifier: () => createModifier, - createModifiersFromModifierFlags: () => createModifiersFromModifierFlags, - createModuleBlock: () => createModuleBlock, - createModuleDeclaration: () => createModuleDeclaration, createModuleResolutionCache: () => createModuleResolutionCache, createModuleResolutionLoader: () => createModuleResolutionLoader, createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, createMultiMap: () => createMultiMap, - createNamedExports: () => createNamedExports, - createNamedImports: () => createNamedImports, - createNamespaceExport: () => createNamespaceExport, - createNamespaceExportDeclaration: () => createNamespaceExportDeclaration, - createNamespaceImport: () => createNamespaceImport, - createNew: () => createNew, - createNoSubstitutionTemplateLiteral: () => createNoSubstitutionTemplateLiteral, - createNode: () => createNode2, - createNodeArray: () => createNodeArray, createNodeConverters: () => createNodeConverters, createNodeFactory: () => createNodeFactory, - createNonNullChain: () => createNonNullChain, - createNonNullExpression: () => createNonNullExpression, - createNotEmittedStatement: () => createNotEmittedStatement, - createNull: () => createNull, - createNumericLiteral: () => createNumericLiteral, - createObjectBindingPattern: () => createObjectBindingPattern, - createObjectLiteral: () => createObjectLiteral, - createOmittedExpression: () => createOmittedExpression, - createOptimisticUniqueName: () => createOptimisticUniqueName, createOptionNameMap: () => createOptionNameMap, - createOptionalTypeNode: () => createOptionalTypeNode, createOverload: () => createOverload, createPackageJsonImportFilter: () => createPackageJsonImportFilter, createPackageJsonInfo: () => createPackageJsonInfo, - createParameter: () => createParameter, - createParen: () => createParen, - createParenthesizedType: () => createParenthesizedType, createParenthesizerRules: () => createParenthesizerRules, - createPartiallyEmittedExpression: () => createPartiallyEmittedExpression, createPatternMatcher: () => createPatternMatcher, - createPostfix: () => createPostfix, - createPostfixIncrement: () => createPostfixIncrement, - createPrefix: () => createPrefix, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, - createPrivateIdentifier: () => createPrivateIdentifier, createProgram: () => createProgram, createProgramHost: () => createProgramHost, - createProperty: () => createProperty, - createPropertyAccess: () => createPropertyAccess, - createPropertyAccessChain: () => createPropertyAccessChain, - createPropertyAssignment: () => createPropertyAssignment, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, - createPropertySignature: () => createPropertySignature, - createQualifiedName: () => createQualifiedName, createQueue: () => createQueue, createRange: () => createRange, createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, - createRegularExpressionLiteral: () => createRegularExpressionLiteral, createResolutionCache: () => createResolutionCache, - createRestTypeNode: () => createRestTypeNode, - createReturn: () => createReturn, createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, createScanner: () => createScanner, createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, - createSemicolonClassElement: () => createSemicolonClassElement, createSet: () => createSet, - createSetAccessor: () => createSetAccessor, - createShorthandPropertyAssignment: () => createShorthandPropertyAssignment, createSolutionBuilder: () => createSolutionBuilder, createSolutionBuilderHost: () => createSolutionBuilderHost, createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, @@ -175535,27 +177754,10 @@ ${e.message}`; createSourceFile: () => createSourceFile, createSourceMapGenerator: () => createSourceMapGenerator, createSourceMapSource: () => createSourceMapSource, - createSpread: () => createSpread, - createSpreadAssignment: () => createSpreadAssignment, - createStatement: () => createStatement, - createStrictEquality: () => createStrictEquality, - createStrictInequality: () => createStrictInequality, - createStringLiteral: () => createStringLiteral, - createStringLiteralFromNode: () => createStringLiteralFromNode, - createSubtract: () => createSubtract, - createSuper: () => createSuper, createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, - createSwitch: () => createSwitch, createSymbolTable: () => createSymbolTable, createSymlinkCache: () => createSymlinkCache, createSystemWatchFunctions: () => createSystemWatchFunctions, - createTaggedTemplate: () => createTaggedTemplate, - createTempVariable: () => createTempVariable, - createTemplateExpression: () => createTemplateExpression, - createTemplateHead: () => createTemplateHead, - createTemplateMiddle: () => createTemplateMiddle, - createTemplateSpan: () => createTemplateSpan, - createTemplateTail: () => createTemplateTail, createTextChange: () => createTextChange, createTextChangeFromStartLength: () => createTextChangeFromStartLength, createTextChangeRange: () => createTextChangeRange, @@ -175567,36 +177769,12 @@ ${e.message}`; createTextSpanFromRange: () => createTextSpanFromRange, createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, createTextWriter: () => createTextWriter, - createThis: () => createThis, - createThisTypeNode: () => createThisTypeNode, - createThrow: () => createThrow, - createToken: () => createToken, createTokenRange: () => createTokenRange, - createTrue: () => createTrue, - createTry: () => createTry, - createTupleTypeNode: () => createTupleTypeNode, - createTypeAliasDeclaration: () => createTypeAliasDeclaration, - createTypeAssertion: () => createTypeAssertion, createTypeChecker: () => createTypeChecker, - createTypeLiteralNode: () => createTypeLiteralNode, - createTypeOf: () => createTypeOf, - createTypeOperatorNode: () => createTypeOperatorNode, - createTypeParameterDeclaration: () => createTypeParameterDeclaration, - createTypePredicateNode: () => createTypePredicateNode, - createTypePredicateNodeWithModifier: () => createTypePredicateNodeWithModifier, - createTypeQueryNode: () => createTypeQueryNode, createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, - createTypeReferenceNode: () => createTypeReferenceNode, createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap, - createUnionTypeNode: () => createUnionTypeNode, - createUniqueName: () => createUniqueName, createUnparsedSourceFile: () => createUnparsedSourceFile, - createVariableDeclaration: () => createVariableDeclaration, - createVariableDeclarationList: () => createVariableDeclarationList, - createVariableStatement: () => createVariableStatement, - createVoid: () => createVoid, - createVoidZero: () => createVoidZero, createWatchCompilerHost: () => createWatchCompilerHost2, createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, @@ -175604,10 +177782,7 @@ ${e.message}`; createWatchHost: () => createWatchHost, createWatchProgram: () => createWatchProgram, createWatchStatusReporter: () => createWatchStatusReporter, - createWhile: () => createWhile, - createWith: () => createWith, createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - createYield: () => createYield, declarationNameToString: () => declarationNameToString, decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, @@ -175654,6 +177829,7 @@ ${e.message}`; equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, equateStringsCaseSensitive: () => equateStringsCaseSensitive, equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, escapeJsxAttributeString: () => escapeJsxAttributeString, escapeLeadingUnderscores: () => escapeLeadingUnderscores, escapeNonAsciiString: () => escapeNonAsciiString, @@ -175682,6 +177858,7 @@ ${e.message}`; findAncestor: () => findAncestor, findBestPatternMatch: () => findBestPatternMatch, findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, findConfigFile: () => findConfigFile, findContainingList: () => findContainingList, findDiagnosticForNode: () => findDiagnosticForNode, @@ -175712,6 +177889,7 @@ ${e.message}`; flatMapIterator: () => flatMapIterator, flatMapToMutable: () => flatMapToMutable, flatten: () => flatten, + flattenCommaList: () => flattenCommaList, flattenDestructuringAssignment: () => flattenDestructuringAssignment, flattenDestructuringBinding: () => flattenDestructuringBinding, flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, @@ -175817,6 +177995,7 @@ ${e.message}`; getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, getDecorators: () => getDecorators, getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, getDefaultLibFileName: () => getDefaultLibFileName, getDefaultLibFilePath: () => getDefaultLibFilePath, @@ -175888,9 +178067,11 @@ ${e.message}`; getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, getFullWidth: () => getFullWidth, getFunctionFlags: () => getFunctionFlags, - getGeneratedNameForNode: () => getGeneratedNameForNode, getHeritageClause: () => getHeritageClause, getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, @@ -175902,7 +178083,9 @@ ${e.message}`; getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, getJSDocAugmentsTag: () => getJSDocAugmentsTag, getJSDocClassTag: () => getJSDocClassTag, getJSDocCommentRanges: () => getJSDocCommentRanges, @@ -175926,6 +178109,8 @@ ${e.message}`; getJSDocReturnTag: () => getJSDocReturnTag, getJSDocReturnType: () => getJSDocReturnType, getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, getJSDocTags: () => getJSDocTags, getJSDocTagsNoCache: () => getJSDocTagsNoCache, getJSDocTemplateTag: () => getJSDocTemplateTag, @@ -175980,7 +178165,6 @@ ${e.message}`; getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, - getMutableClone: () => getMutableClone, getNameForExportedSymbol: () => getNameForExportedSymbol, getNameFromIndexInfo: () => getNameFromIndexInfo, getNameFromPropertyName: () => getNameFromPropertyName, @@ -176054,6 +178238,7 @@ ${e.message}`; getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, getPreEmitDiagnostics: () => getPreEmitDiagnostics, getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, getProperties: () => getProperties, getProperty: () => getProperty, getPropertyArrayElementValue: () => getPropertyArrayElementValue, @@ -176179,6 +178364,7 @@ ${e.message}`; getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, getWatchFactory: () => getWatchFactory, group: () => group, + groupBy: () => groupBy, guessIndentation: () => guessIndentation, handleNoEmitOptions: () => handleNoEmitOptions, hasAbstractModifier: () => hasAbstractModifier, @@ -176224,12 +178410,14 @@ ${e.message}`; hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, idText: () => idText, identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, identity: () => identity, identitySourceMapConsumer: () => identitySourceMapConsumer, ignoreSourceNewlines: () => ignoreSourceNewlines, ignoredPaths: () => ignoredPaths, importDefaultHelper: () => importDefaultHelper, importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, importStarHelper: () => importStarHelper, indexOfAnyCharCode: () => indexOfAnyCharCode, indexOfNode: () => indexOfNode, @@ -176255,6 +178443,7 @@ ${e.message}`; isAliasableExpression: () => isAliasableExpression, isAmbientModule: () => isAmbientModule, isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, isAnyDirectorySeparator: () => isAnyDirectorySeparator, isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, isAnyImportOrReExport: () => isAnyImportOrReExport, @@ -176264,6 +178453,7 @@ ${e.message}`; isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, isArray: () => isArray, isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, isArrayBindingPattern: () => isArrayBindingPattern, isArrayLiteralExpression: () => isArrayLiteralExpression, @@ -176295,7 +178485,9 @@ ${e.message}`; isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, isBindableStaticNameExpression: () => isBindableStaticNameExpression, isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, isBindingPattern: () => isBindingPattern, isBlock: () => isBlock, @@ -176336,6 +178528,7 @@ ${e.message}`; isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, isCollapsedRange: () => isCollapsedRange, isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, isCommaListExpression: () => isCommaListExpression, isCommaSequence: () => isCommaSequence, isCommaToken: () => isCommaToken, @@ -176369,6 +178562,7 @@ ${e.message}`; isDecoratorTarget: () => isDecoratorTarget, isDefaultClause: () => isDefaultClause, isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, isDeleteExpression: () => isDeleteExpression, isDeleteTarget: () => isDeleteTarget, @@ -176392,6 +178586,7 @@ ${e.message}`; isEmptyBindingPattern: () => isEmptyBindingPattern, isEmptyObjectLiteral: () => isEmptyObjectLiteral, isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, isEndOfDeclarationMarker: () => isEndOfDeclarationMarker, isEntityName: () => isEntityName, isEntityNameExpression: () => isEntityNameExpression, @@ -176408,6 +178603,7 @@ ${e.message}`; isExportModifier: () => isExportModifier, isExportName: () => isExportName, isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, isExportSpecifier: () => isExportSpecifier, isExportsIdentifier: () => isExportsIdentifier, isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, @@ -176462,7 +178658,6 @@ ${e.message}`; isIdentifier: () => isIdentifier, isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, isIdentifierName: () => isIdentifierName, - isIdentifierOrPrivateIdentifier: () => isIdentifierOrPrivateIdentifier, isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, isIdentifierPart: () => isIdentifierPart, isIdentifierStart: () => isIdentifierStart, @@ -176502,6 +178697,7 @@ ${e.message}`; isInferTypeNode: () => isInferTypeNode, isInfinityOrNaNString: () => isInfinityOrNaNString, isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, isInsideJsxElement: () => isInsideJsxElement, isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, isInsideNodeModules: () => isInsideNodeModules, @@ -176551,6 +178747,8 @@ ${e.message}`; isJSDocPublicTag: () => isJSDocPublicTag, isJSDocReadonlyTag: () => isJSDocReadonlyTag, isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, isJSDocSeeTag: () => isJSDocSeeTag, isJSDocSignature: () => isJSDocSignature, isJSDocTag: () => isJSDocTag, @@ -176606,11 +178804,14 @@ ${e.message}`; isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, isLiteralTypeNode: () => isLiteralTypeNode, isLocalName: () => isLocalName, isLogicalOperator: () => isLogicalOperator, isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, isMappedTypeNode: () => isMappedTypeNode, isMemberName: () => isMemberName, isMergeDeclarationMarker: () => isMergeDeclarationMarker, @@ -176638,6 +178839,8 @@ ${e.message}`; isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, isNamedClassElement: () => isNamedClassElement, isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, isNamedExportBindings: () => isNamedExportBindings, isNamedExports: () => isNamedExports, isNamedImportBindings: () => isNamedImportBindings, @@ -176662,6 +178865,7 @@ ${e.message}`; isNodeModulesDirectory: () => isNodeModulesDirectory, isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, isNonGlobalDeclaration: () => isNonGlobalDeclaration, isNonNullAccess: () => isNonNullAccess, @@ -176730,6 +178934,7 @@ ${e.message}`; isPropertyName: () => isPropertyName, isPropertyNameLiteral: () => isPropertyNameLiteral, isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, isPrototypeAccess: () => isPrototypeAccess, isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, isPunctuation: () => isPunctuation, @@ -176841,7 +179046,6 @@ ${e.message}`; isTupleTypeNode: () => isTupleTypeNode, isTypeAlias: () => isTypeAlias, isTypeAliasDeclaration: () => isTypeAliasDeclaration, - isTypeAssertion: () => isTypeAssertion, isTypeAssertionExpression: () => isTypeAssertionExpression, isTypeDeclaration: () => isTypeDeclaration, isTypeElement: () => isTypeElement, @@ -176851,8 +179055,9 @@ ${e.message}`; isTypeLiteralNode: () => isTypeLiteralNode, isTypeNode: () => isTypeNode, isTypeNodeKind: () => isTypeNodeKind, - isTypeNodeOrTypeParameterDeclaration: () => isTypeNodeOrTypeParameterDeclaration, isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, isTypeOperatorNode: () => isTypeOperatorNode, isTypeParameterDeclaration: () => isTypeParameterDeclaration, @@ -176927,6 +179132,7 @@ ${e.message}`; maybeBind: () => maybeBind, maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, memoize: () => memoize, + memoizeCached: () => memoizeCached, memoizeOne: () => memoizeOne, memoizeWeak: () => memoizeWeak, metadataHelper: () => metadataHelper, @@ -176952,6 +179158,7 @@ ${e.message}`; mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, noTransformers: () => noTransformers, @@ -177045,6 +179252,7 @@ ${e.message}`; programContainsEsModules: () => programContainsEsModules, programContainsModules: () => programContainsModules, projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, propertyNamePart: () => propertyNamePart, pseudoBigIntToString: () => pseudoBigIntToString, punctuationPart: () => punctuationPart, @@ -177109,10 +179317,12 @@ ${e.message}`; returnTrue: () => returnTrue, returnUndefined: () => returnUndefined, returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, sameFlatMap: () => sameFlatMap, sameMap: () => sameMap, sameMapping: () => sameMapping, scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, scanner: () => scanner, screenStartingMessageCodes: () => screenStartingMessageCodes, semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, @@ -177124,7 +179334,12 @@ ${e.message}`; setConstantValue: () => setConstantValue, setEachParent: () => setEachParent, setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, setModuleDefaultHelper: () => setModuleDefaultHelper, setNodeFlags: () => setNodeFlags, @@ -177132,6 +179347,7 @@ ${e.message}`; setOriginalNode: () => setOriginalNode, setParent: () => setParent, setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, setResolvedModule: () => setResolvedModule, setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective, setSnippetElement: () => setSnippetElement, @@ -177172,6 +179388,7 @@ ${e.message}`; skipTrivia: () => skipTrivia, skipTypeChecking: () => skipTypeChecking, skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, sliceAfter: () => sliceAfter, some: () => some, sort: () => sort, @@ -177266,6 +179483,7 @@ ${e.message}`; transformES2020: () => transformES2020, transformES2021: () => transformES2021, transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, transformESNext: () => transformESNext, transformGenerators: () => transformGenerators, transformJsx: () => transformJsx, @@ -177292,6 +179510,7 @@ ${e.message}`; tryGetDirectories: () => tryGetDirectories, tryGetExtensionFromPath: () => tryGetExtensionFromPath2, tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, @@ -177326,148 +179545,14 @@ ${e.message}`; unreachableCodeIsError: () => unreachableCodeIsError, unusedLabelIsError: () => unusedLabelIsError, unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, - updateArrayBindingPattern: () => updateArrayBindingPattern, - updateArrayLiteral: () => updateArrayLiteral, - updateArrayTypeNode: () => updateArrayTypeNode, - updateArrowFunction: () => updateArrowFunction, - updateAsExpression: () => updateAsExpression, - updateAwait: () => updateAwait, - updateBinary: () => updateBinary, - updateBindingElement: () => updateBindingElement, - updateBlock: () => updateBlock, - updateBreak: () => updateBreak, - updateBundle: () => updateBundle, - updateCall: () => updateCall, - updateCallChain: () => updateCallChain, - updateCallSignature: () => updateCallSignature, - updateCaseBlock: () => updateCaseBlock, - updateCaseClause: () => updateCaseClause, - updateCatchClause: () => updateCatchClause, - updateClassDeclaration: () => updateClassDeclaration, - updateClassExpression: () => updateClassExpression, - updateCommaList: () => updateCommaList, - updateComputedPropertyName: () => updateComputedPropertyName, - updateConditional: () => updateConditional, - updateConditionalTypeNode: () => updateConditionalTypeNode, - updateConstructSignature: () => updateConstructSignature, - updateConstructor: () => updateConstructor, - updateConstructorTypeNode: () => updateConstructorTypeNode, - updateContinue: () => updateContinue, - updateDecorator: () => updateDecorator, - updateDefaultClause: () => updateDefaultClause, - updateDelete: () => updateDelete, - updateDo: () => updateDo, - updateElementAccess: () => updateElementAccess, - updateElementAccessChain: () => updateElementAccessChain, - updateEnumDeclaration: () => updateEnumDeclaration, - updateEnumMember: () => updateEnumMember, updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, - updateExportAssignment: () => updateExportAssignment, - updateExportDeclaration: () => updateExportDeclaration, - updateExportSpecifier: () => updateExportSpecifier, - updateExpressionStatement: () => updateExpressionStatement, - updateExpressionWithTypeArguments: () => updateExpressionWithTypeArguments, - updateExternalModuleReference: () => updateExternalModuleReference, - updateFor: () => updateFor, - updateForIn: () => updateForIn, - updateForOf: () => updateForOf, - updateFunctionDeclaration: () => updateFunctionDeclaration, - updateFunctionExpression: () => updateFunctionExpression, - updateFunctionTypeNode: () => updateFunctionTypeNode, - updateGetAccessor: () => updateGetAccessor, - updateHeritageClause: () => updateHeritageClause, - updateIf: () => updateIf, - updateImportClause: () => updateImportClause, - updateImportDeclaration: () => updateImportDeclaration, - updateImportEqualsDeclaration: () => updateImportEqualsDeclaration, - updateImportSpecifier: () => updateImportSpecifier, - updateImportTypeNode: () => updateImportTypeNode, - updateIndexSignature: () => updateIndexSignature, - updateIndexedAccessTypeNode: () => updateIndexedAccessTypeNode, - updateInferTypeNode: () => updateInferTypeNode, - updateInterfaceDeclaration: () => updateInterfaceDeclaration, - updateIntersectionTypeNode: () => updateIntersectionTypeNode, - updateJsxAttribute: () => updateJsxAttribute, - updateJsxAttributes: () => updateJsxAttributes, - updateJsxClosingElement: () => updateJsxClosingElement, - updateJsxElement: () => updateJsxElement, - updateJsxExpression: () => updateJsxExpression, - updateJsxFragment: () => updateJsxFragment, - updateJsxOpeningElement: () => updateJsxOpeningElement, - updateJsxSelfClosingElement: () => updateJsxSelfClosingElement, - updateJsxSpreadAttribute: () => updateJsxSpreadAttribute, - updateJsxText: () => updateJsxText, - updateLabel: () => updateLabel, updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, - updateLiteralTypeNode: () => updateLiteralTypeNode, - updateMappedTypeNode: () => updateMappedTypeNode, - updateMetaProperty: () => updateMetaProperty, - updateMethod: () => updateMethod, - updateMethodSignature: () => updateMethodSignature, updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updateModuleBlock: () => updateModuleBlock, - updateModuleDeclaration: () => updateModuleDeclaration, - updateNamedExports: () => updateNamedExports, - updateNamedImports: () => updateNamedImports, - updateNamespaceExport: () => updateNamespaceExport, - updateNamespaceExportDeclaration: () => updateNamespaceExportDeclaration, - updateNamespaceImport: () => updateNamespaceImport, - updateNew: () => updateNew, - updateNonNullChain: () => updateNonNullChain, - updateNonNullExpression: () => updateNonNullExpression, - updateObjectBindingPattern: () => updateObjectBindingPattern, - updateObjectLiteral: () => updateObjectLiteral, - updateOptionalTypeNode: () => updateOptionalTypeNode, updatePackageJsonWatch: () => updatePackageJsonWatch, - updateParameter: () => updateParameter, - updateParen: () => updateParen, - updateParenthesizedType: () => updateParenthesizedType, - updatePartiallyEmittedExpression: () => updatePartiallyEmittedExpression, - updatePostfix: () => updatePostfix, - updatePrefix: () => updatePrefix, - updateProperty: () => updateProperty, - updatePropertyAccess: () => updatePropertyAccess, - updatePropertyAccessChain: () => updatePropertyAccessChain, - updatePropertyAssignment: () => updatePropertyAssignment, - updatePropertySignature: () => updatePropertySignature, - updateQualifiedName: () => updateQualifiedName, updateResolutionField: () => updateResolutionField, - updateRestTypeNode: () => updateRestTypeNode, - updateReturn: () => updateReturn, - updateSetAccessor: () => updateSetAccessor, updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, - updateShorthandPropertyAssignment: () => updateShorthandPropertyAssignment, updateSourceFile: () => updateSourceFile, - updateSourceFileNode: () => updateSourceFileNode, - updateSpread: () => updateSpread, - updateSpreadAssignment: () => updateSpreadAssignment, - updateStatement: () => updateStatement, - updateSwitch: () => updateSwitch, - updateTaggedTemplate: () => updateTaggedTemplate, - updateTemplateExpression: () => updateTemplateExpression, - updateTemplateSpan: () => updateTemplateSpan, - updateThrow: () => updateThrow, - updateTry: () => updateTry, - updateTupleTypeNode: () => updateTupleTypeNode, - updateTypeAliasDeclaration: () => updateTypeAliasDeclaration, - updateTypeAssertion: () => updateTypeAssertion, - updateTypeLiteralNode: () => updateTypeLiteralNode, - updateTypeOf: () => updateTypeOf, - updateTypeOperatorNode: () => updateTypeOperatorNode, - updateTypeParameterDeclaration: () => updateTypeParameterDeclaration, - updateTypePredicateNode: () => updateTypePredicateNode, - updateTypePredicateNodeWithModifier: () => updateTypePredicateNodeWithModifier, - updateTypeQueryNode: () => updateTypeQueryNode, - updateTypeReferenceNode: () => updateTypeReferenceNode, - updateUnionTypeNode: () => updateUnionTypeNode, - updateVariableDeclaration: () => updateVariableDeclaration, - updateVariableDeclarationList: () => updateVariableDeclarationList, - updateVariableStatement: () => updateVariableStatement, - updateVoid: () => updateVoid, updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, - updateWhile: () => updateWhile, - updateWith: () => updateWith, - updateYield: () => updateYield, usesExtensionsOnImports: () => usesExtensionsOnImports, usingSingleLineStringWriter: () => usingSingleLineStringWriter, utf16EncodeAsString: () => utf16EncodeAsString, @@ -177476,6 +179561,7 @@ ${e.message}`; version: () => version, versionMajorMinor: () => versionMajorMinor, visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, visitEachChild: () => visitEachChild, visitFunctionBody: () => visitFunctionBody, visitIterationBody: () => visitIterationBody, @@ -177484,6 +179570,8 @@ ${e.message}`; visitNodes: () => visitNodes2, visitParameterList: () => visitParameterList, walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, @@ -177667,6 +179755,7 @@ ${e.message}`; InferencePriority: () => InferencePriority, InlayHintKind: () => InlayHintKind, InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, InternalSymbolName: () => InternalSymbolName, InvalidatedProjectKind: () => InvalidatedProjectKind, JsDoc: () => ts_JsDoc_exports, @@ -177710,7 +179799,7 @@ ${e.message}`; PollingInterval: () => PollingInterval, PollingWatchKind: () => PollingWatchKind, PragmaKindFlags: () => PragmaKindFlags, - PrivateIdentifierKind: () => PrivateIdentifierKind2, + PrivateIdentifierKind: () => PrivateIdentifierKind, ProcessLevel: () => ProcessLevel, QuotePreference: () => QuotePreference, RelationComparisonResult: () => RelationComparisonResult, @@ -177760,10 +179849,13 @@ ${e.message}`; WatchFileKind: () => WatchFileKind, WatchLogLevel: () => WatchLogLevel, WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, addEmitFlags: () => addEmitFlags, addEmitHelper: () => addEmitHelper, addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, addRange: () => addRange, addRelatedInfo: () => addRelatedInfo, addSyntheticLeadingComment: () => addSyntheticLeadingComment, @@ -177834,6 +179926,7 @@ ${e.message}`; changesAffectModuleResolution: () => changesAffectModuleResolution, changesAffectingProgramStructure: () => changesAffectingProgramStructure, childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, classPrivateFieldInHelper: () => classPrivateFieldInHelper, @@ -177882,6 +179975,7 @@ ${e.message}`; compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, computeLineOfPosition: () => computeLineOfPosition, @@ -177899,7 +179993,6 @@ ${e.message}`; containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, - convertEnableAutoDiscoveryToEnable: () => convertEnableAutoDiscoveryToEnable, convertJsonOption: () => convertJsonOption, convertToBase64: () => convertToBase64, convertToObject: () => convertToObject, @@ -177920,41 +180013,17 @@ ${e.message}`; createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, - createAdd: () => createAdd, - createArrayBindingPattern: () => createArrayBindingPattern, - createArrayLiteral: () => createArrayLiteral, - createArrayTypeNode: () => createArrayTypeNode, - createArrowFunction: () => createArrowFunction, - createAsExpression: () => createAsExpression, - createAssignment: () => createAssignment, - createAwait: () => createAwait, createBaseNodeFactory: () => createBaseNodeFactory, - createBigIntLiteral: () => createBigIntLiteral, - createBinary: () => createBinary, createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, - createBindingElement: () => createBindingElement, createBindingHelper: () => createBindingHelper, - createBlock: () => createBlock, - createBreak: () => createBreak, createBuildInfo: () => createBuildInfo, createBuilderProgram: () => createBuilderProgram, createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, createBuilderStatusReporter: () => createBuilderStatusReporter, - createBundle: () => createBundle, createCacheWithRedirects: () => createCacheWithRedirects, createCacheableExportInfoMap: () => createCacheableExportInfoMap, createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, - createCall: () => createCall, - createCallChain: () => createCallChain, - createCallSignature: () => createCallSignature, - createCaseBlock: () => createCaseBlock, - createCaseClause: () => createCaseClause, - createCatchClause: () => createCatchClause, - createClassDeclaration: () => createClassDeclaration, - createClassExpression: () => createClassExpression, createClassifier: () => createClassifier, - createComma: () => createComma, - createCommaList: () => createCommaList, createCommentDirectivesMap: () => createCommentDirectivesMap, createCompilerDiagnostic: () => createCompilerDiagnostic, createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, @@ -177962,212 +180031,73 @@ ${e.message}`; createCompilerHost: () => createCompilerHost, createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, createCompilerHostWorker: () => createCompilerHostWorker, - createComputedPropertyName: () => createComputedPropertyName, - createConditional: () => createConditional, - createConditionalTypeNode: () => createConditionalTypeNode, - createConstructSignature: () => createConstructSignature, - createConstructor: () => createConstructor, - createConstructorTypeNode: () => createConstructorTypeNode, - createContinue: () => createContinue, - createDebuggerStatement: () => createDebuggerStatement, - createDecorator: () => createDecorator, - createDefaultClause: () => createDefaultClause, - createDelete: () => createDelete, createDetachedDiagnostic: () => createDetachedDiagnostic, createDiagnosticCollection: () => createDiagnosticCollection, createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, createDiagnosticForNode: () => createDiagnosticForNode, createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, createDiagnosticForRange: () => createDiagnosticForRange, createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, createDiagnosticReporter: () => createDiagnosticReporter, - createDo: () => createDo, createDocumentPositionMapper: () => createDocumentPositionMapper, createDocumentRegistry: () => createDocumentRegistry, createDocumentRegistryInternal: () => createDocumentRegistryInternal, - createElementAccess: () => createElementAccess, - createElementAccessChain: () => createElementAccessChain, createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, createEmitHelperFactory: () => createEmitHelperFactory, createEmptyExports: () => createEmptyExports, - createEmptyStatement: () => createEmptyStatement, - createEnumDeclaration: () => createEnumDeclaration, - createEnumMember: () => createEnumMember, - createExportAssignment: () => createExportAssignment2, - createExportDeclaration: () => createExportDeclaration, - createExportDefault: () => createExportDefault, - createExportSpecifier: () => createExportSpecifier, createExpressionForJsxElement: () => createExpressionForJsxElement, createExpressionForJsxFragment: () => createExpressionForJsxFragment, createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, createExpressionForPropertyName: () => createExpressionForPropertyName, createExpressionFromEntityName: () => createExpressionFromEntityName, - createExpressionStatement: () => createExpressionStatement, - createExpressionWithTypeArguments: () => createExpressionWithTypeArguments, createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createExternalModuleExport: () => createExternalModuleExport, - createExternalModuleReference: () => createExternalModuleReference, - createFalse: () => createFalse, createFileDiagnostic: () => createFileDiagnostic, createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createFileLevelUniqueName: () => createFileLevelUniqueName, - createFor: () => createFor, - createForIn: () => createForIn, - createForOf: () => createForOf, createForOfBindingStatement: () => createForOfBindingStatement, - createFunctionDeclaration: () => createFunctionDeclaration, - createFunctionExpression: () => createFunctionExpression, - createFunctionTypeNode: () => createFunctionTypeNode, - createGetAccessor: () => createGetAccessor, createGetCanonicalFileName: () => createGetCanonicalFileName, createGetSourceFile: () => createGetSourceFile, createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, createGetSymbolWalker: () => createGetSymbolWalker, - createHeritageClause: () => createHeritageClause, - createIdentifier: () => createIdentifier, - createIf: () => createIf, - createImmediatelyInvokedArrowFunction: () => createImmediatelyInvokedArrowFunction, - createImmediatelyInvokedFunctionExpression: () => createImmediatelyInvokedFunctionExpression, - createImportClause: () => createImportClause, - createImportDeclaration: () => createImportDeclaration, - createImportEqualsDeclaration: () => createImportEqualsDeclaration, - createImportSpecifier: () => createImportSpecifier, - createImportTypeNode: () => createImportTypeNode, createIncrementalCompilerHost: () => createIncrementalCompilerHost, createIncrementalProgram: () => createIncrementalProgram, - createIndexSignature: () => createIndexSignature, - createIndexedAccessTypeNode: () => createIndexedAccessTypeNode, - createInferTypeNode: () => createInferTypeNode, createInputFiles: () => createInputFiles, createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, - createInterfaceDeclaration: () => createInterfaceDeclaration, - createIntersectionTypeNode: () => createIntersectionTypeNode, - createJSDocAugmentsTag: () => createJSDocAugmentsTag, - createJSDocAuthorTag: () => createJSDocAuthorTag, - createJSDocCallbackTag: () => createJSDocCallbackTag, - createJSDocClassTag: () => createJSDocClassTag, - createJSDocComment: () => createJSDocComment, - createJSDocEnumTag: () => createJSDocEnumTag, - createJSDocImplementsTag: () => createJSDocImplementsTag, - createJSDocParamTag: () => createJSDocParamTag, - createJSDocParameterTag: () => createJSDocParameterTag, - createJSDocPrivateTag: () => createJSDocPrivateTag, - createJSDocPropertyTag: () => createJSDocPropertyTag, - createJSDocProtectedTag: () => createJSDocProtectedTag, - createJSDocPublicTag: () => createJSDocPublicTag, - createJSDocReadonlyTag: () => createJSDocReadonlyTag, - createJSDocReturnTag: () => createJSDocReturnTag, - createJSDocSignature: () => createJSDocSignature, - createJSDocTag: () => createJSDocTag, - createJSDocTemplateTag: () => createJSDocTemplateTag, - createJSDocThisTag: () => createJSDocThisTag, - createJSDocTypeExpression: () => createJSDocTypeExpression, - createJSDocTypeLiteral: () => createJSDocTypeLiteral, - createJSDocTypeTag: () => createJSDocTypeTag, - createJSDocTypedefTag: () => createJSDocTypedefTag, - createJsxAttribute: () => createJsxAttribute, - createJsxAttributes: () => createJsxAttributes, - createJsxClosingElement: () => createJsxClosingElement, - createJsxElement: () => createJsxElement, - createJsxExpression: () => createJsxExpression, createJsxFactoryExpression: () => createJsxFactoryExpression, - createJsxFragment: () => createJsxFragment, - createJsxJsxClosingFragment: () => createJsxJsxClosingFragment, - createJsxOpeningElement: () => createJsxOpeningElement, - createJsxOpeningFragment: () => createJsxOpeningFragment, - createJsxSelfClosingElement: () => createJsxSelfClosingElement, - createJsxSpreadAttribute: () => createJsxSpreadAttribute, - createJsxText: () => createJsxText, - createKeywordTypeNode: () => createKeywordTypeNode, - createLabel: () => createLabel, createLanguageService: () => createLanguageService, createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createLessThan: () => createLessThan, - createLiteral: () => createLiteral, - createLiteralTypeNode: () => createLiteralTypeNode, - createLogicalAnd: () => createLogicalAnd, - createLogicalNot: () => createLogicalNot, - createLogicalOr: () => createLogicalOr, - createLoopVariable: () => createLoopVariable, - createMappedTypeNode: () => createMappedTypeNode, createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createMetaProperty: () => createMetaProperty, - createMethod: () => createMethod, - createMethodSignature: () => createMethodSignature, createModeAwareCache: () => createModeAwareCache, createModeAwareCacheKey: () => createModeAwareCacheKey, - createModifier: () => createModifier, - createModifiersFromModifierFlags: () => createModifiersFromModifierFlags, - createModuleBlock: () => createModuleBlock, - createModuleDeclaration: () => createModuleDeclaration, createModuleResolutionCache: () => createModuleResolutionCache, createModuleResolutionLoader: () => createModuleResolutionLoader, createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, createMultiMap: () => createMultiMap, - createNamedExports: () => createNamedExports, - createNamedImports: () => createNamedImports, - createNamespaceExport: () => createNamespaceExport, - createNamespaceExportDeclaration: () => createNamespaceExportDeclaration, - createNamespaceImport: () => createNamespaceImport, - createNew: () => createNew, - createNoSubstitutionTemplateLiteral: () => createNoSubstitutionTemplateLiteral, - createNode: () => createNode2, - createNodeArray: () => createNodeArray, createNodeConverters: () => createNodeConverters, createNodeFactory: () => createNodeFactory, - createNonNullChain: () => createNonNullChain, - createNonNullExpression: () => createNonNullExpression, - createNotEmittedStatement: () => createNotEmittedStatement, - createNull: () => createNull, - createNumericLiteral: () => createNumericLiteral, - createObjectBindingPattern: () => createObjectBindingPattern, - createObjectLiteral: () => createObjectLiteral, - createOmittedExpression: () => createOmittedExpression, - createOptimisticUniqueName: () => createOptimisticUniqueName, createOptionNameMap: () => createOptionNameMap, - createOptionalTypeNode: () => createOptionalTypeNode, createOverload: () => createOverload, createPackageJsonImportFilter: () => createPackageJsonImportFilter, createPackageJsonInfo: () => createPackageJsonInfo, - createParameter: () => createParameter, - createParen: () => createParen, - createParenthesizedType: () => createParenthesizedType, createParenthesizerRules: () => createParenthesizerRules, - createPartiallyEmittedExpression: () => createPartiallyEmittedExpression, createPatternMatcher: () => createPatternMatcher, - createPostfix: () => createPostfix, - createPostfixIncrement: () => createPostfixIncrement, - createPrefix: () => createPrefix, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, - createPrivateIdentifier: () => createPrivateIdentifier, createProgram: () => createProgram, createProgramHost: () => createProgramHost, - createProperty: () => createProperty, - createPropertyAccess: () => createPropertyAccess, - createPropertyAccessChain: () => createPropertyAccessChain, - createPropertyAssignment: () => createPropertyAssignment, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, - createPropertySignature: () => createPropertySignature, - createQualifiedName: () => createQualifiedName, createQueue: () => createQueue, createRange: () => createRange, createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, - createRegularExpressionLiteral: () => createRegularExpressionLiteral, createResolutionCache: () => createResolutionCache, - createRestTypeNode: () => createRestTypeNode, - createReturn: () => createReturn, createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, createScanner: () => createScanner, createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, - createSemicolonClassElement: () => createSemicolonClassElement, createSet: () => createSet, - createSetAccessor: () => createSetAccessor, - createShorthandPropertyAssignment: () => createShorthandPropertyAssignment, createSolutionBuilder: () => createSolutionBuilder, createSolutionBuilderHost: () => createSolutionBuilderHost, createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, @@ -178176,27 +180106,10 @@ ${e.message}`; createSourceFile: () => createSourceFile, createSourceMapGenerator: () => createSourceMapGenerator, createSourceMapSource: () => createSourceMapSource, - createSpread: () => createSpread, - createSpreadAssignment: () => createSpreadAssignment, - createStatement: () => createStatement, - createStrictEquality: () => createStrictEquality, - createStrictInequality: () => createStrictInequality, - createStringLiteral: () => createStringLiteral, - createStringLiteralFromNode: () => createStringLiteralFromNode, - createSubtract: () => createSubtract, - createSuper: () => createSuper, createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, - createSwitch: () => createSwitch, createSymbolTable: () => createSymbolTable, createSymlinkCache: () => createSymlinkCache, createSystemWatchFunctions: () => createSystemWatchFunctions, - createTaggedTemplate: () => createTaggedTemplate, - createTempVariable: () => createTempVariable, - createTemplateExpression: () => createTemplateExpression, - createTemplateHead: () => createTemplateHead, - createTemplateMiddle: () => createTemplateMiddle, - createTemplateSpan: () => createTemplateSpan, - createTemplateTail: () => createTemplateTail, createTextChange: () => createTextChange, createTextChangeFromStartLength: () => createTextChangeFromStartLength, createTextChangeRange: () => createTextChangeRange, @@ -178208,36 +180121,12 @@ ${e.message}`; createTextSpanFromRange: () => createTextSpanFromRange, createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, createTextWriter: () => createTextWriter, - createThis: () => createThis, - createThisTypeNode: () => createThisTypeNode, - createThrow: () => createThrow, - createToken: () => createToken, createTokenRange: () => createTokenRange, - createTrue: () => createTrue, - createTry: () => createTry, - createTupleTypeNode: () => createTupleTypeNode, - createTypeAliasDeclaration: () => createTypeAliasDeclaration, - createTypeAssertion: () => createTypeAssertion, createTypeChecker: () => createTypeChecker, - createTypeLiteralNode: () => createTypeLiteralNode, - createTypeOf: () => createTypeOf, - createTypeOperatorNode: () => createTypeOperatorNode, - createTypeParameterDeclaration: () => createTypeParameterDeclaration, - createTypePredicateNode: () => createTypePredicateNode, - createTypePredicateNodeWithModifier: () => createTypePredicateNodeWithModifier, - createTypeQueryNode: () => createTypeQueryNode, createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, - createTypeReferenceNode: () => createTypeReferenceNode, createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap, - createUnionTypeNode: () => createUnionTypeNode, - createUniqueName: () => createUniqueName, createUnparsedSourceFile: () => createUnparsedSourceFile, - createVariableDeclaration: () => createVariableDeclaration, - createVariableDeclarationList: () => createVariableDeclarationList, - createVariableStatement: () => createVariableStatement, - createVoid: () => createVoid, - createVoidZero: () => createVoidZero, createWatchCompilerHost: () => createWatchCompilerHost2, createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, @@ -178245,10 +180134,7 @@ ${e.message}`; createWatchHost: () => createWatchHost, createWatchProgram: () => createWatchProgram, createWatchStatusReporter: () => createWatchStatusReporter, - createWhile: () => createWhile, - createWith: () => createWith, createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - createYield: () => createYield, declarationNameToString: () => declarationNameToString, decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, @@ -178295,6 +180181,7 @@ ${e.message}`; equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, equateStringsCaseSensitive: () => equateStringsCaseSensitive, equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, escapeJsxAttributeString: () => escapeJsxAttributeString, escapeLeadingUnderscores: () => escapeLeadingUnderscores, escapeNonAsciiString: () => escapeNonAsciiString, @@ -178323,6 +180210,7 @@ ${e.message}`; findAncestor: () => findAncestor, findBestPatternMatch: () => findBestPatternMatch, findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, findConfigFile: () => findConfigFile, findContainingList: () => findContainingList, findDiagnosticForNode: () => findDiagnosticForNode, @@ -178353,6 +180241,7 @@ ${e.message}`; flatMapIterator: () => flatMapIterator, flatMapToMutable: () => flatMapToMutable, flatten: () => flatten, + flattenCommaList: () => flattenCommaList, flattenDestructuringAssignment: () => flattenDestructuringAssignment, flattenDestructuringBinding: () => flattenDestructuringBinding, flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, @@ -178458,6 +180347,7 @@ ${e.message}`; getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, getDecorators: () => getDecorators, getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, getDefaultLibFileName: () => getDefaultLibFileName, getDefaultLibFilePath: () => getDefaultLibFilePath, @@ -178529,9 +180419,11 @@ ${e.message}`; getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, getFullWidth: () => getFullWidth, getFunctionFlags: () => getFunctionFlags, - getGeneratedNameForNode: () => getGeneratedNameForNode, getHeritageClause: () => getHeritageClause, getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, @@ -178543,7 +180435,9 @@ ${e.message}`; getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, getJSDocAugmentsTag: () => getJSDocAugmentsTag, getJSDocClassTag: () => getJSDocClassTag, getJSDocCommentRanges: () => getJSDocCommentRanges, @@ -178567,6 +180461,8 @@ ${e.message}`; getJSDocReturnTag: () => getJSDocReturnTag, getJSDocReturnType: () => getJSDocReturnType, getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, getJSDocTags: () => getJSDocTags, getJSDocTagsNoCache: () => getJSDocTagsNoCache, getJSDocTemplateTag: () => getJSDocTemplateTag, @@ -178621,7 +180517,6 @@ ${e.message}`; getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, - getMutableClone: () => getMutableClone, getNameForExportedSymbol: () => getNameForExportedSymbol, getNameFromIndexInfo: () => getNameFromIndexInfo, getNameFromPropertyName: () => getNameFromPropertyName, @@ -178695,6 +180590,7 @@ ${e.message}`; getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, getPreEmitDiagnostics: () => getPreEmitDiagnostics, getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, getProperties: () => getProperties, getProperty: () => getProperty, getPropertyArrayElementValue: () => getPropertyArrayElementValue, @@ -178820,6 +180716,7 @@ ${e.message}`; getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, getWatchFactory: () => getWatchFactory, group: () => group, + groupBy: () => groupBy, guessIndentation: () => guessIndentation, handleNoEmitOptions: () => handleNoEmitOptions, hasAbstractModifier: () => hasAbstractModifier, @@ -178865,12 +180762,14 @@ ${e.message}`; hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, idText: () => idText, identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, identity: () => identity, identitySourceMapConsumer: () => identitySourceMapConsumer, ignoreSourceNewlines: () => ignoreSourceNewlines, ignoredPaths: () => ignoredPaths, importDefaultHelper: () => importDefaultHelper, importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, importStarHelper: () => importStarHelper, indexOfAnyCharCode: () => indexOfAnyCharCode, indexOfNode: () => indexOfNode, @@ -178896,6 +180795,7 @@ ${e.message}`; isAliasableExpression: () => isAliasableExpression, isAmbientModule: () => isAmbientModule, isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, isAnyDirectorySeparator: () => isAnyDirectorySeparator, isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, isAnyImportOrReExport: () => isAnyImportOrReExport, @@ -178905,6 +180805,7 @@ ${e.message}`; isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, isArray: () => isArray, isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, isArrayBindingPattern: () => isArrayBindingPattern, isArrayLiteralExpression: () => isArrayLiteralExpression, @@ -178936,7 +180837,9 @@ ${e.message}`; isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, isBindableStaticNameExpression: () => isBindableStaticNameExpression, isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, isBindingPattern: () => isBindingPattern, isBlock: () => isBlock, @@ -178977,6 +180880,7 @@ ${e.message}`; isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, isCollapsedRange: () => isCollapsedRange, isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, isCommaListExpression: () => isCommaListExpression, isCommaSequence: () => isCommaSequence, isCommaToken: () => isCommaToken, @@ -179010,6 +180914,7 @@ ${e.message}`; isDecoratorTarget: () => isDecoratorTarget, isDefaultClause: () => isDefaultClause, isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, isDeleteExpression: () => isDeleteExpression, isDeleteTarget: () => isDeleteTarget, @@ -179033,6 +180938,7 @@ ${e.message}`; isEmptyBindingPattern: () => isEmptyBindingPattern, isEmptyObjectLiteral: () => isEmptyObjectLiteral, isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, isEndOfDeclarationMarker: () => isEndOfDeclarationMarker, isEntityName: () => isEntityName, isEntityNameExpression: () => isEntityNameExpression, @@ -179049,6 +180955,7 @@ ${e.message}`; isExportModifier: () => isExportModifier, isExportName: () => isExportName, isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, isExportSpecifier: () => isExportSpecifier, isExportsIdentifier: () => isExportsIdentifier, isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, @@ -179103,7 +181010,6 @@ ${e.message}`; isIdentifier: () => isIdentifier, isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, isIdentifierName: () => isIdentifierName, - isIdentifierOrPrivateIdentifier: () => isIdentifierOrPrivateIdentifier, isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, isIdentifierPart: () => isIdentifierPart, isIdentifierStart: () => isIdentifierStart, @@ -179143,6 +181049,7 @@ ${e.message}`; isInferTypeNode: () => isInferTypeNode, isInfinityOrNaNString: () => isInfinityOrNaNString, isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, isInsideJsxElement: () => isInsideJsxElement, isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, isInsideNodeModules: () => isInsideNodeModules, @@ -179192,6 +181099,8 @@ ${e.message}`; isJSDocPublicTag: () => isJSDocPublicTag, isJSDocReadonlyTag: () => isJSDocReadonlyTag, isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, isJSDocSeeTag: () => isJSDocSeeTag, isJSDocSignature: () => isJSDocSignature, isJSDocTag: () => isJSDocTag, @@ -179247,11 +181156,14 @@ ${e.message}`; isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, isLiteralTypeNode: () => isLiteralTypeNode, isLocalName: () => isLocalName, isLogicalOperator: () => isLogicalOperator, isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, isMappedTypeNode: () => isMappedTypeNode, isMemberName: () => isMemberName, isMergeDeclarationMarker: () => isMergeDeclarationMarker, @@ -179279,6 +181191,8 @@ ${e.message}`; isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, isNamedClassElement: () => isNamedClassElement, isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, isNamedExportBindings: () => isNamedExportBindings, isNamedExports: () => isNamedExports, isNamedImportBindings: () => isNamedImportBindings, @@ -179303,6 +181217,7 @@ ${e.message}`; isNodeModulesDirectory: () => isNodeModulesDirectory, isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, isNonGlobalDeclaration: () => isNonGlobalDeclaration, isNonNullAccess: () => isNonNullAccess, @@ -179371,6 +181286,7 @@ ${e.message}`; isPropertyName: () => isPropertyName, isPropertyNameLiteral: () => isPropertyNameLiteral, isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, isPrototypeAccess: () => isPrototypeAccess, isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, isPunctuation: () => isPunctuation, @@ -179482,7 +181398,6 @@ ${e.message}`; isTupleTypeNode: () => isTupleTypeNode, isTypeAlias: () => isTypeAlias, isTypeAliasDeclaration: () => isTypeAliasDeclaration, - isTypeAssertion: () => isTypeAssertion, isTypeAssertionExpression: () => isTypeAssertionExpression, isTypeDeclaration: () => isTypeDeclaration, isTypeElement: () => isTypeElement, @@ -179492,8 +181407,9 @@ ${e.message}`; isTypeLiteralNode: () => isTypeLiteralNode, isTypeNode: () => isTypeNode, isTypeNodeKind: () => isTypeNodeKind, - isTypeNodeOrTypeParameterDeclaration: () => isTypeNodeOrTypeParameterDeclaration, isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, isTypeOperatorNode: () => isTypeOperatorNode, isTypeParameterDeclaration: () => isTypeParameterDeclaration, @@ -179568,6 +181484,7 @@ ${e.message}`; maybeBind: () => maybeBind, maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, memoize: () => memoize, + memoizeCached: () => memoizeCached, memoizeOne: () => memoizeOne, memoizeWeak: () => memoizeWeak, metadataHelper: () => metadataHelper, @@ -179593,6 +181510,7 @@ ${e.message}`; mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, noTransformers: () => noTransformers, @@ -179686,6 +181604,7 @@ ${e.message}`; programContainsEsModules: () => programContainsEsModules, programContainsModules: () => programContainsModules, projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, propertyNamePart: () => propertyNamePart, pseudoBigIntToString: () => pseudoBigIntToString, punctuationPart: () => punctuationPart, @@ -179750,10 +181669,12 @@ ${e.message}`; returnTrue: () => returnTrue, returnUndefined: () => returnUndefined, returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, sameFlatMap: () => sameFlatMap, sameMap: () => sameMap, sameMapping: () => sameMapping, scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, scanner: () => scanner, screenStartingMessageCodes: () => screenStartingMessageCodes, semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, @@ -179765,7 +181686,12 @@ ${e.message}`; setConstantValue: () => setConstantValue, setEachParent: () => setEachParent, setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, setModuleDefaultHelper: () => setModuleDefaultHelper, setNodeFlags: () => setNodeFlags, @@ -179773,6 +181699,7 @@ ${e.message}`; setOriginalNode: () => setOriginalNode, setParent: () => setParent, setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, setResolvedModule: () => setResolvedModule, setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective, setSnippetElement: () => setSnippetElement, @@ -179813,6 +181740,7 @@ ${e.message}`; skipTrivia: () => skipTrivia, skipTypeChecking: () => skipTypeChecking, skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, sliceAfter: () => sliceAfter, some: () => some, sort: () => sort, @@ -179907,6 +181835,7 @@ ${e.message}`; transformES2020: () => transformES2020, transformES2021: () => transformES2021, transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, transformESNext: () => transformESNext, transformGenerators: () => transformGenerators, transformJsx: () => transformJsx, @@ -179933,6 +181862,7 @@ ${e.message}`; tryGetDirectories: () => tryGetDirectories, tryGetExtensionFromPath: () => tryGetExtensionFromPath2, tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, @@ -179967,148 +181897,14 @@ ${e.message}`; unreachableCodeIsError: () => unreachableCodeIsError, unusedLabelIsError: () => unusedLabelIsError, unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, - updateArrayBindingPattern: () => updateArrayBindingPattern, - updateArrayLiteral: () => updateArrayLiteral, - updateArrayTypeNode: () => updateArrayTypeNode, - updateArrowFunction: () => updateArrowFunction, - updateAsExpression: () => updateAsExpression, - updateAwait: () => updateAwait, - updateBinary: () => updateBinary, - updateBindingElement: () => updateBindingElement, - updateBlock: () => updateBlock, - updateBreak: () => updateBreak, - updateBundle: () => updateBundle, - updateCall: () => updateCall, - updateCallChain: () => updateCallChain, - updateCallSignature: () => updateCallSignature, - updateCaseBlock: () => updateCaseBlock, - updateCaseClause: () => updateCaseClause, - updateCatchClause: () => updateCatchClause, - updateClassDeclaration: () => updateClassDeclaration, - updateClassExpression: () => updateClassExpression, - updateCommaList: () => updateCommaList, - updateComputedPropertyName: () => updateComputedPropertyName, - updateConditional: () => updateConditional, - updateConditionalTypeNode: () => updateConditionalTypeNode, - updateConstructSignature: () => updateConstructSignature, - updateConstructor: () => updateConstructor, - updateConstructorTypeNode: () => updateConstructorTypeNode, - updateContinue: () => updateContinue, - updateDecorator: () => updateDecorator, - updateDefaultClause: () => updateDefaultClause, - updateDelete: () => updateDelete, - updateDo: () => updateDo, - updateElementAccess: () => updateElementAccess, - updateElementAccessChain: () => updateElementAccessChain, - updateEnumDeclaration: () => updateEnumDeclaration, - updateEnumMember: () => updateEnumMember, updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, - updateExportAssignment: () => updateExportAssignment, - updateExportDeclaration: () => updateExportDeclaration, - updateExportSpecifier: () => updateExportSpecifier, - updateExpressionStatement: () => updateExpressionStatement, - updateExpressionWithTypeArguments: () => updateExpressionWithTypeArguments, - updateExternalModuleReference: () => updateExternalModuleReference, - updateFor: () => updateFor, - updateForIn: () => updateForIn, - updateForOf: () => updateForOf, - updateFunctionDeclaration: () => updateFunctionDeclaration, - updateFunctionExpression: () => updateFunctionExpression, - updateFunctionTypeNode: () => updateFunctionTypeNode, - updateGetAccessor: () => updateGetAccessor, - updateHeritageClause: () => updateHeritageClause, - updateIf: () => updateIf, - updateImportClause: () => updateImportClause, - updateImportDeclaration: () => updateImportDeclaration, - updateImportEqualsDeclaration: () => updateImportEqualsDeclaration, - updateImportSpecifier: () => updateImportSpecifier, - updateImportTypeNode: () => updateImportTypeNode, - updateIndexSignature: () => updateIndexSignature, - updateIndexedAccessTypeNode: () => updateIndexedAccessTypeNode, - updateInferTypeNode: () => updateInferTypeNode, - updateInterfaceDeclaration: () => updateInterfaceDeclaration, - updateIntersectionTypeNode: () => updateIntersectionTypeNode, - updateJsxAttribute: () => updateJsxAttribute, - updateJsxAttributes: () => updateJsxAttributes, - updateJsxClosingElement: () => updateJsxClosingElement, - updateJsxElement: () => updateJsxElement, - updateJsxExpression: () => updateJsxExpression, - updateJsxFragment: () => updateJsxFragment, - updateJsxOpeningElement: () => updateJsxOpeningElement, - updateJsxSelfClosingElement: () => updateJsxSelfClosingElement, - updateJsxSpreadAttribute: () => updateJsxSpreadAttribute, - updateJsxText: () => updateJsxText, - updateLabel: () => updateLabel, updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, - updateLiteralTypeNode: () => updateLiteralTypeNode, - updateMappedTypeNode: () => updateMappedTypeNode, - updateMetaProperty: () => updateMetaProperty, - updateMethod: () => updateMethod, - updateMethodSignature: () => updateMethodSignature, updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updateModuleBlock: () => updateModuleBlock, - updateModuleDeclaration: () => updateModuleDeclaration, - updateNamedExports: () => updateNamedExports, - updateNamedImports: () => updateNamedImports, - updateNamespaceExport: () => updateNamespaceExport, - updateNamespaceExportDeclaration: () => updateNamespaceExportDeclaration, - updateNamespaceImport: () => updateNamespaceImport, - updateNew: () => updateNew, - updateNonNullChain: () => updateNonNullChain, - updateNonNullExpression: () => updateNonNullExpression, - updateObjectBindingPattern: () => updateObjectBindingPattern, - updateObjectLiteral: () => updateObjectLiteral, - updateOptionalTypeNode: () => updateOptionalTypeNode, updatePackageJsonWatch: () => updatePackageJsonWatch, - updateParameter: () => updateParameter, - updateParen: () => updateParen, - updateParenthesizedType: () => updateParenthesizedType, - updatePartiallyEmittedExpression: () => updatePartiallyEmittedExpression, - updatePostfix: () => updatePostfix, - updatePrefix: () => updatePrefix, - updateProperty: () => updateProperty, - updatePropertyAccess: () => updatePropertyAccess, - updatePropertyAccessChain: () => updatePropertyAccessChain, - updatePropertyAssignment: () => updatePropertyAssignment, - updatePropertySignature: () => updatePropertySignature, - updateQualifiedName: () => updateQualifiedName, updateResolutionField: () => updateResolutionField, - updateRestTypeNode: () => updateRestTypeNode, - updateReturn: () => updateReturn, - updateSetAccessor: () => updateSetAccessor, updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, - updateShorthandPropertyAssignment: () => updateShorthandPropertyAssignment, updateSourceFile: () => updateSourceFile, - updateSourceFileNode: () => updateSourceFileNode, - updateSpread: () => updateSpread, - updateSpreadAssignment: () => updateSpreadAssignment, - updateStatement: () => updateStatement, - updateSwitch: () => updateSwitch, - updateTaggedTemplate: () => updateTaggedTemplate, - updateTemplateExpression: () => updateTemplateExpression, - updateTemplateSpan: () => updateTemplateSpan, - updateThrow: () => updateThrow, - updateTry: () => updateTry, - updateTupleTypeNode: () => updateTupleTypeNode, - updateTypeAliasDeclaration: () => updateTypeAliasDeclaration, - updateTypeAssertion: () => updateTypeAssertion, - updateTypeLiteralNode: () => updateTypeLiteralNode, - updateTypeOf: () => updateTypeOf, - updateTypeOperatorNode: () => updateTypeOperatorNode, - updateTypeParameterDeclaration: () => updateTypeParameterDeclaration, - updateTypePredicateNode: () => updateTypePredicateNode, - updateTypePredicateNodeWithModifier: () => updateTypePredicateNodeWithModifier, - updateTypeQueryNode: () => updateTypeQueryNode, - updateTypeReferenceNode: () => updateTypeReferenceNode, - updateUnionTypeNode: () => updateUnionTypeNode, - updateVariableDeclaration: () => updateVariableDeclaration, - updateVariableDeclarationList: () => updateVariableDeclarationList, - updateVariableStatement: () => updateVariableStatement, - updateVoid: () => updateVoid, updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, - updateWhile: () => updateWhile, - updateWith: () => updateWith, - updateYield: () => updateYield, usesExtensionsOnImports: () => usesExtensionsOnImports, usingSingleLineStringWriter: () => usingSingleLineStringWriter, utf16EncodeAsString: () => utf16EncodeAsString, @@ -180117,6 +181913,7 @@ ${e.message}`; version: () => version, versionMajorMinor: () => versionMajorMinor, visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, visitEachChild: () => visitEachChild, visitFunctionBody: () => visitFunctionBody, visitIterationBody: () => visitIterationBody, @@ -180125,6 +181922,8 @@ ${e.message}`; visitNodes: () => visitNodes2, visitParameterList: () => visitParameterList, walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 107407bd58e53..c9eeb8a00a1a5 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -348,15 +348,15 @@ declare namespace ts { ShorthandPropertyAssignment = 300, SpreadAssignment = 301, EnumMember = 302, - UnparsedPrologue = 303, - UnparsedPrepend = 304, - UnparsedText = 305, - UnparsedInternalText = 306, - UnparsedSyntheticReference = 307, + /** @deprecated */ UnparsedPrologue = 303, + /** @deprecated */ UnparsedPrepend = 304, + /** @deprecated */ UnparsedText = 305, + /** @deprecated */ UnparsedInternalText = 306, + /** @deprecated */ UnparsedSyntheticReference = 307, SourceFile = 308, Bundle = 309, - UnparsedSource = 310, - InputFiles = 311, + /** @deprecated */ UnparsedSource = 310, + /** @deprecated */ InputFiles = 311, JSDocTypeExpression = 312, JSDocNameReference = 313, JSDocMemberName = 314, @@ -400,14 +400,15 @@ declare namespace ts { JSDocSeeTag = 350, JSDocPropertyTag = 351, JSDocThrowsTag = 352, - SyntaxList = 353, - NotEmittedStatement = 354, - PartiallyEmittedExpression = 355, - CommaListExpression = 356, - MergeDeclarationMarker = 357, - EndOfDeclarationMarker = 358, - SyntheticReferenceExpression = 359, - Count = 360, + JSDocSatisfiesTag = 353, + SyntaxList = 354, + NotEmittedStatement = 355, + PartiallyEmittedExpression = 356, + CommaListExpression = 357, + MergeDeclarationMarker = 358, + EndOfDeclarationMarker = 359, + SyntheticReferenceExpression = 360, + Count = 361, FirstAssignment = 63, LastAssignment = 78, FirstCompoundAssignment = 64, @@ -436,14 +437,14 @@ declare namespace ts { LastStatement = 256, FirstNode = 163, FirstJSDocNode = 312, - LastJSDocNode = 352, + LastJSDocNode = 353, FirstJSDocTagNode = 330, - LastJSDocTagNode = 352 + LastJSDocTagNode = 353 } type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; - type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; + type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword; type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; @@ -540,30 +541,6 @@ declare namespace ts { getLastToken(sourceFile?: SourceFile): Node | undefined; forEachChild(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray) => T | undefined): T | undefined; } - interface Node { - /** - * @deprecated `decorators` has been removed from `Node` and merged with `modifiers` on the `Node` subtypes that support them. - * Use `ts.canHaveDecorators()` to test whether a `Node` can have decorators. - * Use `ts.getDecorators()` to get the decorators of a `Node`. - * - * For example: - * ```ts - * const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined; - * ``` - */ - readonly decorators?: undefined; - /** - * @deprecated `modifiers` has been removed from `Node` and moved to the `Node` subtypes that support them. - * Use `ts.canHaveModifiers()` to test whether a `Node` can have modifiers. - * Use `ts.getModifiers()` to get the modifiers of a `Node`. - * - * For example: - * ```ts - * const modifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined; - * ``` - */ - readonly modifiers?: NodeArray | undefined; - } interface JSDocContainer extends Node { _jsdocContainerBrand: any; } @@ -595,6 +572,9 @@ declare namespace ts { type ExclamationToken = PunctuationToken; type ColonToken = PunctuationToken; type EqualsToken = PunctuationToken; + type AmpersandAmpersandEqualsToken = PunctuationToken; + type BarBarEqualsToken = PunctuationToken; + type QuestionQuestionEqualsToken = PunctuationToken; type AsteriskToken = PunctuationToken; type EqualsGreaterThanToken = PunctuationToken; type PlusToken = PunctuationToken; @@ -606,10 +586,6 @@ declare namespace ts { type AssertKeyword = KeywordToken; type AwaitKeyword = KeywordToken; type CaseKeyword = KeywordToken; - /** @deprecated Use `AwaitKeyword` instead. */ - type AwaitKeywordToken = AwaitKeyword; - /** @deprecated Use `AssertsKeyword` instead. */ - type AssertsToken = AssertsKeyword; interface ModifierToken extends KeywordToken { } type AbstractKeyword = ModifierToken; @@ -627,8 +603,6 @@ declare namespace ts { type OutKeyword = ModifierToken; type OverrideKeyword = ModifierToken; type StaticKeyword = ModifierToken; - /** @deprecated Use `ReadonlyKeyword` instead. */ - type ReadonlyToken = ReadonlyKeyword; type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword; type ModifierLike = Modifier | Decorator; type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword; @@ -649,12 +623,16 @@ declare namespace ts { * Text of identifier, but if the identifier begins with two underscores, this will begin with three. */ readonly escapedText: __String; - readonly originalKeywordKind?: SyntaxKind; - isInJSDocNamespace?: boolean; } interface Identifier { readonly text: string; } + interface Identifier { + /** @deprecated Use `idKeyword(identifier)` instead. */ + readonly originalKeywordKind?: SyntaxKind; + /** @deprecated Use `.parent` or the surrounding context to determine this instead. */ + readonly isInJSDocNamespace?: boolean; + } interface TransientIdentifier extends Identifier { resolvedSymbol: Symbol; } @@ -757,10 +735,6 @@ declare namespace ts { readonly questionToken?: QuestionToken; readonly type?: TypeNode; } - interface PropertySignature { - /** @deprecated A property signature cannot have an initializer */ - readonly initializer?: Expression | undefined; - } interface PropertyDeclaration extends ClassElement, JSDocContainer { readonly kind: SyntaxKind.PropertyDeclaration; readonly parent: ClassLikeDeclaration; @@ -786,12 +760,6 @@ declare namespace ts { readonly name: PropertyName; readonly initializer: Expression; } - interface PropertyAssignment { - /** @deprecated A property assignment cannot have a question token */ - readonly questionToken?: QuestionToken | undefined; - /** @deprecated A property assignment cannot have an exclamation token */ - readonly exclamationToken?: ExclamationToken | undefined; - } interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer { readonly kind: SyntaxKind.ShorthandPropertyAssignment; readonly parent: ObjectLiteralExpression; @@ -799,14 +767,6 @@ declare namespace ts { readonly equalsToken?: EqualsToken; readonly objectAssignmentInitializer?: Expression; } - interface ShorthandPropertyAssignment { - /** @deprecated A shorthand property assignment cannot have modifiers */ - readonly modifiers?: NodeArray | undefined; - /** @deprecated A shorthand property assignment cannot have a question token */ - readonly questionToken?: QuestionToken | undefined; - /** @deprecated A shorthand property assignment cannot have an exclamation token */ - readonly exclamationToken?: ExclamationToken | undefined; - } interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer { readonly kind: SyntaxKind.SpreadAssignment; readonly parent: ObjectLiteralExpression; @@ -845,7 +805,7 @@ declare namespace ts { type FunctionLike = SignatureDeclaration; interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement, LocalsContainer { readonly kind: SyntaxKind.FunctionDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name?: Identifier; readonly body?: FunctionBody; } @@ -865,7 +825,7 @@ declare namespace ts { interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer, LocalsContainer { readonly kind: SyntaxKind.Constructor; readonly parent: ClassLikeDeclaration; - readonly modifiers?: NodeArray | undefined; + readonly modifiers?: NodeArray | undefined; readonly body?: FunctionBody | undefined; } /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ @@ -891,7 +851,7 @@ declare namespace ts { interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement, LocalsContainer { readonly kind: SyntaxKind.IndexSignature; readonly parent: ObjectTypeDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly type: TypeNode; } interface ClassStaticBlockDeclaration extends ClassElement, JSDocContainer, LocalsContainer { @@ -929,10 +889,6 @@ declare namespace ts { interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer { readonly kind: SyntaxKind.FunctionType; } - interface FunctionTypeNode { - /** @deprecated A function type cannot have modifiers */ - readonly modifiers?: NodeArray | undefined; - } interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer { readonly kind: SyntaxKind.ConstructorType; readonly modifiers?: NodeArray; @@ -1474,7 +1430,7 @@ declare namespace ts { interface DebuggerStatement extends Statement, FlowContainer { readonly kind: SyntaxKind.DebuggerStatement; } - interface MissingDeclaration extends DeclarationStatement { + interface MissingDeclaration extends DeclarationStatement, PrimaryExpression { readonly kind: SyntaxKind.MissingDeclaration; readonly name?: Identifier; } @@ -1485,7 +1441,7 @@ declare namespace ts { } interface VariableStatement extends Statement, FlowContainer { readonly kind: SyntaxKind.VariableStatement; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly declarationList: VariableDeclarationList; } interface ExpressionStatement extends Statement, FlowContainer { @@ -1622,7 +1578,7 @@ declare namespace ts { } interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.InterfaceDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: Identifier; readonly typeParameters?: NodeArray; readonly heritageClauses?: NodeArray; @@ -1636,7 +1592,7 @@ declare namespace ts { } interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer, LocalsContainer { readonly kind: SyntaxKind.TypeAliasDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: Identifier; readonly typeParameters?: NodeArray; readonly type: TypeNode; @@ -1649,7 +1605,7 @@ declare namespace ts { } interface EnumDeclaration extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.EnumDeclaration; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: Identifier; readonly members: NodeArray; } @@ -1658,7 +1614,7 @@ declare namespace ts { interface ModuleDeclaration extends DeclarationStatement, JSDocContainer, LocalsContainer { readonly kind: SyntaxKind.ModuleDeclaration; readonly parent: ModuleBody | SourceFile; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: ModuleName; readonly body?: ModuleBody | JSDocNamespaceDeclaration; } @@ -1686,7 +1642,7 @@ declare namespace ts { interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.ImportEqualsDeclaration; readonly parent: SourceFile | ModuleBlock; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly name: Identifier; readonly isTypeOnly: boolean; readonly moduleReference: ModuleReference; @@ -1699,7 +1655,7 @@ declare namespace ts { interface ImportDeclaration extends Statement { readonly kind: SyntaxKind.ImportDeclaration; readonly parent: SourceFile | ModuleBlock; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly importClause?: ImportClause; /** If this is not a StringLiteral it will be a grammar error. */ readonly moduleSpecifier: Expression; @@ -1744,7 +1700,7 @@ declare namespace ts { interface ExportDeclaration extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.ExportDeclaration; readonly parent: SourceFile | ModuleBlock; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly isTypeOnly: boolean; /** Will not be assigned in the case of `export * from "foo";` */ readonly exportClause?: NamedExportBindings; @@ -1778,8 +1734,8 @@ declare namespace ts { readonly name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; - type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier; - type TypeOnlyAliasDeclaration = ImportClause & { + type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier | ExportDeclaration | NamespaceExport; + type TypeOnlyImportDeclaration = ImportClause & { readonly isTypeOnly: true; readonly name: Identifier; } | ImportEqualsDeclaration & { @@ -1796,7 +1752,8 @@ declare namespace ts { readonly isTypeOnly: true; }; }; - }) | ExportSpecifier & ({ + }); + type TypeOnlyExportDeclaration = ExportSpecifier & ({ readonly isTypeOnly: true; } | { readonly parent: NamedExports & { @@ -1804,7 +1761,14 @@ declare namespace ts { readonly isTypeOnly: true; }; }; - }); + }) | ExportDeclaration & { + readonly isTypeOnly: true; + } | NamespaceExport & { + readonly parent: ExportDeclaration & { + readonly isTypeOnly: true; + }; + }; + type TypeOnlyAliasDeclaration = TypeOnlyImportDeclaration | TypeOnlyExportDeclaration; /** * This is either an `export =` or an `export default` declaration. * Unless `isExportEquals` is set, this node was parsed as an `export default`. @@ -1812,7 +1776,7 @@ declare namespace ts { interface ExportAssignment extends DeclarationStatement, JSDocContainer { readonly kind: SyntaxKind.ExportAssignment; readonly parent: SourceFile; - readonly modifiers?: NodeArray; + readonly modifiers?: NodeArray; readonly isExportEquals?: boolean; readonly expression: Expression; } @@ -2032,6 +1996,10 @@ declare namespace ts { /** If true, then this type literal represents an *array* of its type. */ readonly isArrayType: boolean; } + interface JSDocSatisfiesTag extends JSDocTag { + readonly kind: SyntaxKind.JSDocSatisfiesTag; + readonly typeExpression: JSDocTypeExpression; + } enum FlowFlags { Unreachable = 1, Start = 2, @@ -2157,9 +2125,10 @@ declare namespace ts { } interface Bundle extends Node { readonly kind: SyntaxKind.Bundle; - readonly prepends: readonly (InputFiles | UnparsedSource)[]; + /** @deprecated */ readonly prepends: readonly (InputFiles | UnparsedSource)[]; readonly sourceFiles: readonly SourceFile[]; } + /** @deprecated */ interface InputFiles extends Node { readonly kind: SyntaxKind.InputFiles; javascriptPath?: string; @@ -2171,6 +2140,7 @@ declare namespace ts { declarationMapPath?: string; declarationMapText?: string; } + /** @deprecated */ interface UnparsedSource extends Node { readonly kind: SyntaxKind.UnparsedSource; fileName: string; @@ -2186,28 +2156,35 @@ declare namespace ts { readonly syntheticReferences?: readonly UnparsedSyntheticReference[]; readonly texts: readonly UnparsedSourceText[]; } + /** @deprecated */ type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike; + /** @deprecated */ type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference; + /** @deprecated */ interface UnparsedSection extends Node { readonly kind: SyntaxKind; readonly parent: UnparsedSource; readonly data?: string; } + /** @deprecated */ interface UnparsedPrologue extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrologue; readonly parent: UnparsedSource; readonly data: string; } + /** @deprecated */ interface UnparsedPrepend extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrepend; readonly parent: UnparsedSource; readonly data: string; readonly texts: readonly UnparsedTextLike[]; } + /** @deprecated */ interface UnparsedTextLike extends UnparsedSection { readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText; readonly parent: UnparsedSource; } + /** @deprecated */ interface UnparsedSyntheticReference extends UnparsedSection { readonly kind: SyntaxKind.UnparsedSyntheticReference; readonly parent: UnparsedSource; @@ -2348,9 +2325,7 @@ declare namespace ts { DiagnosticsPresent_OutputsSkipped = 1, DiagnosticsPresent_OutputsGenerated = 2, InvalidProject_OutputsSkipped = 3, - ProjectReferenceCycle_OutputsSkipped = 4, - /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */ - ProjectReferenceCycle_OutputsSkupped = 4 + ProjectReferenceCycle_OutputsSkipped = 4 } interface EmitResult { emitSkipped: boolean; @@ -2480,8 +2455,6 @@ declare namespace ts { OmitThisParameter = 33554432, AllowThisInObjectLiteral = 32768, AllowQualifiedNameInPlaceOfIdentifier = 65536, - /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ - AllowQualifedNameInPlaceOfIdentifier = 65536, AllowAnonymousIdentifier = 131072, AllowEmptyUnionOrIntersection = 262144, AllowEmptyTuple = 524288, @@ -2516,7 +2489,6 @@ declare namespace ts { InElementType = 2097152, InFirstTypeArgument = 4194304, InTypeAlias = 8388608, - /** @deprecated */ WriteOwnNameForAnyLike = 0, NodeBuilderFlagsMask = 848330091 } enum SymbolFormatFlags { @@ -2972,8 +2944,6 @@ declare namespace ts { PriorityImpliesCombination = 416, Circularity = -1 } - /** @deprecated Use FileExtensionInfo instead. */ - type JsFileExtensionInfo = FileExtensionInfo; interface FileExtensionInfo { extension: string; isMixedContent: boolean; @@ -3181,6 +3151,7 @@ declare namespace ts { types?: string[]; /** Paths used to compute primary types search locations */ typeRoots?: string[]; + verbatimModuleSyntax?: boolean; esModuleInterop?: boolean; useDefineForClassFields?: boolean; [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined; @@ -3195,11 +3166,6 @@ declare namespace ts { [option: string]: CompilerOptionsValue | undefined; } interface TypeAcquisition { - /** - * @deprecated typingOptions.enableAutoDiscovery - * Use typeAcquisition.enable instead. - */ - enableAutoDiscovery?: boolean; enable?: boolean; include?: string[]; exclude?: string[]; @@ -3575,8 +3541,8 @@ declare namespace ts { updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature; createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; - createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; - updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + createConstructorDeclaration(modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; + updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; @@ -3585,8 +3551,8 @@ declare namespace ts { updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): CallSignatureDeclaration; createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; - createIndexSignature(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - updateIndexSignature(node: IndexSignatureDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + createIndexSignature(modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + updateIndexSignature(node: IndexSignatureDeclaration, modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; createClassStaticBlockDeclaration(body: Block): ClassStaticBlockDeclaration; @@ -3722,8 +3688,8 @@ declare namespace ts { createSemicolonClassElement(): SemicolonClassElement; createBlock(statements: readonly Statement[], multiLine?: boolean): Block; updateBlock(node: Block, statements: readonly Statement[]): Block; - createVariableStatement(modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement; - updateVariableStatement(node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement; + createVariableStatement(modifiers: readonly ModifierLike[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement; + updateVariableStatement(node: VariableStatement, modifiers: readonly ModifierLike[] | undefined, declarationList: VariableDeclarationList): VariableStatement; createEmptyStatement(): EmptyStatement; createExpressionStatement(expression: Expression): ExpressionStatement; updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; @@ -3764,24 +3730,24 @@ declare namespace ts { updateFunctionDeclaration(node: FunctionDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; createClassDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; updateClassDeclaration(node: ClassDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; - createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; - updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; - createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; - updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; - createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration; - updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration; - createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; - updateModuleDeclaration(node: ModuleDeclaration, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; + createInterfaceDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; + updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; + createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; + updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; + createEnumDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration; + updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration; + createModuleDeclaration(modifiers: readonly ModifierLike[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; + updateModuleDeclaration(node: ModuleDeclaration, modifiers: readonly ModifierLike[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; createModuleBlock(statements: readonly Statement[]): ModuleBlock; updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock; createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock; updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock; createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration; updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration; - createImportEqualsDeclaration(modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - createImportDeclaration(modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration; - updateImportDeclaration(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; + createImportEqualsDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; + createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration; + updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; createAssertClause(elements: NodeArray, multiLine?: boolean): AssertClause; @@ -3798,10 +3764,10 @@ declare namespace ts { updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports; createImportSpecifier(isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; - createExportAssignment(modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; - updateExportAssignment(node: ExportAssignment, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment; - createExportDeclaration(modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration; - updateExportDeclaration(node: ExportDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration; + createExportAssignment(modifiers: readonly ModifierLike[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; + updateExportAssignment(node: ExportAssignment, modifiers: readonly ModifierLike[] | undefined, expression: Expression): ExportAssignment; + createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration; + updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration; createNamedExports(elements: readonly ExportSpecifier[]): NamedExports; updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports; createExportSpecifier(isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; @@ -3878,12 +3844,14 @@ declare namespace ts { updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | NodeArray | undefined): JSDocReadonlyTag; createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray): JSDocUnknownTag; updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray | undefined): JSDocUnknownTag; - createJSDocDeprecatedTag(tagName: Identifier, comment?: string | NodeArray): JSDocDeprecatedTag; - updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string | NodeArray): JSDocDeprecatedTag; - createJSDocOverrideTag(tagName: Identifier, comment?: string | NodeArray): JSDocOverrideTag; - updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment?: string | NodeArray): JSDocOverrideTag; + createJSDocDeprecatedTag(tagName: Identifier | undefined, comment?: string | NodeArray): JSDocDeprecatedTag; + updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier | undefined, comment?: string | NodeArray): JSDocDeprecatedTag; + createJSDocOverrideTag(tagName: Identifier | undefined, comment?: string | NodeArray): JSDocOverrideTag; + updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier | undefined, comment?: string | NodeArray): JSDocOverrideTag; createJSDocThrowsTag(tagName: Identifier, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray): JSDocThrowsTag; updateJSDocThrowsTag(node: JSDocThrowsTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray | undefined): JSDocThrowsTag; + createJSDocSatisfiesTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray): JSDocSatisfiesTag; + updateJSDocSatisfiesTag(node: JSDocSatisfiesTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray | undefined): JSDocSatisfiesTag; createJSDocText(text: string): JSDocText; updateJSDocText(node: JSDocText, text: string): JSDocText; createJSDocComment(comment?: string | NodeArray | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc; @@ -3933,8 +3901,10 @@ declare namespace ts { updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; createCommaListExpression(elements: readonly Expression[]): CommaListExpression; updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression; - createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; - updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + createBundle(sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + updateBundle(node: Bundle, sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; createComma(left: Expression, right: Expression): BinaryExpression; createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; createAssignment(left: Expression, right: Expression): AssignmentExpression; @@ -3977,179 +3947,6 @@ declare namespace ts { createExternalModuleExport(exportName: Identifier): ExportDeclaration; restoreOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression; } - interface NodeFactory { - /** @deprecated Use the overload that accepts 'modifiers' */ - createConstructorTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode; - /** @deprecated Use the overload that accepts 'modifiers' */ - updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode; - } - interface NodeFactory { - createImportTypeNode(argument: TypeNode, assertions?: ImportTypeAssertionContainer, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; - /** @deprecated Use the overload that accepts 'assertions' */ - createImportTypeNode(argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; - /** @deprecated Use the overload that accepts 'assertions' */ - updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode; - } - interface NodeFactory { - /** @deprecated Use the overload that accepts 'modifiers' */ - createTypeParameterDeclaration(name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration; - /** @deprecated Use the overload that accepts 'modifiers' */ - updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; - } - interface NodeFactory { - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createParameterDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateParameterDeclaration(node: ParameterDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createPropertyDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updatePropertyDeclaration(node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createMethodDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateMethodDeclaration(node: MethodDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; - /** - * @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter. - */ - createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; - /** - * @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createGetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createSetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - /** - * @deprecated Decorators and modifiers are no longer supported for this function. Callers should use an overload that does not accept the `decorators` and `modifiers` parameters. - */ - updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - /** - * @deprecated Decorators and modifiers are no longer supported for this function. Callers should use an overload that does not accept the `decorators` and `modifiers` parameters. - */ - createClassStaticBlockDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, body: Block): ClassStaticBlockDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateClassStaticBlockDeclaration(node: ClassStaticBlockDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, body: Block): ClassStaticBlockDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createClassExpression(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateClassExpression(node: ClassExpression, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createFunctionDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateFunctionDeclaration(node: FunctionDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - createClassDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; - /** - * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateClassDeclaration(node: ClassDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createInterfaceDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateInterfaceDeclaration(node: InterfaceDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createTypeAliasDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createEnumDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateEnumDeclaration(node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createModuleDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateModuleDeclaration(node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createImportEqualsDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createImportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateImportDeclaration(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createExportAssignment(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateExportAssignment(node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration; - /** - * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter. - */ - updateExportDeclaration(node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration; - } interface CoreTransformationContext { readonly factory: NodeFactory; /** Gets the compiler options supplied to the transformer. */ @@ -4246,16 +4043,39 @@ declare namespace ts { /** * A function that accepts and possibly transforms a node. */ - type Visitor = (node: Node) => VisitResult; + type Visitor = (node: TIn) => VisitResult; + /** + * A function that walks a node using the given visitor, lifting node arrays into single nodes, + * returning an node which satisfies the test. + * + * - If the input node is undefined, then the output is undefined. + * - If the visitor returns undefined, then the output is undefined. + * - If the output node is not undefined, then it will satisfy the test function. + * - In order to obtain a return type that is more specific than `Node`, a test + * function _must_ be provided, and that function must be a type predicate. + * + * For the canonical implementation of this type, @see {visitNode}. + */ interface NodeVisitor { - (nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T; - (nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined; + (node: TIn, visitor: Visitor, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined); + (node: TIn, visitor: Visitor, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined); } + /** + * A function that walks a node array using the given visitor, returning an array whose contents satisfy the test. + * + * - If the input node array is undefined, the output is undefined. + * - If the visitor can return undefined, the node it visits in the array will be reused. + * - If the output node array is not undefined, then its contents will satisfy the test. + * - In order to obtain a return type that is more specific than `NodeArray`, a test + * function _must_ be provided, and that function must be a type predicate. + * + * For the canonical implementation of this type, @see {visitNodes}. + */ interface NodesVisitor { - (nodes: NodeArray, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray; - (nodes: NodeArray | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | undefined; + | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray | (TInArray & undefined); + | undefined>(nodes: TInArray, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | (TInArray & undefined); } - type VisitResult = T | readonly T[] | undefined; + type VisitResult = T | readonly Node[]; interface Printer { /** * Print a node and its subtree as-is, without any emit transformations. @@ -4455,6 +4275,11 @@ declare namespace ts { readonly allowRenameOfImportPath?: boolean; readonly autoImportFileExcludePatterns?: string[]; readonly organizeImportsIgnoreCase?: "auto" | boolean; + readonly organizeImportsCollation?: "ordinal" | "unicode"; + readonly organizeImportsLocale?: string; + readonly organizeImportsNumericCollation?: boolean; + readonly organizeImportsAccentCollation?: boolean; + readonly organizeImportsCaseFirst?: "upper" | "lower" | false; } /** Represents a bigint literal value without requiring bigint support */ interface PseudoBigInt { @@ -4469,6 +4294,7 @@ declare namespace ts { } type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind, modifiedTime?: Date) => void; type DirectoryWatcherCallback = (fileName: string) => void; + type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"; interface System { args: string[]; newLine: string; @@ -4527,8 +4353,8 @@ declare namespace ts { function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; - function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined; - function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined; + function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined; + function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined; function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; /** Optionally, get the shebang */ @@ -4607,7 +4433,7 @@ declare namespace ts { function getTypeParameterOwner(d: Declaration): Declaration | undefined; function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration; function isEmptyBindingPattern(node: BindingName): node is BindingPattern; - function isEmptyBindingElement(node: BindingElement): boolean; + function isEmptyBindingElement(node: BindingElement | ArrayBindingElement): boolean; function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration; function getCombinedModifierFlags(node: Declaration): ModifierFlags; function getCombinedNodeFlags(node: Node): NodeFlags; @@ -4624,7 +4450,7 @@ declare namespace ts { function getOriginalNode(node: Node): Node; function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; function getOriginalNode(node: Node | undefined): Node | undefined; - function getOriginalNode(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined; + function getOriginalNode(node: Node | undefined, nodeTest: (node: Node) => node is T): T | undefined; /** * Iterates through the parent chain of a node and performs the callback on each parent until the callback * returns a truthy value, then returns that value. @@ -4664,6 +4490,11 @@ declare namespace ts { */ function unescapeLeadingUnderscores(identifier: __String): string; function idText(identifierOrPrivateName: Identifier | PrivateIdentifier): string; + /** + * If the text of an Identifier matches a keyword (including contextual and TypeScript-specific keywords), returns the + * SyntaxKind for the matching keyword. + */ + function identifierToKeywordKind(node: Identifier): KeywordSyntaxKind | undefined; function symbolName(symbol: Symbol): string; function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined; function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined; @@ -4725,6 +4556,7 @@ declare namespace ts { function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined; /** Gets the JSDoc template tag for the node if present */ function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined; + function getJSDocSatisfiesTag(node: Node): JSDocSatisfiesTag | undefined; /** Gets the JSDoc type tag for the node if present and valid */ function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined; /** @@ -4778,7 +4610,9 @@ declare namespace ts { function isNonNullChain(node: Node): node is NonNullChain; function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement; function isNamedExportBindings(node: Node): node is NamedExportBindings; + /** @deprecated */ function isUnparsedTextLike(node: Node): node is UnparsedTextLike; + /** @deprecated */ function isUnparsedNode(node: Node): node is UnparsedNode; function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag; /** @@ -4797,6 +4631,8 @@ declare namespace ts { function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken; function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier; + function isTypeOnlyImportDeclaration(node: Node): node is TypeOnlyImportDeclaration; + function isTypeOnlyExportDeclaration(node: Node): node is TypeOnlyExportDeclaration; function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyAliasDeclaration; function isAssertionKey(node: Node): node is AssertionKey; function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; @@ -4820,13 +4656,30 @@ declare namespace ts { */ function isTypeNode(node: Node): node is TypeNode; function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode; + function isArrayBindingElement(node: Node): node is ArrayBindingElement; function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName; function isCallLikeExpression(node: Node): node is CallLikeExpression; function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression; function isTemplateLiteral(node: Node): node is TemplateLiteral; + function isLeftHandSideExpression(node: Node): node is LeftHandSideExpression; + function isLiteralTypeLiteral(node: Node): node is NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression; + /** + * Determines whether a node is an expression based only on its kind. + */ + function isExpression(node: Node): node is Expression; function isAssertionExpression(node: Node): node is AssertionExpression; function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; + function isConciseBody(node: Node): node is ConciseBody; + function isForInitializer(node: Node): node is ForInitializer; + function isModuleBody(node: Node): node is ModuleBody; + function isNamedImportBindings(node: Node): node is NamedImportBindings; + function isStatement(node: Node): node is Statement; + function isModuleReference(node: Node): node is ModuleReference; + function isJsxTagNameExpression(node: Node): node is JsxTagNameExpression; + function isJsxChild(node: Node): node is JsxChild; + function isJsxAttributeLike(node: Node): node is JsxAttributeLike; + function isStringLiteralOrJsxExpression(node: Node): node is StringLiteral | JsxExpression; function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement; function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; /** True if node is of a kind that may contain comment text. */ @@ -4846,11 +4699,17 @@ declare namespace ts { name: Identifier; }; function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean; + /** @deprecated */ function createUnparsedSourceFile(text: string): UnparsedSource; + /** @deprecated */ function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource; + /** @deprecated */ function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; + /** @deprecated */ function createInputFiles(javascriptText: string, declarationText: string): InputFiles; + /** @deprecated */ function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles; + /** @deprecated */ function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles; /** * Create an external source map source file reference @@ -4939,8 +4798,15 @@ declare namespace ts { function isPlusToken(node: Node): node is PlusToken; function isMinusToken(node: Node): node is MinusToken; function isAsteriskToken(node: Node): node is AsteriskToken; + function isExclamationToken(node: Node): node is ExclamationToken; + function isQuestionToken(node: Node): node is QuestionToken; + function isColonToken(node: Node): node is ColonToken; + function isQuestionDotToken(node: Node): node is QuestionDotToken; + function isEqualsGreaterThanToken(node: Node): node is EqualsGreaterThanToken; function isIdentifier(node: Node): node is Identifier; function isPrivateIdentifier(node: Node): node is PrivateIdentifier; + function isAssertsKeyword(node: Node): node is AssertsKeyword; + function isAwaitKeyword(node: Node): node is AwaitKeyword; function isQualifiedName(node: Node): node is QualifiedName; function isComputedPropertyName(node: Node): node is ComputedPropertyName; function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration; @@ -5084,9 +4950,11 @@ declare namespace ts { function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment; function isSpreadAssignment(node: Node): node is SpreadAssignment; function isEnumMember(node: Node): node is EnumMember; + /** @deprecated */ function isUnparsedPrepend(node: Node): node is UnparsedPrepend; function isSourceFile(node: Node): node is SourceFile; function isBundle(node: Node): node is Bundle; + /** @deprecated */ function isUnparsedSource(node: Node): node is UnparsedSource; function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; function isJSDocNameReference(node: Node): node is JSDocNameReference; @@ -5127,7 +4995,14 @@ declare namespace ts { function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag; function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag; function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag; + function isJSDocSatisfiesTag(node: Node): node is JSDocSatisfiesTag; function isJSDocThrowsTag(node: Node): node is JSDocThrowsTag; + function isQuestionOrExclamationToken(node: Node): node is QuestionToken | ExclamationToken; + function isIdentifierOrThisTypeNode(node: Node): node is Identifier | ThisTypeNode; + function isReadonlyKeywordOrPlusOrMinusToken(node: Node): node is ReadonlyKeyword | PlusToken | MinusToken; + function isQuestionOrPlusOrMinusToken(node: Node): node is QuestionToken | PlusToken | MinusToken; + function isModuleName(node: Node): node is ModuleName; + function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken; function setTextRange(range: T, location: TextRange | undefined): T; function canHaveModifiers(node: Node): node is HasModifiers; function canHaveDecorators(node: Node): node is HasDecorators; @@ -5335,41 +5210,65 @@ declare namespace ts { /** * Visits a Node using the supplied visitor, possibly returning a new Node in its place. * + * - If the input node is undefined, then the output is undefined. + * - If the visitor returns undefined, then the output is undefined. + * - If the output node is not undefined, then it will satisfy the test function. + * - In order to obtain a return type that is more specific than `Node`, a test + * function _must_ be provided, and that function must be a type predicate. + * * @param node The Node to visit. * @param visitor The callback used to visit the Node. * @param test A callback to execute to verify the Node is valid. * @param lift An optional callback to execute to lift a NodeArray into a valid Node. */ - function visitNode(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T; + function visitNode(node: TIn, visitor: Visitor, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined); /** * Visits a Node using the supplied visitor, possibly returning a new Node in its place. * + * - If the input node is undefined, then the output is undefined. + * - If the visitor returns undefined, then the output is undefined. + * - If the output node is not undefined, then it will satisfy the test function. + * - In order to obtain a return type that is more specific than `Node`, a test + * function _must_ be provided, and that function must be a type predicate. + * * @param node The Node to visit. * @param visitor The callback used to visit the Node. * @param test A callback to execute to verify the Node is valid. * @param lift An optional callback to execute to lift a NodeArray into a valid Node. */ - function visitNode(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined; + function visitNode(node: TIn, visitor: Visitor, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined); /** * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. * + * - If the input node array is undefined, the output is undefined. + * - If the visitor can return undefined, the node it visits in the array will be reused. + * - If the output node array is not undefined, then its contents will satisfy the test. + * - In order to obtain a return type that is more specific than `NodeArray`, a test + * function _must_ be provided, and that function must be a type predicate. + * * @param nodes The NodeArray to visit. * @param visitor The callback used to visit a Node. * @param test A node test to execute for each node. * @param start An optional value indicating the starting offset at which to start visiting. * @param count An optional value indicating the maximum number of nodes to visit. */ - function visitNodes(nodes: NodeArray, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray; + function visitNodes | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray | (TInArray & undefined); /** * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. * + * - If the input node array is undefined, the output is undefined. + * - If the visitor can return undefined, the node it visits in the array will be reused. + * - If the output node array is not undefined, then its contents will satisfy the test. + * - In order to obtain a return type that is more specific than `NodeArray`, a test + * function _must_ be provided, and that function must be a type predicate. + * * @param nodes The NodeArray to visit. * @param visitor The callback used to visit a Node. * @param test A node test to execute for each node. * @param start An optional value indicating the starting offset at which to start visiting. * @param count An optional value indicating the maximum number of nodes to visit. */ - function visitNodes(nodes: NodeArray | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | undefined; + function visitNodes | undefined>(nodes: TInArray, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray | (TInArray & undefined); /** * Starts a new lexical environment and visits a statement list, ending the lexical environment * and merging hoisted declarations upon completion. @@ -5400,6 +5299,12 @@ declare namespace ts { * Visits an iteration body, adding any block-scoped variables required by the transformation. */ function visitIterationBody(body: Statement, visitor: Visitor, context: TransformationContext): Statement; + /** + * Visits the elements of a {@link CommaListExpression}. + * @param visitor The visitor to use when visiting expressions whose result will not be discarded at runtime. + * @param discardVisitor The visitor to use when visiting expressions whose result will be discarded at runtime. Defaults to {@link visitor}. + */ + function visitCommaListElements(elements: NodeArray, visitor: Visitor, discardVisitor?: Visitor): NodeArray; /** * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. * @@ -5495,15 +5400,11 @@ declare namespace ts { * Note: The file might not exist. */ function resolveProjectReferencePath(ref: ProjectReference): ResolvedConfigFileName; - /** @deprecated */ function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName; interface FormatDiagnosticsHost { getCurrentDirectory(): string; getCanonicalFileName(fileName: string): string; getNewLine(): string; } - /** @deprecated */ interface ResolveProjectReferencePathHost { - fileExists(fileName: string): boolean; - } interface EmitOutput { outputFiles: OutputFile[]; emitSkipped: boolean; @@ -5846,7 +5747,7 @@ declare namespace ts { } enum InvalidatedProjectKind { Build = 0, - UpdateBundle = 1, + /** @deprecated */ UpdateBundle = 1, UpdateOutputFileStamps = 2 } interface InvalidatedProjectBase { @@ -5878,6 +5779,7 @@ declare namespace ts { getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult; emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined; } + /** @deprecated */ interface UpdateBundleProject extends InvalidatedProjectBase { readonly kind: InvalidatedProjectKind.UpdateBundle; emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject | undefined; @@ -7218,738 +7120,5 @@ declare namespace ts { * @param compilerOptions Optional compiler options. */ function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; - /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */ - const createNodeArray: typeof factory.createNodeArray; - /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */ - const createNumericLiteral: typeof factory.createNumericLiteral; - /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */ - const createBigIntLiteral: typeof factory.createBigIntLiteral; - /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */ - const createStringLiteral: typeof factory.createStringLiteral; - /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */ - const createStringLiteralFromNode: typeof factory.createStringLiteralFromNode; - /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */ - const createRegularExpressionLiteral: typeof factory.createRegularExpressionLiteral; - /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */ - const createLoopVariable: typeof factory.createLoopVariable; - /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */ - const createUniqueName: typeof factory.createUniqueName; - /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */ - const createPrivateIdentifier: typeof factory.createPrivateIdentifier; - /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */ - const createSuper: typeof factory.createSuper; - /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */ - const createThis: typeof factory.createThis; - /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */ - const createNull: typeof factory.createNull; - /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */ - const createTrue: typeof factory.createTrue; - /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */ - const createFalse: typeof factory.createFalse; - /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */ - const createModifier: typeof factory.createModifier; - /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */ - const createModifiersFromModifierFlags: typeof factory.createModifiersFromModifierFlags; - /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */ - const createQualifiedName: typeof factory.createQualifiedName; - /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */ - const updateQualifiedName: typeof factory.updateQualifiedName; - /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */ - const createComputedPropertyName: typeof factory.createComputedPropertyName; - /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */ - const updateComputedPropertyName: typeof factory.updateComputedPropertyName; - /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */ - const createTypeParameterDeclaration: typeof factory.createTypeParameterDeclaration; - /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */ - const updateTypeParameterDeclaration: typeof factory.updateTypeParameterDeclaration; - /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */ - const createParameter: typeof factory.createParameterDeclaration; - /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */ - const updateParameter: typeof factory.updateParameterDeclaration; - /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */ - const createDecorator: typeof factory.createDecorator; - /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */ - const updateDecorator: typeof factory.updateDecorator; - /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */ - const createProperty: typeof factory.createPropertyDeclaration; - /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */ - const updateProperty: typeof factory.updatePropertyDeclaration; - /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */ - const createMethod: typeof factory.createMethodDeclaration; - /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */ - const updateMethod: typeof factory.updateMethodDeclaration; - /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */ - const createConstructor: typeof factory.createConstructorDeclaration; - /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */ - const updateConstructor: typeof factory.updateConstructorDeclaration; - /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */ - const createGetAccessor: typeof factory.createGetAccessorDeclaration; - /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */ - const updateGetAccessor: typeof factory.updateGetAccessorDeclaration; - /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */ - const createSetAccessor: typeof factory.createSetAccessorDeclaration; - /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */ - const updateSetAccessor: typeof factory.updateSetAccessorDeclaration; - /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */ - const createCallSignature: typeof factory.createCallSignature; - /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */ - const updateCallSignature: typeof factory.updateCallSignature; - /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */ - const createConstructSignature: typeof factory.createConstructSignature; - /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */ - const updateConstructSignature: typeof factory.updateConstructSignature; - /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */ - const updateIndexSignature: typeof factory.updateIndexSignature; - /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */ - const createKeywordTypeNode: typeof factory.createKeywordTypeNode; - /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */ - const createTypePredicateNodeWithModifier: typeof factory.createTypePredicateNode; - /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */ - const updateTypePredicateNodeWithModifier: typeof factory.updateTypePredicateNode; - /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */ - const createTypeReferenceNode: typeof factory.createTypeReferenceNode; - /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */ - const updateTypeReferenceNode: typeof factory.updateTypeReferenceNode; - /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */ - const createFunctionTypeNode: typeof factory.createFunctionTypeNode; - /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */ - const updateFunctionTypeNode: typeof factory.updateFunctionTypeNode; - /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */ - const createConstructorTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => ConstructorTypeNode; - /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */ - const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode) => ConstructorTypeNode; - /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */ - const createTypeQueryNode: typeof factory.createTypeQueryNode; - /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */ - const updateTypeQueryNode: typeof factory.updateTypeQueryNode; - /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */ - const createTypeLiteralNode: typeof factory.createTypeLiteralNode; - /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */ - const updateTypeLiteralNode: typeof factory.updateTypeLiteralNode; - /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */ - const createArrayTypeNode: typeof factory.createArrayTypeNode; - /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */ - const updateArrayTypeNode: typeof factory.updateArrayTypeNode; - /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */ - const createTupleTypeNode: typeof factory.createTupleTypeNode; - /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */ - const updateTupleTypeNode: typeof factory.updateTupleTypeNode; - /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */ - const createOptionalTypeNode: typeof factory.createOptionalTypeNode; - /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */ - const updateOptionalTypeNode: typeof factory.updateOptionalTypeNode; - /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */ - const createRestTypeNode: typeof factory.createRestTypeNode; - /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */ - const updateRestTypeNode: typeof factory.updateRestTypeNode; - /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */ - const createUnionTypeNode: typeof factory.createUnionTypeNode; - /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */ - const updateUnionTypeNode: typeof factory.updateUnionTypeNode; - /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */ - const createIntersectionTypeNode: typeof factory.createIntersectionTypeNode; - /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */ - const updateIntersectionTypeNode: typeof factory.updateIntersectionTypeNode; - /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */ - const createConditionalTypeNode: typeof factory.createConditionalTypeNode; - /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */ - const updateConditionalTypeNode: typeof factory.updateConditionalTypeNode; - /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */ - const createInferTypeNode: typeof factory.createInferTypeNode; - /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */ - const updateInferTypeNode: typeof factory.updateInferTypeNode; - /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */ - const createImportTypeNode: typeof factory.createImportTypeNode; - /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */ - const updateImportTypeNode: typeof factory.updateImportTypeNode; - /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */ - const createParenthesizedType: typeof factory.createParenthesizedType; - /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */ - const updateParenthesizedType: typeof factory.updateParenthesizedType; - /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */ - const createThisTypeNode: typeof factory.createThisTypeNode; - /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */ - const updateTypeOperatorNode: typeof factory.updateTypeOperatorNode; - /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ - const createIndexedAccessTypeNode: typeof factory.createIndexedAccessTypeNode; - /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ - const updateIndexedAccessTypeNode: typeof factory.updateIndexedAccessTypeNode; - /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */ - const createMappedTypeNode: typeof factory.createMappedTypeNode; - /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */ - const updateMappedTypeNode: typeof factory.updateMappedTypeNode; - /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */ - const createLiteralTypeNode: typeof factory.createLiteralTypeNode; - /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */ - const updateLiteralTypeNode: typeof factory.updateLiteralTypeNode; - /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */ - const createObjectBindingPattern: typeof factory.createObjectBindingPattern; - /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */ - const updateObjectBindingPattern: typeof factory.updateObjectBindingPattern; - /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */ - const createArrayBindingPattern: typeof factory.createArrayBindingPattern; - /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */ - const updateArrayBindingPattern: typeof factory.updateArrayBindingPattern; - /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */ - const createBindingElement: typeof factory.createBindingElement; - /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */ - const updateBindingElement: typeof factory.updateBindingElement; - /** @deprecated Use `factory.createArrayLiteralExpression` or the factory supplied by your transformation context instead. */ - const createArrayLiteral: typeof factory.createArrayLiteralExpression; - /** @deprecated Use `factory.updateArrayLiteralExpression` or the factory supplied by your transformation context instead. */ - const updateArrayLiteral: typeof factory.updateArrayLiteralExpression; - /** @deprecated Use `factory.createObjectLiteralExpression` or the factory supplied by your transformation context instead. */ - const createObjectLiteral: typeof factory.createObjectLiteralExpression; - /** @deprecated Use `factory.updateObjectLiteralExpression` or the factory supplied by your transformation context instead. */ - const updateObjectLiteral: typeof factory.updateObjectLiteralExpression; - /** @deprecated Use `factory.createPropertyAccessExpression` or the factory supplied by your transformation context instead. */ - const createPropertyAccess: typeof factory.createPropertyAccessExpression; - /** @deprecated Use `factory.updatePropertyAccessExpression` or the factory supplied by your transformation context instead. */ - const updatePropertyAccess: typeof factory.updatePropertyAccessExpression; - /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */ - const createPropertyAccessChain: typeof factory.createPropertyAccessChain; - /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */ - const updatePropertyAccessChain: typeof factory.updatePropertyAccessChain; - /** @deprecated Use `factory.createElementAccessExpression` or the factory supplied by your transformation context instead. */ - const createElementAccess: typeof factory.createElementAccessExpression; - /** @deprecated Use `factory.updateElementAccessExpression` or the factory supplied by your transformation context instead. */ - const updateElementAccess: typeof factory.updateElementAccessExpression; - /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */ - const createElementAccessChain: typeof factory.createElementAccessChain; - /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */ - const updateElementAccessChain: typeof factory.updateElementAccessChain; - /** @deprecated Use `factory.createCallExpression` or the factory supplied by your transformation context instead. */ - const createCall: typeof factory.createCallExpression; - /** @deprecated Use `factory.updateCallExpression` or the factory supplied by your transformation context instead. */ - const updateCall: typeof factory.updateCallExpression; - /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */ - const createCallChain: typeof factory.createCallChain; - /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */ - const updateCallChain: typeof factory.updateCallChain; - /** @deprecated Use `factory.createNewExpression` or the factory supplied by your transformation context instead. */ - const createNew: typeof factory.createNewExpression; - /** @deprecated Use `factory.updateNewExpression` or the factory supplied by your transformation context instead. */ - const updateNew: typeof factory.updateNewExpression; - /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */ - const createTypeAssertion: typeof factory.createTypeAssertion; - /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */ - const updateTypeAssertion: typeof factory.updateTypeAssertion; - /** @deprecated Use `factory.createParenthesizedExpression` or the factory supplied by your transformation context instead. */ - const createParen: typeof factory.createParenthesizedExpression; - /** @deprecated Use `factory.updateParenthesizedExpression` or the factory supplied by your transformation context instead. */ - const updateParen: typeof factory.updateParenthesizedExpression; - /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */ - const createFunctionExpression: typeof factory.createFunctionExpression; - /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */ - const updateFunctionExpression: typeof factory.updateFunctionExpression; - /** @deprecated Use `factory.createDeleteExpression` or the factory supplied by your transformation context instead. */ - const createDelete: typeof factory.createDeleteExpression; - /** @deprecated Use `factory.updateDeleteExpression` or the factory supplied by your transformation context instead. */ - const updateDelete: typeof factory.updateDeleteExpression; - /** @deprecated Use `factory.createTypeOfExpression` or the factory supplied by your transformation context instead. */ - const createTypeOf: typeof factory.createTypeOfExpression; - /** @deprecated Use `factory.updateTypeOfExpression` or the factory supplied by your transformation context instead. */ - const updateTypeOf: typeof factory.updateTypeOfExpression; - /** @deprecated Use `factory.createVoidExpression` or the factory supplied by your transformation context instead. */ - const createVoid: typeof factory.createVoidExpression; - /** @deprecated Use `factory.updateVoidExpression` or the factory supplied by your transformation context instead. */ - const updateVoid: typeof factory.updateVoidExpression; - /** @deprecated Use `factory.createAwaitExpression` or the factory supplied by your transformation context instead. */ - const createAwait: typeof factory.createAwaitExpression; - /** @deprecated Use `factory.updateAwaitExpression` or the factory supplied by your transformation context instead. */ - const updateAwait: typeof factory.updateAwaitExpression; - /** @deprecated Use `factory.createPrefixExpression` or the factory supplied by your transformation context instead. */ - const createPrefix: typeof factory.createPrefixUnaryExpression; - /** @deprecated Use `factory.updatePrefixExpression` or the factory supplied by your transformation context instead. */ - const updatePrefix: typeof factory.updatePrefixUnaryExpression; - /** @deprecated Use `factory.createPostfixUnaryExpression` or the factory supplied by your transformation context instead. */ - const createPostfix: typeof factory.createPostfixUnaryExpression; - /** @deprecated Use `factory.updatePostfixUnaryExpression` or the factory supplied by your transformation context instead. */ - const updatePostfix: typeof factory.updatePostfixUnaryExpression; - /** @deprecated Use `factory.createBinaryExpression` or the factory supplied by your transformation context instead. */ - const createBinary: typeof factory.createBinaryExpression; - /** @deprecated Use `factory.updateConditionalExpression` or the factory supplied by your transformation context instead. */ - const updateConditional: typeof factory.updateConditionalExpression; - /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */ - const createTemplateExpression: typeof factory.createTemplateExpression; - /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */ - const updateTemplateExpression: typeof factory.updateTemplateExpression; - /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */ - const createTemplateHead: typeof factory.createTemplateHead; - /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */ - const createTemplateMiddle: typeof factory.createTemplateMiddle; - /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */ - const createTemplateTail: typeof factory.createTemplateTail; - /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */ - const createNoSubstitutionTemplateLiteral: typeof factory.createNoSubstitutionTemplateLiteral; - /** @deprecated Use `factory.updateYieldExpression` or the factory supplied by your transformation context instead. */ - const updateYield: typeof factory.updateYieldExpression; - /** @deprecated Use `factory.createSpreadExpression` or the factory supplied by your transformation context instead. */ - const createSpread: typeof factory.createSpreadElement; - /** @deprecated Use `factory.updateSpreadExpression` or the factory supplied by your transformation context instead. */ - const updateSpread: typeof factory.updateSpreadElement; - /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */ - const createOmittedExpression: typeof factory.createOmittedExpression; - /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */ - const createAsExpression: typeof factory.createAsExpression; - /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */ - const updateAsExpression: typeof factory.updateAsExpression; - /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */ - const createNonNullExpression: typeof factory.createNonNullExpression; - /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */ - const updateNonNullExpression: typeof factory.updateNonNullExpression; - /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */ - const createNonNullChain: typeof factory.createNonNullChain; - /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */ - const updateNonNullChain: typeof factory.updateNonNullChain; - /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */ - const createMetaProperty: typeof factory.createMetaProperty; - /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */ - const updateMetaProperty: typeof factory.updateMetaProperty; - /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */ - const createTemplateSpan: typeof factory.createTemplateSpan; - /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */ - const updateTemplateSpan: typeof factory.updateTemplateSpan; - /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */ - const createSemicolonClassElement: typeof factory.createSemicolonClassElement; - /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */ - const createBlock: typeof factory.createBlock; - /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */ - const updateBlock: typeof factory.updateBlock; - /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */ - const createVariableStatement: typeof factory.createVariableStatement; - /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */ - const updateVariableStatement: typeof factory.updateVariableStatement; - /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */ - const createEmptyStatement: typeof factory.createEmptyStatement; - /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */ - const createExpressionStatement: typeof factory.createExpressionStatement; - /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */ - const updateExpressionStatement: typeof factory.updateExpressionStatement; - /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */ - const createStatement: typeof factory.createExpressionStatement; - /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */ - const updateStatement: typeof factory.updateExpressionStatement; - /** @deprecated Use `factory.createIfStatement` or the factory supplied by your transformation context instead. */ - const createIf: typeof factory.createIfStatement; - /** @deprecated Use `factory.updateIfStatement` or the factory supplied by your transformation context instead. */ - const updateIf: typeof factory.updateIfStatement; - /** @deprecated Use `factory.createDoStatement` or the factory supplied by your transformation context instead. */ - const createDo: typeof factory.createDoStatement; - /** @deprecated Use `factory.updateDoStatement` or the factory supplied by your transformation context instead. */ - const updateDo: typeof factory.updateDoStatement; - /** @deprecated Use `factory.createWhileStatement` or the factory supplied by your transformation context instead. */ - const createWhile: typeof factory.createWhileStatement; - /** @deprecated Use `factory.updateWhileStatement` or the factory supplied by your transformation context instead. */ - const updateWhile: typeof factory.updateWhileStatement; - /** @deprecated Use `factory.createForStatement` or the factory supplied by your transformation context instead. */ - const createFor: typeof factory.createForStatement; - /** @deprecated Use `factory.updateForStatement` or the factory supplied by your transformation context instead. */ - const updateFor: typeof factory.updateForStatement; - /** @deprecated Use `factory.createForInStatement` or the factory supplied by your transformation context instead. */ - const createForIn: typeof factory.createForInStatement; - /** @deprecated Use `factory.updateForInStatement` or the factory supplied by your transformation context instead. */ - const updateForIn: typeof factory.updateForInStatement; - /** @deprecated Use `factory.createForOfStatement` or the factory supplied by your transformation context instead. */ - const createForOf: typeof factory.createForOfStatement; - /** @deprecated Use `factory.updateForOfStatement` or the factory supplied by your transformation context instead. */ - const updateForOf: typeof factory.updateForOfStatement; - /** @deprecated Use `factory.createContinueStatement` or the factory supplied by your transformation context instead. */ - const createContinue: typeof factory.createContinueStatement; - /** @deprecated Use `factory.updateContinueStatement` or the factory supplied by your transformation context instead. */ - const updateContinue: typeof factory.updateContinueStatement; - /** @deprecated Use `factory.createBreakStatement` or the factory supplied by your transformation context instead. */ - const createBreak: typeof factory.createBreakStatement; - /** @deprecated Use `factory.updateBreakStatement` or the factory supplied by your transformation context instead. */ - const updateBreak: typeof factory.updateBreakStatement; - /** @deprecated Use `factory.createReturnStatement` or the factory supplied by your transformation context instead. */ - const createReturn: typeof factory.createReturnStatement; - /** @deprecated Use `factory.updateReturnStatement` or the factory supplied by your transformation context instead. */ - const updateReturn: typeof factory.updateReturnStatement; - /** @deprecated Use `factory.createWithStatement` or the factory supplied by your transformation context instead. */ - const createWith: typeof factory.createWithStatement; - /** @deprecated Use `factory.updateWithStatement` or the factory supplied by your transformation context instead. */ - const updateWith: typeof factory.updateWithStatement; - /** @deprecated Use `factory.createSwitchStatement` or the factory supplied by your transformation context instead. */ - const createSwitch: typeof factory.createSwitchStatement; - /** @deprecated Use `factory.updateSwitchStatement` or the factory supplied by your transformation context instead. */ - const updateSwitch: typeof factory.updateSwitchStatement; - /** @deprecated Use `factory.createLabelStatement` or the factory supplied by your transformation context instead. */ - const createLabel: typeof factory.createLabeledStatement; - /** @deprecated Use `factory.updateLabelStatement` or the factory supplied by your transformation context instead. */ - const updateLabel: typeof factory.updateLabeledStatement; - /** @deprecated Use `factory.createThrowStatement` or the factory supplied by your transformation context instead. */ - const createThrow: typeof factory.createThrowStatement; - /** @deprecated Use `factory.updateThrowStatement` or the factory supplied by your transformation context instead. */ - const updateThrow: typeof factory.updateThrowStatement; - /** @deprecated Use `factory.createTryStatement` or the factory supplied by your transformation context instead. */ - const createTry: typeof factory.createTryStatement; - /** @deprecated Use `factory.updateTryStatement` or the factory supplied by your transformation context instead. */ - const updateTry: typeof factory.updateTryStatement; - /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */ - const createDebuggerStatement: typeof factory.createDebuggerStatement; - /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */ - const createVariableDeclarationList: typeof factory.createVariableDeclarationList; - /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */ - const updateVariableDeclarationList: typeof factory.updateVariableDeclarationList; - /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */ - const createFunctionDeclaration: typeof factory.createFunctionDeclaration; - /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */ - const updateFunctionDeclaration: typeof factory.updateFunctionDeclaration; - /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */ - const createClassDeclaration: typeof factory.createClassDeclaration; - /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */ - const updateClassDeclaration: typeof factory.updateClassDeclaration; - /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */ - const createInterfaceDeclaration: typeof factory.createInterfaceDeclaration; - /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */ - const updateInterfaceDeclaration: typeof factory.updateInterfaceDeclaration; - /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */ - const createTypeAliasDeclaration: typeof factory.createTypeAliasDeclaration; - /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */ - const updateTypeAliasDeclaration: typeof factory.updateTypeAliasDeclaration; - /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */ - const createEnumDeclaration: typeof factory.createEnumDeclaration; - /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */ - const updateEnumDeclaration: typeof factory.updateEnumDeclaration; - /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */ - const createModuleDeclaration: typeof factory.createModuleDeclaration; - /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */ - const updateModuleDeclaration: typeof factory.updateModuleDeclaration; - /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */ - const createModuleBlock: typeof factory.createModuleBlock; - /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */ - const updateModuleBlock: typeof factory.updateModuleBlock; - /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */ - const createCaseBlock: typeof factory.createCaseBlock; - /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */ - const updateCaseBlock: typeof factory.updateCaseBlock; - /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */ - const createNamespaceExportDeclaration: typeof factory.createNamespaceExportDeclaration; - /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */ - const updateNamespaceExportDeclaration: typeof factory.updateNamespaceExportDeclaration; - /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */ - const createImportEqualsDeclaration: typeof factory.createImportEqualsDeclaration; - /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */ - const updateImportEqualsDeclaration: typeof factory.updateImportEqualsDeclaration; - /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */ - const createImportDeclaration: typeof factory.createImportDeclaration; - /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */ - const updateImportDeclaration: typeof factory.updateImportDeclaration; - /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */ - const createNamespaceImport: typeof factory.createNamespaceImport; - /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */ - const updateNamespaceImport: typeof factory.updateNamespaceImport; - /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */ - const createNamedImports: typeof factory.createNamedImports; - /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */ - const updateNamedImports: typeof factory.updateNamedImports; - /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */ - const createImportSpecifier: typeof factory.createImportSpecifier; - /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */ - const updateImportSpecifier: typeof factory.updateImportSpecifier; - /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */ - const createExportAssignment: typeof factory.createExportAssignment; - /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */ - const updateExportAssignment: typeof factory.updateExportAssignment; - /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */ - const createNamedExports: typeof factory.createNamedExports; - /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */ - const updateNamedExports: typeof factory.updateNamedExports; - /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */ - const createExportSpecifier: typeof factory.createExportSpecifier; - /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */ - const updateExportSpecifier: typeof factory.updateExportSpecifier; - /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */ - const createExternalModuleReference: typeof factory.createExternalModuleReference; - /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */ - const updateExternalModuleReference: typeof factory.updateExternalModuleReference; - /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */ - const createJSDocTypeExpression: typeof factory.createJSDocTypeExpression; - /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */ - const createJSDocTypeTag: typeof factory.createJSDocTypeTag; - /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */ - const createJSDocReturnTag: typeof factory.createJSDocReturnTag; - /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */ - const createJSDocThisTag: typeof factory.createJSDocThisTag; - /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */ - const createJSDocComment: typeof factory.createJSDocComment; - /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */ - const createJSDocParameterTag: typeof factory.createJSDocParameterTag; - /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */ - const createJSDocClassTag: typeof factory.createJSDocClassTag; - /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */ - const createJSDocAugmentsTag: typeof factory.createJSDocAugmentsTag; - /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */ - const createJSDocEnumTag: typeof factory.createJSDocEnumTag; - /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */ - const createJSDocTemplateTag: typeof factory.createJSDocTemplateTag; - /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */ - const createJSDocTypedefTag: typeof factory.createJSDocTypedefTag; - /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */ - const createJSDocCallbackTag: typeof factory.createJSDocCallbackTag; - /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */ - const createJSDocSignature: typeof factory.createJSDocSignature; - /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */ - const createJSDocPropertyTag: typeof factory.createJSDocPropertyTag; - /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */ - const createJSDocTypeLiteral: typeof factory.createJSDocTypeLiteral; - /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */ - const createJSDocImplementsTag: typeof factory.createJSDocImplementsTag; - /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */ - const createJSDocAuthorTag: typeof factory.createJSDocAuthorTag; - /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */ - const createJSDocPublicTag: typeof factory.createJSDocPublicTag; - /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */ - const createJSDocPrivateTag: typeof factory.createJSDocPrivateTag; - /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */ - const createJSDocProtectedTag: typeof factory.createJSDocProtectedTag; - /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */ - const createJSDocReadonlyTag: typeof factory.createJSDocReadonlyTag; - /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */ - const createJSDocTag: typeof factory.createJSDocUnknownTag; - /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */ - const createJsxElement: typeof factory.createJsxElement; - /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */ - const updateJsxElement: typeof factory.updateJsxElement; - /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */ - const createJsxSelfClosingElement: typeof factory.createJsxSelfClosingElement; - /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */ - const updateJsxSelfClosingElement: typeof factory.updateJsxSelfClosingElement; - /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */ - const createJsxOpeningElement: typeof factory.createJsxOpeningElement; - /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */ - const updateJsxOpeningElement: typeof factory.updateJsxOpeningElement; - /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */ - const createJsxClosingElement: typeof factory.createJsxClosingElement; - /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */ - const updateJsxClosingElement: typeof factory.updateJsxClosingElement; - /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */ - const createJsxFragment: typeof factory.createJsxFragment; - /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */ - const createJsxText: typeof factory.createJsxText; - /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */ - const updateJsxText: typeof factory.updateJsxText; - /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */ - const createJsxOpeningFragment: typeof factory.createJsxOpeningFragment; - /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */ - const createJsxJsxClosingFragment: typeof factory.createJsxJsxClosingFragment; - /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ - const updateJsxFragment: typeof factory.updateJsxFragment; - /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ - const createJsxAttribute: typeof factory.createJsxAttribute; - /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxAttribute: typeof factory.updateJsxAttribute; - /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ - const createJsxAttributes: typeof factory.createJsxAttributes; - /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ - const updateJsxAttributes: typeof factory.updateJsxAttributes; - /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */ - const createJsxSpreadAttribute: typeof factory.createJsxSpreadAttribute; - /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxSpreadAttribute: typeof factory.updateJsxSpreadAttribute; - /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */ - const createJsxExpression: typeof factory.createJsxExpression; - /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */ - const updateJsxExpression: typeof factory.updateJsxExpression; - /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */ - const createCaseClause: typeof factory.createCaseClause; - /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */ - const updateCaseClause: typeof factory.updateCaseClause; - /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */ - const createDefaultClause: typeof factory.createDefaultClause; - /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */ - const updateDefaultClause: typeof factory.updateDefaultClause; - /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */ - const createHeritageClause: typeof factory.createHeritageClause; - /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */ - const updateHeritageClause: typeof factory.updateHeritageClause; - /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */ - const createCatchClause: typeof factory.createCatchClause; - /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */ - const updateCatchClause: typeof factory.updateCatchClause; - /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */ - const createPropertyAssignment: typeof factory.createPropertyAssignment; - /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */ - const updatePropertyAssignment: typeof factory.updatePropertyAssignment; - /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */ - const createShorthandPropertyAssignment: typeof factory.createShorthandPropertyAssignment; - /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */ - const updateShorthandPropertyAssignment: typeof factory.updateShorthandPropertyAssignment; - /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */ - const createSpreadAssignment: typeof factory.createSpreadAssignment; - /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */ - const updateSpreadAssignment: typeof factory.updateSpreadAssignment; - /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */ - const createEnumMember: typeof factory.createEnumMember; - /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */ - const updateEnumMember: typeof factory.updateEnumMember; - /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */ - const updateSourceFileNode: typeof factory.updateSourceFile; - /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */ - const createNotEmittedStatement: typeof factory.createNotEmittedStatement; - /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */ - const createPartiallyEmittedExpression: typeof factory.createPartiallyEmittedExpression; - /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */ - const updatePartiallyEmittedExpression: typeof factory.updatePartiallyEmittedExpression; - /** @deprecated Use `factory.createCommaListExpression` or the factory supplied by your transformation context instead. */ - const createCommaList: typeof factory.createCommaListExpression; - /** @deprecated Use `factory.updateCommaListExpression` or the factory supplied by your transformation context instead. */ - const updateCommaList: typeof factory.updateCommaListExpression; - /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */ - const createBundle: typeof factory.createBundle; - /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */ - const updateBundle: typeof factory.updateBundle; - /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */ - const createImmediatelyInvokedFunctionExpression: typeof factory.createImmediatelyInvokedFunctionExpression; - /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */ - const createImmediatelyInvokedArrowFunction: typeof factory.createImmediatelyInvokedArrowFunction; - /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */ - const createVoidZero: typeof factory.createVoidZero; - /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */ - const createExportDefault: typeof factory.createExportDefault; - /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */ - const createExternalModuleExport: typeof factory.createExternalModuleExport; - /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */ - const createNamespaceExport: typeof factory.createNamespaceExport; - /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */ - const updateNamespaceExport: typeof factory.updateNamespaceExport; - /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */ - const createToken: (kind: TKind) => Token; - /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */ - const createIdentifier: (text: string) => Identifier; - /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */ - const createTempVariable: (recordTempVariable: ((node: Identifier) => void) | undefined) => Identifier; - /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */ - const getGeneratedNameForNode: (node: Node | undefined) => Identifier; - /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */ - const createOptimisticUniqueName: (text: string) => Identifier; - /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */ - const createFileLevelUniqueName: (text: string) => Identifier; - /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */ - const createIndexSignature: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration; - /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */ - const createTypePredicateNode: (parameterName: Identifier | ThisTypeNode | string, type: TypeNode) => TypePredicateNode; - /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */ - const updateTypePredicateNode: (node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode) => TypePredicateNode; - /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */ - const createLiteral: { - (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral; - (value: number | PseudoBigInt): NumericLiteral; - (value: boolean): BooleanLiteral; - (value: string | number | PseudoBigInt | boolean): PrimaryExpression; - }; - /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */ - const createMethodSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined) => MethodSignature; - /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */ - const updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined) => MethodSignature; - /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */ - const createTypeOperatorNode: { - (type: TypeNode): TypeOperatorNode; - (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; - }; - /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */ - const createTaggedTemplate: { - (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; - (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; - }; - /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */ - const updateTaggedTemplate: { - (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; - (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; - }; - /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */ - const updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken) => BinaryExpression; - /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */ - const createConditional: { - (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; - (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; - }; - /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */ - const createYield: { - (expression?: Expression | undefined): YieldExpression; - (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression; - }; - /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */ - const createClassExpression: (modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression; - /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */ - const updateClassExpression: (node: ClassExpression, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression; - /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */ - const createPropertySignature: (modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer?: Expression | undefined) => PropertySignature; - /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */ - const updatePropertySignature: (node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertySignature; - /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */ - const createExpressionWithTypeArguments: (typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments; - /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */ - const updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments; - /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */ - const createArrowFunction: { - (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; - (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; - }; - /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */ - const updateArrowFunction: { - (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction; - (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; - }; - /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */ - const createVariableDeclaration: { - (name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration; - (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; - }; - /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */ - const updateVariableDeclaration: { - (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; - (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; - }; - /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */ - const createImportClause: (name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly?: any) => ImportClause; - /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */ - const updateImportClause: (node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) => ImportClause; - /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */ - const createExportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly?: any) => ExportDeclaration; - /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */ - const updateExportDeclaration: (node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, isTypeOnly: boolean) => ExportDeclaration; - /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */ - const createJSDocParamTag: (name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocParameterTag; - /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */ - const createComma: (left: Expression, right: Expression) => Expression; - /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */ - const createLessThan: (left: Expression, right: Expression) => Expression; - /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */ - const createAssignment: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */ - const createStrictEquality: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */ - const createStrictInequality: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */ - const createAdd: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */ - const createSubtract: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */ - const createLogicalAnd: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */ - const createLogicalOr: (left: Expression, right: Expression) => BinaryExpression; - /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */ - const createPostfixIncrement: (operand: Expression) => PostfixUnaryExpression; - /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */ - const createLogicalNot: (operand: Expression) => PrefixUnaryExpression; - /** @deprecated Use an appropriate `factory` method instead. */ - const createNode: (kind: SyntaxKind, pos?: any, end?: any) => Node; - /** - * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set. - * - * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be - * captured with respect to transformations. - * - * @deprecated Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`. - */ - const getMutableClone: (node: T) => T; - /** @deprecated Use `isTypeAssertionExpression` instead. */ - const isTypeAssertion: (node: Node) => node is TypeAssertion; - /** - * @deprecated Use `isMemberName` instead. - */ - const isIdentifierOrPrivateIdentifier: (node: Node) => node is MemberName; } export = ts; \ No newline at end of file diff --git a/lib/typescript.js b/lib/typescript.js index 3d47c2cb27900..6a3f7a4f37324 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -42,7 +42,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = `${versionMajorMinor}.0-dev.20230112`; + version = `${versionMajorMinor}.0-beta`; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -590,25 +590,20 @@ var ts = (() => { } return true; } - function detectSortCaseSensitivity(array, useEslintOrdering, getString) { + function detectSortCaseSensitivity(array, getString, compareStringsCaseSensitive2, compareStringsCaseInsensitive2) { let kind = 3 /* Both */; if (array.length < 2) return kind; - const caseSensitiveComparer = getString ? (a, b) => compareStringsCaseSensitive(getString(a), getString(b)) : compareStringsCaseSensitive; - const compareCaseInsensitive = useEslintOrdering ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseInsensitive; - const caseInsensitiveComparer = getString ? (a, b) => compareCaseInsensitive(getString(a), getString(b)) : compareCaseInsensitive; - for (let i = 1, len = array.length; i < len; i++) { - const prevElement = array[i - 1]; - const element = array[i]; - if (kind & 1 /* CaseSensitive */ && caseSensitiveComparer(prevElement, element) === 1 /* GreaterThan */) { + let prevElement = getString(array[0]); + for (let i = 1, len = array.length; i < len && kind !== 0 /* None */; i++) { + const element = getString(array[i]); + if (kind & 1 /* CaseSensitive */ && compareStringsCaseSensitive2(prevElement, element) > 0) { kind &= ~1 /* CaseSensitive */; } - if (kind & 2 /* CaseInsensitive */ && caseInsensitiveComparer(prevElement, element) === 1 /* GreaterThan */) { + if (kind & 2 /* CaseInsensitive */ && compareStringsCaseInsensitive2(prevElement, element) > 0) { kind &= ~2 /* CaseInsensitive */; } - if (kind === 0 /* None */) { - return kind; - } + prevElement = element; } return kind; } @@ -943,6 +938,18 @@ var ts = (() => { function group(values, getGroupId, resultSelector = identity) { return arrayFrom(arrayToMultiMap(values, getGroupId).values(), resultSelector); } + function groupBy(values, keySelector) { + var _a2; + const result = {}; + if (values) { + for (const value of values) { + const key = `${keySelector(value)}`; + const array = (_a2 = result[key]) != null ? _a2 : result[key] = []; + array.push(value); + } + } + return result; + } function clone(object) { const result = {}; for (const id in object) { @@ -1229,6 +1236,35 @@ var ts = (() => { return value; }; } + function memoizeCached(callback, cache) { + return (...args) => { + let value = cache.get(args); + if (value === void 0 && !cache.has(args)) { + value = callback(...args); + cache.set(args, value); + } + return value; + }; + } + function compose(a, b, c, d, e) { + if (!!e) { + const args = []; + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + return (t) => reduceLeft(args, (u, f) => f(u), t); + } else if (d) { + return (t) => d(c(b(a(t)))); + } else if (c) { + return (t) => c(b(a(t))); + } else if (b) { + return (t) => b(a(t)); + } else if (a) { + return (t) => a(t); + } else { + return (t) => t; + } + } function equateValues(a, b) { return a === b; } @@ -1565,12 +1601,24 @@ var ts = (() => { return length2 <= s.length ? s : s + padString.repeat(length2 - s.length); } function takeWhile(array, predicate) { - const len = array.length; - let index = 0; - while (index < len && predicate(array[index])) { - index++; + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(0, index); + } + } + function skipWhile(array, predicate) { + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(index); } - return array.slice(0, index); } function trimEndImpl(s) { let end = s.length - 1; @@ -3541,7 +3589,7 @@ ${lanes.join("\n")} const name = DiagnosticCategory[d.category]; return lowerCase ? name.toLowerCase() : name; } - var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, DeprecationVersion; + var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, DeprecationVersion; var init_types = __esm({ "src/compiler/types.ts"() { "use strict"; @@ -3900,14 +3948,15 @@ ${lanes.join("\n")} SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 350] = "JSDocSeeTag"; SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 351] = "JSDocPropertyTag"; SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 352] = "JSDocThrowsTag"; - SyntaxKind5[SyntaxKind5["SyntaxList"] = 353] = "SyntaxList"; - SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 354] = "NotEmittedStatement"; - SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression"; - SyntaxKind5[SyntaxKind5["CommaListExpression"] = 356] = "CommaListExpression"; - SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 357] = "MergeDeclarationMarker"; - SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 358] = "EndOfDeclarationMarker"; - SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 359] = "SyntheticReferenceExpression"; - SyntaxKind5[SyntaxKind5["Count"] = 360] = "Count"; + SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag"; + SyntaxKind5[SyntaxKind5["SyntaxList"] = 354] = "SyntaxList"; + SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 355] = "NotEmittedStatement"; + SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression"; + SyntaxKind5[SyntaxKind5["CommaListExpression"] = 357] = "CommaListExpression"; + SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker"; + SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker"; + SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression"; + SyntaxKind5[SyntaxKind5["Count"] = 361] = "Count"; SyntaxKind5[SyntaxKind5["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment"; SyntaxKind5[SyntaxKind5["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment"; SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment"; @@ -3936,51 +3985,53 @@ ${lanes.join("\n")} SyntaxKind5[SyntaxKind5["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement"; SyntaxKind5[SyntaxKind5["FirstNode"] = 163 /* QualifiedName */] = "FirstNode"; SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocNode"; + SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocNode"; SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocTagNode"; + SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocTagNode"; SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword"; SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword"; return SyntaxKind5; })(SyntaxKind || {}); - NodeFlags = /* @__PURE__ */ ((NodeFlags4) => { - NodeFlags4[NodeFlags4["None"] = 0] = "None"; - NodeFlags4[NodeFlags4["Let"] = 1] = "Let"; - NodeFlags4[NodeFlags4["Const"] = 2] = "Const"; - NodeFlags4[NodeFlags4["NestedNamespace"] = 4] = "NestedNamespace"; - NodeFlags4[NodeFlags4["Synthesized"] = 8] = "Synthesized"; - NodeFlags4[NodeFlags4["Namespace"] = 16] = "Namespace"; - NodeFlags4[NodeFlags4["OptionalChain"] = 32] = "OptionalChain"; - NodeFlags4[NodeFlags4["ExportContext"] = 64] = "ExportContext"; - NodeFlags4[NodeFlags4["ContainsThis"] = 128] = "ContainsThis"; - NodeFlags4[NodeFlags4["HasImplicitReturn"] = 256] = "HasImplicitReturn"; - NodeFlags4[NodeFlags4["HasExplicitReturn"] = 512] = "HasExplicitReturn"; - NodeFlags4[NodeFlags4["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; - NodeFlags4[NodeFlags4["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; - NodeFlags4[NodeFlags4["DisallowInContext"] = 4096] = "DisallowInContext"; - NodeFlags4[NodeFlags4["YieldContext"] = 8192] = "YieldContext"; - NodeFlags4[NodeFlags4["DecoratorContext"] = 16384] = "DecoratorContext"; - NodeFlags4[NodeFlags4["AwaitContext"] = 32768] = "AwaitContext"; - NodeFlags4[NodeFlags4["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; - NodeFlags4[NodeFlags4["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; - NodeFlags4[NodeFlags4["JavaScriptFile"] = 262144] = "JavaScriptFile"; - NodeFlags4[NodeFlags4["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; - NodeFlags4[NodeFlags4["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; - NodeFlags4[NodeFlags4["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; - NodeFlags4[NodeFlags4["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; - NodeFlags4[NodeFlags4["JSDoc"] = 8388608] = "JSDoc"; - NodeFlags4[NodeFlags4["Ambient"] = 16777216] = "Ambient"; - NodeFlags4[NodeFlags4["InWithStatement"] = 33554432] = "InWithStatement"; - NodeFlags4[NodeFlags4["JsonFile"] = 67108864] = "JsonFile"; - NodeFlags4[NodeFlags4["TypeCached"] = 134217728] = "TypeCached"; - NodeFlags4[NodeFlags4["Deprecated"] = 268435456] = "Deprecated"; - NodeFlags4[NodeFlags4["BlockScoped"] = 3] = "BlockScoped"; - NodeFlags4[NodeFlags4["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; - NodeFlags4[NodeFlags4["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; - NodeFlags4[NodeFlags4["ContextFlags"] = 50720768] = "ContextFlags"; - NodeFlags4[NodeFlags4["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; - NodeFlags4[NodeFlags4["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; - return NodeFlags4; + NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { + NodeFlags3[NodeFlags3["None"] = 0] = "None"; + NodeFlags3[NodeFlags3["Let"] = 1] = "Let"; + NodeFlags3[NodeFlags3["Const"] = 2] = "Const"; + NodeFlags3[NodeFlags3["NestedNamespace"] = 4] = "NestedNamespace"; + NodeFlags3[NodeFlags3["Synthesized"] = 8] = "Synthesized"; + NodeFlags3[NodeFlags3["Namespace"] = 16] = "Namespace"; + NodeFlags3[NodeFlags3["OptionalChain"] = 32] = "OptionalChain"; + NodeFlags3[NodeFlags3["ExportContext"] = 64] = "ExportContext"; + NodeFlags3[NodeFlags3["ContainsThis"] = 128] = "ContainsThis"; + NodeFlags3[NodeFlags3["HasImplicitReturn"] = 256] = "HasImplicitReturn"; + NodeFlags3[NodeFlags3["HasExplicitReturn"] = 512] = "HasExplicitReturn"; + NodeFlags3[NodeFlags3["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; + NodeFlags3[NodeFlags3["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; + NodeFlags3[NodeFlags3["DisallowInContext"] = 4096] = "DisallowInContext"; + NodeFlags3[NodeFlags3["YieldContext"] = 8192] = "YieldContext"; + NodeFlags3[NodeFlags3["DecoratorContext"] = 16384] = "DecoratorContext"; + NodeFlags3[NodeFlags3["AwaitContext"] = 32768] = "AwaitContext"; + NodeFlags3[NodeFlags3["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; + NodeFlags3[NodeFlags3["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; + NodeFlags3[NodeFlags3["JavaScriptFile"] = 262144] = "JavaScriptFile"; + NodeFlags3[NodeFlags3["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags3[NodeFlags3["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; + NodeFlags3[NodeFlags3["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; + NodeFlags3[NodeFlags3["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; + NodeFlags3[NodeFlags3["JSDoc"] = 8388608] = "JSDoc"; + NodeFlags3[NodeFlags3["Ambient"] = 16777216] = "Ambient"; + NodeFlags3[NodeFlags3["InWithStatement"] = 33554432] = "InWithStatement"; + NodeFlags3[NodeFlags3["JsonFile"] = 67108864] = "JsonFile"; + NodeFlags3[NodeFlags3["TypeCached"] = 134217728] = "TypeCached"; + NodeFlags3[NodeFlags3["Deprecated"] = 268435456] = "Deprecated"; + NodeFlags3[NodeFlags3["BlockScoped"] = 3] = "BlockScoped"; + NodeFlags3[NodeFlags3["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; + NodeFlags3[NodeFlags3["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; + NodeFlags3[NodeFlags3["ContextFlags"] = 50720768] = "ContextFlags"; + NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; + NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; + NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape"; + NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace"; + return NodeFlags3; })(NodeFlags || {}); ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { ModifierFlags3[ModifierFlags3["None"] = 0] = "None"; @@ -4120,7 +4171,6 @@ ${lanes.join("\n")} ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; ExitStatus2[ExitStatus2["InvalidProject_OutputsSkipped"] = 3] = "InvalidProject_OutputsSkipped"; ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkipped"] = 4] = "ProjectReferenceCycle_OutputsSkipped"; - ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkupped"] = 4] = "ProjectReferenceCycle_OutputsSkupped"; return ExitStatus2; })(ExitStatus || {}); MemberOverrideStatus = /* @__PURE__ */ ((MemberOverrideStatus2) => { @@ -4165,7 +4215,6 @@ ${lanes.join("\n")} NodeBuilderFlags2[NodeBuilderFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; NodeBuilderFlags2[NodeBuilderFlags2["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifiedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifiedNameInPlaceOfIdentifier"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifedNameInPlaceOfIdentifier"] = 65536 /* AllowQualifiedNameInPlaceOfIdentifier */] = "AllowQualifedNameInPlaceOfIdentifier"; NodeBuilderFlags2[NodeBuilderFlags2["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; @@ -4203,7 +4252,6 @@ ${lanes.join("\n")} TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType"; TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; - TypeFormatFlags2[TypeFormatFlags2["WriteOwnNameForAnyLike"] = 0] = "WriteOwnNameForAnyLike"; TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330091] = "NodeBuilderFlagsMask"; return TypeFormatFlags2; })(TypeFormatFlags || {}); @@ -4995,18 +5043,24 @@ ${lanes.join("\n")} EmitFlags3[EmitFlags3["HasEndOfDeclarationMarker"] = 8388608] = "HasEndOfDeclarationMarker"; EmitFlags3[EmitFlags3["Iterator"] = 16777216] = "Iterator"; EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 33554432] = "NoAsciiEscaping"; - EmitFlags3[EmitFlags3["TypeScriptClassWrapper"] = 67108864] = "TypeScriptClassWrapper"; - EmitFlags3[EmitFlags3["NeverApplyImportHelper"] = 134217728] = "NeverApplyImportHelper"; - EmitFlags3[EmitFlags3["IgnoreSourceNewlines"] = 268435456] = "IgnoreSourceNewlines"; - EmitFlags3[EmitFlags3["Immutable"] = 536870912] = "Immutable"; - EmitFlags3[EmitFlags3["IndirectCall"] = 1073741824] = "IndirectCall"; return EmitFlags3; })(EmitFlags || {}); + InternalEmitFlags = /* @__PURE__ */ ((InternalEmitFlags3) => { + InternalEmitFlags3[InternalEmitFlags3["None"] = 0] = "None"; + InternalEmitFlags3[InternalEmitFlags3["TypeScriptClassWrapper"] = 1] = "TypeScriptClassWrapper"; + InternalEmitFlags3[InternalEmitFlags3["NeverApplyImportHelper"] = 2] = "NeverApplyImportHelper"; + InternalEmitFlags3[InternalEmitFlags3["IgnoreSourceNewlines"] = 4] = "IgnoreSourceNewlines"; + InternalEmitFlags3[InternalEmitFlags3["Immutable"] = 8] = "Immutable"; + InternalEmitFlags3[InternalEmitFlags3["IndirectCall"] = 16] = "IndirectCall"; + InternalEmitFlags3[InternalEmitFlags3["TransformPrivateStaticElements"] = 32] = "TransformPrivateStaticElements"; + return InternalEmitFlags3; + })(InternalEmitFlags || {}); ExternalEmitHelpers = /* @__PURE__ */ ((ExternalEmitHelpers2) => { ExternalEmitHelpers2[ExternalEmitHelpers2["Extends"] = 1] = "Extends"; ExternalEmitHelpers2[ExternalEmitHelpers2["Assign"] = 2] = "Assign"; ExternalEmitHelpers2[ExternalEmitHelpers2["Rest"] = 4] = "Rest"; ExternalEmitHelpers2[ExternalEmitHelpers2["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ESDecorateAndRunInitializers"] = 8 /* Decorate */] = "ESDecorateAndRunInitializers"; ExternalEmitHelpers2[ExternalEmitHelpers2["Metadata"] = 16] = "Metadata"; ExternalEmitHelpers2[ExternalEmitHelpers2["Param"] = 32] = "Param"; ExternalEmitHelpers2[ExternalEmitHelpers2["Awaiter"] = 64] = "Awaiter"; @@ -5026,8 +5080,10 @@ ${lanes.join("\n")} ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldSet"] = 1048576] = "ClassPrivateFieldSet"; ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldIn"] = 2097152] = "ClassPrivateFieldIn"; ExternalEmitHelpers2[ExternalEmitHelpers2["CreateBinding"] = 4194304] = "CreateBinding"; + ExternalEmitHelpers2[ExternalEmitHelpers2["SetFunctionName"] = 8388608] = "SetFunctionName"; + ExternalEmitHelpers2[ExternalEmitHelpers2["PropKey"] = 16777216] = "PropKey"; ExternalEmitHelpers2[ExternalEmitHelpers2["FirstEmitHelper"] = 1 /* Extends */] = "FirstEmitHelper"; - ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 4194304 /* CreateBinding */] = "LastEmitHelper"; + ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 16777216 /* PropKey */] = "LastEmitHelper"; ExternalEmitHelpers2[ExternalEmitHelpers2["ForOfIncludes"] = 256 /* Values */] = "ForOfIncludes"; ExternalEmitHelpers2[ExternalEmitHelpers2["ForAwaitOfIncludes"] = 16384 /* AsyncValues */] = "ForAwaitOfIncludes"; ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; @@ -7176,10 +7232,9 @@ ${lanes.join("\n")} Line_terminator_not_permitted_before_arrow: diag(1200, 1 /* Error */, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, 1 /* Error */, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, 1 /* Error */, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), - Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), + Re_exporting_a_type_when_0_is_enabled_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205", "Re-exporting a type when '{0}' is enabled requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, 1 /* Error */, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, 1 /* Error */, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, 1 /* Error */, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, 1 /* Error */, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, 1 /* Error */, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, 1 /* Error */, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), @@ -7189,7 +7244,6 @@ ${lanes.join("\n")} Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, 1 /* Error */, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, 1 /* Error */, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, 1 /* Error */, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, 1 /* Error */, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."), Generators_are_not_allowed_in_an_ambient_context: diag(1221, 1 /* Error */, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, 1 /* Error */, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), _0_tag_already_specified: diag(1223, 1 /* Error */, "_0_tag_already_specified_1223", "'{0}' tag already specified."), @@ -7236,7 +7290,7 @@ ${lanes.join("\n")} An_optional_element_cannot_follow_a_rest_element: diag(1266, 1 /* Error */, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, 1 /* Error */, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, 1 /* Error */, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), - Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."), + Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269", "Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."), Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, 1 /* Error */, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, 1 /* Error */, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, 1 /* Error */, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), @@ -7245,6 +7299,17 @@ ${lanes.join("\n")} accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1 /* Error */, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), An_accessor_property_cannot_be_declared_optional: diag(1276, 1 /* Error */, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), _0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: diag(1277, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0: diag(1278, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278", "The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0: diag(1279, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279", "The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."), + Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement: diag(1280, 1 /* Error */, "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280", "Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."), + Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead: diag(1281, 1 /* Error */, "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281", "Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."), + An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1282, 1 /* Error */, "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282", "An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), @@ -7316,7 +7381,6 @@ ${lanes.join("\n")} An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), - Only_named_exports_may_use_export_type: diag(1383, 1 /* Error */, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."), Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), @@ -7364,7 +7428,7 @@ ${lanes.join("\n")} The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."), - Decorators_may_not_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."), + Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."), Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, 1 /* Error */, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), @@ -7377,7 +7441,7 @@ ${lanes.join("\n")} Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, 1 /* Error */, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), - _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."), Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"), Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"), @@ -7405,6 +7469,8 @@ ${lanes.join("\n")} To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), + _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -7862,7 +7928,7 @@ ${lanes.join("\n")} This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1 /* Error */, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), - Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), + Cannot_access_ambient_const_enums_when_0_is_enabled: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."), _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1 /* Error */, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, 1 /* Error */, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), @@ -8110,12 +8176,12 @@ ${lanes.join("\n")} The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, 1 /* Error */, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, 1 /* Error */, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, 1 /* Error */, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), - Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."), + Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."), The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), - Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_eithe_5096", "Option 'allowImportingTsExtensions' can only be used when 'moduleResolution' is set to 'bundler' and either 'noEmit' or 'emitDeclarationOnly' is set."), + Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), @@ -8123,6 +8189,9 @@ ${lanes.join("\n")} Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), + Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), + Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), + Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8405,6 +8474,8 @@ ${lanes.join("\n")} package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."), + Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."), + There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`), Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), @@ -8529,7 +8600,7 @@ ${lanes.join("\n")} Filters_results_from_the_include_option: diag(6627, 3 /* Message */, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), Remove_a_list_of_directories_from_the_watch_process: diag(6628, 3 /* Message */, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, 3 /* Message */, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), - Enable_experimental_support_for_TC39_stage_2_draft_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630", "Enable experimental support for TC39 stage 2 draft decorators."), + Enable_experimental_support_for_legacy_experimental_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_legacy_experimental_decorators_6630", "Enable experimental support for legacy experimental decorators."), Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, 3 /* Message */, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), Output_more_detailed_compiler_performance_information_after_building: diag(6632, 3 /* Message */, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, 3 /* Message */, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), @@ -8615,6 +8686,7 @@ ${lanes.join("\n")} Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), + Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."), one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"), one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"), type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"), @@ -8750,6 +8822,7 @@ ${lanes.join("\n")} You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), + Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -9035,7 +9108,8 @@ ${lanes.join("\n")} _0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), _0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), - The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here.") + The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."), + Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.") }; } }); @@ -9488,10 +9562,7 @@ ${lanes.join("\n")} initial ); } - function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) { - if (!comments) { - comments = []; - } + function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments = []) { comments.push({ kind, pos, end, hasTrailingNewLine }); return comments; } @@ -11335,7 +11406,7 @@ ${lanes.join("\n")} } } function isParameterPropertyDeclaration(node, parent2) { - return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 173 /* Constructor */; + return isParameter(node) && hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 173 /* Constructor */; } function isEmptyBindingPattern(node) { if (isBindingPattern(node)) { @@ -11439,7 +11510,10 @@ ${lanes.join("\n")} node = node.original; } } - return !nodeTest || nodeTest(node) ? node : void 0; + if (!node || !nodeTest) { + return node; + } + return nodeTest(node) ? node : void 0; } function findAncestor(node, callback) { while (node) { @@ -11478,6 +11552,10 @@ ${lanes.join("\n")} function idText(identifierOrPrivateName) { return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); } + function identifierToKeywordKind(node) { + const token = stringToToken(node.escapedText); + return token ? tryCast(token, isKeyword) : void 0; + } function symbolName(symbol) { if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { return idText(symbol.valueDeclaration.name); @@ -11753,6 +11831,9 @@ ${lanes.join("\n")} function getJSDocTemplateTag(node) { return getFirstJSDocTag(node, isJSDocTemplateTag); } + function getJSDocSatisfiesTag(node) { + return getFirstJSDocTag(node, isJSDocSatisfiesTag); + } function getJSDocTypeTag(node) { const tag = getFirstJSDocTag(node, isJSDocTypeTag); if (tag && tag.typeExpression && tag.typeExpression.type) { @@ -11785,15 +11866,17 @@ ${lanes.join("\n")} } } function getJSDocTagsWorker(node, noCache) { + var _a2, _b; if (!canHaveJSDoc(node)) return emptyArray; - let tags = node.jsDocCache; + let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache; if (tags === void 0 || noCache) { const comments = getJSDocCommentsAndTags(node, noCache); Debug.assert(comments.length < 2 || comments[0] !== comments[1]); tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j); if (!noCache) { - node.jsDocCache = tags; + (_b = node.jsDoc) != null ? _b : node.jsDoc = []; + node.jsDoc.jsDocCache = tags; } } return tags; @@ -11971,19 +12054,31 @@ ${lanes.join("\n")} function isImportOrExportSpecifier(node) { return isImportSpecifier(node) || isExportSpecifier(node); } - function isTypeOnlyImportOrExportDeclaration(node) { + function isTypeOnlyImportDeclaration(node) { switch (node.kind) { case 273 /* ImportSpecifier */: - case 278 /* ExportSpecifier */: return node.isTypeOnly || node.parent.parent.isTypeOnly; case 271 /* NamespaceImport */: return node.parent.isTypeOnly; case 270 /* ImportClause */: case 268 /* ImportEqualsDeclaration */: return node.isTypeOnly; - default: - return false; } + return false; + } + function isTypeOnlyExportDeclaration(node) { + switch (node.kind) { + case 278 /* ExportSpecifier */: + return node.isTypeOnly || node.parent.parent.isTypeOnly; + case 275 /* ExportDeclaration */: + return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; + case 277 /* NamespaceExport */: + return node.parent.isTypeOnly; + } + return false; + } + function isTypeOnlyImportOrExportDeclaration(node) { + return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node); } function isAssertionKey(node) { return isStringLiteral(node) || isIdentifier(node); @@ -11992,10 +12087,12 @@ ${lanes.join("\n")} return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } function isGeneratedIdentifier(node) { - return isIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isGeneratedPrivateIdentifier(node) { - return isPrivateIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isPrivateIdentifierClassElementDeclaration(node) { return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name); @@ -12172,6 +12269,9 @@ ${lanes.join("\n")} } return false; } + function isBindingOrAssignmentElement(node) { + return isVariableDeclaration(node) || isParameter(node) || isObjectBindingOrAssignmentElement(node) || isArrayBindingOrAssignmentElement(node); + } function isBindingOrAssignmentPattern(node) { return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); } @@ -12201,6 +12301,24 @@ ${lanes.join("\n")} } return false; } + function isArrayBindingOrAssignmentElement(node) { + switch (node.kind) { + case 205 /* BindingElement */: + case 229 /* OmittedExpression */: + case 227 /* SpreadElement */: + case 206 /* ArrayLiteralExpression */: + case 207 /* ObjectLiteralExpression */: + case 79 /* Identifier */: + case 208 /* PropertyAccessExpression */: + case 209 /* ElementAccessExpression */: + return true; + } + return isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ); + } function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { const kind = node.kind; return kind === 208 /* PropertyAccessExpression */ || kind === 163 /* QualifiedName */ || kind === 202 /* ImportType */; @@ -12264,6 +12382,7 @@ ${lanes.join("\n")} case 230 /* ExpressionWithTypeArguments */: case 233 /* MetaProperty */: case 100 /* ImportKeyword */: + case 279 /* MissingDeclaration */: return true; default: return false; @@ -12296,6 +12415,17 @@ ${lanes.join("\n")} return false; } } + function isLiteralTypeLiteral(node) { + switch (node.kind) { + case 104 /* NullKeyword */: + case 110 /* TrueKeyword */: + case 95 /* FalseKeyword */: + case 221 /* PrefixUnaryExpression */: + return true; + default: + return isLiteralExpression(node); + } + } function isExpression(node) { return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); } @@ -12308,8 +12438,8 @@ ${lanes.join("\n")} case 227 /* SpreadElement */: case 231 /* AsExpression */: case 229 /* OmittedExpression */: - case 356 /* CommaListExpression */: - case 355 /* PartiallyEmittedExpression */: + case 357 /* CommaListExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: return true; default: @@ -12494,7 +12624,7 @@ ${lanes.join("\n")} return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 354 /* NotEmittedStatement */ || kind === 358 /* EndOfDeclarationMarker */ || kind === 357 /* MergeDeclarationMarker */; + return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 355 /* NotEmittedStatement */ || kind === 359 /* EndOfDeclarationMarker */ || kind === 358 /* MergeDeclarationMarker */; } function isDeclaration(node) { if (node.kind === 165 /* TypeParameter */) { @@ -12555,13 +12685,13 @@ ${lanes.join("\n")} return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */; } function isJSDocNode(node) { - return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */; + return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */; } function isJSDocCommentContainingNode(node) { return node.kind === 323 /* JSDoc */ || node.kind === 322 /* JSDocNamepathType */ || node.kind === 324 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } function isJSDocTag(node) { - return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 352 /* LastJSDocTagNode */; + return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */; } function isSetAccessor(node) { return node.kind === 175 /* SetAccessor */; @@ -12981,7 +13111,7 @@ ${lanes.join("\n")} if (includeJsDoc && hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 353 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return skipTrivia( @@ -13033,6 +13163,10 @@ ${lanes.join("\n")} const emitNode = node.emitNode; return emitNode && emitNode.flags || 0; } + function getInternalEmitFlags(node) { + const emitNode = node.emitNode; + return emitNode && emitNode.internalFlags || 0; + } function getScriptTargetFeatures() { return { es2015: { @@ -13282,6 +13416,7 @@ ${lanes.join("\n")} return false; } function isDeclarationWithTypeParameters(node) { + Debug.type(node); switch (node.kind) { case 341 /* JSDocCallbackTag */: case 349 /* JSDocTypedefTag */: @@ -13293,6 +13428,7 @@ ${lanes.join("\n")} } } function isDeclarationWithTypeParameterChildren(node) { + Debug.type(node); switch (node.kind) { case 176 /* CallSignature */: case 177 /* ConstructSignature */: @@ -13373,10 +13509,11 @@ ${lanes.join("\n")} return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } function tryGetTextOfPropertyName(name) { + var _a2; switch (name.kind) { case 79 /* Identifier */: case 80 /* PrivateIdentifier */: - return name.autoGenerate ? void 0 : name.escapedText; + return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: @@ -13425,11 +13562,14 @@ ${lanes.join("\n")} const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); } - function createDiagnosticForNodeFromMessageChain(node, messageChain, relatedInformation) { - const sourceFile = getSourceFileOfNode(node); + function createDiagnosticForNodeFromMessageChain(sourceFile, node, messageChain, relatedInformation) { const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation); } + function createDiagnosticForNodeArrayFromMessageChain(sourceFile, nodes, messageChain, relatedInformation) { + const start = skipTrivia(sourceFile.text, nodes.pos); + return createFileDiagnosticFromMessageChain(sourceFile, start, nodes.end - start, messageChain, relatedInformation); + } function assertDiagnosticLocation(file, start, length2) { Debug.assertGreaterThanOrEqual(start, 0); Debug.assertGreaterThanOrEqual(length2, 0); @@ -13494,6 +13634,20 @@ ${lanes.join("\n")} const start = scanner2.getTokenPos(); return createTextSpanFromBounds(start, scanner2.getTextPos()); } + function scanTokenAtPosition(sourceFile, pos) { + const scanner2 = createScanner( + sourceFile.languageVersion, + /*skipTrivia*/ + true, + sourceFile.languageVariant, + sourceFile.text, + /*onError:*/ + void 0, + pos + ); + scanner2.scan(); + return scanner2.getToken(); + } function getErrorSpanForArrowFunction(sourceFile, node) { const pos = skipTrivia(sourceFile.text, node.pos); if (node.body && node.body.kind === 238 /* Block */) { @@ -14082,47 +14236,90 @@ ${lanes.join("\n")} return node.expression; } } - function nodeCanBeDecorated(node, parent2, grandparent) { - if (isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { + function nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent) { + if (useLegacyDecorators && isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { return false; } switch (node.kind) { case 260 /* ClassDeclaration */: return true; + case 228 /* ClassExpression */: + return !useLegacyDecorators; case 169 /* PropertyDeclaration */: - return parent2.kind === 260 /* ClassDeclaration */; + return parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); case 174 /* GetAccessor */: case 175 /* SetAccessor */: case 171 /* MethodDeclaration */: - return node.body !== void 0 && parent2.kind === 260 /* ClassDeclaration */; + return node.body !== void 0 && parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2)); case 166 /* Parameter */: - return parent2.body !== void 0 && (parent2.kind === 173 /* Constructor */ || parent2.kind === 171 /* MethodDeclaration */ || parent2.kind === 175 /* SetAccessor */) && grandparent.kind === 260 /* ClassDeclaration */; + if (!useLegacyDecorators) + return false; + return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 173 /* Constructor */ || parent2.kind === 171 /* MethodDeclaration */ || parent2.kind === 175 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 260 /* ClassDeclaration */; } return false; } - function nodeIsDecorated(node, parent2, grandparent) { - return hasDecorators(node) && nodeCanBeDecorated(node, parent2, grandparent); + function nodeIsDecorated(useLegacyDecorators, node, parent2, grandparent) { + return hasDecorators(node) && nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent); } - function nodeOrChildIsDecorated(node, parent2, grandparent) { - return nodeIsDecorated(node, parent2, grandparent) || childIsDecorated(node, parent2); + function nodeOrChildIsDecorated(useLegacyDecorators, node, parent2, grandparent) { + return nodeIsDecorated(useLegacyDecorators, node, parent2, grandparent) || childIsDecorated(useLegacyDecorators, node, parent2); } - function childIsDecorated(node, parent2) { + function childIsDecorated(useLegacyDecorators, node, parent2) { switch (node.kind) { case 260 /* ClassDeclaration */: - return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2)); + return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); + case 228 /* ClassExpression */: + return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); case 171 /* MethodDeclaration */: case 175 /* SetAccessor */: case 173 /* Constructor */: - return some(node.parameters, (p) => nodeIsDecorated(p, node, parent2)); + return some(node.parameters, (p) => nodeIsDecorated(useLegacyDecorators, p, node, parent2)); default: return false; } } - function classOrConstructorParameterIsDecorated(node) { - if (nodeIsDecorated(node)) + function classOrConstructorParameterIsDecorated(useLegacyDecorators, node) { + if (nodeIsDecorated(useLegacyDecorators, node)) return true; const constructor = getFirstConstructorWithBody(node); - return !!constructor && childIsDecorated(constructor, node); + return !!constructor && childIsDecorated(useLegacyDecorators, constructor, node); + } + function classElementOrClassElementParameterIsDecorated(useLegacyDecorators, node, parent2) { + let parameters; + if (isAccessor(node)) { + const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(parent2.members, node); + const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0; + if (!firstAccessorWithDecorators || node !== firstAccessorWithDecorators) { + return false; + } + parameters = setAccessor == null ? void 0 : setAccessor.parameters; + } else if (isMethodDeclaration(node)) { + parameters = node.parameters; + } + if (nodeIsDecorated(useLegacyDecorators, node, parent2)) { + return true; + } + if (parameters) { + for (const parameter of parameters) { + if (parameterIsThisKeyword(parameter)) + continue; + if (nodeIsDecorated(useLegacyDecorators, parameter, node, parent2)) + return true; + } + } + return false; + } + function isEmptyStringLiteral(node) { + if (node.textSourceNode) { + switch (node.textSourceNode.kind) { + case 10 /* StringLiteral */: + return isEmptyStringLiteral(node.textSourceNode); + case 14 /* NoSubstitutionTemplateLiteral */: + return node.text === ""; + } + return false; + } + return node.text === ""; } function isJSXTagName(node) { const { parent: parent2 } = node; @@ -14319,6 +14516,9 @@ ${lanes.join("\n")} true ); } + function isBindingElementOfBareOrAccessedRequire(node) { + return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); + } function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) { return isVariableDeclaration(node) && !!node.initializer && isRequireCall( allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, @@ -14563,7 +14763,7 @@ ${lanes.join("\n")} } function setValueDeclaration(symbol, node) { const { valueDeclaration } = symbol; - if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { + if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !isInJSFile(node) && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { symbol.valueDeclaration = node; } } @@ -14578,6 +14778,7 @@ ${lanes.join("\n")} var _a2, _b; switch (node.kind) { case 257 /* VariableDeclaration */: + case 205 /* BindingElement */: return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall( node2, /*requireStringLiteralLikeArgument*/ @@ -14587,6 +14788,14 @@ ${lanes.join("\n")} return tryCast(node.moduleSpecifier, isStringLiteralLike); case 268 /* ImportEqualsDeclaration */: return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); + case 270 /* ImportClause */: + case 277 /* NamespaceExport */: + return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); + case 271 /* NamespaceImport */: + case 278 /* ExportSpecifier */: + return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); + case 273 /* ImportSpecifier */: + return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); default: Debug.assertNever(node); } @@ -14832,7 +15041,7 @@ ${lanes.join("\n")} return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0; } function ownsJSDocTag(hostNode, tag) { - return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; + return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; } function getNextJSDocCommentLocation(node) { const parent2 = node.parent; @@ -15176,7 +15385,8 @@ ${lanes.join("\n")} const token = stringToToken(name); return token !== void 0 && isKeyword(token); } - function isIdentifierANonContextualKeyword({ originalKeywordKind }) { + function isIdentifierANonContextualKeyword(node) { + const originalKeywordKind = identifierToKeywordKind(node); return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind); } function isTrivia(token) { @@ -15287,6 +15497,72 @@ ${lanes.join("\n")} function isESSymbolIdentifier(node) { return node.kind === 79 /* Identifier */ && node.escapedText === "Symbol"; } + function isProtoSetter(node) { + return isIdentifier(node) ? idText(node) === "__proto__" : isStringLiteral(node) && node.text === "__proto__"; + } + function isAnonymousFunctionDefinition(node, cb) { + node = skipOuterExpressions(node); + switch (node.kind) { + case 228 /* ClassExpression */: + case 215 /* FunctionExpression */: + if (node.name) { + return false; + } + break; + case 216 /* ArrowFunction */: + break; + default: + return false; + } + return typeof cb === "function" ? cb(node) : true; + } + function isNamedEvaluationSource(node) { + switch (node.kind) { + case 299 /* PropertyAssignment */: + return !isProtoSetter(node.name); + case 300 /* ShorthandPropertyAssignment */: + return !!node.objectAssignmentInitializer; + case 257 /* VariableDeclaration */: + return isIdentifier(node.name) && !!node.initializer; + case 166 /* Parameter */: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 205 /* BindingElement */: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 169 /* PropertyDeclaration */: + return !!node.initializer; + case 223 /* BinaryExpression */: + switch (node.operatorToken.kind) { + case 63 /* EqualsToken */: + case 76 /* AmpersandAmpersandEqualsToken */: + case 75 /* BarBarEqualsToken */: + case 77 /* QuestionQuestionEqualsToken */: + return isIdentifier(node.left); + } + break; + case 274 /* ExportAssignment */: + return true; + } + return false; + } + function isNamedEvaluation(node, cb) { + if (!isNamedEvaluationSource(node)) + return false; + switch (node.kind) { + case 299 /* PropertyAssignment */: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 300 /* ShorthandPropertyAssignment */: + return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); + case 257 /* VariableDeclaration */: + case 166 /* Parameter */: + case 205 /* BindingElement */: + case 169 /* PropertyDeclaration */: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 223 /* BinaryExpression */: + return isAnonymousFunctionDefinition(node.right, cb); + case 274 /* ExportAssignment */: + return isAnonymousFunctionDefinition(node.expression, cb); + } + } function isPushOrUnshiftIdentifier(node) { return node.escapedText === "push" || node.escapedText === "unshift"; } @@ -15367,7 +15643,7 @@ ${lanes.join("\n")} } function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return 0 /* Comma */; case 227 /* SpreadElement */: return 1 /* Spread */; @@ -15975,7 +16251,7 @@ ${lanes.join("\n")} return node.parent.kind === 183 /* TypeQuery */; } function identifierIsThisKeyword(id) { - return id.originalKeywordKind === 108 /* ThisKeyword */; + return id.escapedText === "this"; } function getAllAccessorDeclarations(declarations, accessor) { let firstAccessor; @@ -16286,7 +16562,7 @@ ${lanes.join("\n")} } function getSyntacticModifierFlagsNoCache(node) { let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */; - if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) { + if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { flags |= 1 /* Export */; } return flags; @@ -16337,14 +16613,23 @@ ${lanes.join("\n")} } return 0 /* None */; } + function isBinaryLogicalOperator(token) { + return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */; + } function isLogicalOperator(token) { - return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */ || token === 53 /* ExclamationToken */; + return isBinaryLogicalOperator(token) || token === 53 /* ExclamationToken */; } function isLogicalOrCoalescingAssignmentOperator(token) { return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */; } function isLogicalOrCoalescingAssignmentExpression(expr) { - return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); + return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); + } + function isLogicalOrCoalescingBinaryOperator(token) { + return isBinaryLogicalOperator(token) || token === 60 /* QuestionQuestionToken */; + } + function isLogicalOrCoalescingBinaryExpression(expr) { + return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind); } function isAssignmentOperator(token) { return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */; @@ -16581,14 +16866,14 @@ ${lanes.join("\n")} function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); } - function getNewLineCharacter(options, getNewLine) { + function getNewLineCharacter(options) { switch (options.newLine) { case 0 /* CarriageReturnLineFeed */: return carriageReturnLineFeed; case 1 /* LineFeed */: + case void 0: return lineFeed; } - return getNewLine ? getNewLine() : sys ? sys.newLine : carriageReturnLineFeed; } function createRange(pos, end = pos) { Debug.assert(end >= pos || end === -1); @@ -16605,6 +16890,9 @@ ${lanes.join("\n")} return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; } function moveRangePastModifiers(node) { + if (isPropertyDeclaration(node) || isMethodDeclaration(node)) { + return moveRangePos(node, node.name.pos); + } const lastModifier = canHaveModifiers(node) ? lastOrUndefined(node.modifiers) : void 0; return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); } @@ -16718,7 +17006,7 @@ ${lanes.join("\n")} return filter(node.declarations, isInitializedVariable); } function isInitializedVariable(node) { - return node.initializer !== void 0; + return isVariableDeclaration(node) && node.initializer !== void 0; } function isWatchSet(options) { return options.watch && hasProperty(options, "watch"); @@ -16899,7 +17187,7 @@ ${lanes.join("\n")} return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node); } function isTypeNodeKind(kind) { - return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; + return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 139 /* IntrinsicKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; } function isAccessExpression(node) { return node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */; @@ -16981,7 +17269,7 @@ ${lanes.join("\n")} case 209 /* ElementAccessExpression */: case 208 /* PropertyAccessExpression */: case 232 /* NonNullExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: node = node.expression; continue; @@ -17049,15 +17337,19 @@ ${lanes.join("\n")} this.parent = void 0; this.original = void 0; this.emitNode = void 0; - this.flowNode = void 0; } function SourceMapSource(fileName, text, skipTrivia2) { this.fileName = fileName; this.text = text; this.skipTrivia = skipTrivia2 || ((pos) => pos); } + function addObjectAllocatorPatcher(fn) { + objectAllocatorPatchers.push(fn); + fn(objectAllocator); + } function setObjectAllocator(alloc) { Object.assign(objectAllocator, alloc); + forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator)); } function formatStringFromArgs(text, args, baseIndex = 0) { return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index + baseIndex])); @@ -17343,6 +17635,12 @@ ${lanes.join("\n")} return false; } } + function getIsolatedModules(options) { + return !!(options.isolatedModules || options.verbatimModuleSyntax); + } + function importNameElisionDisabled(options) { + return options.verbatimModuleSyntax || options.isolatedModules && options.preserveValueImports; + } function unreachableCodeIsError(options) { return options.allowUnreachableCode === false; } @@ -18200,7 +18498,7 @@ ${lanes.join("\n")} return node.parent.templateSpans; case 167 /* Decorator */: { const { parent: parent4 } = node; - return canHaveDecorators(parent4) ? parent4.modifiers : canHaveIllegalDecorators(parent4) ? parent4.illegalDecorators : void 0; + return canHaveDecorators(parent4) ? parent4.modifiers : void 0; } case 294 /* HeritageClause */: return node.parent.heritageClauses; @@ -18218,7 +18516,7 @@ ${lanes.join("\n")} return parent2.types; case 186 /* TupleType */: case 206 /* ArrayLiteralExpression */: - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: case 272 /* NamedImports */: case 276 /* NamedExports */: return parent2.elements; @@ -18403,7 +18701,17 @@ ${lanes.join("\n")} const kind = node.kind; return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression); } - var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries; + function isJSDocSatisfiesExpression(node) { + return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); + } + function getJSDocSatisfiesExpressionType(node) { + return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node)); + } + function tryGetJSDocSatisfiesTypeNode(node) { + const tag = getJSDocSatisfiesTag(node); + return tag && tag.typeExpression && tag.typeExpression.type; + } + var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries; var init_utilities = __esm({ "src/compiler/utilities.ts"() { "use strict"; @@ -18524,6 +18832,7 @@ ${lanes.join("\n")} getSignatureConstructor: () => Signature2, getSourceMapSourceConstructor: () => SourceMapSource }; + objectAllocatorPatchers = []; reservedCharacterPattern = /[^\w\s\/]/g; wildcardCharCodes = [42 /* asterisk */, 63 /* question */]; commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; @@ -19064,7 +19373,7 @@ ${lanes.join("\n")} if (!node.body) return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); const updated = factory2.createFunctionExpression( - node.modifiers, + getModifiers(node), node.asteriskToken, node.name, node.typeParameters, @@ -19203,46 +19512,45 @@ ${lanes.join("\n")} }, baseFactory: baseFactory2, flags, - createNodeArray: createNodeArray2, - createNumericLiteral: createNumericLiteral2, - createBigIntLiteral: createBigIntLiteral2, - createStringLiteral: createStringLiteral2, - createStringLiteralFromNode: createStringLiteralFromNode2, - createRegularExpressionLiteral: createRegularExpressionLiteral2, + createNodeArray, + createNumericLiteral, + createBigIntLiteral, + createStringLiteral, + createStringLiteralFromNode, + createRegularExpressionLiteral, createLiteralLikeNode, - createIdentifier: createIdentifier3, - updateIdentifier, - createTempVariable: createTempVariable3, - createLoopVariable: createLoopVariable2, - createUniqueName: createUniqueName2, - getGeneratedNameForNode: getGeneratedNameForNode3, - createPrivateIdentifier: createPrivateIdentifier2, + createIdentifier, + createTempVariable, + createLoopVariable, + createUniqueName, + getGeneratedNameForNode, + createPrivateIdentifier, createUniquePrivateName, getGeneratedPrivateNameForNode, - createToken: createToken3, - createSuper: createSuper2, - createThis: createThis2, - createNull: createNull2, - createTrue: createTrue2, - createFalse: createFalse2, - createModifier: createModifier2, - createModifiersFromModifierFlags: createModifiersFromModifierFlags2, - createQualifiedName: createQualifiedName2, - updateQualifiedName: updateQualifiedName2, - createComputedPropertyName: createComputedPropertyName2, - updateComputedPropertyName: updateComputedPropertyName2, - createTypeParameterDeclaration: createTypeParameterDeclaration2, - updateTypeParameterDeclaration: updateTypeParameterDeclaration2, + createToken, + createSuper, + createThis, + createNull, + createTrue, + createFalse, + createModifier, + createModifiersFromModifierFlags, + createQualifiedName, + updateQualifiedName, + createComputedPropertyName, + updateComputedPropertyName, + createTypeParameterDeclaration, + updateTypeParameterDeclaration, createParameterDeclaration, updateParameterDeclaration, - createDecorator: createDecorator2, - updateDecorator: updateDecorator2, - createPropertySignature: createPropertySignature3, - updatePropertySignature: updatePropertySignature3, + createDecorator, + updateDecorator, + createPropertySignature, + updatePropertySignature, createPropertyDeclaration, updatePropertyDeclaration: updatePropertyDeclaration2, - createMethodSignature: createMethodSignature3, - updateMethodSignature: updateMethodSignature3, + createMethodSignature, + updateMethodSignature, createMethodDeclaration, updateMethodDeclaration, createConstructorDeclaration, @@ -19251,96 +19559,96 @@ ${lanes.join("\n")} updateGetAccessorDeclaration, createSetAccessorDeclaration, updateSetAccessorDeclaration, - createCallSignature: createCallSignature2, - updateCallSignature: updateCallSignature2, - createConstructSignature: createConstructSignature2, - updateConstructSignature: updateConstructSignature2, - createIndexSignature: createIndexSignature3, - updateIndexSignature: updateIndexSignature2, + createCallSignature, + updateCallSignature, + createConstructSignature, + updateConstructSignature, + createIndexSignature, + updateIndexSignature, createClassStaticBlockDeclaration, updateClassStaticBlockDeclaration, createTemplateLiteralTypeSpan, updateTemplateLiteralTypeSpan, - createKeywordTypeNode: createKeywordTypeNode2, - createTypePredicateNode: createTypePredicateNode3, - updateTypePredicateNode: updateTypePredicateNode3, - createTypeReferenceNode: createTypeReferenceNode2, - updateTypeReferenceNode: updateTypeReferenceNode2, - createFunctionTypeNode: createFunctionTypeNode2, - updateFunctionTypeNode: updateFunctionTypeNode2, - createConstructorTypeNode: createConstructorTypeNode2, - updateConstructorTypeNode: updateConstructorTypeNode2, - createTypeQueryNode: createTypeQueryNode2, - updateTypeQueryNode: updateTypeQueryNode2, - createTypeLiteralNode: createTypeLiteralNode2, - updateTypeLiteralNode: updateTypeLiteralNode2, - createArrayTypeNode: createArrayTypeNode2, - updateArrayTypeNode: updateArrayTypeNode2, - createTupleTypeNode: createTupleTypeNode2, - updateTupleTypeNode: updateTupleTypeNode2, + createKeywordTypeNode, + createTypePredicateNode, + updateTypePredicateNode, + createTypeReferenceNode, + updateTypeReferenceNode, + createFunctionTypeNode, + updateFunctionTypeNode, + createConstructorTypeNode, + updateConstructorTypeNode, + createTypeQueryNode, + updateTypeQueryNode, + createTypeLiteralNode, + updateTypeLiteralNode, + createArrayTypeNode, + updateArrayTypeNode, + createTupleTypeNode, + updateTupleTypeNode, createNamedTupleMember, updateNamedTupleMember, - createOptionalTypeNode: createOptionalTypeNode2, - updateOptionalTypeNode: updateOptionalTypeNode2, - createRestTypeNode: createRestTypeNode2, - updateRestTypeNode: updateRestTypeNode2, - createUnionTypeNode: createUnionTypeNode2, - updateUnionTypeNode: updateUnionTypeNode2, - createIntersectionTypeNode: createIntersectionTypeNode2, - updateIntersectionTypeNode: updateIntersectionTypeNode2, - createConditionalTypeNode: createConditionalTypeNode2, - updateConditionalTypeNode: updateConditionalTypeNode2, - createInferTypeNode: createInferTypeNode2, - updateInferTypeNode: updateInferTypeNode2, - createImportTypeNode: createImportTypeNode2, - updateImportTypeNode: updateImportTypeNode2, - createParenthesizedType: createParenthesizedType2, - updateParenthesizedType: updateParenthesizedType2, - createThisTypeNode: createThisTypeNode2, - createTypeOperatorNode: createTypeOperatorNode3, - updateTypeOperatorNode: updateTypeOperatorNode2, - createIndexedAccessTypeNode: createIndexedAccessTypeNode2, - updateIndexedAccessTypeNode: updateIndexedAccessTypeNode2, - createMappedTypeNode: createMappedTypeNode2, - updateMappedTypeNode: updateMappedTypeNode2, - createLiteralTypeNode: createLiteralTypeNode2, - updateLiteralTypeNode: updateLiteralTypeNode2, + createOptionalTypeNode, + updateOptionalTypeNode, + createRestTypeNode, + updateRestTypeNode, + createUnionTypeNode, + updateUnionTypeNode, + createIntersectionTypeNode, + updateIntersectionTypeNode, + createConditionalTypeNode, + updateConditionalTypeNode, + createInferTypeNode, + updateInferTypeNode, + createImportTypeNode, + updateImportTypeNode, + createParenthesizedType, + updateParenthesizedType, + createThisTypeNode, + createTypeOperatorNode, + updateTypeOperatorNode, + createIndexedAccessTypeNode, + updateIndexedAccessTypeNode, + createMappedTypeNode, + updateMappedTypeNode, + createLiteralTypeNode, + updateLiteralTypeNode, createTemplateLiteralType, updateTemplateLiteralType, - createObjectBindingPattern: createObjectBindingPattern2, - updateObjectBindingPattern: updateObjectBindingPattern2, - createArrayBindingPattern: createArrayBindingPattern2, - updateArrayBindingPattern: updateArrayBindingPattern2, - createBindingElement: createBindingElement2, - updateBindingElement: updateBindingElement2, + createObjectBindingPattern, + updateObjectBindingPattern, + createArrayBindingPattern, + updateArrayBindingPattern, + createBindingElement, + updateBindingElement, createArrayLiteralExpression, updateArrayLiteralExpression, createObjectLiteralExpression, updateObjectLiteralExpression, createPropertyAccessExpression: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, name) => setEmitFlags(createPropertyAccessExpression(expression, name), 262144 /* NoIndentation */) : createPropertyAccessExpression, updatePropertyAccessExpression, - createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain2(expression, questionDotToken, name), 262144 /* NoIndentation */) : createPropertyAccessChain2, - updatePropertyAccessChain: updatePropertyAccessChain2, + createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain(expression, questionDotToken, name), 262144 /* NoIndentation */) : createPropertyAccessChain, + updatePropertyAccessChain, createElementAccessExpression, updateElementAccessExpression, - createElementAccessChain: createElementAccessChain2, - updateElementAccessChain: updateElementAccessChain2, + createElementAccessChain, + updateElementAccessChain, createCallExpression, updateCallExpression, - createCallChain: createCallChain2, - updateCallChain: updateCallChain2, + createCallChain, + updateCallChain, createNewExpression, updateNewExpression, createTaggedTemplateExpression, updateTaggedTemplateExpression, - createTypeAssertion: createTypeAssertion2, - updateTypeAssertion: updateTypeAssertion2, + createTypeAssertion, + updateTypeAssertion, createParenthesizedExpression, updateParenthesizedExpression, - createFunctionExpression: createFunctionExpression2, - updateFunctionExpression: updateFunctionExpression2, - createArrowFunction: createArrowFunction3, - updateArrowFunction: updateArrowFunction3, + createFunctionExpression, + updateFunctionExpression, + createArrowFunction, + updateArrowFunction, createDeleteExpression, updateDeleteExpression, createTypeOfExpression, @@ -19357,42 +19665,42 @@ ${lanes.join("\n")} updateBinaryExpression, createConditionalExpression, updateConditionalExpression, - createTemplateExpression: createTemplateExpression2, - updateTemplateExpression: updateTemplateExpression2, - createTemplateHead: createTemplateHead2, - createTemplateMiddle: createTemplateMiddle2, - createTemplateTail: createTemplateTail2, - createNoSubstitutionTemplateLiteral: createNoSubstitutionTemplateLiteral2, + createTemplateExpression, + updateTemplateExpression, + createTemplateHead, + createTemplateMiddle, + createTemplateTail, + createNoSubstitutionTemplateLiteral, createTemplateLiteralLikeNode, createYieldExpression, updateYieldExpression, createSpreadElement, updateSpreadElement, - createClassExpression: createClassExpression3, - updateClassExpression: updateClassExpression3, - createOmittedExpression: createOmittedExpression2, - createExpressionWithTypeArguments: createExpressionWithTypeArguments3, - updateExpressionWithTypeArguments: updateExpressionWithTypeArguments3, - createAsExpression: createAsExpression2, - updateAsExpression: updateAsExpression2, - createNonNullExpression: createNonNullExpression2, - updateNonNullExpression: updateNonNullExpression2, + createClassExpression, + updateClassExpression, + createOmittedExpression, + createExpressionWithTypeArguments, + updateExpressionWithTypeArguments, + createAsExpression, + updateAsExpression, + createNonNullExpression, + updateNonNullExpression, createSatisfiesExpression, updateSatisfiesExpression, - createNonNullChain: createNonNullChain2, - updateNonNullChain: updateNonNullChain2, - createMetaProperty: createMetaProperty2, - updateMetaProperty: updateMetaProperty2, - createTemplateSpan: createTemplateSpan2, - updateTemplateSpan: updateTemplateSpan2, - createSemicolonClassElement: createSemicolonClassElement2, - createBlock: createBlock2, - updateBlock: updateBlock2, - createVariableStatement: createVariableStatement2, - updateVariableStatement: updateVariableStatement2, - createEmptyStatement: createEmptyStatement2, - createExpressionStatement: createExpressionStatement2, - updateExpressionStatement: updateExpressionStatement2, + createNonNullChain, + updateNonNullChain, + createMetaProperty, + updateMetaProperty, + createTemplateSpan, + updateTemplateSpan, + createSemicolonClassElement, + createBlock, + updateBlock, + createVariableStatement, + updateVariableStatement, + createEmptyStatement, + createExpressionStatement, + updateExpressionStatement, createIfStatement, updateIfStatement, createDoStatement, @@ -19421,60 +19729,60 @@ ${lanes.join("\n")} updateThrowStatement, createTryStatement, updateTryStatement, - createDebuggerStatement: createDebuggerStatement2, - createVariableDeclaration: createVariableDeclaration3, - updateVariableDeclaration: updateVariableDeclaration3, - createVariableDeclarationList: createVariableDeclarationList2, - updateVariableDeclarationList: updateVariableDeclarationList2, - createFunctionDeclaration: createFunctionDeclaration2, - updateFunctionDeclaration: updateFunctionDeclaration2, - createClassDeclaration: createClassDeclaration2, - updateClassDeclaration: updateClassDeclaration2, - createInterfaceDeclaration: createInterfaceDeclaration2, - updateInterfaceDeclaration: updateInterfaceDeclaration2, - createTypeAliasDeclaration: createTypeAliasDeclaration2, - updateTypeAliasDeclaration: updateTypeAliasDeclaration2, - createEnumDeclaration: createEnumDeclaration2, - updateEnumDeclaration: updateEnumDeclaration2, - createModuleDeclaration: createModuleDeclaration2, - updateModuleDeclaration: updateModuleDeclaration2, - createModuleBlock: createModuleBlock2, - updateModuleBlock: updateModuleBlock2, - createCaseBlock: createCaseBlock2, - updateCaseBlock: updateCaseBlock2, - createNamespaceExportDeclaration: createNamespaceExportDeclaration2, - updateNamespaceExportDeclaration: updateNamespaceExportDeclaration2, - createImportEqualsDeclaration: createImportEqualsDeclaration2, - updateImportEqualsDeclaration: updateImportEqualsDeclaration2, - createImportDeclaration: createImportDeclaration2, - updateImportDeclaration: updateImportDeclaration2, - createImportClause: createImportClause3, - updateImportClause: updateImportClause3, + createDebuggerStatement, + createVariableDeclaration, + updateVariableDeclaration, + createVariableDeclarationList, + updateVariableDeclarationList, + createFunctionDeclaration, + updateFunctionDeclaration, + createClassDeclaration, + updateClassDeclaration, + createInterfaceDeclaration, + updateInterfaceDeclaration, + createTypeAliasDeclaration, + updateTypeAliasDeclaration, + createEnumDeclaration, + updateEnumDeclaration, + createModuleDeclaration, + updateModuleDeclaration, + createModuleBlock, + updateModuleBlock, + createCaseBlock, + updateCaseBlock, + createNamespaceExportDeclaration, + updateNamespaceExportDeclaration, + createImportEqualsDeclaration, + updateImportEqualsDeclaration, + createImportDeclaration, + updateImportDeclaration, + createImportClause, + updateImportClause, createAssertClause, updateAssertClause, createAssertEntry, updateAssertEntry, createImportTypeAssertionContainer, updateImportTypeAssertionContainer, - createNamespaceImport: createNamespaceImport2, - updateNamespaceImport: updateNamespaceImport2, - createNamespaceExport: createNamespaceExport2, - updateNamespaceExport: updateNamespaceExport2, - createNamedImports: createNamedImports2, - updateNamedImports: updateNamedImports2, - createImportSpecifier: createImportSpecifier2, - updateImportSpecifier: updateImportSpecifier2, - createExportAssignment: createExportAssignment3, - updateExportAssignment: updateExportAssignment2, - createExportDeclaration: createExportDeclaration3, - updateExportDeclaration: updateExportDeclaration3, - createNamedExports: createNamedExports2, - updateNamedExports: updateNamedExports2, - createExportSpecifier: createExportSpecifier2, - updateExportSpecifier: updateExportSpecifier2, + createNamespaceImport, + updateNamespaceImport, + createNamespaceExport, + updateNamespaceExport, + createNamedImports, + updateNamedImports, + createImportSpecifier, + updateImportSpecifier, + createExportAssignment: createExportAssignment2, + updateExportAssignment, + createExportDeclaration, + updateExportDeclaration, + createNamedExports, + updateNamedExports, + createExportSpecifier, + updateExportSpecifier, createMissingDeclaration, - createExternalModuleReference: createExternalModuleReference2, - updateExternalModuleReference: updateExternalModuleReference2, + createExternalModuleReference, + updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(315 /* JSDocAllType */); @@ -19514,27 +19822,27 @@ ${lanes.join("\n")} }, createJSDocFunctionType, updateJSDocFunctionType, - createJSDocTypeLiteral: createJSDocTypeLiteral2, + createJSDocTypeLiteral, updateJSDocTypeLiteral, - createJSDocTypeExpression: createJSDocTypeExpression2, + createJSDocTypeExpression, updateJSDocTypeExpression, - createJSDocSignature: createJSDocSignature2, + createJSDocSignature, updateJSDocSignature, - createJSDocTemplateTag: createJSDocTemplateTag2, + createJSDocTemplateTag, updateJSDocTemplateTag, - createJSDocTypedefTag: createJSDocTypedefTag2, + createJSDocTypedefTag, updateJSDocTypedefTag, - createJSDocParameterTag: createJSDocParameterTag2, + createJSDocParameterTag, updateJSDocParameterTag, - createJSDocPropertyTag: createJSDocPropertyTag2, + createJSDocPropertyTag, updateJSDocPropertyTag, - createJSDocCallbackTag: createJSDocCallbackTag2, + createJSDocCallbackTag, updateJSDocCallbackTag, createJSDocOverloadTag, updateJSDocOverloadTag, - createJSDocAugmentsTag: createJSDocAugmentsTag2, + createJSDocAugmentsTag, updateJSDocAugmentsTag, - createJSDocImplementsTag: createJSDocImplementsTag2, + createJSDocImplementsTag, updateJSDocImplementsTag, createJSDocSeeTag, updateJSDocSeeTag, @@ -19621,57 +19929,63 @@ ${lanes.join("\n")} get updateJSDocThrowsTag() { return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */); }, - createJSDocEnumTag: createJSDocEnumTag2, + get createJSDocSatisfiesTag() { + return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */); + }, + get updateJSDocSatisfiesTag() { + return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */); + }, + createJSDocEnumTag, updateJSDocEnumTag, createJSDocUnknownTag, updateJSDocUnknownTag, createJSDocText, updateJSDocText, - createJSDocComment: createJSDocComment2, + createJSDocComment, updateJSDocComment, - createJsxElement: createJsxElement2, - updateJsxElement: updateJsxElement2, - createJsxSelfClosingElement: createJsxSelfClosingElement2, - updateJsxSelfClosingElement: updateJsxSelfClosingElement2, - createJsxOpeningElement: createJsxOpeningElement2, - updateJsxOpeningElement: updateJsxOpeningElement2, - createJsxClosingElement: createJsxClosingElement2, - updateJsxClosingElement: updateJsxClosingElement2, - createJsxFragment: createJsxFragment2, - createJsxText: createJsxText2, - updateJsxText: updateJsxText2, - createJsxOpeningFragment: createJsxOpeningFragment2, - createJsxJsxClosingFragment: createJsxJsxClosingFragment2, - updateJsxFragment: updateJsxFragment2, - createJsxAttribute: createJsxAttribute2, - updateJsxAttribute: updateJsxAttribute2, - createJsxAttributes: createJsxAttributes2, - updateJsxAttributes: updateJsxAttributes2, - createJsxSpreadAttribute: createJsxSpreadAttribute2, - updateJsxSpreadAttribute: updateJsxSpreadAttribute2, - createJsxExpression: createJsxExpression2, - updateJsxExpression: updateJsxExpression2, - createCaseClause: createCaseClause2, - updateCaseClause: updateCaseClause2, - createDefaultClause: createDefaultClause2, - updateDefaultClause: updateDefaultClause2, - createHeritageClause: createHeritageClause2, - updateHeritageClause: updateHeritageClause2, - createCatchClause: createCatchClause2, - updateCatchClause: updateCatchClause2, - createPropertyAssignment: createPropertyAssignment2, - updatePropertyAssignment: updatePropertyAssignment2, - createShorthandPropertyAssignment: createShorthandPropertyAssignment2, - updateShorthandPropertyAssignment: updateShorthandPropertyAssignment2, - createSpreadAssignment: createSpreadAssignment2, - updateSpreadAssignment: updateSpreadAssignment2, - createEnumMember: createEnumMember2, - updateEnumMember: updateEnumMember2, + createJsxElement, + updateJsxElement, + createJsxSelfClosingElement, + updateJsxSelfClosingElement, + createJsxOpeningElement, + updateJsxOpeningElement, + createJsxClosingElement, + updateJsxClosingElement, + createJsxFragment, + createJsxText, + updateJsxText, + createJsxOpeningFragment, + createJsxJsxClosingFragment, + updateJsxFragment, + createJsxAttribute, + updateJsxAttribute, + createJsxAttributes, + updateJsxAttributes, + createJsxSpreadAttribute, + updateJsxSpreadAttribute, + createJsxExpression, + updateJsxExpression, + createCaseClause, + updateCaseClause, + createDefaultClause, + updateDefaultClause, + createHeritageClause, + updateHeritageClause, + createCatchClause, + updateCatchClause, + createPropertyAssignment, + updatePropertyAssignment, + createShorthandPropertyAssignment, + updateShorthandPropertyAssignment, + createSpreadAssignment, + updateSpreadAssignment, + createEnumMember, + updateEnumMember, createSourceFile: createSourceFile2, updateSourceFile: updateSourceFile2, createRedirectedSourceFile, - createBundle: createBundle2, - updateBundle: updateBundle2, + createBundle, + updateBundle, createUnparsedSource, createUnparsedPrologue, createUnparsedPrepend, @@ -19680,9 +19994,9 @@ ${lanes.join("\n")} createInputFiles: createInputFiles2, createSyntheticExpression, createSyntaxList: createSyntaxList3, - createNotEmittedStatement: createNotEmittedStatement2, - createPartiallyEmittedExpression: createPartiallyEmittedExpression2, - updatePartiallyEmittedExpression: updatePartiallyEmittedExpression2, + createNotEmittedStatement, + createPartiallyEmittedExpression, + updatePartiallyEmittedExpression, createCommaListExpression, updateCommaListExpression, createEndOfDeclarationMarker, @@ -19788,11 +20102,11 @@ ${lanes.join("\n")} return getPostfixUnaryCreateFunction(46 /* MinusMinusToken */); }, // Compound nodes - createImmediatelyInvokedFunctionExpression: createImmediatelyInvokedFunctionExpression2, - createImmediatelyInvokedArrowFunction: createImmediatelyInvokedArrowFunction2, - createVoidZero: createVoidZero2, - createExportDefault: createExportDefault2, - createExternalModuleExport: createExternalModuleExport2, + createImmediatelyInvokedFunctionExpression, + createImmediatelyInvokedArrowFunction, + createVoidZero, + createExportDefault, + createExternalModuleExport, createTypeCheck, createMethodCall, createGlobalMethodCall, @@ -19802,6 +20116,7 @@ ${lanes.join("\n")} createArraySliceCall, createArrayConcatCall, createObjectDefinePropertyCall, + createObjectGetOwnPropertyDescriptorCall, createReflectGetCall, createReflectSetCall, createPropertyDescriptor, @@ -19828,7 +20143,7 @@ ${lanes.join("\n")} }; forEach(nodeFactoryPatchers, (fn) => fn(factory2)); return factory2; - function createNodeArray2(elements, hasTrailingComma) { + function createNodeArray(elements, hasTrailingComma) { if (elements === void 0 || elements === emptyArray) { elements = []; } else if (isNodeArray(elements)) { @@ -19872,7 +20187,7 @@ ${lanes.join("\n")} } return update(updated, original); } - function createNumericLiteral2(value, numericLiteralFlags = 0 /* None */) { + function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) { const node = createBaseDeclaration(8 /* NumericLiteral */); node.text = typeof value === "number" ? value + "" : value; node.numericLiteralFlags = numericLiteralFlags; @@ -19880,7 +20195,7 @@ ${lanes.join("\n")} node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createBigIntLiteral2(value) { + function createBigIntLiteral(value) { const node = createBaseToken(9 /* BigIntLiteral */); node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n"; node.transformFlags |= 4 /* ContainsESNext */; @@ -19892,14 +20207,14 @@ ${lanes.join("\n")} node.singleQuote = isSingleQuote; return node; } - function createStringLiteral2(text, isSingleQuote, hasExtendedUnicodeEscape) { + function createStringLiteral(text, isSingleQuote, hasExtendedUnicodeEscape) { const node = createBaseStringLiteral(text, isSingleQuote); node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; if (hasExtendedUnicodeEscape) node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createStringLiteralFromNode2(sourceNode) { + function createStringLiteralFromNode(sourceNode) { const node = createBaseStringLiteral( getTextOfIdentifierOrLiteral(sourceNode), /*isSingleQuote*/ @@ -19908,7 +20223,7 @@ ${lanes.join("\n")} node.textSourceNode = sourceNode; return node; } - function createRegularExpressionLiteral2(text) { + function createRegularExpressionLiteral(text) { const node = createBaseToken(13 /* RegularExpressionLiteral */); node.text = text; return node; @@ -19916,33 +20231,33 @@ ${lanes.join("\n")} function createLiteralLikeNode(kind, text) { switch (kind) { case 8 /* NumericLiteral */: - return createNumericLiteral2( + return createNumericLiteral( text, /*numericLiteralFlags*/ 0 ); case 9 /* BigIntLiteral */: - return createBigIntLiteral2(text); + return createBigIntLiteral(text); case 10 /* StringLiteral */: - return createStringLiteral2( + return createStringLiteral( text, /*isSingleQuote*/ void 0 ); case 11 /* JsxText */: - return createJsxText2( + return createJsxText( text, /*containsOnlyTriviaWhiteSpaces*/ false ); case 12 /* JsxTextAllWhiteSpaces */: - return createJsxText2( + return createJsxText( text, /*containsOnlyTriviaWhiteSpaces*/ true ); case 13 /* RegularExpressionLiteral */: - return createRegularExpressionLiteral2(text); + return createRegularExpressionLiteral(text); case 14 /* NoSubstitutionTemplateLiteral */: return createTemplateLiteralLikeNode( kind, @@ -19954,56 +20269,44 @@ ${lanes.join("\n")} ); } } - function createBaseIdentifier(escapedText, originalKeywordKind) { + function createBaseIdentifier(escapedText) { const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */); - node.originalKeywordKind = originalKeywordKind; node.escapedText = escapedText; - node.autoGenerate = void 0; - node.typeArguments = void 0; - node.hasExtendedUnicodeEscape = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.symbol = void 0; return node; } function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { - const node = createBaseIdentifier( - escapeLeadingUnderscores(text), - /*originalKeywordKind*/ - void 0 - ); - node.autoGenerate = { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } - function createIdentifier3(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) { + function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) { if (originalKeywordKind === void 0 && text) { originalKeywordKind = stringToToken(text); } if (originalKeywordKind === 79 /* Identifier */) { originalKeywordKind = void 0; } - const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind); - node.typeArguments = asNodeArray(typeArguments); - node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; - if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + if (hasExtendedUnicodeEscape) + node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */; + if (node.escapedText === "await") { node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */; } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { node.transformFlags |= 1024 /* ContainsES2015 */; } return node; } - function updateIdentifier(node, typeArguments) { - return node.typeArguments !== typeArguments ? update(createIdentifier3(idText(node), typeArguments), node) : node; - } - function createTempVariable3(recordTempVariable, reservedInNestedScopes, prefix, suffix) { + function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { let flags2 = 1 /* Auto */; if (reservedInNestedScopes) flags2 |= 8 /* ReservedInNestedScopes */; @@ -20013,7 +20316,7 @@ ${lanes.join("\n")} } return name; } - function createLoopVariable2(reservedInNestedScopes) { + function createLoopVariable(reservedInNestedScopes) { let flags2 = 2 /* Loop */; if (reservedInNestedScopes) flags2 |= 8 /* ReservedInNestedScopes */; @@ -20026,12 +20329,12 @@ ${lanes.join("\n")} void 0 ); } - function createUniqueName2(text, flags2 = 0 /* None */, prefix, suffix) { + function createUniqueName(text, flags2 = 0 /* None */, prefix, suffix) { Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); Debug.assert((flags2 & (16 /* Optimistic */ | 32 /* FileLevel */)) !== 32 /* FileLevel */, "GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"); return createBaseGeneratedIdentifier(text, 3 /* Unique */ | flags2, prefix, suffix); } - function getGeneratedNameForNode3(node, flags2 = 0, prefix, suffix) { + function getGeneratedNameForNode(node, flags2 = 0, prefix, suffix) { Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); const text = !node ? "" : isMemberName(node) ? formatGeneratedName( /*privateName*/ @@ -20050,23 +20353,22 @@ ${lanes.join("\n")} function createBasePrivateIdentifier(escapedText) { const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */); node.escapedText = escapedText; - node.autoGenerate = void 0; node.transformFlags |= 16777216 /* ContainsClassFields */; return node; } - function createPrivateIdentifier2(text) { + function createPrivateIdentifier(text) { if (!startsWith(text, "#")) Debug.fail("First character of private identifier must be #: " + text); return createBasePrivateIdentifier(escapeLeadingUnderscores(text)); } function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text)); - node.autoGenerate = { + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } @@ -20093,7 +20395,7 @@ ${lanes.join("\n")} function createBaseToken(kind) { return baseFactory2.createBaseTokenNode(kind); } - function createToken3(token) { + function createToken(token) { Debug.assert(token >= 0 /* FirstToken */ && token <= 162 /* LastToken */, "Invalid token"); Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); @@ -20147,59 +20449,59 @@ ${lanes.join("\n")} } return node; } - function createSuper2() { - return createToken3(106 /* SuperKeyword */); + function createSuper() { + return createToken(106 /* SuperKeyword */); } - function createThis2() { - return createToken3(108 /* ThisKeyword */); + function createThis() { + return createToken(108 /* ThisKeyword */); } - function createNull2() { - return createToken3(104 /* NullKeyword */); + function createNull() { + return createToken(104 /* NullKeyword */); } - function createTrue2() { - return createToken3(110 /* TrueKeyword */); + function createTrue() { + return createToken(110 /* TrueKeyword */); } - function createFalse2() { - return createToken3(95 /* FalseKeyword */); + function createFalse() { + return createToken(95 /* FalseKeyword */); } - function createModifier2(kind) { - return createToken3(kind); + function createModifier(kind) { + return createToken(kind); } - function createModifiersFromModifierFlags2(flags2) { + function createModifiersFromModifierFlags(flags2) { const result = []; if (flags2 & 1 /* Export */) - result.push(createModifier2(93 /* ExportKeyword */)); + result.push(createModifier(93 /* ExportKeyword */)); if (flags2 & 2 /* Ambient */) - result.push(createModifier2(136 /* DeclareKeyword */)); + result.push(createModifier(136 /* DeclareKeyword */)); if (flags2 & 1024 /* Default */) - result.push(createModifier2(88 /* DefaultKeyword */)); + result.push(createModifier(88 /* DefaultKeyword */)); if (flags2 & 2048 /* Const */) - result.push(createModifier2(85 /* ConstKeyword */)); + result.push(createModifier(85 /* ConstKeyword */)); if (flags2 & 4 /* Public */) - result.push(createModifier2(123 /* PublicKeyword */)); + result.push(createModifier(123 /* PublicKeyword */)); if (flags2 & 8 /* Private */) - result.push(createModifier2(121 /* PrivateKeyword */)); + result.push(createModifier(121 /* PrivateKeyword */)); if (flags2 & 16 /* Protected */) - result.push(createModifier2(122 /* ProtectedKeyword */)); + result.push(createModifier(122 /* ProtectedKeyword */)); if (flags2 & 256 /* Abstract */) - result.push(createModifier2(126 /* AbstractKeyword */)); + result.push(createModifier(126 /* AbstractKeyword */)); if (flags2 & 32 /* Static */) - result.push(createModifier2(124 /* StaticKeyword */)); + result.push(createModifier(124 /* StaticKeyword */)); if (flags2 & 16384 /* Override */) - result.push(createModifier2(161 /* OverrideKeyword */)); + result.push(createModifier(161 /* OverrideKeyword */)); if (flags2 & 64 /* Readonly */) - result.push(createModifier2(146 /* ReadonlyKeyword */)); + result.push(createModifier(146 /* ReadonlyKeyword */)); if (flags2 & 128 /* Accessor */) - result.push(createModifier2(127 /* AccessorKeyword */)); + result.push(createModifier(127 /* AccessorKeyword */)); if (flags2 & 512 /* Async */) - result.push(createModifier2(132 /* AsyncKeyword */)); + result.push(createModifier(132 /* AsyncKeyword */)); if (flags2 & 32768 /* In */) - result.push(createModifier2(101 /* InKeyword */)); + result.push(createModifier(101 /* InKeyword */)); if (flags2 & 65536 /* Out */) - result.push(createModifier2(145 /* OutKeyword */)); + result.push(createModifier(145 /* OutKeyword */)); return result.length ? result : void 0; } - function createQualifiedName2(left, right) { + function createQualifiedName(left, right) { const node = createBaseNode(163 /* QualifiedName */); node.left = left; node.right = asName(right); @@ -20207,19 +20509,19 @@ ${lanes.join("\n")} node.flowNode = void 0; return node; } - function updateQualifiedName2(node, left, right) { - return node.left !== left || node.right !== right ? update(createQualifiedName2(left, right), node) : node; + function updateQualifiedName(node, left, right) { + return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node; } - function createComputedPropertyName2(expression) { + function createComputedPropertyName(expression) { const node = createBaseNode(164 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */; return node; } - function updateComputedPropertyName2(node, expression) { - return node.expression !== expression ? update(createComputedPropertyName2(expression), node) : node; + function updateComputedPropertyName(node, expression) { + return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node; } - function createTypeParameterDeclaration2(modifiers, name, constraint, defaultType) { + function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) { const node = createBaseDeclaration(165 /* TypeParameter */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -20228,11 +20530,10 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; node.expression = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateTypeParameterDeclaration2(node, modifiers, name, constraint, defaultType) { - return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration2(modifiers, name, constraint, defaultType), node) : node; + function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) { + return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node; } function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) { var _a2, _b; @@ -20249,13 +20550,12 @@ ${lanes.join("\n")} node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */); } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node; } - function createDecorator2(expression) { + function createDecorator(expression) { const node = createBaseNode(167 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -20265,10 +20565,10 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */; return node; } - function updateDecorator2(node, expression) { - return node.expression !== expression ? update(createDecorator2(expression), node) : node; + function updateDecorator(node, expression) { + return node.expression !== expression ? update(createDecorator(expression), node) : node; } - function createPropertySignature3(modifiers, name, questionToken, type) { + function createPropertySignature(modifiers, name, questionToken, type) { const node = createBaseDeclaration(168 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -20277,11 +20577,10 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; node.initializer = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updatePropertySignature3(node, modifiers, name, questionToken, type) { - return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature3(modifiers, name, questionToken, type), node) : node; + function updatePropertySignature(node, modifiers, name, questionToken, type) { + return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature(modifiers, name, questionToken, type), node) : node; } function finishUpdatePropertySignature(updated, original) { if (updated !== original) { @@ -20300,13 +20599,12 @@ ${lanes.join("\n")} const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer) { return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } - function createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type) { + function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { const node = createBaseDeclaration(170 /* MethodSignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -20316,14 +20614,13 @@ ${lanes.join("\n")} node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateMethodSignature3(node, modifiers, name, questionToken, typeParameters, parameters, type) { - return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; + function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) { + return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; } function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { const node = createBaseDeclaration(171 /* MethodDeclaration */); @@ -20333,7 +20630,7 @@ ${lanes.join("\n")} node.questionToken = questionToken; node.exclamationToken = void 0; node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body) { @@ -20346,7 +20643,6 @@ ${lanes.join("\n")} } node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -20367,10 +20663,8 @@ ${lanes.join("\n")} const node = createBaseDeclaration(172 /* ClassStaticBlockDeclaration */); node.body = body; node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -20382,7 +20676,6 @@ ${lanes.join("\n")} } function finishUpdateClassStaticBlockDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); @@ -20390,15 +20683,13 @@ ${lanes.join("\n")} function createConstructorDeclaration(modifiers, parameters, body) { const node = createBaseDeclaration(173 /* Constructor */); node.modifiers = asNodeArray(modifiers); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.body = body; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */; - node.illegalDecorators = void 0; node.typeParameters = void 0; node.type = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -20410,7 +20701,6 @@ ${lanes.join("\n")} } function finishUpdateConstructorDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.typeParameters = original.typeParameters; updated.type = original.type; } @@ -20420,7 +20710,7 @@ ${lanes.join("\n")} const node = createBaseDeclaration(174 /* GetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body) { @@ -20431,7 +20721,6 @@ ${lanes.join("\n")} node.typeArguments = void 0; node.typeParameters = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -20452,7 +20741,7 @@ ${lanes.join("\n")} const node = createBaseDeclaration(175 /* SetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.body = body; if (!node.body) { node.transformFlags = 1 /* ContainsTypeScript */; @@ -20463,7 +20752,6 @@ ${lanes.join("\n")} node.typeParameters = void 0; node.type = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -20481,54 +20769,50 @@ ${lanes.join("\n")} } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createCallSignature2(typeParameters, parameters, type) { + function createCallSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(176 /* CallSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateCallSignature2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature2(typeParameters, parameters, type), node) : node; + function updateCallSignature(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node; } - function createConstructSignature2(typeParameters, parameters, type) { + function createConstructSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(177 /* ConstructSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateConstructSignature2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature2(typeParameters, parameters, type), node) : node; + function updateConstructSignature(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node; } - function createIndexSignature3(modifiers, parameters, type) { + function createIndexSignature(modifiers, parameters, type) { const node = createBaseDeclaration(178 /* IndexSignature */); node.modifiers = asNodeArray(modifiers); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateIndexSignature2(node, modifiers, parameters, type) { - return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature3(modifiers, parameters, type), node) : node; + function updateIndexSignature(node, modifiers, parameters, type) { + return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node; } function createTemplateLiteralTypeSpan(type, literal) { const node = createBaseNode(201 /* TemplateLiteralTypeSpan */); @@ -20540,10 +20824,10 @@ ${lanes.join("\n")} function updateTemplateLiteralTypeSpan(node, type, literal) { return node.type !== type || node.literal !== literal ? update(createTemplateLiteralTypeSpan(type, literal), node) : node; } - function createKeywordTypeNode2(kind) { - return createToken3(kind); + function createKeywordTypeNode(kind) { + return createToken(kind); } - function createTypePredicateNode3(assertsModifier, parameterName, type) { + function createTypePredicateNode(assertsModifier, parameterName, type) { const node = createBaseNode(179 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); @@ -20551,20 +20835,20 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypePredicateNode3(node, assertsModifier, parameterName, type) { - return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode3(assertsModifier, parameterName, type), node) : node; + function updateTypePredicateNode(node, assertsModifier, parameterName, type) { + return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node; } - function createTypeReferenceNode2(typeName, typeArguments) { + function createTypeReferenceNode(typeName, typeArguments) { const node = createBaseNode(180 /* TypeReference */); node.typeName = asName(typeName); - node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray2(typeArguments)); + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeReferenceNode2(node, typeName, typeArguments) { - return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode2(typeName, typeArguments), node) : node; + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node; } - function createFunctionTypeNode2(typeParameters, parameters, type) { + function createFunctionTypeNode(typeParameters, parameters, type) { const node = createBaseDeclaration(181 /* FunctionType */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); @@ -20572,14 +20856,13 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function updateFunctionTypeNode2(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(typeParameters, parameters, type), node) : node; + function updateFunctionTypeNode(node, typeParameters, parameters, type) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type), node) : node; } function finishUpdateFunctionTypeNode(updated, original) { if (updated !== original) { @@ -20587,8 +20870,8 @@ ${lanes.join("\n")} } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createConstructorTypeNode2(...args) { - return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode22(...args) : Debug.fail("Incorrect number of arguments specified."); + function createConstructorTypeNode(...args) { + return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) { const node = createBaseDeclaration(182 /* ConstructorType */); @@ -20598,13 +20881,12 @@ ${lanes.join("\n")} node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; return node; } - function createConstructorTypeNode22(typeParameters, parameters, type) { + function createConstructorTypeNode2(typeParameters, parameters, type) { return createConstructorTypeNode1( /*modifiers*/ void 0, @@ -20613,51 +20895,51 @@ ${lanes.join("\n")} type ); } - function updateConstructorTypeNode2(...args) { - return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode22(...args) : Debug.fail("Incorrect number of arguments specified."); + function updateConstructorTypeNode(...args) { + return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function updateConstructorTypeNode1(node, modifiers, typeParameters, parameters, type) { - return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode2(modifiers, typeParameters, parameters, type), node) : node; + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode(modifiers, typeParameters, parameters, type), node) : node; } - function updateConstructorTypeNode22(node, typeParameters, parameters, type) { + function updateConstructorTypeNode2(node, typeParameters, parameters, type) { return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type); } - function createTypeQueryNode2(exprName, typeArguments) { + function createTypeQueryNode(exprName, typeArguments) { const node = createBaseNode(183 /* TypeQuery */); node.exprName = exprName; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeQueryNode2(node, exprName, typeArguments) { - return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode2(exprName, typeArguments), node) : node; + function updateTypeQueryNode(node, exprName, typeArguments) { + return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node; } - function createTypeLiteralNode2(members) { + function createTypeLiteralNode(members) { const node = createBaseDeclaration(184 /* TypeLiteral */); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeLiteralNode2(node, members) { - return node.members !== members ? update(createTypeLiteralNode2(members), node) : node; + function updateTypeLiteralNode(node, members) { + return node.members !== members ? update(createTypeLiteralNode(members), node) : node; } - function createArrayTypeNode2(elementType) { + function createArrayTypeNode(elementType) { const node = createBaseNode(185 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateArrayTypeNode2(node, elementType) { - return node.elementType !== elementType ? update(createArrayTypeNode2(elementType), node) : node; + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node; } - function createTupleTypeNode2(elements) { + function createTupleTypeNode(elements) { const node = createBaseNode(186 /* TupleType */); - node.elements = createNodeArray2(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); + node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTupleTypeNode2(node, elements) { - return node.elements !== elements ? update(createTupleTypeNode2(elements), node) : node; + function updateTupleTypeNode(node, elements) { + return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node; } function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { const node = createBaseDeclaration(199 /* NamedTupleMember */); @@ -20667,29 +20949,28 @@ ${lanes.join("\n")} node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) { return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node; } - function createOptionalTypeNode2(type) { + function createOptionalTypeNode(type) { const node = createBaseNode(187 /* OptionalType */); node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateOptionalTypeNode2(node, type) { - return node.type !== type ? update(createOptionalTypeNode2(type), node) : node; + function updateOptionalTypeNode(node, type) { + return node.type !== type ? update(createOptionalTypeNode(type), node) : node; } - function createRestTypeNode2(type) { + function createRestTypeNode(type) { const node = createBaseNode(188 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateRestTypeNode2(node, type) { - return node.type !== type ? update(createRestTypeNode2(type), node) : node; + function updateRestTypeNode(node, type) { + return node.type !== type ? update(createRestTypeNode(type), node) : node; } function createUnionOrIntersectionTypeNode(kind, types, parenthesize) { const node = createBaseNode(kind); @@ -20700,19 +20981,19 @@ ${lanes.join("\n")} function updateUnionOrIntersectionTypeNode(node, types, parenthesize) { return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node; } - function createUnionTypeNode2(types) { + function createUnionTypeNode(types) { return createUnionOrIntersectionTypeNode(189 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } - function updateUnionTypeNode2(node, types) { + function updateUnionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } - function createIntersectionTypeNode2(types) { + function createIntersectionTypeNode(types) { return createUnionOrIntersectionTypeNode(190 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } - function updateIntersectionTypeNode2(node, types) { + function updateIntersectionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } - function createConditionalTypeNode2(checkType, extendsType, trueType, falseType) { + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { const node = createBaseNode(191 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); @@ -20723,29 +21004,29 @@ ${lanes.join("\n")} node.nextContainer = void 0; return node; } - function updateConditionalTypeNode2(node, checkType, extendsType, trueType, falseType) { - return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode2(checkType, extendsType, trueType, falseType), node) : node; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; } - function createInferTypeNode2(typeParameter) { + function createInferTypeNode(typeParameter) { const node = createBaseNode(192 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateInferTypeNode2(node, typeParameter) { - return node.typeParameter !== typeParameter ? update(createInferTypeNode2(typeParameter), node) : node; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node; } function createTemplateLiteralType(head, templateSpans) { const node = createBaseNode(200 /* TemplateLiteralType */); node.head = head; - node.templateSpans = createNodeArray2(templateSpans); + node.templateSpans = createNodeArray(templateSpans); node.transformFlags = 1 /* ContainsTypeScript */; return node; } function updateTemplateLiteralType(node, head, templateSpans) { return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node; } - function createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf = false) { + function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) { const node = createBaseNode(202 /* ImportType */); node.argument = argument; node.assertions = assertions; @@ -20755,90 +21036,90 @@ ${lanes.join("\n")} node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateImportTypeNode2(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) { - return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; + function updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) { + return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; } - function createParenthesizedType2(type) { + function createParenthesizedType(type) { const node = createBaseNode(193 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateParenthesizedType2(node, type) { - return node.type !== type ? update(createParenthesizedType2(type), node) : node; + function updateParenthesizedType(node, type) { + return node.type !== type ? update(createParenthesizedType(type), node) : node; } - function createThisTypeNode2() { + function createThisTypeNode() { const node = createBaseNode(194 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function createTypeOperatorNode3(operator, type) { + function createTypeOperatorNode(operator, type) { const node = createBaseNode(195 /* TypeOperator */); node.operator = operator; node.type = operator === 146 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateTypeOperatorNode2(node, type) { - return node.type !== type ? update(createTypeOperatorNode3(node.operator, type), node) : node; + function updateTypeOperatorNode(node, type) { + return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node; } - function createIndexedAccessTypeNode2(objectType, indexType) { + function createIndexedAccessTypeNode(objectType, indexType) { const node = createBaseNode(196 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateIndexedAccessTypeNode2(node, objectType, indexType) { - return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode2(objectType, indexType), node) : node; + function updateIndexedAccessTypeNode(node, objectType, indexType) { + return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; } - function createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members) { + function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) { const node = createBaseDeclaration(197 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.nameType = nameType; node.questionToken = questionToken; node.type = type; - node.members = members && createNodeArray2(members); + node.members = members && createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateMappedTypeNode2(node, readonlyToken, typeParameter, nameType, questionToken, type, members) { - return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; + function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) { + return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; } - function createLiteralTypeNode2(literal) { + function createLiteralTypeNode(literal) { const node = createBaseNode(198 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateLiteralTypeNode2(node, literal) { - return node.literal !== literal ? update(createLiteralTypeNode2(literal), node) : node; + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node; } - function createObjectBindingPattern2(elements) { + function createObjectBindingPattern(elements) { const node = createBaseNode(203 /* ObjectBindingPattern */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { node.transformFlags |= 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; } return node; } - function updateObjectBindingPattern2(node, elements) { - return node.elements !== elements ? update(createObjectBindingPattern2(elements), node) : node; + function updateObjectBindingPattern(node, elements) { + return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node; } - function createArrayBindingPattern2(elements) { + function createArrayBindingPattern(elements) { const node = createBaseNode(204 /* ArrayBindingPattern */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; return node; } - function updateArrayBindingPattern2(node, elements) { - return node.elements !== elements ? update(createArrayBindingPattern2(elements), node) : node; + function updateArrayBindingPattern(node, elements) { + return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node; } - function createBindingElement2(dotDotDotToken, propertyName, name, initializer) { + function createBindingElement(dotDotDotToken, propertyName, name, initializer) { const node = createBaseDeclaration(205 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); @@ -20848,13 +21129,13 @@ ${lanes.join("\n")} node.flowNode = void 0; return node; } - function updateBindingElement2(node, dotDotDotToken, propertyName, name, initializer) { - return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement2(dotDotDotToken, propertyName, name, initializer), node) : node; + function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { + return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node; } function createArrayLiteralExpression(elements, multiLine) { const node = createBaseNode(206 /* ArrayLiteralExpression */); const lastElement = elements && lastOrUndefined(elements); - const elementsArray = createNodeArray2(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); + const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -20865,11 +21146,10 @@ ${lanes.join("\n")} } function createObjectLiteralExpression(properties, multiLine) { const node = createBaseDeclaration(207 /* ObjectLiteralExpression */); - node.properties = createNodeArray2(properties); + node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateObjectLiteralExpression(node, properties) { @@ -20882,7 +21162,6 @@ ${lanes.join("\n")} node.name = name; node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -20904,11 +21183,11 @@ ${lanes.join("\n")} } function updatePropertyAccessExpression(node, expression, name) { if (isPropertyAccessChain(node)) { - return updatePropertyAccessChain2(node, expression, node.questionDotToken, cast(name, isIdentifier)); + return updatePropertyAccessChain(node, expression, node.questionDotToken, cast(name, isIdentifier)); } return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node; } - function createPropertyAccessChain2(expression, questionDotToken, name) { + function createPropertyAccessChain(expression, questionDotToken, name) { const node = createBasePropertyAccessExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -20922,9 +21201,9 @@ ${lanes.join("\n")} node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updatePropertyAccessChain2(node, expression, questionDotToken, name) { + function updatePropertyAccessChain(node, expression, questionDotToken, name) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain2(expression, questionDotToken, name), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node; } function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) { const node = createBaseDeclaration(209 /* ElementAccessExpression */); @@ -20933,7 +21212,6 @@ ${lanes.join("\n")} node.argumentExpression = argumentExpression; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -20955,11 +21233,11 @@ ${lanes.join("\n")} } function updateElementAccessExpression(node, expression, argumentExpression) { if (isElementAccessChain(node)) { - return updateElementAccessChain2(node, expression, node.questionDotToken, argumentExpression); + return updateElementAccessChain(node, expression, node.questionDotToken, argumentExpression); } return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node; } - function createElementAccessChain2(expression, questionDotToken, index) { + function createElementAccessChain(expression, questionDotToken, index) { const node = createBaseElementAccessExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -20973,9 +21251,9 @@ ${lanes.join("\n")} node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updateElementAccessChain2(node, expression, questionDotToken, argumentExpression) { + function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain2(expression, questionDotToken, argumentExpression), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; } function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) { const node = createBaseDeclaration(210 /* CallExpression */); @@ -21002,7 +21280,7 @@ ${lanes.join("\n")} /*questionDotToken*/ void 0, asNodeArray(typeArguments), - parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray)) + parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) ); if (isImportKeyword(node.expression)) { node.transformFlags |= 8388608 /* ContainsDynamicImport */; @@ -21011,11 +21289,11 @@ ${lanes.join("\n")} } function updateCallExpression(node, expression, typeArguments, argumentsArray) { if (isCallChain(node)) { - return updateCallChain2(node, expression, node.questionDotToken, typeArguments, argumentsArray); + return updateCallChain(node, expression, node.questionDotToken, typeArguments, argumentsArray); } return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node; } - function createCallChain2(expression, questionDotToken, typeArguments, argumentsArray) { + function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { const node = createBaseCallExpression( parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -21024,15 +21302,15 @@ ${lanes.join("\n")} ), questionDotToken, asNodeArray(typeArguments), - parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray)) + parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) ); node.flags |= 32 /* OptionalChain */; node.transformFlags |= 32 /* ContainsES2020 */; return node; } - function updateCallChain2(node, expression, questionDotToken, typeArguments, argumentsArray) { + function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."); - return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain2(expression, questionDotToken, typeArguments, argumentsArray), node) : node; + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; } function createNewExpression(expression, typeArguments, argumentsArray) { const node = createBaseDeclaration(211 /* NewExpression */); @@ -21069,34 +21347,33 @@ ${lanes.join("\n")} function updateTaggedTemplateExpression(node, tag, typeArguments, template) { return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node; } - function createTypeAssertion2(type, expression) { + function createTypeAssertion(type, expression) { const node = createBaseNode(213 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; return node; } - function updateTypeAssertion2(node, type, expression) { - return node.type !== type || node.expression !== expression ? update(createTypeAssertion2(type, expression), node) : node; + function updateTypeAssertion(node, type, expression) { + return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node; } function createParenthesizedExpression(expression) { const node = createBaseNode(214 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParenthesizedExpression(node, expression) { return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node; } - function createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { const node = createBaseDeclaration(215 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; @@ -21105,7 +21382,6 @@ ${lanes.join("\n")} node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21113,22 +21389,21 @@ ${lanes.join("\n")} node.returnFlowNode = void 0; return node; } - function updateFunctionExpression2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; + function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } - function createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { const node = createBaseDeclaration(216 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; - node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken3(38 /* EqualsGreaterThanToken */); + node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body); const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21136,8 +21411,8 @@ ${lanes.join("\n")} node.returnFlowNode = void 0; return node; } - function updateArrowFunction3(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; + function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; } function createDeleteExpression(expression) { const node = createBaseNode(217 /* DeleteExpression */); @@ -21226,7 +21501,6 @@ ${lanes.join("\n")} node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */; } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function propagateAssignmentPatternFlags(node) { @@ -21255,9 +21529,9 @@ ${lanes.join("\n")} function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { const node = createBaseNode(224 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); - node.questionToken = questionToken != null ? questionToken : createToken3(57 /* QuestionToken */); + node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); - node.colonToken = colonToken != null ? colonToken : createToken3(58 /* ColonToken */); + node.colonToken = colonToken != null ? colonToken : createToken(58 /* ColonToken */); node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse); node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse); return node; @@ -21265,15 +21539,15 @@ ${lanes.join("\n")} function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) { return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; } - function createTemplateExpression2(head, templateSpans) { + function createTemplateExpression(head, templateSpans) { const node = createBaseNode(225 /* TemplateExpression */); node.head = head; - node.templateSpans = createNodeArray2(templateSpans); + node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */; return node; } - function updateTemplateExpression2(node, head, templateSpans) { - return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression2(head, templateSpans), node) : node; + function updateTemplateExpression(node, head, templateSpans) { + return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression(head, templateSpans), node) : node; } function checkTemplateLiteralLikeNode(kind, text, rawText, templateFlags = 0 /* None */) { Debug.assert(!(templateFlags & ~2048 /* TemplateLiteralLikeFlags */), "Unsupported template flags."); @@ -21323,19 +21597,19 @@ ${lanes.join("\n")} } return createTemplateLiteralLikeToken(kind, text, rawText, templateFlags); } - function createTemplateHead2(text, rawText, templateFlags) { + function createTemplateHead(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); } - function createTemplateMiddle2(text, rawText, templateFlags) { + function createTemplateMiddle(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(16 /* TemplateMiddle */, text, rawText, templateFlags); } - function createTemplateTail2(text, rawText, templateFlags) { + function createTemplateTail(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeNode(17 /* TemplateTail */, text, rawText, templateFlags); } - function createNoSubstitutionTemplateLiteral2(text, rawText, templateFlags) { + function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) { text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags); return createTemplateLiteralLikeDeclaration(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags); } @@ -21359,25 +21633,24 @@ ${lanes.join("\n")} function updateSpreadElement(node, expression) { return node.expression !== expression ? update(createSpreadElement(expression), node) : node; } - function createClassExpression3(modifiers, name, typeParameters, heritageClauses, members) { + function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(228 /* ClassExpression */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateClassExpression3(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression3(modifiers, name, typeParameters, heritageClauses, members), node) : node; + function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function createOmittedExpression2() { + function createOmittedExpression() { return createBaseNode(229 /* OmittedExpression */); } - function createExpressionWithTypeArguments3(expression, typeArguments) { + function createExpressionWithTypeArguments(expression, typeArguments) { const node = createBaseNode(230 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -21388,20 +21661,20 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */; return node; } - function updateExpressionWithTypeArguments3(node, expression, typeArguments) { - return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments3(expression, typeArguments), node) : node; + function updateExpressionWithTypeArguments(node, expression, typeArguments) { + return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node; } - function createAsExpression2(expression, type) { + function createAsExpression(expression, type) { const node = createBaseNode(231 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; return node; } - function updateAsExpression2(node, expression, type) { - return node.expression !== expression || node.type !== type ? update(createAsExpression2(expression, type), node) : node; + function updateAsExpression(node, expression, type) { + return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node; } - function createNonNullExpression2(expression) { + function createNonNullExpression(expression) { const node = createBaseNode(232 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -21411,11 +21684,11 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; return node; } - function updateNonNullExpression2(node, expression) { + function updateNonNullExpression(node, expression) { if (isNonNullChain(node)) { - return updateNonNullChain2(node, expression); + return updateNonNullChain(node, expression); } - return node.expression !== expression ? update(createNonNullExpression2(expression), node) : node; + return node.expression !== expression ? update(createNonNullExpression(expression), node) : node; } function createSatisfiesExpression(expression, type) { const node = createBaseNode(235 /* SatisfiesExpression */); @@ -21427,7 +21700,7 @@ ${lanes.join("\n")} function updateSatisfiesExpression(node, expression, type) { return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node; } - function createNonNullChain2(expression) { + function createNonNullChain(expression) { const node = createBaseNode(232 /* NonNullExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( @@ -21438,11 +21711,11 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; return node; } - function updateNonNullChain2(node, expression) { + function updateNonNullChain(node, expression) { Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); - return node.expression !== expression ? update(createNonNullChain2(expression), node) : node; + return node.expression !== expression ? update(createNonNullChain(expression), node) : node; } - function createMetaProperty2(keywordToken, name) { + function createMetaProperty(keywordToken, name) { const node = createBaseNode(233 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; @@ -21460,72 +21733,67 @@ ${lanes.join("\n")} node.flowNode = void 0; return node; } - function updateMetaProperty2(node, name) { - return node.name !== name ? update(createMetaProperty2(node.keywordToken, name), node) : node; + function updateMetaProperty(node, name) { + return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node; } - function createTemplateSpan2(expression, literal) { + function createTemplateSpan(expression, literal) { const node = createBaseNode(236 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */; return node; } - function updateTemplateSpan2(node, expression, literal) { - return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan2(expression, literal), node) : node; + function updateTemplateSpan(node, expression, literal) { + return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node; } - function createSemicolonClassElement2() { + function createSemicolonClassElement() { const node = createBaseNode(237 /* SemicolonClassElement */); node.transformFlags |= 1024 /* ContainsES2015 */; return node; } - function createBlock2(statements, multiLine) { + function createBlock(statements, multiLine) { const node = createBaseNode(238 /* Block */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateBlock2(node, statements) { - return node.statements !== statements ? update(createBlock2(statements, node.multiLine), node) : node; + function updateBlock(node, statements) { + return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node; } - function createVariableStatement2(modifiers, declarationList) { + function createVariableStatement(modifiers, declarationList) { const node = createBaseNode(240 /* VariableStatement */); node.modifiers = asNodeArray(modifiers); - node.declarationList = isArray(declarationList) ? createVariableDeclarationList2(declarationList) : declarationList; + node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function updateVariableStatement2(node, modifiers, declarationList) { - return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement2(modifiers, declarationList), node) : node; + function updateVariableStatement(node, modifiers, declarationList) { + return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node; } - function createEmptyStatement2() { + function createEmptyStatement() { const node = createBaseNode(239 /* EmptyStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function createExpressionStatement2(expression) { + function createExpressionStatement(expression) { const node = createBaseNode(241 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function updateExpressionStatement2(node, expression) { - return node.expression !== expression ? update(createExpressionStatement2(expression), node) : node; + function updateExpressionStatement(node, expression) { + return node.expression !== expression ? update(createExpressionStatement(expression), node) : node; } function createIfStatement(expression, thenStatement, elseStatement) { const node = createBaseNode(242 /* IfStatement */); @@ -21534,7 +21802,6 @@ ${lanes.join("\n")} node.elseStatement = asEmbeddedStatement(elseStatement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21547,7 +21814,6 @@ ${lanes.join("\n")} node.expression = expression; node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21560,7 +21826,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21575,7 +21840,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21591,7 +21855,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21610,7 +21873,6 @@ ${lanes.join("\n")} if (awaitModifier) node.transformFlags |= 128 /* ContainsES2018 */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -21624,7 +21886,6 @@ ${lanes.join("\n")} node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21636,7 +21897,6 @@ ${lanes.join("\n")} node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21648,7 +21908,6 @@ ${lanes.join("\n")} node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21661,7 +21920,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21674,7 +21932,6 @@ ${lanes.join("\n")} node.caseBlock = caseBlock; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.possiblyExhaustive = false; return node; @@ -21688,7 +21945,6 @@ ${lanes.join("\n")} node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21700,7 +21956,6 @@ ${lanes.join("\n")} node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -21714,21 +21969,19 @@ ${lanes.join("\n")} node.finallyBlock = finallyBlock; node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } function updateTryStatement(node, tryBlock, catchClause, finallyBlock) { return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; } - function createDebuggerStatement2() { + function createDebuggerStatement() { const node = createBaseNode(256 /* DebuggerStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } - function createVariableDeclaration3(name, exclamationToken, type, initializer) { + function createVariableDeclaration(name, exclamationToken, type, initializer) { var _a2; const node = createBaseDeclaration(257 /* VariableDeclaration */); node.name = asName(name); @@ -21737,32 +21990,31 @@ ${lanes.join("\n")} node.initializer = asInitializer(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateVariableDeclaration3(node, name, exclamationToken, type, initializer) { - return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration3(name, exclamationToken, type, initializer), node) : node; + function updateVariableDeclaration(node, name, exclamationToken, type, initializer) { + return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node; } - function createVariableDeclarationList2(declarations, flags2 = 0 /* None */) { + function createVariableDeclarationList(declarations, flags2 = 0 /* None */) { const node = createBaseNode(258 /* VariableDeclarationList */); node.flags |= flags2 & 3 /* BlockScoped */; - node.declarations = createNodeArray2(declarations); + node.declarations = createNodeArray(declarations); node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; if (flags2 & 3 /* BlockScoped */) { node.transformFlags |= 1024 /* ContainsES2015 */ | 262144 /* ContainsBlockScopedBinding */; } return node; } - function updateVariableDeclarationList2(node, declarations) { - return node.declarations !== declarations ? update(createVariableDeclarationList2(declarations, node.flags), node) : node; + function updateVariableDeclarationList(node, declarations) { + return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node; } - function createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { const node = createBaseDeclaration(259 /* FunctionDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.body = body; if (!node.body || modifiersToFlags(node.modifiers) & 2 /* Ambient */) { @@ -21773,32 +22025,32 @@ ${lanes.join("\n")} const isAsyncGenerator = isAsync && isGenerator; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; } - node.illegalDecorators = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; node.returnFlowNode = void 0; return node; } - function updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; + function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { + return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } function finishUpdateFunctionDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return finishUpdateBaseSignatureDeclaration(updated, original); } - function createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members) { + function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(260 /* ClassDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } else { @@ -21808,79 +22060,54 @@ ${lanes.join("\n")} } } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateClassDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members), node) : node; + function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members) { + function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) { const node = createBaseDeclaration(261 /* InterfaceDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? finishUpdateInterfaceDeclaration(createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members), node) : node; - } - function finishUpdateInterfaceDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } - function createTypeAliasDeclaration2(modifiers, name, typeParameters, type) { + function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { const node = createBaseDeclaration(262 /* TypeAliasDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? finishUpdateTypeAliasDeclaration(createTypeAliasDeclaration2(modifiers, name, typeParameters, type), node) : node; + function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) { + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? update(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; } - function finishUpdateTypeAliasDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createEnumDeclaration2(modifiers, name, members) { + function createEnumDeclaration(modifiers, name, members) { const node = createBaseDeclaration(263 /* EnumDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.members = createNodeArray2(members); + node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateEnumDeclaration2(node, modifiers, name, members) { - return node.modifiers !== modifiers || node.name !== name || node.members !== members ? finishUpdateEnumDeclaration(createEnumDeclaration2(modifiers, name, members), node) : node; + function updateEnumDeclaration(node, modifiers, name, members) { + return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createEnumDeclaration(modifiers, name, members), node) : node; } - function finishUpdateEnumDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createModuleDeclaration2(modifiers, name, body, flags2 = 0 /* None */) { + function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { const node = createBaseDeclaration(264 /* ModuleDeclaration */); node.modifiers = asNodeArray(modifiers); node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); @@ -21892,65 +22119,53 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } - function updateModuleDeclaration2(node, modifiers, name, body) { - return node.modifiers !== modifiers || node.name !== name || node.body !== body ? finishUpdateModuleDeclaration(createModuleDeclaration2(modifiers, name, body, node.flags), node) : node; - } - function finishUpdateModuleDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateModuleDeclaration(node, modifiers, name, body) { + return node.modifiers !== modifiers || node.name !== name || node.body !== body ? update(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; } - function createModuleBlock2(statements) { + function createModuleBlock(statements) { const node = createBaseNode(265 /* ModuleBlock */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateModuleBlock2(node, statements) { - return node.statements !== statements ? update(createModuleBlock2(statements), node) : node; + function updateModuleBlock(node, statements) { + return node.statements !== statements ? update(createModuleBlock(statements), node) : node; } - function createCaseBlock2(clauses) { + function createCaseBlock(clauses) { const node = createBaseNode(266 /* CaseBlock */); - node.clauses = createNodeArray2(clauses); + node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); node.locals = void 0; node.nextContainer = void 0; return node; } - function updateCaseBlock2(node, clauses) { - return node.clauses !== clauses ? update(createCaseBlock2(clauses), node) : node; + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node; } - function createNamespaceExportDeclaration2(name) { + function createNamespaceExportDeclaration(name) { const node = createBaseDeclaration(267 /* NamespaceExportDeclaration */); node.name = asName(name); node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateNamespaceExportDeclaration2(node, name) { - return node.name !== name ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration2(name), node) : node; + function updateNamespaceExportDeclaration(node, name) { + return node.name !== name ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration(name), node) : node; } function finishUpdateNamespaceExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); } - function createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference) { + function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) { const node = createBaseDeclaration(268 /* ImportEqualsDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -21961,21 +22176,13 @@ ${lanes.join("\n")} node.transformFlags |= 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? finishUpdateImportEqualsDeclaration(createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference), node) : node; + function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; } - function finishUpdateImportEqualsDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); - } - function createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause) { + function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) { const node = createBaseNode(269 /* ImportDeclaration */); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -21983,21 +22190,13 @@ ${lanes.join("\n")} node.assertClause = assertClause; node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateImportDeclaration(createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause), node) : node; - } - function finishUpdateImportDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) { + return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; } - function createImportClause3(isTypeOnly, name, namedBindings) { + function createImportClause(isTypeOnly, name, namedBindings) { const node = createBaseDeclaration(270 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; @@ -22009,12 +22208,12 @@ ${lanes.join("\n")} node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateImportClause3(node, isTypeOnly, name, namedBindings) { - return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause3(isTypeOnly, name, namedBindings), node) : node; + function updateImportClause(node, isTypeOnly, name, namedBindings) { + return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause(isTypeOnly, name, namedBindings), node) : node; } function createAssertClause(elements, multiLine) { const node = createBaseNode(296 /* AssertClause */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.multiLine = multiLine; node.transformFlags |= 4 /* ContainsESNext */; return node; @@ -22041,37 +22240,37 @@ ${lanes.join("\n")} function updateImportTypeAssertionContainer(node, clause, multiLine) { return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node; } - function createNamespaceImport2(name) { + function createNamespaceImport(name) { const node = createBaseDeclaration(271 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamespaceImport2(node, name) { - return node.name !== name ? update(createNamespaceImport2(name), node) : node; + function updateNamespaceImport(node, name) { + return node.name !== name ? update(createNamespaceImport(name), node) : node; } - function createNamespaceExport2(name) { + function createNamespaceExport(name) { const node = createBaseDeclaration(277 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamespaceExport2(node, name) { - return node.name !== name ? update(createNamespaceExport2(name), node) : node; + function updateNamespaceExport(node, name) { + return node.name !== name ? update(createNamespaceExport(name), node) : node; } - function createNamedImports2(elements) { + function createNamedImports(elements) { const node = createBaseNode(272 /* NamedImports */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamedImports2(node, elements) { - return node.elements !== elements ? update(createNamedImports2(elements), node) : node; + function updateNamedImports(node, elements) { + return node.elements !== elements ? update(createNamedImports(elements), node) : node; } - function createImportSpecifier2(isTypeOnly, propertyName, name) { + function createImportSpecifier(isTypeOnly, propertyName, name) { const node = createBaseDeclaration(273 /* ImportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = propertyName; @@ -22080,10 +22279,10 @@ ${lanes.join("\n")} node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateImportSpecifier2(node, isTypeOnly, propertyName, name) { - return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier2(isTypeOnly, propertyName, name), node) : node; + function updateImportSpecifier(node, isTypeOnly, propertyName, name) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node; } - function createExportAssignment3(modifiers, isExportEquals, expression) { + function createExportAssignment2(modifiers, isExportEquals, expression) { const node = createBaseDeclaration(274 /* ExportAssignment */); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -22095,21 +22294,13 @@ ${lanes.join("\n")} ) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportAssignment2(node, modifiers, expression) { - return node.modifiers !== modifiers || node.expression !== expression ? finishUpdateExportAssignment(createExportAssignment3(modifiers, node.isExportEquals, expression), node) : node; - } - function finishUpdateExportAssignment(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + function updateExportAssignment(node, modifiers, expression) { + return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node; } - function createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { const node = createBaseDeclaration(275 /* ExportDeclaration */); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -22118,31 +22309,31 @@ ${lanes.join("\n")} node.assertClause = assertClause; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; + function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; } function finishUpdateExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return update(updated, original); } - function createNamedExports2(elements) { + function createNamedExports(elements) { const node = createBaseNode(276 /* NamedExports */); - node.elements = createNodeArray2(elements); + node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateNamedExports2(node, elements) { - return node.elements !== elements ? update(createNamedExports2(elements), node) : node; + function updateNamedExports(node, elements) { + return node.elements !== elements ? update(createNamedExports(elements), node) : node; } - function createExportSpecifier2(isTypeOnly, propertyName, name) { + function createExportSpecifier(isTypeOnly, propertyName, name) { const node = createBaseNode(278 /* ExportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = asName(propertyName); @@ -22150,27 +22341,25 @@ ${lanes.join("\n")} node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateExportSpecifier2(node, isTypeOnly, propertyName, name) { - return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier2(isTypeOnly, propertyName, name), node) : node; + function updateExportSpecifier(node, isTypeOnly, propertyName, name) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createMissingDeclaration() { const node = createBaseDeclaration(279 /* MissingDeclaration */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function createExternalModuleReference2(expression) { + function createExternalModuleReference(expression) { const node = createBaseNode(280 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateExternalModuleReference2(node, expression) { - return node.expression !== expression ? update(createExternalModuleReference2(expression), node) : node; + function updateExternalModuleReference(node, expression) { + return node.expression !== expression ? update(createExternalModuleReference(expression), node) : node; } function createJSDocPrimaryTypeWorker(kind) { return createBaseNode(kind); @@ -22200,7 +22389,6 @@ ${lanes.join("\n")} node.type = type; node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -22209,40 +22397,39 @@ ${lanes.join("\n")} function updateJSDocFunctionType(node, parameters, type) { return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node; } - function createJSDocTypeLiteral2(propertyTags, isArrayType = false) { + function createJSDocTypeLiteral(propertyTags, isArrayType = false) { const node = createBaseDeclaration(325 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; } function updateJSDocTypeLiteral(node, propertyTags, isArrayType) { - return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral2(propertyTags, isArrayType), node) : node; + return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; } - function createJSDocTypeExpression2(type) { + function createJSDocTypeExpression(type) { const node = createBaseNode(312 /* JSDocTypeExpression */); node.type = type; return node; } function updateJSDocTypeExpression(node, type) { - return node.type !== type ? update(createJSDocTypeExpression2(type), node) : node; + return node.type !== type ? update(createJSDocTypeExpression(type), node) : node; } - function createJSDocSignature2(typeParameters, parameters, type) { + function createJSDocSignature(typeParameters, parameters, type) { const node = createBaseDeclaration(326 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray2(parameters); + node.parameters = createNodeArray(parameters); node.type = type; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } function updateJSDocSignature(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? update(createJSDocSignature2(typeParameters, parameters, type), node) : node; + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? update(createJSDocSignature(typeParameters, parameters, type), node) : node; } function getDefaultTagName(node) { const defaultTagName = getDefaultTagNameForKind(node.kind); - return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier3(defaultTagName); + return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier(defaultTagName); } function createBaseJSDocTag(kind, tagName, comment) { const node = createBaseNode(kind); @@ -22256,17 +22443,17 @@ ${lanes.join("\n")} node.comment = comment; return node; } - function createJSDocTemplateTag2(tagName, constraint, typeParameters, comment) { - const node = createBaseJSDocTag(348 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment); + function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { + const node = createBaseJSDocTag(348 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment); node.constraint = constraint; - node.typeParameters = createNodeArray2(typeParameters); + node.typeParameters = createNodeArray(typeParameters); return node; } function updateJSDocTemplateTag(node, tagName = getDefaultTagName(node), constraint, typeParameters, comment) { - return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag2(tagName, constraint, typeParameters, comment), node) : node; + return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; } - function createJSDocTypedefTag2(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(349 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment); + function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { + const node = createBaseJSDocTagDeclaration(349 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -22275,10 +22462,10 @@ ${lanes.join("\n")} return node; } function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag2(tagName, typeExpression, fullName, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; } - function createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(344 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment); + function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { + const node = createBaseJSDocTagDeclaration(344 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -22286,10 +22473,10 @@ ${lanes.join("\n")} return node; } function updateJSDocParameterTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { - return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; + return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } - function createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(351 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment); + function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { + const node = createBaseJSDocTagDeclaration(351 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -22297,10 +22484,10 @@ ${lanes.join("\n")} return node; } function updateJSDocPropertyTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { - return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; + return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } - function createJSDocCallbackTag2(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment); + function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { + const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -22309,31 +22496,31 @@ ${lanes.join("\n")} return node; } function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag2(tagName, typeExpression, fullName, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocOverloadTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTag(342 /* JSDocOverloadTag */, tagName != null ? tagName : createIdentifier3("overload"), comment); + const node = createBaseJSDocTag(342 /* JSDocOverloadTag */, tagName != null ? tagName : createIdentifier("overload"), comment); node.typeExpression = typeExpression; return node; } function updateJSDocOverloadTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocOverloadTag(tagName, typeExpression, comment), node) : node; } - function createJSDocAugmentsTag2(tagName, className, comment) { - const node = createBaseJSDocTag(331 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment); + function createJSDocAugmentsTag(tagName, className, comment) { + const node = createBaseJSDocTag(331 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } function updateJSDocAugmentsTag(node, tagName = getDefaultTagName(node), className, comment) { - return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag2(tagName, className, comment), node) : node; + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node; } - function createJSDocImplementsTag2(tagName, className, comment) { - const node = createBaseJSDocTag(332 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment); + function createJSDocImplementsTag(tagName, className, comment) { + const node = createBaseJSDocTag(332 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } function createJSDocSeeTag(tagName, name, comment) { - const node = createBaseJSDocTag(350 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment); + const node = createBaseJSDocTag(350 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment); node.name = name; return node; } @@ -22386,17 +22573,17 @@ ${lanes.join("\n")} return node.name !== name ? update(createJSDocLinkPlain(name, text), node) : node; } function updateJSDocImplementsTag(node, tagName = getDefaultTagName(node), className, comment) { - return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocImplementsTag2(tagName, className, comment), node) : node; + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocImplementsTag(tagName, className, comment), node) : node; } function createJSDocSimpleTagWorker(kind, tagName, comment) { - const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(kind)), comment); + const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); return node; } function updateJSDocSimpleTagWorker(kind, node, tagName = getDefaultTagName(node), comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocSimpleTagWorker(kind, tagName, comment), node) : node; } function createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment) { - const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(kind)), comment); + const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); node.typeExpression = typeExpression; return node; } @@ -22410,15 +22597,15 @@ ${lanes.join("\n")} function updateJSDocUnknownTag(node, tagName, comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node; } - function createJSDocEnumTag2(tagName, typeExpression, comment) { - const node = createBaseJSDocTagDeclaration(343 /* JSDocEnumTag */, tagName != null ? tagName : createIdentifier3(getDefaultTagNameForKind(343 /* JSDocEnumTag */)), comment); + function createJSDocEnumTag(tagName, typeExpression, comment) { + const node = createBaseJSDocTagDeclaration(343 /* JSDocEnumTag */, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(343 /* JSDocEnumTag */)), comment); node.typeExpression = typeExpression; node.locals = void 0; node.nextContainer = void 0; return node; } function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag2(tagName, typeExpression, comment), node) : node; + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node; } function createJSDocText(text) { const node = createBaseNode(324 /* JSDocText */); @@ -22428,27 +22615,27 @@ ${lanes.join("\n")} function updateJSDocText(node, text) { return node.text !== text ? update(createJSDocText(text), node) : node; } - function createJSDocComment2(comment, tags) { + function createJSDocComment(comment, tags) { const node = createBaseNode(323 /* JSDoc */); node.comment = comment; node.tags = asNodeArray(tags); return node; } function updateJSDocComment(node, comment, tags) { - return node.comment !== comment || node.tags !== tags ? update(createJSDocComment2(comment, tags), node) : node; + return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node; } - function createJsxElement2(openingElement, children, closingElement) { + function createJsxElement(openingElement, children, closingElement) { const node = createBaseNode(281 /* JsxElement */); node.openingElement = openingElement; - node.children = createNodeArray2(children); + node.children = createNodeArray(children); node.closingElement = closingElement; node.transformFlags |= propagateChildFlags(node.openingElement) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingElement) | 2 /* ContainsJsx */; return node; } - function updateJsxElement2(node, openingElement, children, closingElement) { - return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement2(openingElement, children, closingElement), node) : node; + function updateJsxElement(node, openingElement, children, closingElement) { + return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node; } - function createJsxSelfClosingElement2(tagName, typeArguments, attributes) { + function createJsxSelfClosingElement(tagName, typeArguments, attributes) { const node = createBaseNode(282 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); @@ -22459,10 +22646,10 @@ ${lanes.join("\n")} } return node; } - function updateJsxSelfClosingElement2(node, tagName, typeArguments, attributes) { - return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement2(tagName, typeArguments, attributes), node) : node; + function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; } - function createJsxOpeningElement2(tagName, typeArguments, attributes) { + function createJsxOpeningElement(tagName, typeArguments, attributes) { const node = createBaseNode(283 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); @@ -22473,112 +22660,111 @@ ${lanes.join("\n")} } return node; } - function updateJsxOpeningElement2(node, tagName, typeArguments, attributes) { - return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement2(tagName, typeArguments, attributes), node) : node; + function updateJsxOpeningElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; } - function createJsxClosingElement2(tagName) { + function createJsxClosingElement(tagName) { const node = createBaseNode(284 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */; return node; } - function updateJsxClosingElement2(node, tagName) { - return node.tagName !== tagName ? update(createJsxClosingElement2(tagName), node) : node; + function updateJsxClosingElement(node, tagName) { + return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node; } - function createJsxFragment2(openingFragment, children, closingFragment) { + function createJsxFragment(openingFragment, children, closingFragment) { const node = createBaseNode(285 /* JsxFragment */); node.openingFragment = openingFragment; - node.children = createNodeArray2(children); + node.children = createNodeArray(children); node.closingFragment = closingFragment; node.transformFlags |= propagateChildFlags(node.openingFragment) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingFragment) | 2 /* ContainsJsx */; return node; } - function updateJsxFragment2(node, openingFragment, children, closingFragment) { - return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update(createJsxFragment2(openingFragment, children, closingFragment), node) : node; + function updateJsxFragment(node, openingFragment, children, closingFragment) { + return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update(createJsxFragment(openingFragment, children, closingFragment), node) : node; } - function createJsxText2(text, containsOnlyTriviaWhiteSpaces) { + function createJsxText(text, containsOnlyTriviaWhiteSpaces) { const node = createBaseNode(11 /* JsxText */); node.text = text; node.containsOnlyTriviaWhiteSpaces = !!containsOnlyTriviaWhiteSpaces; node.transformFlags |= 2 /* ContainsJsx */; return node; } - function updateJsxText2(node, text, containsOnlyTriviaWhiteSpaces) { - return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText2(text, containsOnlyTriviaWhiteSpaces), node) : node; + function updateJsxText(node, text, containsOnlyTriviaWhiteSpaces) { + return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; } - function createJsxOpeningFragment2() { + function createJsxOpeningFragment() { const node = createBaseNode(286 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } - function createJsxJsxClosingFragment2() { + function createJsxJsxClosingFragment() { const node = createBaseNode(287 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } - function createJsxAttribute2(name, initializer) { + function createJsxAttribute(name, initializer) { const node = createBaseDeclaration(288 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */; return node; } - function updateJsxAttribute2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute2(name, initializer), node) : node; + function updateJsxAttribute(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node; } - function createJsxAttributes2(properties) { + function createJsxAttributes(properties) { const node = createBaseDeclaration(289 /* JsxAttributes */); - node.properties = createNodeArray2(properties); + node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */; return node; } - function updateJsxAttributes2(node, properties) { - return node.properties !== properties ? update(createJsxAttributes2(properties), node) : node; + function updateJsxAttributes(node, properties) { + return node.properties !== properties ? update(createJsxAttributes(properties), node) : node; } - function createJsxSpreadAttribute2(expression) { + function createJsxSpreadAttribute(expression) { const node = createBaseNode(290 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; } - function updateJsxSpreadAttribute2(node, expression) { - return node.expression !== expression ? update(createJsxSpreadAttribute2(expression), node) : node; + function updateJsxSpreadAttribute(node, expression) { + return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node; } - function createJsxExpression2(dotDotDotToken, expression) { + function createJsxExpression(dotDotDotToken, expression) { const node = createBaseNode(291 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; } - function updateJsxExpression2(node, expression) { - return node.expression !== expression ? update(createJsxExpression2(node.dotDotDotToken, expression), node) : node; + function updateJsxExpression(node, expression) { + return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node; } - function createCaseClause2(expression, statements) { + function createCaseClause(expression, statements) { const node = createBaseNode(292 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateCaseClause2(node, expression, statements) { - return node.expression !== expression || node.statements !== statements ? update(createCaseClause2(expression, statements), node) : node; + function updateCaseClause(node, expression, statements) { + return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node; } - function createDefaultClause2(statements) { + function createDefaultClause(statements) { const node = createBaseNode(293 /* DefaultClause */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; } - function updateDefaultClause2(node, statements) { - return node.statements !== statements ? update(createDefaultClause2(statements), node) : node; + function updateDefaultClause(node, statements) { + return node.statements !== statements ? update(createDefaultClause(statements), node) : node; } - function createHeritageClause2(token, types) { + function createHeritageClause(token, types) { const node = createBaseNode(294 /* HeritageClause */); node.token = token; - node.types = createNodeArray2(types); + node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); switch (token) { case 94 /* ExtendsKeyword */: @@ -22592,10 +22778,10 @@ ${lanes.join("\n")} } return node; } - function updateHeritageClause2(node, types) { - return node.types !== types ? update(createHeritageClause2(node.token, types), node) : node; + function updateHeritageClause(node, types) { + return node.types !== types ? update(createHeritageClause(node.token, types), node) : node; } - function createCatchClause2(variableDeclaration, block) { + function createCatchClause(variableDeclaration, block) { const node = createBaseNode(295 /* CatchClause */); node.variableDeclaration = asVariableDeclaration(variableDeclaration); node.block = block; @@ -22604,87 +22790,79 @@ ${lanes.join("\n")} node.nextContainer = void 0; return node; } - function updateCatchClause2(node, variableDeclaration, block) { - return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause2(variableDeclaration, block), node) : node; + function updateCatchClause(node, variableDeclaration, block) { + return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node; } - function createPropertyAssignment2(name, initializer) { + function createPropertyAssignment(name, initializer) { const node = createBaseDeclaration(299 /* PropertyAssignment */); node.name = asName(name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updatePropertyAssignment2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment2(name, initializer), node) : node; + function updatePropertyAssignment(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment(name, initializer), node) : node; } function finishUpdatePropertyAssignment(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; } return update(updated, original); } - function createShorthandPropertyAssignment2(name, objectAssignmentInitializer) { + function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { const node = createBaseDeclaration(300 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; node.equalsToken = void 0; - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateShorthandPropertyAssignment2(node, name, objectAssignmentInitializer) { - return node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment2(name, objectAssignmentInitializer), node) : node; + function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { + return node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node) : node; } function finishUpdateShorthandPropertyAssignment(updated, original) { if (updated !== original) { - updated.equalsToken = original.equalsToken; - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; + updated.equalsToken = original.equalsToken; } return update(updated, original); } - function createSpreadAssignment2(expression) { + function createSpreadAssignment(expression) { const node = createBaseDeclaration(301 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateSpreadAssignment2(node, expression) { - return node.expression !== expression ? update(createSpreadAssignment2(expression), node) : node; + function updateSpreadAssignment(node, expression) { + return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node; } - function createEnumMember2(name, initializer) { + function createEnumMember(name, initializer) { const node = createBaseDeclaration(302 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } - function updateEnumMember2(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? update(createEnumMember2(name, initializer), node) : node; + function updateEnumMember(node, name, initializer) { + return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node; } function createSourceFile2(statements, endOfFileToken, flags2) { const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags2; node.text = ""; @@ -22785,7 +22963,7 @@ ${lanes.join("\n")} } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { const node = cloneSourceFile(source); - node.statements = createNodeArray2(statements); + node.statements = createNodeArray(statements); node.isDeclarationFile = isDeclarationFile; node.referencedFiles = referencedFiles; node.typeReferenceDirectives = typeReferences; @@ -22797,7 +22975,7 @@ ${lanes.join("\n")} function updateSourceFile2(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) { return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; } - function createBundle2(sourceFiles, prepends = emptyArray) { + function createBundle(sourceFiles, prepends = emptyArray) { const node = createBaseNode(309 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; @@ -22807,8 +22985,8 @@ ${lanes.join("\n")} node.hasNoDefaultLib = void 0; return node; } - function updateBundle2(node, sourceFiles, prepends = emptyArray) { - return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle2(sourceFiles, prepends), node) : node; + function updateBundle(node, sourceFiles, prepends = emptyArray) { + return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle(sourceFiles, prepends), node) : node; } function createUnparsedSource(prologues, syntheticReferences, texts) { const node = createBaseNode(310 /* UnparsedSource */); @@ -22858,26 +23036,26 @@ ${lanes.join("\n")} return node; } function createSyntaxList3(children) { - const node = createBaseNode(353 /* SyntaxList */); + const node = createBaseNode(354 /* SyntaxList */); node._children = children; return node; } - function createNotEmittedStatement2(original) { - const node = createBaseNode(354 /* NotEmittedStatement */); + function createNotEmittedStatement(original) { + const node = createBaseNode(355 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; } - function createPartiallyEmittedExpression2(expression, original) { - const node = createBaseNode(355 /* PartiallyEmittedExpression */); + function createPartiallyEmittedExpression(expression, original) { + const node = createBaseNode(356 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; setTextRange(node, original); return node; } - function updatePartiallyEmittedExpression2(node, expression) { - return node.expression !== expression ? update(createPartiallyEmittedExpression2(expression, node.original), node) : node; + function updatePartiallyEmittedExpression(node, expression) { + return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node; } function flattenCommaElements(node) { if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { @@ -22891,8 +23069,8 @@ ${lanes.join("\n")} return node; } function createCommaListExpression(elements) { - const node = createBaseNode(356 /* CommaListExpression */); - node.elements = createNodeArray2(sameFlatMap(elements, flattenCommaElements)); + const node = createBaseNode(357 /* CommaListExpression */); + node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; } @@ -22900,19 +23078,19 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; } function createEndOfDeclarationMarker(original) { - const node = createBaseNode(358 /* EndOfDeclarationMarker */); + const node = createBaseNode(359 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createMergeDeclarationMarker(original) { - const node = createBaseNode(357 /* MergeDeclarationMarker */); + const node = createBaseNode(358 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(359 /* SyntheticReferenceExpression */); + const node = createBaseNode(360 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); @@ -22922,36 +23100,32 @@ ${lanes.join("\n")} return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node; } function cloneGeneratedIdentifier(node) { - const clone2 = createBaseIdentifier( - node.escapedText, - /*originalKeywordKind*/ - void 0 - ); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function cloneIdentifier(node) { - const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.typeArguments = node.typeArguments; - clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape; clone2.jsDoc = node.jsDoc; - clone2.jsDocCache = node.jsDocCache; clone2.flowNode = node.flowNode; clone2.symbol = node.symbol; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + const typeArguments = getIdentifierTypeArguments(node); + if (typeArguments) + setIdentifierTypeArguments(clone2, typeArguments); return clone2; } function cloneGeneratedPrivateIdentifier(node) { const clone2 = createBasePrivateIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function clonePrivateIdentifier(node) { @@ -22992,9 +23166,9 @@ ${lanes.join("\n")} } return clone2; } - function createImmediatelyInvokedFunctionExpression2(statements, param, paramValue) { + function createImmediatelyInvokedFunctionExpression(statements, param, paramValue) { return createCallExpression( - createFunctionExpression2( + createFunctionExpression( /*modifiers*/ void 0, /*asteriskToken*/ @@ -23007,7 +23181,7 @@ ${lanes.join("\n")} param ? [param] : [], /*type*/ void 0, - createBlock2( + createBlock( statements, /*multiLine*/ true @@ -23019,9 +23193,9 @@ ${lanes.join("\n")} paramValue ? [paramValue] : [] ); } - function createImmediatelyInvokedArrowFunction2(statements, param, paramValue) { + function createImmediatelyInvokedArrowFunction(statements, param, paramValue) { return createCallExpression( - createArrowFunction3( + createArrowFunction( /*modifiers*/ void 0, /*typeParameters*/ @@ -23032,7 +23206,7 @@ ${lanes.join("\n")} void 0, /*equalsGreaterThanToken*/ void 0, - createBlock2( + createBlock( statements, /*multiLine*/ true @@ -23044,11 +23218,11 @@ ${lanes.join("\n")} paramValue ? [paramValue] : [] ); } - function createVoidZero2() { - return createVoidExpression(createNumericLiteral2("0")); + function createVoidZero() { + return createVoidExpression(createNumericLiteral("0")); } - function createExportDefault2(expression) { - return createExportAssignment3( + function createExportDefault(expression) { + return createExportAssignment2( /*modifiers*/ void 0, /*isExportEquals*/ @@ -23056,14 +23230,14 @@ ${lanes.join("\n")} expression ); } - function createExternalModuleExport2(exportName) { - return createExportDeclaration3( + function createExternalModuleExport(exportName) { + return createExportDeclaration( /*modifiers*/ void 0, /*isTypeOnly*/ false, - createNamedExports2([ - createExportSpecifier2( + createNamedExports([ + createExportSpecifier( /*isTypeOnly*/ false, /*propertyName*/ @@ -23074,12 +23248,12 @@ ${lanes.join("\n")} ); } function createTypeCheck(value, tag) { - return tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero2()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral2(tag)); + return tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral(tag)); } function createMethodCall(object, methodName, argumentsList) { if (isCallChain(object)) { - return createCallChain2( - createPropertyAccessChain2( + return createCallChain( + createPropertyAccessChain( object, /*questionDotToken*/ void 0, @@ -23109,7 +23283,7 @@ ${lanes.join("\n")} return createMethodCall(target, "apply", [thisArg, argumentsExpression]); } function createGlobalMethodCall(globalObjectName, methodName, argumentsList) { - return createMethodCall(createIdentifier3(globalObjectName), methodName, argumentsList); + return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList); } function createArraySliceCall(array, start) { return createMethodCall(array, "slice", start === void 0 ? [] : [asExpression(start)]); @@ -23120,6 +23294,9 @@ ${lanes.join("\n")} function createObjectDefinePropertyCall(target, propertyName, attributes) { return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); } + function createObjectGetOwnPropertyDescriptorCall(target, propertyName) { + return createGlobalMethodCall("Object", "getOwnPropertyDescriptor", [target, asExpression(propertyName)]); + } function createReflectGetCall(target, propertyKey, receiver) { return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); } @@ -23128,7 +23305,7 @@ ${lanes.join("\n")} } function tryAddPropertyAssignment(properties, propertyName, expression) { if (expression) { - properties.push(createPropertyAssignment2(propertyName, expression)); + properties.push(createPropertyAssignment(propertyName, expression)); return true; } return false; @@ -23149,15 +23326,15 @@ ${lanes.join("\n")} case 214 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); case 213 /* TypeAssertionExpression */: - return updateTypeAssertion2(outerExpression, outerExpression.type, expression); + return updateTypeAssertion(outerExpression, outerExpression.type, expression); case 231 /* AsExpression */: - return updateAsExpression2(outerExpression, expression, outerExpression.type); + return updateAsExpression(outerExpression, expression, outerExpression.type); case 235 /* SatisfiesExpression */: return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); case 232 /* NonNullExpression */: - return updateNonNullExpression2(outerExpression, expression); - case 355 /* PartiallyEmittedExpression */: - return updatePartiallyEmittedExpression2(outerExpression, expression); + return updateNonNullExpression(outerExpression, expression); + case 356 /* PartiallyEmittedExpression */: + return updatePartiallyEmittedExpression(outerExpression, expression); } } function isIgnorableParen(node) { @@ -23213,13 +23390,13 @@ ${lanes.join("\n")} let thisArg; let target; if (isSuperProperty(callee)) { - thisArg = createThis2(); + thisArg = createThis(); target = callee; } else if (isSuperKeyword(callee)) { - thisArg = createThis2(); - target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier3("_super"), callee) : callee; + thisArg = createThis(); + target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier("_super"), callee) : callee; } else if (getEmitFlags(callee) & 8192 /* HelperName */) { - thisArg = createVoidZero2(); + thisArg = createVoidZero(); target = parenthesizerRules().parenthesizeLeftSideOfAccess( callee, /*optionalChain*/ @@ -23227,7 +23404,7 @@ ${lanes.join("\n")} ); } else if (isPropertyAccessExpression(callee)) { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable3(recordTempVariable); + thisArg = createTempVariable(recordTempVariable); target = createPropertyAccessExpression( setTextRange( factory2.createAssignment( @@ -23245,7 +23422,7 @@ ${lanes.join("\n")} } } else if (isElementAccessExpression(callee)) { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable3(recordTempVariable); + thisArg = createTempVariable(recordTempVariable); target = createElementAccessExpression( setTextRange( factory2.createAssignment( @@ -23262,7 +23439,7 @@ ${lanes.join("\n")} target = callee; } } else { - thisArg = createVoidZero2(); + thisArg = createVoidZero(); target = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -23293,8 +23470,8 @@ ${lanes.join("\n")} /*initializer*/ void 0 )], - createBlock2([ - createExpressionStatement2(expression) + createBlock([ + createExpressionStatement(expression) ]) ) ]) @@ -23318,7 +23495,7 @@ ${lanes.join("\n")} setEmitFlags(name, emitFlags); return name; } - return getGeneratedNameForNode3(node); + return getGeneratedNameForNode(node); } function getInternalName(node, allowComments, allowSourceMaps) { return getName(node, allowComments, allowSourceMaps, 32768 /* LocalName */ | 65536 /* InternalName */); @@ -23358,7 +23535,7 @@ ${lanes.join("\n")} return isStringLiteral(node.expression) && node.expression.text === "use strict"; } function createUseStrictPrologue() { - return startOnNewLine(createExpressionStatement2(createStringLiteral2("use strict"))); + return startOnNewLine(createExpressionStatement(createStringLiteral("use strict"))); } function copyStandardPrologue(source, target, statementOffset = 0, ensureUseStrict2) { Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); @@ -23397,13 +23574,13 @@ ${lanes.join("\n")} function ensureUseStrict(statements) { const foundUseStrict = findUseStrictPrologue(statements); if (!foundUseStrict) { - return setTextRange(createNodeArray2([createUseStrictPrologue(), ...statements]), statements); + return setTextRange(createNodeArray([createUseStrictPrologue(), ...statements]), statements); } return statements; } function liftToBlock(nodes) { Debug.assert(every(nodes, isStatementOrBlock), "Cannot lift nodes to a Block."); - return singleOrUndefined(nodes) || createBlock2(nodes); + return singleOrUndefined(nodes) || createBlock(nodes); } function findSpanEnd(array, test, start) { let i = start; @@ -23452,7 +23629,7 @@ ${lanes.join("\n")} } } if (isNodeArray(statements)) { - return setTextRange(createNodeArray2(left, statements.hasTrailingComma), statements); + return setTextRange(createNodeArray(left, statements.hasTrailingComma), statements); } return statements; } @@ -23460,33 +23637,33 @@ ${lanes.join("\n")} var _a2; let modifierArray; if (typeof modifiers === "number") { - modifierArray = createModifiersFromModifierFlags2(modifiers); + modifierArray = createModifiersFromModifierFlags(modifiers); } else { modifierArray = modifiers; } - return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node); + return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node); } function asNodeArray(array) { - return array ? createNodeArray2(array) : void 0; + return array ? createNodeArray(array) : void 0; } function asName(name) { - return typeof name === "string" ? createIdentifier3(name) : name; + return typeof name === "string" ? createIdentifier(name) : name; } function asExpression(value) { - return typeof value === "string" ? createStringLiteral2(value) : typeof value === "number" ? createNumericLiteral2(value) : typeof value === "boolean" ? value ? createTrue2() : createFalse2() : value; + return typeof value === "string" ? createStringLiteral(value) : typeof value === "number" ? createNumericLiteral(value) : typeof value === "boolean" ? value ? createTrue() : createFalse() : value; } function asInitializer(node) { return node && parenthesizerRules().parenthesizeExpressionForDisallowedComma(node); } function asToken(value) { - return typeof value === "number" ? createToken3(value) : value; + return typeof value === "number" ? createToken(value) : value; } function asEmbeddedStatement(statement) { - return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement2(), statement), statement) : statement; + return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement; } function asVariableDeclaration(variableDeclaration) { if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) { - return createVariableDeclaration3( + return createVariableDeclaration( variableDeclaration, /*exclamationToken*/ void 0, @@ -23690,7 +23867,7 @@ ${lanes.join("\n")} case 213 /* TypeAssertionExpression */: case 235 /* SatisfiesExpression */: case 231 /* AsExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 214 /* ParenthesizedExpression */: case 106 /* SuperKeyword */: return -2147483648 /* OuterExpressionExcludes */; @@ -23963,6 +24140,7 @@ ${lanes.join("\n")} function mergeEmitNode(sourceEmitNode, destEmitNode) { const { flags, + internalFlags, leadingComments, trailingComments, commentRange, @@ -23980,7 +24158,9 @@ ${lanes.join("\n")} if (trailingComments) destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); if (flags) - destEmitNode.flags = flags & ~536870912 /* Immutable */; + destEmitNode.flags = flags; + if (internalFlags) + destEmitNode.internalFlags = internalFlags & ~8 /* Immutable */; if (commentRange) destEmitNode.commentRange = commentRange; if (sourceMapRange) @@ -24049,7 +24229,7 @@ ${lanes.join("\n")} } node.emitNode = {}; } else { - Debug.assert(!(node.emitNode.flags & 536870912 /* Immutable */), "Invalid attempt to mutate an immutable node."); + Debug.assert(!(node.emitNode.internalFlags & 8 /* Immutable */), "Invalid attempt to mutate an immutable node."); } return node.emitNode; } @@ -24078,6 +24258,15 @@ ${lanes.join("\n")} emitNode.flags = emitNode.flags | emitFlags; return node; } + function setInternalEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).internalFlags = emitFlags; + return node; + } + function addInternalEmitFlags(node, emitFlags) { + const emitNode = getOrCreateEmitNode(node); + emitNode.internalFlags = emitNode.internalFlags | emitFlags; + return node; + } function getSourceMapRange(node) { var _a2, _b; return (_b = (_a2 = node.emitNode) == null ? void 0 : _a2.sourceMapRange) != null ? _b : node; @@ -24208,7 +24397,7 @@ ${lanes.join("\n")} return node; } function ignoreSourceNewlines(node) { - getOrCreateEmitNode(node).flags |= 268435456 /* IgnoreSourceNewlines */; + getOrCreateEmitNode(node).internalFlags |= 4 /* IgnoreSourceNewlines */; return node; } function setTypeNode(node, type) { @@ -24220,6 +24409,30 @@ ${lanes.join("\n")} var _a2; return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode; } + function setIdentifierTypeArguments(node, typeArguments) { + getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; + return node; + } + function getIdentifierTypeArguments(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments; + } + function setIdentifierAutoGenerate(node, autoGenerate) { + getOrCreateEmitNode(node).autoGenerate = autoGenerate; + return node; + } + function getIdentifierAutoGenerate(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + } + function setIdentifierGeneratedImportReference(node, value) { + getOrCreateEmitNode(node).generatedImportReference = value; + return node; + } + function getIdentifierGeneratedImportReference(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference; + } var init_emitNode = __esm({ "src/compiler/factory/emitNode.ts"() { "use strict"; @@ -24230,14 +24443,17 @@ ${lanes.join("\n")} // src/compiler/factory/emitHelpers.ts function createEmitHelperFactory(context) { const factory2 = context.factory; - const immutableTrue = memoize(() => setEmitFlags(factory2.createTrue(), 536870912 /* Immutable */)); - const immutableFalse = memoize(() => setEmitFlags(factory2.createFalse(), 536870912 /* Immutable */)); + const immutableTrue = memoize(() => setInternalEmitFlags(factory2.createTrue(), 8 /* Immutable */)); + const immutableFalse = memoize(() => setInternalEmitFlags(factory2.createFalse(), 8 /* Immutable */)); return { getUnscopedHelperName, // TypeScript Helpers createDecorateHelper, createMetadataHelper, createParamHelper, + // ES Decorators Helpers + createESDecorateHelper, + createRunInitializersHelper, // ES2018 Helpers createAssignHelper, createAwaitHelper, @@ -24252,6 +24468,8 @@ ${lanes.join("\n")} createExtendsHelper, createTemplateObjectHelper, createSpreadArrayHelper, + createPropKeyHelper, + createSetFunctionNameHelper, // ES2015 Destructuring Helpers createValuesHelper, createReadHelper, @@ -24320,6 +24538,50 @@ ${lanes.join("\n")} location ); } + function createESDecorateClassContextObject(contextIn) { + return factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral("class")), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) + ]); + } + function createESDecorateClassElementContextObject(contextIn) { + return factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), + factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()) + // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494 + // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) + ]); + } + function createESDecorateContextObject(contextIn) { + return contextIn.kind === "class" ? createESDecorateClassContextObject(contextIn) : createESDecorateClassElementContextObject(contextIn); + } + function createESDecorateHelper(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + context.requestEmitHelper(esDecorateHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__esDecorate"), + /*typeArguments*/ + void 0, + [ + ctor != null ? ctor : factory2.createNull(), + descriptorIn != null ? descriptorIn : factory2.createNull(), + decorators, + createESDecorateContextObject(contextIn), + initializers, + extraInitializers + ] + ); + } + function createRunInitializersHelper(thisArg, initializers, value) { + context.requestEmitHelper(runInitializersHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__runInitializers"), + /*typeArguments*/ + void 0, + value ? [thisArg, initializers, value] : [thisArg, initializers] + ); + } function createAssignHelper(attributesSegments) { if (getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { return factory2.createCallExpression( @@ -24476,6 +24738,24 @@ ${lanes.join("\n")} [to, from, packFrom ? immutableTrue() : immutableFalse()] ); } + function createPropKeyHelper(expr) { + context.requestEmitHelper(propKeyHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__propKey"), + /*typeArguments*/ + void 0, + [expr] + ); + } + function createSetFunctionNameHelper(f, name, prefix) { + context.requestEmitHelper(setFunctionNameHelper); + return context.factory.createCallExpression( + getUnscopedHelperName("__setFunctionName"), + /*typeArguments*/ + void 0, + prefix ? [f, name, context.factory.createStringLiteral(prefix)] : [f, name] + ); + } function createValuesHelper(expression) { context.requestEmitHelper(valuesHelper); return factory2.createCallExpression( @@ -24611,6 +24891,8 @@ ${lanes.join("\n")} decorateHelper, metadataHelper, paramHelper, + esDecorateHelper, + runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, @@ -24623,6 +24905,8 @@ ${lanes.join("\n")} spreadArrayHelper, valuesHelper, readHelper, + propKeyHelper, + setFunctionNameHelper, generatorHelper, importStarHelper, importDefaultHelper, @@ -24637,11 +24921,17 @@ ${lanes.join("\n")} function isCallToHelper(firstSegment, helperName) { return isCallExpression(firstSegment) && isIdentifier(firstSegment.expression) && (getEmitFlags(firstSegment.expression) & 8192 /* HelperName */) !== 0 && firstSegment.expression.escapedText === helperName; } - var decorateHelper, metadataHelper, paramHelper, assignHelper, awaitHelper, asyncGeneratorHelper, asyncDelegator, asyncValues, restHelper, awaiterHelper, extendsHelper, templateObjectHelper, readHelper, spreadArrayHelper, valuesHelper, generatorHelper, createBindingHelper, setModuleDefaultHelper, importStarHelper, importDefaultHelper, exportStarHelper, classPrivateFieldGetHelper, classPrivateFieldSetHelper, classPrivateFieldInHelper, allUnscopedEmitHelpers, asyncSuperHelper, advancedAsyncSuperHelper; + var PrivateIdentifierKind, decorateHelper, metadataHelper, paramHelper, esDecorateHelper, runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, asyncDelegator, asyncValues, restHelper, awaiterHelper, extendsHelper, templateObjectHelper, readHelper, spreadArrayHelper, propKeyHelper, setFunctionNameHelper, valuesHelper, generatorHelper, createBindingHelper, setModuleDefaultHelper, importStarHelper, importDefaultHelper, exportStarHelper, classPrivateFieldGetHelper, classPrivateFieldSetHelper, classPrivateFieldInHelper, allUnscopedEmitHelpers, asyncSuperHelper, advancedAsyncSuperHelper; var init_emitHelpers = __esm({ "src/compiler/factory/emitHelpers.ts"() { "use strict"; init_ts2(); + PrivateIdentifierKind = /* @__PURE__ */ ((PrivateIdentifierKind2) => { + PrivateIdentifierKind2["Field"] = "f"; + PrivateIdentifierKind2["Method"] = "m"; + PrivateIdentifierKind2["Accessor"] = "a"; + return PrivateIdentifierKind2; + })(PrivateIdentifierKind || {}); decorateHelper = { name: "typescript:decorate", importName: "__decorate", @@ -24675,6 +24965,54 @@ ${lanes.join("\n")} return function (target, key) { decorator(target, key, paramIndex); } };` }; + esDecorateHelper = { + name: "typescript:esDecorate", + importName: "__esDecorate", + scoped: false, + priority: 2, + text: ` + var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.push(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.push(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + };` + }; + runInitializersHelper = { + name: "typescript:runInitializers", + importName: "__runInitializers", + scoped: false, + priority: 2, + text: ` + var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + };` + }; assignHelper = { name: "typescript:assign", importName: "__assign", @@ -24847,6 +25185,25 @@ ${lanes.join("\n")} return to.concat(ar || Array.prototype.slice.call(from)); };` }; + propKeyHelper = { + name: "typescript:propKey", + importName: "__propKey", + scoped: false, + text: ` + var __propKey = (this && this.__propKey) || function (x) { + return typeof x === "symbol" ? x : "".concat(x); + };` + }; + setFunctionNameHelper = { + name: "typescript:setFunctionName", + importName: "__setFunctionName", + scoped: false, + text: ` + var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + };` + }; valuesHelper = { name: "typescript:values", importName: "__values", @@ -25081,6 +25438,9 @@ ${lanes.join("\n")} function isExportModifier(node) { return node.kind === 93 /* ExportKeyword */; } + function isDefaultModifier(node) { + return node.kind === 88 /* DefaultKeyword */; + } function isAsyncModifier(node) { return node.kind === 132 /* AsyncKeyword */; } @@ -25334,10 +25694,10 @@ ${lanes.join("\n")} return node.kind === 234 /* SyntheticExpression */; } function isPartiallyEmittedExpression(node) { - return node.kind === 355 /* PartiallyEmittedExpression */; + return node.kind === 356 /* PartiallyEmittedExpression */; } function isCommaListExpression(node) { - return node.kind === 356 /* CommaListExpression */; + return node.kind === 357 /* CommaListExpression */; } function isTemplateSpan(node) { return node.kind === 236 /* TemplateSpan */; @@ -25481,16 +25841,16 @@ ${lanes.join("\n")} return node.kind === 279 /* MissingDeclaration */; } function isNotEmittedStatement(node) { - return node.kind === 354 /* NotEmittedStatement */; + return node.kind === 355 /* NotEmittedStatement */; } function isSyntheticReference(node) { - return node.kind === 359 /* SyntheticReferenceExpression */; + return node.kind === 360 /* SyntheticReferenceExpression */; } function isMergeDeclarationMarker(node) { - return node.kind === 357 /* MergeDeclarationMarker */; + return node.kind === 358 /* MergeDeclarationMarker */; } function isEndOfDeclarationMarker(node) { - return node.kind === 358 /* EndOfDeclarationMarker */; + return node.kind === 359 /* EndOfDeclarationMarker */; } function isExternalModuleReference(node) { return node.kind === 280 /* ExternalModuleReference */; @@ -25681,11 +26041,14 @@ ${lanes.join("\n")} function isJSDocImplementsTag(node) { return node.kind === 332 /* JSDocImplementsTag */; } + function isJSDocSatisfiesTag(node) { + return node.kind === 353 /* JSDocSatisfiesTag */; + } function isJSDocThrowsTag(node) { return node.kind === 352 /* JSDocThrowsTag */; } function isSyntaxList(n) { - return n.kind === 353 /* SyntaxList */; + return n.kind === 354 /* SyntaxList */; } var init_nodeTests = __esm({ "src/compiler/factory/nodeTests.ts"() { @@ -25714,7 +26077,7 @@ ${lanes.join("\n")} isMemberName(memberName) ? factory2.createPropertyAccessExpression(target, memberName) : factory2.createElementAccessExpression(target, memberName), memberName ); - getOrCreateEmitNode(expression).flags |= 128 /* NoNestedSourceMaps */; + addEmitFlags(expression, 128 /* NoNestedSourceMaps */); return expression; } } @@ -26058,8 +26421,11 @@ ${lanes.join("\n")} const firstStatement = firstOrUndefined(statements); return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); } + function isCommaExpression(node) { + return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */; + } function isCommaSequence(node) { - return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 356 /* CommaListExpression */; + return isCommaExpression(node) || isCommaListExpression(node); } function isJSDocTypeAssertion(node) { return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node); @@ -26078,11 +26444,12 @@ ${lanes.join("\n")} return (kinds & 1 /* Parentheses */) !== 0; case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: + case 230 /* ExpressionWithTypeArguments */: case 235 /* SatisfiesExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; case 232 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -26093,6 +26460,14 @@ ${lanes.join("\n")} } return node; } + function walkUpOuterExpressions(node, kinds = 15 /* All */) { + let parent2 = node.parent; + while (isOuterExpression(parent2, kinds)) { + parent2 = parent2.parent; + Debug.assert(parent2); + } + return parent2; + } function skipAssertions(node) { return skipOuterExpressions(node, 6 /* Assertions */); } @@ -26174,7 +26549,7 @@ ${lanes.join("\n")} /*assertClause*/ void 0 ); - addEmitFlags(externalHelpersImportDeclaration, 134217728 /* NeverApplyImportHelper */); + addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */); return externalHelpersImportDeclaration; } } @@ -26386,6 +26761,21 @@ ${lanes.join("\n")} const kind = node.kind; return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; } + function isQuestionOrExclamationToken(node) { + return isQuestionToken(node) || isExclamationToken(node); + } + function isIdentifierOrThisTypeNode(node) { + return isIdentifier(node) || isThisTypeNode(node); + } + function isReadonlyKeywordOrPlusOrMinusToken(node) { + return isReadonlyKeyword(node) || isPlusToken(node) || isMinusToken(node); + } + function isQuestionOrPlusOrMinusToken(node) { + return isQuestionToken(node) || isPlusToken(node) || isMinusToken(node); + } + function isModuleName(node) { + return isIdentifier(node) || isStringLiteral(node); + } function isLiteralTypeLikeExpression(node) { const kind = node.kind; return kind === 104 /* NullKeyword */ || kind === 110 /* TrueKeyword */ || kind === 95 /* FalseKeyword */ || isLiteralExpression(node) || isPrefixUnaryExpression(node); @@ -26460,6 +26850,17 @@ ${lanes.join("\n")} return resultHolder.value; } } + function isExportOrDefaultKeywordKind(kind) { + return kind === 93 /* ExportKeyword */ || kind === 88 /* DefaultKeyword */; + } + function isExportOrDefaultModifier(node) { + const kind = node.kind; + return isExportOrDefaultKeywordKind(kind); + } + function isNonExportDefaultModifier(node) { + const kind = node.kind; + return isModifierKind(kind) && !isExportOrDefaultKeywordKind(kind); + } function elideNodes(factory2, nodes) { if (nodes === void 0) return void 0; @@ -26468,13 +26869,16 @@ ${lanes.join("\n")} return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes); } function getNodeForGeneratedName(name) { - if (name.autoGenerate.flags & 4 /* Node */) { - const autoGenerateId = name.autoGenerate.id; + var _a2; + const autoGenerate = name.emitNode.autoGenerate; + if (autoGenerate.flags & 4 /* Node */) { + const autoGenerateId = autoGenerate.id; let node = name; let original = node.original; while (original) { node = original; - if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) { + const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) { break; } original = node.original; @@ -26573,17 +26977,55 @@ ${lanes.join("\n")} ]) ); } - var isTypeNodeOrTypeParameterDeclaration, isQuestionOrExclamationToken, isIdentifierOrThisTypeNode, isReadonlyKeywordOrPlusOrMinusToken, isQuestionOrPlusOrMinusToken, isModuleName, BinaryExpressionState, BinaryExpressionStateMachine; + function findComputedPropertyNameCacheAssignment(name) { + let node = name.expression; + while (true) { + node = skipOuterExpressions(node); + if (isCommaListExpression(node)) { + node = last(node.elements); + continue; + } + if (isCommaExpression(node)) { + node = node.right; + continue; + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ) && isGeneratedIdentifier(node.left)) { + return node; + } + break; + } + } + function isSyntheticParenthesizedExpression(node) { + return isParenthesizedExpression(node) && nodeIsSynthesized(node) && !node.emitNode; + } + function flattenCommaListWorker(node, expressions) { + if (isSyntheticParenthesizedExpression(node)) { + flattenCommaListWorker(node.expression, expressions); + } else if (isCommaExpression(node)) { + flattenCommaListWorker(node.left, expressions); + flattenCommaListWorker(node.right, expressions); + } else if (isCommaListExpression(node)) { + for (const child of node.elements) { + flattenCommaListWorker(child, expressions); + } + } else { + expressions.push(node); + } + } + function flattenCommaList(node) { + const expressions = []; + flattenCommaListWorker(node, expressions); + return expressions; + } + var BinaryExpressionState, BinaryExpressionStateMachine; var init_utilities2 = __esm({ "src/compiler/factory/utilities.ts"() { "use strict"; init_ts2(); - isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration); - isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken); - isIdentifierOrThisTypeNode = or(isIdentifier, isThisTypeNode); - isReadonlyKeywordOrPlusOrMinusToken = or(isReadonlyKeyword, isPlusToken, isMinusToken); - isQuestionOrPlusOrMinusToken = or(isQuestionToken, isPlusToken, isMinusToken); - isModuleName = or(isIdentifier, isStringLiteral); ((BinaryExpressionState2) => { function enter(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, outerState) { const prevUserState = stackIndex > 0 ? userStateStack[stackIndex - 1] : void 0; @@ -27169,7 +27611,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); }, [300 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); }, [301 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); @@ -27184,7 +27626,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, [299 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); }, [257 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); @@ -27193,7 +27635,7 @@ ${lanes.join("\n")} return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [178 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [182 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -27210,7 +27652,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [173 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [174 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -27219,7 +27661,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [259 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [215 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -27228,7 +27670,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); }, [172 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); }, [180 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); @@ -27349,7 +27791,7 @@ ${lanes.join("\n")} return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); }, [240 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); }, [258 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.declarations); @@ -27413,25 +27855,25 @@ ${lanes.join("\n")} [260 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, [228 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, [261 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); }, [262 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); }, [263 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); }, [302 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [264 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); }, [268 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); }, [269 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [270 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); @@ -27443,7 +27885,7 @@ ${lanes.join("\n")} return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); }, [267 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); }, [271 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); @@ -27454,12 +27896,12 @@ ${lanes.join("\n")} [272 /* NamedImports */]: forEachChildInNamedImportsOrExports, [276 /* NamedExports */]: forEachChildInNamedImportsOrExports, [275 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [273 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, [278 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, [274 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); }, [225 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); @@ -27486,9 +27928,9 @@ ${lanes.join("\n")} return visitNode2(cbNode, node.expression); }, [279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers); + return visitNodes(cbNode, cbNodes, node.modifiers); }, - [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, [281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { @@ -27560,6 +28002,7 @@ ${lanes.join("\n")} [347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, [346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, [343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, + [353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, [352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, [342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, [326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { @@ -27579,7 +28022,7 @@ ${lanes.join("\n")} [339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, [334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, [340 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression + [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; ((Parser2) => { const scanner2 = createScanner( @@ -27709,7 +28152,7 @@ ${lanes.join("\n")} const pos = getNodePos(); let statements, endOfFileToken; if (token() === 1 /* EndOfFileToken */) { - statements = createNodeArray2([], pos, pos); + statements = createNodeArray([], pos, pos); endOfFileToken = parseTokenNode(); } else { let expressions; @@ -27755,7 +28198,7 @@ ${lanes.join("\n")} const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); const statement = factory2.createExpressionStatement(expression); finishNode(statement, pos); - statements = createNodeArray2([statement], pos); + statements = createNodeArray([statement], pos); endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); } const sourceFile = createSourceFile2( @@ -28403,7 +28846,7 @@ ${lanes.join("\n")} function parseSemicolon() { return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); } - function createNodeArray2(elements, pos, end, hasTrailingComma) { + function createNodeArray(elements, pos, end, hasTrailingComma) { const array = factory2.createNodeArray(elements, hasTrailingComma); setTextRangePosEnd(array, pos, end != null ? end : scanner2.getStartPos()); return array; @@ -28428,8 +28871,6 @@ ${lanes.join("\n")} const pos = getNodePos(); const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( "", - /*typeArguments*/ - void 0, /*originalKeywordKind*/ void 0 ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode( @@ -28456,7 +28897,7 @@ ${lanes.join("\n")} } return identifier; } - function createIdentifier3(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { + function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { if (isIdentifier3) { identifierCount++; const pos = getNodePos(); @@ -28464,23 +28905,17 @@ ${lanes.join("\n")} const text = internIdentifier(scanner2.getTokenValue()); const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind, - hasExtendedUnicodeEscape - ), pos); + return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - return createIdentifier3( + return createIdentifier( /*isIdentifier*/ true ); } if (token() === 0 /* Unknown */ && scanner2.tryScan(() => scanner2.reScanInvalidIdentifier() === 79 /* Identifier */)) { - return createIdentifier3( + return createIdentifier( /*isIdentifier*/ true ); @@ -28493,7 +28928,7 @@ ${lanes.join("\n")} return createMissingNode(79 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg); } function parseBindingIdentifier(privateIdentifierDiagnosticMessage) { - return createIdentifier3( + return createIdentifier( isBindingIdentifier(), /*diagnosticMessage*/ void 0, @@ -28501,10 +28936,10 @@ ${lanes.join("\n")} ); } function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) { - return createIdentifier3(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); + return createIdentifier(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); } function parseIdentifierName(diagnosticMessage) { - return createIdentifier3(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); + return createIdentifier(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); } function isLiteralPropertyName() { return tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */; @@ -28581,7 +29016,7 @@ ${lanes.join("\n")} } } function canFollowExportModifier() { - return token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); + return token() === 59 /* AtToken */ || token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); } function nextTokenCanFollowExportModifier() { nextToken(); @@ -28595,7 +29030,7 @@ ${lanes.join("\n")} } function nextTokenCanFollowDefaultKeyword() { nextToken(); - return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); + return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 59 /* AtToken */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); } function isListElement2(parsingContext2, inErrorRecovery) { const node = currentNode(parsingContext2); @@ -28802,7 +29237,7 @@ ${lanes.join("\n")} } } parsingContext = saveParsingContext; - return createNodeArray2(list, listPos); + return createNodeArray(list, listPos); } function parseListElement(parsingContext2, parseElement) { const node = currentNode(parsingContext2); @@ -28812,6 +29247,7 @@ ${lanes.join("\n")} return parseElement(); } function currentNode(parsingContext2, pos) { + var _a2; if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { return void 0; } @@ -28826,8 +29262,8 @@ ${lanes.join("\n")} if (!canReuseNode(node, parsingContext2)) { return void 0; } - if (canHaveJSDoc(node) && node.jsDocCache) { - node.jsDocCache = void 0; + if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) { + node.jsDoc.jsDocCache = void 0; } return node; } @@ -28886,7 +29322,7 @@ ${lanes.join("\n")} return true; case 171 /* MethodDeclaration */: const methodDeclaration = node; - const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 135 /* ConstructorKeyword */; + const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; } } @@ -29078,7 +29514,7 @@ ${lanes.join("\n")} } } parsingContext = saveParsingContext; - return createNodeArray2( + return createNodeArray( list, listPos, /*end*/ @@ -29090,7 +29526,7 @@ ${lanes.join("\n")} return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; } function createMissingList() { - const list = createNodeArray2([], getNodePos()); + const list = createNodeArray([], getNodePos()); list.isMissingList = true; return list; } @@ -29108,13 +29544,10 @@ ${lanes.join("\n")} function parseEntityName(allowReservedWords, diagnosticMessage) { const pos = getNodePos(); let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); - let dotPos = getNodePos(); while (parseOptional(24 /* DotToken */)) { if (token() === 29 /* LessThanToken */) { - entity.jsdocDotPos = dotPos; break; } - dotPos = getNodePos(); entity = finishNode( factory2.createQualifiedName( entity, @@ -29129,7 +29562,7 @@ ${lanes.join("\n")} } return entity; } - function createQualifiedName2(entity, name) { + function createQualifiedName(entity, name) { return finishNode(factory2.createQualifiedName(entity, name), entity.pos); } function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers) { @@ -29163,7 +29596,7 @@ ${lanes.join("\n")} node = parseTemplateSpan(isTaggedTemplate); list.push(node); } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray2(list, pos); + return createNodeArray(list, pos); } function parseTemplateExpression(isTaggedTemplate) { const pos = getNodePos(); @@ -29196,7 +29629,7 @@ ${lanes.join("\n")} node = parseTemplateTypeSpan(); list.push(node); } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray2(list, pos); + return createNodeArray(list, pos); } function parseTemplateTypeSpan() { const pos = getNodePos(); @@ -29444,6 +29877,8 @@ ${lanes.join("\n")} function parseTypeParameter() { const pos = getNodePos(); const modifiers = parseModifiers( + /*allowDecorators*/ + false, /*permitConstAsModifier*/ true ); @@ -29496,13 +29931,19 @@ ${lanes.join("\n")} function parseParameterWorker(inOuterAwaitContext, allowAmbiguity = true) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : doOutsideOfAwaitContext(parseDecorators); + const modifiers = inOuterAwaitContext ? doInAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )) : doOutsideOfAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )); if (token() === 108 /* ThisKeyword */) { const node2 = factory2.createParameterDeclaration( - decorators, + modifiers, /*dotDotDotToken*/ void 0, - createIdentifier3( + createIdentifier( /*isIdentifier*/ true ), @@ -29512,14 +29953,14 @@ ${lanes.join("\n")} /*initializer*/ void 0 ); - if (decorators) { - parseErrorAtRange(decorators[0], Diagnostics.Decorators_may_not_be_applied_to_this_parameters); + const modifier = firstOrUndefined(modifiers); + if (modifier) { + parseErrorAtRange(modifier, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); } return withJSDoc(finishNode(node2, pos), hasJSDoc); } const savedTopLevel = topLevel; topLevel = false; - const modifiers = combineDecoratorsAndModifiers(decorators, parseModifiers()); const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); if (!allowAmbiguity && !isParameterNameStart()) { return void 0; @@ -29631,7 +30072,7 @@ ${lanes.join("\n")} nextToken(); return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } - function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( /*inOuterAwaitContext*/ false @@ -29639,7 +30080,6 @@ ${lanes.join("\n")} const type = parseTypeAnnotation(); parseTypeMemberSemicolon(); const node = factory2.createIndexSignature(modifiers, parameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { @@ -29694,37 +30134,18 @@ ${lanes.join("\n")} } const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 174 /* GetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 4 /* Type */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 175 /* SetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 4 /* Type */); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers - ); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); } @@ -29868,7 +30289,7 @@ ${lanes.join("\n")} const pos = getNodePos(); nextToken(); const modifier = finishNode(factory2.createToken(126 /* AbstractKeyword */), pos); - modifiers = createNodeArray2([modifier], pos); + modifiers = createNodeArray([modifier], pos); } return modifiers; } @@ -30179,7 +30600,7 @@ ${lanes.join("\n")} while (parseOptional(operator)) { types.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType()); } - type = finishNode(createTypeNode(createNodeArray2(types, pos)), pos); + type = finishNode(createTypeNode(createNodeArray(types, pos)), pos); } return type; } @@ -30204,7 +30625,10 @@ ${lanes.join("\n")} } function skipParameterStart() { if (isModifierKind(token())) { - parseModifiers(); + parseModifiers( + /*allowDecorators*/ + false + ); } if (isIdentifier2() || token() === 108 /* ThisKeyword */) { nextToken(); @@ -30332,6 +30756,7 @@ ${lanes.join("\n")} case 133 /* AwaitKeyword */: case 125 /* YieldKeyword */: case 80 /* PrivateIdentifier */: + case 59 /* AtToken */: return true; default: if (isBinaryOperator2()) { @@ -30453,7 +30878,7 @@ ${lanes.join("\n")} void 0 ); finishNode(parameter, identifier.pos); - const parameters = createNodeArray2([parameter], parameter.pos, parameter.end); + const parameters = createNodeArray([parameter], parameter.pos, parameter.end); const equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */); const body = parseArrowFunctionExpressionBody( /*isAsync*/ @@ -30940,7 +31365,7 @@ ${lanes.join("\n")} lastChild.openingElement.pos, end ); - children = createNodeArray2([...children.slice(0, children.length - 1), newLast], children.pos, end); + children = createNodeArray([...children.slice(0, children.length - 1), newLast], children.pos, end); closingElement = lastChild.closingElement; } else { closingElement = parseJsxClosingElement(opening, inExpressionContext); @@ -31034,7 +31459,7 @@ ${lanes.join("\n")} } } parsingContext = saveParsingContext; - return createNodeArray2(list, listPos); + return createNodeArray(list, listPos); } function parseJsxAttributes() { const pos = getNodePos(); @@ -31423,6 +31848,8 @@ ${lanes.join("\n")} break; } return parseFunctionExpression(); + case 59 /* AtToken */: + return parseDecoratedExpression(); case 84 /* ClassKeyword */: return parseClassExpression(); case 98 /* FunctionKeyword */: @@ -31490,13 +31917,15 @@ ${lanes.join("\n")} ); return withJSDoc(finishNode(factory2.createSpreadAssignment(expression), pos), hasJSDoc); } - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const tokenIsIdentifier = isIdentifier2(); @@ -31504,7 +31933,7 @@ ${lanes.join("\n")} const questionToken = parseOptionalToken(57 /* QuestionToken */); const exclamationToken = parseOptionalToken(53 /* ExclamationToken */); if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken); + return parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken); } let node; const isShorthandPropertyAssignment2 = tokenIsIdentifier && token() !== 58 /* ColonToken */; @@ -31524,7 +31953,6 @@ ${lanes.join("\n")} )); node = factory2.createPropertyAssignment(name, initializer); } - node.illegalDecorators = decorators; node.modifiers = modifiers; node.questionToken = questionToken; node.exclamationToken = exclamationToken; @@ -31552,7 +31980,10 @@ ${lanes.join("\n")} ); const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); parseExpected(98 /* FunctionKeyword */); const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; @@ -31924,7 +32355,7 @@ ${lanes.join("\n")} if (currentToken2 === 154 /* TypeKeyword */) { currentToken2 = lookAhead(nextToken); } - if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */) { + if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */ || currentToken2 === 59 /* AtToken */) { return true; } continue; @@ -32008,8 +32439,6 @@ ${lanes.join("\n")} return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -32018,8 +32447,6 @@ ${lanes.join("\n")} return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -32029,8 +32456,6 @@ ${lanes.join("\n")} return parseFunctionDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -32038,8 +32463,6 @@ ${lanes.join("\n")} return parseClassDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -32102,8 +32525,10 @@ ${lanes.join("\n")} function parseDeclaration() { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); const isAmbient = some(modifiers, isDeclareModifier); if (isAmbient) { const node = tryReuseAmbientDeclaration(pos); @@ -32113,9 +32538,9 @@ ${lanes.join("\n")} for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); } else { - return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); + return parseDeclarationWorker(pos, hasJSDoc, modifiers); } } function tryReuseAmbientDeclaration(pos) { @@ -32126,41 +32551,41 @@ ${lanes.join("\n")} } }); } - function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) { + function parseDeclarationWorker(pos, hasJSDoc, modifiersIn) { switch (token()) { case 113 /* VarKeyword */: case 119 /* LetKeyword */: case 85 /* ConstKeyword */: - return parseVariableStatement(pos, hasJSDoc, decorators, modifiers); + return parseVariableStatement(pos, hasJSDoc, modifiersIn); case 98 /* FunctionKeyword */: - return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseFunctionDeclaration(pos, hasJSDoc, modifiersIn); case 84 /* ClassKeyword */: - return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassDeclaration(pos, hasJSDoc, modifiersIn); case 118 /* InterfaceKeyword */: - return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseInterfaceDeclaration(pos, hasJSDoc, modifiersIn); case 154 /* TypeKeyword */: - return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseTypeAliasDeclaration(pos, hasJSDoc, modifiersIn); case 92 /* EnumKeyword */: - return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseEnumDeclaration(pos, hasJSDoc, modifiersIn); case 159 /* GlobalKeyword */: case 142 /* ModuleKeyword */: case 143 /* NamespaceKeyword */: - return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseModuleDeclaration(pos, hasJSDoc, modifiersIn); case 100 /* ImportKeyword */: - return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiersIn); case 93 /* ExportKeyword */: nextToken(); switch (token()) { case 88 /* DefaultKeyword */: case 63 /* EqualsToken */: - return parseExportAssignment(pos, hasJSDoc, decorators, modifiers); + return parseExportAssignment(pos, hasJSDoc, modifiersIn); case 128 /* AsKeyword */: - return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseNamespaceExportDeclaration(pos, hasJSDoc, modifiersIn); default: - return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseExportDeclaration(pos, hasJSDoc, modifiersIn); } default: - if (decorators || modifiers) { + if (modifiersIn) { const missing = createMissingNode( 279 /* MissingDeclaration */, /*reportAtCurrentPosition*/ @@ -32168,8 +32593,7 @@ ${lanes.join("\n")} Diagnostics.Declaration_expected ); setTextRangePos(missing, pos); - missing.illegalDecorators = decorators; - missing.modifiers = modifiers; + missing.modifiers = modifiersIn; return missing; } return void 0; @@ -32302,17 +32726,16 @@ ${lanes.join("\n")} function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } - function parseVariableStatement(pos, hasJSDoc, decorators, modifiers) { + function parseVariableStatement(pos, hasJSDoc, modifiers) { const declarationList = parseVariableDeclarationList( /*inForStatementInitializer*/ false ); parseSemicolon(); const node = factory2.createVariableStatement(modifiers, declarationList); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); const modifierFlags = modifiersToFlags(modifiers); parseExpected(98 /* FunctionKeyword */); @@ -32335,7 +32758,6 @@ ${lanes.join("\n")} const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, Diagnostics.or_expected); setAwaitContext(savedAwaitContext); const node = factory2.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseConstructorName() { @@ -32349,7 +32771,7 @@ ${lanes.join("\n")} }); } } - function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) { + function tryParseConstructorDeclaration(pos, hasJSDoc, modifiers) { return tryParse(() => { if (parseConstructorName()) { const typeParameters = parseTypeParameters(); @@ -32361,14 +32783,13 @@ ${lanes.join("\n")} ); const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected); const node = factory2.createConstructorDeclaration(modifiers, parameters, body); - node.illegalDecorators = decorators; node.typeParameters = typeParameters; node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } }); } - function parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { + function parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; const typeParameters = parseTypeParameters(); @@ -32380,7 +32801,7 @@ ${lanes.join("\n")} ); const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage); const node = factory2.createMethodDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, asteriskToken, name, questionToken, @@ -32392,13 +32813,13 @@ ${lanes.join("\n")} node.exclamationToken = exclamationToken; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken) { + function parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken) { const exclamationToken = !questionToken && !scanner2.hasPrecedingLineBreak() ? parseOptionalToken(53 /* ExclamationToken */) : void 0; const type = parseTypeAnnotation(); const initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer); parseSemicolonAfterPropertyName(name, type, initializer); const node = factory2.createPropertyDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, name, questionToken || exclamationToken, type, @@ -32406,7 +32827,7 @@ ${lanes.join("\n")} ); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers) { const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const name = parsePropertyName(); const questionToken = parseOptionalToken(57 /* QuestionToken */); @@ -32414,7 +32835,6 @@ ${lanes.join("\n")} return parseMethodDeclaration( pos, hasJSDoc, - decorators, modifiers, asteriskToken, name, @@ -32424,9 +32844,9 @@ ${lanes.join("\n")} Diagnostics.or_expected ); } - return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken); + return parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken); } - function parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, kind, flags) { + function parseAccessorDeclaration(pos, hasJSDoc, modifiers, kind, flags) { const name = parsePropertyName(); const typeParameters = parseTypeParameters(); const parameters = parseParameters(0 /* None */); @@ -32436,7 +32856,7 @@ ${lanes.join("\n")} false ); const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body); + const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); node.typeParameters = typeParameters; if (isSetAccessorDeclaration(node)) node.type = type; @@ -32482,11 +32902,10 @@ ${lanes.join("\n")} } return false; } - function parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers) { parseExpectedToken(124 /* StaticKeyword */); const body = parseClassStaticBlockBody(); const node = withJSDoc(finishNode(factory2.createClassStaticBlockDeclaration(body), pos), hasJSDoc); - node.illegalDecorators = decorators; node.modifiers = modifiers; return node; } @@ -32526,15 +32945,7 @@ ${lanes.join("\n")} const expression = doInDecoratorContext(parseDecoratorExpression); return finishNode(factory2.createDecorator(expression), pos); } - function parseDecorators() { - const pos = getNodePos(); - let list, decorator; - while (decorator = tryParseDecorator()) { - list = append(list, decorator); - } - return list && createNodeArray2(list, pos); - } - function tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { + function tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); const kind = token(); if (token() === 85 /* ConstKeyword */ && permitConstAsModifier) { @@ -32552,24 +32963,27 @@ ${lanes.join("\n")} } return finishNode(factory2.createToken(kind), pos); } - function combineDecoratorsAndModifiers(decorators, modifiers) { - if (!decorators) - return modifiers; - if (!modifiers) - return decorators; - const decoratorsAndModifiers = factory2.createNodeArray(concatenate(decorators, modifiers)); - setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end); - return decoratorsAndModifiers; - } - function parseModifiers(permitConstAsModifier, stopOnStartOfClassStaticBlock) { + function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); - let list, modifier, hasSeenStatic = false; - while (modifier = tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) { + let list; + let modifier, hasSeenStaticModifier = false; + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) - hasSeenStatic = true; + hasSeenStaticModifier = true; list = append(list, modifier); } - return list && createNodeArray2(list, pos); + if (allowDecorators && token() === 59 /* AtToken */) { + let decorator; + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { + if (modifier.kind === 124 /* StaticKeyword */) + hasSeenStaticModifier = true; + list = append(list, modifier); + } + } + return list && createNodeArray(list, pos); } function parseModifiersForArrowFunction() { let modifiers; @@ -32577,7 +32991,7 @@ ${lanes.join("\n")} const pos = getNodePos(); nextToken(); const modifier = finishNode(factory2.createToken(132 /* AsyncKeyword */), pos); - modifiers = createNodeArray2([modifier], pos); + modifiers = createNodeArray([modifier], pos); } return modifiers; } @@ -32588,30 +33002,31 @@ ${lanes.join("\n")} return finishNode(factory2.createSemicolonClassElement(), pos); } const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); const modifiers = parseModifiers( + /*allowDecorators*/ + true, /*permitConstAsModifier*/ true, /*stopOnStartOfClassStaticBlock*/ true ); if (token() === 124 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { - return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); } if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } if (token() === 135 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { - const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); + const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); if (constructorDeclaration) { return constructorDeclaration; } } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) { const isAmbient = some(modifiers, isDeclareModifier); @@ -32619,12 +33034,12 @@ ${lanes.join("\n")} for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); } else { - return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); + return parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers); } } - if (decorators || modifiers) { + if (modifiers) { const name = createMissingNode( 79 /* Identifier */, /*reportAtCurrentPosition*/ @@ -32634,7 +33049,6 @@ ${lanes.join("\n")} return parsePropertyDeclaration( pos, hasJSDoc, - decorators, modifiers, name, /*questionToken*/ @@ -32643,21 +33057,39 @@ ${lanes.join("\n")} } return Debug.fail("Should not have attempted to parse class member declaration."); } + function parseDecoratedExpression() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); + if (token() === 84 /* ClassKeyword */) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 228 /* ClassExpression */); + } + const missing = createMissingNode( + 279 /* MissingDeclaration */, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Expression_expected + ); + setTextRangePos(missing, pos); + missing.modifiers = modifiers; + return missing; + } function parseClassExpression() { return parseClassDeclarationOrExpression( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0, 228 /* ClassExpression */ ); } - function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 260 /* ClassDeclaration */); + function parseClassDeclaration(pos, hasJSDoc, modifiers) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 260 /* ClassDeclaration */); } - function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { + function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { const savedAwaitContext = inAwaitContext(); parseExpected(84 /* ClassKeyword */); const name = parseNameOfClassDeclarationOrExpression(); @@ -32676,11 +33108,11 @@ ${lanes.join("\n")} members = createMissingList(); } setAwaitContext(savedAwaitContext); - const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members); + const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseNameOfClassDeclarationOrExpression() { - return isBindingIdentifier() && !isImplementsClause() ? createIdentifier3(isBindingIdentifier()) : void 0; + return isBindingIdentifier() && !isImplementsClause() ? createIdentifier(isBindingIdentifier()) : void 0; } function isImplementsClause() { return token() === 117 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); @@ -32717,17 +33149,16 @@ ${lanes.join("\n")} function parseClassMembers() { return parseList(ParsingContext.ClassMembers, parseClassElement); } - function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); const heritageClauses = parseHeritageClauses(); const members = parseObjectTypeMembers(); const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) { parseExpected(154 /* TypeKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); @@ -32735,7 +33166,6 @@ ${lanes.join("\n")} const type = token() === 139 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); parseSemicolon(); const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseEnumMember() { @@ -32745,7 +33175,7 @@ ${lanes.join("\n")} const initializer = allowInAnd(parseInitializer); return withJSDoc(finishNode(factory2.createEnumMember(name, initializer), pos), hasJSDoc); } - function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseEnumDeclaration(pos, hasJSDoc, modifiers) { parseExpected(92 /* EnumKeyword */); const name = parseIdentifier(); let members; @@ -32756,7 +33186,6 @@ ${lanes.join("\n")} members = createMissingList(); } const node = factory2.createEnumDeclaration(modifiers, name, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseModuleBlock() { @@ -32770,24 +33199,21 @@ ${lanes.join("\n")} } return finishNode(factory2.createModuleBlock(statements), pos); } - function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags) { + function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) { const namespaceFlag = flags & 16 /* Namespace */; const name = parseIdentifier(); const body = parseOptional(24 /* DotToken */) ? parseModuleOrNamespaceDeclaration( getNodePos(), /*hasJSDoc*/ false, - /*decorators*/ - void 0, /*modifiers*/ void 0, 4 /* NestedNamespace */ | namespaceFlag ) : parseModuleBlock(); const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; let name; if (token() === 159 /* GlobalKeyword */) { @@ -32803,23 +33229,22 @@ ${lanes.join("\n")} } else { parseSemicolon(); } - const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; + const node = factory2.createModuleDeclaration(modifiersIn, name, body, flags); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; if (token() === 159 /* GlobalKeyword */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } else if (parseOptional(143 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { parseExpected(142 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } } - return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); + return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiersIn, flags); } function isExternalModuleReference2() { return token() === 147 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); @@ -32833,17 +33258,16 @@ ${lanes.join("\n")} function nextTokenIsSlash() { return nextToken() === 43 /* SlashToken */; } - function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseNamespaceExportDeclaration(pos, hasJSDoc, modifiers) { parseExpected(128 /* AsKeyword */); parseExpected(143 /* NamespaceKeyword */); const name = parseIdentifier(); parseSemicolon(); const node = factory2.createNamespaceExportDeclaration(name); - node.illegalDecorators = decorators; node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) { parseExpected(100 /* ImportKeyword */); const afterImportPos = scanner2.getStartPos(); let identifier; @@ -32856,7 +33280,7 @@ ${lanes.join("\n")} identifier = isIdentifier2() ? parseIdentifier() : void 0; } if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { - return parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly); + return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly); } let importClause; if (identifier || // import id @@ -32872,7 +33296,6 @@ ${lanes.join("\n")} } parseSemicolon(); const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseAssertEntry() { @@ -32910,7 +33333,7 @@ ${lanes.join("\n")} } return finishNode(factory2.createAssertClause(elements, multiLine), pos); } else { - const elements = createNodeArray2( + const elements = createNodeArray( [], getNodePos(), /*end*/ @@ -32931,12 +33354,11 @@ ${lanes.join("\n")} function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { return token() === 27 /* CommaToken */ || token() === 158 /* FromKeyword */; } - function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { + function parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly) { parseExpected(63 /* EqualsToken */); const moduleReference = parseModuleReference(); parseSemicolon(); const node = factory2.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); - node.illegalDecorators = decorators; const finished = withJSDoc(finishNode(node, pos), hasJSDoc); return finished; } @@ -33046,7 +33468,7 @@ ${lanes.join("\n")} function parseNamespaceExport(pos) { return finishNode(factory2.createNamespaceExport(parseIdentifierName()), pos); } - function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseExportDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -33076,10 +33498,9 @@ ${lanes.join("\n")} parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) { + function parseExportAssignment(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -33098,7 +33519,6 @@ ${lanes.join("\n")} parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportAssignment(modifiers, isExportEquals, expression); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } let ParsingContext; @@ -33353,8 +33773,8 @@ ${lanes.join("\n")} } if (parts.length && tags) Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set"); - const tagsArray = tags && createNodeArray2(tags, tagsPos, tagsEnd); - return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray2(parts, start, commentsPos) : comments.length ? comments.join("") : void 0, tagsArray), start, end); + const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd); + return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : comments.length ? comments.join("") : void 0, tagsArray), start, end); }); function removeLeadingNewlines(comments2) { while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) { @@ -33482,6 +33902,9 @@ ${lanes.join("\n")} case "overload": tag = parseOverloadTag(start2, tagName, margin, indentText); break; + case "satisfies": + tag = parseSatisfiesTag(start2, tagName, margin, indentText); + break; case "see": tag = parseSeeTag(start2, tagName, margin, indentText); break; @@ -33594,7 +34017,7 @@ ${lanes.join("\n")} if (comments2.length) { parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2)); } - return createNodeArray2(parts2, commentsPos2, scanner2.getTextPos()); + return createNodeArray(parts2, commentsPos2, scanner2.getTextPos()); } else if (comments2.length) { return comments2.join(""); } @@ -33760,7 +34183,7 @@ ${lanes.join("\n")} if (!comments2) { commentEnd = scanner2.getStartPos(); } - const allParts = typeof comments2 !== "string" ? createNodeArray2(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; + const allParts = typeof comments2 !== "string" ? createNodeArray(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; return finishNode(factory2.createJSDocAuthorTag(tagName, allParts), start2); } function parseAuthorNameAndEmail() { @@ -33790,6 +34213,14 @@ ${lanes.join("\n")} const className = parseExpressionWithTypeArgumentsForAugments(); return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); } + function parseSatisfiesTag(start2, tagName, margin, indentText) { + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + false + ); + const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0; + return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2); + } function parseExpressionWithTypeArgumentsForAugments() { const usedBrace = parseOptional(18 /* OpenBraceToken */); const pos = getNodePos(); @@ -33894,7 +34325,7 @@ ${lanes.join("\n")} return finishNode(jsDocNamespaceNode, pos); } if (nested) { - typeNameOrNamespaceName.isInJSDocNamespace = true; + typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */; } return typeNameOrNamespaceName; } @@ -33905,7 +34336,7 @@ ${lanes.join("\n")} while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) { parameters = append(parameters, child); } - return createNodeArray2(parameters || [], pos); + return createNodeArray(parameters || [], pos); } function parseJSDocSignature(start2, indent2) { const parameters = parseCallbackTagParameters(indent2); @@ -34056,7 +34487,7 @@ ${lanes.join("\n")} } skipWhitespaceOrAsterisk(); } while (parseOptionalJsdoc(27 /* CommaToken */)); - return createNodeArray2(typeParameters, pos); + return createNodeArray(typeParameters, pos); } function parseTemplateTag(start2, tagName, indent2, indentText) { const constraint = token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0; @@ -34080,7 +34511,7 @@ ${lanes.join("\n")} if (parseOptional(22 /* OpenBracketToken */)) { parseExpected(23 /* CloseBracketToken */); } - entity = createQualifiedName2(entity, name); + entity = createQualifiedName(entity, name); } return entity; } @@ -34098,12 +34529,7 @@ ${lanes.join("\n")} const end2 = scanner2.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner2.getTokenValue()); - const result = finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind - ), pos, end2); + const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -34504,16 +34930,6 @@ ${lanes.join("\n")} function getOptionsNameMap() { return optionsNameMapCache || (optionsNameMapCache = createOptionNameMap(optionDeclarations)); } - function convertEnableAutoDiscoveryToEnable(typeAcquisition) { - if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== void 0 && typeAcquisition.enable === void 0) { - return { - enable: typeAcquisition.enableAutoDiscovery, - include: typeAcquisition.include || [], - exclude: typeAcquisition.exclude || [] - }; - } - return typeAcquisition; - } function createCompilerDiagnosticForInvalidCustomType(opt) { return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic); } @@ -34844,12 +35260,6 @@ ${lanes.join("\n")} elementOptions: getCommandLineWatchOptionsMap(), extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics }, - { - name: "typingOptions", - type: "object", - elementOptions: getCommandLineTypeAcquisitionMap(), - extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics - }, { name: "typeAcquisition", type: "object", @@ -35696,11 +36106,11 @@ ${lanes.join("\n")} errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } const options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName); - const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName); + const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition, basePath, errors, configFileName); const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors); json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors); let extendedConfigPath; - if (json.extends) { + if (json.extends || json.extends === "") { if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) { errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration))); } else { @@ -35723,7 +36133,7 @@ ${lanes.join("\n")} } function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { const options = getDefaultCompilerOptions(configFileName); - let typeAcquisition, typingOptionstypeAcquisition; + let typeAcquisition; let watchOptions; let extendedConfigPath; let rootCompilerOptions; @@ -35740,9 +36150,6 @@ ${lanes.join("\n")} case "typeAcquisition": currentOption = typeAcquisition || (typeAcquisition = getDefaultTypeAcquisition(configFileName)); break; - case "typingOptions": - currentOption = typingOptionstypeAcquisition || (typingOptionstypeAcquisition = getDefaultTypeAcquisition(configFileName)); - break; default: Debug.fail("Unknown option"); } @@ -35795,15 +36202,7 @@ ${lanes.join("\n")} optionsIterator ); if (!typeAcquisition) { - if (typingOptionstypeAcquisition) { - typeAcquisition = typingOptionstypeAcquisition.enableAutoDiscovery !== void 0 ? { - enable: typingOptionstypeAcquisition.enableAutoDiscovery, - include: typingOptionstypeAcquisition.include, - exclude: typingOptionstypeAcquisition.exclude - } : typingOptionstypeAcquisition; - } else { - typeAcquisition = getDefaultTypeAcquisition(configFileName); - } + typeAcquisition = getDefaultTypeAcquisition(configFileName); } if (rootCompilerOptions && json && json.compilerOptions === void 0) { errors.push(createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, getTextOfPropertyName(rootCompilerOptions[0]))); @@ -35827,7 +36226,11 @@ ${lanes.join("\n")} if (resolved.resolvedModule) { return resolved.resolvedModule.resolvedFileName; } - errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); + if (extendedConfig === "") { + errors.push(createDiagnostic(Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends")); + } else { + errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); + } return void 0; } function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) { @@ -35905,8 +36308,7 @@ ${lanes.join("\n")} } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { const options = getDefaultTypeAcquisition(configFileName); - const typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions); - convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), typeAcquisition, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); + convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), jsonOptions, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); return options; } function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) { @@ -36108,6 +36510,7 @@ ${lanes.join("\n")} } } function specToDiagnostic(spec, disallowTrailingRecursion) { + Debug.assert(typeof spec === "string"); if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return [Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; } else if (invalidDotDotAfterRecursiveWildcard(spec)) { @@ -36290,6 +36693,7 @@ ${lanes.join("\n")} ["es2020", "lib.es2020.d.ts"], ["es2021", "lib.es2021.d.ts"], ["es2022", "lib.es2022.d.ts"], + ["es2023", "lib.es2023.d.ts"], ["esnext", "lib.esnext.d.ts"], // Host only ["dom", "lib.dom.d.ts"], @@ -36343,14 +36747,17 @@ ${lanes.join("\n")} ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"], ["es2022.string", "lib.es2022.string.d.ts"], ["es2022.regexp", "lib.es2022.regexp.d.ts"], - ["esnext.array", "lib.es2022.array.d.ts"], + ["es2023.array", "lib.es2023.array.d.ts"], + ["esnext.array", "lib.es2023.array.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.es2022.string.d.ts"], ["esnext.promise", "lib.es2021.promise.d.ts"], - ["esnext.weakref", "lib.es2021.weakref.d.ts"] + ["esnext.weakref", "lib.es2021.weakref.d.ts"], + ["decorators", "lib.decorators.d.ts"], + ["decorators.legacy", "lib.decorators.legacy.d.ts"] ]; libs = libEntries.map((entry) => entry[0]); libMap = new Map(libEntries); @@ -36893,6 +37300,13 @@ ${lanes.join("\n")} transpileOptionValue: true, defaultValueDescription: false }, + { + name: "verbatimModuleSyntax", + type: "boolean", + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting, + defaultValueDescription: false + }, // Strict Type Checks { name: "strict", @@ -37194,7 +37608,7 @@ ${lanes.join("\n")} { name: "allowImportingTsExtensions", type: "boolean", - affectsModuleResolution: true, + affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, defaultValueDescription: false @@ -37258,10 +37672,11 @@ ${lanes.join("\n")} { name: "experimentalDecorators", type: "boolean", + affectsEmit: true, affectsSemanticDiagnostics: true, affectsBuildInfo: true, category: Diagnostics.Language_and_Environment, - description: Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators, + description: Diagnostics.Enable_experimental_support_for_legacy_experimental_decorators, defaultValueDescription: false }, { @@ -37375,7 +37790,7 @@ ${lanes.join("\n")} paramType: Diagnostics.NEWLINE, category: Diagnostics.Emit, description: Diagnostics.Set_the_newline_character_for_emitting_files, - defaultValueDescription: Diagnostics.Platform_specific + defaultValueDescription: "lf" }, { name: "noErrorTruncation", @@ -37551,7 +37966,7 @@ ${lanes.join("\n")} affectsModuleResolution: true, category: Diagnostics.Interop_Constraints, description: Diagnostics.Ensure_that_casing_is_correct_in_imports, - defaultValueDescription: false + defaultValueDescription: true }, { name: "maxNodeModuleJsDepth", @@ -37675,14 +38090,6 @@ ${lanes.join("\n")} ...optionsForBuild ]; typeAcquisitionDeclarations = [ - { - /* @deprecated typingOptions.enableAutoDiscovery - * Use typeAcquisition.enable instead. - */ - name: "enableAutoDiscovery", - type: "boolean", - defaultValueDescription: false - }, { name: "enable", type: "boolean", @@ -37822,7 +38229,7 @@ ${lanes.join("\n")} Debug.assert(extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations); @@ -37840,7 +38247,8 @@ ${lanes.join("\n")} }, failedLookupLocations: initializeResolutionField(failedLookupLocations), affectingLocations: initializeResolutionField(affectingLocations), - resolutionDiagnostics: initializeResolutionField(diagnostics) + resolutionDiagnostics: initializeResolutionField(diagnostics), + node10Result: legacyResult }; } function initializeResolutionField(value) { @@ -38880,7 +39288,7 @@ ${lanes.join("\n")} ); } function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) { - var _a2, _b; + var _a2, _b, _c, _d; const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations = []; const affectingLocations = []; @@ -38907,44 +39315,60 @@ ${lanes.join("\n")} if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) { const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */); const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */); - result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0; + result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0; } else { - result = tryResolve(extensions); + result = tryResolve(extensions, state); + } + let legacyResult; + if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) { + traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update); + const diagnosticState = { + ...state, + features: state.features & ~8 /* Exports */, + failedLookupLocations: [], + affectingLocations: [], + reportDiagnostic: noop + }; + const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState); + if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) { + legacyResult = diagnosticResult.value.resolved.path; + } } return createResolvedModuleWithFailedLookupLocations( - (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved, - (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport, + (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, + (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state.resultFromCache, + legacyResult ); - function tryResolve(extensions2) { - const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName( + function tryResolve(extensions2, state2) { + const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName( extensions3, candidate, onlyRecordFailures, - state2, + state3, /*considerPackageJson*/ true ); - const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state); + const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2); if (resolved) { return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) }); } if (!isExternalModuleNameRelative(moduleName)) { let resolved2; if (features & 2 /* Imports */ && startsWith(moduleName, "#")) { - resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2 && features & 4 /* SelfName */) { - resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) { if (traceEnabled) { trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2)); } - resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) return void 0; @@ -38963,7 +39387,7 @@ ${lanes.join("\n")} candidate, /*onlyRecordFailures*/ false, - state, + state2, /*considerPackageJson*/ true ); @@ -40164,7 +40588,7 @@ ${lanes.join("\n")} } } function shouldAllowImportingTsExtension(compilerOptions, fromFileName) { - return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && (!!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName)); + return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName); } function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) { const traceEnabled = isTraceEnabled(compilerOptions, host); @@ -40318,7 +40742,7 @@ ${lanes.join("\n")} case 264 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { return 0 /* NonInstantiated */; } } @@ -40754,6 +41178,7 @@ ${lanes.join("\n")} } else if (containerFlags & 64 /* IsInterface */) { seenThisKeyword = false; bindChildren(node); + Debug.assertNotNode(node, isIdentifier); node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */; } else { bindChildren(node); @@ -41054,13 +41479,12 @@ ${lanes.join("\n")} } else if (node.kind === 221 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 223 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); + return isLogicalOrCoalescingBinaryExpression(node); } } } function isLogicalAssignmentExpression(node) { - node = skipParentheses(node); - return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind); + return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node)); } function isTopLevelLogicalExpression(node) { while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) { @@ -41443,7 +41867,7 @@ ${lanes.join("\n")} }; } const operator = node.operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */ || isLogicalOrCoalescingAssignmentOperator(operator)) { + if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) { if (isTopLevelLogicalExpression(node)) { const postExpressionLabel = createBranchLabel(); bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); @@ -41913,13 +42337,17 @@ ${lanes.join("\n")} } function checkContextualIdentifier(node) { if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) { - if (inStrictMode && node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 125 /* LastFutureReservedWord */) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind === void 0) { + return; + } + if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, getStrictModeIdentifierMessage(node), declarationNameToString(node) )); - } else if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + } else if (originalKeywordKind === 133 /* AwaitKeyword */) { if (isExternalModule(file) && isInTopLevelContext(node)) { file.bindDiagnostics.push(createDiagnosticForNode2( node, @@ -41933,7 +42361,7 @@ ${lanes.join("\n")} declarationNameToString(node) )); } - } else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { + } else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, @@ -42145,7 +42573,7 @@ ${lanes.join("\n")} function bindWorker(node) { switch (node.kind) { case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { let parentNode = node.parent; while (parentNode && !isJSDocTypeAlias(parentNode)) { parentNode = parentNode.parent; @@ -44078,6 +44506,7 @@ ${lanes.join("\n")} deferredDiagnosticsCallbacks.push(arg); }; let cancellationToken; + const requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); let requestedExternalEmitHelpers; let externalHelpersModule; const Symbol46 = objectAllocator.getSymbolConstructor(); @@ -44096,6 +44525,7 @@ ${lanes.join("\n")} const compilerOptions = host.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); @@ -44120,6 +44550,7 @@ ${lanes.join("\n")} globals.set(globalThisSymbol.escapedName, globalThisSymbol); const argumentsSymbol = createSymbol(4 /* Property */, "arguments"); const requireSymbol = createSymbol(4 /* Property */, "require"); + const isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; let apparentArgumentCount; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), @@ -44540,6 +44971,7 @@ ${lanes.join("\n")} const stringMappingTypes = /* @__PURE__ */ new Map(); const substitutionTypes = /* @__PURE__ */ new Map(); const subtypeReductionCache = /* @__PURE__ */ new Map(); + const decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); const cachedTypes = /* @__PURE__ */ new Map(); const evolvingArrayTypes = []; const undefinedProperties = /* @__PURE__ */ new Map(); @@ -44779,6 +45211,14 @@ ${lanes.join("\n")} let deferredGlobalBigIntType; let deferredGlobalNaNSymbol; let deferredGlobalRecordSymbol; + let deferredGlobalClassDecoratorContextType; + let deferredGlobalClassMethodDecoratorContextType; + let deferredGlobalClassGetterDecoratorContextType; + let deferredGlobalClassSetterDecoratorContextType; + let deferredGlobalClassAccessorDecoratorContextType; + let deferredGlobalClassAccessorDecoratorTargetType; + let deferredGlobalClassAccessorDecoratorResultType; + let deferredGlobalClassFieldDecoratorContextType; const allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); let flowLoopStart = 0; let flowLoopCount = 0; @@ -44865,7 +45305,7 @@ ${lanes.join("\n")} if (jsxFragmentPragma) { const chosenPragma = isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma; file.localJsxFragmentFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFragmentFactory, markAsSynthetic); + visitNode(file.localJsxFragmentFactory, markAsSynthetic, isEntityName); if (file.localJsxFragmentFactory) { return file.localJsxFragmentNamespace = getFirstIdentifier(file.localJsxFragmentFactory).escapedText; } @@ -44908,7 +45348,7 @@ ${lanes.join("\n")} if (jsxPragma) { const chosenPragma = isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; file.localJsxFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFactory, markAsSynthetic); + visitNode(file.localJsxFactory, markAsSynthetic, isEntityName); if (file.localJsxFactory) { return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; } @@ -44961,7 +45401,7 @@ ${lanes.join("\n")} addErrorOrSuggestion(isError, "message" in message ? createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : createDiagnosticForFileFromMessageChain(file, message)); return; } - addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(location, message)); + addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(location), location, message)); } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { const diagnostic = error(location, message, arg0, arg1, arg2, arg3); @@ -45006,6 +45446,16 @@ ${lanes.join("\n")} symbol.links.checkFlags = checkFlags || 0 /* None */; return symbol; } + function createParameter(name, type) { + const symbol = createSymbol(1 /* FunctionScopedVariable */, name); + symbol.links.type = type; + return symbol; + } + function createProperty(name, type) { + const symbol = createSymbol(4 /* Property */, name); + symbol.links.type = type; + return symbol; + } function getExcludedSymbolFlags(flags) { let result = 0; if (flags & 2 /* BlockScopedVariable */) @@ -45552,6 +46002,15 @@ ${lanes.join("\n")} break; case 263 /* EnumDeclaration */: if (result = lookup(((_c = getSymbolOfDeclaration(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) { + if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 16777216 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { + error( + errorLocation, + Diagnostics.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead, + unescapeLeadingUnderscores(name), + isolatedModulesLikeFlagName, + `${unescapeLeadingUnderscores(getSymbolOfNode(location).escapedName)}.${unescapeLeadingUnderscores(name)}` + ); + } break loop; } break; @@ -45797,7 +46256,7 @@ ${lanes.join("\n")} if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */); if (typeOnlyDeclaration) { - const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; const unescapedName = unescapeLeadingUnderscores(name); addTypeOnlyDeclarationRelatedInfo( error(errorLocation, message, unescapedName), @@ -45817,7 +46276,7 @@ ${lanes.join("\n")} diagnostic, createDiagnosticForNode( typeOnlyDeclaration, - typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, + typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, unescapedName ) ); @@ -46196,10 +46655,10 @@ ${lanes.join("\n")} false ) && !node.isTypeOnly) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); - const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */; + const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */; const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here; - const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); + const name = typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); } } @@ -46419,6 +46878,7 @@ ${lanes.join("\n")} return valueSymbol; } const result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); + Debug.assert(valueSymbol.declarations || typeSymbol.declarations); result.declarations = deduplicate(concatenate(valueSymbol.declarations, typeSymbol.declarations), equateValues); result.parent = valueSymbol.parent || typeSymbol.parent; if (valueSymbol.valueDeclaration) @@ -46430,15 +46890,19 @@ ${lanes.join("\n")} return result; } function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + var _a2; if (symbol.flags & 1536 /* Module */) { const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); const resolved = resolveSymbol(exportSymbol, dontResolveAlias); + const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name.escapedText); markSymbolOfAliasDeclarationIfTypeOnly( specifier, exportSymbol, resolved, /*overwriteEmpty*/ - false + false, + exportStarDeclaration, + name.escapedText ); return resolved; } @@ -46765,7 +47229,7 @@ ${lanes.join("\n")} } return flags; } - function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { + function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) { if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration)) return false; const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration); @@ -46774,6 +47238,14 @@ ${lanes.join("\n")} links2.typeOnlyDeclaration = aliasDeclaration; return true; } + if (exportStarDeclaration) { + const links2 = getSymbolLinks(sourceSymbol); + links2.typeOnlyDeclaration = exportStarDeclaration; + if (sourceSymbol.escapedName !== exportStarName) { + links2.typeOnlyExportStarName = exportStarName; + } + return true; + } const links = getSymbolLinks(sourceSymbol); return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty); } @@ -46795,11 +47267,15 @@ ${lanes.join("\n")} return links.typeOnlyDeclaration || void 0; } if (links.typeOnlyDeclaration) { - return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : void 0; + const resolved = links.typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); + return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; } return void 0; } function markExportAsReferenced(node) { + if (compilerOptions.verbatimModuleSyntax) { + return; + } const symbol = getSymbolOfDeclaration(node); const target = resolveAlias(symbol); if (target) { @@ -46810,6 +47286,7 @@ ${lanes.join("\n")} } } function markAliasSymbolAsReferenced(symbol) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); const links = getSymbolLinks(symbol); if (!links.referenced) { links.referenced = true; @@ -47116,6 +47593,8 @@ ${lanes.join("\n")} /*isError*/ false, errorNode, + currentSourceFile, + mode, resolvedModule, moduleReference ); @@ -47167,7 +47646,7 @@ ${lanes.join("\n")} } } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chainDiagnosticMessages( + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chainDiagnosticMessages( diagnosticDetails, Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, moduleReference @@ -47201,6 +47680,8 @@ ${lanes.join("\n")} /*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, + currentSourceFile, + mode, resolvedModule, moduleReference ); @@ -47255,26 +47736,37 @@ ${lanes.join("\n")} return importSourceWithoutExtension; } } - function errorOnImplicitAnyModule(isError, errorNode, { packageId, resolvedFileName }, moduleReference) { - const errorInfo = !isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, - packageId.name, - mangleScopedPackageName(packageId.name) - ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, - packageId.name, - moduleReference - ) : chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, - moduleReference, - mangleScopedPackageName(packageId.name) - ) : void 0; + function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) { + var _a2, _b; + let errorInfo; + if (!isExternalModuleNameRelative(moduleReference) && packageId) { + const node10Result = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleReference, mode)) == null ? void 0 : _b.node10Result; + errorInfo = node10Result ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings, + node10Result, + node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageId.name)}` : packageId.name + ) : typesPackageExists(packageId.name) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, + packageId.name, + mangleScopedPackageName(packageId.name) + ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, + packageId.name, + moduleReference + ) : chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, + moduleReference, + mangleScopedPackageName(packageId.name) + ); + } errorOrSuggestion(isError, errorNode, chainDiagnosticMessages( errorInfo, Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, @@ -47434,7 +47926,12 @@ ${lanes.join("\n")} } function getExportsOfModule(moduleSymbol) { const links = getSymbolLinks(moduleSymbol); - return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol)); + if (!links.resolvedExports) { + const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol); + links.resolvedExports = exports; + links.typeOnlyExportStarMap = typeOnlyExportStarMap; + } + return links.resolvedExports; } function extendExportSymbols(target, source, lookupTable, exportNode) { if (!source) @@ -47462,9 +47959,21 @@ ${lanes.join("\n")} } function getExportsOfModuleWorker(moduleSymbol) { const visitedSymbols = []; + let typeOnlyExportStarMap; + const nonTypeOnlyNames = /* @__PURE__ */ new Set(); moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); - return visit(moduleSymbol) || emptySymbols; - function visit(symbol) { + const exports = visit(moduleSymbol) || emptySymbols; + if (typeOnlyExportStarMap) { + nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name)); + } + return { + exports, + typeOnlyExportStarMap + }; + function visit(symbol, exportStar, isTypeOnly) { + if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) { + symbol.exports.forEach((_, name) => nonTypeOnlyNames.add(name)); + } if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) { return; } @@ -47476,7 +47985,7 @@ ${lanes.join("\n")} if (exportStars.declarations) { for (const node of exportStars.declarations) { const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); - const exportedSymbols = visit(resolvedModule); + const exportedSymbols = visit(resolvedModule, node, isTypeOnly || node.isTypeOnly); extendExportSymbols( nestedSymbols, exportedSymbols, @@ -47500,6 +48009,13 @@ ${lanes.join("\n")} }); extendExportSymbols(symbols, nestedSymbols); } + if (exportStar == null ? void 0 : exportStar.isTypeOnly) { + typeOnlyExportStarMap != null ? typeOnlyExportStarMap : typeOnlyExportStarMap = /* @__PURE__ */ new Map(); + symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set( + escapedName, + exportStar + )); + } return symbols; } } @@ -48931,13 +49447,17 @@ ${lanes.join("\n")} let qualifier = root.qualifier; if (qualifier) { if (isIdentifier(qualifier)) { - qualifier = factory.updateIdentifier(qualifier, typeArguments); + if (typeArguments !== getIdentifierTypeArguments(qualifier)) { + qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments); + } } else { - qualifier = factory.updateQualifiedName( - qualifier, - qualifier.left, - factory.updateIdentifier(qualifier.right, typeArguments) - ); + if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) { + qualifier = factory.updateQualifiedName( + qualifier, + qualifier.left, + setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments) + ); + } } } typeArguments = ref.typeArguments; @@ -48957,13 +49477,17 @@ ${lanes.join("\n")} let typeArguments = root.typeArguments; let typeName = root.typeName; if (isIdentifier(typeName)) { - typeName = factory.updateIdentifier(typeName, typeArguments); + if (typeArguments !== getIdentifierTypeArguments(typeName)) { + typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments); + } } else { - typeName = factory.updateQualifiedName( - typeName, - typeName.left, - factory.updateIdentifier(typeName.right, typeArguments) - ); + if (typeArguments !== getIdentifierTypeArguments(typeName.right)) { + typeName = factory.updateQualifiedName( + typeName, + typeName.left, + setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments) + ); + } } typeArguments = ref.typeArguments; const ids = getAccessStack(ref); @@ -49677,7 +50201,11 @@ ${lanes.join("\n")} if (!nonRootParts || isEntityName(nonRootParts)) { if (nonRootParts) { const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; - lastId.typeArguments = void 0; + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); } return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf); } else { @@ -49694,8 +50222,12 @@ ${lanes.join("\n")} return factory.createTypeQueryNode(entityName); } else { const lastId = isIdentifier(entityName) ? entityName : entityName.right; - const lastTypeArgs = lastId.typeArguments; - lastId.typeArguments = void 0; + const lastTypeArgs = getIdentifierTypeArguments(lastId); + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); return factory.createTypeReferenceNode(entityName, lastTypeArgs); } function createAccessFromSymbolChain(chain2, index, stopper) { @@ -49739,7 +50271,9 @@ ${lanes.join("\n")} return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2))); } } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; if (index > stopper) { const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper); @@ -49797,7 +50331,9 @@ ${lanes.join("\n")} text = `${rawtext}_${i}`; } if (text !== rawtext) { - result = factory.createIdentifier(text, result.typeArguments); + const typeArguments = getIdentifierTypeArguments(result); + result = factory.createIdentifier(text); + setIdentifierTypeArguments(result, typeArguments); } (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i); (context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result); @@ -49821,7 +50357,9 @@ ${lanes.join("\n")} if (index === 0) { context.flags ^= 16777216 /* InInitialEntityName */; } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier; } @@ -49844,7 +50382,9 @@ ${lanes.join("\n")} return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context)); } if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) { - const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier; } else { @@ -49859,8 +50399,11 @@ ${lanes.join("\n")} expression = factory.createNumericLiteral(+symbolName2); } if (!expression) { - expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */); - expression.symbol = symbol2; + const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); + identifier.symbol = symbol2; + expression = identifier; } return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression); } @@ -50016,7 +50559,7 @@ ${lanes.join("\n")} } let hadError = false; const file = getSourceFileOfNode(existing); - const transformed = visitNode(existing, visitExistingNodeTreeSymbols); + const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode); if (hadError) { return void 0; } @@ -50029,16 +50572,16 @@ ${lanes.join("\n")} return factory.createKeywordTypeNode(157 /* UnknownKeyword */); } if (isJSDocNullableType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), factory.createLiteralTypeNode(factory.createNull())]); + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createLiteralTypeNode(factory.createNull())]); } if (isJSDocOptionalType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), factory.createKeywordTypeNode(155 /* UndefinedKeyword */)]); + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createKeywordTypeNode(155 /* UndefinedKeyword */)]); } if (isJSDocNonNullableType(node)) { return visitNode(node.type, visitExistingNodeTreeSymbols); } if (isJSDocVariadicType(node)) { - return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols)); + return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode)); } if (isJSDocTypeLiteral(node)) { return factory.createTypeLiteralNode(map(node.jsDocPropertyTags, (t) => { @@ -50050,7 +50593,7 @@ ${lanes.join("\n")} void 0, name, t.isBracketed || t.typeExpression && isJSDocOptionalType(t.typeExpression.type) ? factory.createToken(57 /* QuestionToken */) : void 0, - overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); })); } @@ -50069,9 +50612,9 @@ ${lanes.join("\n")} "x", /*questionToken*/ void 0, - visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols) + visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols, isTypeNode) )], - visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols) + visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols, isTypeNode) )]); } if (isJSDocFunctionType(node)) { @@ -50080,33 +50623,33 @@ ${lanes.join("\n")} return factory.createConstructorTypeNode( /*modifiers*/ void 0, - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols), + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), mapDefined(node.parameters, (p, i) => p.name && isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode = p.type, void 0) : factory.createParameterDeclaration( /*modifiers*/ void 0, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, - visitNode(p.type, visitExistingNodeTreeSymbols), + visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), /*initializer*/ void 0 )), - visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); } else { return factory.createFunctionTypeNode( - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols), + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), map(node.parameters, (p, i) => factory.createParameterDeclaration( /*modifiers*/ void 0, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, - visitNode(p.type, visitExistingNodeTreeSymbols), + visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), /*initializer*/ void 0 )), - visitNode(node.type, visitExistingNodeTreeSymbols) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ); } } @@ -50555,7 +51098,7 @@ ${lanes.join("\n")} /*modifiers*/ void 0, /*isTypeOnly*/ - false, + node.isTypeOnly, /*exportClause*/ void 0, factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context)) @@ -51028,7 +51571,7 @@ ${lanes.join("\n")} break; } case 268 /* ImportEqualsDeclaration */: - if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, isJsonSourceFile)) { + if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) { serializeMaybeAliasAssignment(symbol); break; } @@ -52123,6 +52666,12 @@ ${lanes.join("\n")} const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration); const isOptional = includeOptionality && isOptionalDeclaration(declaration); const declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { + if (declaredType) { + return isTypeAny(declaredType) || declaredType === unknownType ? declaredType : errorType; + } + return useUnknownInCatchVariables ? unknownType : anyType; + } if (declaredType) { return addOptionality(declaredType, isProperty, isOptional); } @@ -52701,14 +53250,6 @@ ${lanes.join("\n")} } Debug.assertIsDefined(symbol.valueDeclaration); const declaration = symbol.valueDeclaration; - if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode === void 0) { - return useUnknownInCatchVariables ? unknownType : anyType; - } - const type2 = getTypeOfNode(typeNode); - return isTypeAny(type2) || type2 === unknownType ? type2 : errorType; - } if (isSourceFile(declaration) && isJsonSourceFile(declaration)) { if (!declaration.statements.length) { return emptyObjectType; @@ -53300,7 +53841,7 @@ ${lanes.join("\n")} baseType ); const diagnostic = chainDiagnosticMessages(elaboration, Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(reducedBaseType)); - diagnostics.add(createDiagnosticForNodeFromMessageChain(baseTypeNode.expression, diagnostic)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(baseTypeNode.expression), baseTypeNode.expression, diagnostic)); return type.resolvedBaseTypes = emptyArray; } if (type === reducedBaseType || hasBaseType(reducedBaseType, type)) { @@ -53701,7 +54242,7 @@ ${lanes.join("\n")} const links = getSymbolLinks(symbol); if (!links[resolutionKind]) { const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */; - const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) : symbol.exports; + const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol).exports : symbol.exports; links[resolutionKind] = earlySymbols || emptySymbols; const lateSymbols = createSymbolTable(); for (const decl of symbol.declarations || emptyArray) { @@ -54690,7 +55231,7 @@ ${lanes.join("\n")} } function isConstTypeVariable(type) { var _a2; - return !!(type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType)); + return !!(type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || isGenericTupleType(type) && findIndex(getTypeArguments(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t)) >= 0 || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType)); } function getConstraintOfIndexedAccess(type) { return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0; @@ -55914,6 +56455,12 @@ ${lanes.join("\n")} } return result & 458752 /* PropagatingFlags */; } + function tryCreateTypeReference(target, typeArguments) { + if (some(typeArguments) && target === emptyGenericType) { + return unknownType; + } + return createTypeReference(target, typeArguments); + } function createTypeReference(target, typeArguments) { const id = getTypeListId(typeArguments); let type = target.instantiations.get(id); @@ -56608,6 +57155,78 @@ ${lanes.join("\n")} false )) || emptyObjectType; } + function getGlobalClassDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassDecoratorContextType != null ? deferredGlobalClassDecoratorContextType : deferredGlobalClassDecoratorContextType = getGlobalType( + "ClassDecoratorContext", + /*arity*/ + 1, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassMethodDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassMethodDecoratorContextType != null ? deferredGlobalClassMethodDecoratorContextType : deferredGlobalClassMethodDecoratorContextType = getGlobalType( + "ClassMethodDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassGetterDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassGetterDecoratorContextType != null ? deferredGlobalClassGetterDecoratorContextType : deferredGlobalClassGetterDecoratorContextType = getGlobalType( + "ClassGetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassSetterDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassSetterDecoratorContextType != null ? deferredGlobalClassSetterDecoratorContextType : deferredGlobalClassSetterDecoratorContextType = getGlobalType( + "ClassSetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorContextType != null ? deferredGlobalClassAccessorDecoratorContextType : deferredGlobalClassAccessorDecoratorContextType = getGlobalType( + "ClassAccessorDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorTargetType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorTargetType != null ? deferredGlobalClassAccessorDecoratorTargetType : deferredGlobalClassAccessorDecoratorTargetType = getGlobalType( + "ClassAccessorDecoratorTarget", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassAccessorDecoratorResultType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassAccessorDecoratorResultType != null ? deferredGlobalClassAccessorDecoratorResultType : deferredGlobalClassAccessorDecoratorResultType = getGlobalType( + "ClassAccessorDecoratorResult", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } + function getGlobalClassFieldDecoratorContextType(reportErrors2) { + var _a2; + return (_a2 = deferredGlobalClassFieldDecoratorContextType != null ? deferredGlobalClassFieldDecoratorContextType : deferredGlobalClassFieldDecoratorContextType = getGlobalType( + "ClassFieldDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) != null ? _a2 : emptyGenericType; + } function getGlobalNaNSymbol() { return deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol( "NaN", @@ -57918,7 +58537,7 @@ ${lanes.join("\n")} typeToString(fullIndexType), typeToString(objectType) ); - diagnostics.add(createDiagnosticForNodeFromMessageChain(accessExpression, errorInfo)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(accessExpression), accessExpression, errorInfo)); } } } @@ -60332,7 +60951,7 @@ ${lanes.join("\n")} } } } - const diag2 = createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, errorInfo, relatedInformation); if (relatedInfo) { addRelatedInfo(diag2, ...relatedInfo); } @@ -63375,19 +63994,22 @@ ${lanes.join("\n")} break; case 166 /* Parameter */: const param = declaration; - if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( - param, - param.name.escapedText, - 788968 /* Type */, - void 0, - param.name.escapedText, - /*isUse*/ - true - ) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) { - const newName = "arg" + param.parent.parameters.indexOf(param); - const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); - errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); - return; + if (isIdentifier(param.name)) { + const originalKeywordKind = identifierToKeywordKind(param.name); + if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( + param, + param.name.escapedText, + 788968 /* Type */, + void 0, + param.name.escapedText, + /*isUse*/ + true + ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) { + const newName = "arg" + param.parent.parameters.indexOf(param); + const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); + errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); + return; + } } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; @@ -63575,6 +64197,10 @@ ${lanes.join("\n")} function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); } + function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { + const typePredicate = getTypePredicateOfSignature(signature); + return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter); + } function createEmptyObjectTypeFromStringLiteral(type) { const members = createSymbolTable(); forEachType(type, (t) => { @@ -64298,7 +64924,7 @@ ${lanes.join("\n")} } else { const middleLength = targetArity - startLength - endLength; if (middleLength === 2) { - if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) { + if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */) { const targetInfo = getInferenceInfoForType(elementTypes[startLength]); if (targetInfo && targetInfo.impliedArity !== void 0) { inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]); @@ -64312,7 +64938,7 @@ ${lanes.join("\n")} inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]); inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]); } - } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) { + } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */) { const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter; const constraint = param && getBaseConstraintOfType(param); if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) { @@ -64332,10 +64958,10 @@ ${lanes.join("\n")} } } else if (middleLength === 1 && elementFlags[startLength] & 8 /* Variadic */) { const endsInOptional = target.target.elementFlags[targetArity - 1] & 2 /* Optional */; - const sourceSlice = isTupleType(source) ? sliceTupleType(source, startLength, endLength) : createArrayType(getTypeArguments(source)[0]); + const sourceSlice = sliceTupleType(source, startLength, endLength); inferWithPriority(sourceSlice, elementTypes[startLength], endsInOptional ? 2 /* SpeculativeTuple */ : 0); } else if (middleLength === 1 && elementFlags[startLength] & 4 /* Rest */) { - const restType = isTupleType(source) ? getElementTypeOfSliceOfTupleType(source, startLength, endLength) : getTypeArguments(source)[0]; + const restType = getElementTypeOfSliceOfTupleType(source, startLength, endLength); if (restType) { inferFromTypes(restType, elementTypes[startLength]); } @@ -64446,7 +65072,7 @@ ${lanes.join("\n")} function getCovariantInference(inference, signature) { const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates); const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter); - const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); + const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter)); const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates; const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates); return getWidenedType(unwidenedType); @@ -66501,7 +67127,7 @@ ${lanes.join("\n")} return getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */); } function isSymbolAssigned(symbol) { if (!symbol.valueDeclaration) { @@ -66583,6 +67209,9 @@ ${lanes.join("\n")} }); } function markAliasReferenced(symbol, location) { + if (compilerOptions.verbatimModuleSyntax) { + return; + } if (isNonLocalAlias( symbol, /*excludes*/ @@ -66590,7 +67219,7 @@ ${lanes.join("\n")} ) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) { const target = resolveAlias(symbol); if (getAllSymbolFlags(target) & (111551 /* Value */ | 1048576 /* ExportValue */)) { - if (compilerOptions.isolatedModules || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { + if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { markAliasSymbolAsReferenced(symbol); } else { markConstEnumAliasAsReferenced(symbol); @@ -66599,6 +67228,7 @@ ${lanes.join("\n")} } } function getNarrowedTypeOfSymbol(symbol, location) { + var _a2; const type = getTypeOfSymbol(symbol); const declaration = symbol.valueDeclaration; if (declaration) { @@ -66634,7 +67264,7 @@ ${lanes.join("\n")} if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) { const contextualSignature = getContextualSignature(func); if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) { - const restType = getReducedApparentType(getTypeOfSymbol(contextualSignature.parameters[0])); + const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a2 = getInferenceContext(func)) == null ? void 0 : _a2.nonFixingMapper)); if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) { const narrowedType = getFlowTypeOfReference( func, @@ -66687,7 +67317,7 @@ ${lanes.join("\n")} } let declaration = localOrExportSymbol.valueDeclaration; if (declaration && localOrExportSymbol.flags & 32 /* Class */) { - if (declaration.kind === 260 /* ClassDeclaration */ && nodeIsDecorated(declaration)) { + if (declaration.kind === 260 /* ClassDeclaration */ && nodeIsDecorated(legacyDecorators, declaration)) { let container = getContainingClass(node); while (container !== void 0) { if (container === declaration && container.name !== node) { @@ -66758,13 +67388,14 @@ ${lanes.join("\n")} const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); + const isCatch = flowContainer.kind === 295 /* CatchClause */; const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -66911,7 +67542,7 @@ ${lanes.join("\n")} } } function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) { - if (isPropertyDeclaration(container) && hasStaticModifier(container) && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { + if (isPropertyDeclaration(container) && hasStaticModifier(container) && legacyDecorators && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { error(thisExpression, Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); } } @@ -67289,7 +67920,7 @@ ${lanes.join("\n")} } } function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0); if (typeNode) { return getTypeFromTypeNode(typeNode); } @@ -67455,6 +68086,10 @@ ${lanes.join("\n")} const restIndex = signature.parameters.length - 1; return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex); } + function getContextualTypeForDecorator(decorator) { + const signature = getDecoratorCallSignature(decorator); + return signature ? getOrCreateTypeFromSignature(signature) : void 0; + } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { if (template.parent.kind === 212 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); @@ -67855,7 +68490,9 @@ ${lanes.join("\n")} } const index = findContextualNode(node); if (index >= 0) { - return contextualTypes[index]; + const cached = contextualTypes[index]; + if (cached || !contextFlags) + return cached; } const { parent: parent2 } = node; switch (parent2.kind) { @@ -67875,6 +68512,8 @@ ${lanes.join("\n")} case 210 /* CallExpression */: case 211 /* NewExpression */: return getContextualTypeForArgument(parent2, node); + case 167 /* Decorator */: + return getContextualTypeForDecorator(parent2); case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: return isConstTypeReference(parent2.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(parent2.type); @@ -67896,8 +68535,16 @@ ${lanes.join("\n")} Debug.assert(parent2.parent.kind === 225 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent2.parent, node); case 214 /* ParenthesizedExpression */: { - const tag = isInJSFile(parent2) ? getJSDocTypeTag(parent2) : void 0; - return !tag ? getContextualType2(parent2, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(tag.typeExpression.type); + if (isInJSFile(parent2)) { + if (isJSDocSatisfiesExpression(parent2)) { + return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent2)); + } + const typeTag = getJSDocTypeTag(parent2); + if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) { + return getTypeFromTypeNode(typeTag.typeExpression.type); + } + } + return getContextualType2(parent2, contextFlags); } case 232 /* NonNullExpression */: return getContextualType2(parent2, contextFlags); @@ -69049,7 +69696,7 @@ ${lanes.join("\n")} } if (jsxFactorySym) { jsxFactorySym.isReferenced = 67108863 /* All */; - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + if (!compilerOptions.verbatimModuleSyntax && jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { markAliasSymbolAsReferenced(jsxFactorySym); } } @@ -69506,7 +70153,7 @@ ${lanes.join("\n")} node.kind === 163 /* QualifiedName */ ); } - if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 302 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { + if (isIdentifier(left) && parentSymbol && (getIsolatedModules(compilerOptions) || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 302 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { markAliasReferenced(parentSymbol, node); } let propType; @@ -69715,7 +70362,7 @@ ${lanes.join("\n")} } } } - const resultDiagnostic = createDiagnosticForNodeFromMessageChain(propNode, errorInfo); + const resultDiagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(propNode), propNode, errorInfo); if (relatedInfo) { addRelatedInfo(resultDiagnostic, relatedInfo); } @@ -70577,35 +71224,22 @@ ${lanes.join("\n")} return args; } function getEffectiveDecoratorArguments(node) { - const parent2 = node.parent; const expr = node.expression; - switch (parent2.kind) { - case 260 /* ClassDeclaration */: - case 228 /* ClassExpression */: - return [ - createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfDeclaration(parent2))) - ]; - case 166 /* Parameter */: - const func = parent2.parent; - return [ - createSyntheticExpression(expr, parent2.parent.kind === 173 /* Constructor */ ? getTypeOfSymbol(getSymbolOfDeclaration(func)) : errorType), - createSyntheticExpression(expr, anyType), - createSyntheticExpression(expr, numberType) - ]; - case 169 /* PropertyDeclaration */: - case 171 /* MethodDeclaration */: - case 174 /* GetAccessor */: - case 175 /* SetAccessor */: - const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2)); - return [ - createSyntheticExpression(expr, getParentTypeOfClassElement(parent2)), - createSyntheticExpression(expr, getClassElementPropertyKeyType(parent2)), - createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent2)) : anyType) - ]; + const signature = getDecoratorCallSignature(node); + if (signature) { + const args = []; + for (const param of signature.parameters) { + const type = getTypeOfSymbol(param); + args.push(createSyntheticExpression(expr, type)); + } + return args; } return Debug.fail(); } function getDecoratorArgumentCount(node, signature) { + return compilerOptions.experimentalDecorators ? getLegacyDecoratorArgumentCount(node, signature) : 2; + } + function getLegacyDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { case 260 /* ClassDeclaration */: case 228 /* ClassExpression */: @@ -70640,9 +71274,15 @@ ${lanes.join("\n")} function getDiagnosticForCallNode(node, message, arg0, arg1, arg2, arg3) { if (isCallExpression(node)) { const { sourceFile, start, length: length2 } = getDiagnosticSpanForCallNode(node); - return createFileDiagnostic(sourceFile, start, length2, message, arg0, arg1, arg2, arg3); + if ("message" in message) { + return createFileDiagnostic(sourceFile, start, length2, message, arg0, arg1, arg2, arg3); + } + return createDiagnosticForFileFromMessageChain(sourceFile, message); } else { - return createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + if ("message" in message) { + return createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + } + return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, message); } } function isPromiseResolveArityError(node) { @@ -70666,7 +71306,7 @@ ${lanes.join("\n")} ); return constructorSymbol === globalPromiseSymbol; } - function getArgumentArityError(node, signatures, args) { + function getArgumentArityError(node, signatures, args, headMessage) { var _a2; const spreadIndex = getSpreadArgumentIndex(args); if (spreadIndex > -1) { @@ -70696,11 +71336,36 @@ ${lanes.join("\n")} if (isVoidPromiseError && isInJSFile(node)) { return getDiagnosticForCallNode(node, Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments); } - const error2 = hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; + const error2 = isDecorator(node) ? hasRestParameter2 ? Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 : Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 : hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; if (min2 < args.length && args.length < max) { + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, + args.length, + maxBelow, + minAbove + ); + chain = chainDiagnosticMessages(chain, headMessage); + return getDiagnosticForCallNode(node, chain); + } return getDiagnosticForCallNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove); } else if (args.length < min2) { - const diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + let diagnostic; + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + error2, + parameterRange, + args.length + ); + chain = chainDiagnosticMessages(chain, headMessage); + diagnostic = getDiagnosticForCallNode(node, chain); + } else { + diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + } const parameter = (_a2 = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a2.parameters[closestSignature.thisParameter ? args.length + 1 : args.length]; if (parameter) { const parameterError = createDiagnosticForNode( @@ -70719,15 +71384,37 @@ ${lanes.join("\n")} end++; } setTextRangePosEnd(errorSpan, pos, end); + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + error2, + parameterRange, + args.length + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), errorSpan, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error2, parameterRange, args.length); } } - function getTypeArgumentArityError(node, signatures, typeArguments) { + function getTypeArgumentArityError(node, signatures, typeArguments, headMessage) { const argCount = typeArguments.length; if (signatures.length === 1) { const sig = signatures[0]; const min2 = getMinTypeArgumentCount(sig.typeParameters); const max = length(sig.typeParameters); + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + min2 < max ? min2 + "-" + max : min2, + argCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min2 < max ? min2 + "-" + max : min2, argCount); } let belowArgCount = -Infinity; @@ -70742,11 +71429,34 @@ ${lanes.join("\n")} } } if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, + argCount, + belowArgCount, + aboveArgCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); } + if (headMessage) { + let chain = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + belowArgCount === -Infinity ? aboveArgCount : belowArgCount, + argCount + ); + chain = chainDiagnosticMessages(chain, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); + } return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } - function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { + function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) { const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */; const isDecorator2 = node.kind === 167 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); @@ -70795,6 +71505,9 @@ ${lanes.join("\n")} chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call); } + if (headMessage) { + chain = chainDiagnosticMessages(chain, headMessage); + } const diags = getSignatureApplicabilityError( node, args, @@ -70855,39 +71568,40 @@ ${lanes.join("\n")} } const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures"); - const chain = chainDiagnosticMessages( + let chain = chainDiagnosticMessages( map(diags, createDiagnosticMessageChainFromDiagnostic), Diagnostics.No_overload_matches_this_call ); + if (headMessage) { + chain = chainDiagnosticMessages(chain, headMessage); + } const related = [...flatMap(diags, (d) => d.relatedInformation)]; let diag2; if (every(diags, (d) => d.start === diags[0].start && d.length === diags[0].length && d.file === diags[0].file)) { const { file, start, length: length2 } = diags[0]; diag2 = { file, start, length: length2, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; } else { - diag2 = createDiagnosticForNodeFromMessageChain(node, chain, related); + diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, chain, related); } addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2); diagnostics.add(diag2); } } else if (candidateForArgumentArityError) { - diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args)); + diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args, headMessage)); } else if (candidateForTypeArgumentError) { checkTypeArguments( candidateForTypeArgumentError, node.typeArguments, /*reportErrors*/ true, - fallbackError + headMessage ); } else { const signaturesWithCorrectTypeArgumentArity = filter(signatures, (s) => hasCorrectTypeArgumentArity(s, typeArguments)); if (signaturesWithCorrectTypeArgumentArity.length === 0) { - diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments)); - } else if (!isDecorator2) { - diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args)); - } else if (fallbackError) { - diagnostics.add(getDiagnosticForCallNode(node, fallbackError)); + diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments, headMessage)); + } else { + diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args, headMessage)); } } } @@ -71390,7 +72104,7 @@ ${lanes.join("\n")} } function invocationError(errorTarget, apparentType, kind, relatedInformation) { const { messageChain, relatedMessage: relatedInfo } = invocationErrorDetails(errorTarget, apparentType, kind); - const diagnostic = createDiagnosticForNodeFromMessageChain(errorTarget, messageChain); + const diagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorTarget), errorTarget, messageChain); if (relatedInfo) { addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo)); } @@ -71471,7 +72185,7 @@ ${lanes.join("\n")} if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { return resolveUntypedCall(node); } - if (isPotentiallyUncalledDecorator(node, callSignatures)) { + if (isPotentiallyUncalledDecorator(node, callSignatures) && !isParenthesizedExpression(node.expression)) { const nodeStr = getTextOfNode( node.expression, /*includeTrivia*/ @@ -71484,7 +72198,7 @@ ${lanes.join("\n")} if (!callSignatures.length) { const errorDetails = invocationErrorDetails(node.expression, apparentType, 0 /* Call */); const messageChain = chainDiagnosticMessages(errorDetails.messageChain, headMessage); - const diag2 = createDiagnosticForNodeFromMessageChain(node.expression, messageChain); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node.expression), node.expression, messageChain); if (errorDetails.relatedMessage) { addRelatedInfo(diag2, createDiagnosticForNode(node.expression, errorDetails.relatedMessage)); } @@ -72101,12 +72815,15 @@ ${lanes.join("\n")} } function checkSatisfiesExpression(node) { checkSourceElement(node.type); - const exprType = checkExpression(node.expression); - const targetType = getTypeFromTypeNode(node.type); + return checkSatisfiesExpressionWorker(node.expression, node.type); + } + function checkSatisfiesExpressionWorker(expression, target, checkMode) { + const exprType = checkExpression(expression, checkMode); + const targetType = getTypeFromTypeNode(target); if (isErrorType(targetType)) { return targetType; } - checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); + checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); return exprType; } function checkMetaProperty(node) { @@ -72444,6 +73161,243 @@ ${lanes.join("\n")} } } } + function createClassDecoratorContextType(classType) { + return tryCreateTypeReference(getGlobalClassDecoratorContextType( + /*reportErrors*/ + true + ), [classType]); + } + function createClassMethodDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassMethodDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassGetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassGetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassSetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassSetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassFieldDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2) { + const key = `${isPrivate ? "p" : "P"}${isStatic2 ? "s" : "S"}${nameType.id}`; + let overrideType = decoratorContextOverrideTypeCache.get(key); + if (!overrideType) { + const members = createSymbolTable(); + members.set("name", createProperty("name", nameType)); + members.set("private", createProperty("private", isPrivate ? trueType : falseType)); + members.set("static", createProperty("static", isStatic2 ? trueType : falseType)); + overrideType = createAnonymousType( + /*symbol*/ + void 0, + members, + emptyArray, + emptyArray, + emptyArray + ); + decoratorContextOverrideTypeCache.set(key, overrideType); + } + return overrideType; + } + function createClassMemberDecoratorContextTypeForNode(node, thisType, valueType) { + const isStatic2 = hasStaticModifier(node); + const isPrivate = isPrivateIdentifier(node.name); + const nameType = isPrivate ? getStringLiteralType(idText(node.name)) : getLiteralTypeFromPropertyName(node.name); + const contextType = isMethodDeclaration(node) ? createClassMethodDecoratorContextType(thisType, valueType) : isGetAccessorDeclaration(node) ? createClassGetterDecoratorContextType(thisType, valueType) : isSetAccessorDeclaration(node) ? createClassSetterDecoratorContextType(thisType, valueType) : isAutoAccessorPropertyDeclaration(node) ? createClassAccessorDecoratorContextType(thisType, valueType) : isPropertyDeclaration(node) ? createClassFieldDecoratorContextType(thisType, valueType) : Debug.failBadSyntaxKind(node); + const overrideType = getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2); + return getIntersectionType([contextType, overrideType]); + } + function createClassAccessorDecoratorTargetType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorTargetType( + /*reportError*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorResultType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorResultType( + /*reportError*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorInitializerMutatorType(thisType, valueType) { + const thisParam = createParameter("this", thisType); + const valueParam = createParameter("value", valueType); + return createFunctionType( + /*typeParameters*/ + void 0, + thisParam, + [valueParam], + valueType, + /*typePredicate*/ + void 0, + 1 + ); + } + function createESDecoratorCallSignature(targetType, contextType, nonOptionalReturnType) { + const targetParam = createParameter("target", targetType); + const contextParam = createParameter("context", contextType); + const returnType = getUnionType([nonOptionalReturnType, voidType]); + return createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, contextParam], + returnType + ); + } + function getESDecoratorCallSignature(decorator) { + const { parent: parent2 } = decorator; + const links = getNodeLinks(parent2); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent2.kind) { + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: { + const node = parent2; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const contextType = createClassDecoratorContextType(targetType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); + break; + } + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const valueType = isMethodDeclaration(node) ? getOrCreateTypeFromSignature(getSignatureFromDeclaration(node)) : getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + case 169 /* PropertyDeclaration */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const valueType = getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = hasAccessorModifier(node) ? createClassAccessorDecoratorTargetType(thisType, valueType) : undefinedType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = hasAccessorModifier(node) ? createClassAccessorDecoratorResultType(thisType, valueType) : createClassFieldDecoratorInitializerMutatorType(thisType, valueType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getLegacyDecoratorCallSignature(decorator) { + const { parent: parent2 } = decorator; + const links = getNodeLinks(parent2); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent2.kind) { + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: { + const node = parent2; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const targetParam = createParameter("target", targetType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam], + getUnionType([targetType, voidType]) + ); + break; + } + case 166 /* Parameter */: { + const node = parent2; + if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { + break; + } + if (getThisParameter(node.parent) === node) { + break; + } + const index = getThisParameter(node.parent) ? node.parent.parameters.indexOf(node) - 1 : node.parent.parameters.indexOf(node); + Debug.assert(index >= 0); + const targetType = isConstructorDeclaration(node.parent) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent.parent)) : getParentTypeOfClassElement(node.parent); + const keyType = isConstructorDeclaration(node.parent) ? undefinedType : getClassElementPropertyKeyType(node.parent); + const indexType = getNumberLiteralType(index); + const targetParam = createParameter("target", targetType); + const keyParam = createParameter("propertyKey", keyType); + const indexParam = createParameter("parameterIndex", indexType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, indexParam], + voidType + ); + break; + } + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: + case 169 /* PropertyDeclaration */: { + const node = parent2; + if (!isClassLike(node.parent)) + break; + const targetType = getParentTypeOfClassElement(node); + const targetParam = createParameter("target", targetType); + const keyType = getClassElementPropertyKeyType(node); + const keyParam = createParameter("propertyKey", keyType); + const returnType = isPropertyDeclaration(node) ? voidType : createTypedPropertyDescriptorType(getTypeOfNode(node)); + const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2)); + if (hasPropDesc) { + const descriptorType = createTypedPropertyDescriptorType(getTypeOfNode(node)); + const descriptorParam = createParameter("descriptor", descriptorType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, descriptorParam], + getUnionType([returnType, voidType]) + ); + } else { + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam], + getUnionType([returnType, voidType]) + ); + } + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getDecoratorCallSignature(decorator) { + return legacyDecorators ? getLegacyDecoratorCallSignature(decorator) : getESDecoratorCallSignature(decorator); + } function createPromiseType(promisedType) { const globalPromiseType = getGlobalPromiseType( /*reportErrors*/ @@ -73513,12 +74467,12 @@ ${lanes.join("\n")} void 0 ); const operator = operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) { - if (operator === 55 /* AmpersandAmpersandToken */) { - let parent2 = node.parent; - while (parent2.kind === 214 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) { - parent2 = parent2.parent; - } + if (isLogicalOrCoalescingBinaryOperator(operator)) { + let parent2 = node.parent; + while (parent2.kind === 214 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { + parent2 = parent2.parent; + } + if (operator === 55 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) { checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0); } checkTruthinessOfType(leftType, node.left); @@ -73595,7 +74549,7 @@ ${lanes.join("\n")} return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 108 /* ThisKeyword */); } let leftType; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) { + if (isLogicalOrCoalescingBinaryOperator(operator)) { leftType = checkTruthinessExpression(left, checkMode); } else { leftType = checkExpression(left, checkMode); @@ -73746,7 +74700,14 @@ ${lanes.join("\n")} if (checkForDisallowedESSymbolOperand(operator)) { leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); - reportOperatorErrorUnless((left2, right2) => isTypeComparableTo(left2, right2) || isTypeComparableTo(right2, left2) || isTypeAssignableTo(left2, numberOrBigIntType) && isTypeAssignableTo(right2, numberOrBigIntType)); + reportOperatorErrorUnless((left2, right2) => { + if (isTypeAny(left2) || isTypeAny(right2)) { + return true; + } + const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType); + const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType); + return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2); + }); } return booleanType; case 34 /* EqualsEqualsToken */: @@ -73879,7 +74840,7 @@ ${lanes.join("\n")} left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access - ) && (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) { + )) { let headMessage; if (exactOptionalPropertyTypes && isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768 /* Undefined */)) { const target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText); @@ -74128,7 +75089,7 @@ ${lanes.join("\n")} } return links.resolvedType; } - function isTypeAssertion3(node) { + function isTypeAssertion(node) { node = skipParentheses( node, /*excludeJSDocTypeAssertions*/ @@ -74138,6 +75099,12 @@ ${lanes.join("\n")} } function checkDeclarationInitializer(declaration, checkMode, contextualType) { const initializer = getEffectiveInitializer(declaration); + if (isInJSFile(declaration)) { + const typeNode = tryGetJSDocSatisfiesTypeNode(declaration); + if (typeNode) { + return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode); + } + } const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType( initializer, contextualType, @@ -74206,7 +75173,7 @@ ${lanes.join("\n")} } function checkExpressionForMutableLocation(node, checkMode, forceTuple) { const type = checkExpression(node, checkMode, forceTuple); - return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion3(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType( + return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType( getContextualType2( node, /*contextFlags*/ @@ -74456,18 +75423,23 @@ ${lanes.join("\n")} if (!ok) { error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } - if (compilerOptions.isolatedModules) { + if (getIsolatedModules(compilerOptions)) { Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */)); const constEnumDeclaration = type.symbol.valueDeclaration; if (constEnumDeclaration.flags & 16777216 /* Ambient */) { - error(node, Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided); + error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } } } function checkParenthesizedExpression(node, checkMode) { - if (hasJSDocNodes(node) && isJSDocTypeAssertion(node)) { - const type = getJSDocTypeAssertionType(node); - return checkAssertionWorker(type, type, node.expression, checkMode); + if (hasJSDocNodes(node)) { + if (isJSDocSatisfiesExpression(node)) { + return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode); + } + if (isJSDocTypeAssertion(node)) { + const type = getJSDocTypeAssertionType(node); + return checkAssertionWorker(type, type, node.expression, checkMode); + } } return checkExpression(node.expression, checkMode); } @@ -74630,7 +75602,7 @@ ${lanes.join("\n")} } } function checkParameter(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkVariableLikeDeclaration(node); const func = getContainingFunction(node); if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) { @@ -74951,7 +75923,7 @@ ${lanes.join("\n")} } } function checkPropertyDeclaration(node) { - if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarProperty(node)) + if (!checkGrammarModifiers(node) && !checkGrammarProperty(node)) checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); setNodeLinksForPrivateIdentifierScope(node); @@ -74995,7 +75967,7 @@ ${lanes.join("\n")} } } function checkClassStaticBlockDeclaration(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); forEachChild(node, checkSourceElement); } function checkConstructorDeclaration(node) { @@ -75175,8 +76147,11 @@ ${lanes.join("\n")} } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 180 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) { - grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + if (node.kind === 180 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { + const sourceFile = getSourceFileOfNode(node); + if (scanTokenAtPosition(sourceFile, node.typeName.end) === 24 /* DotToken */) { + grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + } } forEach(node.typeArguments, checkSourceElement); const type = getTypeFromTypeReference(node); @@ -75869,7 +76844,7 @@ ${lanes.join("\n")} chain = chainDiagnosticMessages(chain, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForErrorOut.value)); } chain = chainDiagnosticMessages(chain, diagnosticMessage, arg0); - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chain)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chain)); } return void 0; } @@ -75960,36 +76935,66 @@ ${lanes.join("\n")} if (returnType.flags & 1 /* Any */) { return; } + const decoratorSignature = getDecoratorCallSignature(node); + if (!(decoratorSignature == null ? void 0 : decoratorSignature.resolvedReturnType)) + return; let headMessage; - let expectedReturnType; + const expectedReturnType = decoratorSignature.resolvedReturnType; switch (node.parent.kind) { case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - const classSymbol = getSymbolOfDeclaration(node.parent); - const classConstructorType = getTypeOfSymbol(classSymbol); - expectedReturnType = getUnionType([classConstructorType, voidType]); break; case 169 /* PropertyDeclaration */: + if (!legacyDecorators) { + headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + break; + } case 166 /* Parameter */: headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; - expectedReturnType = voidType; break; case 171 /* MethodDeclaration */: case 174 /* GetAccessor */: case 175 /* SetAccessor */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - const methodType = getTypeOfNode(node.parent); - const descriptorType = createTypedPropertyDescriptorType(methodType); - expectedReturnType = getUnionType([descriptorType, voidType]); break; default: - return Debug.fail(); + return Debug.failBadSyntaxKind(node.parent); } - checkTypeAssignableTo( - returnType, - expectedReturnType, - node, - headMessage + checkTypeAssignableTo(returnType, expectedReturnType, node.expression, headMessage); + } + function createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount = parameters.length, flags = 0 /* None */) { + const decl = factory.createFunctionTypeNode( + /*typeParameters*/ + void 0, + emptyArray, + factory.createKeywordTypeNode(131 /* AnyKeyword */) + ); + return createSignature(decl, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + } + function createFunctionType(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags) { + const signature = createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + return getOrCreateTypeFromSignature(signature); + } + function createGetterFunctionType(type) { + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + type + ); + } + function createSetterFunctionType(type) { + const valueParam = createParameter("value", type); + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [valueParam], + voidType ); } function markTypeNodeAsReferenced(node) { @@ -76016,9 +77021,9 @@ ${lanes.join("\n")} true ); if (rootSymbol && rootSymbol.flags & 2097152 /* Alias */) { - if (symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { + if (!compilerOptions.verbatimModuleSyntax && symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { markAliasSymbolAsReferenced(rootSymbol); - } else if (forDecoratorMetadata && compilerOptions.isolatedModules && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { + } else if (forDecoratorMetadata && getIsolatedModules(compilerOptions) && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { const diag2 = error(typeName, Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled); const aliasDeclaration = find(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration2); if (aliasDeclaration) { @@ -76084,19 +77089,37 @@ ${lanes.join("\n")} return isRestParameter(node) ? getRestParameterElementType(typeNode) : typeNode; } function checkDecorators(node) { - if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(node, node.parent, node.parent.parent)) { + if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { return; } - if (!compilerOptions.experimentalDecorators) { - error(node, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning); - } const firstDecorator = find(node.modifiers, isDecorator); if (!firstDecorator) { return; } - checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 166 /* Parameter */) { - checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + if (legacyDecorators) { + checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); + if (node.kind === 166 /* Parameter */) { + checkExternalEmitHelpers(firstDecorator, 32 /* Param */); + } + } else if (languageVersion < 99 /* ESNext */) { + checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */); + if (isClassDeclaration(node)) { + if (!node.name) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } else { + const member = getFirstTransformableStaticClassElement(node); + if (member) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } + } + } else if (!isClassExpression(node)) { + if (isPrivateIdentifier(node.name) && (isMethodDeclaration(node) || isAccessor(node) || isAutoAccessorPropertyDeclaration(node))) { + checkExternalEmitHelpers(firstDecorator, 8388608 /* SetFunctionName */); + } + if (isComputedPropertyName(node.name)) { + checkExternalEmitHelpers(firstDecorator, 16777216 /* PropKey */); + } + } } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); @@ -76166,6 +77189,19 @@ ${lanes.join("\n")} function checkJSDocTypeTag(node) { checkSourceElement(node.typeExpression); } + function checkJSDocSatisfiesTag(node) { + checkSourceElement(node.typeExpression); + const host2 = getEffectiveJSDocHost(node); + if (host2) { + const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag); + if (length(tags) > 1) { + for (let i = 1; i < length(tags); i++) { + const tagName = tags[i].tagName; + error(tagName, Diagnostics._0_tag_already_specified, idText(tagName)); + } + } + } + } function checkJSDocLinkLikeTag(node) { if (node.name) { resolveJSDocMemberName( @@ -76838,7 +77874,7 @@ ${lanes.join("\n")} return; } const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 205 /* BindingElement */ ? node.parent.parent : node)) { + if (symbol.flags & 2097152 /* Alias */ && (isVariableDeclarationInitializedToBareOrAccessedRequire(node) || isBindingElementOfBareOrAccessedRequire(node))) { checkAliasSymbol(node); return; } @@ -76930,7 +77966,7 @@ ${lanes.join("\n")} return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { - if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) + if (!checkGrammarModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) checkGrammarForDisallowedLetOrConstStatement(node); forEach(node.declarationList.declarations, checkSourceElement); } @@ -76951,17 +77987,26 @@ ${lanes.join("\n")} function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) { if (!strictNullChecks) return; - helper(condExpr, body); - while (isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56 /* BarBarToken */) { - condExpr = condExpr.left; - helper(condExpr, body); + bothHelper(condExpr, body); + function bothHelper(condExpr2, body2) { + condExpr2 = skipParentheses(condExpr2); + helper(condExpr2, body2); + while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 60 /* QuestionQuestionToken */)) { + condExpr2 = skipParentheses(condExpr2.left); + helper(condExpr2, body2); + } } function helper(condExpr2, body2) { - const location = isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 55 /* AmpersandAmpersandToken */) ? condExpr2.right : condExpr2; - if (isModuleExportsAccessExpression(location)) + const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2; + if (isModuleExportsAccessExpression(location)) { + return; + } + if (isLogicalOrCoalescingBinaryExpression(location)) { + bothHelper(location, body2); return; + } const type = location === condExpr2 ? condType : checkTruthinessExpression(location); - const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion3(location.expression); + const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression); if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast) return; const callSignatures = getSignaturesOfType(type, 0 /* Call */); @@ -76969,7 +78014,7 @@ ${lanes.join("\n")} if (callSignatures.length === 0 && !isPromise) { return; } - const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : isBinaryExpression(location) && isIdentifier(location.right) ? location.right : void 0; + const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0; const testedSymbol = testedNode && getSymbolAtLocation(testedNode); if (!testedSymbol && !isPromise) { return; @@ -77927,14 +78972,10 @@ ${lanes.join("\n")} if (catchClause) { if (catchClause.variableDeclaration) { const declaration = catchClause.variableDeclaration; - const typeNode = getEffectiveTypeAnnotationNode(getRootDeclaration(declaration)); + checkVariableLikeDeclaration(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration); if (typeNode) { - const type = getTypeForVariableLikeDeclaration( - declaration, - /*includeOptionality*/ - false, - 0 /* Normal */ - ); + const type = getTypeFromTypeNode(typeNode); if (type && !(type.flags & 3 /* AnyOrUnknown */)) { grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } @@ -78189,9 +79230,65 @@ ${lanes.join("\n")} } return true; } + function getFirstTransformableStaticClassElement(node) { + var _a2; + const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ESNext */ && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + ); + const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */; + const willTransformInitializers = !useDefineForClassFields || languageVersion < 9 /* ES2022 */; + if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) { + for (const member of node.members) { + if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated( + /*useLegacyDecorators*/ + false, + member, + node + )) { + return (_a2 = firstOrUndefined(getDecorators(node))) != null ? _a2 : node; + } else if (willTransformPrivateElementsOrClassStaticBlocks) { + if (isClassStaticBlockDeclaration(member)) { + return member; + } else if (isStatic(member)) { + if (isPrivateIdentifierClassElementDeclaration(member) || willTransformInitializers && isInitializedProperty(member)) { + return member; + } + } + } + } + } + } + function checkClassExpressionExternalHelpers(node) { + var _a2; + if (node.name) + return; + const parent2 = walkUpOuterExpressions(node); + if (!isNamedEvaluationSource(parent2)) + return; + const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ESNext */; + let location; + if (willTransformESDecorators && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + )) { + location = (_a2 = firstOrUndefined(getDecorators(node))) != null ? _a2 : node; + } else { + location = getFirstTransformableStaticClassElement(node); + } + if (location) { + checkExternalEmitHelpers(location, 8388608 /* SetFunctionName */); + if ((isPropertyAssignment(parent2) || isPropertyDeclaration(parent2) || isBindingElement(parent2)) && isComputedPropertyName(parent2.name)) { + checkExternalEmitHelpers(location, 16777216 /* PropKey */); + } + } + } function checkClassExpression(node) { checkClassLikeDeclaration(node); checkNodeDeferred(node); + checkClassExpressionExternalHelpers(node); return getTypeOfSymbol(getSymbolOfDeclaration(node)); } function checkClassExpressionDeferred(node) { @@ -78200,7 +79297,7 @@ ${lanes.join("\n")} } function checkClassDeclaration(node) { const firstDecorator = find(node.modifiers, isDecorator); - if (firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { + if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator); } if (!node.name && !hasSyntacticModifier(node, 1024 /* Default */)) { @@ -78674,7 +79771,7 @@ ${lanes.join("\n")} typeName2 ); errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); - diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(typeNode), typeNode, errorInfo)); } } } @@ -78730,7 +79827,7 @@ ${lanes.join("\n")} return !containsUndefinedType(flowType); } function checkInterfaceDeclaration(node) { - if (!checkGrammarDecoratorsAndModifiers(node)) + if (!checkGrammarModifiers(node)) checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); addLazyDiagnostic(() => { @@ -78764,7 +79861,7 @@ ${lanes.join("\n")} }); } function checkTypeAliasDeclaration(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); @@ -78960,7 +80057,7 @@ ${lanes.join("\n")} addLazyDiagnostic(() => checkEnumDeclarationWorker(node)); } function checkEnumDeclarationWorker(node) { - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); checkCollisionsForDeclarationName(node, node.name); checkExportsOnMergedDeclarations(node); node.members.forEach(checkEnumMember); @@ -79035,6 +80132,7 @@ ${lanes.join("\n")} } addLazyDiagnostic(checkModuleDeclarationDiagnostics); function checkModuleDeclarationDiagnostics() { + var _a2, _b; const isGlobalAugmentation = isGlobalScopeAugmentation(node); const inAmbientContext = node.flags & 16777216 /* Ambient */; if (isGlobalAugmentation && !inAmbientContext) { @@ -79045,7 +80143,7 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, contextErrorMessage)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node)) { + if (!checkGrammarModifiers(node)) { if (!inAmbientContext && node.name.kind === 10 /* StringLiteral */) { grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -79055,18 +80153,29 @@ ${lanes.join("\n")} } checkExportsOnMergedDeclarations(node); const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && symbol.declarations && symbol.declarations.length > 1 && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { - const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (firstNonAmbientClassOrFunc) { - if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { + if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) { + error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); + } + if (((_a2 = symbol.declarations) == null ? void 0 : _a2.length) > 1) { + const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + } else if (node.pos < firstNonAmbientClassOrFunc.pos) { + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + } + } + const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */); + if (mergedClass && inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */); - if (mergedClass && inSameLexicalScope(node, mergedClass)) { - getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */) { + const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 93 /* ExportKeyword */); + if (exportModifier) { + error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } } } if (isAmbientExternalModule) { @@ -79222,7 +80331,7 @@ ${lanes.join("\n")} const message = node.kind === 278 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } - if (compilerOptions.isolatedModules && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) { + if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) { const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol); const isType = !(targetFlags & 111551 /* Value */); if (isType || typeOnlyAlias) { @@ -79230,9 +80339,9 @@ ${lanes.join("\n")} case 270 /* ImportClause */: case 273 /* ImportSpecifier */: case 268 /* ImportEqualsDeclaration */: { - if (compilerOptions.preserveValueImports) { + if (compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) { Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); - const message = isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; + const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? compilerOptions.verbatimModuleSyntax ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : compilerOptions.verbatimModuleSyntax ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; const name = idText(node.kind === 273 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); addTypeOnlyDeclarationRelatedInfo( error(node, message, name), @@ -79241,24 +80350,23 @@ ${lanes.join("\n")} ); } if (isType && node.kind === 268 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) { - error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided); + error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); } break; } case 278 /* ExportSpecifier */: { - if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { - const message = isType ? Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled; + if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { const name = idText(node.propertyName || node.name); - addTypeOnlyDeclarationRelatedInfo( - error(node, message, name), - isType ? void 0 : typeOnlyAlias, - name - ); - return; + const diagnostic = isType ? error(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName); + addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name); + break; } } } } + if (compilerOptions.verbatimModuleSyntax && node.kind !== 268 /* ImportEqualsDeclaration */ && !isInJSFile(node) && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } } if (isImportSpecifier(node)) { const targetSymbol = checkDeprecatedAliasedSymbol(symbol, node); @@ -79338,7 +80446,7 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -79368,7 +80476,7 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - checkGrammarDecoratorsAndModifiers(node); + checkGrammarModifiers(node); if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (hasSyntacticModifier(node, 1 /* Export */)) { @@ -79404,7 +80512,7 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasSyntacticModifiers(node)) { + if (!checkGrammarModifiers(node) && hasSyntacticModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers); } if (node.moduleSpecifier && node.exportClause && isNamedExports(node.exportClause) && length(node.exportClause.elements) && languageVersion === 0 /* ES3 */) { @@ -79441,12 +80549,8 @@ ${lanes.join("\n")} } function checkGrammarExportDeclaration(node) { var _a2; - if (node.isTypeOnly) { - if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) { - return checkGrammarNamedImportsOrExports(node.exportClause); - } else { - return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type); - } + if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) { + return checkGrammarNamedImportsOrExports(node.exportClause); } return false; } @@ -79544,13 +80648,14 @@ ${lanes.join("\n")} } return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); } const typeAnnotationNode = getEffectiveTypeAnnotationNode(node); if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } + const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; const sym = resolveEntityName( @@ -79564,16 +80669,28 @@ ${lanes.join("\n")} ); if (sym) { markAliasReferenced(sym, id); - const target = sym.flags & 2097152 /* Alias */ ? resolveAlias(sym) : sym; - if (getAllSymbolFlags(target) & 111551 /* Value */) { - checkExpressionCached(node.expression); + if (getAllSymbolFlags(sym) & 111551 /* Value */) { + checkExpressionCached(id); + if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { + error( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, + idText(id) + ); + } + } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + error( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, + idText(id) + ); } } else { - checkExpressionCached(node.expression); + checkExpressionCached(id); } if (getEmitDeclarations(compilerOptions)) { collectLinkedAliases( - node.expression, + id, /*setVisibility*/ true ); @@ -79581,6 +80698,9 @@ ${lanes.join("\n")} } else { checkExpressionCached(node.expression); } + if (isIllegalExportDefaultInCJS) { + error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } checkExternalModuleExports(container); if (node.flags & 16777216 /* Ambient */ && !isEntityNameExpression(node.expression)) { grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context); @@ -79770,6 +80890,8 @@ ${lanes.join("\n")} case 338 /* JSDocProtectedTag */: case 337 /* JSDocPrivateTag */: return checkJSDocAccessibilityModifiers(node); + case 353 /* JSDocSatisfiesTag */: + return checkJSDocSatisfiesTag(node); case 196 /* IndexedAccessType */: return checkIndexedAccessType(node); case 197 /* MappedType */: @@ -80785,8 +81907,9 @@ ${lanes.join("\n")} } } function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; + const specifier = getIdentifierGeneratedImportReference(nodeIn); + if (specifier) { + return specifier; } const node = getParseTreeNode(nodeIn, isIdentifier); if (node) { @@ -80868,6 +81991,7 @@ ${lanes.join("\n")} return false; } function isValueAliasDeclaration(node) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); switch (node.kind) { case 268 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfDeclaration(node)); @@ -80908,6 +82032,7 @@ ${lanes.join("\n")} return isConstEnumSymbol(s) || !!s.constEnumOnlyModule; } function isReferencedAliasDeclaration(node, checkChildren) { + Debug.assert(!compilerOptions.verbatimModuleSyntax); if (isAliasSymbolDeclaration2(node)) { const symbol = getSymbolOfDeclaration(node); const links = symbol && getSymbolLinks(symbol); @@ -81624,23 +82749,27 @@ ${lanes.join("\n")} const helpersModule = resolveHelpersModule(sourceFile, location); if (helpersModule !== unknownSymbol) { const uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; - for (let helper = 1 /* FirstEmitHelper */; helper <= 4194304 /* LastEmitHelper */; helper <<= 1) { + for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) { if (uncheckedHelpers & helper) { - const name = getHelperName(helper); - const symbol = getSymbol2(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */); - if (!symbol) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); - } else if (helper & 524288 /* ClassPrivateFieldGet */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); - } - } else if (helper & 1048576 /* ClassPrivateFieldSet */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); - } - } else if (helper & 1024 /* SpreadArray */) { - if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + for (const name of getHelperNames(helper)) { + if (requestedExternalEmitHelperNames.has(name)) + continue; + requestedExternalEmitHelperNames.add(name); + const symbol = getSymbol2(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */); + if (!symbol) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); + } else if (helper & 524288 /* ClassPrivateFieldGet */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); + } + } else if (helper & 1048576 /* ClassPrivateFieldSet */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); + } + } else if (helper & 1024 /* SpreadArray */) { + if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { + error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + } } } } @@ -81650,54 +82779,58 @@ ${lanes.join("\n")} } } } - function getHelperName(helper) { + function getHelperNames(helper) { switch (helper) { case 1 /* Extends */: - return "__extends"; + return ["__extends"]; case 2 /* Assign */: - return "__assign"; + return ["__assign"]; case 4 /* Rest */: - return "__rest"; + return ["__rest"]; case 8 /* Decorate */: - return "__decorate"; + return legacyDecorators ? ["__decorate"] : ["__esDecorate", "__runInitializers"]; case 16 /* Metadata */: - return "__metadata"; + return ["__metadata"]; case 32 /* Param */: - return "__param"; + return ["__param"]; case 64 /* Awaiter */: - return "__awaiter"; + return ["__awaiter"]; case 128 /* Generator */: - return "__generator"; + return ["__generator"]; case 256 /* Values */: - return "__values"; + return ["__values"]; case 512 /* Read */: - return "__read"; + return ["__read"]; case 1024 /* SpreadArray */: - return "__spreadArray"; + return ["__spreadArray"]; case 2048 /* Await */: - return "__await"; + return ["__await"]; case 4096 /* AsyncGenerator */: - return "__asyncGenerator"; + return ["__asyncGenerator"]; case 8192 /* AsyncDelegator */: - return "__asyncDelegator"; + return ["__asyncDelegator"]; case 16384 /* AsyncValues */: - return "__asyncValues"; + return ["__asyncValues"]; case 32768 /* ExportStar */: - return "__exportStar"; + return ["__exportStar"]; case 65536 /* ImportStar */: - return "__importStar"; + return ["__importStar"]; case 131072 /* ImportDefault */: - return "__importDefault"; + return ["__importDefault"]; case 262144 /* MakeTemplateObject */: - return "__makeTemplateObject"; + return ["__makeTemplateObject"]; case 524288 /* ClassPrivateFieldGet */: - return "__classPrivateFieldGet"; + return ["__classPrivateFieldGet"]; case 1048576 /* ClassPrivateFieldSet */: - return "__classPrivateFieldSet"; + return ["__classPrivateFieldSet"]; case 2097152 /* ClassPrivateFieldIn */: - return "__classPrivateFieldIn"; + return ["__classPrivateFieldIn"]; case 4194304 /* CreateBinding */: - return "__createBinding"; + return ["__createBinding"]; + case 8388608 /* SetFunctionName */: + return ["__setFunctionName"]; + case 16777216 /* PropKey */: + return ["__propKey"]; default: return Debug.fail("Unrecognized helper"); } @@ -81708,257 +82841,264 @@ ${lanes.join("\n")} } return externalHelpersModule; } - function checkGrammarDecoratorsAndModifiers(node) { - return checkGrammarDecorators(node) || checkGrammarModifiers(node); - } - function checkGrammarDecorators(node) { - if (canHaveIllegalDecorators(node) && some(node.illegalDecorators)) { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); - } - if (!canHaveDecorators(node) || !hasDecorators(node)) { - return false; - } - if (!nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 171 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { - return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); - } else { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); - } - } else if (node.kind === 174 /* GetAccessor */ || node.kind === 175 /* SetAccessor */) { - const accessors = getAllAccessorDeclarations(node.parent.members, node); - if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { - return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); - } - } - return false; - } function checkGrammarModifiers(node) { - const quickResult = reportObviousModifierErrors(node); + const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node); if (quickResult !== void 0) { return quickResult; } - let lastStatic, lastDeclare, lastAsync, lastOverride; + if (isParameter(node) && parameterIsThisKeyword(node)) { + return grammarErrorOnFirstToken(node, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); + } + let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; + let sawExportBeforeDecorators = false; for (const modifier of node.modifiers) { - if (isDecorator(modifier)) - continue; - if (modifier.kind !== 146 /* ReadonlyKeyword */) { - if (node.kind === 168 /* PropertySignature */ || node.kind === 170 /* MethodSignature */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); + if (isDecorator(modifier)) { + if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { + if (node.kind === 171 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } else { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); + } + } else if (legacyDecorators && (node.kind === 174 /* GetAccessor */ || node.kind === 175 /* SetAccessor */)) { + const accessors = getAllAccessorDeclarations(node.parent.members, node); + if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } } - if (node.kind === 178 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !isClassLike(node.parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); + if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { + return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } - } - if (modifier.kind !== 101 /* InKeyword */ && modifier.kind !== 145 /* OutKeyword */ && modifier.kind !== 85 /* ConstKeyword */) { - if (node.kind === 165 /* TypeParameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); + flags |= 131072 /* Decorator */; + if (flags & 1 /* Export */) { + sawExportBeforeDecorators = true; } - } - switch (modifier.kind) { - case 85 /* ConstKeyword */: - if (node.kind !== 263 /* EnumDeclaration */ && node.kind !== 165 /* TypeParameter */) { - return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(85 /* ConstKeyword */)); - } - const parent2 = node.parent; - if (node.kind === 165 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); + firstDecorator != null ? firstDecorator : firstDecorator = modifier; + } else { + if (modifier.kind !== 146 /* ReadonlyKeyword */) { + if (node.kind === 168 /* PropertySignature */ || node.kind === 170 /* MethodSignature */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); } - break; - case 161 /* OverrideKeyword */: - if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); - } - flags |= 16384 /* Override */; - lastOverride = modifier; - break; - case 123 /* PublicKeyword */: - case 122 /* ProtectedKeyword */: - case 121 /* PrivateKeyword */: - const text = visibilityToString(modifierToFlag(modifier.kind)); - if (flags & 28 /* AccessibilityModifier */) { - return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); - } else if (flags & 32 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); - } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); - } else if (flags & 256 /* Abstract */) { - if (modifier.kind === 121 /* PrivateKeyword */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); - } else { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); - } - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + if (node.kind === 178 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !isClassLike(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); } - flags |= modifierToFlag(modifier.kind); - break; - case 124 /* StaticKeyword */: - if (flags & 32 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); - } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } else if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); - } - flags |= 32 /* Static */; - lastStatic = modifier; - break; - case 127 /* AccessorKeyword */: - if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); - } else if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); - } else if (node.kind !== 169 /* PropertyDeclaration */) { - return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); - } - flags |= 128 /* Accessor */; - break; - case 146 /* ReadonlyKeyword */: - if (flags & 64 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); - } else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); - } - flags |= 64 /* Readonly */; - break; - case 93 /* ExportKeyword */: - if (flags & 1 /* Export */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); - } else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } else if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); - } else if (isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 88 /* DefaultKeyword */: - const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 264 /* ModuleDeclaration */ && !isAmbientModule(container)) { - return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); - } else if (!(flags & 1 /* Export */)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); - } - flags |= 1024 /* Default */; - break; - case 136 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); - } else if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); - } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 265 /* ModuleBlock */) { - return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); - } else if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); - } - flags |= 2 /* Ambient */; - lastDeclare = modifier; - break; - case 126 /* AbstractKeyword */: - if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); + } + if (modifier.kind !== 101 /* InKeyword */ && modifier.kind !== 145 /* OutKeyword */ && modifier.kind !== 85 /* ConstKeyword */) { + if (node.kind === 165 /* TypeParameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); } - if (node.kind !== 260 /* ClassDeclaration */ && node.kind !== 182 /* ConstructorType */) { - if (node.kind !== 171 /* MethodDeclaration */ && node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 174 /* GetAccessor */ && node.kind !== 175 /* SetAccessor */) { - return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + switch (modifier.kind) { + case 85 /* ConstKeyword */: + if (node.kind !== 263 /* EnumDeclaration */ && node.kind !== 165 /* TypeParameter */) { + return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(85 /* ConstKeyword */)); + } + const parent2 = node.parent; + if (node.kind === 165 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); } - if (!(node.parent.kind === 260 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { - return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + break; + case 161 /* OverrideKeyword */: + if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); + } + flags |= 16384 /* Override */; + lastOverride = modifier; + break; + case 123 /* PublicKeyword */: + case 122 /* ProtectedKeyword */: + case 121 /* PrivateKeyword */: + const text = visibilityToString(modifierToFlag(modifier.kind)); + if (flags & 28 /* AccessibilityModifier */) { + return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); + } else if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); + } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); + } else if (flags & 256 /* Abstract */) { + if (modifier.kind === 121 /* PrivateKeyword */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); + } else { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); + } + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); } + flags |= modifierToFlag(modifier.kind); + break; + case 124 /* StaticKeyword */: if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); + } else if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } else if (flags & 256 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); } - if (flags & 8 /* Private */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + flags |= 32 /* Static */; + lastStatic = modifier; + break; + case 127 /* AccessorKeyword */: + if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); + } else if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); + } else if (node.kind !== 169 /* PropertyDeclaration */) { + return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); + } + flags |= 128 /* Accessor */; + break; + case 146 /* ReadonlyKeyword */: + if (flags & 64 /* Readonly */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); + } else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); + } + flags |= 64 /* Readonly */; + break; + case 93 /* ExportKeyword */: + if (compilerOptions.verbatimModuleSyntax && !(node.flags & 16777216 /* Ambient */) && node.kind !== 262 /* TypeAliasDeclaration */ && node.kind !== 261 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later + node.kind !== 264 /* ModuleDeclaration */ && node.parent.kind === 308 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } + if (flags & 1 /* Export */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); + } else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } else if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); + } else if (isClassLike(node.parent)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1 /* Export */; + break; + case 88 /* DefaultKeyword */: + const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 264 /* ModuleDeclaration */ && !isAmbientModule(container)) { + return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } else if (!(flags & 1 /* Export */)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); + } else if (sawExportBeforeDecorators) { + return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here); + } + flags |= 1024 /* Default */; + break; + case 136 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); + } else if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); + } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 265 /* ModuleBlock */) { + return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); + } else if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); + } + flags |= 2 /* Ambient */; + lastDeclare = modifier; + break; + case 126 /* AbstractKeyword */: + if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); } - if (flags & 512 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + if (node.kind !== 260 /* ClassDeclaration */ && node.kind !== 182 /* ConstructorType */) { + if (node.kind !== 171 /* MethodDeclaration */ && node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 174 /* GetAccessor */ && node.kind !== 175 /* SetAccessor */) { + return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + if (!(node.parent.kind === 260 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { + return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + } + if (flags & 32 /* Static */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } + if (flags & 8 /* Private */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + } + if (flags & 512 /* Async */ && lastAsync) { + return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + if (flags & 16384 /* Override */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + } + if (flags & 128 /* Accessor */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + } } - if (flags & 16384 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + if (isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); } - if (flags & 128 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + flags |= 256 /* Abstract */; + break; + case 132 /* AsyncKeyword */: + if (flags & 512 /* Async */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); + } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (node.kind === 166 /* Parameter */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); + } + if (flags & 256 /* Abstract */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + flags |= 512 /* Async */; + lastAsync = modifier; + break; + case 101 /* InKeyword */: + case 145 /* OutKeyword */: + const inOutFlag = modifier.kind === 101 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; + const inOutText = modifier.kind === 101 /* InKeyword */ ? "in" : "out"; + if (node.kind !== 165 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); } - } - if (isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); - } - flags |= 256 /* Abstract */; - break; - case 132 /* AsyncKeyword */: - if (flags & 512 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); - } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (node.kind === 166 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); - } - if (flags & 256 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } - flags |= 512 /* Async */; - lastAsync = modifier; - break; - case 101 /* InKeyword */: - case 145 /* OutKeyword */: - const inOutFlag = modifier.kind === 101 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; - const inOutText = modifier.kind === 101 /* InKeyword */ ? "in" : "out"; - if (node.kind !== 165 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); - } - if (flags & inOutFlag) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); - } - if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); - } - flags |= inOutFlag; - break; + if (flags & inOutFlag) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); + } + if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); + } + flags |= inOutFlag; + break; + } } } if (node.kind === 173 /* Constructor */) { @@ -81985,9 +83125,16 @@ ${lanes.join("\n")} return false; } function reportObviousModifierErrors(node) { - return !node.modifiers ? false : shouldReportBadModifier(node) ? grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here) : void 0; + if (!node.modifiers) + return false; + const modifier = findFirstIllegalModifier(node); + return modifier && grammarErrorOnFirstToken(modifier, Diagnostics.Modifiers_cannot_appear_here); + } + function findFirstModifierExcept(node, allowedModifier) { + const modifier = find(node.modifiers, isModifier); + return modifier && modifier.kind !== allowedModifier ? modifier : void 0; } - function shouldReportBadModifier(node) { + function findFirstIllegalModifier(node) { switch (node.kind) { case 174 /* GetAccessor */: case 175 /* SetAccessor */: @@ -82006,43 +83153,42 @@ ${lanes.join("\n")} case 216 /* ArrowFunction */: case 166 /* Parameter */: case 165 /* TypeParameter */: - return false; + return void 0; case 172 /* ClassStaticBlockDeclaration */: case 299 /* PropertyAssignment */: case 300 /* ShorthandPropertyAssignment */: case 267 /* NamespaceExportDeclaration */: case 181 /* FunctionType */: case 279 /* MissingDeclaration */: - return true; + return find(node.modifiers, isModifier); default: if (node.parent.kind === 265 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return false; + return void 0; } switch (node.kind) { case 259 /* FunctionDeclaration */: - return nodeHasAnyModifiersExcept(node, 132 /* AsyncKeyword */); + return findFirstModifierExcept(node, 132 /* AsyncKeyword */); case 260 /* ClassDeclaration */: case 182 /* ConstructorType */: - return nodeHasAnyModifiersExcept(node, 126 /* AbstractKeyword */); + return findFirstModifierExcept(node, 126 /* AbstractKeyword */); case 228 /* ClassExpression */: case 261 /* InterfaceDeclaration */: case 240 /* VariableStatement */: case 262 /* TypeAliasDeclaration */: - return true; + return find(node.modifiers, isModifier); case 263 /* EnumDeclaration */: - return nodeHasAnyModifiersExcept(node, 85 /* ConstKeyword */); + return findFirstModifierExcept(node, 85 /* ConstKeyword */); default: Debug.assertNever(node); } } } - function nodeHasAnyModifiersExcept(node, allowedModifier) { - for (const modifier of node.modifiers) { - if (isDecorator(modifier)) - continue; - return modifier.kind !== allowedModifier; - } - return false; + function reportObviousDecoratorErrors(node) { + const decorator = findFirstIllegalDecorator(node); + return decorator && grammarErrorOnFirstToken(decorator, Diagnostics.Decorators_are_not_valid_here); + } + function findFirstIllegalDecorator(node) { + return canHaveIllegalDecorators(node) ? find(node.modifiers, isDecorator) : void 0; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { @@ -82121,7 +83267,7 @@ ${lanes.join("\n")} } function checkGrammarFunctionLikeDeclaration(node) { const file = getSourceFileOfNode(node); - return checkGrammarDecoratorsAndModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); + return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); } function checkGrammarClassLikeDeclaration(node) { const file = getSourceFileOfNode(node); @@ -82179,7 +83325,7 @@ ${lanes.join("\n")} return false; } function checkGrammarIndexSignature(node) { - return checkGrammarDecoratorsAndModifiers(node) || checkGrammarIndexSignatureParameters(node); + return checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { if (typeArguments && typeArguments.length === 0) { @@ -82219,7 +83365,7 @@ ${lanes.join("\n")} function checkGrammarClassDeclarationHeritageClauses(node) { let seenExtendsClause = false; let seenImplementsClause = false; - if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) { + if (!checkGrammarModifiers(node) && node.heritageClauses) { for (const heritageClause of node.heritageClauses) { if (heritageClause.token === 94 /* ExtendsKeyword */) { if (seenExtendsClause) { @@ -82320,7 +83466,9 @@ ${lanes.join("\n")} } } else if (canHaveIllegalModifiers(prop) && prop.modifiers) { for (const mod of prop.modifiers) { - grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); + if (isModifier(mod)) { + grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); + } } } let currentKind; @@ -82764,7 +83912,7 @@ ${lanes.join("\n")} } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 79 /* Identifier */) { - if (name.originalKeywordKind === 119 /* LetKeyword */) { + if (name.escapedText === "let") { return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { @@ -83052,6 +84200,9 @@ ${lanes.join("\n")} }); } function checkGrammarImportCallExpression(node) { + if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) { + return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } if (moduleKind === 5 /* ES2015 */) { return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext); } @@ -83460,13 +84611,10 @@ ${lanes.join("\n")} // src/compiler/visitorPublic.ts function visitNode(node, visitor, test, lift) { - if (node === void 0 || visitor === void 0) { + if (node === void 0) { return node; } const visited = visitor(node); - if (visited === node) { - return node; - } let visitedNode; if (visited === void 0) { return void 0; @@ -83479,7 +84627,7 @@ ${lanes.join("\n")} return visitedNode; } function visitNodes2(nodes, visitor, test, start, count) { - if (nodes === void 0 || visitor === void 0) { + if (nodes === void 0) { return nodes; } const length2 = nodes.length; @@ -83528,25 +84676,30 @@ ${lanes.join("\n")} } for (let i = 0; i < count; i++) { const node = nodes[i + start]; - const visited = node !== void 0 ? visitor(node) : void 0; + const visited = node !== void 0 ? visitor ? visitor(node) : node : void 0; if (updated !== void 0 || visited === void 0 || visited !== node) { if (updated === void 0) { updated = nodes.slice(0, i); + Debug.assertEachNode(updated, test); } if (visited) { if (isArray(visited)) { for (const visitedNode of visited) { - void Debug.assertNode(visitedNode, test); + Debug.assertNode(visitedNode, test); updated.push(visitedNode); } } else { - void Debug.assertNode(visited, test); + Debug.assertNode(visited, test); updated.push(visited); } } } } - return updated != null ? updated : nodes; + if (updated) { + return updated; + } + Debug.assertEachNode(nodes, test); + return nodes; } function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict, nodesVisitor = visitNodes2) { context.startLexicalEnvironment(); @@ -83560,7 +84713,7 @@ ${lanes.join("\n")} context.startLexicalEnvironment(); if (nodes) { context.setLexicalEnvironmentFlags(1 /* InParameters */, true); - updated = nodesVisitor(nodes, visitor, isParameterDeclaration); + updated = nodesVisitor(nodes, visitor, isParameter); if (context.getLexicalEnvironmentFlags() & 2 /* VariablesHoistedInParameters */ && getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { updated = addDefaultValueAssignmentsIfNeeded(updated, context); } @@ -83682,6 +84835,7 @@ ${lanes.join("\n")} function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { context.startBlockScope(); const updated = nodeVisitor(body, visitor, isStatement, context.factory.liftToBlock); + Debug.assert(updated); const declarations = context.endBlockScope(); if (some(declarations)) { if (isBlock(updated)) { @@ -83693,6 +84847,18 @@ ${lanes.join("\n")} } return updated; } + function visitCommaListElements(elements, visitor, discardVisitor = visitor) { + if (discardVisitor === visitor || elements.length <= 1) { + return visitNodes2(elements, visitor, isExpression); + } + let i = 0; + const length2 = elements.length; + return visitNodes2(elements, (node) => { + const discarded = i < length2 - 1; + i++; + return discarded ? discardVisitor(node) : visitor(node); + }, isExpression); + } function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) { if (node === void 0) { return void 0; @@ -83710,23 +84876,17 @@ ${lanes.join("\n")} "use strict"; init_ts2(); visitEachChildTable = { - [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateIdentifier( - node, - nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration) - ); - }, [163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateQualifiedName( node, - nodeVisitor(node.left, visitor, isEntityName), - nodeVisitor(node.right, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), + Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) ); }, [164 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateComputedPropertyName( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Signature elements @@ -83734,7 +84894,7 @@ ${lanes.join("\n")} return context.factory.updateTypeParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.constraint, visitor, isTypeNode), nodeVisitor(node.default, visitor, isTypeNode) ); @@ -83743,9 +84903,9 @@ ${lanes.join("\n")} return context.factory.updateParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -83753,7 +84913,7 @@ ${lanes.join("\n")} [167 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDecorator( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Type elements @@ -83761,19 +84921,19 @@ ${lanes.join("\n")} return context.factory.updatePropertySignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode) ); }, [169 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - var _a2; + var _a2, _b; return context.factory.updatePropertyDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration - nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken), + tokenVisitor ? nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken) : (_b = node.questionToken) != null ? _b : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -83782,10 +84942,10 @@ ${lanes.join("\n")} return context.factory.updateMethodSignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -83793,9 +84953,9 @@ ${lanes.join("\n")} return context.factory.updateMethodDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), @@ -83805,7 +84965,7 @@ ${lanes.join("\n")} [173 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -83814,7 +84974,7 @@ ${lanes.join("\n")} return context.factory.updateGetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor) @@ -83824,7 +84984,7 @@ ${lanes.join("\n")} return context.factory.updateSetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -83841,7 +85001,7 @@ ${lanes.join("\n")} return context.factory.updateCallSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -83849,16 +85009,16 @@ ${lanes.join("\n")} return context.factory.updateConstructSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, [178 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexSignature( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, // Types @@ -83866,14 +85026,14 @@ ${lanes.join("\n")} return context.factory.updateTypePredicateNode( node, nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), - nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode), + Debug.checkDefined(nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode)), nodeVisitor(node.type, visitor, isTypeNode) ); }, [180 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeReferenceNode( node, - nodeVisitor(node.typeName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -83881,8 +85041,8 @@ ${lanes.join("\n")} return context.factory.updateFunctionTypeNode( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [182 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -83890,14 +85050,14 @@ ${lanes.join("\n")} node, nodesVisitor(node.modifiers, visitor, isModifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [183 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeQueryNode( node, - nodeVisitor(node.exprName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -83910,7 +85070,7 @@ ${lanes.join("\n")} [185 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateArrayTypeNode( node, - nodeVisitor(node.elementType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) ); }, [186 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -83922,13 +85082,13 @@ ${lanes.join("\n")} [187 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateOptionalTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [188 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateRestTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [189 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -83946,22 +85106,22 @@ ${lanes.join("\n")} [191 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConditionalTypeNode( node, - nodeVisitor(node.checkType, visitor, isTypeNode), - nodeVisitor(node.extendsType, visitor, isTypeNode), - nodeVisitor(node.trueType, visitor, isTypeNode), - nodeVisitor(node.falseType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.extendsType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.trueType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) ); }, [192 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInferTypeNode( node, - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration) + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) ); }, [202 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeNode( node, - nodeVisitor(node.argument, visitor, isTypeNode), + Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer), nodeVisitor(node.qualifier, visitor, isEntityName), nodesVisitor(node.typeArguments, visitor, isTypeNode), @@ -83971,45 +85131,45 @@ ${lanes.join("\n")} [298 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeAssertionContainer( node, - nodeVisitor(node.assertClause, visitor, isAssertClause), + Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), node.multiLine ); }, [199 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateNamedTupleMember( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.type, visitor, isTypeNode) + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [193 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedType( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [195 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOperatorNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [196 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexedAccessTypeNode( node, - nodeVisitor(node.objectType, visitor, isTypeNode), - nodeVisitor(node.indexType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) ); }, [197 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMappedTypeNode( node, - nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken), - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration), + tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)), nodeVisitor(node.nameType, visitor, isTypeNode), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodesVisitor(node.members, visitor, isTypeElement) ); @@ -84017,21 +85177,21 @@ ${lanes.join("\n")} [198 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLiteralTypeNode( node, - nodeVisitor(node.literal, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) ); }, [200 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralType( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) ); }, [201 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralTypeSpan( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Binding patterns @@ -84050,9 +85210,9 @@ ${lanes.join("\n")} [205 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBindingElement( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, nodeVisitor(node.propertyName, visitor, isPropertyName), - nodeVisitor(node.name, visitor, isBindingName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -84072,37 +85232,37 @@ ${lanes.join("\n")} [208 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ) : context.factory.updatePropertyAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ); }, [209 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isElementAccessChain(node) ? context.factory.updateElementAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ) : context.factory.updateElementAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ); }, [210 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return isCallChain(node) ? context.factory.updateCallChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ) : context.factory.updateCallExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -84110,7 +85270,7 @@ ${lanes.join("\n")} [211 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNewExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -84118,29 +85278,29 @@ ${lanes.join("\n")} [212 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTaggedTemplateExpression( node, - nodeVisitor(node.tag, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.template, visitor, isTemplateLiteral) + Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) ); }, [213 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAssertion( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [214 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [215 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionExpression( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -84155,82 +85315,82 @@ ${lanes.join("\n")} nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken)) : node.equalsGreaterThanToken, visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, [217 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDeleteExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [218 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOfExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [219 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVoidExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [220 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAwaitExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [221 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePrefixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [222 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePostfixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [223 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBinaryExpression( node, - nodeVisitor(node.left, visitor, isExpression), - nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken), - nodeVisitor(node.right, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken)) : node.operatorToken, + Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) ); }, [224 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateConditionalExpression( node, - nodeVisitor(node.condition, visitor, isExpression), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.whenTrue, visitor, isExpression), - nodeVisitor(node.colonToken, tokenVisitor, isColonToken), - nodeVisitor(node.whenFalse, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken)) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.whenTrue, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.colonToken, tokenVisitor, isColonToken)) : node.colonToken, + Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) ); }, [225 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateExpression( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateSpan) ); }, [226 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateYieldExpression( node, - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.expression, visitor, isExpression) ); }, [227 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadElement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [228 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -84246,45 +85406,45 @@ ${lanes.join("\n")} [230 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionWithTypeArguments( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, [231 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAsExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [235 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSatisfiesExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [232 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return isOptionalChain(node) ? context.factory.updateNonNullChain( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ) : context.factory.updateNonNullExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [233 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateMetaProperty( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Misc [236 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateSpan( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Element @@ -84297,21 +85457,21 @@ ${lanes.join("\n")} [240 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVariableStatement( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.declarationList, visitor, isVariableDeclarationList) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) ); }, [241 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [242 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIfStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock)), nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) ); }, @@ -84319,13 +85479,13 @@ ${lanes.join("\n")} return context.factory.updateDoStatement( node, visitIterationBody(node.statement, visitor, context, nodeVisitor), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [244 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWhileStatement( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -84341,17 +85501,17 @@ ${lanes.join("\n")} [246 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForInStatement( node, - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, [247 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateForOfStatement( node, - nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword), - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -84376,34 +85536,34 @@ ${lanes.join("\n")} [251 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWithStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [252 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSwitchStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.caseBlock, visitor, isCaseBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) ); }, [253 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLabeledStatement( node, - nodeVisitor(node.label, visitor, isIdentifier), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [254 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateThrowStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [255 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTryStatement( node, - nodeVisitor(node.tryBlock, visitor, isBlock), + Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), nodeVisitor(node.catchClause, visitor, isCatchClause), nodeVisitor(node.finallyBlock, visitor, isBlock) ); @@ -84411,8 +85571,8 @@ ${lanes.join("\n")} [257 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateVariableDeclaration( node, - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken) : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -84427,7 +85587,7 @@ ${lanes.join("\n")} return context.factory.updateFunctionDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -84448,8 +85608,8 @@ ${lanes.join("\n")} [261 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInterfaceDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, isHeritageClause), nodesVisitor(node.members, visitor, isTypeElement) @@ -84458,25 +85618,25 @@ ${lanes.join("\n")} [262 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAliasDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [263 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.members, visitor, isEnumMember) ); }, [264 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateModuleDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isModuleName), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleName)), nodeVisitor(node.body, visitor, isModuleBody) ); }, @@ -84495,24 +85655,24 @@ ${lanes.join("\n")} [267 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExportDeclaration( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [268 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportEqualsDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.moduleReference, visitor, isModuleReference) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) ); }, [269 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), nodeVisitor(node.importClause, visitor, isImportClause), - nodeVisitor(node.moduleSpecifier, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)), nodeVisitor(node.assertClause, visitor, isAssertClause) ); }, @@ -84526,8 +85686,8 @@ ${lanes.join("\n")} [297 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAssertEntry( node, - nodeVisitor(node.name, visitor, isAssertionKey), - nodeVisitor(node.value, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)), + Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) ); }, [270 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -84541,13 +85701,13 @@ ${lanes.join("\n")} [271 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceImport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [277 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [272 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -84561,20 +85721,20 @@ ${lanes.join("\n")} node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [274 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportAssignment( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.expression, visitor, isExpression) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [275 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, isExpression), @@ -84592,59 +85752,59 @@ ${lanes.join("\n")} node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Module references [280 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExternalModuleReference( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // JSX [281 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxElement( node, - nodeVisitor(node.openingElement, visitor, isJsxOpeningElement), + Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingElement, visitor, isJsxClosingElement) + Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) ); }, [282 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSelfClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [283 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxOpeningElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [284 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression) + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) ); }, [285 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxFragment( node, - nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment), + Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment) + Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) ); }, [288 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) ); }, @@ -84657,20 +85817,20 @@ ${lanes.join("\n")} [290 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSpreadAttribute( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Clauses [292 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCaseClause( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.statements, visitor, isStatement) ); }, @@ -84690,35 +85850,35 @@ ${lanes.join("\n")} return context.factory.updateCatchClause( node, nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), - nodeVisitor(node.block, visitor, isBlock) + Debug.checkDefined(nodeVisitor(node.block, visitor, isBlock)) ); }, // Property assignments [299 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePropertyAssignment( node, - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.initializer, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) ); }, [300 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateShorthandPropertyAssignment( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) ); }, [301 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadAssignment( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Enum [302 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumMember( node, - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -84730,13 +85890,13 @@ ${lanes.join("\n")} ); }, // Transformation nodes - [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePartiallyEmittedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCommaListExpression( node, nodesVisitor(node.elements, visitor, isExpression) @@ -85622,10 +86782,13 @@ ${lanes.join("\n")} parameters }; } - function getAllDecoratorsOfClassElement(member, parent2) { + function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { switch (member.kind) { case 174 /* GetAccessor */: case 175 /* SetAccessor */: + if (!useLegacyDecorators) { + return getAllDecoratorsOfMethod(member); + } return getAllDecoratorsOfAccessors(member, parent2); case 171 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); @@ -85674,6 +86837,34 @@ ${lanes.join("\n")} } return { decorators }; } + function walkUpLexicalEnvironments(env, cb) { + while (env) { + const result = cb(env); + if (result !== void 0) + return result; + env = env.previous; + } + } + function newPrivateEnvironment(data) { + return { data }; + } + function getPrivateIdentifier(privateEnv, name) { + var _a2, _b; + return isGeneratedPrivateIdentifier(name) ? (_a2 = privateEnv == null ? void 0 : privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(getNodeForGeneratedName(name)) : (_b = privateEnv == null ? void 0 : privateEnv.identifiers) == null ? void 0 : _b.get(name.escapedText); + } + function setPrivateIdentifier(privateEnv, name, entry) { + var _a2, _b; + if (isGeneratedPrivateIdentifier(name)) { + (_a2 = privateEnv.generatedIdentifiers) != null ? _a2 : privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map(); + privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), entry); + } else { + (_b = privateEnv.identifiers) != null ? _b : privateEnv.identifiers = /* @__PURE__ */ new Map(); + privateEnv.identifiers.set(name.escapedText, entry); + } + } + function accessPrivateIdentifier(env, name) { + return walkUpLexicalEnvironments(env, (env2) => getPrivateIdentifier(env2.privateEnv, name)); + } var init_utilities3 = __esm({ "src/compiler/transformers/utilities.ts"() { "use strict"; @@ -85692,7 +86883,7 @@ ${lanes.join("\n")} location = node = value; value = node.right; } else { - return visitNode(value, visitor, isExpression); + return Debug.checkDefined(visitNode(value, visitor, isExpression)); } } } @@ -85711,6 +86902,7 @@ ${lanes.join("\n")} }; if (value) { value = visitNode(value, visitor, isExpression); + Debug.assert(value); if (isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node)) { value = ensureIdentifier( flattenContext, @@ -85752,7 +86944,7 @@ ${lanes.join("\n")} function emitBindingOrAssignment(target, value2, location2, original) { Debug.assertNode(target, createAssignmentCallback ? isIdentifier : isExpression); const expression = createAssignmentCallback ? createAssignmentCallback(target, value2, location2) : setTextRange( - context.factory.createAssignment(visitNode(target, visitor, isExpression), value2), + context.factory.createAssignment(Debug.checkDefined(visitNode(target, visitor, isExpression)), value2), location2 ); expression.original = original; @@ -85809,7 +87001,7 @@ ${lanes.join("\n")} if (initializer && (isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node))) { initializer = ensureIdentifier( flattenContext, - visitNode(initializer, flattenContext.visitor), + Debug.checkDefined(visitNode(initializer, flattenContext.visitor, isExpression)), /*reuseIdentifierExpressions*/ false, initializer @@ -85930,7 +87122,7 @@ ${lanes.join("\n")} if (!getRestIndicatorOfBindingOrAssignmentElement(element)) { const propertyName = getPropertyNameOfBindingOrAssignmentElement(element); if (flattenContext.level >= 1 /* ObjectRest */ && !(element.transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !(getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !isComputedPropertyName(propertyName)) { - bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor)); + bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor, isBindingOrAssignmentElement)); } else { if (bindingElements) { flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern); @@ -86068,7 +87260,7 @@ ${lanes.join("\n")} if (isComputedPropertyName(propertyName)) { const argumentExpression = ensureIdentifier( flattenContext, - visitNode(propertyName.expression, flattenContext.visitor), + Debug.checkDefined(visitNode(propertyName.expression, flattenContext.visitor, isExpression)), /*reuseIdentifierExpressions*/ false, /*location*/ @@ -86111,6 +87303,7 @@ ${lanes.join("\n")} return factory2.createArrayBindingPattern(elements); } function makeArrayAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isArrayBindingOrAssignmentElement); return factory2.createArrayLiteralExpression(map(elements, factory2.converters.convertToArrayAssignmentElement)); } function makeObjectBindingPattern(factory2, elements) { @@ -86118,6 +87311,7 @@ ${lanes.join("\n")} return factory2.createObjectBindingPattern(elements); } function makeObjectAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isObjectBindingOrAssignmentElement); return factory2.createObjectLiteralExpression(map(elements, factory2.converters.convertToObjectAssignmentElement)); } function makeBindingElement(factory2, name) { @@ -86148,6 +87342,7 @@ ${lanes.join("\n")} // src/compiler/transformers/taggedTemplate.ts function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) { const tag = visitNode(node.tag, visitor, isExpression); + Debug.assert(tag); const templateArguments = [void 0]; const cookedStrings = []; const rawStrings = []; @@ -86164,7 +87359,7 @@ ${lanes.join("\n")} for (const templateSpan of template.templateSpans) { cookedStrings.push(createTemplateCooked(templateSpan.literal)); rawStrings.push(getRawLiteral(templateSpan.literal, currentSourceFile)); - templateArguments.push(visitNode(templateSpan.expression, visitor, isExpression)); + templateArguments.push(Debug.checkDefined(visitNode(templateSpan.expression, visitor, isExpression))); } } const helperCall = context.getEmitHelperFactory().createTemplateObjectHelper( @@ -86235,6 +87430,7 @@ ${lanes.join("\n")} const compilerOptions = context.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const typeSerializer = compilerOptions.emitDecoratorMetadata ? createRuntimeTypeSerializer(context) : void 0; const previousOnEmitNode = context.onEmitNode; const previousOnSubstituteNode = context.onSubstituteNode; @@ -86409,6 +87605,12 @@ ${lanes.join("\n")} return Debug.failBadSyntaxKind(node); } } + function decoratorElidingVisitor(node) { + return isDecorator(node) ? void 0 : visitor(node); + } + function modifierElidingVisitor(node) { + return isModifier(node) ? void 0 : visitor(node); + } function modifierVisitor(node) { if (isDecorator(node)) return void 0; @@ -86548,19 +87750,25 @@ ${lanes.join("\n")} function visitObjectLiteralExpression(node) { return factory2.updateObjectLiteralExpression( node, - visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElement) + visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElementLike) ); } - function getClassFacts(node, staticProperties) { + function getClassFacts(node) { let facts = 0 /* None */; - if (some(staticProperties)) + if (some(getProperties( + node, + /*requireInitialized*/ + true, + /*isStatic*/ + true + ))) facts |= 1 /* HasStaticInitializedProperties */; const extendsClauseElement = getEffectiveBaseTypeNode(node); if (extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */) facts |= 64 /* IsDerivedClass */; - if (classOrConstructorParameterIsDecorated(node)) - facts |= 2 /* HasConstructorDecorators */; - if (childIsDecorated(node)) + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) + facts |= 2 /* HasClassOrConstructorParameterDecorators */; + if (childIsDecorated(legacyDecorators, node)) facts |= 4 /* HasMemberDecorators */; if (isExportOfNamespace(node)) facts |= 8 /* IsExportOfNamespace */; @@ -86568,8 +87776,6 @@ ${lanes.join("\n")} facts |= 32 /* IsDefaultExternalExport */; else if (isNamedExternalModuleExport(node)) facts |= 16 /* IsNamedExternalExport */; - if (languageVersion <= 1 /* ES5 */ && facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */) - facts |= 128 /* UseImmediatelyInvokedFunctionExpression */; return facts; } function hasTypeScriptClassSyntax(node) { @@ -86579,7 +87785,10 @@ ${lanes.join("\n")} return hasDecorators(node) || some(node.typeParameters) || some(node.heritageClauses, hasTypeScriptClassSyntax) || some(node.members, hasTypeScriptClassSyntax); } function visitClassDeclaration(node) { - if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !(currentNamespace && hasSyntacticModifier(node, 1 /* Export */))) { + var _a2; + const facts = getClassFacts(node); + const promoteToIIFE = languageVersion <= 1 /* ES5 */ && !!(facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */); + if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !classOrConstructorParameterIsDecorated(legacyDecorators, node) && !isExportOfNamespace(node)) { return factory2.updateClassDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), @@ -86590,24 +87799,19 @@ ${lanes.join("\n")} visitNodes2(node.members, getClassElementVisitor(node), isClassElement) ); } - const staticProperties = getProperties( - node, - /*requireInitializer*/ - true, - /*isStatic*/ - true - ); - const facts = getClassFacts(node, staticProperties); - if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) { + if (promoteToIIFE) { context.startLexicalEnvironment(); } - const name = node.name || (facts & 5 /* NeedsName */ ? factory2.getGeneratedNameForNode(node) : void 0); - const allDecorators = getAllDecoratorsOfClass(node); - const decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); - const modifiers = !(facts & 128 /* UseImmediatelyInvokedFunctionExpression */) ? visitNodes2(node.modifiers, modifierVisitor, isModifier) : elideNodes(factory2, node.modifiers); - const classStatement = factory2.updateClassDeclaration( + const moveModifiers = promoteToIIFE || facts & 8 /* IsExportOfNamespace */ || facts & 2 /* HasClassOrConstructorParameterDecorators */ && legacyDecorators || facts & 1 /* HasStaticInitializedProperties */; + let modifiers = moveModifiers ? visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, visitor, isModifierLike); + if (facts & 2 /* HasClassOrConstructorParameterDecorators */) { + modifiers = injectClassTypeMetadata(modifiers, node); + } + const needsName = moveModifiers && !node.name || facts & 4 /* HasMemberDecorators */ || facts & 1 /* HasStaticInitializedProperties */; + const name = needsName ? (_a2 = node.name) != null ? _a2 : factory2.getGeneratedNameForNode(node) : node.name; + const classDeclaration = factory2.updateClassDeclaration( node, - concatenate(decorators, modifiers), + modifiers, name, /*typeParameters*/ void 0, @@ -86618,24 +87822,25 @@ ${lanes.join("\n")} if (facts & 1 /* HasStaticInitializedProperties */) { emitFlags |= 64 /* NoTrailingSourceMap */; } - setEmitFlags(classStatement, emitFlags); - let statements = [classStatement]; - if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) { + setEmitFlags(classDeclaration, emitFlags); + let statement; + if (promoteToIIFE) { + const statements = [classDeclaration]; const closingBraceLocation = createTokenRange(skipTrivia(currentSourceFile.text, node.members.end), 19 /* CloseBraceToken */); const localName = factory2.getInternalName(node); const outer = factory2.createPartiallyEmittedExpression(localName); setTextRangeEnd(outer, closingBraceLocation.end); setEmitFlags(outer, 3072 /* NoComments */); - const statement = factory2.createReturnStatement(outer); - setTextRangePos(statement, closingBraceLocation.pos); - setEmitFlags(statement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); - statements.push(statement); + const returnStatement = factory2.createReturnStatement(outer); + setTextRangePos(returnStatement, closingBraceLocation.pos); + setEmitFlags(returnStatement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); + statements.push(returnStatement); insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment()); const iife = factory2.createImmediatelyInvokedArrowFunction(statements); - setEmitFlags(iife, 67108864 /* TypeScriptClassWrapper */); + setInternalEmitFlags(iife, 1 /* TypeScriptClassWrapper */); + const modifiers2 = facts & 16 /* IsNamedExternalExport */ ? factory2.createModifiersFromModifierFlags(1 /* Export */) : void 0; const varStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, + modifiers2, factory2.createVariableDeclarationList([ factory2.createVariableDeclaration( factory2.getLocalName( @@ -86651,114 +87856,133 @@ ${lanes.join("\n")} void 0, iife ) - ]) + ], 1 /* Let */) ); setOriginalNode(varStatement, node); setCommentRange(varStatement, node); setSourceMapRange(varStatement, moveRangePastDecorators(node)); startOnNewLine(varStatement); - statements = [varStatement]; + statement = varStatement; + } else { + statement = classDeclaration; } - if (facts & 8 /* IsExportOfNamespace */) { - addExportMemberAssignment(statements, node); - } else if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) { + if (moveModifiers) { + if (facts & 8 /* IsExportOfNamespace */) { + return demarcateMultiStatementExport( + statement, + createExportMemberAssignmentStatement(node) + ); + } if (facts & 32 /* IsDefaultExternalExport */) { - statements.push(factory2.createExportDefault(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ))); - } else if (facts & 16 /* IsNamedExternalExport */) { - statements.push(factory2.createExternalModuleExport(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ))); + return demarcateMultiStatementExport( + statement, + factory2.createExportDefault(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ); + } + if (facts & 16 /* IsNamedExternalExport */ && !promoteToIIFE) { + return demarcateMultiStatementExport( + statement, + factory2.createExternalModuleExport(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ); } } - if (statements.length > 1) { - statements.push(factory2.createEndOfDeclarationMarker(node)); - setEmitFlags(classStatement, getEmitFlags(classStatement) | 8388608 /* HasEndOfDeclarationMarker */); - } - return singleOrMany(statements); + return statement; + } + function demarcateMultiStatementExport(declarationStatement, exportStatement) { + addEmitFlags(declarationStatement, 8388608 /* HasEndOfDeclarationMarker */); + return [ + declarationStatement, + exportStatement, + factory2.createEndOfDeclarationMarker(declarationStatement) + ]; } function visitClassExpression(node) { - const allDecorators = getAllDecoratorsOfClass(node); - const decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); + let modifiers = visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike); + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) { + modifiers = injectClassTypeMetadata(modifiers, node); + } return factory2.updateClassExpression( node, - decorators, + modifiers, node.name, /*typeParameters*/ void 0, visitNodes2(node.heritageClauses, visitor, isHeritageClause), - isClassLikeDeclarationWithTypeScriptSyntax(node) ? transformClassMembers(node) : visitNodes2(node.members, getClassElementVisitor(node), isClassElement) + transformClassMembers(node) ); } function transformClassMembers(node) { - const members = []; + const members = visitNodes2(node.members, getClassElementVisitor(node), isClassElement); + let newMembers; const constructor = getFirstConstructorWithBody(node); const parametersWithPropertyAssignments = constructor && filter(constructor.parameters, (p) => isParameterPropertyDeclaration(p, constructor)); if (parametersWithPropertyAssignments) { for (const parameter of parametersWithPropertyAssignments) { - if (isIdentifier(parameter.name)) { - members.push(setOriginalNode(factory2.createPropertyDeclaration( - /*modifiers*/ - void 0, - parameter.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ), parameter)); - } + const parameterProperty = factory2.createPropertyDeclaration( + /*modifiers*/ + void 0, + parameter.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + setOriginalNode(parameterProperty, parameter); + newMembers = append(newMembers, parameterProperty); } } - addRange(members, visitNodes2(node.members, getClassElementVisitor(node), isClassElement)); - return setTextRange( - factory2.createNodeArray(members), - /*location*/ - node.members - ); + if (newMembers) { + newMembers = addRange(newMembers, members); + return setTextRange( + factory2.createNodeArray(newMembers), + /*location*/ + node.members + ); + } + return members; } - function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { - var _a2, _b, _c, _d; - if (!allDecorators) { - return void 0; + function injectClassTypeMetadata(modifiers, node) { + const metadata = getTypeMetadata(node, node); + if (some(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, takeWhile(modifiers, isExportOrDefaultModifier)); + addRange(modifiersArray, filter(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter(skipWhile(modifiers, isExportOrDefaultModifier), isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); } - const decorators = visitArray(allDecorators.decorators, visitor, isDecorator); - const parameterDecorators = flatMap(allDecorators.parameters, transformDecoratorsOfParameter); - const metadataDecorators = some(decorators) || some(parameterDecorators) ? getTypeMetadata(node, container) : void 0; - const result = factory2.createNodeArray(concatenate(concatenate(decorators, parameterDecorators), metadataDecorators)); - const pos = (_b = (_a2 = firstOrUndefined(allDecorators.decorators)) == null ? void 0 : _a2.pos) != null ? _b : -1; - const end = (_d = (_c = lastOrUndefined(allDecorators.decorators)) == null ? void 0 : _c.end) != null ? _d : -1; - setTextRangePosEnd(result, pos, end); - return result; + return modifiers; } - function transformDecoratorsOfParameter(parameterDecorators, parameterOffset) { - if (parameterDecorators) { - const decorators = []; - for (const parameterDecorator of parameterDecorators) { - const expression = visitNode(parameterDecorator.expression, visitor, isExpression); - const helper = emitHelpers().createParamHelper(expression, parameterOffset); - setTextRange(helper, parameterDecorator.expression); - setEmitFlags(helper, 3072 /* NoComments */); - const decorator = factory2.createDecorator(helper); - setSourceMapRange(decorator, parameterDecorator.expression); - setCommentRange(decorator, parameterDecorator.expression); - setEmitFlags(decorator, 3072 /* NoComments */); - decorators.push(decorator); + function injectClassElementTypeMetadata(modifiers, node, container) { + if (isClassLike(container) && classElementOrClassElementParameterIsDecorated(legacyDecorators, node, container)) { + const metadata = getTypeMetadata(node, container); + if (some(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, filter(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter(modifiers, isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); } - return decorators; } + return modifiers; } function getTypeMetadata(node, container) { + if (!legacyDecorators) + return void 0; return USE_NEW_TYPE_METADATA_FORMAT ? getNewTypeMetadata(node, container) : getOldTypeMetadata(node, container); } function getOldTypeMetadata(node, container) { @@ -86867,8 +88091,9 @@ ${lanes.join("\n")} } function visitPropertyNameOfClassElement(member) { const name = member.name; - if (isComputedPropertyName(name) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member))) { + if (isComputedPropertyName(name) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member) && legacyDecorators)) { const expression = visitNode(name.expression, visitor, isExpression); + Debug.assert(expression); const innerExpression = skipPartiallyEmittedExpressions(expression); if (!isSimpleInlineableExpression(innerExpression)) { const generatedName = factory2.getGeneratedNameForNode(name); @@ -86876,7 +88101,7 @@ ${lanes.join("\n")} return factory2.updateComputedPropertyName(name, factory2.createAssignment(generatedName, expression)); } } - return visitNode(name, visitor, isPropertyName); + return Debug.checkDefined(visitNode(name, visitor, isPropertyName)); } function visitHeritageClause(node) { if (node.token === 117 /* ImplementsKeyword */) { @@ -86887,7 +88112,7 @@ ${lanes.join("\n")} function visitExpressionWithTypeArguments(node) { return factory2.updateExpressionWithTypeArguments( node, - visitNode(node.expression, visitor, isLeftHandSideExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression)), /*typeArguments*/ void 0 ); @@ -86897,16 +88122,16 @@ ${lanes.join("\n")} } function visitPropertyDeclaration(node, parent2) { const isAmbient = node.flags & 16777216 /* Ambient */ || hasSyntacticModifier(node, 256 /* Abstract */); - if (isAmbient && !hasDecorators(node)) { + if (isAmbient && !(legacyDecorators && hasDecorators(node))) { return void 0; } - const allDecorators = getAllDecoratorsOfClassElement(node, parent2); - const decorators = transformAllDecoratorsOfDeclaration(node, parent2, allDecorators); + let modifiers = isClassLike(parent2) ? !isAmbient ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); if (isAmbient) { return factory2.updatePropertyDeclaration( node, - concatenate(decorators, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), - visitNode(node.name, visitor, isPropertyName), + concatenate(modifiers, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, /*type*/ @@ -86917,13 +88142,13 @@ ${lanes.join("\n")} } return factory2.updatePropertyDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), /*questionOrExclamationToken*/ void 0, /*type*/ void 0, - visitNode(node.initializer, visitor) + visitNode(node.initializer, visitor, isExpression) ); } function visitConstructor(node) { @@ -87024,11 +88249,11 @@ ${lanes.join("\n")} if (!shouldEmitFunctionLikeDeclaration(node)) { return void 0; } - const allDecorators = isClassLike(parent2) ? getAllDecoratorsOfClassElement(node, parent2) : void 0; - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, allDecorators) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateMethodDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, node.asteriskToken, visitPropertyNameOfClassElement(node), /*questionToken*/ @@ -87051,10 +88276,11 @@ ${lanes.join("\n")} if (!shouldEmitAccessorDeclaration(node)) { return void 0; } - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, getAllDecoratorsOfClassElement(node, parent2)) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateGetAccessorDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), visitParameterList(node.parameters, visitor, context), /*type*/ @@ -87069,10 +88295,11 @@ ${lanes.join("\n")} if (!shouldEmitAccessorDeclaration(node)) { return void 0; } - const decorators = isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, getAllDecoratorsOfClassElement(node, parent2)) : void 0; + let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); return factory2.updateSetAccessorDeclaration( node, - concatenate(decorators, visitNodes2(node.modifiers, modifierVisitor, isModifierLike)), + modifiers, visitPropertyNameOfClassElement(node), visitParameterList(node.parameters, visitor, context), visitFunctionBody(node.body, visitor, context) || factory2.createBlock([]) @@ -87139,10 +88366,9 @@ ${lanes.join("\n")} } const updated = factory2.updateParameterDeclaration( node, - elideNodes(factory2, node.modifiers), - // preserve positions, if available + visitNodes2(node.modifiers, (node2) => isDecorator(node2) ? visitor(node2) : void 0, isModifierLike), node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*questionToken*/ void 0, /*type*/ @@ -87191,7 +88417,7 @@ ${lanes.join("\n")} return setTextRange( factory2.createAssignment( getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), - visitNode(node.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) ), /*location*/ node @@ -87201,7 +88427,7 @@ ${lanes.join("\n")} function visitVariableDeclaration(node) { const updated = factory2.updateVariableDeclaration( node, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*exclamationToken*/ void 0, /*type*/ @@ -87217,26 +88443,30 @@ ${lanes.join("\n")} const innerExpression = skipOuterExpressions(node.expression, ~6 /* Assertions */); if (isAssertionExpression(innerExpression)) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } return visitEachChild(node, visitor, context); } function visitAssertionExpression(node) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitNonNullExpression(node) { const expression = visitNode(node.expression, visitor, isLeftHandSideExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitSatisfiesExpression(node) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); return factory2.createPartiallyEmittedExpression(expression, node); } function visitCallExpression(node) { return factory2.updateCallExpression( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -87245,7 +88475,7 @@ ${lanes.join("\n")} function visitNewExpression(node) { return factory2.updateNewExpression( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -87254,28 +88484,28 @@ ${lanes.join("\n")} function visitTaggedTemplateExpression(node) { return factory2.updateTaggedTemplateExpression( node, - visitNode(node.tag, visitor, isExpression), + Debug.checkDefined(visitNode(node.tag, visitor, isExpression)), /*typeArguments*/ void 0, - visitNode(node.template, visitor, isExpression) + Debug.checkDefined(visitNode(node.template, visitor, isTemplateLiteral)) ); } function visitJsxSelfClosingElement(node) { return factory2.updateJsxSelfClosingElement( node, - visitNode(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), /*typeArguments*/ void 0, - visitNode(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) ); } function visitJsxJsxOpeningElement(node) { return factory2.updateJsxOpeningElement( node, - visitNode(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), /*typeArguments*/ void 0, - visitNode(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) ); } function shouldEmitEnumDeclaration(node) { @@ -87421,7 +88651,7 @@ ${lanes.join("\n")} } else { enableSubstitutionForNonQualifiedEnumMembers(); if (member.initializer) { - return visitNode(member.initializer, visitor, isExpression); + return Debug.checkDefined(visitNode(member.initializer, visitor, isExpression)); } else { return factory2.createVoidZero(); } @@ -87663,7 +88893,7 @@ ${lanes.join("\n")} if (node.kind === 271 /* NamespaceImport */) { return shouldEmitAliasDeclaration(node) ? node : void 0; } else { - const allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); + const allowEmpty = compilerOptions.verbatimModuleSyntax || compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); const elements = visitNodes2(node.elements, visitImportSpecifier, isImportSpecifier); return allowEmpty || some(elements) ? factory2.updateNamedImports(node, elements) : void 0; } @@ -87672,7 +88902,7 @@ ${lanes.join("\n")} return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : void 0; } function visitExportAssignment(node) { - return resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; + return compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; } function visitExportDeclaration(node) { if (node.isTypeOnly) { @@ -87681,7 +88911,7 @@ ${lanes.join("\n")} if (!node.exportClause || isNamespaceExport(node.exportClause)) { return node; } - const allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); + const allowEmpty = compilerOptions.verbatimModuleSyntax || !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); const exportClause = visitNode( node.exportClause, (bindings) => visitNamedExportBindings(bindings, allowEmpty), @@ -87702,13 +88932,13 @@ ${lanes.join("\n")} return allowEmpty || some(elements) ? factory2.updateNamedExports(node, elements) : void 0; } function visitNamespaceExports(node) { - return factory2.updateNamespaceExport(node, visitNode(node.name, visitor, isIdentifier)); + return factory2.updateNamespaceExport(node, Debug.checkDefined(visitNode(node.name, visitor, isIdentifier))); } function visitNamedExportBindings(node, allowEmpty) { return isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty); } function visitExportSpecifier(node) { - return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : void 0; + return !node.isTypeOnly && (compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node)) ? node : void 0; } function shouldEmitImportEqualsDeclaration(node) { return shouldEmitAliasDeclaration(node) || !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node); @@ -87768,7 +88998,7 @@ ${lanes.join("\n")} ); } else { return setOriginalNode( - createNamespaceExport2( + createNamespaceExport( node.name, moduleReference, node @@ -87789,7 +89019,7 @@ ${lanes.join("\n")} function isDefaultExternalModuleExport(node) { return isExternalModuleExport(node) && hasSyntacticModifier(node, 1024 /* Default */); } - function addExportMemberAssignment(statements, node) { + function createExportMemberAssignmentStatement(node) { const expression = factory2.createAssignment( factory2.getExternalModuleOrNamespaceExportName( currentNamespaceContainerName, @@ -87804,9 +89034,12 @@ ${lanes.join("\n")} setSourceMapRange(expression, createRange(node.name ? node.name.pos : node.pos, node.end)); const statement = factory2.createExpressionStatement(expression); setSourceMapRange(statement, createRange(-1, node.end)); - statements.push(statement); + return statement; } - function createNamespaceExport2(exportName, exportValue, location) { + function addExportMemberAssignment(statements, node) { + statements.push(createExportMemberAssignmentStatement(node)); + } + function createNamespaceExport(exportName, exportValue, location) { return setTextRange( factory2.createExpressionStatement( factory2.createAssignment( @@ -87967,7 +89200,7 @@ ${lanes.join("\n")} return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; } function shouldEmitAliasDeclaration(node) { - return isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); + return compilerOptions.verbatimModuleSyntax || isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); } } var USE_NEW_TYPE_METADATA_FORMAT; @@ -87983,6 +89216,7 @@ ${lanes.join("\n")} function transformClassFields(context) { const { factory: factory2, + getEmitHelperFactory: emitHelpers, hoistVariableDeclaration, endLexicalEnvironment, startLexicalEnvironment, @@ -87993,6 +89227,7 @@ ${lanes.join("\n")} const compilerOptions = context.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; const shouldTransformInitializersUsingSet = !useDefineForClassFields; const shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9 /* ES2022 */; const shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine; @@ -88005,42 +89240,69 @@ ${lanes.join("\n")} context.onSubstituteNode = onSubstituteNode; const previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; + let shouldTransformPrivateStaticElementsInFile = false; let enabledSubstitutions; let classAliases; let pendingExpressions; let pendingStatements; - const classLexicalEnvironmentStack = []; - const classLexicalEnvironmentMap = /* @__PURE__ */ new Map(); - let currentClassLexicalEnvironment; + let lexicalEnvironment; + const lexicalEnvironmentMap = /* @__PURE__ */ new Map(); let currentClassContainer; - let currentComputedPropertyNameClassLexicalEnvironment; let currentStaticPropertyDeclarationOrStaticBlock; + let shouldSubstituteThisWithClassThis = false; + let previousShouldSubstituteThisWithClassThis = false; return chainBundle(context, transformSourceFile); function transformSourceFile(node) { - if (node.isDeclarationFile || !shouldTransformAnything) { + if (node.isDeclarationFile) { + return node; + } + lexicalEnvironment = void 0; + shouldTransformPrivateStaticElementsInFile = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); + if (!shouldTransformAnything && !shouldTransformPrivateStaticElementsInFile) { return node; } const visited = visitEachChild(node, visitor, context); addEmitHelpers(visited, context.readEmitHelpers()); return visited; } + function modifierVisitor(node) { + switch (node.kind) { + case 127 /* AccessorKeyword */: + return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + default: + return tryCast(node, isModifier); + } + } function visitor(node) { if (!(node.transformFlags & 16777216 /* ContainsClassFields */) && !(node.transformFlags & 134234112 /* ContainsLexicalThisOrSuper */)) { return node; } switch (node.kind) { case 127 /* AccessorKeyword */: - return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + return Debug.fail("Use `modifierVisitor` instead."); case 260 /* ClassDeclaration */: return visitClassDeclaration(node); case 228 /* ClassExpression */: - return visitClassExpression(node); + return visitClassExpression( + node, + /*referencedName*/ + void 0 + ); case 172 /* ClassStaticBlockDeclaration */: - return visitClassStaticBlockDeclaration(node); case 169 /* PropertyDeclaration */: - return visitPropertyDeclaration(node); + return Debug.fail("Use `classElementVisitor` instead."); + case 299 /* PropertyAssignment */: + return visitPropertyAssignment(node); case 240 /* VariableStatement */: return visitVariableStatement(node); + case 257 /* VariableDeclaration */: + return visitVariableDeclaration(node); + case 166 /* Parameter */: + return visitParameterDeclaration(node); + case 205 /* BindingElement */: + return visitBindingElement(node); + case 274 /* ExportAssignment */: + return visitExportAssignment(node); case 80 /* PrivateIdentifier */: return visitPrivateIdentifier(node); case 208 /* PropertyAccessExpression */: @@ -88051,15 +89313,23 @@ ${lanes.join("\n")} case 222 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ false ); case 223 /* BinaryExpression */: return visitBinaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ false ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); case 210 /* CallExpression */: return visitCallExpression(node); case 241 /* ExpressionStatement */: @@ -88088,21 +89358,57 @@ ${lanes.join("\n")} function fallbackVisitor(node) { return visitEachChild(node, visitor, context); } + function namedEvaluationVisitor(node, referencedName) { + switch (node.kind) { + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 228 /* ClassExpression */: + return visitClassExpression(node, referencedName); + default: + return visitor(node); + } + } function discardedValueVisitor(node) { switch (node.kind) { case 221 /* PrefixUnaryExpression */: case 222 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ true ); case 223 /* BinaryExpression */: return visitBinaryExpression( node, - /*valueIsDiscarded*/ + /*discarded*/ + true + ); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ true ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + true, + /*referencedName*/ + void 0 + ); default: return visitor(node); } @@ -88146,10 +89452,20 @@ ${lanes.join("\n")} visitPropertyDeclaration, node ); + case 172 /* ClassStaticBlockDeclaration */: + return visitClassStaticBlockDeclaration(node); case 164 /* ComputedPropertyName */: return visitComputedPropertyName(node); case 237 /* SemicolonClassElement */: return node; + default: + return isModifierLike(node) ? modifierVisitor(node) : visitor(node); + } + } + function propertyNameVisitor(node) { + switch (node.kind) { + case 164 /* ComputedPropertyName */: + return visitComputedPropertyName(node); default: return visitor(node); } @@ -88175,20 +89491,25 @@ ${lanes.join("\n")} } return setOriginalNode(factory2.createIdentifier(""), node); } - function isPrivateIdentifierInExpression(node) { - return isPrivateIdentifier(node.left) && node.operatorToken.kind === 101 /* InKeyword */; - } function transformPrivateIdentifierInInExpression(node) { - const info = accessPrivateIdentifier(node.left); + const info = accessPrivateIdentifier2(node.left); if (info) { const receiver = visitNode(node.right, visitor, isExpression); return setOriginalNode( - context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), + emitHelpers().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node ); } return visitEachChild(node, visitor, context); } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updatePropertyAssignment(node, name, initializer); + } + return visitEachChild(node, visitor, context); + } function visitVariableStatement(node) { const savedPendingStatements = pendingStatements; pendingStatements = []; @@ -88197,17 +89518,90 @@ ${lanes.join("\n")} pendingStatements = savedPendingStatements; return statement; } - function visitComputedPropertyName(node) { - let expression = visitNode(node.expression, visitor, isExpression); + function getAssignedNameOfIdentifier(name, initializer) { + const originalClass = getOriginalNode(initializer, isClassLike); + return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateVariableDeclaration( + node, + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitParameterDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const propertyName = visitNode(node.propertyName, visitor, isPropertyName); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBindingElement( + node, + /*dotDotDotToken*/ + void 0, + propertyName, + name, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateExportAssignment(node, modifiers, expression); + } + return visitEachChild(node, visitor, context); + } + function injectPendingExpressions(expression) { if (some(pendingExpressions)) { if (isParenthesizedExpression(expression)) { - expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions([...pendingExpressions, expression.expression])); + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); } else { - expression = factory2.inlineExpressions([...pendingExpressions, expression]); + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); } pendingExpressions = void 0; } - return factory2.updateComputedPropertyName(node, expression); + return expression; + } + function visitComputedPropertyName(node) { + const expression = visitNode(node.expression, visitor, isExpression); + return factory2.updateComputedPropertyName(node, injectPendingExpressions(expression)); } function visitConstructorDeclaration(node) { if (currentClassContainer) { @@ -88215,12 +89609,19 @@ ${lanes.join("\n")} } return fallbackVisitor(node); } + function shouldTransformClassElementToWeakMap(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) + return true; + if (hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) + return true; + return false; + } function visitMethodOrAccessorDeclaration(node) { Debug.assert(!hasDecorators(node)); - if (!shouldTransformPrivateElementsOrClassStaticBlocks || !isPrivateIdentifier(node.name)) { + if (!isPrivateIdentifierClassElementDeclaration(node) || !shouldTransformClassElementToWeakMap(node)) { return visitEachChild(node, classElementVisitor, context); } - const info = accessPrivateIdentifier(node.name); + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); if (!info.isValid) { return node; @@ -88255,7 +89656,7 @@ ${lanes.join("\n")} } function getHoistedFunctionName(node) { Debug.assert(isPrivateIdentifier(node.name)); - const info = accessPrivateIdentifier(node.name); + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); if (info.kind === "m" /* Method */) { return info.methodName; @@ -88270,42 +89671,61 @@ ${lanes.join("\n")} } } function transformAutoAccessor(node) { - Debug.assertEachNode(node.modifiers, isModifier); const commentRange = getCommentRange(node); const sourceMapRange = getSourceMapRange(node); const name = node.name; let getterName = name; let setterName = name; if (isComputedPropertyName(name) && !isSimpleInlineableExpression(name.expression)) { - const temp = factory2.createTempVariable(hoistVariableDeclaration); - setSourceMapRange(temp, name.expression); - const expression = visitNode(name.expression, visitor, isExpression); - const assignment = factory2.createAssignment(temp, expression); - setSourceMapRange(assignment, name.expression); - getterName = factory2.updateComputedPropertyName(name, factory2.inlineExpressions([assignment, temp])); - setterName = factory2.updateComputedPropertyName(name, temp); + const cacheAssignment = findComputedPropertyNameCacheAssignment(name); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name, visitNode(name.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name.expression); + const expression = visitNode(name.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name.expression); + getterName = factory2.updateComputedPropertyName(name, assignment); + setterName = factory2.updateComputedPropertyName(name, temp); + } } - const backingField = createAccessorPropertyBackingField(factory2, node, node.modifiers, node.initializer); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiers, node.initializer); setOriginalNode(backingField, node); setEmitFlags(backingField, 3072 /* NoComments */); setSourceMapRange(backingField, sourceMapRange); - const getter = createAccessorPropertyGetRedirector(factory2, node, node.modifiers, getterName); + const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName); setOriginalNode(getter, node); setCommentRange(getter, commentRange); setSourceMapRange(getter, sourceMapRange); - const setter = createAccessorPropertySetRedirector(factory2, node, node.modifiers, setterName); + const setter = createAccessorPropertySetRedirector(factory2, node, modifiers, setterName); setOriginalNode(setter, node); setEmitFlags(setter, 3072 /* NoComments */); setSourceMapRange(setter, sourceMapRange); return visitArray([backingField, getter, setter], accessorFieldResultVisitor, isClassElement); } function transformPrivateFieldInitializer(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { - const info = accessPrivateIdentifier(node.name); + if (shouldTransformClassElementToWeakMap(node)) { + const info = accessPrivateIdentifier2(node.name); Debug.assert(info, "Undeclared private name for property declaration."); - return info.isValid ? void 0 : node; + if (!info.isValid) { + return node; + } + if (info.isStatic && !shouldTransformPrivateElementsOrClassStaticBlocks) { + const statement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); + if (statement) { + return factory2.createClassStaticBlockDeclaration(factory2.createBlock( + [statement], + /*multiLine*/ + true + )); + } + } + return void 0; } - if (shouldTransformInitializersUsingSet && !isStatic(node) && currentClassLexicalEnvironment && currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */) { + if (shouldTransformInitializersUsingSet && !isStatic(node) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */) { return factory2.updatePropertyDeclaration( node, visitNodes2(node.modifiers, visitor, isModifierLike), @@ -88318,6 +89738,19 @@ ${lanes.join("\n")} void 0 ); } + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) + ); + } return visitEachChild(node, visitor, context); } function transformPublicFieldInitializer(node) { @@ -88325,10 +89758,12 @@ ${lanes.join("\n")} const expr = getPropertyNameExpressionIfNeeded( node.name, /*shouldHoist*/ - !!node.initializer || useDefineForClassFields + !!node.initializer || useDefineForClassFields, + /*captureReferencedName*/ + isNamedEvaluation(node, isAnonymousClassNeedingAssignedName) ); if (expr) { - getPendingExpressions().push(expr); + getPendingExpressions().push(...flattenCommaList(expr)); } if (isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks) { const initializerStatement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); @@ -88346,17 +89781,26 @@ ${lanes.join("\n")} } return void 0; } - return visitEachChild(node, classElementVisitor, context); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); } function transformFieldInitializer(node) { Debug.assert(!hasDecorators(node), "Decorators should already have been transformed and elided."); return isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node); } function shouldTransformAutoAccessorsInCurrentClass() { - return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!currentClassLexicalEnvironment && !!(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */); + return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !!(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */); } function visitPropertyDeclaration(node) { - if (shouldTransformAutoAccessorsInCurrentClass() && isAutoAccessorPropertyDeclaration(node)) { + if (isAutoAccessorPropertyDeclaration(node) && (shouldTransformAutoAccessorsInCurrentClass() || hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */)) { return transformAutoAccessor(node); } return transformFieldInitializer(node); @@ -88368,33 +89812,35 @@ ${lanes.join("\n")} setCommentRange(receiver, moveRangePos(receiver, -1)); switch (info.kind) { case "a" /* Accessor */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, info.getterName ); case "m" /* Method */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, info.methodName ); case "f" /* Field */: - return context.getEmitHelperFactory().createClassPrivateFieldGetHelper( + return emitHelpers().createClassPrivateFieldGetHelper( receiver, info.brandCheckIdentifier, info.kind, - info.variableName + info.isStatic ? info.variableName : void 0 ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); default: Debug.assertNever(info, "Unknown private element type"); } } function visitPropertyAccessExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(node.name)) { - const privateIdentifierInfo = accessPrivateIdentifier(node.name); + if (isPrivateIdentifier(node.name)) { + const privateIdentifierInfo = accessPrivateIdentifier2(node.name); if (privateIdentifierInfo) { return setTextRange( setOriginalNode( @@ -88405,8 +89851,8 @@ ${lanes.join("\n")} ); } } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); } @@ -88424,8 +89870,8 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitElementAccessExpression(node) { - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); } @@ -88442,16 +89888,16 @@ ${lanes.join("\n")} } return visitEachChild(node, visitor, context); } - function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) { + function visitPreOrPostfixUnaryExpression(node, discarded) { if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { const operand = skipParentheses(node.operand); - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(operand)) { + if (isPrivateIdentifierPropertyAccessExpression(operand)) { let info; - if (info = accessPrivateIdentifier(operand.name)) { + if (info = accessPrivateIdentifier2(operand.name)) { const receiver = visitNode(operand.expression, visitor, isExpression); const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver); let expression = createPrivateIdentifierAccess(info, readExpression); - const temp = isPrefixUnaryExpression(node) || valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = isPrefixUnaryExpression(node) || discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); expression = createPrivateIdentifierAssignment( info, @@ -88467,8 +89913,8 @@ ${lanes.join("\n")} } return expression; } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { const expression = visitInvalidSuperProperty(operand); return isPrefixUnaryExpression(node) ? factory2.updatePrefixUnaryExpression(node, expression) : factory2.updatePostfixUnaryExpression(node, expression); @@ -88491,7 +89937,7 @@ ${lanes.join("\n")} if (setterName && getterName) { let expression = factory2.createReflectGetCall(superClassReference, getterName, classConstructor); setTextRange(expression, operand); - const temp = valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); expression = factory2.createReflectSetCall(superClassReference, setterName, expression, classConstructor); setOriginalNode(expression, node); @@ -88532,12 +89978,13 @@ ${lanes.join("\n")} return { readExpression, initializeExpression }; } function visitCallExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.expression)) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.expression) && accessPrivateIdentifier2(node.expression.name)) { const { thisArg, target } = factory2.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion); if (isCallChain(node)) { return factory2.updateCallChain( node, - factory2.createPropertyAccessChain(visitNode(target, visitor), node.questionDotToken, "call"), + factory2.createPropertyAccessChain(visitNode(target, visitor, isExpression), node.questionDotToken, "call"), /*questionDotToken*/ void 0, /*typeArguments*/ @@ -88547,16 +89994,16 @@ ${lanes.join("\n")} } return factory2.updateCallExpression( node, - factory2.createPropertyAccessExpression(visitNode(target, visitor), "call"), + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "call"), /*typeArguments*/ void 0, [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { const invocation = factory2.createFunctionCallCall( visitNode(node.expression, visitor, isExpression), - currentClassLexicalEnvironment.classConstructor, + lexicalEnvironment.data.classConstructor, visitNodes2(node.arguments, visitor, isExpression) ); setOriginalNode(invocation, node); @@ -88566,12 +90013,13 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitTaggedTemplateExpression(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.tag)) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.tag) && accessPrivateIdentifier2(node.tag.name)) { const { thisArg, target } = factory2.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion); return factory2.updateTaggedTemplateExpression( node, factory2.createCallExpression( - factory2.createPropertyAccessExpression(visitNode(target, visitor), "bind"), + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "bind"), /*typeArguments*/ void 0, [visitNode(thisArg, visitor, isExpression)] @@ -88581,10 +90029,10 @@ ${lanes.join("\n")} visitNode(node.template, visitor, isTemplateLiteral) ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { const invocation = factory2.createFunctionBindCall( visitNode(node.tag, visitor, isExpression), - currentClassLexicalEnvironment.classConstructor, + lexicalEnvironment.data.classConstructor, [] ); setOriginalNode(invocation, node); @@ -88600,10 +90048,10 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function transformClassStaticBlockDeclaration(node) { + if (lexicalEnvironment) { + lexicalEnvironmentMap.set(getOriginalNode(node), lexicalEnvironment); + } if (shouldTransformPrivateElementsOrClassStaticBlocks) { - if (currentClassLexicalEnvironment) { - classLexicalEnvironmentMap.set(getOriginalNodeId(node), currentClassLexicalEnvironment); - } startLexicalEnvironment(); let statements = setCurrentStaticPropertyDeclarationOrStaticBlockAnd( node, @@ -88618,23 +90066,45 @@ ${lanes.join("\n")} return iife; } } - function visitBinaryExpression(node, valueIsDiscarded) { + function isAnonymousClassNeedingAssignedName(node) { + if (isClassExpression(node) && !node.name) { + const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); + const classStaticBlock = find(staticPropertiesOrClassStaticBlocks, isClassStaticBlockDeclaration); + if (classStaticBlock) { + for (const statement of classStaticBlock.body.statements) { + if (isExpressionStatement(statement) && isCallToHelper(statement.expression, "___setFunctionName")) { + return false; + } + } + } + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || !!(getInternalEmitFlags(node) && 32 /* TransformPrivateStaticElements */)) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + return hasTransformableStatics; + } + return false; + } + function visitBinaryExpression(node, discarded) { if (isDestructuringAssignment(node)) { const savedPendingExpressions = pendingExpressions; pendingExpressions = void 0; node = factory2.updateBinaryExpression( node, - visitNode(node.left, assignmentTargetVisitor), + visitNode(node.left, assignmentTargetVisitor, isExpression), node.operatorToken, - visitNode(node.right, visitor) + visitNode(node.right, visitor, isExpression) ); const expr = some(pendingExpressions) ? factory2.inlineExpressions(compact([...pendingExpressions, node])) : node; pendingExpressions = savedPendingExpressions; return expr; } if (isAssignmentExpression(node)) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.left)) { - const info = accessPrivateIdentifier(node.left.name); + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isPrivateIdentifierPropertyAccessExpression(node.left)) { + const info = accessPrivateIdentifier2(node.left.name); if (info) { return setTextRange( setOriginalNode( @@ -88644,8 +90114,8 @@ ${lanes.join("\n")} node ); } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return factory2.updateBinaryExpression( node, @@ -88678,7 +90148,7 @@ ${lanes.join("\n")} ); setTextRange(expression, node); } - const temp = valueIsDiscarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); if (temp) { expression = factory2.createAssignment(temp, expression); setTextRange(temp, node); @@ -88700,11 +90170,42 @@ ${lanes.join("\n")} } } } - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierInExpression(node)) { + if (isPrivateIdentifierInExpression(node)) { return transformPrivateIdentifierInInExpression(node); } return visitEachChild(node, visitor, context); } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitParenthesizedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function visitPartiallyEmittedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + const referencedName = factory2.createTempVariable(hoistVariableDeclaration); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name }; + } function createPrivateIdentifierAssignment(info, receiver, right, operator) { receiver = visitNode(receiver, visitor, isExpression); right = visitNode(right, visitor, isExpression); @@ -88720,7 +90221,7 @@ ${lanes.join("\n")} setCommentRange(receiver, moveRangePos(receiver, -1)); switch (info.kind) { case "a" /* Accessor */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, @@ -88728,7 +90229,7 @@ ${lanes.join("\n")} info.setterName ); case "m" /* Method */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, @@ -88737,13 +90238,15 @@ ${lanes.join("\n")} void 0 ); case "f" /* Field */: - return context.getEmitHelperFactory().createClassPrivateFieldSetHelper( + return emitHelpers().createClassPrivateFieldSetHelper( receiver, info.brandCheckIdentifier, right, info.kind, - info.variableName + info.isStatic ? info.variableName : void 0 ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); default: Debug.assertNever(info, "Unknown private element type"); } @@ -88754,7 +90257,7 @@ ${lanes.join("\n")} function getClassFacts(node) { let facts = 0 /* None */; const original = getOriginalNode(node); - if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(original)) { + if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) { facts |= 1 /* ClassWasDecorated */; } let containsPublicInstanceFields = false; @@ -88798,7 +90301,8 @@ ${lanes.join("\n")} return facts; } function visitExpressionWithTypeArgumentsInHeritageClause(node) { - const facts = (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts) || 0 /* None */; + var _a2; + const facts = ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts) || 0 /* None */; if (facts & 4 /* NeedsClassSuperReference */) { const temp = factory2.createTempVariable( hoistVariableDeclaration, @@ -88818,20 +90322,24 @@ ${lanes.join("\n")} } return visitEachChild(node, visitor, context); } - function visitInNewClassLexicalEnvironment(node, visitor2) { + function visitInNewClassLexicalEnvironment(node, referencedName, visitor2) { const savedCurrentClassContainer = currentClassContainer; const savedPendingExpressions = pendingExpressions; + const savedLexicalEnvironment = lexicalEnvironment; currentClassContainer = node; pendingExpressions = void 0; startClassLexicalEnvironment(); - if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const shouldAlwaysTransformPrivateStaticElements = getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */; + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldAlwaysTransformPrivateStaticElements) { const name = getNameOfDeclaration(node); if (name && isIdentifier(name)) { - getPrivateIdentifierEnvironment().className = name; + getPrivateIdentifierEnvironment().data.className = name; } + } + if (shouldTransformPrivateElementsOrClassStaticBlocks) { const privateInstanceMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); if (some(privateInstanceMethodsAndAccessors)) { - getPrivateIdentifierEnvironment().weakSetName = createHoistedVariableForClass( + getPrivateIdentifierEnvironment().data.weakSetName = createHoistedVariableForClass( "instances", privateInstanceMethodsAndAccessors[0].name ); @@ -88844,27 +90352,42 @@ ${lanes.join("\n")} if (facts & 8 /* NeedsSubstitutionForThisInClassStaticField */) { enableSubstitutionForClassStaticThisOrSuperReference(); } - const result = visitor2(node, facts); + const result = visitor2(node, facts, referencedName); endClassLexicalEnvironment(); + Debug.assert(lexicalEnvironment === savedLexicalEnvironment); currentClassContainer = savedCurrentClassContainer; pendingExpressions = savedPendingExpressions; return result; } function visitClassDeclaration(node) { - return visitInNewClassLexicalEnvironment(node, visitClassDeclarationInNewClassLexicalEnvironment); + return visitInNewClassLexicalEnvironment( + node, + /*referencedName*/ + void 0, + visitClassDeclarationInNewClassLexicalEnvironment + ); } function visitClassDeclarationInNewClassLexicalEnvironment(node, facts) { + var _a2, _b; let pendingClassReferenceAssignment; if (facts & 2 /* NeedsClassConstructorReference */) { - const temp = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); - pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) { + getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + pendingClassReferenceAssignment = factory2.createAssignment(node.emitNode.classThis, factory2.getInternalName(node)); + } else { + const temp = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + } + if ((_b = node.emitNode) == null ? void 0 : _b.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; + } } - const modifiers = visitNodes2(node.modifiers, visitor, isModifierLike); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); const classDecl = factory2.updateClassDeclaration( @@ -88887,7 +90410,7 @@ ${lanes.join("\n")} if (some(pendingExpressions)) { statements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); } - if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks) { + if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) { const staticProperties = getStaticPropertiesAndClassStaticBlock(node); if (some(staticProperties)) { addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory2.getInternalName(node)); @@ -88895,28 +90418,37 @@ ${lanes.join("\n")} } return statements; } - function visitClassExpression(node) { - return visitInNewClassLexicalEnvironment(node, visitClassExpressionInNewClassLexicalEnvironment); + function visitClassExpression(node, referencedName) { + return visitInNewClassLexicalEnvironment(node, referencedName, visitClassExpressionInNewClassLexicalEnvironment); } - function visitClassExpressionInNewClassLexicalEnvironment(node, facts) { + function visitClassExpressionInNewClassLexicalEnvironment(node, facts, referencedName) { + var _a2, _b, _c, _d, _e, _f; const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */); const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */; let temp; function createClassTempVar() { + var _a3; + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a3 = node.emitNode) == null ? void 0 : _a3.classThis)) { + return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + } const classCheckFlags = resolver.getNodeCheckFlags(node); const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */; const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */; - return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2); + return temp2; + } + if ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; } if (facts & 2 /* NeedsClassConstructorReference */) { - temp = createClassTempVar(); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + temp != null ? temp : temp = createClassTempVar(); } - const modifiers = visitNodes2(node.modifiers, visitor, isModifierLike); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); - const classExpression = factory2.updateClassExpression( + let classExpression = factory2.updateClassExpression( node, modifiers, node.name, @@ -88929,46 +90461,68 @@ ${lanes.join("\n")} if (prologue) { expressions.push(prologue); } - const hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); - if (hasTransformableStatics || some(pendingExpressions)) { + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + if (hasTransformableStatics || some(pendingExpressions) || referencedName) { if (isDecoratedClassDeclaration) { Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration."); - if (pendingStatements && pendingExpressions && some(pendingExpressions)) { - pendingStatements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); + if (some(pendingExpressions)) { + addRange(pendingStatements, map(pendingExpressions, factory2.createExpressionStatement)); + } + if (referencedName) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const setNameExpression = emitHelpers().createSetFunctionNameHelper((_c = temp != null ? temp : (_b = node.emitNode) == null ? void 0 : _b.classThis) != null ? _c : factory2.getInternalName(node), referencedName); + pendingStatements.push(factory2.createExpressionStatement(setNameExpression)); + } else { + const setNameExpression = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), referencedName); + classExpression = factory2.updateClassExpression( + classExpression, + classExpression.modifiers, + classExpression.name, + classExpression.typeParameters, + classExpression.heritageClauses, + [ + factory2.createClassStaticBlockDeclaration( + factory2.createBlock([ + factory2.createExpressionStatement(setNameExpression) + ]) + ), + ...classExpression.members + ] + ); + } } - if (pendingStatements && some(staticPropertiesOrClassStaticBlocks)) { - addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, factory2.getInternalName(node)); + if (some(staticPropertiesOrClassStaticBlocks)) { + addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, (_e = (_d = node.emitNode) == null ? void 0 : _d.classThis) != null ? _e : factory2.getInternalName(node)); } if (temp) { - expressions.push( - startOnNewLine(factory2.createAssignment(temp, classExpression)), - startOnNewLine(temp) - ); + expressions.push(factory2.createAssignment(temp, classExpression)); + } else if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_f = node.emitNode) == null ? void 0 : _f.classThis)) { + expressions.push(factory2.createAssignment(node.emitNode.classThis, classExpression)); } else { expressions.push(classExpression); - if (prologue) { - startOnNewLine(classExpression); - } } } else { - temp || (temp = createClassTempVar()); + temp != null ? temp : temp = createClassTempVar(); if (isClassWithConstructorReference) { enableSubstitutionForClassAliases(); const alias = factory2.cloneNode(temp); - alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; + alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; classAliases[getOriginalNodeId(node)] = alias; } - setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression)); - expressions.push(startOnNewLine(factory2.createAssignment(temp, classExpression))); - addRange(expressions, map(pendingExpressions, startOnNewLine)); + expressions.push(factory2.createAssignment(temp, classExpression)); + addRange(expressions, pendingExpressions); + if (referencedName) { + expressions.push(emitHelpers().createSetFunctionNameHelper(temp, referencedName)); + } addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp)); - expressions.push(startOnNewLine(temp)); + expressions.push(factory2.cloneNode(temp)); } } else { expressions.push(classExpression); - if (prologue) { - startOnNewLine(classExpression); - } + } + if (expressions.length > 1) { + addEmitFlags(classExpression, 131072 /* Indented */); + expressions.forEach(startOnNewLine); } return factory2.inlineExpressions(expressions); } @@ -88979,16 +90533,24 @@ ${lanes.join("\n")} return void 0; } function transformClassMembers(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const shouldTransformPrivateStaticElementsInClass = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInFile) { for (const member of node.members) { if (isPrivateIdentifierClassElementDeclaration(member)) { - addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + if (shouldTransformClassElementToWeakMap(member)) { + addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, member.name, { kind: "untransformed" }); + } } } - if (some(getPrivateInstanceMethodsAndAccessors(node))) { - createBrandCheckWeakSetForPrivateMethods(); + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + if (some(getPrivateInstanceMethodsAndAccessors(node))) { + createBrandCheckWeakSetForPrivateMethods(); + } } - if (shouldTransformAutoAccessors) { + if (shouldTransformAutoAccessorsInCurrentClass()) { for (const member of node.members) { if (isAutoAccessorPropertyDeclaration(member)) { const storageName = factory2.getGeneratedPrivateNameForNode( @@ -88997,7 +90559,12 @@ ${lanes.join("\n")} void 0, "_accessor_storage" ); - addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInClass && hasStaticModifier(member)) { + addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, storageName, { kind: "untransformed" }); + } } } } @@ -89056,7 +90623,7 @@ ${lanes.join("\n")} return { members, prologue }; } function createBrandCheckWeakSetForPrivateMethods() { - const { weakSetName } = getPrivateIdentifierEnvironment(); + const { weakSetName } = getPrivateIdentifierEnvironment().data; Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); getPendingExpressions().push( factory2.createAssignment( @@ -89072,7 +90639,7 @@ ${lanes.join("\n")} } function transformConstructor(constructor, container) { constructor = visitNode(constructor, visitor, isConstructorDeclaration); - if (!currentClassLexicalEnvironment || !(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */)) { + if (!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) || !(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */)) { return constructor; } const extendsClauseElement = getEffectiveBaseTypeNode(container); @@ -89109,13 +90676,14 @@ ${lanes.join("\n")} } function transformConstructorBody(node, constructor, isDerivedClass) { var _a2, _b; - let properties = getProperties( + const instanceProperties = getProperties( node, /*requireInitializer*/ false, /*isStatic*/ false ); + let properties = instanceProperties; if (!useDefineForClassFields) { properties = filter(properties, (property) => !!property.initializer || isPrivateIdentifier(property.name) || hasAccessorModifier(property)); } @@ -89169,37 +90737,30 @@ ${lanes.join("\n")} } let parameterPropertyDeclarationCount = 0; if (constructor == null ? void 0 : constructor.body) { - if (useDefineForClassFields) { - statements = statements.filter((statement) => !isParameterPropertyDeclaration(getOriginalNode(statement), constructor)); - } else { - for (const statement of constructor.body.statements) { - if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - parameterPropertyDeclarationCount++; - } - } - if (parameterPropertyDeclarationCount > 0) { - const parameterProperties = visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount); - if (superStatementIndex >= 0) { - addRange(statements, parameterProperties); - } else { - let superAndPrologueStatementCount = prologueStatementCount; - if (needsSyntheticConstructor) - superAndPrologueStatementCount++; - statements = [ - ...statements.slice(0, superAndPrologueStatementCount), - ...parameterProperties, - ...statements.slice(superAndPrologueStatementCount) - ]; - } - indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + for (let i = indexOfFirstStatementAfterSuperAndPrologue; i < constructor.body.statements.length; i++) { + const statement = constructor.body.statements[i]; + if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { + parameterPropertyDeclarationCount++; + } else { + break; } } + if (parameterPropertyDeclarationCount > 0) { + indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + } } const receiver = factory2.createThis(); - addMethodStatements(statements, privateMethodsAndAccessors, receiver); - addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + addInstanceMethodStatements(statements, privateMethodsAndAccessors, receiver); + if (constructor) { + const parameterProperties = filter(instanceProperties, (prop) => isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + const nonParameterProperties = filter(properties, (prop) => !isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + addPropertyOrClassStaticBlockStatements(statements, parameterProperties, receiver); + addPropertyOrClassStaticBlockStatements(statements, nonParameterProperties, receiver); + } else { + addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + } if (constructor) { - addRange(statements, visitNodes2(constructor.body.statements, visitBodyStatement, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); + addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); } statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); if (statements.length === 0 && !constructor) { @@ -89218,16 +90779,10 @@ ${lanes.join("\n")} /*location*/ constructor ? constructor.body : void 0 ); - function visitBodyStatement(statement) { - if (useDefineForClassFields && isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - return void 0; - } - return visitor(statement); - } } function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) { for (const property of properties) { - if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) { + if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks) { continue; } const statement = transformPropertyOrClassStaticBlock(property, receiver); @@ -89245,10 +90800,19 @@ ${lanes.join("\n")} const statement = factory2.createExpressionStatement(expression); setOriginalNode(statement, property); addEmitFlags(statement, getEmitFlags(property) & 3072 /* NoComments */); - setSourceMapRange(statement, moveRangePastModifiers(property)); setCommentRange(statement, property); + const propertyOriginalNode = getOriginalNode(property); + if (isParameter(propertyOriginalNode)) { + setSourceMapRange(statement, propertyOriginalNode); + removeAllComments(statement); + } else { + setSourceMapRange(statement, moveRangePastModifiers(property)); + } setSyntheticLeadingComments(expression, void 0); setSyntheticTrailingComments(expression, void 0); + if (hasAccessorModifier(propertyOriginalNode)) { + addEmitFlags(statement, 3072 /* NoComments */); + } return statement; } function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) { @@ -89268,37 +90832,49 @@ ${lanes.join("\n")} return expressions; } function transformProperty(property, receiver) { + var _a2; const savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock; const transformed = transformPropertyWorker(property, receiver); - if (transformed && hasStaticModifier(property) && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts)) { + if (transformed && hasStaticModifier(property) && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts)) { setOriginalNode(transformed, property); addEmitFlags(transformed, 4 /* AdviseOnEmitNode */); - classLexicalEnvironmentMap.set(getOriginalNodeId(transformed), currentClassLexicalEnvironment); + setSourceMapRange(transformed, getSourceMapRange(property.name)); + lexicalEnvironmentMap.set(getOriginalNode(property), lexicalEnvironment); } currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock; return transformed; } function transformPropertyWorker(property, receiver) { - var _a2; const emitAssignment = !useDefineForClassFields; + let referencedName; + if (isNamedEvaluation(property, isAnonymousClassNeedingAssignedName)) { + if (isPropertyNameLiteral(property.name) || isPrivateIdentifier(property.name)) { + referencedName = factory2.createStringLiteralFromNode(property.name); + } else if (isPropertyNameLiteral(property.name.expression) && !isIdentifier(property.name.expression)) { + referencedName = factory2.createStringLiteralFromNode(property.name.expression); + } else { + referencedName = factory2.getGeneratedNameForNode(property.name); + } + } const propertyName = hasAccessorModifier(property) ? factory2.getGeneratedPrivateNameForNode(property.name) : isComputedPropertyName(property.name) && !isSimpleInlineableExpression(property.name.expression) ? factory2.updateComputedPropertyName(property.name, factory2.getGeneratedNameForNode(property.name)) : property.name; if (hasStaticModifier(property)) { currentStaticPropertyDeclarationOrStaticBlock = property; } - if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(propertyName)) { - const privateIdentifierInfo = accessPrivateIdentifier(propertyName); + const initializerVisitor = referencedName ? (child) => namedEvaluationVisitor(child, referencedName) : visitor; + if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property)) { + const privateIdentifierInfo = accessPrivateIdentifier2(propertyName); if (privateIdentifierInfo) { if (privateIdentifierInfo.kind === "f" /* Field */) { if (!privateIdentifierInfo.isStatic) { return createPrivateInstanceFieldInitializer( receiver, - visitNode(property.initializer, visitor, isExpression), + visitNode(property.initializer, initializerVisitor, isExpression), privateIdentifierInfo.brandCheckIdentifier ); } else { return createPrivateStaticFieldInitializer( privateIdentifierInfo.variableName, - visitNode(property.initializer, visitor, isExpression) + visitNode(property.initializer, initializerVisitor, isExpression) ); } } else { @@ -89315,7 +90891,23 @@ ${lanes.join("\n")} if (hasSyntacticModifier(propertyOriginalNode, 256 /* Abstract */)) { return void 0; } - const initializer = property.initializer || emitAssignment ? (_a2 = visitNode(property.initializer, visitor, isExpression)) != null ? _a2 : factory2.createVoidZero() : isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName) ? propertyName : factory2.createVoidZero(); + let initializer = visitNode(property.initializer, initializerVisitor, isExpression); + if (isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName)) { + const localName = factory2.cloneNode(propertyName); + if (initializer) { + if (isParenthesizedExpression(initializer) && isCommaExpression(initializer.expression) && isCallToHelper(initializer.expression.left, "___runInitializers") && isVoidExpression(initializer.expression.right) && isNumericLiteral(initializer.expression.right.expression)) { + initializer = initializer.expression.left; + } + initializer = factory2.inlineExpressions([initializer, localName]); + } else { + initializer = localName; + } + setEmitFlags(propertyName, 3072 /* NoComments */ | 96 /* NoSourceMap */); + setSourceMapRange(localName, propertyOriginalNode.name); + setEmitFlags(localName, 3072 /* NoComments */); + } else { + initializer != null ? initializer : initializer = factory2.createVoidZero(); + } if (emitAssignment || isPrivateIdentifier(propertyName)) { const memberAccess = createMemberAccessForPropertyName( factory2, @@ -89324,7 +90916,9 @@ ${lanes.join("\n")} /*location*/ propertyName ); - return factory2.createAssignment(memberAccess, initializer); + addEmitFlags(memberAccess, 1024 /* NoLeadingComments */); + const expression = factory2.createAssignment(memberAccess, initializer); + return expression; } else { const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; const descriptor = factory2.createPropertyDescriptor({ value: initializer, configurable: true, writable: true, enumerable: true }); @@ -89352,11 +90946,11 @@ ${lanes.join("\n")} context.enableEmitNotification(164 /* ComputedPropertyName */); } } - function addMethodStatements(statements, methods, receiver) { + function addInstanceMethodStatements(statements, methods, receiver) { if (!shouldTransformPrivateElementsOrClassStaticBlocks || !some(methods)) { return; } - const { weakSetName } = getPrivateIdentifierEnvironment(); + const { weakSetName } = getPrivateIdentifierEnvironment().data; Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); statements.push( factory2.createExpressionStatement( @@ -89375,20 +90969,352 @@ ${lanes.join("\n")} visitNode(node.argumentExpression, visitor, isExpression) ); } + function getPropertyNameExpressionIfNeeded(name, shouldHoist, captureReferencedName) { + if (isComputedPropertyName(name)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name); + let expression = visitNode(name.expression, visitor, isExpression); + const innerExpression = skipPartiallyEmittedExpressions(expression); + const inlinable = isSimpleInlineableExpression(innerExpression); + const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); + if (!alreadyTransformed && !inlinable && shouldHoist) { + const generatedName = factory2.getGeneratedNameForNode(name); + if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) { + addBlockScopedVariable(generatedName); + } else { + hoistVariableDeclaration(generatedName); + } + if (captureReferencedName) { + expression = emitHelpers().createPropKeyHelper(expression); + } + return factory2.createAssignment(generatedName, expression); + } + return inlinable || isIdentifier(innerExpression) ? void 0 : expression; + } + } + function startClassLexicalEnvironment() { + lexicalEnvironment = { previous: lexicalEnvironment, data: void 0 }; + } + function endClassLexicalEnvironment() { + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + } + function getClassLexicalEnvironment() { + var _a2; + Debug.assert(lexicalEnvironment); + return (_a2 = lexicalEnvironment.data) != null ? _a2 : lexicalEnvironment.data = { + facts: 0 /* None */, + classConstructor: void 0, + classThis: void 0, + superClassReference: void 0 + // privateIdentifierEnvironment: undefined, + }; + } + function getPrivateIdentifierEnvironment() { + var _a2; + Debug.assert(lexicalEnvironment); + return (_a2 = lexicalEnvironment.privateEnv) != null ? _a2 : lexicalEnvironment.privateEnv = newPrivateEnvironment({ + className: void 0, + weakSetName: void 0 + }); + } + function getPendingExpressions() { + return pendingExpressions != null ? pendingExpressions : pendingExpressions = []; + } + function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + if (isAutoAccessorPropertyDeclaration(node)) { + addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isPropertyDeclaration(node)) { + addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isMethodDeclaration(node)) { + addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isGetAccessorDeclaration(node)) { + addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } else if (isSetAccessorDeclaration(node)) { + addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } + } + function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + if (isStatic2) { + const brandCheckIdentifier = Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment"); + const variableName = createHoistedVariableForPrivateName(name); + setPrivateIdentifier(privateEnv, name, { + kind: "f" /* Field */, + isStatic: true, + brandCheckIdentifier, + variableName, + isValid + }); + } else { + const weakMapName = createHoistedVariableForPrivateName(name); + setPrivateIdentifier(privateEnv, name, { + kind: "f" /* Field */, + isStatic: false, + brandCheckIdentifier: weakMapName, + isValid + }); + getPendingExpressions().push(factory2.createAssignment( + weakMapName, + factory2.createNewExpression( + factory2.createIdentifier("WeakMap"), + /*typeArguments*/ + void 0, + [] + ) + )); + } + } + function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + const methodName = createHoistedVariableForPrivateName(name); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name, { + kind: "m" /* Method */, + methodName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + var _a2; + const getterName = createHoistedVariableForPrivateName(name, "_get"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { + previousInfo.getterName = getterName; + } else { + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName, + setterName: void 0, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + } + function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { + var _a2; + const setterName = createHoistedVariableForPrivateName(name, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { + previousInfo.setterName = setterName; + } else { + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName: void 0, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + } + function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { + var _a2; + const getterName = createHoistedVariableForPrivateName(name, "_get"); + const setterName = createHoistedVariableForPrivateName(name, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined((_a2 = lex.classThis) != null ? _a2 : lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name, { + kind: "a" /* Accessor */, + getterName, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid + }); + } + function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { + const lex = getClassLexicalEnvironment(); + const privateEnv = getPrivateIdentifierEnvironment(); + const previousInfo = getPrivateIdentifier(privateEnv, name); + const isStatic2 = hasStaticModifier(node); + const isValid = !isReservedPrivateName(name) && previousInfo === void 0; + addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); + } + function createHoistedVariableForClass(name, node, suffix) { + const { className } = getPrivateIdentifierEnvironment().data; + const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; + const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0, + /*reserveInNestedScopes*/ + true, + prefix, + suffix + ); + if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) { + addBlockScopedVariable(identifier); + } else { + hoistVariableDeclaration(identifier); + } + return identifier; + } + function createHoistedVariableForPrivateName(name, suffix) { + var _a2; + const text = tryGetTextOfPropertyName(name); + return createHoistedVariableForClass((_a2 = text == null ? void 0 : text.substring(1)) != null ? _a2 : name, name, suffix); + } + function accessPrivateIdentifier2(name) { + const info = accessPrivateIdentifier(lexicalEnvironment, name); + return (info == null ? void 0 : info.kind) === "untransformed" ? void 0 : info; + } + function wrapPrivateIdentifierForDestructuringTarget(node) { + const parameter = factory2.getGeneratedNameForNode(node); + const info = accessPrivateIdentifier2(node.name); + if (!info) { + return visitEachChild(node, visitor, context); + } + let receiver = node.expression; + if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { + receiver = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getPendingExpressions().push(factory2.createBinaryExpression(receiver, 63 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); + } + return factory2.createAssignmentTargetWrapper( + parameter, + createPrivateIdentifierAssignment( + info, + receiver, + parameter, + 63 /* EqualsToken */ + ) + ); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isPrivateIdentifierPropertyAccessExpression(node)) { + return wrapPrivateIdentifierForDestructuringTarget(node); + } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1 /* ClassWasDecorated */) { + return visitInvalidSuperProperty(node); + } else if (classConstructor && superClassReference) { + const name = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (name) { + const temp = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + return factory2.createAssignmentTargetWrapper( + temp, + factory2.createReflectSetCall( + superClassReference, + name, + temp, + classConstructor + ) + ); + } + } + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const left = visitDestructuringAssignmentTarget(node.left); + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const left = visitDestructuringAssignmentTarget(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitDestructuringAssignmentTarget(node); + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentProperty(node) { + const name = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + return visitEachChild(node, visitor, context); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); + const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateShorthandPropertyAssignment(node, node.name, objectAssignmentInitializer); + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + return factory2.updateArrayLiteralExpression( + node, + visitNodes2(node.elements, visitArrayAssignmentElement, isExpression) + ); + } else { + return factory2.updateObjectLiteralExpression( + node, + visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike) + ); + } + } function onEmitNode(hint, node, emitCallback) { const original = getOriginalNode(node); - if (original.id) { - const classLexicalEnvironment = classLexicalEnvironmentMap.get(original.id); - if (classLexicalEnvironment) { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = classLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = classLexicalEnvironment; - previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; - return; - } + const lex = lexicalEnvironmentMap.get(original); + if (lex) { + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = lex; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = !isClassStaticBlockDeclaration(original) || !(getInternalEmitFlags(original) & 32 /* TransformPrivateStaticElements */); + previousOnEmitNode(hint, node, emitCallback); + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; + return; } switch (node.kind) { case 215 /* FunctionExpression */: @@ -89396,37 +91322,30 @@ ${lanes.join("\n")} break; } case 259 /* FunctionDeclaration */: - case 173 /* Constructor */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = void 0; - currentComputedPropertyNameClassLexicalEnvironment = void 0; - previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; - return; - } + case 173 /* Constructor */: case 174 /* GetAccessor */: case 175 /* SetAccessor */: case 171 /* MethodDeclaration */: case 169 /* PropertyDeclaration */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment; - currentClassLexicalEnvironment = void 0; + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = void 0; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = false; previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; return; } case 164 /* ComputedPropertyName */: { - const savedClassLexicalEnvironment = currentClassLexicalEnvironment; - const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = void 0; + const savedLexicalEnvironment = lexicalEnvironment; + const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; previousOnEmitNode(hint, node, emitCallback); - currentClassLexicalEnvironment = savedClassLexicalEnvironment; - currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + shouldSubstituteThisWithClassThis = savedShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; return; } } @@ -89449,15 +91368,16 @@ ${lanes.join("\n")} return node; } function substituteThisExpression(node) { - if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && currentClassLexicalEnvironment) { - const { facts, classConstructor } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { + if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { facts, classConstructor, classThis } = lexicalEnvironment.data; + if (facts & 1 /* ClassWasDecorated */ && legacyDecorators) { return factory2.createParenthesizedExpression(factory2.createVoidZero()); } - if (classConstructor) { + const substituteThis = shouldSubstituteThisWithClassThis ? classThis != null ? classThis : classConstructor : classConstructor; + if (substituteThis) { return setTextRange( setOriginalNode( - factory2.cloneNode(classConstructor), + factory2.cloneNode(substituteThis), node ), node @@ -89486,350 +91406,6 @@ ${lanes.join("\n")} } return void 0; } - function getPropertyNameExpressionIfNeeded(name, shouldHoist) { - if (isComputedPropertyName(name)) { - const expression = visitNode(name.expression, visitor, isExpression); - const innerExpression = skipPartiallyEmittedExpressions(expression); - const inlinable = isSimpleInlineableExpression(innerExpression); - const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); - if (!alreadyTransformed && !inlinable && shouldHoist) { - const generatedName = factory2.getGeneratedNameForNode(name); - if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) { - addBlockScopedVariable(generatedName); - } else { - hoistVariableDeclaration(generatedName); - } - return factory2.createAssignment(generatedName, expression); - } - return inlinable || isIdentifier(innerExpression) ? void 0 : expression; - } - } - function startClassLexicalEnvironment() { - classLexicalEnvironmentStack.push(currentClassLexicalEnvironment); - currentClassLexicalEnvironment = void 0; - } - function endClassLexicalEnvironment() { - currentClassLexicalEnvironment = classLexicalEnvironmentStack.pop(); - } - function getClassLexicalEnvironment() { - return currentClassLexicalEnvironment || (currentClassLexicalEnvironment = { - facts: 0 /* None */, - classConstructor: void 0, - superClassReference: void 0, - privateIdentifierEnvironment: void 0 - }); - } - function getPrivateIdentifierEnvironment() { - const lex = getClassLexicalEnvironment(); - lex.privateIdentifierEnvironment || (lex.privateIdentifierEnvironment = { - className: void 0, - weakSetName: void 0, - identifiers: void 0, - generatedIdentifiers: void 0 - }); - return lex.privateIdentifierEnvironment; - } - function getPendingExpressions() { - return pendingExpressions != null ? pendingExpressions : pendingExpressions = []; - } - function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - if (isAutoAccessorPropertyDeclaration(node)) { - addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isPropertyDeclaration(node)) { - addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isMethodDeclaration(node)) { - addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isGetAccessorDeclaration(node)) { - addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isSetAccessorDeclaration(node)) { - addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - } - function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - if (isStatic2) { - Debug.assert(lex.classConstructor, "classConstructor should be set in private identifier environment"); - const variableName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - brandCheckIdentifier: lex.classConstructor, - variableName, - isStatic: true, - isValid - }); - } else { - const weakMapName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - brandCheckIdentifier: weakMapName, - variableName: void 0, - isStatic: false, - isValid - }); - getPendingExpressions().push(factory2.createAssignment( - weakMapName, - factory2.createNewExpression( - factory2.createIdentifier("WeakMap"), - /*typeArguments*/ - void 0, - [] - ) - )); - } - } - function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const methodName = createHoistedVariableForPrivateName(name); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "m" /* Method */, - methodName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { - previousInfo.getterName = getterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName: void 0, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { - previousInfo.setterName = setterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName: void 0, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { - const lex = getClassLexicalEnvironment(); - const privateEnv = getPrivateIdentifierEnvironment(); - const previousInfo = getPrivateIdentifier(privateEnv, name); - const isStatic2 = hasStaticModifier(node); - const isValid = !isReservedPrivateName(name) && previousInfo === void 0; - addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - function createHoistedVariableForClass(name, node, suffix) { - const { className } = getPrivateIdentifierEnvironment(); - const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; - const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0, - /*reserveInNestedScopes*/ - true, - prefix, - suffix - ); - if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) { - addBlockScopedVariable(identifier); - } else { - hoistVariableDeclaration(identifier); - } - return identifier; - } - function createHoistedVariableForPrivateName(name, suffix) { - var _a2; - const text = tryGetTextOfPropertyName(name); - return createHoistedVariableForClass((_a2 = text == null ? void 0 : text.substring(1)) != null ? _a2 : name, name, suffix); - } - function accessPrivateIdentifier(name) { - if (isGeneratedPrivateIdentifier(name)) { - return accessGeneratedPrivateIdentifier(name); - } else { - return accessPrivateIdentifierByText(name.escapedText); - } - } - function accessPrivateIdentifierByText(text) { - return accessPrivateIdentifierWorker(getPrivateIdentifierInfo, text); - } - function accessGeneratedPrivateIdentifier(name) { - return accessPrivateIdentifierWorker(getGeneratedPrivateIdentifierInfo, getNodeForGeneratedName(name)); - } - function accessPrivateIdentifierWorker(getPrivateIdentifierInfo2, privateIdentifierKey) { - if (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.privateIdentifierEnvironment) { - const info = getPrivateIdentifierInfo2(currentClassLexicalEnvironment.privateIdentifierEnvironment, privateIdentifierKey); - if (info) { - return info; - } - } - for (let i = classLexicalEnvironmentStack.length - 1; i >= 0; --i) { - const env = classLexicalEnvironmentStack[i]; - if (!env) { - continue; - } - if (env.privateIdentifierEnvironment) { - const info = getPrivateIdentifierInfo2(env.privateIdentifierEnvironment, privateIdentifierKey); - if (info) { - return info; - } - } - } - return void 0; - } - function wrapPrivateIdentifierForDestructuringTarget(node) { - const parameter = factory2.getGeneratedNameForNode(node); - const info = accessPrivateIdentifier(node.name); - if (!info) { - return visitEachChild(node, visitor, context); - } - let receiver = node.expression; - if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { - receiver = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getPendingExpressions().push(factory2.createBinaryExpression(receiver, 63 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); - } - return factory2.createAssignmentTargetWrapper( - parameter, - createPrivateIdentifierAssignment( - info, - receiver, - parameter, - 63 /* EqualsToken */ - ) - ); - } - function visitArrayAssignmentTarget(node) { - const target = getTargetOfBindingOrAssignmentElement(node); - if (target) { - let wrapped; - if (isPrivateIdentifierPropertyAccessExpression(target)) { - wrapped = wrapPrivateIdentifierForDestructuringTarget(target); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { - wrapped = visitInvalidSuperProperty(target); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(target) ? visitNode(target.argumentExpression, visitor, isExpression) : isIdentifier(target.name) ? factory2.createStringLiteralFromNode(target.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - wrapped = factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - if (wrapped) { - if (isAssignmentExpression(node)) { - return factory2.updateBinaryExpression( - node, - wrapped, - node.operatorToken, - visitNode(node.right, visitor, isExpression) - ); - } else if (isSpreadElement(node)) { - return factory2.updateSpreadElement(node, wrapped); - } else { - return wrapped; - } - } - } - return visitNode(node, assignmentTargetVisitor); - } - function visitObjectAssignmentTarget(node) { - if (isObjectBindingOrAssignmentElement(node) && !isShorthandPropertyAssignment(node)) { - const target = getTargetOfBindingOrAssignmentElement(node); - let wrapped; - if (target) { - if (isPrivateIdentifierPropertyAccessExpression(target)) { - wrapped = wrapPrivateIdentifierForDestructuringTarget(target); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { - const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment; - if (facts & 1 /* ClassWasDecorated */) { - wrapped = visitInvalidSuperProperty(target); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(target) ? visitNode(target.argumentExpression, visitor, isExpression) : isIdentifier(target.name) ? factory2.createStringLiteralFromNode(target.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - wrapped = factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - } - if (isPropertyAssignment(node)) { - const initializer = getInitializerOfBindingOrAssignmentElement(node); - return factory2.updatePropertyAssignment( - node, - visitNode(node.name, visitor, isPropertyName), - wrapped ? initializer ? factory2.createAssignment(wrapped, visitNode(initializer, visitor)) : wrapped : visitNode(node.initializer, assignmentTargetVisitor, isExpression) - ); - } - if (isSpreadAssignment(node)) { - return factory2.updateSpreadAssignment( - node, - wrapped || visitNode(node.expression, assignmentTargetVisitor, isExpression) - ); - } - Debug.assert(wrapped === void 0, "Should not have generated a wrapped target"); - } - return visitNode(node, visitor); - } - function visitAssignmentPattern(node) { - if (isArrayLiteralExpression(node)) { - return factory2.updateArrayLiteralExpression( - node, - visitNodes2(node.elements, visitArrayAssignmentTarget, isExpression) - ); - } else { - return factory2.updateObjectLiteralExpression( - node, - visitNodes2(node.properties, visitObjectAssignmentTarget, isObjectLiteralElementLike) - ); - } - } } function createPrivateStaticFieldInitializer(variableName, initializer) { return factory.createAssignment( @@ -89858,38 +91434,13 @@ ${lanes.join("\n")} function isReservedPrivateName(node) { return !isGeneratedPrivateIdentifier(node) && node.escapedText === "#constructor"; } - function getPrivateIdentifier(privateEnv, name) { - return isGeneratedPrivateIdentifier(name) ? getGeneratedPrivateIdentifierInfo(privateEnv, getNodeForGeneratedName(name)) : getPrivateIdentifierInfo(privateEnv, name.escapedText); - } - function setPrivateIdentifier(privateEnv, name, info) { - var _a2, _b; - if (isGeneratedPrivateIdentifier(name)) { - (_a2 = privateEnv.generatedIdentifiers) != null ? _a2 : privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map(); - privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), info); - } else { - (_b = privateEnv.identifiers) != null ? _b : privateEnv.identifiers = /* @__PURE__ */ new Map(); - privateEnv.identifiers.set(name.escapedText, info); - } - } - function getPrivateIdentifierInfo(privateEnv, key) { - var _a2; - return (_a2 = privateEnv.identifiers) == null ? void 0 : _a2.get(key); - } - function getGeneratedPrivateIdentifierInfo(privateEnv, key) { - var _a2; - return (_a2 = privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(key); + function isPrivateIdentifierInExpression(node) { + return isPrivateIdentifier(node.left) && node.operatorToken.kind === 101 /* InKeyword */; } - var PrivateIdentifierKind2; var init_classFields = __esm({ "src/compiler/transformers/classFields.ts"() { "use strict"; init_ts2(); - PrivateIdentifierKind2 = /* @__PURE__ */ ((PrivateIdentifierKind3) => { - PrivateIdentifierKind3["Field"] = "f"; - PrivateIdentifierKind3["Method"] = "m"; - PrivateIdentifierKind3["Accessor"] = "a"; - return PrivateIdentifierKind3; - })(PrivateIdentifierKind2 || {}); } }); @@ -90302,9 +91853,22 @@ ${lanes.join("\n")} } } function visitClassDeclaration(node) { - if (!(classOrConstructorParameterIsDecorated(node) || childIsDecorated(node))) + if (!(classOrConstructorParameterIsDecorated( + /*legacyDecorators*/ + true, + node + ) || childIsDecorated( + /*legacyDecorators*/ + true, + node + ))) { return visitEachChild(node, visitor, context); - const statements = hasDecorators(node) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); + } + const statements = classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + true, + node + ) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); if (statements.length > 1) { statements.push(factory2.createEndOfDeclarationMarker(node)); setEmitFlags(statements[0], getEmitFlags(statements[0]) | 8388608 /* HasEndOfDeclarationMarker */); @@ -90321,7 +91885,12 @@ ${lanes.join("\n")} for (const member of node.members) { if (!canHaveDecorators(member)) continue; - const allDecorators = getAllDecoratorsOfClassElement(member, node); + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); if (some(allDecorators == null ? void 0 : allDecorators.decorators, decoratorContainsPrivateIdentifierInExpression)) return true; if (some(allDecorators == null ? void 0 : allDecorators.parameters, parameterDecoratorsContainPrivateIdentifierInExpression)) @@ -90398,7 +91967,7 @@ ${lanes.join("\n")} const classExpression = factory2.createClassExpression( /*modifiers*/ void 0, - name, + name && isGeneratedIdentifier(name) ? void 0 : name, /*typeParameters*/ void 0, heritageClauses, @@ -90443,7 +92012,7 @@ ${lanes.join("\n")} return factory2.updateConstructorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), visitNode(node.body, visitor, isBlock) ); } @@ -90459,12 +92028,12 @@ ${lanes.join("\n")} node, visitNodes2(node.modifiers, modifierVisitor, isModifier), node.asteriskToken, - visitNode(node.name, visitor, isPropertyName), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionToken*/ void 0, /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -90474,8 +92043,8 @@ ${lanes.join("\n")} return finishClassElement(factory2.updateGetAccessorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -90485,8 +92054,8 @@ ${lanes.join("\n")} return finishClassElement(factory2.updateSetAccessorDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), - visitNodes2(node.parameters, visitor, isParameterDeclaration), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), visitNode(node.body, visitor, isBlock) ), node); } @@ -90497,7 +92066,7 @@ ${lanes.join("\n")} return finishClassElement(factory2.updatePropertyDeclaration( node, visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, visitor, isPropertyName), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, /*type*/ @@ -90510,7 +92079,7 @@ ${lanes.join("\n")} node, elideNodes(factory2, node.modifiers), node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), /*questionToken*/ void 0, /*type*/ @@ -90525,20 +92094,30 @@ ${lanes.join("\n")} } return updated; } + function isSyntheticMetadataDecorator(node) { + return isCallToHelper(node.expression, "___metadata"); + } function transformAllDecoratorsOfDeclaration(allDecorators) { if (!allDecorators) { return void 0; } + const { false: decorators, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator); const decoratorExpressions = []; - addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); + addRange(decoratorExpressions, map(decorators, transformDecorator)); addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); + addRange(decoratorExpressions, map(metadata, transformDecorator)); return decoratorExpressions; } function addClassElementDecorationStatements(statements, node, isStatic2) { addRange(statements, map(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr))); } function isDecoratedClassElement(member, isStaticElement, parent2) { - return nodeOrChildIsDecorated(member, parent2) && isStaticElement === isStatic(member); + return nodeOrChildIsDecorated( + /*legacyDecorators*/ + true, + member, + parent2 + ) && isStaticElement === isStatic(member); } function getDecoratedClassElements(node, isStatic2) { return filter(node.members, (m) => isDecoratedClassElement(m, isStatic2, node)); @@ -90552,7 +92131,12 @@ ${lanes.join("\n")} return expressions; } function generateClassElementDecorationExpression(node, member) { - const allDecorators = getAllDecoratorsOfClassElement(member, node); + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); if (!decoratorExpressions) { return void 0; @@ -90607,7 +92191,7 @@ ${lanes.join("\n")} return expression; } function transformDecorator(decorator) { - return visitNode(decorator.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(decorator.expression, visitor, isExpression)); } function transformDecoratorsOfParameter(decorators, parameterOffset) { let expressions; @@ -90701,6 +92285,1719 @@ ${lanes.join("\n")} } }); + // src/compiler/transformers/esDecorators.ts + function transformESDecorators(context) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + startLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context; + let top; + let classInfo; + let classThis; + let classSuper; + let pendingExpressions; + let shouldTransformPrivateStaticElementsInFile; + return chainBundle(context, transformSourceFile); + function transformSourceFile(node) { + top = void 0; + shouldTransformPrivateStaticElementsInFile = false; + const visited = visitEachChild(node, visitor, context); + addEmitHelpers(visited, context.readEmitHelpers()); + if (shouldTransformPrivateStaticElementsInFile) { + addInternalEmitFlags(visited, 32 /* TransformPrivateStaticElements */); + shouldTransformPrivateStaticElementsInFile = false; + } + return visited; + } + function updateState() { + classInfo = void 0; + classThis = void 0; + classSuper = void 0; + switch (top == null ? void 0 : top.kind) { + case "class": + classInfo = top.classInfo; + break; + case "class-element": + classInfo = top.next.classInfo; + classThis = top.classThis; + classSuper = top.classSuper; + break; + case "name": + const grandparent = top.next.next.next; + if ((grandparent == null ? void 0 : grandparent.kind) === "class-element") { + classInfo = grandparent.next.classInfo; + classThis = grandparent.classThis; + classSuper = grandparent.classSuper; + } + break; + } + } + function enterClass(classInfo2) { + top = { kind: "class", next: top, classInfo: classInfo2, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + function exitClass() { + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + function enterClassElement(node) { + var _a2, _b; + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "class-element", next: top }; + if (isClassStaticBlockDeclaration(node) || isPropertyDeclaration(node) && hasStaticModifier(node)) { + top.classThis = (_a2 = top.next.classInfo) == null ? void 0 : _a2.classThis; + top.classSuper = (_b = top.next.classInfo) == null ? void 0 : _b.classSuper; + } + updateState(); + } + function exitClassElement() { + var _a2; + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + Debug.assert(((_a2 = top.next) == null ? void 0 : _a2.kind) === "class", "Incorrect value for top.next.kind.", () => { + var _a3; + return `Expected top.next.kind to be 'class' but got '${(_a3 = top.next) == null ? void 0 : _a3.kind}' instead.`; + }); + top = top.next; + updateState(); + } + function enterName() { + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "name", next: top }; + updateState(); + } + function exitName() { + Debug.assert((top == null ? void 0 : top.kind) === "name", "Incorrect value for top.kind.", () => `Expected top.kind to be 'name' but got '${top == null ? void 0 : top.kind}' instead.`); + top = top.next; + updateState(); + } + function enterOther() { + if ((top == null ? void 0 : top.kind) === "other") { + Debug.assert(!pendingExpressions); + top.depth++; + } else { + top = { kind: "other", next: top, depth: 0, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + } + function exitOther() { + Debug.assert((top == null ? void 0 : top.kind) === "other", "Incorrect value for top.kind.", () => `Expected top.kind to be 'other' but got '${top == null ? void 0 : top.kind}' instead.`); + if (top.depth > 0) { + Debug.assert(!pendingExpressions); + top.depth--; + } else { + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + } + function shouldVisitNode(node) { + return !!(node.transformFlags & 33554432 /* ContainsDecorators */) || !!classThis && !!(node.transformFlags & 16384 /* ContainsLexicalThis */) || !!classThis && !!classSuper && !!(node.transformFlags & 134217728 /* ContainsLexicalSuper */); + } + function visitor(node) { + if (!shouldVisitNode(node)) { + return node; + } + switch (node.kind) { + case 167 /* Decorator */: + return Debug.fail("Use `modifierVisitor` instead."); + case 260 /* ClassDeclaration */: + return visitClassDeclaration(node); + case 228 /* ClassExpression */: + return visitClassExpression( + node, + /*referencedName*/ + void 0 + ); + case 173 /* Constructor */: + case 169 /* PropertyDeclaration */: + case 172 /* ClassStaticBlockDeclaration */: + return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); + case 166 /* Parameter */: + return visitParameterDeclaration(node); + case 223 /* BinaryExpression */: + return visitBinaryExpression( + node, + /*discarded*/ + false + ); + case 299 /* PropertyAssignment */: + return visitPropertyAssignment(node); + case 257 /* VariableDeclaration */: + return visitVariableDeclaration(node); + case 205 /* BindingElement */: + return visitBindingElement(node); + case 274 /* ExportAssignment */: + return visitExportAssignment(node); + case 108 /* ThisKeyword */: + return visitThisExpression(node); + case 245 /* ForStatement */: + return visitForStatement(node); + case 241 /* ExpressionStatement */: + return visitExpressionStatement(node); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ + false + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + /*referencedName*/ + void 0 + ); + case 210 /* CallExpression */: + return visitCallExpression(node); + case 212 /* TaggedTemplateExpression */: + return visitTaggedTemplateExpression(node); + case 221 /* PrefixUnaryExpression */: + case 222 /* PostfixUnaryExpression */: + return visitPreOrPostfixUnaryExpression( + node, + /*discard*/ + false + ); + case 208 /* PropertyAccessExpression */: + return visitPropertyAccessExpression(node); + case 209 /* ElementAccessExpression */: + return visitElementAccessExpression(node); + case 164 /* ComputedPropertyName */: + return visitComputedPropertyName(node); + case 171 /* MethodDeclaration */: + case 175 /* SetAccessor */: + case 174 /* GetAccessor */: + case 215 /* FunctionExpression */: + case 259 /* FunctionDeclaration */: { + enterOther(); + const result = visitEachChild(node, fallbackVisitor, context); + exitOther(); + return result; + } + default: + return visitEachChild(node, fallbackVisitor, context); + } + } + function fallbackVisitor(node) { + switch (node.kind) { + case 167 /* Decorator */: + return void 0; + default: + return visitor(node); + } + } + function modifierVisitor(node) { + switch (node.kind) { + case 167 /* Decorator */: + return void 0; + default: + return node; + } + } + function classElementVisitor(node) { + switch (node.kind) { + case 173 /* Constructor */: + return visitConstructorDeclaration(node); + case 171 /* MethodDeclaration */: + return visitMethodDeclaration(node); + case 174 /* GetAccessor */: + return visitGetAccessorDeclaration(node); + case 175 /* SetAccessor */: + return visitSetAccessorDeclaration(node); + case 169 /* PropertyDeclaration */: + return visitPropertyDeclaration(node); + case 172 /* ClassStaticBlockDeclaration */: + return visitClassStaticBlockDeclaration(node); + default: + return visitor(node); + } + } + function namedEvaluationVisitor(node, referencedName) { + switch (node.kind) { + case 356 /* PartiallyEmittedExpression */: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + false, + referencedName + ); + case 228 /* ClassExpression */: + return visitClassExpression(node, referencedName); + default: + return visitor(node); + } + } + function discardedValueVisitor(node) { + switch (node.kind) { + case 221 /* PrefixUnaryExpression */: + case 222 /* PostfixUnaryExpression */: + return visitPreOrPostfixUnaryExpression( + node, + /*discarded*/ + true + ); + case 223 /* BinaryExpression */: + return visitBinaryExpression( + node, + /*discarded*/ + true + ); + case 357 /* CommaListExpression */: + return visitCommaListExpression( + node, + /*discarded*/ + true + ); + case 214 /* ParenthesizedExpression */: + return visitParenthesizedExpression( + node, + /*discarded*/ + true, + /*referencedName*/ + void 0 + ); + default: + return visitor(node); + } + } + function getHelperVariableName(node) { + let declarationName = node.name && isIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name) : node.name && isPrivateIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name).slice(1) : node.name && isStringLiteral(node.name) && isIdentifierText(node.name.text, 99 /* ESNext */) ? node.name.text : isClassLike(node) ? "class" : "member"; + if (isGetAccessor(node)) + declarationName = `get_${declarationName}`; + if (isSetAccessor(node)) + declarationName = `set_${declarationName}`; + if (node.name && isPrivateIdentifier(node.name)) + declarationName = `private_${declarationName}`; + if (isStatic(node)) + declarationName = `static_${declarationName}`; + return "_" + declarationName; + } + function createHelperVariable(node, suffix) { + return factory2.createUniqueName(`${getHelperVariableName(node)}_${suffix}`, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */); + } + function createLet(name, initializer) { + return factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ) + ], 1 /* Let */) + ); + } + function createClassInfo(node) { + let instanceExtraInitializersName; + let staticExtraInitializersName; + let hasStaticInitializers = false; + let hasNonAmbientInstanceFields = false; + let hasStaticPrivateClassElements = false; + for (const member of node.members) { + if (isNamedClassElement(member) && nodeOrChildIsDecorated( + /*legacyDecorators*/ + false, + member, + node + )) { + if (hasStaticModifier(member)) { + staticExtraInitializersName != null ? staticExtraInitializersName : staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */); + } else { + instanceExtraInitializersName != null ? instanceExtraInitializersName : instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */); + } + } + if (isClassStaticBlockDeclaration(member)) { + hasStaticInitializers = true; + } else if (isPropertyDeclaration(member)) { + if (hasStaticModifier(member)) { + hasStaticInitializers || (hasStaticInitializers = !!member.initializer || hasDecorators(member)); + } else { + hasNonAmbientInstanceFields || (hasNonAmbientInstanceFields = !isAmbientPropertyDeclaration(member)); + } + } + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + hasStaticPrivateClassElements = true; + } + if (staticExtraInitializersName && instanceExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) { + break; + } + } + return { + class: node, + instanceExtraInitializersName, + staticExtraInitializersName, + hasStaticInitializers, + hasNonAmbientInstanceFields, + hasStaticPrivateClassElements + }; + } + function containsLexicalSuperInStaticInitializer(node) { + for (const member of node.members) { + if (isClassStaticBlockDeclaration(member) || isPropertyDeclaration(member) && hasStaticModifier(member)) { + if (member.transformFlags & 134217728 /* ContainsLexicalSuper */) { + return true; + } + } + } + return false; + } + function transformClassLike(node, className) { + var _a2, _b, _c, _d, _e; + startLexicalEnvironment(); + const classReference = (_a2 = node.name) != null ? _a2 : factory2.getGeneratedNameForNode(node); + const classInfo2 = createClassInfo(node); + const classDefinitionStatements = []; + let leadingBlockStatements; + let trailingBlockStatements; + let syntheticConstructor; + let heritageClauses; + let shouldTransformPrivateStaticElementsInClass = false; + const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(node)); + if (classDecorators) { + classInfo2.classDecoratorsName = factory2.createUniqueName("_classDecorators", 16 /* Optimistic */); + classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */); + classInfo2.classExtraInitializersName = factory2.createUniqueName("_classExtraInitializers", 16 /* Optimistic */); + classInfo2.classThis = factory2.createUniqueName("_classThis", 16 /* Optimistic */); + classDefinitionStatements.push( + createLet(classInfo2.classDecoratorsName, factory2.createArrayLiteralExpression(classDecorators)), + createLet(classInfo2.classDescriptorName), + createLet(classInfo2.classExtraInitializersName, factory2.createArrayLiteralExpression()), + createLet(classInfo2.classThis) + ); + if (classInfo2.hasStaticPrivateClassElements) { + shouldTransformPrivateStaticElementsInClass = true; + shouldTransformPrivateStaticElementsInFile = true; + } + } + if (classDecorators && containsLexicalSuperInStaticInitializer(node)) { + const extendsClause = getHeritageClause(node.heritageClauses, 94 /* ExtendsKeyword */); + const extendsElement = extendsClause && firstOrUndefined(extendsClause.types); + const extendsExpression = extendsElement && visitNode(extendsElement.expression, visitor, isExpression); + if (extendsExpression) { + classInfo2.classSuper = factory2.createUniqueName("_classSuper", 16 /* Optimistic */); + const unwrapped = skipOuterExpressions(extendsExpression); + const safeExtendsExpression = isClassExpression(unwrapped) && !unwrapped.name || isFunctionExpression(unwrapped) && !unwrapped.name || isArrowFunction(unwrapped) ? factory2.createComma(factory2.createNumericLiteral(0), extendsExpression) : extendsExpression; + classDefinitionStatements.push(createLet(classInfo2.classSuper, safeExtendsExpression)); + const updatedExtendsElement = factory2.updateExpressionWithTypeArguments( + extendsElement, + classInfo2.classSuper, + /*typeArguments*/ + void 0 + ); + const updatedExtendsClause = factory2.updateHeritageClause(extendsClause, [updatedExtendsElement]); + heritageClauses = factory2.createNodeArray([updatedExtendsClause]); + } + } else { + heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + } + const renamedClassThis = (_b = classInfo2.classThis) != null ? _b : factory2.createThis(); + const needsSetNameHelper = !((_c = getOriginalNode(node, isClassLike)) == null ? void 0 : _c.name) && (classDecorators || !isStringLiteral(className) || !isEmptyStringLiteral(className)); + if (needsSetNameHelper) { + const setNameExpr = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), className); + leadingBlockStatements = append(leadingBlockStatements, factory2.createExpressionStatement(setNameExpr)); + } + enterClass(classInfo2); + let members = visitNodes2(node.members, classElementVisitor, isClassElement); + if (pendingExpressions) { + let outerThis; + for (let expression of pendingExpressions) { + expression = visitNode(expression, function thisVisitor(node2) { + if (!(node2.transformFlags & 16384 /* ContainsLexicalThis */)) { + return node2; + } + switch (node2.kind) { + case 108 /* ThisKeyword */: + if (!outerThis) { + outerThis = factory2.createUniqueName("_outerThis", 16 /* Optimistic */); + classDefinitionStatements.unshift(createLet(outerThis, factory2.createThis())); + } + return outerThis; + default: + return visitEachChild(node2, thisVisitor, context); + } + }, isExpression); + const statement = factory2.createExpressionStatement(expression); + leadingBlockStatements = append(leadingBlockStatements, statement); + } + pendingExpressions = void 0; + } + exitClass(); + if (classInfo2.instanceExtraInitializersName && !getFirstConstructorWithBody(node)) { + const initializerStatements = prepareConstructor(node, classInfo2); + if (initializerStatements) { + const extendsClauseElement = getEffectiveBaseTypeNode(node); + const isDerivedClass = !!(extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */); + const constructorStatements = []; + if (isDerivedClass) { + const spreadArguments = factory2.createSpreadElement(factory2.createIdentifier("arguments")); + const superCall = factory2.createCallExpression( + factory2.createSuper(), + /*typeArguments*/ + void 0, + [spreadArguments] + ); + constructorStatements.push(factory2.createExpressionStatement(superCall)); + } + addRange(constructorStatements, initializerStatements); + const constructorBody = factory2.createBlock( + constructorStatements, + /*multiLine*/ + true + ); + syntheticConstructor = factory2.createConstructorDeclaration( + /*modifiers*/ + void 0, + [], + constructorBody + ); + } + } + if (classInfo2.staticExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.staticExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.instanceExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.instanceExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (!isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticFieldDecorationStatements); + if (classInfo2.classDescriptorName && classInfo2.classDecoratorsName && classInfo2.classExtraInitializersName && classInfo2.classThis) { + leadingBlockStatements != null ? leadingBlockStatements : leadingBlockStatements = []; + const valueProperty = factory2.createPropertyAssignment("value", factory2.createThis()); + const classDescriptor = factory2.createObjectLiteralExpression([valueProperty]); + const classDescriptorAssignment = factory2.createAssignment(classInfo2.classDescriptorName, classDescriptor); + const classNameReference = factory2.createPropertyAccessExpression(factory2.createThis(), "name"); + const esDecorateHelper2 = emitHelpers().createESDecorateHelper( + factory2.createNull(), + classDescriptorAssignment, + classInfo2.classDecoratorsName, + { kind: "class", name: classNameReference }, + factory2.createNull(), + classInfo2.classExtraInitializersName + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateHelper2); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(node)); + leadingBlockStatements.push(esDecorateStatement); + const classDescriptorValueReference = factory2.createPropertyAccessExpression(classInfo2.classDescriptorName, "value"); + const classThisAssignment = factory2.createAssignment(classInfo2.classThis, classDescriptorValueReference); + const classReferenceAssignment = factory2.createAssignment(classReference, classThisAssignment); + leadingBlockStatements.push(factory2.createExpressionStatement(classReferenceAssignment)); + } + if (classInfo2.staticExtraInitializersName) { + const runStaticInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.staticExtraInitializersName); + const runStaticInitializersStatement = factory2.createExpressionStatement(runStaticInitializersHelper); + setSourceMapRange(runStaticInitializersStatement, (_d = node.name) != null ? _d : moveRangePastDecorators(node)); + leadingBlockStatements = append(leadingBlockStatements, runStaticInitializersStatement); + } + if (classInfo2.classExtraInitializersName) { + const runClassInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.classExtraInitializersName); + const runClassInitializersStatement = factory2.createExpressionStatement(runClassInitializersHelper); + setSourceMapRange(runClassInitializersStatement, (_e = node.name) != null ? _e : moveRangePastDecorators(node)); + trailingBlockStatements = append(trailingBlockStatements, runClassInitializersStatement); + } + if (leadingBlockStatements && trailingBlockStatements && !classInfo2.hasStaticInitializers) { + addRange(leadingBlockStatements, trailingBlockStatements); + trailingBlockStatements = void 0; + } + let newMembers = members; + if (leadingBlockStatements) { + const leadingStaticBlockBody = factory2.createBlock( + leadingBlockStatements, + /*multiline*/ + true + ); + const leadingStaticBlock = factory2.createClassStaticBlockDeclaration(leadingStaticBlockBody); + if (shouldTransformPrivateStaticElementsInClass) { + setInternalEmitFlags(leadingStaticBlock, 32 /* TransformPrivateStaticElements */); + } + newMembers = [leadingStaticBlock, ...newMembers]; + } + if (syntheticConstructor) { + newMembers = [...newMembers, syntheticConstructor]; + } + if (trailingBlockStatements) { + const trailingStaticBlockBody = factory2.createBlock( + trailingBlockStatements, + /*multiline*/ + true + ); + const trailingStaticBlock = factory2.createClassStaticBlockDeclaration(trailingStaticBlockBody); + newMembers = [...newMembers, trailingStaticBlock]; + } + if (newMembers !== members) { + members = setTextRange(factory2.createNodeArray(newMembers), members); + } + const lexicalEnvironment = endLexicalEnvironment(); + let classExpression; + if (classDecorators) { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + const classReferenceDeclaration = factory2.createVariableDeclaration( + classReference, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + classExpression + ); + const classReferenceVarDeclList = factory2.createVariableDeclarationList([classReferenceDeclaration]); + const returnExpr = classInfo2.classThis ? factory2.createAssignment(classReference, classInfo2.classThis) : classReference; + classDefinitionStatements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + classReferenceVarDeclList + ), + factory2.createReturnStatement(returnExpr) + ); + } else { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + classDefinitionStatements.push(factory2.createReturnStatement(classExpression)); + } + if (shouldTransformPrivateStaticElementsInClass) { + addInternalEmitFlags(classExpression, 32 /* TransformPrivateStaticElements */); + for (const member of classExpression.members) { + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + addInternalEmitFlags(member, 32 /* TransformPrivateStaticElements */); + } + } + } + setOriginalNode(classExpression, node); + getOrCreateEmitNode(classExpression).classThis = classInfo2.classThis; + return factory2.createImmediatelyInvokedArrowFunction(factory2.mergeLexicalEnvironment(classDefinitionStatements, lexicalEnvironment)); + } + function isDecoratedClassLike(node) { + return classOrConstructorParameterIsDecorated( + /*legacyDecorators*/ + false, + node + ) || childIsDecorated( + /*legacyDecorators*/ + false, + node + ); + } + function visitClassDeclaration(node) { + var _a2; + if (isDecoratedClassLike(node)) { + if (hasSyntacticModifier(node, 1 /* Export */) && hasSyntacticModifier(node, 1024 /* Default */)) { + const originalClass = (_a2 = getOriginalNode(node, isClassLike)) != null ? _a2 : node; + const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default"); + const iife = transformClassLike(node, className); + const statement = factory2.createExportDefault(iife); + setOriginalNode(statement, node); + setCommentRange(statement, getCommentRange(node)); + setSourceMapRange(statement, moveRangePastDecorators(node)); + return statement; + } else { + Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name."); + const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name)); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const varDecl = factory2.createVariableDeclaration( + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + const varDecls = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); + const statement = factory2.createVariableStatement(modifiers, varDecls); + setOriginalNode(statement, node); + setCommentRange(statement, getCommentRange(node)); + return statement; + } + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassDeclaration( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function visitClassExpression(node, referencedName) { + if (isDecoratedClassLike(node)) { + const className = node.name ? factory2.createStringLiteralFromNode(node.name) : referencedName != null ? referencedName : factory2.createStringLiteral(""); + const iife = transformClassLike(node, className); + setOriginalNode(iife, node); + return iife; + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassExpression( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function prepareConstructor(_parent, classInfo2) { + if (classInfo2.instanceExtraInitializersName && !classInfo2.hasNonAmbientInstanceFields) { + const statements = []; + statements.push( + factory2.createExpressionStatement( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + classInfo2.instanceExtraInitializersName + ) + ) + ); + return statements; + } + } + function visitConstructorDeclaration(node) { + enterClassElement(node); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const parameters = visitNodes2(node.parameters, visitor, isParameter); + let body; + if (node.body && classInfo) { + const initializerStatements = prepareConstructor(classInfo.class, classInfo); + if (initializerStatements) { + const statements = []; + const nonPrologueStart = factory2.copyPrologue( + node.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart)); + body = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + setOriginalNode(body, node.body); + setTextRange(body, node.body); + } + } + body != null ? body : body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return factory2.updateConstructorDeclaration(node, modifiers, parameters, body); + } + function finishClassElement(updated, original) { + if (updated !== original) { + setCommentRange(updated, original); + setSourceMapRange(updated, moveRangePastDecorators(original)); + } + return updated; + } + function partialTransformClassElement(member, useNamedEvaluation, classInfo2, createDescriptor) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let referencedName; + let name; + let initializersName; + let thisArg; + let descriptorName; + if (!classInfo2) { + const modifiers2 = visitNodes2(member.modifiers, modifierVisitor, isModifier); + enterName(); + if (useNamedEvaluation) { + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + } else { + name = visitPropertyName(member.name); + } + exitName(); + return { modifiers: modifiers2, referencedName, name, initializersName, descriptorName, thisArg }; + } + const memberDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClassElement( + member, + classInfo2.class, + /*useLegacyDecorators*/ + false + )); + const modifiers = visitNodes2(member.modifiers, modifierVisitor, isModifier); + if (memberDecorators) { + const memberDecoratorsName = createHelperVariable(member, "decorators"); + const memberDecoratorsArray = factory2.createArrayLiteralExpression(memberDecorators); + const memberDecoratorsAssignment = factory2.createAssignment(memberDecoratorsName, memberDecoratorsArray); + const memberInfo = { memberDecoratorsName }; + (_a2 = classInfo2.memberInfos) != null ? _a2 : classInfo2.memberInfos = /* @__PURE__ */ new Map(); + classInfo2.memberInfos.set(member, memberInfo); + pendingExpressions != null ? pendingExpressions : pendingExpressions = []; + pendingExpressions.push(memberDecoratorsAssignment); + const statements = isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? (_b = classInfo2.staticNonFieldDecorationStatements) != null ? _b : classInfo2.staticNonFieldDecorationStatements = [] : (_c = classInfo2.nonStaticNonFieldDecorationStatements) != null ? _c : classInfo2.nonStaticNonFieldDecorationStatements = [] : isPropertyDeclaration(member) && !isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? (_d = classInfo2.staticFieldDecorationStatements) != null ? _d : classInfo2.staticFieldDecorationStatements = [] : (_e = classInfo2.nonStaticFieldDecorationStatements) != null ? _e : classInfo2.nonStaticFieldDecorationStatements = [] : Debug.fail(); + const kind = isGetAccessorDeclaration(member) ? "getter" : isSetAccessorDeclaration(member) ? "setter" : isMethodDeclaration(member) ? "method" : isAutoAccessorPropertyDeclaration(member) ? "accessor" : isPropertyDeclaration(member) ? "field" : Debug.fail(); + let propertyName; + if (isIdentifier(member.name) || isPrivateIdentifier(member.name)) { + propertyName = { computed: false, name: member.name }; + } else if (isPropertyNameLiteral(member.name)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(member.name) }; + } else { + const expression = member.name.expression; + if (isPropertyNameLiteral(expression) && !isIdentifier(expression)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(expression) }; + } else { + enterName(); + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + propertyName = { computed: true, name: referencedName }; + exitName(); + } + } + const context2 = { + kind, + name: propertyName, + static: isStatic(member), + private: isPrivateIdentifier(member.name), + access: { + // 15.7.3 CreateDecoratorAccessObject (kind, name) + // 2. If _kind_ is ~field~, ~method~, ~accessor~, or ~getter~, then ... + get: isPropertyDeclaration(member) || isGetAccessorDeclaration(member) || isMethodDeclaration(member), + // 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ... + set: isPropertyDeclaration(member) || isSetAccessorDeclaration(member) + } + }; + const extraInitializers = isStatic(member) ? (_f = classInfo2.staticExtraInitializersName) != null ? _f : classInfo2.staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */) : (_g = classInfo2.instanceExtraInitializersName) != null ? _g : classInfo2.instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */); + if (isMethodOrAccessor(member)) { + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && createDescriptor) { + descriptor = createDescriptor(member, visitNodes2(modifiers, (node) => tryCast(node, isAsyncModifier), isModifier)); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper(factory2.createThis(), descriptor != null ? descriptor : factory2.createNull(), memberDecoratorsName, context2, factory2.createNull(), extraInitializers); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } else if (isPropertyDeclaration(member)) { + initializersName = (_h = memberInfo.memberInitializersName) != null ? _h : memberInfo.memberInitializersName = createHelperVariable(member, "initializers"); + if (isStatic(member)) { + thisArg = classInfo2.classThis; + } + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && hasAccessorModifier(member) && createDescriptor) { + descriptor = createDescriptor( + member, + /*modifiers*/ + void 0 + ); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper( + isAutoAccessorPropertyDeclaration(member) ? factory2.createThis() : factory2.createNull(), + descriptor != null ? descriptor : factory2.createNull(), + memberDecoratorsName, + context2, + initializersName, + extraInitializers + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } + } + if (name === void 0) { + enterName(); + if (useNamedEvaluation) { + ({ referencedName, name } = visitReferencedPropertyName(member.name)); + } else { + name = visitPropertyName(member.name); + } + exitName(); + } + if (!some(modifiers) && (isMethodDeclaration(member) || isPropertyDeclaration(member))) { + setEmitFlags(name, 1024 /* NoLeadingComments */); + } + return { modifiers, referencedName, name, initializersName, descriptorName, thisArg }; + } + function visitMethodDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createMethodDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createMethodDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateMethodDeclaration( + node, + modifiers, + node.asteriskToken, + name, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitGetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createGetAccessorDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createGetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateGetAccessorDeclaration( + node, + modifiers, + name, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitSetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name, descriptorName } = partialTransformClassElement( + node, + /*useNamedEvaluation*/ + false, + classInfo, + createSetAccessorDescriptorObject + ); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createSetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock); + exitClassElement(); + return finishClassElement(factory2.updateSetAccessorDeclaration(node, modifiers, name, parameters, body), node); + } + } + function visitClassStaticBlockDeclaration(node) { + enterClassElement(node); + if (classInfo) + classInfo.hasStaticInitializers = true; + const result = visitEachChild(node, visitor, context); + exitClassElement(); + return result; + } + function visitPropertyDeclaration(node) { + enterClassElement(node); + Debug.assert(!isAmbientPropertyDeclaration(node), "Not yet implemented."); + const useNamedEvaluation = isNamedEvaluation(node, isAnonymousClassNeedingAssignedName); + const { modifiers, name, referencedName, initializersName, descriptorName, thisArg } = partialTransformClassElement(node, useNamedEvaluation, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0); + startLexicalEnvironment(); + let initializer = referencedName ? visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression) : visitNode(node.initializer, visitor, isExpression); + if (initializersName) { + initializer = emitHelpers().createRunInitializersHelper( + thisArg != null ? thisArg : factory2.createThis(), + initializersName, + initializer != null ? initializer : factory2.createVoidZero() + ); + } + if (!isStatic(node) && (classInfo == null ? void 0 : classInfo.instanceExtraInitializersName) && !(classInfo == null ? void 0 : classInfo.hasInjectedInstanceInitializers)) { + classInfo.hasInjectedInstanceInitializers = true; + initializer != null ? initializer : initializer = factory2.createVoidZero(); + initializer = factory2.createParenthesizedExpression(factory2.createComma( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + classInfo.instanceExtraInitializersName + ), + initializer + )); + } + if (isStatic(node) && classInfo && initializer) { + classInfo.hasStaticInitializers = true; + } + const declarations = endLexicalEnvironment(); + if (some(declarations)) { + initializer = factory2.createImmediatelyInvokedArrowFunction([ + ...declarations, + factory2.createReturnStatement(initializer) + ]); + } + exitClassElement(); + if (hasAccessorModifier(node) && descriptorName) { + const commentRange = getCommentRange(node); + const sourceMapRange = getSourceMapRange(node); + const name2 = node.name; + let getterName = name2; + let setterName = name2; + if (isComputedPropertyName(name2) && !isSimpleInlineableExpression(name2.expression)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name2); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name2, visitNode(name2.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name2, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name2.expression); + const expression = visitNode(name2.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name2.expression); + getterName = factory2.updateComputedPropertyName(name2, assignment); + setterName = factory2.updateComputedPropertyName(name2, temp); + } + } + const modifiersWithoutAccessor = visitNodes2(modifiers, (node2) => node2.kind !== 127 /* AccessorKeyword */ ? node2 : void 0, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiersWithoutAccessor, initializer); + setOriginalNode(backingField, node); + setEmitFlags(backingField, 3072 /* NoComments */); + setSourceMapRange(backingField, sourceMapRange); + setSourceMapRange(backingField.name, node.name); + const getter = createGetAccessorDescriptorForwarder(modifiersWithoutAccessor, getterName, descriptorName); + setOriginalNode(getter, node); + setCommentRange(getter, commentRange); + setSourceMapRange(getter, sourceMapRange); + const setter = createSetAccessorDescriptorForwarder(modifiersWithoutAccessor, setterName, descriptorName); + setOriginalNode(setter, node); + setEmitFlags(setter, 3072 /* NoComments */); + setSourceMapRange(setter, sourceMapRange); + return [backingField, getter, setter]; + } + return finishClassElement(factory2.updatePropertyDeclaration( + node, + modifiers, + name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node); + } + function visitThisExpression(node) { + return classThis != null ? classThis : node; + } + function visitCallExpression(node) { + if (isSuperProperty(node.expression) && classThis) { + const expression = visitNode(node.expression, visitor, isExpression); + const argumentsList = visitNodes2(node.arguments, visitor, isExpression); + const invocation = factory2.createFunctionCallCall(expression, classThis, argumentsList); + setOriginalNode(invocation, node); + setTextRange(invocation, node); + return invocation; + } + return visitEachChild(node, visitor, context); + } + function visitTaggedTemplateExpression(node) { + if (isSuperProperty(node.tag) && classThis) { + const tag = visitNode(node.tag, visitor, isExpression); + const boundTag = factory2.createFunctionBindCall(tag, classThis, []); + setOriginalNode(boundTag, node); + setTextRange(boundTag, node); + const template = visitNode(node.template, visitor, isTemplateLiteral); + return factory2.updateTaggedTemplateExpression( + node, + boundTag, + /*typeArguments*/ + void 0, + template + ); + } + return visitEachChild(node, visitor, context); + } + function visitPropertyAccessExpression(node) { + if (isSuperProperty(node) && isIdentifier(node.name) && classThis && classSuper) { + const propertyName = factory2.createStringLiteralFromNode(node.name); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context); + } + function visitElementAccessExpression(node) { + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = visitNode(node.argumentExpression, visitor, isExpression); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context); + } + function visitParameterDeclaration(node) { + let updated; + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } else { + updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + visitNode(node.name, visitor, isBindingName), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + } + if (updated !== node) { + setCommentRange(updated, node); + setTextRange(updated, moveRangePastModifiers(node)); + setSourceMapRange(updated, moveRangePastModifiers(node)); + setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */); + } + return updated; + } + function isAnonymousClassNeedingAssignedName(node) { + return isClassExpression(node) && !node.name && isDecoratedClassLike(node); + } + function visitForStatement(node) { + return factory2.updateForStatement( + node, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, discardedValueVisitor, isExpression), + visitIterationBody(node.statement, visitor, context) + ); + } + function visitExpressionStatement(node) { + return visitEachChild(node, discardedValueVisitor, context); + } + function visitBinaryExpression(node, discarded) { + if (isDestructuringAssignment(node)) { + const left = visitAssignmentPattern(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression(node)) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isSuperProperty(node.left) && classThis && classSuper) { + let setterName = isElementAccessExpression(node.left) ? visitNode(node.left.argumentExpression, visitor, isExpression) : isIdentifier(node.left.name) ? factory2.createStringLiteralFromNode(node.left.name) : void 0; + if (setterName) { + let expression = visitNode(node.right, visitor, isExpression); + if (isCompoundAssignment(node.operatorToken.kind)) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + const superPropertyGet = factory2.createReflectGetCall( + classSuper, + getterName, + classThis + ); + setOriginalNode(superPropertyGet, node.left); + setTextRange(superPropertyGet, node.left); + expression = factory2.createBinaryExpression( + superPropertyGet, + getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), + expression + ); + setTextRange(expression, node); + } + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + if (temp) { + expression = factory2.createAssignment(temp, expression); + setTextRange(temp, node); + } + expression = factory2.createReflectSetCall( + classSuper, + setterName, + expression, + classThis + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + if (node.operatorToken.kind === 27 /* CommaToken */) { + const left = visitNode(node.left, discardedValueVisitor, isExpression); + const right = visitNode(node.right, discarded ? discardedValueVisitor : visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitEachChild(node, visitor, context); + } + function visitPreOrPostfixUnaryExpression(node, discarded) { + if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { + const operand = skipParentheses(node.operand); + if (isSuperProperty(operand) && classThis && classSuper) { + let setterName = isElementAccessExpression(operand) ? visitNode(operand.argumentExpression, visitor, isExpression) : isIdentifier(operand.name) ? factory2.createStringLiteralFromNode(operand.name) : void 0; + if (setterName) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + let expression = factory2.createReflectGetCall(classSuper, getterName, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); + expression = factory2.createReflectSetCall(classSuper, setterName, expression, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + return visitEachChild(node, visitor, context); + } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name2 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name2 }; + } + const referencedName = factory2.getGeneratedNameForNode(node); + hoistVariableDeclaration(referencedName); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name }; + } + function visitPropertyName(node) { + if (isComputedPropertyName(node)) { + return visitComputedPropertyName(node); + } + return visitNode(node, visitor, isPropertyName); + } + function visitComputedPropertyName(node) { + let expression = visitNode(node.expression, visitor, isExpression); + if (!isSimpleInlineableExpression(expression)) { + expression = injectPendingExpressions(expression); + } + return factory2.updateComputedPropertyName(node, expression); + } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const { referencedName, name } = visitReferencedPropertyName(node.name); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updatePropertyAssignment(node, name, initializer); + } + return visitEachChild(node, visitor, context); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateVariableDeclaration( + node, + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); + const propertyName = visitNode(node.propertyName, visitor, isPropertyName); + const name = visitNode(node.name, visitor, isBindingName); + const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateBindingElement( + node, + /*dotDotDotToken*/ + void 0, + propertyName, + name, + initializer + ); + } + return visitEachChild(node, visitor, context); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (propertyName) { + const paramName = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const expression = factory2.createAssignmentTargetWrapper( + paramName, + factory2.createReflectSetCall( + classSuper, + propertyName, + paramName, + classThis + ) + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + return expression; + } + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentElement(node) { + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentTarget = visitDestructuringAssignmentTarget(node.left); + let initializer; + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.left, node.right); + initializer = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + } else { + initializer = visitNode(node.right, visitor, isExpression); + } + return factory2.updateBinaryExpression(node, assignmentTarget, node.operatorToken, initializer); + } else { + return visitDestructuringAssignmentTarget(node); + } + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentProperty(node) { + const name = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name, assignmentElement); + } + return visitEachChild(node, visitor, context); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); + const name = visitNode(node.name, visitor, isIdentifier); + const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); + return factory2.updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer); + } + return visitEachChild(node, visitor, context); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + const elements = visitNodes2(node.elements, visitArrayAssignmentElement, isExpression); + return factory2.updateArrayLiteralExpression(node, elements); + } else { + const properties = visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike); + return factory2.updateObjectLiteralExpression(node, properties); + } + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + const referencedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); + return factory2.updateExportAssignment(node, modifiers, expression); + } + return visitEachChild(node, visitor, context); + } + function visitParenthesizedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function visitPartiallyEmittedExpression(node, discarded, referencedName) { + const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function injectPendingExpressions(expression) { + if (some(pendingExpressions)) { + if (isParenthesizedExpression(expression)) { + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); + } else { + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); + } + pendingExpressions = void 0; + } + return expression; + } + function transformAllDecoratorsOfDeclaration(allDecorators) { + if (!allDecorators) { + return void 0; + } + const decoratorExpressions = []; + addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); + return decoratorExpressions; + } + function transformDecorator(decorator) { + const expression = visitNode(decorator.expression, visitor, isExpression); + setEmitFlags(expression, 3072 /* NoComments */); + return expression; + } + function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) { + const func = factory2.createFunctionExpression( + modifiers, + asteriskToken, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body != null ? body : factory2.createBlock([]) + ); + setOriginalNode(func, original); + setSourceMapRange(func, moveRangePastDecorators(original)); + setEmitFlags(func, 3072 /* NoComments */); + const prefix = kind === "get" || kind === "set" ? kind : void 0; + const functionName = factory2.createStringLiteralFromNode( + name, + /*isSingleQuote*/ + void 0 + ); + const namedFunction = emitHelpers().createSetFunctionNameHelper(func, functionName, prefix); + const method = factory2.createPropertyAssignment(factory2.createIdentifier(kind), namedFunction); + setOriginalNode(method, original); + setSourceMapRange(method, moveRangePastDecorators(original)); + setEmitFlags(method, 3072 /* NoComments */); + return method; + } + function createMethodDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + node.asteriskToken, + "value", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createGetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createSetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ) + ]); + } + function createAccessorPropertyDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ) + ) + ]) + ), + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ), + factory2.createIdentifier("value") + ) + ) + ]) + ) + ]); + } + function createMethodDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("value") + ) + ) + ]) + ); + } + function createGetAccessorDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("get") + ), + factory2.createThis(), + [] + ) + ) + ]) + ); + } + function createSetAccessorDescriptorForwarder(modifiers, name, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createSetAccessorDeclaration( + modifiers, + name, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("set") + ), + factory2.createThis(), + [factory2.createIdentifier("value")] + ) + ) + ]) + ); + } + function getAssignedNameOfIdentifier(name, initializer) { + const originalClass = getOriginalNode(initializer, isClassLike); + return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); + } + } + var init_esDecorators = __esm({ + "src/compiler/transformers/esDecorators.ts"() { + "use strict"; + init_ts2(); + } + }); + // src/compiler/transformers/es2017.ts function transformES2017(context) { const { @@ -90879,21 +94176,21 @@ ${lanes.join("\n")} node.initializer, /*hasReceiver*/ true - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), visitIterationBody(node.statement, asyncBodyVisitor, context) ); } function visitForOfStatementInAsyncBody(node) { return factory2.updateForOfStatement( node, - visitNode(node.awaitModifier, visitor, isToken), + visitNode(node.awaitModifier, visitor, isAwaitKeyword), isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( node.initializer, /*hasReceiver*/ true - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), visitIterationBody(node.statement, asyncBodyVisitor, context) ); } @@ -90930,7 +94227,7 @@ ${lanes.join("\n")} function visitConstructorDeclaration(node) { return factory2.updateConstructorDeclaration( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), visitParameterList(node.parameters, visitor, context), transformMethodBody(node) ); @@ -90988,7 +94285,7 @@ ${lanes.join("\n")} function visitFunctionExpression(node) { return factory2.updateFunctionExpression( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), node.asteriskToken, node.name, /*typeParameters*/ @@ -91002,7 +94299,7 @@ ${lanes.join("\n")} function visitArrowFunction(node) { return factory2.updateArrowFunction( node, - visitNodes2(node.modifiers, visitor, isModifierLike), + visitNodes2(node.modifiers, visitor, isModifier), /*typeParameters*/ void 0, visitParameterList(node.parameters, visitor, context), @@ -91059,7 +94356,7 @@ ${lanes.join("\n")} ), node ); - return visitNode(converted, visitor, isExpression); + return Debug.checkDefined(visitNode(converted, visitor, isExpression)); } function collidesWithParameterName({ name }) { if (isIdentifier(name)) { @@ -91191,7 +94488,7 @@ ${lanes.join("\n")} if (isBlock(body)) { return factory2.updateBlock(body, visitNodes2(body.statements, asyncBodyVisitor, isStatement, start)); } else { - return factory2.converters.convertToFunctionBlock(visitNode(body, asyncBodyVisitor, isConciseBody)); + return factory2.converters.convertToFunctionBlock(Debug.checkDefined(visitNode(body, asyncBodyVisitor, isConciseBody))); } } function getPromiseConstructor(type) { @@ -91552,7 +94849,7 @@ ${lanes.join("\n")} return visitObjectLiteralExpression(node); case 223 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 295 /* CatchClause */: return visitCatchClause(node); @@ -92310,7 +95607,7 @@ ${lanes.join("\n")} /*questionToken*/ void 0, visitor, - isToken + isQuestionToken ), /*typeParameters*/ void 0, @@ -93002,15 +96299,10 @@ ${lanes.join("\n")} if ((node.transformFlags & 16 /* ContainsES2021 */) === 0) { return node; } - switch (node.kind) { - case 223 /* BinaryExpression */: - const binaryExpression = node; - if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { - return transformLogicalAssignment(binaryExpression); - } - default: - return visitEachChild(node, visitor, context); + if (isLogicalOrCoalescingAssignmentExpression(node)) { + return transformLogicalAssignment(node); } + return visitEachChild(node, visitor, context); } function transformLogicalAssignment(binaryExpression) { const operator = binaryExpression.operatorToken; @@ -93152,7 +96444,7 @@ ${lanes.join("\n")} factory2.createIdentifier(name), generatedName ); - generatedName.generatedImportReference = specifier; + setIdentifierGeneratedImportReference(generatedName, specifier); specifierSourceImports.set(name, specifier); return generatedName; } @@ -93468,7 +96760,7 @@ ${lanes.join("\n")} return element; } function transformJsxSpreadAttributeToSpreadAssignment(node) { - return factory2.createSpreadAssignment(visitNode(node.expression, visitor, isExpression)); + return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); } function transformJsxAttributesToObjectProps(attrs, children) { const target = getEmitScriptTarget(compilerOptions); @@ -93498,7 +96790,7 @@ ${lanes.join("\n")} return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions); } function transformJsxSpreadAttributeToExpression(node) { - return visitNode(node.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); } function transformJsxAttributeToObjectLiteralElement(node) { const name = getAttributeName(node); @@ -93518,7 +96810,7 @@ ${lanes.join("\n")} if (node.expression === void 0) { return factory2.createTrue(); } - return visitNode(node.expression, visitor, isExpression); + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); } if (isJsxElement(node)) { return visitJsxElement( @@ -94042,7 +97334,7 @@ ${lanes.join("\n")} node, /*lookInLabeledStatements*/ false - ) && shouldConvertIterationStatement(node) || (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) !== 0; + ) && shouldConvertIterationStatement(node) || (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { return shouldVisitNode(node) ? visitorWorker( @@ -94173,7 +97465,7 @@ ${lanes.join("\n")} return visitParenthesizedExpression(node, expressionResultIsUnused2); case 223 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -94276,7 +97568,7 @@ ${lanes.join("\n")} [ factory2.createPropertyAssignment( factory2.createIdentifier("value"), - node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() + node.expression ? Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) : factory2.createVoidZero() ) ] ) @@ -94308,7 +97600,7 @@ ${lanes.join("\n")} return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments")); } } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { return setOriginalNode(setTextRange( factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)), node @@ -94447,7 +97739,7 @@ ${lanes.join("\n")} outer, /*typeArguments*/ void 0, - extendsClauseElement ? [visitNode(extendsClauseElement.expression, visitor, isExpression)] : [] + extendsClauseElement ? [Debug.checkDefined(visitNode(extendsClauseElement.expression, visitor, isExpression))] : [] ) ); addSyntheticLeadingComment(result, 3 /* MultiLineCommentTrivia */, "* @class "); @@ -94789,7 +98081,7 @@ ${lanes.join("\n")} factory2.createExpressionStatement( factory2.createAssignment( factory2.getGeneratedNameForNode(parameter), - visitNode(initializer, visitor, isExpression) + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) ) ), 2097152 /* CustomPrologue */ @@ -94800,7 +98092,7 @@ ${lanes.join("\n")} return false; } function insertDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { - initializer = visitNode(initializer, visitor, isExpression); + initializer = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); const statement = factory2.createIfStatement( factory2.createTypeCheck(factory2.cloneNode(name), "undefined"), setEmitFlags( @@ -95076,6 +98368,7 @@ ${lanes.join("\n")} container ); const propertyName = visitNode(member.name, visitor, isPropertyName); + Debug.assert(propertyName); let e; if (!isPrivateIdentifier(propertyName) && getUseDefineForClassFields(context.getCompilerOptions())) { const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; @@ -95119,6 +98412,7 @@ ${lanes.join("\n")} setEmitFlags(target, 3072 /* NoComments */ | 64 /* NoTrailingSourceMap */); setSourceMapRange(target, firstAccessor.name); const visitedAccessorName = visitNode(firstAccessor.name, visitor, isPropertyName); + Debug.assert(visitedAccessorName); if (isPrivateIdentifier(visitedAccessorName)) { return Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015."); } @@ -95391,9 +98685,9 @@ ${lanes.join("\n")} if (node.operatorToken.kind === 27 /* CommaToken */) { return factory2.updateBinaryExpression( node, - visitNode(node.left, visitorWithUnusedExpressionResult, isExpression), + Debug.checkDefined(visitNode(node.left, visitorWithUnusedExpressionResult, isExpression)), node.operatorToken, - visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression) + Debug.checkDefined(visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -95408,6 +98702,7 @@ ${lanes.join("\n")} const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression); if (result || visited !== element) { result || (result = node.elements.slice(0, i)); + Debug.assert(visited); result.push(visited); } } @@ -95415,7 +98710,7 @@ ${lanes.join("\n")} return factory2.updateCommaListExpression(node, elements); } function isVariableStatementOfTypeScriptClassWrapper(node) { - return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getEmitFlags(node.declarationList.declarations[0].initializer) & 67108864 /* TypeScriptClassWrapper */); + return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */); } function visitVariableStatement(node) { const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); @@ -95434,7 +98729,7 @@ ${lanes.join("\n")} 0 /* All */ ); } else { - assignment = factory2.createBinaryExpression(decl.name, 63 /* EqualsToken */, visitNode(decl.initializer, visitor, isExpression)); + assignment = factory2.createBinaryExpression(decl.name, 63 /* EqualsToken */, Debug.checkDefined(visitNode(decl.initializer, visitor, isExpression))); setTextRange(assignment, decl); } assignments = append(assignments, assignment); @@ -95456,7 +98751,7 @@ ${lanes.join("\n")} if (node.flags & 3 /* BlockScoped */) { enableSubstitutionsForBlockScopedBindings(); } - const declarations = flatMap(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration); + const declarations = visitNodes2(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration, isVariableDeclaration); const declarationList = factory2.createVariableDeclarationList(declarations); setOriginalNode(declarationList, node); setTextRange(declarationList, node); @@ -95540,7 +98835,7 @@ ${lanes.join("\n")} statement, /*outermostLabeledStatement*/ node - ) : factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node, convertedLoopState && resetLabel); + ) : factory2.restoreEnclosingLabel(Debug.checkDefined(visitNode(statement, visitor, isStatement, factory2.liftToBlock)), node, convertedLoopState && resetLabel); } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { @@ -95583,7 +98878,7 @@ ${lanes.join("\n")} visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer), visitNode(node.condition, visitor, isExpression), visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression), - visitNode(node.statement, visitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) ); } function visitForInStatement(node, outermostLabeledStatement) { @@ -95669,13 +98964,14 @@ ${lanes.join("\n")} ))); } else { setTextRangeEnd(assignment, initializer.end); - statements.push(setTextRange(factory2.createExpressionStatement(visitNode(assignment, visitor, isExpression)), moveRangeEnd(initializer, -1))); + statements.push(setTextRange(factory2.createExpressionStatement(Debug.checkDefined(visitNode(assignment, visitor, isExpression))), moveRangeEnd(initializer, -1))); } } if (convertedLoopBodyStatements) { return createSyntheticBlockForConvertedStatements(addRange(statements, convertedLoopBodyStatements)); } else { const statement = visitNode(node.statement, visitor, isStatement, factory2.liftToBlock); + Debug.assert(statement); if (isBlock(statement)) { return factory2.updateBlock(statement, setTextRange(factory2.createNodeArray(concatenate(statements, statement.statements)), statement.statements)); } else { @@ -95696,6 +98992,7 @@ ${lanes.join("\n")} } function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const counter = factory2.createLoopVariable(); const rhsReference = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( /*recordTempVariable*/ @@ -95755,6 +99052,7 @@ ${lanes.join("\n")} } function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) { const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const iterator = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( /*recordTempVariable*/ void 0 @@ -96012,7 +99310,7 @@ ${lanes.join("\n")} loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); } } else { - const clone2 = convertIterationStatementCore(node, initializerFunction, visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)); + const clone2 = convertIterationStatementCore(node, initializerFunction, Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))); loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); } statements.push(loop); @@ -96050,16 +99348,16 @@ ${lanes.join("\n")} node, /*awaitModifier*/ void 0, - visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } function convertForInStatement(node, convertedLoopBody) { return factory2.updateForInStatement( node, - visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } @@ -96067,13 +99365,13 @@ ${lanes.join("\n")} return factory2.updateDoStatement( node, convertedLoopBody, - visitNode(node.expression, visitor, isExpression) + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) ); } function convertWhileStatement(node, convertedLoopBody) { return factory2.updateWhileStatement( node, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), convertedLoopBody ); } @@ -96235,7 +99533,7 @@ ${lanes.join("\n")} void 0, /*type*/ void 0, - visitNode( + Debug.checkDefined(visitNode( factory2.createBlock( statements, /*multiLine*/ @@ -96243,7 +99541,7 @@ ${lanes.join("\n")} ), visitor, isBlock - ) + )) ), emitFlags ) @@ -96266,7 +99564,7 @@ ${lanes.join("\n")} if (node.incrementor) { statements.push(factory2.createIfStatement( currentState.conditionVariable, - factory2.createExpressionStatement(visitNode(node.incrementor, visitor, isExpression)), + factory2.createExpressionStatement(Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression))), factory2.createExpressionStatement(factory2.createAssignment(currentState.conditionVariable, factory2.createTrue())) )); } else { @@ -96277,11 +99575,12 @@ ${lanes.join("\n")} } if (shouldConvertConditionOfForStatement(node)) { statements.push(factory2.createIfStatement( - factory2.createPrefixUnaryExpression(53 /* ExclamationToken */, visitNode(node.condition, visitor, isExpression)), - visitNode(factory2.createBreakStatement(), visitor, isStatement) + factory2.createPrefixUnaryExpression(53 /* ExclamationToken */, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))), + Debug.checkDefined(visitNode(factory2.createBreakStatement(), visitor, isStatement)) )); } } + Debug.assert(statement); if (isBlock(statement)) { addRange(statements, statement.statements); } else { @@ -96549,9 +99848,9 @@ ${lanes.join("\n")} createMemberAccessForPropertyName( factory2, receiver, - visitNode(property.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) ), - visitNode(property.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(property.initializer, visitor, isExpression)) ); setTextRange(expression, property); if (startsOnNewLine) { @@ -96564,7 +99863,7 @@ ${lanes.join("\n")} createMemberAccessForPropertyName( factory2, receiver, - visitNode(property.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) ), factory2.cloneNode(property.name) ); @@ -96579,7 +99878,7 @@ ${lanes.join("\n")} createMemberAccessForPropertyName( factory2, receiver, - visitNode(method.name, visitor, isPropertyName) + Debug.checkDefined(visitNode(method.name, visitor, isPropertyName)) ), transformFunctionLikeToExpression( method, @@ -96700,7 +99999,7 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitCallExpression(node) { - if (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) { + if (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) { return visitTypeScriptClassWrapper(node); } const expression = skipOuterExpressions(node.expression); @@ -96713,7 +100012,7 @@ ${lanes.join("\n")} } return factory2.updateCallExpression( node, - visitNode(node.expression, callExpressionVisitor, isExpression), + Debug.checkDefined(visitNode(node.expression, callExpressionVisitor, isExpression)), /*typeArguments*/ void 0, visitNodes2(node.arguments, visitor, isExpression) @@ -96765,7 +100064,14 @@ ${lanes.join("\n")} if (classBodyEnd < -1) { addRange(statements, funcStatements, classBodyEnd + 1); } - addRange(statements, remainingStatements); + const returnStatement = tryCast(elementAt(funcStatements, classBodyEnd), isReturnStatement); + for (const statement of remainingStatements) { + if (isReturnStatement(statement) && (returnStatement == null ? void 0 : returnStatement.expression) && !isIdentifier(returnStatement.expression)) { + statements.push(returnStatement); + } else { + statements.push(statement); + } + } addRange( statements, classStatements, @@ -96825,8 +100131,8 @@ ${lanes.join("\n")} let resultingCall; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { resultingCall = factory2.createFunctionApplyCall( - visitNode(target, callExpressionVisitor, isExpression), - node.expression.kind === 106 /* SuperKeyword */ ? thisArg : visitNode(thisArg, visitor, isExpression), + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 106 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), transformAndSpreadElements( node.arguments, /*isArgumentList*/ @@ -96840,8 +100146,8 @@ ${lanes.join("\n")} } else { resultingCall = setTextRange( factory2.createFunctionCallCall( - visitNode(target, callExpressionVisitor, isExpression), - node.expression.kind === 106 /* SuperKeyword */ ? thisArg : visitNode(thisArg, visitor, isExpression), + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 106 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), visitNodes2(node.arguments, visitor, isExpression) ), node @@ -96863,7 +100169,7 @@ ${lanes.join("\n")} const { target, thisArg } = factory2.createCallBinding(factory2.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration); return factory2.createNewExpression( factory2.createFunctionApplyCall( - visitNode(target, visitor, isExpression), + Debug.checkDefined(visitNode(target, visitor, isExpression)), thisArg, transformAndSpreadElements( factory2.createNodeArray([factory2.createVoidZero(), ...node.arguments]), @@ -96920,7 +100226,9 @@ ${lanes.join("\n")} return map(chunk, visitExpressionOfSpread); } function visitExpressionOfSpread(node) { + Debug.assertNode(node, isSpreadElement); let expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); const isCallToReadHelper = isCallToHelper(expression, "___read"); let kind = isCallToReadHelper || isPackedArrayLiteral(expression) ? 2 /* PackedSpread */ : 1 /* UnpackedSpread */; if (compilerOptions.downlevelIteration && kind === 1 /* UnpackedSpread */ && !isArrayLiteralExpression(expression) && !isCallToReadHelper) { @@ -96971,7 +100279,7 @@ ${lanes.join("\n")} function visitTemplateExpression(node) { let expression = factory2.createStringLiteral(node.head.text); for (const span of node.templateSpans) { - const args = [visitNode(span.expression, visitor, isExpression)]; + const args = [Debug.checkDefined(visitNode(span.expression, visitor, isExpression))]; if (span.literal.text.length > 0) { args.push(factory2.createStringLiteral(span.literal.text)); } @@ -97195,7 +100503,7 @@ ${lanes.join("\n")} return node; } function trySubstituteReservedName(name) { - const token = name.originalKeywordKind || (nodeIsSynthesized(name) ? stringToToken(idText(name)) : void 0); + const token = identifierToKeywordKind(name); if (token !== void 0 && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) { return setTextRange(factory2.createStringLiteralFromNode(name), name); } @@ -97337,7 +100645,7 @@ ${lanes.join("\n")} switch (node.kind) { case 223 /* BinaryExpression */: return visitBinaryExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node); case 224 /* ConditionalExpression */: return visitConditionalExpression(node); @@ -97549,19 +100857,19 @@ ${lanes.join("\n")} case 208 /* PropertyAccessExpression */: target = factory2.updatePropertyAccessExpression( left, - cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)), + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), left.name ); break; case 209 /* ElementAccessExpression */: target = factory2.updateElementAccessExpression( left, - cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)), - cacheExpression(visitNode(left.argumentExpression, visitor, isExpression)) + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), + cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression))) ); break; default: - target = visitNode(left, visitor, isExpression); + target = Debug.checkDefined(visitNode(left, visitor, isExpression)); break; } const operator = node.operatorToken.kind; @@ -97573,7 +100881,7 @@ ${lanes.join("\n")} factory2.createBinaryExpression( cacheExpression(target), getNonAssignmentOperatorForCompoundAssignment(operator), - visitNode(right, visitor, isExpression) + Debug.checkDefined(visitNode(right, visitor, isExpression)) ), node ) @@ -97581,7 +100889,7 @@ ${lanes.join("\n")} node ); } else { - return factory2.updateBinaryExpression(node, target, node.operatorToken, visitNode(right, visitor, isExpression)); + return factory2.updateBinaryExpression(node, target, node.operatorToken, Debug.checkDefined(visitNode(right, visitor, isExpression))); } } return visitEachChild(node, visitor, context); @@ -97595,9 +100903,9 @@ ${lanes.join("\n")} } return factory2.updateBinaryExpression( node, - cacheExpression(visitNode(node.left, visitor, isExpression)), + cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))), node.operatorToken, - visitNode(node.right, visitor, isExpression) + Debug.checkDefined(visitNode(node.right, visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -97616,7 +100924,7 @@ ${lanes.join("\n")} emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); pendingExpressions = []; } - pendingExpressions.push(visitNode(node2, visitor, isExpression)); + pendingExpressions.push(Debug.checkDefined(visitNode(node2, visitor, isExpression))); } } } @@ -97630,7 +100938,7 @@ ${lanes.join("\n")} emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); pendingExpressions = []; } - pendingExpressions.push(visitNode(elem, visitor, isExpression)); + pendingExpressions.push(Debug.checkDefined(visitNode(elem, visitor, isExpression))); } } return factory2.inlineExpressions(pendingExpressions); @@ -97640,7 +100948,7 @@ ${lanes.join("\n")} const resultLocal = declareLocal(); emitAssignment( resultLocal, - visitNode(node.left, visitor, isExpression), + Debug.checkDefined(visitNode(node.left, visitor, isExpression)), /*location*/ node.left ); @@ -97661,7 +100969,7 @@ ${lanes.join("\n")} } emitAssignment( resultLocal, - visitNode(node.right, visitor, isExpression), + Debug.checkDefined(visitNode(node.right, visitor, isExpression)), /*location*/ node.right ); @@ -97675,13 +100983,13 @@ ${lanes.join("\n")} const resultLocal = declareLocal(); emitBreakWhenFalse( whenFalseLabel, - visitNode(node.condition, visitor, isExpression), + Debug.checkDefined(visitNode(node.condition, visitor, isExpression)), /*location*/ node.condition ); emitAssignment( resultLocal, - visitNode(node.whenTrue, visitor, isExpression), + Debug.checkDefined(visitNode(node.whenTrue, visitor, isExpression)), /*location*/ node.whenTrue ); @@ -97689,7 +100997,7 @@ ${lanes.join("\n")} markLabel(whenFalseLabel); emitAssignment( resultLocal, - visitNode(node.whenFalse, visitor, isExpression), + Debug.checkDefined(visitNode(node.whenFalse, visitor, isExpression)), /*location*/ node.whenFalse ); @@ -97769,7 +101077,7 @@ ${lanes.join("\n")} leadingElement = void 0; expressions2 = []; } - expressions2.push(visitNode(element, visitor, isExpression)); + expressions2.push(Debug.checkDefined(visitNode(element, visitor, isExpression))); return expressions2; } } @@ -97808,8 +101116,8 @@ ${lanes.join("\n")} if (containsYield(node.argumentExpression)) { return factory2.updateElementAccessExpression( node, - cacheExpression(visitNode(node.expression, visitor, isLeftHandSideExpression)), - visitNode(node.argumentExpression, visitor, isExpression) + cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))), + Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression)) ); } return visitEachChild(node, visitor, context); @@ -97826,7 +101134,7 @@ ${lanes.join("\n")} return setOriginalNode( setTextRange( factory2.createFunctionApplyCall( - cacheExpression(visitNode(target, visitor, isLeftHandSideExpression)), + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isLeftHandSideExpression))), thisArg, visitElements(node.arguments) ), @@ -97844,7 +101152,7 @@ ${lanes.join("\n")} setTextRange( factory2.createNewExpression( factory2.createFunctionApplyCall( - cacheExpression(visitNode(target, visitor, isExpression)), + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isExpression))), thisArg, visitElements( node.arguments, @@ -97960,7 +101268,7 @@ ${lanes.join("\n")} return setSourceMapRange( factory2.createAssignment( setSourceMapRange(factory2.cloneNode(node.name), node.name), - visitNode(node.initializer, visitor, isExpression) + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) ), node ); @@ -97972,7 +101280,7 @@ ${lanes.join("\n")} const elseLabel = node.elseStatement ? defineLabel() : void 0; emitBreakWhenFalse( node.elseStatement ? elseLabel : endLabel, - visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), /*location*/ node.expression ); @@ -98001,7 +101309,7 @@ ${lanes.join("\n")} markLabel(loopLabel); transformAndEmitEmbeddedStatement(node.statement); markLabel(conditionLabel); - emitBreakWhenTrue(loopLabel, visitNode(node.expression, visitor, isExpression)); + emitBreakWhenTrue(loopLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); endLoopBlock(); } else { emitStatement(visitNode(node, visitor, isStatement)); @@ -98022,7 +101330,7 @@ ${lanes.join("\n")} const loopLabel = defineLabel(); const endLabel = beginLoopBlock(loopLabel); markLabel(loopLabel); - emitBreakWhenFalse(endLabel, visitNode(node.expression, visitor, isExpression)); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); transformAndEmitEmbeddedStatement(node.statement); emitBreak(loopLabel); endLoopBlock(); @@ -98053,7 +101361,7 @@ ${lanes.join("\n")} emitStatement( setTextRange( factory2.createExpressionStatement( - visitNode(initializer, visitor, isExpression) + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) ), initializer ) @@ -98062,7 +101370,7 @@ ${lanes.join("\n")} } markLabel(conditionLabel); if (node.condition) { - emitBreakWhenFalse(endLabel, visitNode(node.condition, visitor, isExpression)); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))); } transformAndEmitEmbeddedStatement(node.statement); markLabel(incrementLabel); @@ -98070,7 +101378,7 @@ ${lanes.join("\n")} emitStatement( setTextRange( factory2.createExpressionStatement( - visitNode(node.incrementor, visitor, isExpression) + Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression)) ), node.incrementor ) @@ -98115,7 +101423,7 @@ ${lanes.join("\n")} const keysIndex = factory2.createLoopVariable(); const initializer = node.initializer; hoistVariableDeclaration(keysIndex); - emitAssignment(obj, visitNode(node.expression, visitor, isExpression)); + emitAssignment(obj, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); emitAssignment(keysArray, factory2.createArrayLiteralExpression()); emitStatement( factory2.createForInStatement( @@ -98146,7 +101454,7 @@ ${lanes.join("\n")} } variable = factory2.cloneNode(initializer.declarations[0].name); } else { - variable = visitNode(initializer, visitor, isExpression); + variable = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); Debug.assert(isLeftHandSideExpression(variable)); } emitAssignment(variable, key); @@ -98171,8 +101479,8 @@ ${lanes.join("\n")} node = factory2.updateForInStatement( node, initializer.declarations[0].name, - visitNode(node.expression, visitor, isExpression), - visitNode(node.statement, visitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) ); } else { node = visitEachChild(node, visitor, context); @@ -98248,7 +101556,7 @@ ${lanes.join("\n")} } function transformAndEmitWithStatement(node) { if (containsYield(node)) { - beginWithBlock(cacheExpression(visitNode(node.expression, visitor, isExpression))); + beginWithBlock(cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)))); transformAndEmitEmbeddedStatement(node.statement); endWithBlock(); } else { @@ -98260,7 +101568,7 @@ ${lanes.join("\n")} const caseBlock = node.caseBlock; const numClauses = caseBlock.clauses.length; const endLabel = beginSwitchBlock(); - const expression = cacheExpression(visitNode(node.expression, visitor, isExpression)); + const expression = cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); const clauseLabels = []; let defaultClauseIndex = -1; for (let i = 0; i < numClauses; i++) { @@ -98282,7 +101590,7 @@ ${lanes.join("\n")} } pendingClauses.push( factory2.createCaseClause( - visitNode(clause.expression, visitor, isExpression), + Debug.checkDefined(visitNode(clause.expression, visitor, isExpression)), [ createInlineBreak( clauseLabels[i], @@ -98352,7 +101660,7 @@ ${lanes.join("\n")} function transformAndEmitThrowStatement(node) { var _a2; emitThrow( - visitNode((_a2 = node.expression) != null ? _a2 : factory2.createVoidZero(), visitor, isExpression), + Debug.checkDefined(visitNode((_a2 = node.expression) != null ? _a2 : factory2.createVoidZero(), visitor, isExpression)), /*location*/ node ); @@ -98708,7 +102016,7 @@ ${lanes.join("\n")} } return 0; } - function createLabel2(label) { + function createLabel(label) { if (label !== void 0 && label > 0) { if (labelExpressions === void 0) { labelExpressions = []; @@ -98734,7 +102042,7 @@ ${lanes.join("\n")} factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), location @@ -98939,10 +102247,10 @@ ${lanes.join("\n")} void 0, [ factory2.createArrayLiteralExpression([ - createLabel2(startLabel), - createLabel2(catchLabel), - createLabel2(finallyLabel), - createLabel2(endLabel) + createLabel(startLabel), + createLabel(catchLabel), + createLabel(finallyLabel), + createLabel(endLabel) ]) ] ) @@ -99118,7 +102426,7 @@ ${lanes.join("\n")} factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -99137,7 +102445,7 @@ ${lanes.join("\n")} factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -99159,7 +102467,7 @@ ${lanes.join("\n")} factory2.createReturnStatement( factory2.createArrayLiteralExpression([ createInstruction(3 /* Break */), - createLabel2(label) + createLabel(label) ]) ), operationLocation @@ -99642,7 +102950,7 @@ ${lanes.join("\n")} } function addExportEqualsIfNeeded(statements, emitAsReturn) { if (currentModuleInfo.exportEquals) { - const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor); + const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor, isExpression); if (expressionResult) { if (emitAsReturn) { const statement = factory2.createReturnStatement(expressionResult); @@ -99682,9 +102990,9 @@ ${lanes.join("\n")} return visitFunctionDeclaration(node); case 260 /* ClassDeclaration */: return visitClassDeclaration(node); - case 357 /* MergeDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 358 /* EndOfDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return visitor(node); @@ -99701,7 +103009,7 @@ ${lanes.join("\n")} return visitExpressionStatement(node); case 214 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); case 210 /* CallExpression */: if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) { @@ -99837,7 +103145,7 @@ ${lanes.join("\n")} } function visitImportCallExpression(node) { const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; const containsLexicalThis = !!(node.transformFlags & 16384 /* ContainsLexicalThis */); switch (compilerOptions.module) { @@ -100046,7 +103354,7 @@ ${lanes.join("\n")} return downleveledImport; } function getHelperExpressionForExport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { return innerExpr; } if (getExportNeedsImportStarHelper(node)) { @@ -100055,7 +103363,7 @@ ${lanes.join("\n")} return innerExpr; } function getHelperExpressionForImport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { return innerExpr; } if (getImportNeedsImportStarHelper(node)) { @@ -100300,7 +103608,7 @@ ${lanes.join("\n")} ) ); } else { - const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default"; + const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default"; const exportedValue = factory2.createPropertyAccessExpression( exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, specifier.propertyName || specifier.name @@ -100366,7 +103674,7 @@ ${lanes.join("\n")} deferredExports[id] = appendExportStatement( deferredExports[id], factory2.createIdentifier("default"), - visitNode(node.expression, visitor), + visitNode(node.expression, visitor, isExpression), /*location*/ node, /*allowComments*/ @@ -100376,7 +103684,7 @@ ${lanes.join("\n")} statements = appendExportStatement( statements, factory2.createIdentifier("default"), - visitNode(node.expression, visitor), + visitNode(node.expression, visitor, isExpression), /*location*/ node, /*allowComments*/ @@ -100404,7 +103712,7 @@ ${lanes.join("\n")} ), /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitEachChild(node.body, visitor, context) @@ -100445,8 +103753,8 @@ ${lanes.join("\n")} ), /*typeParameters*/ void 0, - visitNodes2(node.heritageClauses, visitor), - visitNodes2(node.members, visitor) + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + visitNodes2(node.members, visitor, isClassElement) ), node ), @@ -100476,7 +103784,23 @@ ${lanes.join("\n")} if (!modifiers) { modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); } - variables = append(variables, variable); + if (variable.initializer) { + const updatedVariable = factory2.updateVariableDeclaration( + variable, + variable.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createExportExpression( + variable.name, + visitNode(variable.initializer, visitor, isExpression) + ) + ); + variables = append(variables, updatedVariable); + } else { + variables = append(variables, variable); + } } else if (variable.initializer) { if (!isBindingPattern(variable.name) && (isArrowFunction(variable.initializer) || isFunctionExpression(variable.initializer) || isClassExpression(variable.initializer))) { const expression = factory2.createAssignment( @@ -100494,7 +103818,7 @@ ${lanes.join("\n")} variable.name, variable.exclamationToken, variable.type, - visitNode(variable.initializer, visitor) + visitNode(variable.initializer, visitor, isExpression) ); variables = append(variables, updatedVariable); expressions = append(expressions, expression); @@ -100545,9 +103869,8 @@ ${lanes.join("\n")} function transformInitializedVariable(node) { if (isBindingPattern(node.name)) { return flattenDestructuringAssignment( - visitNode(node, visitor), - /*visitor*/ - void 0, + visitNode(node, visitor, isInitializedVariable), + visitor, context, 0 /* All */, /*needsValue*/ @@ -100564,7 +103887,7 @@ ${lanes.join("\n")} /*location*/ node.name ), - node.initializer ? visitNode(node.initializer, visitor) : factory2.createVoidZero() + node.initializer ? visitNode(node.initializer, visitor, isExpression) : factory2.createVoidZero() ); } } @@ -100834,7 +104157,7 @@ ${lanes.join("\n")} const expression = substituteExpressionIdentifier(node.expression); noSubstitution[getNodeId(expression)] = true; if (!isIdentifier(expression) && !(getEmitFlags(node.expression) & 8192 /* HelperName */)) { - return addEmitFlags( + return addInternalEmitFlags( factory2.updateCallExpression( node, expression, @@ -100842,7 +104165,7 @@ ${lanes.join("\n")} void 0, node.arguments ), - 1073741824 /* IndirectCall */ + 16 /* IndirectCall */ ); } } @@ -100853,7 +104176,7 @@ ${lanes.join("\n")} const tag = substituteExpressionIdentifier(node.tag); noSubstitution[getNodeId(tag)] = true; if (!isIdentifier(tag) && !(getEmitFlags(node.tag) & 8192 /* HelperName */)) { - return addEmitFlags( + return addInternalEmitFlags( factory2.updateTaggedTemplateExpression( node, tag, @@ -100861,7 +104184,7 @@ ${lanes.join("\n")} void 0, node.template ), - 1073741824 /* IndirectCall */ + 16 /* IndirectCall */ ); } } @@ -100875,7 +104198,7 @@ ${lanes.join("\n")} return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); } return node; - } else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { + } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node)); if (exportContainer && exportContainer.kind === 308 /* SourceFile */) { return setTextRange( @@ -101514,7 +104837,7 @@ ${lanes.join("\n")} ), /*typeParameters*/ void 0, - visitNodes2(node.parameters, visitor, isParameterDeclaration), + visitNodes2(node.parameters, visitor, isParameter), /*type*/ void 0, visitNode(node.body, visitor, isBlock) @@ -101611,7 +104934,7 @@ ${lanes.join("\n")} return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 308 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { - const createAssignment3 = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; + const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; return isBindingPattern(node.name) ? flattenDestructuringAssignment( node, visitor, @@ -101619,8 +104942,8 @@ ${lanes.join("\n")} 0 /* All */, /*needsValue*/ false, - createAssignment3 - ) : node.initializer ? createAssignment3(node.name, visitNode(node.initializer, visitor, isExpression)) : node.name; + createAssignment + ) : node.initializer ? createAssignment(node.name, visitNode(node.initializer, visitor, isExpression)) : node.name; } function createExportedVariableAssignment(name, value, location) { return createVariableAssignment( @@ -101824,9 +105147,9 @@ ${lanes.join("\n")} return visitCatchClause(node); case 238 /* Block */: return visitBlock(node); - case 357 /* MergeDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 358 /* EndOfDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return visitor(node); @@ -101888,7 +105211,7 @@ ${lanes.join("\n")} } return expressions ? factory2.inlineExpressions(expressions) : factory2.createOmittedExpression(); } else { - return visitNode(node, discardedValueVisitor, isExpression); + return visitNode(node, discardedValueVisitor, isForInitializer); } } function visitDoStatement(node) { @@ -101909,21 +105232,21 @@ ${lanes.join("\n")} return factory2.updateLabeledStatement( node, node.label, - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) ); } function visitWithStatement(node) { return factory2.updateWithStatement( node, visitNode(node.expression, visitor, isExpression), - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) ); } function visitSwitchStatement(node) { return factory2.updateSwitchStatement( node, visitNode(node.expression, visitor, isExpression), - visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock) + Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock)) ); } function visitCaseBlock(node) { @@ -101955,7 +105278,7 @@ ${lanes.join("\n")} node = factory2.updateCatchClause( node, node.variableDeclaration, - visitNode(node.block, topLevelNestedVisitor, isBlock) + Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock)) ); enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; return node; @@ -101982,7 +105305,7 @@ ${lanes.join("\n")} return visitExpressionStatement(node); case 214 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); case 223 /* BinaryExpression */: if (isDestructuringAssignment(node)) { @@ -102025,7 +105348,7 @@ ${lanes.join("\n")} } function visitImportCallExpression(node) { const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; return factory2.createCallExpression( factory2.createPropertyAccessExpression( @@ -103169,7 +106492,7 @@ ${lanes.join("\n")} sourceFile, /*bundled*/ true - )) : visitNodes2(sourceFile.statements, visitDeclarationStatements); + )) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); const newFile = factory2.updateSourceFile( sourceFile, [factory2.createModuleDeclaration( @@ -103191,7 +106514,7 @@ ${lanes.join("\n")} return newFile; } needsDeclare = true; - const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements); + const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); return factory2.updateSourceFile( sourceFile, transformAndReplaceLatePaintedStatements(updated2), @@ -103260,7 +106583,7 @@ ${lanes.join("\n")} refs.forEach(referenceVisitor); emittedImports = filter(combinedStatements, isAnyImportSyntax); } else { - const statements = visitNodes2(node.statements, visitDeclarationStatements); + const statements = visitNodes2(node.statements, visitDeclarationStatements, isStatement); combinedStatements = setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements); refs.forEach(referenceVisitor); emittedImports = filter(combinedStatements, isAnyImportSyntax); @@ -103377,9 +106700,9 @@ ${lanes.join("\n")} return name; } else { if (name.kind === 204 /* ArrayBindingPattern */) { - return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement)); + return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement)); } else { - return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement)); + return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement)); } } function visitBindingElement(elem) { @@ -103449,10 +106772,10 @@ ${lanes.join("\n")} } const shouldUseResolverType = node.kind === 166 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { - return visitNode(type, visitDeclarationSubtree); + return visitNode(type, visitDeclarationSubtree, isTypeNode); } if (!getParseTreeNode(node)) { - return type ? visitNode(type, visitDeclarationSubtree) : factory2.createKeywordTypeNode(131 /* AnyKeyword */); + return type ? visitNode(type, visitDeclarationSubtree, isTypeNode) : factory2.createKeywordTypeNode(131 /* AnyKeyword */); } if (node.kind === 175 /* SetAccessor */) { return factory2.createKeywordTypeNode(131 /* AnyKeyword */); @@ -103522,11 +106845,11 @@ ${lanes.join("\n")} } function updateParamsList(node, params, modifierMask) { if (hasEffectiveModifier(node, 8 /* Private */)) { - return void 0; + return factory2.createNodeArray(); } const newParams = map(params, (p) => ensureParameter(p, modifierMask)); if (!newParams) { - return void 0; + return factory2.createNodeArray(); } return factory2.createNodeArray(newParams, params.hasTrailingComma); } @@ -103566,7 +106889,7 @@ ${lanes.join("\n")} return factory2.createNodeArray(newParams || emptyArray); } function ensureTypeParams(node, params) { - return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree); + return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration); } function isEnclosingDeclaration(node) { return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node); @@ -103701,7 +107024,7 @@ ${lanes.join("\n")} needsDeclare = priorNeedsDeclare; lateStatementReplacementMap.set(getOriginalNodeId(i), result); } - return visitNodes2(statements, visitLateVisibilityMarkedStatements); + return visitNodes2(statements, visitLateVisibilityMarkedStatements, isStatement); function visitLateVisibilityMarkedStatements(statement) { if (isLateVisibilityPaintedStatement(statement)) { const key = getOriginalNodeId(statement); @@ -103915,7 +107238,7 @@ ${lanes.join("\n")} input, ensureModifiers(input), updateParamsList(input, input.parameters), - visitNode(input.type, visitDeclarationSubtree) || factory2.createKeywordTypeNode(131 /* AnyKeyword */) + visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode(131 /* AnyKeyword */) )); } case 257 /* VariableDeclaration */: { @@ -103948,20 +107271,24 @@ ${lanes.join("\n")} return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); } case 191 /* ConditionalType */: { - const checkType = visitNode(input.checkType, visitDeclarationSubtree); - const extendsType = visitNode(input.extendsType, visitDeclarationSubtree); + const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); + const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); const oldEnclosingDecl = enclosingDeclaration; enclosingDeclaration = input.trueType; - const trueType = visitNode(input.trueType, visitDeclarationSubtree); + const trueType = visitNode(input.trueType, visitDeclarationSubtree, isTypeNode); enclosingDeclaration = oldEnclosingDecl; - const falseType = visitNode(input.falseType, visitDeclarationSubtree); + const falseType = visitNode(input.falseType, visitDeclarationSubtree, isTypeNode); + Debug.assert(checkType); + Debug.assert(extendsType); + Debug.assert(trueType); + Debug.assert(falseType); return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } case 181 /* FunctionType */: { - return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree))); + return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); } case 182 /* ConstructorType */: { - return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree))); + return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); } case 202 /* ImportType */: { if (!isLiteralImportTypeNode(input)) @@ -104105,7 +107432,7 @@ ${lanes.join("\n")} ensureModifiers(input), input.name, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), - visitNode(input.type, visitDeclarationSubtree, isTypeNode) + Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) )); needsDeclare = previousNeedsDeclare; return clean2; @@ -104117,7 +107444,7 @@ ${lanes.join("\n")} input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), - visitNodes2(input.members, visitDeclarationSubtree) + visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) )); } case 259 /* FunctionDeclaration */: { @@ -104234,7 +107561,7 @@ ${lanes.join("\n")} const oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; needsScopeFixMarker = false; - const statements = visitNodes2(inner.statements, visitDeclarationStatements); + const statements = visitNodes2(inner.statements, visitDeclarationStatements, isStatement); let lateStatements = transformAndReplaceLatePaintedStatements(statements); if (input.flags & 16777216 /* Ambient */) { needsScopeFixMarker = false; @@ -104243,7 +107570,7 @@ ${lanes.join("\n")} if (needsScopeFixMarker) { lateStatements = factory2.createNodeArray([...lateStatements, createEmptyExports(factory2)]); } else { - lateStatements = visitNodes2(lateStatements, stripExportModifiers); + lateStatements = visitNodes2(lateStatements, stripExportModifiers, isStatement); } } const body = factory2.updateModuleBlock(inner, lateStatements); @@ -104339,7 +107666,7 @@ ${lanes.join("\n")} void 0 ) ] : void 0; - const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree)); + const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement)); const members = factory2.createNodeArray(memberNodes); const extendsClause = getEffectiveBaseTypeNode(input); if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 104 /* NullKeyword */) { @@ -104363,11 +107690,11 @@ ${lanes.join("\n")} if (clause.token === 94 /* ExtendsKeyword */) { const oldDiag2 = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]); - const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree)))); + const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree, isTypeNode)))); getSymbolAccessibilityDiagnostic = oldDiag2; return newClause; } - return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */)), visitDeclarationSubtree)); + return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */)), visitDeclarationSubtree, isExpressionWithTypeArguments)); })); return [statement, cleanup(factory2.updateClassDeclaration( input, @@ -104423,7 +107750,7 @@ ${lanes.join("\n")} function transformVariableStatement(input) { if (!forEach(input.declarationList.declarations, getBindingNameVisible)) return; - const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree); + const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree, isVariableDeclaration); if (!length(nodes)) return; return factory2.updateVariableStatement(input, factory2.createNodeArray(ensureModifiers(input)), factory2.updateVariableDeclarationList(input.declarationList, nodes)); @@ -104514,7 +107841,7 @@ ${lanes.join("\n")} function transformHeritageClauses(nodes) { return factory2.createNodeArray(filter(map(nodes, (clause) => factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => { return isEntityNameExpression(t.expression) || clause.token === 94 /* ExtendsKeyword */ && t.expression.kind === 104 /* NullKeyword */; - })), visitDeclarationSubtree))), (clause) => clause.types && !!clause.types.length)); + })), visitDeclarationSubtree, isExpressionWithTypeArguments))), (clause) => clause.types && !!clause.types.length)); } } function isAlwaysType(node) { @@ -104631,10 +107958,15 @@ ${lanes.join("\n")} return emptyArray; const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); + const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); const transformers = []; addRange(transformers, customTransformers && map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(transformTypeScript); - transformers.push(transformLegacyDecorators); + if (compilerOptions.experimentalDecorators) { + transformers.push(transformLegacyDecorators); + } else if (languageVersion < 99 /* ESNext */ || !useDefineForClassFields) { + transformers.push(transformESDecorators); + } transformers.push(transformClassFields); if (getJSXTransformEnabled(compilerOptions)) { transformers.push(transformJsx); @@ -104700,7 +108032,7 @@ ${lanes.join("\n")} } function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { var _a2, _b; - const enabledSyntaxKindFeatures = new Array(360 /* Count */); + const enabledSyntaxKindFeatures = new Array(361 /* Count */); let lexicalEnvironmentVariableDeclarations; let lexicalEnvironmentFunctionDeclarations; let lexicalEnvironmentStatements; @@ -105270,7 +108602,7 @@ ${lanes.join("\n")} const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; const emitterDiagnostics = createDiagnosticCollection(); - const newLine = getNewLineCharacter(compilerOptions, () => host.getNewLine()); + const newLine = getNewLineCharacter(compilerOptions); const writer = createTextWriter(newLine); const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); let bundleBuildInfo; @@ -105727,7 +109059,6 @@ ${lanes.join("\n")} getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory), getCompilerOptions: () => config.options, getCurrentDirectory: () => host.getCurrentDirectory(), - getNewLine: () => host.getNewLine(), getSourceFile: returnUndefined, getSourceFileByPath: returnUndefined, getSourceFiles: () => sourceFilesForJsEmit, @@ -105813,6 +109144,7 @@ ${lanes.join("\n")} const bundledHelpers = /* @__PURE__ */ new Map(); let currentSourceFile; let nodeIdToGeneratedName; + let nodeIdToGeneratedPrivateName; let autoGeneratedIdToGeneratedName; let generatedNames; let formattedNameTempFlagsStack; @@ -106109,6 +109441,7 @@ ${lanes.join("\n")} } function reset2() { nodeIdToGeneratedName = []; + nodeIdToGeneratedPrivateName = []; autoGeneratedIdToGeneratedName = []; generatedNames = /* @__PURE__ */ new Set(); formattedNameTempFlagsStack = []; @@ -106160,7 +109493,7 @@ ${lanes.join("\n")} pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node); } function beforeEmitNode(node) { - if (preserveSourceNewlines && getEmitFlags(node) & 268435456 /* IgnoreSourceNewlines */) { + if (preserveSourceNewlines && getInternalEmitFlags(node) & 4 /* IgnoreSourceNewlines */) { preserveSourceNewlines = false; } } @@ -106550,6 +109883,7 @@ ${lanes.join("\n")} case 346 /* JSDocThisTag */: case 347 /* JSDocTypeTag */: case 352 /* JSDocThrowsTag */: + case 353 /* JSDocSatisfiesTag */: return emitJSDocSimpleTypedTag(node); case 348 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); @@ -106557,9 +109891,9 @@ ${lanes.join("\n")} return emitJSDocTypedefTag(node); case 350 /* JSDocSeeTag */: return emitJSDocSeeTag(node); - case 354 /* NotEmittedStatement */: - case 358 /* EndOfDeclarationMarker */: - case 357 /* MergeDeclarationMarker */: + case 355 /* NotEmittedStatement */: + case 359 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: return; } if (isExpression(node)) { @@ -106652,24 +109986,26 @@ ${lanes.join("\n")} return emitMetaProperty(node); case 234 /* SyntheticExpression */: return Debug.fail("SyntheticExpression should never be printed."); + case 279 /* MissingDeclaration */: + return; case 281 /* JsxElement */: return emitJsxElement(node); case 282 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); case 285 /* JsxFragment */: return emitJsxFragment(node); - case 353 /* SyntaxList */: + case 354 /* SyntaxList */: return Debug.fail("SyntaxList should not be printed"); - case 354 /* NotEmittedStatement */: + case 355 /* NotEmittedStatement */: return; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return emitCommaList(node); - case 357 /* MergeDeclarationMarker */: - case 358 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: return; - case 359 /* SyntheticReferenceExpression */: + case 360 /* SyntheticReferenceExpression */: return Debug.fail("SyntheticReferenceExpression should not be printed"); } } @@ -106842,7 +110178,7 @@ ${lanes.join("\n")} /*includeTrivia*/ false ), node.symbol); - emitList(node, node.typeArguments, 53776 /* TypeParameters */); + emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */); } function emitPrivateIdentifier(node) { write(getTextOfNode2( @@ -106873,7 +110209,7 @@ ${lanes.join("\n")} pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames); } function emitTypeParameter(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emit(node.name); if (node.constraint) { writeSpace(); @@ -106889,7 +110225,12 @@ ${lanes.join("\n")} } } function emitParameter(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); @@ -106905,14 +110246,19 @@ ${lanes.join("\n")} emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); } function emitPropertySignature(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emitNodeWithWriter(node.name, writeProperty); emit(node.questionToken); emitTypeAnnotation(node.type); writeTrailingSemicolon(); } function emitPropertyDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.name); emit(node.questionToken); emit(node.exclamationToken); @@ -106922,7 +110268,7 @@ ${lanes.join("\n")} } function emitMethodSignature(node) { pushNameGenerationScope(node); - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emit(node.name); emit(node.questionToken); emitTypeParameters(node, node.typeParameters); @@ -106932,7 +110278,12 @@ ${lanes.join("\n")} popNameGenerationScope(node); } function emitMethodDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); emit(node.asteriskToken); emit(node.name); emit(node.questionToken); @@ -106943,13 +110294,24 @@ ${lanes.join("\n")} emitBlockFunctionBody(node.body); } function emitConstructor(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { - emitDecoratorsAndModifiers(node, node.modifiers); - writeKeyword(node.kind === 174 /* GetAccessor */ ? "get" : "set"); + const pos = emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + const token = node.kind === 174 /* GetAccessor */ ? 137 /* GetKeyword */ : 151 /* SetKeyword */; + emitTokenWithComment(token, pos, writeKeyword, node); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -106973,7 +110335,12 @@ ${lanes.join("\n")} popNameGenerationScope(node); } function emitIndexSignature(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitParametersForIndexSignature(node, node.parameters); emitTypeAnnotation(node.type); writeTrailingSemicolon(); @@ -107032,7 +110399,7 @@ ${lanes.join("\n")} } function emitConstructorType(node) { pushNameGenerationScope(node); - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); writeKeyword("new"); writeSpace(); emitTypeParameters(node, node.typeParameters); @@ -107308,7 +110675,7 @@ ${lanes.join("\n")} emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node); } function emitCallExpression(node) { - const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */; + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; if (indirectCall) { writePunctuation("("); writeLiteral("0"); @@ -107331,7 +110698,7 @@ ${lanes.join("\n")} emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); } function emitTaggedTemplateExpression(node) { - const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */; + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; if (indirectCall) { writePunctuation("("); writeLiteral("0"); @@ -107369,7 +110736,7 @@ ${lanes.join("\n")} emitFunctionDeclarationOrExpression(node); } function emitArrowFunction(node) { - emitModifiers(node, node.modifiers); + emitModifierList(node, node.modifiers); emitSignatureAndBody(node, emitArrowFunctionHead); } function emitArrowFunctionHead(node) { @@ -107635,7 +111002,12 @@ ${lanes.join("\n")} ); } function emitVariableStatement(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emit(node.declarationList); writeTrailingSemicolon(); } @@ -107893,7 +111265,12 @@ ${lanes.join("\n")} emitFunctionDeclarationOrExpression(node); } function emitFunctionDeclarationOrExpression(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("function"); emit(node.asteriskToken); writeSpace(); @@ -108001,8 +111378,13 @@ ${lanes.join("\n")} void 0 ); forEach(node.members, generateMemberNames); - emitDecoratorsAndModifiers(node, node.modifiers); - writeKeyword("class"); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emitTokenWithComment(84 /* ClassKeyword */, moveRangePastModifiers(node).pos, writeKeyword, node); if (node.name) { writeSpace(); emitIdentifierName(node.name); @@ -108028,7 +111410,12 @@ ${lanes.join("\n")} /*newReservedMemberNames*/ void 0 ); - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("interface"); writeSpace(); emit(node.name); @@ -108041,7 +111428,12 @@ ${lanes.join("\n")} popPrivateNameGenerationScope(); } function emitTypeAliasDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("type"); writeSpace(); emit(node.name); @@ -108053,7 +111445,12 @@ ${lanes.join("\n")} writeTrailingSemicolon(); } function emitEnumDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); writeKeyword("enum"); writeSpace(); emit(node.name); @@ -108063,7 +111460,12 @@ ${lanes.join("\n")} writePunctuation("}"); } function emitModuleDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); if (~node.flags & 1024 /* GlobalAugmentation */) { writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); writeSpace(); @@ -108103,7 +111505,12 @@ ${lanes.join("\n")} ); } function emitImportEqualsDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { @@ -108125,7 +111532,12 @@ ${lanes.join("\n")} } } function emitImportDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.importClause) { @@ -108178,7 +111590,12 @@ ${lanes.join("\n")} writeTrailingSemicolon(); } function emitExportDeclaration(node) { - emitModifiers(node, node.modifiers); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); let nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { @@ -108801,23 +112218,27 @@ ${lanes.join("\n")} emit(node); write = savedWrite; } - function emitDecoratorsAndModifiers(node, modifiers) { + function emitDecoratorsAndModifiers(node, modifiers, allowDecorators) { if (modifiers == null ? void 0 : modifiers.length) { if (every(modifiers, isModifier)) { - return emitModifiers(node, modifiers); + return emitModifierList(node, modifiers); } if (every(modifiers, isDecorator)) { - return emitDecorators(node, modifiers); + if (allowDecorators) { + return emitDecoratorList(node, modifiers); + } + return node.pos; } onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); let lastMode; let mode; let start = 0; let pos = 0; + let lastModifier; while (start < modifiers.length) { while (pos < modifiers.length) { - const modifier = modifiers[pos]; - mode = isDecorator(modifier) ? "decorators" : "modifiers"; + lastModifier = modifiers[pos]; + mode = isDecorator(lastModifier) ? "decorators" : "modifiers"; if (lastMode === void 0) { lastMode = mode; } else if (mode !== lastMode) { @@ -108830,28 +112251,36 @@ ${lanes.join("\n")} textRange.pos = modifiers.pos; if (pos === modifiers.length - 1) textRange.end = modifiers.end; - emitNodeListItems( - emit, - node, - modifiers, - lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, - /*parenthesizerRule*/ - void 0, - start, - pos - start, - /*hasTrailingComma*/ - false, - textRange - ); + if (lastMode === "modifiers" || allowDecorators) { + emitNodeListItems( + emit, + node, + modifiers, + lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, + /*parenthesizerRule*/ + void 0, + start, + pos - start, + /*hasTrailingComma*/ + false, + textRange + ); + } start = pos; lastMode = mode; pos++; } onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); + if (lastModifier && !positionIsSynthesized(lastModifier.end)) { + return lastModifier.end; + } } + return node.pos; } - function emitModifiers(node, modifiers) { + function emitModifierList(node, modifiers) { emitList(node, modifiers, 2359808 /* Modifiers */); + const lastModifier = lastOrUndefined(modifiers); + return lastModifier && !positionIsSynthesized(lastModifier.end) ? lastModifier.end : node.pos; } function emitTypeAnnotation(node) { if (node) { @@ -108907,8 +112336,10 @@ ${lanes.join("\n")} decreaseIndent(); } } - function emitDecorators(parentNode, decorators) { + function emitDecoratorList(parentNode, decorators) { emitList(parentNode, decorators, 2146305 /* Decorators */); + const lastDecorator = lastOrUndefined(decorators); + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos; } function emitTypeArguments(parentNode, typeArguments) { emitList(parentNode, typeArguments, 53776 /* TypeArguments */, typeArgumentParenthesizerRuleSelector); @@ -109035,7 +112466,10 @@ ${lanes.join("\n")} writeDelimiter(format); } else if (previousSibling) { if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) { - emitLeadingCommentsOfPosition(previousSibling.end); + const previousSiblingEmitFlags = getEmitFlags(previousSibling); + if (!(previousSiblingEmitFlags & 2048 /* NoTrailingComments */)) { + emitLeadingCommentsOfPosition(previousSibling.end); + } } writeDelimiter(format); recordBundleFileInternalSectionEnd(previousSourceFileTextKind); @@ -109560,16 +112994,18 @@ ${lanes.join("\n")} } } function generateName(name) { - if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { - return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix); + const autoGenerate = name.emitNode.autoGenerate; + if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { + return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix); } else { - const autoGenerateId = name.autoGenerate.id; + const autoGenerateId = autoGenerate.id; return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name)); } } function generateNameCached(node, privateName, flags, prefix, suffix) { const nodeId = getNodeId(node); - return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); + const cache = privateName ? nodeIdToGeneratedPrivateName : nodeIdToGeneratedName; + return cache[nodeId] || (cache[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); } function isUniqueName(name, privateName) { return isFileLevelUniqueName2(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name); @@ -109811,7 +113247,21 @@ ${lanes.join("\n")} Debug.assert(!prefix && !suffix && !privateName); return generateNameForImportOrExportDeclaration(node); case 259 /* FunctionDeclaration */: - case 260 /* ClassDeclaration */: + case 260 /* ClassDeclaration */: { + Debug.assert(!prefix && !suffix && !privateName); + const name = node.name; + if (name && !isGeneratedIdentifier(name)) { + return generateNameForNode( + name, + /*privateName*/ + false, + flags, + prefix, + suffix + ); + } + return generateNameForExportDefault(); + } case 274 /* ExportAssignment */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForExportDefault(); @@ -109843,16 +113293,17 @@ ${lanes.join("\n")} } } function makeName(name) { - const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName); - const suffix = formatGeneratedNamePart(name.autoGenerate.suffix); - switch (name.autoGenerate.flags & 7 /* KindMask */) { + const autoGenerate = name.emitNode.autoGenerate; + const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName); + const suffix = formatGeneratedNamePart(autoGenerate.suffix); + switch (autoGenerate.flags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); case 2 /* Loop */: Debug.assertNode(name, isIdentifier); return makeTempVariableName( TempFlags._i, - !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), /*privateName*/ false, prefix, @@ -109861,16 +113312,16 @@ ${lanes.join("\n")} case 3 /* Unique */: return makeUniqueName2( idText(name), - name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, - !!(name.autoGenerate.flags & 16 /* Optimistic */), - !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), + autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, + !!(autoGenerate.flags & 16 /* Optimistic */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix ); } return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum( - name.autoGenerate.flags & 7 /* KindMask */, + autoGenerate.flags & 7 /* KindMask */, GeneratedIdentifierFlags, /*isFlags*/ true @@ -109915,7 +113366,7 @@ ${lanes.join("\n")} emitLeadingComments( pos, /*isEmittedNode*/ - node.kind !== 354 /* NotEmittedStatement */ + node.kind !== 355 /* NotEmittedStatement */ ); } if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { @@ -109939,7 +113390,7 @@ ${lanes.join("\n")} containerPos = savedContainerPos; containerEnd = savedContainerEnd; declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 354 /* NotEmittedStatement */) { + if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) { emitTrailingComments(end); } } @@ -110211,7 +113662,7 @@ ${lanes.join("\n")} } } else { const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); } if (emitFlags & 128 /* NoNestedSourceMaps */) { @@ -110226,7 +113677,7 @@ ${lanes.join("\n")} if (emitFlags & 128 /* NoNestedSourceMaps */) { sourceMapsDisabled = false; } - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); } } @@ -110997,7 +114448,7 @@ ${lanes.join("\n")} function getDefaultLibLocation() { return getDirectoryPath(normalizePath(system.getExecutingFilePath())); } - const newLine = getNewLineCharacter(options, () => system.newLine); + const newLine = getNewLineCharacter(options); const realpath = system.realpath && ((path) => system.realpath(path)); const compilerHost = { getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes), @@ -112399,7 +115850,6 @@ ${lanes.join("\n")} getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: () => currentDirectory, - getNewLine: () => host.getNewLine(), getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, @@ -112778,8 +116228,26 @@ ${lanes.join("\n")} } } function walkArray(nodes, parent2) { - if (canHaveModifiers(parent2) && parent2.modifiers === nodes && some(nodes, isDecorator) && !options.experimentalDecorators) { - diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); + if (canHaveIllegalDecorators(parent2)) { + const decorator = find(parent2.modifiers, isDecorator); + if (decorator) { + diagnostics.push(createDiagnosticForNode2(decorator, Diagnostics.Decorators_are_not_valid_here)); + } + } else if (canHaveDecorators(parent2) && parent2.modifiers) { + const decoratorIndex = findIndex(parent2.modifiers, isDecorator); + if (decoratorIndex >= 0) { + if (isParameter(parent2) && !options.experimentalDecorators) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (isClassDeclaration(parent2)) { + const exportIndex = findIndex(parent2.modifiers, isExportModifier); + const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); + if (exportIndex >= 0 && decoratorIndex < exportIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files)); + } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } + } + } } switch (parent2.kind) { case 260 /* ClassDeclaration */: @@ -112938,7 +116406,7 @@ ${lanes.join("\n")} /*assertClause*/ void 0 ); - addEmitFlags(importDecl, 134217728 /* NeverApplyImportHelper */); + addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */); setParent(externalHelpersModuleReference, importDecl); setParent(importDecl, file); externalHelpersModuleReference.flags &= ~8 /* Synthesized */; @@ -113205,7 +116673,7 @@ ${lanes.join("\n")} if (filesByName.has(path)) { const file2 = filesByName.get(path); addFileIncludeReason(file2 || void 0, reason); - if (file2 && options.forceConsistentCasingInFileNames) { + if (file2 && !(options.forceConsistentCasingInFileNames === false)) { const checkedName = file2.fileName; const isRedirect = toPath3(checkedName) !== toPath3(fileName); if (isRedirect) { @@ -113804,24 +117272,12 @@ ${lanes.join("\n")} } const languageVersion = getEmitScriptTarget(options); const firstNonAmbientExternalModuleSourceFile = find(files, (f) => isExternalModule(f) && !f.isDeclarationFile); - if (options.isolatedModules) { - if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */) { + if (options.isolatedModules || options.verbatimModuleSyntax) { + if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */ && options.isolatedModules) { createDiagnosticForOptionName(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"); } if (options.preserveConstEnums === false) { - createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules"); - } - for (const file of files) { - if (!isExternalModule(file) && !isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* JSON */) { - const span = getErrorSpanForNode(file, file); - programDiagnostics.add(createFileDiagnostic( - file, - span.start, - span.length, - Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, - getBaseFileName(file.fileName) - )); - } + createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled, options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", "preserveConstEnums"); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === 0 /* None */) { const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); @@ -113903,10 +117359,25 @@ ${lanes.join("\n")} } } if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) { - createOptionValueDiagnostic("importsNotUsedAsValues", Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later); + createDiagnosticForOptionName(Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); + } + if (options.verbatimModuleSyntax) { + const moduleKind = getEmitModuleKind(options); + if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { + createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); + } + if (options.isolatedModules) { + createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); + } + if (options.preserveValueImports) { + createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); + } + if (options.importsNotUsedAsValues) { + createRedundantOptionDiagnostic("importsNotUsedAsValues", "verbatimModuleSyntax"); + } } if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) { - createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set); + createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set); } const moduleResolution = getEmitModuleResolutionKind(options); if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { @@ -113952,16 +117423,25 @@ ${lanes.join("\n")} } } } - function verifyDeprecatedCompilerOptions() { + function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) { const version2 = typeScriptVersion3 || versionMajorMinor; const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) { return; - } else { + } else if (reportInvalidIgnoreDeprecations) { createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); } } + return version2; + } + function verifyDeprecatedCompilerOptions() { + const version2 = getVersionForDeprecationDiagnostics( + /*reportInvalidIgnoreDeprecations*/ + true + ); + if (!version2) + return; if (options.target === 0 /* ES3 */) { createDeprecatedDiagnosticForOption(version2, "target", "ES3"); } @@ -113986,32 +117466,85 @@ ${lanes.join("\n")} if (options.out) { createDeprecatedDiagnosticForOption(version2, "out"); } - } - function createDeprecatedDiagnosticForOption(version2, name, value) { - if (version2 === "6.0" /* v6_0 */) { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnosticForOption( + version2, + "importsNotUsedAsValues", + /*value*/ void 0, - Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, - value || name + "verbatimModuleSyntax" ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ + } + if (options.preserveValueImports) { + createDeprecatedDiagnosticForOption( + version2, + "preserveValueImports", + /*value*/ void 0, - Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, - value || name, - "5.5" /* v5_5 */, - "5.0" /* v5_0 */ + "verbatimModuleSyntax" ); } } + function verifyDeprecatedProjectReference(ref, parentFile, index) { + if (ref.prepend) { + const version2 = getVersionForDeprecationDiagnostics( + /*reportInvalidIgnoreDeprecations*/ + false + ); + if (version2) { + createDeprecatedOptionForVersionDiagnostic( + version2, + (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), + "prepend" + ); + } + } + } + function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) { + return createDeprecatedOptionForVersionDiagnostic( + version2, + (message, arg0, arg1, arg2) => { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + chain + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + message, + arg0, + arg1, + arg2 + ); + } + }, + name, + value + ); + } + function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) { + if (version2 === "6.0" /* v6_0 */) { + createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); + } else { + createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + } + } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { var _a3; let fileIncludeReasons; @@ -114155,6 +117688,7 @@ ${lanes.join("\n")} forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent2, index) => { const ref = (parent2 ? parent2.commandLine.projectReferences : projectReferences)[index]; const parentFile = parent2 && parent2.sourceFile; + verifyDeprecatedProjectReference(ref, parentFile, index); if (!resolvedRef) { createDiagnosticForReference(parentFile, index, Diagnostics.File_0_not_found, ref.path); return; @@ -114262,22 +117796,26 @@ ${lanes.join("\n")} arg1 ); } - function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) { + function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) { const referencesSyntax = firstDefined( getTsConfigPropArray(sourceFile || options.configFile, "references"), (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 ); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); } } function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); if (needCompilerDiagnostic) { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + if ("messageText" in message) { + programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); + } else { + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + } } } function getCompilerOptionsObjectLiteralSyntax() { @@ -114298,10 +117836,32 @@ ${lanes.join("\n")} function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + if ("messageText" in message) { + programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); + } else { + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + } } return !!props.length; } + function createRedundantOptionDiagnostic(errorOnOption, redundantWithOption) { + const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + if (compilerOptionsObjectLiteralSyntax) { + createOptionDiagnosticInObjectLiteralSyntax( + compilerOptionsObjectLiteralSyntax, + /*onKey*/ + true, + errorOnOption, + /*key2*/ + void 0, + Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, + errorOnOption, + redundantWithOption + ); + } else { + createDiagnosticForOptionName(Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, errorOnOption, redundantWithOption); + } + } function blockEmittingOfFile(emitFileName, diag2) { hasEmitBlockingDiagnostics.set(toPath3(emitFileName), true); programDiagnostics.add(diag2); @@ -114552,9 +118112,8 @@ ${lanes.join("\n")} } return nodes || emptyArray; } - function resolveProjectReferencePath(hostOrRef, ref) { - const passedInRef = ref ? ref : hostOrRef; - return resolveConfigFileProjectName(passedInRef.path); + function resolveProjectReferencePath(ref) { + return resolveConfigFileProjectName(ref.path); } function getResolutionDiagnostic(options, { extension }, { isDeclarationFile }) { switch (extension) { @@ -117323,6 +120882,9 @@ ${lanes.join("\n")} } ); return filesInError.map((fileName) => { + if (fileName === void 0) { + return void 0; + } const diagnosticForFileName = find( diagnostics, (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName @@ -117693,7 +121255,6 @@ ${lanes.join("\n")} } function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) { const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); - const hostGetNewLine = memoize(() => host.getNewLine()); const compilerHost = { getSourceFile: createGetSourceFile( (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding), @@ -117711,7 +121272,7 @@ ${lanes.join("\n")} getCurrentDirectory: memoize(() => host.getCurrentDirectory()), useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames), - getNewLine: () => getNewLineCharacter(getCompilerOptions(), hostGetNewLine), + getNewLine: () => getNewLineCharacter(getCompilerOptions()), fileExists: (f) => host.fileExists(f), readFile: (f) => host.readFile(f), trace: maybeBind(host, host.trace), @@ -117797,7 +121358,7 @@ ${lanes.join("\n")} copyProperties(result, createWatchHost(system, reportWatchStatus2)); result.afterProgramCreate = (builderProgram) => { const compilerOptions = builderProgram.getCompilerOptions(); - const newLine = getNewLineCharacter(compilerOptions, () => system.newLine); + const newLine = getNewLineCharacter(compilerOptions); emitFilesAndReportErrors( builderProgram, reportDiagnostic, @@ -118007,11 +121568,13 @@ ${lanes.join("\n")} } reportWatchDiagnostic(Diagnostics.Starting_compilation_in_watch_mode); if (configFileName && !host.configFileParsingResult) { - newLine = getNewLineCharacter(optionsToExtendForConfigFile, () => host.getNewLine()); + newLine = getNewLineCharacter(optionsToExtendForConfigFile); Debug.assert(!rootFileNames); parseConfigFile2(); newLine = updateNewLine(); } + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions); const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`); @@ -118114,6 +121677,8 @@ ${lanes.join("\n")} } function synchronizeProgram() { writeLog(`Synchronizing program`); + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); clearInvalidateResolutionsOfFailedLookupLocations(); const program = getCurrentBuilderProgram(); if (hasChangedCompilerOptions) { @@ -118199,7 +121764,7 @@ ${lanes.join("\n")} scheduleProgramUpdate(); } function updateNewLine() { - return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile, () => host.getNewLine()); + return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile); } function toPath3(fileName) { return toPath(fileName, currentDirectory, getCanonicalFileName); @@ -118353,6 +121918,8 @@ ${lanes.join("\n")} } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); + Debug.assert(configFileName); reloadLevel = 0 /* None */; rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { @@ -118361,6 +121928,7 @@ ${lanes.join("\n")} synchronizeProgram(); } function reloadConfigFile() { + Debug.assert(configFileName); writeLog(`Reloading config file: ${configFileName}`); reloadLevel = 0 /* None */; if (cachedDirectoryStructureHost) { @@ -118373,6 +121941,7 @@ ${lanes.join("\n")} updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile); } function parseConfigFile2() { + Debug.assert(configFileName); setConfigFileParsingResult(getParsedCommandLineOfConfigFile( configFileName, optionsToExtendForConfigFile, @@ -118400,6 +121969,7 @@ ${lanes.join("\n")} return config.parsedCommandLine; if (config.parsedCommandLine && config.reloadLevel === 1 /* Partial */ && !host.getParsedCommandLine) { writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); const fileNames = getFileNamesFromConfigSpecs( config.parsedCommandLine.options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName2), currentDirectory), @@ -118491,7 +122061,8 @@ ${lanes.join("\n")} return watchDirectory( directory, (fileOrDirectory) => { - Debug.assert(!!configFileName); + Debug.assert(configFileName); + Debug.assert(compilerOptions); const fileOrDirectoryPath = toPath3(fileOrDirectory); if (cachedDirectoryStructureHost) { cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); @@ -118522,6 +122093,7 @@ ${lanes.join("\n")} ); } function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { + Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, @@ -120678,6 +124250,7 @@ ${lanes.join("\n")} init_classFields(); init_typeSerializer(); init_legacyDecorators(); + init_esDecorators(); init_es2017(); init_es2018(); init_es2019(); @@ -122001,7 +125574,7 @@ ${lanes.join("\n")} Debug.assert(!syntaxList || contains(syntaxList.getChildren(), node)); return syntaxList; } - function isDefaultModifier(node) { + function isDefaultModifier2(node) { return node.kind === 88 /* DefaultKeyword */; } function isClassKeyword(node) { @@ -122015,7 +125588,7 @@ ${lanes.join("\n")} return node.name; } if (isClassDeclaration(node)) { - const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier); + const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier2); if (defaultModifier) return defaultModifier; } @@ -122030,7 +125603,7 @@ ${lanes.join("\n")} return node.name; } if (isFunctionDeclaration(node)) { - const defaultModifier = find(node.modifiers, isDefaultModifier); + const defaultModifier = find(node.modifiers, isDefaultModifier2); if (defaultModifier) return defaultModifier; } @@ -122948,16 +126521,19 @@ ${lanes.join("\n")} function findModifier(node, kind) { return canHaveModifiers(node) ? find(node.modifiers, (m) => m.kind === kind) : void 0; } - function insertImports(changes, sourceFile, imports, blankLineBetween) { + function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) { const decl = isArray(imports) ? imports[0] : imports; const importKindPredicate = decl.kind === 240 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; const existingImportStatements = filter(sourceFile.statements, importKindPredicate); - const sortedNewImports = isArray(imports) ? stableSort(imports, ts_OrganizeImports_exports.compareImportsOrRequireStatements) : [imports]; + let sortKind = isArray(imports) ? ts_OrganizeImports_exports.detectImportDeclarationSorting(imports, preferences) : 3 /* Both */; + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); + const sortedNewImports = isArray(imports) ? stableSort(imports, (a, b) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a, b, comparer)) : [imports]; if (!existingImportStatements.length) { changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); - } else if (existingImportStatements && ts_OrganizeImports_exports.detectImportDeclarationSorting(existingImportStatements)) { + } else if (existingImportStatements && (sortKind = ts_OrganizeImports_exports.detectImportDeclarationSorting(existingImportStatements, preferences))) { + const comparer2 = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); for (const newImport of sortedNewImports) { - const insertionIndex = ts_OrganizeImports_exports.getImportDeclarationInsertionIndex(existingImportStatements, newImport); + const insertionIndex = ts_OrganizeImports_exports.getImportDeclarationInsertionIndex(existingImportStatements, newImport, comparer2); if (insertionIndex === 0) { const options = existingImportStatements[0] === sourceFile.statements[0] ? { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude } : {}; changes.insertNodeBefore( @@ -123288,7 +126864,7 @@ ${lanes.join("\n")} } function getNewLineOrDefaultFromHost(host, formatSettings) { var _a2; - return (formatSettings == null ? void 0 : formatSettings.newLineCharacter) || ((_a2 = host.getNewLine) == null ? void 0 : _a2.call(host)) || carriageReturnLineFeed2; + return (formatSettings == null ? void 0 : formatSettings.newLineCharacter) || ((_a2 = host.getNewLine) == null ? void 0 : _a2.call(host)) || lineFeed2; } function lineBreakPart() { return displayPart("\n", 6 /* lineBreak */); @@ -124001,7 +127577,7 @@ ${lanes.join("\n")} if (!sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) { return false; } - return isInJSFile(declaration) || !findAncestor(declaration, isGlobalScopeAugmentation); + return isInJSFile(declaration) || !findAncestor(declaration, (d) => isModuleDeclaration(d) && isGlobalScopeAugmentation(d)); } function isDeprecatedDeclaration(decl) { return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 8192 /* Deprecated */); @@ -124034,7 +127610,7 @@ ${lanes.join("\n")} function isSourceFileFromLibrary(program, node) { return program.isSourceFileFromExternalLibrary(node) || program.isSourceFileDefaultLibrary(node); } - var scanner, SemanticMeaning, tripleSlashDirectivePrefixRegex, typeKeywords, QuotePreference, displayPartWriter, carriageReturnLineFeed2, ANONYMOUS, syntaxMayBeASICandidate; + var scanner, SemanticMeaning, tripleSlashDirectivePrefixRegex, typeKeywords, QuotePreference, displayPartWriter, lineFeed2, ANONYMOUS, syntaxMayBeASICandidate; var init_utilities4 = __esm({ "src/services/utilities.ts"() { "use strict"; @@ -124080,7 +127656,7 @@ ${lanes.join("\n")} return QuotePreference5; })(QuotePreference || {}); displayPartWriter = getDisplayPartWriter(); - carriageReturnLineFeed2 = "\r\n"; + lineFeed2 = "\n"; ANONYMOUS = "anonymous function"; syntaxMayBeASICandidate = or( syntaxRequiresTrailingCommaOrSemicolonOrASI, @@ -124342,7 +127918,7 @@ ${lanes.join("\n")} } function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) { var _a2; - const isExcluded = (fileName) => excludePatterns == null ? void 0 : excludePatterns.some((p) => p.test(fileName)); + const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName))); for (const ambient of checker.getAmbientModules()) { if (!stringContains(ambient.name, "*") && !(excludePatterns && ((_a2 = ambient.declarations) == null ? void 0 : _a2.every((d) => isExcluded(d.getSourceFile().fileName))))) { cb( @@ -124353,7 +127929,7 @@ ${lanes.join("\n")} } } for (const sourceFile of allSourceFiles) { - if (isExternalOrCommonJsModule(sourceFile) && !isExcluded(sourceFile.fileName)) { + if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile.fileName))) { cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile); } } @@ -124450,10 +128026,10 @@ ${lanes.join("\n")} function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) { const localSymbol = getLocalSymbolForExportDefault(defaultExport); if (localSymbol) - return { symbolForMeaning: localSymbol, name: localSymbol.name }; + return { resolvedSymbol: localSymbol, name: localSymbol.name }; const name = getNameForExportDefault(defaultExport); if (name !== void 0) - return { symbolForMeaning: defaultExport, name }; + return { resolvedSymbol: defaultExport, name }; if (defaultExport.flags & 2097152 /* Alias */) { const aliased = checker.getImmediateAliasedSymbol(defaultExport); if (aliased && aliased.parent) { @@ -124461,9 +128037,9 @@ ${lanes.join("\n")} } } if (defaultExport.escapedName !== "default" /* Default */ && defaultExport.escapedName !== "export=" /* ExportEquals */) { - return { symbolForMeaning: defaultExport, name: defaultExport.getName() }; + return { resolvedSymbol: defaultExport, name: defaultExport.getName() }; } - return { symbolForMeaning: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) }; + return { resolvedSymbol: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) }; } function getNameForExportDefault(symbol) { return symbol.declarations && firstDefined(symbol.declarations, (declaration) => { @@ -128352,7 +131928,7 @@ ${lanes.join("\n")} } } function createSyntaxList(nodes, parent2) { - const list = createNode(353 /* SyntaxList */, nodes.pos, nodes.end, parent2); + const list = createNode(354 /* SyntaxList */, nodes.pos, nodes.end, parent2); list._children = []; let pos = nodes.pos; for (const node of nodes) { @@ -128597,7 +132173,7 @@ ${lanes.join("\n")} getCancellationToken: () => cancellationToken, getCanonicalFileName, useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, - getNewLine: () => getNewLineCharacter(newSettings, () => getNewLineOrDefaultFromHost(host)), + getNewLine: () => getNewLineCharacter(newSettings), getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2), writeFile: noop, getCurrentDirectory: () => currentDirectory, @@ -129143,22 +132719,22 @@ ${lanes.join("\n")} } return []; } - function getCodeFixesAtPosition(fileName, start, end, errorCodes64, formatOptions, preferences = emptyOptions) { + function getCodeFixesAtPosition(fileName, start, end, errorCodes63, formatOptions, preferences = emptyOptions) { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); const span = createTextSpanFromBounds(start, end); const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - return flatMap(deduplicate(errorCodes64, equateValues, compareValues), (errorCode) => { + return flatMap(deduplicate(errorCodes63, equateValues, compareValues), (errorCode) => { cancellationToken.throwIfCancellationRequested(); return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences }); }); } - function getCombinedCodeFix(scope, fixId52, formatOptions, preferences = emptyOptions) { + function getCombinedCodeFix(scope, fixId51, formatOptions, preferences = emptyOptions) { synchronizeHostData(); Debug.assert(scope.type === "file"); const sourceFile = getValidSourceFile(scope.fileName); const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - return ts_codefix_exports.getAllFixes({ fixId: fixId52, sourceFile, program, host, cancellationToken, formatContext, preferences }); + return ts_codefix_exports.getAllFixes({ fixId: fixId51, sourceFile, program, host, cancellationToken, formatContext, preferences }); } function organizeImports2(args, formatOptions, preferences = emptyOptions) { var _a3; @@ -129182,7 +132758,11 @@ ${lanes.join("\n")} return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); } function getDocCommentTemplateAtPosition2(fileName, position, options) { - return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost( + host, + /*formatSettings*/ + void 0 + ), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); } function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { if (openingBrace === 60 /* lessThan */) { @@ -129813,7 +133393,7 @@ ${lanes.join("\n")} if (!children.length) { return void 0; } - const child = find(children, (kid) => kid.kind < 312 /* FirstJSDocNode */ || kid.kind > 352 /* LastJSDocNode */); + const child = find(children, (kid) => kid.kind < 312 /* FirstJSDocNode */ || kid.kind > 353 /* LastJSDocNode */); return child.kind < 163 /* FirstNode */ ? child : child.getFirstToken(sourceFile); } getLastToken(sourceFile) { @@ -130776,7 +134356,11 @@ ${lanes.join("\n")} ); } realizeDiagnostics(diagnostics) { - const newLine = getNewLineOrDefaultFromHost(this.host); + const newLine = getNewLineOrDefaultFromHost( + this.host, + /*formatSettings*/ + void 0 + ); return realizeDiagnostics(diagnostics, newLine); } getSyntacticClassifications(fileName, start, length2) { @@ -131909,9 +135493,9 @@ ${lanes.join("\n")} return node.name; if (isConstNamedExpression(node)) return node.parent.name; - return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier2)); + return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier3)); } - function isDefaultModifier2(node) { + function isDefaultModifier3(node) { return node.kind === 88 /* DefaultKeyword */; } function getSymbolOfCallHierarchyDeclaration(typeChecker, node) { @@ -131923,7 +135507,7 @@ ${lanes.join("\n")} return { text: node.fileName, pos: 0, end: 0 }; } if ((isFunctionDeclaration(node) || isClassDeclaration(node)) && !isNamedDeclaration(node)) { - const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier2); + const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier3); if (defaultModifier) { return { text: "default", pos: defaultModifier.getStart(), end: defaultModifier.getEnd() }; } @@ -132624,23 +136208,23 @@ ${lanes.join("\n")} void 0 ); } - function createCodeFixAction(fixName8, changes, description2, fixId52, fixAllDescription, command) { - return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId52, diagnosticToString(fixAllDescription), command); + function createCodeFixAction(fixName8, changes, description2, fixId51, fixAllDescription, command) { + return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId51, diagnosticToString(fixAllDescription), command); } - function createCodeFixActionMaybeFixAll(fixName8, changes, description2, fixId52, fixAllDescription, command) { - return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId52, fixAllDescription && diagnosticToString(fixAllDescription), command); + function createCodeFixActionMaybeFixAll(fixName8, changes, description2, fixId51, fixAllDescription, command) { + return createCodeFixActionWorker(fixName8, diagnosticToString(description2), changes, fixId51, fixAllDescription && diagnosticToString(fixAllDescription), command); } - function createCodeFixActionWorker(fixName8, description2, changes, fixId52, fixAllDescription, command) { - return { fixName: fixName8, description: description2, changes, fixId: fixId52, fixAllDescription, commands: command ? [command] : void 0 }; + function createCodeFixActionWorker(fixName8, description2, changes, fixId51, fixAllDescription, command) { + return { fixName: fixName8, description: description2, changes, fixId: fixId51, fixAllDescription, commands: command ? [command] : void 0 }; } function registerCodeFix(reg) { for (const error of reg.errorCodes) { errorCodeToFixes.add(String(error), reg); } if (reg.fixIds) { - for (const fixId52 of reg.fixIds) { - Debug.assert(!fixIdToRegistration.has(fixId52)); - fixIdToRegistration.set(fixId52, reg); + for (const fixId51 of reg.fixIds) { + Debug.assert(!fixIdToRegistration.has(fixId51)); + fixIdToRegistration.set(fixId51, reg); } } } @@ -132648,17 +136232,17 @@ ${lanes.join("\n")} return arrayFrom(errorCodeToFixes.keys()); } function removeFixIdIfFixAllUnavailable(registration, diagnostics) { - const { errorCodes: errorCodes64 } = registration; + const { errorCodes: errorCodes63 } = registration; let maybeFixableDiagnostics = 0; for (const diag2 of diagnostics) { - if (contains(errorCodes64, diag2.code)) + if (contains(errorCodes63, diag2.code)) maybeFixableDiagnostics++; if (maybeFixableDiagnostics > 1) break; } const fixAllUnavailable = maybeFixableDiagnostics < 2; - return ({ fixId: fixId52, fixAllDescription, ...action }) => { - return fixAllUnavailable ? action : { ...action, fixId: fixId52, fixAllDescription }; + return ({ fixId: fixId51, fixAllDescription, ...action }) => { + return fixAllUnavailable ? action : { ...action, fixId: fixId51, fixAllDescription }; }; } function getFixes(context) { @@ -132675,14 +136259,14 @@ ${lanes.join("\n")} function createFileTextChanges(fileName, textChanges2) { return { fileName, textChanges: textChanges2 }; } - function codeFixAll(context, errorCodes64, use) { + function codeFixAll(context, errorCodes63, use) { const commands = []; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes64, (diag2) => use(t, diag2, commands))); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes63, (diag2) => use(t, diag2, commands))); return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands); } - function eachDiagnostic(context, errorCodes64, cb) { + function eachDiagnostic(context, errorCodes63, cb) { for (const diag2 of getDiagnostics(context)) { - if (contains(errorCodes64, diag2.code)) { + if (contains(errorCodes63, diag2.code)) { cb(diag2); } } @@ -133425,7 +137009,7 @@ ${lanes.join("\n")} if (!param.type) { const paramType = getJSDocType(param); if (paramType) - changes.tryInsertTypeAnnotation(sourceFile, param, transformJSDocType(paramType)); + changes.tryInsertTypeAnnotation(sourceFile, param, visitNode(paramType, transformJSDocType, isTypeNode)); } } if (needParens) @@ -133433,12 +137017,12 @@ ${lanes.join("\n")} if (!decl.type) { const returnType = getJSDocReturnType(decl); if (returnType) - changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType)); + changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(returnType, transformJSDocType, isTypeNode)); } } else { const jsdocType = Debug.checkDefined(getJSDocType(decl), "A JSDocType for this declaration should exist"); Debug.assert(!decl.type, "The JSDocType decl should have a type"); - changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType)); + changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(jsdocType, transformJSDocType, isTypeNode)); } } function isDeclarationWithType(node) { @@ -133475,19 +137059,19 @@ ${lanes.join("\n")} void 0, isIdentifier(tag.name) ? tag.name : tag.name.right, isOptionalJSDocPropertyLikeTag(tag) ? factory.createToken(57 /* QuestionToken */) : void 0, - tag.typeExpression && visitNode(tag.typeExpression.type, transformJSDocType) || factory.createKeywordTypeNode(131 /* AnyKeyword */) + tag.typeExpression && visitNode(tag.typeExpression.type, transformJSDocType, isTypeNode) || factory.createKeywordTypeNode(131 /* AnyKeyword */) ))); setEmitFlags(typeNode, 1 /* SingleLine */); return typeNode; } function transformJSDocOptionalType(node) { - return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType), factory.createTypeReferenceNode("undefined", emptyArray)]); + return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("undefined", emptyArray)]); } function transformJSDocNullableType(node) { - return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType), factory.createTypeReferenceNode("null", emptyArray)]); + return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("null", emptyArray)]); } function transformJSDocVariadicType(node) { - return factory.createArrayTypeNode(visitNode(node.type, transformJSDocType)); + return factory.createArrayTypeNode(visitNode(node.type, transformJSDocType, isTypeNode)); } function transformJSDocFunctionType(node) { var _a2; @@ -133498,7 +137082,7 @@ ${lanes.join("\n")} const isRest = node.type.kind === 321 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; const name = node.name || (isRest ? "rest" : "arg" + index); const dotdotdot = isRest ? factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; - return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType), node.initializer); + return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType, isTypeNode), node.initializer); } function transformJSDocTypeReference(node) { let name = node.typeName; @@ -133525,7 +137109,7 @@ ${lanes.join("\n")} if ((text === "Array" || text === "Promise") && !node.typeArguments) { args = factory.createNodeArray([factory.createTypeReferenceNode("any", emptyArray)]); } else { - args = visitNodes2(node.typeArguments, transformJSDocType); + args = visitNodes2(node.typeArguments, transformJSDocType, isTypeNode); } } return factory.createTypeReferenceNode(name, args); @@ -134638,8 +138222,8 @@ ${lanes.join("\n")} function collectExportRenames(sourceFile, checker, identifiers) { const res = /* @__PURE__ */ new Map(); forEachExportReference(sourceFile, (node) => { - const { text, originalKeywordKind } = node.name; - if (!res.has(text) && (originalKeywordKind !== void 0 && isNonContextualKeyword(originalKeywordKind) || checker.resolveName( + const { text } = node.name; + if (!res.has(text) && (isIdentifierANonContextualKeyword(node.name) || checker.resolveName( text, node, 111551 /* Value */, @@ -135239,7 +138823,7 @@ ${lanes.join("\n")} "use strict"; init_ts4(); init_ts_codefix(); - errorCodes13 = [Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code]; + errorCodes13 = [Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code]; fixId12 = "convertToTypeOnlyExport"; registerCodeFix({ errorCodes: errorCodes13, @@ -135523,7 +139107,7 @@ ${lanes.join("\n")} Debug.checkDefined(exportInfo), moduleSymbol, program, - /*useNamespaceInfo*/ + /*position*/ void 0, !!isValidTypeOnlyUseSite, useRequire, @@ -135668,7 +139252,8 @@ ${lanes.join("\n")} sourceFile, newDeclarations, /*blankLineBetween*/ - true + true, + preferences ); } } @@ -135680,10 +139265,10 @@ ${lanes.join("\n")} const packageJsonImportFilter = createPackageJsonImportFilter(importingFile, preferences, host); const importMap = createExistingImportMap(program.getTypeChecker(), importingFile, program.getCompilerOptions()); return { getModuleSpecifierForBestExportInfo }; - function getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite, fromCacheOnly) { + function getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, fromCacheOnly) { const { fixes, computedWithoutCacheCount } = getImportFixes( exportInfo, - { symbolName: symbolName2, position }, + position, isValidTypeOnlyUseSite, /*useRequire*/ false, @@ -135704,7 +139289,7 @@ ${lanes.join("\n")} Debug.assertIsDefined(exportInfos); const useRequire = shouldUseRequire(sourceFile, program); const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); - const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, { symbolName: symbolName2, position }, isValidTypeOnlyUseSite, useRequire, host, preferences)); + const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); return { moduleSpecifier: fix.moduleSpecifier, codeAction: codeFixActionToCodeAction(codeActionForFix( @@ -135726,10 +139311,10 @@ ${lanes.join("\n")} const includeSymbolNameInDescription = symbolName2 !== symbolToken.text; return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences)); } - function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, host, preferences) { + function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol"); const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); - return getBestFix(getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); + return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); } function codeFixActionToCodeAction({ description: description2, changes, commands }) { return { description: description2, changes, commands }; @@ -135770,10 +139355,10 @@ ${lanes.join("\n")} } } } - function getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()), fromCacheOnly) { + function getImportFixes(exportInfos, usagePosition, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()), fromCacheOnly) { const checker = program.getTypeChecker(); const existingImports = flatMap(exportInfos, importMap.getImportsForExportInfo); - const useNamespace = useNamespaceInfo && tryUseExistingNamespaceImport(existingImports, useNamespaceInfo.symbolName, useNamespaceInfo.position, checker); + const useNamespace = usagePosition !== void 0 && tryUseExistingNamespaceImport(existingImports, usagePosition); const addToExisting = tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, program.getCompilerOptions()); if (addToExisting) { return { @@ -135786,7 +139371,7 @@ ${lanes.join("\n")} existingImports, program, sourceFile, - useNamespaceInfo == null ? void 0 : useNamespaceInfo.position, + usagePosition, isValidTypeOnlyUseSite, useRequire, host, @@ -135798,33 +139383,18 @@ ${lanes.join("\n")} fixes: [...useNamespace ? [useNamespace] : emptyArray, ...fixes] }; } - function tryUseExistingNamespaceImport(existingImports, symbolName2, position, checker) { - return firstDefined(existingImports, ({ declaration }) => { + function tryUseExistingNamespaceImport(existingImports, position) { + return firstDefined(existingImports, ({ declaration, importKind }) => { var _a2; + if (importKind !== 0 /* Named */) + return void 0; const namespacePrefix = getNamespaceLikeImportText(declaration); - const moduleSpecifier = (_a2 = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a2.text; - if (namespacePrefix && moduleSpecifier) { - const moduleSymbol = getTargetModuleFromNamespaceLikeImport(declaration, checker); - if (moduleSymbol && moduleSymbol.exports.has(escapeLeadingUnderscores(symbolName2))) { - return { kind: 0 /* UseNamespace */, namespacePrefix, position, moduleSpecifier }; - } + const moduleSpecifier = namespacePrefix && ((_a2 = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a2.text); + if (moduleSpecifier) { + return { kind: 0 /* UseNamespace */, namespacePrefix, usagePosition: position, moduleSpecifier }; } }); } - function getTargetModuleFromNamespaceLikeImport(declaration, checker) { - var _a2; - switch (declaration.kind) { - case 257 /* VariableDeclaration */: - return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 268 /* ImportEqualsDeclaration */: - return checker.getAliasedSymbol(declaration.symbol); - case 269 /* ImportDeclaration */: - const namespaceImport = tryCast((_a2 = declaration.importClause) == null ? void 0 : _a2.namedBindings, isNamespaceImport); - return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); - default: - return Debug.assertNever(declaration); - } - } function getNamespaceLikeImportText(declaration) { var _a2, _b, _c; switch (declaration.kind) { @@ -135845,7 +139415,7 @@ ${lanes.join("\n")} if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2 /* Error */) { return 2 /* Required */; } - if (compilerOptions.isolatedModules && compilerOptions.preserveValueImports && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { + if ((compilerOptions.isolatedModules && compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { return 2 /* Required */; } return 1 /* Allowed */; @@ -135940,7 +139510,7 @@ ${lanes.join("\n")} function createGetChecker(program, host) { return memoizeOne((isFromPackageJson) => isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker()); } - function getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { + function getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { const isJs = isSourceFileJS(sourceFile); const compilerOptions = program.getCompilerOptions(); const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); @@ -135963,27 +139533,47 @@ ${lanes.join("\n")} compilerOptions ); computedWithoutCacheCount += computedWithoutCache ? 1 : 0; - return mapDefined( - moduleSpecifiers, - (moduleSpecifier) => rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier) ? void 0 : ( - // `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types. - !importedSymbolHasValueMeaning && isJs && position !== void 0 ? { kind: 1 /* JsdocTypeImport */, moduleSpecifier, position, exportInfo: exportInfo2, isReExport: i > 0 } : { - kind: 3 /* AddNew */, - moduleSpecifier, - importKind: getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions), - useRequire, - addAsTypeOnly, - exportInfo: exportInfo2, - isReExport: i > 0 - } - ) - ); + return mapDefined(moduleSpecifiers, (moduleSpecifier) => { + var _a2; + if (rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier)) { + return void 0; + } + if (!importedSymbolHasValueMeaning && isJs && usagePosition !== void 0) { + return { kind: 1 /* JsdocTypeImport */, moduleSpecifier, usagePosition, exportInfo: exportInfo2, isReExport: i > 0 }; + } + const importKind = getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions); + let qualification; + if (usagePosition !== void 0 && importKind === 3 /* CommonJS */ && exportInfo2.exportKind === 0 /* Named */) { + const exportEquals = checker.resolveExternalModuleSymbol(exportInfo2.moduleSymbol); + let namespacePrefix; + if (exportEquals !== exportInfo2.moduleSymbol) { + namespacePrefix = (_a2 = getDefaultExportInfoWorker(exportEquals, checker, compilerOptions)) == null ? void 0 : _a2.name; + } + namespacePrefix || (namespacePrefix = moduleSymbolToValidIdentifier( + exportInfo2.moduleSymbol, + getEmitScriptTarget(compilerOptions), + /*forceCapitalize*/ + false + )); + qualification = { namespacePrefix, usagePosition }; + } + return { + kind: 3 /* AddNew */, + moduleSpecifier, + importKind, + useRequire, + addAsTypeOnly, + exportInfo: exportInfo2, + isReExport: i > 0, + qualification + }; + }); }); return { computedWithoutCacheCount, fixes }; } - function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { + function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { const existingDeclaration = firstDefined(existingImports, (info) => newImportInfoFromExistingSpecifier(info, isValidTypeOnlyUseSite, useRequire, program.getTypeChecker(), program.getCompilerOptions())); - return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); + return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); } function newImportInfoFromExistingSpecifier({ declaration, importKind, symbol, targetFlags }, isValidTypeOnlyUseSite, useRequire, checker, compilerOptions) { var _a2; @@ -136083,10 +139673,10 @@ ${lanes.join("\n")} const symbolName2 = umdSymbol.name; const exportInfo = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: void 0, exportKind: 3 /* UMD */, targetFlags: symbol.flags, isFromPackageJson: false }]; const useRequire = shouldUseRequire(sourceFile, program); - const position = isIdentifier(token) ? token.getStart(sourceFile) : void 0; const fixes = getImportFixes( exportInfo, - position ? { position, symbolName: symbolName2 } : void 0, + /*usagePosition*/ + void 0, /*isValidTypeOnlyUseSite*/ false, useRequire, @@ -136105,15 +139695,24 @@ ${lanes.join("\n")} if (isUMDExportSymbol(umdSymbol)) return umdSymbol; const { parent: parent2 } = token; - return isJsxOpeningLikeElement(parent2) && parent2.tagName === token || isJsxOpeningFragment(parent2) ? tryCast(checker.resolveName( - checker.getJsxNamespace(parent2), - isJsxOpeningLikeElement(parent2) ? token : parent2, - 111551 /* Value */, - /*excludeGlobals*/ - false - ), isUMDExportSymbol) : void 0; + if (isJsxOpeningLikeElement(parent2) && parent2.tagName === token || isJsxOpeningFragment(parent2)) { + const parentSymbol = checker.resolveName( + checker.getJsxNamespace(parent2), + isJsxOpeningLikeElement(parent2) ? token : parent2, + 111551 /* Value */, + /*excludeGlobals*/ + false + ); + if (isUMDExportSymbol(parentSymbol)) { + return parentSymbol; + } + } + return void 0; } function getImportKind(importingFile, exportKind, compilerOptions, forceImportKeyword) { + if (compilerOptions.verbatimModuleSyntax && (getEmitModuleKind(compilerOptions) === 1 /* CommonJS */ || importingFile.impliedNodeFormat === 1 /* CommonJS */)) { + return 3 /* CommonJS */; + } switch (exportKind) { case 0 /* Named */: return 0 /* Named */; @@ -136165,7 +139764,7 @@ ${lanes.join("\n")} const useRequire = shouldUseRequire(sourceFile, program); const exportInfo = getExportInfos(symbolName2, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences); return arrayFrom( - flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, { symbolName: symbolName2, position: symbolToken.getStart(sourceFile) }, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes), + flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, symbolToken.getStart(sourceFile), isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes), (fix) => ({ fix, symbolName: symbolName2, errorIdentifierText: symbolToken.text, isJsxNamespaceFix: symbolName2 !== symbolToken.text }) ); }); @@ -136235,7 +139834,7 @@ ${lanes.join("\n")} cancellationToken.throwIfCancellationRequested(); const compilerOptions = program2.getCompilerOptions(); const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName2 || moduleSymbolToValidIdentifier(moduleSymbol, getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName2) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { + if (defaultInfo && (defaultInfo.name === symbolName2 || moduleSymbolToValidIdentifier(moduleSymbol, getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName2) && symbolHasMeaning(defaultInfo.resolvedSymbol, currentTokenMeaning)) { addSymbol(moduleSymbol, sourceFile, defaultInfo.symbol, defaultInfo.exportKind, program2, isFromPackageJson); } const exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); @@ -136292,23 +139891,27 @@ ${lanes.join("\n")} return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifierWithoutQuotes] : [Diagnostics.Update_import_from_0, moduleSpecifierWithoutQuotes]; } case 3 /* AddNew */: { - const { importKind, moduleSpecifier, addAsTypeOnly, useRequire } = fix; + const { importKind, moduleSpecifier, addAsTypeOnly, useRequire, qualification } = fix; const getDeclarations = useRequire ? getNewRequires : getNewImports; const defaultImport = importKind === 1 /* Default */ ? { name: symbolName2, addAsTypeOnly } : void 0; const namedImports = importKind === 0 /* Named */ ? [{ name: symbolName2, addAsTypeOnly }] : void 0; - const namespaceLikeImport = importKind === 2 /* Namespace */ || importKind === 3 /* CommonJS */ ? { importKind, name: symbolName2, addAsTypeOnly } : void 0; + const namespaceLikeImport = importKind === 2 /* Namespace */ || importKind === 3 /* CommonJS */ ? { importKind, name: (qualification == null ? void 0 : qualification.namespacePrefix) || symbolName2, addAsTypeOnly } : void 0; insertImports( changes, sourceFile, getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport), /*blankLineBetween*/ - true + true, + preferences ); + if (qualification) { + addNamespaceQualifier(changes, sourceFile, qualification); + } return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifier] : [Diagnostics.Add_import_from_0, moduleSpecifier]; } case 4 /* PromoteTypeOnly */: { const { typeOnlyAliasDeclaration } = fix; - const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile); + const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile, preferences); return promotedDeclaration.kind === 273 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; } default: @@ -136319,12 +139922,12 @@ ${lanes.join("\n")} var _a2, _b; return promotedDeclaration.kind === 268 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } - function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile) { - const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules; + function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) { + const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax; switch (aliasDeclaration.kind) { case 273 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { - const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements); + const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements, preferences); if (aliasDeclaration.parent.elements.length > 1 && sortKind) { changes.delete(sourceFile, aliasDeclaration); const newSpecifier = factory.updateImportSpecifier( @@ -136334,7 +139937,8 @@ ${lanes.join("\n")} aliasDeclaration.propertyName, aliasDeclaration.name ); - const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, sortKind === 2 /* CaseInsensitive */); + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); + const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, comparer); changes.insertImportSpecifierAtIndex(sourceFile, newSpecifier, aliasDeclaration.parent, insertionIndex); } else { changes.deleteRange(sourceFile, aliasDeclaration.getFirstToken()); @@ -136362,7 +139966,7 @@ ${lanes.join("\n")} if (convertExistingToTypeOnly) { const namedImports = tryCast(importClause.namedBindings, isNamedImports); if (namedImports && namedImports.elements.length > 1) { - if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements) && aliasDeclaration.kind === 273 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { + if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements, preferences) && aliasDeclaration.kind === 273 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { changes.delete(sourceFile, aliasDeclaration); changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); } @@ -136393,7 +139997,7 @@ ${lanes.join("\n")} } const promoteFromTypeOnly2 = clause.isTypeOnly && some([defaultImport, ...namedImports], (i) => (i == null ? void 0 : i.addAsTypeOnly) === 4 /* NotAllowed */); const existingSpecifiers = clause.namedBindings && ((_a2 = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a2.elements); - const convertExistingToTypeOnly = promoteFromTypeOnly2 && compilerOptions.preserveValueImports && compilerOptions.isolatedModules; + const convertExistingToTypeOnly = promoteFromTypeOnly2 && (compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax); if (defaultImport) { Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " }); @@ -136403,14 +140007,15 @@ ${lanes.join("\n")} if (typeof preferences.organizeImportsIgnoreCase === "boolean") { ignoreCaseForSorting = preferences.organizeImportsIgnoreCase; } else if (existingSpecifiers) { - const targetImportSorting = ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers); + const targetImportSorting = ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences); if (targetImportSorting !== 3 /* Both */) { ignoreCaseForSorting = targetImportSorting === 2 /* CaseInsensitive */; } } if (ignoreCaseForSorting === void 0) { - ignoreCaseForSorting = ts_OrganizeImports_exports.detectSorting(sourceFile) === 2 /* CaseInsensitive */; + ignoreCaseForSorting = ts_OrganizeImports_exports.detectSorting(sourceFile, preferences) === 2 /* CaseInsensitive */; } + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, ignoreCaseForSorting); const newSpecifiers = stableSort( namedImports.map((namedImport) => factory.createImportSpecifier( (!clause.isTypeOnly || promoteFromTypeOnly2) && needsTypeOnly(namedImport), @@ -136418,12 +140023,12 @@ ${lanes.join("\n")} void 0, factory.createIdentifier(namedImport.name) )), - (s1, s2) => ts_OrganizeImports_exports.compareImportOrExportSpecifiers(s1, s2, ignoreCaseForSorting) + (s1, s2) => ts_OrganizeImports_exports.compareImportOrExportSpecifiers(s1, s2, comparer) ); - const specifierSort = (existingSpecifiers == null ? void 0 : existingSpecifiers.length) && ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers); + const specifierSort = (existingSpecifiers == null ? void 0 : existingSpecifiers.length) && ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences); if (specifierSort && !(ignoreCaseForSorting && specifierSort === 1 /* CaseSensitive */)) { for (const spec of newSpecifiers) { - const insertionIndex = convertExistingToTypeOnly && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, ignoreCaseForSorting); + const insertionIndex = convertExistingToTypeOnly && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, comparer); changes.insertImportSpecifierAtIndex(sourceFile, spec, clause.namedBindings, insertionIndex); } } else if (existingSpecifiers == null ? void 0 : existingSpecifiers.length) { @@ -136463,10 +140068,10 @@ ${lanes.join("\n")} } } } - function addNamespaceQualifier(changes, sourceFile, { namespacePrefix, position }) { - changes.insertText(sourceFile, position, namespacePrefix + "."); + function addNamespaceQualifier(changes, sourceFile, { namespacePrefix, usagePosition }) { + changes.insertText(sourceFile, usagePosition, namespacePrefix + "."); } - function addImportType(changes, sourceFile, { moduleSpecifier, position }, quotePreference) { + function addImportType(changes, sourceFile, { moduleSpecifier, usagePosition: position }, quotePreference) { changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference)); } function getImportTypePrefix(moduleSpecifier, quotePreference) { @@ -136942,10 +140547,10 @@ ${lanes.join("\n")} const info = errorCodeFixIdMap[errorCode]; if (!info) return emptyArray; - const { descriptions, fixId: fixId52, fixAllDescriptions } = info; + const { descriptions, fixId: fixId51, fixAllDescriptions } = info; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => dispatchChanges(changes2, context, errorCode, span.start)); return [ - createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId52, fixAllDescriptions) + createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId51, fixAllDescriptions) ]; }, fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId], @@ -138277,7 +141882,7 @@ ${lanes.join("\n")} }, fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes], getAllCodeActions: (context) => { - const { program, fixId: fixId52 } = context; + const { program, fixId: fixId51 } = context; const checker = program.getTypeChecker(); const seen = /* @__PURE__ */ new Map(); const typeDeclToMembers = /* @__PURE__ */ new Map(); @@ -138287,11 +141892,11 @@ ${lanes.join("\n")} if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + info.token.text)) { return; } - if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) { + if (fixId51 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) { addFunctionDeclaration(changes, context, info); - } else if (fixId52 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) { + } else if (fixId51 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) { addObjectLiteralProperties(changes, context, info); - } else if (fixId52 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) { + } else if (fixId51 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) { addJsxAttributes(changes, context, info); } else { if (info.kind === 1 /* Enum */) { @@ -138579,56 +142184,20 @@ ${lanes.join("\n")} } }); - // src/services/codefixes/fixEnableExperimentalDecorators.ts - function doChange12(changeTracker, configFile) { - setJsonCompilerOptionValue(changeTracker, configFile, "experimentalDecorators", factory.createTrue()); - } - var fixId27, errorCodes32; - var init_fixEnableExperimentalDecorators = __esm({ - "src/services/codefixes/fixEnableExperimentalDecorators.ts"() { - "use strict"; - init_ts4(); - init_ts_codefix(); - fixId27 = "enableExperimentalDecorators"; - errorCodes32 = [ - Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning.code - ]; - registerCodeFix({ - errorCodes: errorCodes32, - getCodeActions: function getCodeActionsToEnableExperimentalDecorators(context) { - const { configFile } = context.program.getCompilerOptions(); - if (configFile === void 0) { - return void 0; - } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => doChange12(changeTracker, configFile)); - return [createCodeFixActionWithoutFixAll(fixId27, changes, Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]; - }, - fixIds: [fixId27], - getAllCodeActions: (context) => codeFixAll(context, errorCodes32, (changes) => { - const { configFile } = context.program.getCompilerOptions(); - if (configFile === void 0) { - return void 0; - } - doChange12(changes, configFile); - }) - }); - } - }); - // src/services/codefixes/fixEnableJsxFlag.ts - function doChange13(changeTracker, configFile) { + function doChange12(changeTracker, configFile) { setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react")); } - var fixID, errorCodes33; + var fixID, errorCodes32; var init_fixEnableJsxFlag = __esm({ "src/services/codefixes/fixEnableJsxFlag.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixID = "fixEnableJsxFlag"; - errorCodes33 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; + errorCodes32 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; registerCodeFix({ - errorCodes: errorCodes33, + errorCodes: errorCodes32, getCodeActions: function getCodeActionsToFixEnableJsxFlag(context) { const { configFile } = context.program.getCompilerOptions(); if (configFile === void 0) { @@ -138636,19 +142205,19 @@ ${lanes.join("\n")} } const changes = ts_textChanges_exports.ChangeTracker.with( context, - (changeTracker) => doChange13(changeTracker, configFile) + (changeTracker) => doChange12(changeTracker, configFile) ); return [ createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) ]; }, fixIds: [fixID], - getAllCodeActions: (context) => codeFixAll(context, errorCodes33, (changes) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes32, (changes) => { const { configFile } = context.program.getCompilerOptions(); if (configFile === void 0) { return void 0; } - doChange13(changes, configFile); + doChange12(changes, configFile); }) }); } @@ -138670,7 +142239,7 @@ ${lanes.join("\n")} } return void 0; } - function doChange14(changes, sourceFile, arg, expression) { + function doChange13(changes, sourceFile, arg, expression) { const callExpression = factory.createCallExpression( factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")), /*typeArguments*/ @@ -138688,33 +142257,33 @@ ${lanes.join("\n")} const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/\'(.*)\'/) || []; return suggestion; } - var fixId28, errorCodes34; + var fixId27, errorCodes33; var init_fixNaNEquality = __esm({ "src/services/codefixes/fixNaNEquality.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId28 = "fixNaNEquality"; - errorCodes34 = [ + fixId27 = "fixNaNEquality"; + errorCodes33 = [ Diagnostics.This_condition_will_always_return_0.code ]; registerCodeFix({ - errorCodes: errorCodes34, + errorCodes: errorCodes33, getCodeActions(context) { const { sourceFile, span, program } = context; const info = getInfo8(program, sourceFile, span); if (info === void 0) return; const { suggestion, expression, arg } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, sourceFile, arg, expression)); - return [createCodeFixAction(fixId28, changes, [Diagnostics.Use_0, suggestion], fixId28, Diagnostics.Use_Number_isNaN_in_all_conditions)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange13(t, sourceFile, arg, expression)); + return [createCodeFixAction(fixId27, changes, [Diagnostics.Use_0, suggestion], fixId27, Diagnostics.Use_Number_isNaN_in_all_conditions)]; }, - fixIds: [fixId28], + fixIds: [fixId27], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes34, (changes, diag2) => { + return codeFixAll(context, errorCodes33, (changes, diag2) => { const info = getInfo8(context.program, diag2.file, createTextSpan(diag2.start, diag2.length)); if (info) { - doChange14(changes, diag2.file, info.arg, info.expression); + doChange13(changes, diag2.file, info.arg, info.expression); } }); } @@ -138770,32 +142339,32 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixPropertyAssignment.ts - function doChange15(changes, sourceFile, node) { + function doChange14(changes, sourceFile, node) { changes.replaceNode(sourceFile, node, factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer)); } function getProperty2(sourceFile, pos) { return cast(getTokenAtPosition(sourceFile, pos).parent, isShorthandPropertyAssignment); } - var fixId29, errorCodes35; + var fixId28, errorCodes34; var init_fixPropertyAssignment = __esm({ "src/services/codefixes/fixPropertyAssignment.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId29 = "fixPropertyAssignment"; - errorCodes35 = [ + fixId28 = "fixPropertyAssignment"; + errorCodes34 = [ Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code ]; registerCodeFix({ - errorCodes: errorCodes35, - fixIds: [fixId29], + errorCodes: errorCodes34, + fixIds: [fixId28], getCodeActions(context) { const { sourceFile, span } = context; const property = getProperty2(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, context.sourceFile, property)); - return [createCodeFixAction(fixId29, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId29, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile, property)); + return [createCodeFixAction(fixId28, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId28, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes, diag2) => doChange15(changes, diag2.file, getProperty2(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange14(changes, diag2.file, getProperty2(diag2.file, diag2.start))) }); } }); @@ -138821,16 +142390,16 @@ ${lanes.join("\n")} changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end }); } } - var fixId30, errorCodes36; + var fixId29, errorCodes35; var init_fixExtendsInterfaceBecomesImplements = __esm({ "src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId30 = "extendsInterfaceBecomesImplements"; - errorCodes36 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; + fixId29 = "extendsInterfaceBecomesImplements"; + errorCodes35 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; registerCodeFix({ - errorCodes: errorCodes36, + errorCodes: errorCodes35, getCodeActions(context) { const { sourceFile } = context; const nodes = getNodes2(sourceFile, context.span.start); @@ -138838,10 +142407,10 @@ ${lanes.join("\n")} return void 0; const { extendsToken, heritageClauses } = nodes; const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChanges2(t, sourceFile, extendsToken, heritageClauses)); - return [createCodeFixAction(fixId30, changes, Diagnostics.Change_extends_to_implements, fixId30, Diagnostics.Change_all_extended_interfaces_to_implements)]; + return [createCodeFixAction(fixId29, changes, Diagnostics.Change_extends_to_implements, fixId29, Diagnostics.Change_all_extended_interfaces_to_implements)]; }, - fixIds: [fixId30], - getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { + fixIds: [fixId29], + getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes, diag2) => { const nodes = getNodes2(diag2.file, diag2.start); if (nodes) doChanges2(changes, diag2.file, nodes.extendsToken, nodes.heritageClauses); @@ -138857,39 +142426,39 @@ ${lanes.join("\n")} return { node, className: diagCode === didYouMeanStaticMemberCode ? getContainingClass(node).name.text : void 0 }; } } - function doChange16(changes, sourceFile, { node, className }) { + function doChange15(changes, sourceFile, { node, className }) { suppressLeadingAndTrailingTrivia(node); changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node)); } - var fixId31, didYouMeanStaticMemberCode, errorCodes37; + var fixId30, didYouMeanStaticMemberCode, errorCodes36; var init_fixForgottenThisPropertyAccess = __esm({ "src/services/codefixes/fixForgottenThisPropertyAccess.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId31 = "forgottenThisPropertyAccess"; + fixId30 = "forgottenThisPropertyAccess"; didYouMeanStaticMemberCode = Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code; - errorCodes37 = [ + errorCodes36 = [ Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, didYouMeanStaticMemberCode ]; registerCodeFix({ - errorCodes: errorCodes37, + errorCodes: errorCodes36, getCodeActions(context) { const { sourceFile } = context; const info = getInfo9(sourceFile, context.span.start, context.errorCode); if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16(t, sourceFile, info)); - return [createCodeFixAction(fixId31, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId31, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, sourceFile, info)); + return [createCodeFixAction(fixId30, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId30, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; }, - fixIds: [fixId31], - getAllCodeActions: (context) => codeFixAll(context, errorCodes37, (changes, diag2) => { + fixIds: [fixId30], + getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { const info = getInfo9(diag2.file, diag2.start, diag2.code); if (info) - doChange16(changes, context.sourceFile, info); + doChange15(changes, context.sourceFile, info); }) }); } @@ -138899,7 +142468,7 @@ ${lanes.join("\n")} function isValidCharacter(character) { return hasProperty(htmlEntity, character); } - function doChange17(changes, preferences, sourceFile, start, useHtmlEntity) { + function doChange16(changes, preferences, sourceFile, start, useHtmlEntity) { const character = sourceFile.getText()[start]; if (!isValidCharacter(character)) { return; @@ -138907,7 +142476,7 @@ ${lanes.join("\n")} const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(sourceFile, preferences, character)}}`; changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); } - var fixIdExpression, fixIdHtmlEntity, errorCodes38, htmlEntity; + var fixIdExpression, fixIdHtmlEntity, errorCodes37, htmlEntity; var init_fixInvalidJsxCharacters = __esm({ "src/services/codefixes/fixInvalidJsxCharacters.ts"() { "use strict"; @@ -138915,16 +142484,16 @@ ${lanes.join("\n")} init_ts_codefix(); fixIdExpression = "fixInvalidJsxCharacters_expression"; fixIdHtmlEntity = "fixInvalidJsxCharacters_htmlEntity"; - errorCodes38 = [ + errorCodes37 = [ Diagnostics.Unexpected_token_Did_you_mean_or_gt.code, Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code ]; registerCodeFix({ - errorCodes: errorCodes38, + errorCodes: errorCodes37, fixIds: [fixIdExpression, fixIdHtmlEntity], getCodeActions(context) { const { sourceFile, preferences, span } = context; - const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( + const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( t, preferences, sourceFile, @@ -138932,7 +142501,7 @@ ${lanes.join("\n")} /* useHtmlEntity */ false )); - const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( + const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( t, preferences, sourceFile, @@ -138946,7 +142515,7 @@ ${lanes.join("\n")} ]; }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes38, (changes, diagnostic) => doChange17(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); + return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange16(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); } }); htmlEntity = { @@ -138957,8 +142526,8 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixUnmatchedParameter.ts - function getDeleteAction(context, { name, signature, jsDocParameterTag }) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.filterJSDocTags(context.sourceFile, signature, (t) => t !== jsDocParameterTag)); + function getDeleteAction(context, { name, jsDocHost, jsDocParameterTag }) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.filterJSDocTags(context.sourceFile, jsDocHost, (t) => t !== jsDocParameterTag)); return createCodeFixAction( deleteUnmatchedParameter, changes, @@ -138997,14 +142566,15 @@ ${lanes.join("\n")} const token = getTokenAtPosition(sourceFile, pos); if (token.parent && isJSDocParameterTag(token.parent) && isIdentifier(token.parent.name)) { const jsDocParameterTag = token.parent; + const jsDocHost = getJSDocHost(jsDocParameterTag); const signature = getHostSignatureFromJSDoc(jsDocParameterTag); - if (signature) { - return { signature, name: token.parent.name, jsDocParameterTag }; + if (jsDocHost && signature) { + return { jsDocHost, signature, name: token.parent.name, jsDocParameterTag }; } } return void 0; } - var deleteUnmatchedParameter, renameUnmatchedParameter, errorCodes39; + var deleteUnmatchedParameter, renameUnmatchedParameter, errorCodes38; var init_fixUnmatchedParameter = __esm({ "src/services/codefixes/fixUnmatchedParameter.ts"() { "use strict"; @@ -139012,12 +142582,12 @@ ${lanes.join("\n")} init_ts_codefix(); deleteUnmatchedParameter = "deleteUnmatchedParameter"; renameUnmatchedParameter = "renameUnmatchedParameter"; - errorCodes39 = [ + errorCodes38 = [ Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code ]; registerCodeFix({ fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter], - errorCodes: errorCodes39, + errorCodes: errorCodes38, getCodeActions: function getCodeActionsToFixUnmatchedParameter(context) { const { sourceFile, span } = context; const actions2 = []; @@ -139032,7 +142602,7 @@ ${lanes.join("\n")} getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context) { const tagsToSignature = /* @__PURE__ */ new Map(); return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes39, ({ file, start }) => { + eachDiagnostic(context, errorCodes38, ({ file, start }) => { const info = getInfo10(file, start); if (info) { tagsToSignature.set(info.signature, append(tagsToSignature.get(info.signature), info.jsDocParameterTag)); @@ -139081,16 +142651,16 @@ ${lanes.join("\n")} function doNamespaceImportChange(changes, sourceFile, importDeclaration, program) { ts_refactor_exports.doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, importDeclaration.parent); } - var fixId32, errorCodes40; + var fixId31, errorCodes39; var init_fixUnreferenceableDecoratorMetadata = __esm({ "src/services/codefixes/fixUnreferenceableDecoratorMetadata.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId32 = "fixUnreferenceableDecoratorMetadata"; - errorCodes40 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code]; + fixId31 = "fixUnreferenceableDecoratorMetadata"; + errorCodes39 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code]; registerCodeFix({ - errorCodes: errorCodes40, + errorCodes: errorCodes39, getCodeActions: (context) => { const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start); if (!importDeclaration) @@ -139099,14 +142669,14 @@ ${lanes.join("\n")} const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program)); let actions2; if (namespaceChanges.length) { - actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId31, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); } if (typeOnlyChanges.length) { - actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, typeOnlyChanges, Diagnostics.Convert_to_type_only_import)); + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId31, typeOnlyChanges, Diagnostics.Convert_to_type_only_import)); } return actions2; }, - fixIds: [fixId32] + fixIds: [fixId31] }); } }); @@ -139259,7 +142829,7 @@ ${lanes.join("\n")} function mayDeleteExpression(node) { return (isBinaryExpression(node.parent) && node.parent.left === node || (isPostfixUnaryExpression(node.parent) || isPrefixUnaryExpression(node.parent)) && node.parent.operand === node) && isExpressionStatement(node.parent.parent); } - var fixName3, fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer, errorCodes41; + var fixName3, fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer, errorCodes40; var init_fixUnusedIdentifier = __esm({ "src/services/codefixes/fixUnusedIdentifier.ts"() { "use strict"; @@ -139270,7 +142840,7 @@ ${lanes.join("\n")} fixIdDelete = "unusedIdentifier_delete"; fixIdDeleteImports = "unusedIdentifier_deleteImports"; fixIdInfer = "unusedIdentifier_infer"; - errorCodes41 = [ + errorCodes40 = [ Diagnostics._0_is_declared_but_its_value_is_never_read.code, Diagnostics._0_is_declared_but_never_used.code, Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, @@ -139280,7 +142850,7 @@ ${lanes.join("\n")} Diagnostics.All_type_parameters_are_unused.code ]; registerCodeFix({ - errorCodes: errorCodes41, + errorCodes: errorCodes40, getCodeActions(context) { const { errorCode, sourceFile, program, cancellationToken } = context; const checker = program.getTypeChecker(); @@ -139366,7 +142936,7 @@ ${lanes.join("\n")} const { sourceFile, program, cancellationToken } = context; const checker = program.getTypeChecker(); const sourceFiles = program.getSourceFiles(); - return codeFixAll(context, errorCodes41, (changes, diag2) => { + return codeFixAll(context, errorCodes40, (changes, diag2) => { const token = getTokenAtPosition(sourceFile, diag2.start); switch (context.fixId) { case fixIdPrefix: @@ -139438,7 +143008,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixUnreachableCode.ts - function doChange18(changes, sourceFile, start, length2, errorCode) { + function doChange17(changes, sourceFile, start, length2, errorCode) { const token = getTokenAtPosition(sourceFile, start); const statement = findAncestor(token, isStatement); if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { @@ -139486,31 +143056,31 @@ ${lanes.join("\n")} } return last2; } - var fixId33, errorCodes42; + var fixId32, errorCodes41; var init_fixUnreachableCode = __esm({ "src/services/codefixes/fixUnreachableCode.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId33 = "fixUnreachableCode"; - errorCodes42 = [Diagnostics.Unreachable_code_detected.code]; + fixId32 = "fixUnreachableCode"; + errorCodes41 = [Diagnostics.Unreachable_code_detected.code]; registerCodeFix({ - errorCodes: errorCodes42, + errorCodes: errorCodes41, getCodeActions(context) { const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken); if (syntacticDiagnostics.length) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); - return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unreachable_code, fixId33, Diagnostics.Remove_all_unreachable_code)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); + return [createCodeFixAction(fixId32, changes, Diagnostics.Remove_unreachable_code, fixId32, Diagnostics.Remove_all_unreachable_code)]; }, - fixIds: [fixId33], - getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start, diag2.length, diag2.code)) + fixIds: [fixId32], + getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange17(changes, diag2.file, diag2.start, diag2.length, diag2.code)) }); } }); // src/services/codefixes/fixUnusedLabel.ts - function doChange19(changes, sourceFile, start) { + function doChange18(changes, sourceFile, start) { const token = getTokenAtPosition(sourceFile, start); const labeledStatement = cast(token.parent, isLabeledStatement); const pos = token.getStart(sourceFile); @@ -139523,28 +143093,28 @@ ${lanes.join("\n")} ); changes.deleteRange(sourceFile, { pos, end }); } - var fixId34, errorCodes43; + var fixId33, errorCodes42; var init_fixUnusedLabel = __esm({ "src/services/codefixes/fixUnusedLabel.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId34 = "fixUnusedLabel"; - errorCodes43 = [Diagnostics.Unused_label.code]; + fixId33 = "fixUnusedLabel"; + errorCodes42 = [Diagnostics.Unused_label.code]; registerCodeFix({ - errorCodes: errorCodes43, + errorCodes: errorCodes42, getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, context.sourceFile, context.span.start)); - return [createCodeFixAction(fixId34, changes, Diagnostics.Remove_unused_label, fixId34, Diagnostics.Remove_all_unused_labels)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start)); + return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unused_label, fixId33, Diagnostics.Remove_all_unused_labels)]; }, - fixIds: [fixId34], - getAllCodeActions: (context) => codeFixAll(context, errorCodes43, (changes, diag2) => doChange19(changes, diag2.file, diag2.start)) + fixIds: [fixId33], + getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start)) }); } }); // src/services/codefixes/fixJSDocTypes.ts - function doChange20(changes, sourceFile, oldTypeNode, newType, checker) { + function doChange19(changes, sourceFile, oldTypeNode, newType, checker) { changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( newType, /*enclosingDeclaration*/ @@ -139593,7 +143163,7 @@ ${lanes.join("\n")} } return checker.getTypeFromTypeNode(node); } - var fixIdPlain, fixIdNullable, errorCodes44; + var fixIdPlain, fixIdNullable, errorCodes43; var init_fixJSDocTypes = __esm({ "src/services/codefixes/fixJSDocTypes.ts"() { "use strict"; @@ -139601,13 +143171,13 @@ ${lanes.join("\n")} init_ts_codefix(); fixIdPlain = "fixJSDocTypes_plain"; fixIdNullable = "fixJSDocTypes_nullable"; - errorCodes44 = [ + errorCodes43 = [ Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code, Diagnostics._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code, Diagnostics._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code ]; registerCodeFix({ - errorCodes: errorCodes44, + errorCodes: errorCodes43, getCodeActions(context) { const { sourceFile } = context; const checker = context.program.getTypeChecker(); @@ -139621,22 +143191,22 @@ ${lanes.join("\n")} actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); } return actions2; - function fix(type2, fixId52, fixAllDescription) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, sourceFile, typeNode, type2, checker)); - return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId52, fixAllDescription); + function fix(type2, fixId51, fixAllDescription) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, sourceFile, typeNode, type2, checker)); + return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId51, fixAllDescription); } }, fixIds: [fixIdPlain, fixIdNullable], getAllCodeActions(context) { - const { fixId: fixId52, program, sourceFile } = context; + const { fixId: fixId51, program, sourceFile } = context; const checker = program.getTypeChecker(); - return codeFixAll(context, errorCodes44, (changes, err) => { + return codeFixAll(context, errorCodes43, (changes, err) => { const info = getInfo11(err.file, err.start, checker); if (!info) return; const { typeNode, type } = info; - const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; - doChange20(changes, sourceFile, typeNode, fixedType, checker); + const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId51 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + doChange19(changes, sourceFile, typeNode, fixedType, checker); }); } }); @@ -139644,7 +143214,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixMissingCallParentheses.ts - function doChange21(changes, sourceFile, name) { + function doChange20(changes, sourceFile, name) { changes.replaceNodeWithText(sourceFile, name, `${name.text}()`); } function getCallName(sourceFile, start) { @@ -139661,31 +143231,31 @@ ${lanes.join("\n")} } return void 0; } - var fixId35, errorCodes45; + var fixId34, errorCodes44; var init_fixMissingCallParentheses = __esm({ "src/services/codefixes/fixMissingCallParentheses.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId35 = "fixMissingCallParentheses"; - errorCodes45 = [ + fixId34 = "fixMissingCallParentheses"; + errorCodes44 = [ Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code ]; registerCodeFix({ - errorCodes: errorCodes45, - fixIds: [fixId35], + errorCodes: errorCodes44, + fixIds: [fixId34], getCodeActions(context) { const { sourceFile, span } = context; const callName = getCallName(sourceFile, span.start); if (!callName) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, context.sourceFile, callName)); - return [createCodeFixAction(fixId35, changes, Diagnostics.Add_missing_call_parentheses, fixId35, Diagnostics.Add_all_missing_call_parentheses)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, context.sourceFile, callName)); + return [createCodeFixAction(fixId34, changes, Diagnostics.Add_missing_call_parentheses, fixId34, Diagnostics.Add_all_missing_call_parentheses)]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes45, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => { const callName = getCallName(diag2.file, diag2.start); if (callName) - doChange21(changes, diag2.file, callName); + doChange20(changes, diag2.file, callName); }) }); } @@ -139727,7 +143297,7 @@ ${lanes.join("\n")} returnType: getReturnType(containingFunction) }; } - function doChange22(changes, sourceFile, { insertBefore, returnType }) { + function doChange21(changes, sourceFile, { insertBefore, returnType }) { if (returnType) { const entityName = getEntityNameFromTypeNode(returnType); if (!entityName || entityName.kind !== 79 /* Identifier */ || entityName.text !== "Promise") { @@ -139736,36 +143306,36 @@ ${lanes.join("\n")} } changes.insertModifierBefore(sourceFile, 132 /* AsyncKeyword */, insertBefore); } - var fixId36, errorCodes46; + var fixId35, errorCodes45; var init_fixAwaitInSyncFunction = __esm({ "src/services/codefixes/fixAwaitInSyncFunction.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId36 = "fixAwaitInSyncFunction"; - errorCodes46 = [ + fixId35 = "fixAwaitInSyncFunction"; + errorCodes45 = [ Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code ]; registerCodeFix({ - errorCodes: errorCodes46, + errorCodes: errorCodes45, getCodeActions(context) { const { sourceFile, span } = context; const nodes = getNodes3(sourceFile, span.start); if (!nodes) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange22(t, sourceFile, nodes)); - return [createCodeFixAction(fixId36, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId36, Diagnostics.Add_all_missing_async_modifiers)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, sourceFile, nodes)); + return [createCodeFixAction(fixId35, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId35, Diagnostics.Add_all_missing_async_modifiers)]; }, - fixIds: [fixId36], + fixIds: [fixId35], getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) { const seen = /* @__PURE__ */ new Map(); - return codeFixAll(context, errorCodes46, (changes, diag2) => { + return codeFixAll(context, errorCodes45, (changes, diag2) => { const nodes = getNodes3(diag2.file, diag2.start); if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return; - doChange22(changes, context.sourceFile, nodes); + doChange21(changes, context.sourceFile, nodes); }); } }); @@ -139773,7 +143343,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixPropertyOverrideAccessor.ts - function doChange23(file, start, length2, code, context) { + function doChange22(file, start, length2, code, context) { let startPosition; let endPosition; if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) { @@ -139800,28 +143370,28 @@ ${lanes.join("\n")} } return generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, Diagnostics.Generate_get_and_set_accessors.message); } - var errorCodes47, fixId37; + var errorCodes46, fixId36; var init_fixPropertyOverrideAccessor = __esm({ "src/services/codefixes/fixPropertyOverrideAccessor.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - errorCodes47 = [ + errorCodes46 = [ Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code, Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code ]; - fixId37 = "fixPropertyOverrideAccessor"; + fixId36 = "fixPropertyOverrideAccessor"; registerCodeFix({ - errorCodes: errorCodes47, + errorCodes: errorCodes46, getCodeActions(context) { - const edits = doChange23(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); + const edits = doChange22(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); if (edits) { - return [createCodeFixAction(fixId37, edits, Diagnostics.Generate_get_and_set_accessors, fixId37, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; + return [createCodeFixAction(fixId36, edits, Diagnostics.Generate_get_and_set_accessors, fixId36, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; } }, - fixIds: [fixId37], - getAllCodeActions: (context) => codeFixAll(context, errorCodes47, (changes, diag2) => { - const edits = doChange23(diag2.file, diag2.start, diag2.length, diag2.code, context); + fixIds: [fixId36], + getAllCodeActions: (context) => codeFixAll(context, errorCodes46, (changes, diag2) => { + const edits = doChange22(diag2.file, diag2.start, diag2.length, diag2.code, context); if (edits) { for (const edit of edits) { changes.pushRaw(context.sourceFile, edit); @@ -139868,7 +143438,7 @@ ${lanes.join("\n")} } return errorCode; } - function doChange24(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { + function doChange23(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { if (!isParameterPropertyModifier(token.kind) && token.kind !== 79 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 108 /* ThisKeyword */) { return void 0; } @@ -140762,14 +144332,14 @@ ${lanes.join("\n")} } } } - var fixId38, errorCodes48; + var fixId37, errorCodes47; var init_inferFromUsage = __esm({ "src/services/codefixes/inferFromUsage.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId38 = "inferFromUsage"; - errorCodes48 = [ + fixId37 = "inferFromUsage"; + errorCodes47 = [ // Variable declarations Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, // Variable uses @@ -140803,13 +144373,13 @@ ${lanes.join("\n")} Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code ]; registerCodeFix({ - errorCodes: errorCodes48, + errorCodes: errorCodes47, getCodeActions(context) { const { sourceFile, program, span: { start }, errorCode, cancellationToken, host, preferences } = context; const token = getTokenAtPosition(sourceFile, start); let declaration; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - declaration = doChange24( + declaration = doChange23( changes2, sourceFile, token, @@ -140823,14 +144393,14 @@ ${lanes.join("\n")} ); }); const name = declaration && getNameOfDeclaration(declaration); - return !name || changes.length === 0 ? void 0 : [createCodeFixAction(fixId38, changes, [getDiagnostic(errorCode, token), getTextOfNode(name)], fixId38, Diagnostics.Infer_all_types_from_usage)]; + return !name || changes.length === 0 ? void 0 : [createCodeFixAction(fixId37, changes, [getDiagnostic(errorCode, token), getTextOfNode(name)], fixId37, Diagnostics.Infer_all_types_from_usage)]; }, - fixIds: [fixId38], + fixIds: [fixId37], getAllCodeActions(context) { const { sourceFile, program, cancellationToken, host, preferences } = context; const markSeen = nodeSeenTracker(); - return codeFixAll(context, errorCodes48, (changes, err) => { - doChange24(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); + return codeFixAll(context, errorCodes47, (changes, err) => { + doChange23(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); }); } }); @@ -140861,22 +144431,22 @@ ${lanes.join("\n")} return { returnTypeNode, returnType, promisedTypeNode, promisedType }; } } - function doChange25(changes, sourceFile, returnTypeNode, promisedTypeNode) { + function doChange24(changes, sourceFile, returnTypeNode, promisedTypeNode) { changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode])); } - var fixId39, errorCodes49; + var fixId38, errorCodes48; var init_fixReturnTypeInAsyncFunction = __esm({ "src/services/codefixes/fixReturnTypeInAsyncFunction.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId39 = "fixReturnTypeInAsyncFunction"; - errorCodes49 = [ + fixId38 = "fixReturnTypeInAsyncFunction"; + errorCodes48 = [ Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code ]; registerCodeFix({ - errorCodes: errorCodes49, - fixIds: [fixId39], + errorCodes: errorCodes48, + fixIds: [fixId38], getCodeActions: function getCodeActionsToFixReturnTypeInAsyncFunction(context) { const { sourceFile, program, span } = context; const checker = program.getTypeChecker(); @@ -140885,23 +144455,23 @@ ${lanes.join("\n")} return void 0; } const { returnTypeNode, returnType, promisedTypeNode, promisedType } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, sourceFile, returnTypeNode, promisedTypeNode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, sourceFile, returnTypeNode, promisedTypeNode)); return [createCodeFixAction( - fixId39, + fixId38, changes, [ Diagnostics.Replace_0_with_Promise_1, checker.typeToString(returnType), checker.typeToString(promisedType) ], - fixId39, + fixId38, Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions )]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes49, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes48, (changes, diag2) => { const info = getInfo12(diag2.file, context.program.getTypeChecker(), diag2.start); if (info) { - doChange25(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); + doChange24(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); } }) }); @@ -140915,20 +144485,20 @@ ${lanes.join("\n")} changes.insertCommentBeforeLine(sourceFile, lineNumber, position, " @ts-ignore"); } } - var fixName4, fixId40, errorCodes50; + var fixName4, fixId39, errorCodes49; var init_disableJsDiagnostics = __esm({ "src/services/codefixes/disableJsDiagnostics.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixName4 = "disableJsDiagnostics"; - fixId40 = "disableJsDiagnostics"; - errorCodes50 = mapDefined(Object.keys(Diagnostics), (key) => { + fixId39 = "disableJsDiagnostics"; + errorCodes49 = mapDefined(Object.keys(Diagnostics), (key) => { const diag2 = Diagnostics[key]; return diag2.category === 1 /* Error */ ? diag2.code : void 0; }); registerCodeFix({ - errorCodes: errorCodes50, + errorCodes: errorCodes49, getCodeActions: function getCodeActionsToDisableJsDiagnostics(context) { const { sourceFile, program, span, host, formatContext } = context; if (!isInJSFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { @@ -140946,14 +144516,14 @@ ${lanes.join("\n")} ) ]; if (ts_textChanges_exports.isValidLocationToAddComment(sourceFile, span.start)) { - fixes.unshift(createCodeFixAction(fixName4, ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange8(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId40, Diagnostics.Add_ts_ignore_to_all_error_messages)); + fixes.unshift(createCodeFixAction(fixName4, ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange8(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId39, Diagnostics.Add_ts_ignore_to_all_error_messages)); } return fixes; }, - fixIds: [fixId40], + fixIds: [fixId39], getAllCodeActions: (context) => { const seenLines = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes50, (changes, diag2) => { + return codeFixAll(context, errorCodes49, (changes, diag2) => { if (ts_textChanges_exports.isValidLocationToAddComment(diag2.file, diag2.start)) { makeChange8(changes, diag2.file, diag2.start, seenLines); } @@ -141563,18 +145133,17 @@ ${lanes.join("\n")} } function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) { let symbols; - const typeNode = visitNode(importTypeNode, visit); + const typeNode = visitNode(importTypeNode, visit, isTypeNode); if (symbols && typeNode) { return { typeNode, symbols }; } function visit(node) { - var _a2; if (isLiteralImportTypeNode(node) && node.qualifier) { const firstIdentifier = getFirstIdentifier(node.qualifier); const name = getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget); const qualifier = name !== firstIdentifier.text ? replaceFirstIdentifierOfEntityName(node.qualifier, factory.createIdentifier(name)) : node.qualifier; symbols = append(symbols, firstIdentifier.symbol); - const typeArguments = (_a2 = node.typeArguments) == null ? void 0 : _a2.map(visit); + const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode); return factory.createTypeReferenceNode(qualifier, typeArguments); } return visitEachChild(node, visit, nullTransformationContext); @@ -141725,9 +145294,7 @@ ${lanes.join("\n")} return factory.createGetAccessorDeclaration( modifiers, accessorName, - /*parameters*/ - void 0, - // TODO: GH#18217 + [], type, factory.createBlock( [ @@ -142052,7 +145619,7 @@ ${lanes.join("\n")} } return void 0; } - var fixName6, fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer, errorCodes51; + var fixName6, fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer, errorCodes50; var init_fixStrictClassInitialization = __esm({ "src/services/codefixes/fixStrictClassInitialization.ts"() { "use strict"; @@ -142062,9 +145629,9 @@ ${lanes.join("\n")} fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; fixIdAddInitializer = "addMissingPropertyInitializer"; - errorCodes51 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; + errorCodes50 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; registerCodeFix({ - errorCodes: errorCodes51, + errorCodes: errorCodes50, getCodeActions: function getCodeActionsForStrictClassInitializationErrors(context) { const info = getInfo13(context.sourceFile, context.span.start); if (!info) @@ -142077,7 +145644,7 @@ ${lanes.join("\n")} }, fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes51, (changes, diag2) => { + return codeFixAll(context, errorCodes50, (changes, diag2) => { const info = getInfo13(diag2.file, diag2.start); if (!info) return; @@ -142105,7 +145672,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/requireInTs.ts - function doChange26(changes, sourceFile, info) { + function doChange25(changes, sourceFile, info) { const { allowSyntheticDefaults, defaultImportName, namedImports, statement, required } = info; changes.replaceNode(sourceFile, statement, defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( /*modifiers*/ @@ -142167,29 +145734,29 @@ ${lanes.join("\n")} return factory.createNamedImports(importSpecifiers); } } - var fixId41, errorCodes52; + var fixId40, errorCodes51; var init_requireInTs = __esm({ "src/services/codefixes/requireInTs.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId41 = "requireInTs"; - errorCodes52 = [Diagnostics.require_call_may_be_converted_to_an_import.code]; + fixId40 = "requireInTs"; + errorCodes51 = [Diagnostics.require_call_may_be_converted_to_an_import.code]; registerCodeFix({ - errorCodes: errorCodes52, + errorCodes: errorCodes51, getCodeActions(context) { const info = getInfo14(context.sourceFile, context.program, context.span.start); if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, context.sourceFile, info)); - return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_require_to_import, fixId41, Diagnostics.Convert_all_require_to_import)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, context.sourceFile, info)); + return [createCodeFixAction(fixId40, changes, Diagnostics.Convert_require_to_import, fixId40, Diagnostics.Convert_all_require_to_import)]; }, - fixIds: [fixId41], - getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { + fixIds: [fixId40], + getAllCodeActions: (context) => codeFixAll(context, errorCodes51, (changes, diag2) => { const info = getInfo14(diag2.file, context.program, diag2.start); if (info) { - doChange26(changes, context.sourceFile, info); + doChange25(changes, context.sourceFile, info); } }) }); @@ -142209,7 +145776,7 @@ ${lanes.join("\n")} return { importNode, name, moduleSpecifier: importNode.moduleSpecifier }; } } - function doChange27(changes, sourceFile, info, preferences) { + function doChange26(changes, sourceFile, info, preferences) { changes.replaceNode(sourceFile, info.importNode, makeImport( info.name, /*namedImports*/ @@ -142218,29 +145785,29 @@ ${lanes.join("\n")} getQuotePreference(sourceFile, preferences) )); } - var fixId42, errorCodes53; + var fixId41, errorCodes52; var init_useDefaultImport = __esm({ "src/services/codefixes/useDefaultImport.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId42 = "useDefaultImport"; - errorCodes53 = [Diagnostics.Import_may_be_converted_to_a_default_import.code]; + fixId41 = "useDefaultImport"; + errorCodes52 = [Diagnostics.Import_may_be_converted_to_a_default_import.code]; registerCodeFix({ - errorCodes: errorCodes53, + errorCodes: errorCodes52, getCodeActions(context) { const { sourceFile, span: { start } } = context; const info = getInfo15(sourceFile, start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, info, context.preferences)); - return [createCodeFixAction(fixId42, changes, Diagnostics.Convert_to_default_import, fixId42, Diagnostics.Convert_all_to_default_imports)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, sourceFile, info, context.preferences)); + return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_to_default_import, fixId41, Diagnostics.Convert_all_to_default_imports)]; }, - fixIds: [fixId42], - getAllCodeActions: (context) => codeFixAll(context, errorCodes53, (changes, diag2) => { + fixIds: [fixId41], + getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { const info = getInfo15(diag2.file, diag2.start); if (info) - doChange27(changes, diag2.file, info, context.preferences); + doChange26(changes, diag2.file, info, context.preferences); }) }); } @@ -142255,27 +145822,27 @@ ${lanes.join("\n")} const newText = numericLiteral.getText(sourceFile) + "n"; changeTracker.replaceNode(sourceFile, numericLiteral, factory.createBigIntLiteral(newText)); } - var fixId43, errorCodes54; + var fixId42, errorCodes53; var init_useBigintLiteral = __esm({ "src/services/codefixes/useBigintLiteral.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId43 = "useBigintLiteral"; - errorCodes54 = [ + fixId42 = "useBigintLiteral"; + errorCodes53 = [ Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code ]; registerCodeFix({ - errorCodes: errorCodes54, + errorCodes: errorCodes53, getCodeActions: function getCodeActionsToUseBigintLiteral(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange9(t, context.sourceFile, context.span)); if (changes.length > 0) { - return [createCodeFixAction(fixId43, changes, Diagnostics.Convert_to_a_bigint_numeric_literal, fixId43, Diagnostics.Convert_all_to_bigint_numeric_literals)]; + return [createCodeFixAction(fixId42, changes, Diagnostics.Convert_to_a_bigint_numeric_literal, fixId42, Diagnostics.Convert_all_to_bigint_numeric_literals)]; } }, - fixIds: [fixId43], + fixIds: [fixId42], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes54, (changes, diag2) => makeChange9(changes, diag2.file, diag2)); + return codeFixAll(context, errorCodes53, (changes, diag2) => makeChange9(changes, diag2.file, diag2)); } }); } @@ -142288,7 +145855,7 @@ ${lanes.join("\n")} Debug.assert(token.parent.kind === 202 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } - function doChange28(changes, sourceFile, importType) { + function doChange27(changes, sourceFile, importType) { const newTypeNode = factory.updateImportTypeNode( importType, importType.argument, @@ -142300,25 +145867,25 @@ ${lanes.join("\n")} ); changes.replaceNode(sourceFile, importType, newTypeNode); } - var fixIdAddMissingTypeof, fixId44, errorCodes55; + var fixIdAddMissingTypeof, fixId43, errorCodes54; var init_fixAddModuleReferTypeMissingTypeof = __esm({ "src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixIdAddMissingTypeof = "fixAddModuleReferTypeMissingTypeof"; - fixId44 = fixIdAddMissingTypeof; - errorCodes55 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code]; + fixId43 = fixIdAddMissingTypeof; + errorCodes54 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code]; registerCodeFix({ - errorCodes: errorCodes55, + errorCodes: errorCodes54, getCodeActions: function getCodeActionsToAddMissingTypeof(context) { const { sourceFile, span } = context; const importType = getImportTypeNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, importType)); - return [createCodeFixAction(fixId44, changes, Diagnostics.Add_missing_typeof, fixId44, Diagnostics.Add_missing_typeof)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, importType)); + return [createCodeFixAction(fixId43, changes, Diagnostics.Add_missing_typeof, fixId43, Diagnostics.Add_missing_typeof)]; }, - fixIds: [fixId44], - getAllCodeActions: (context) => codeFixAll(context, errorCodes55, (changes, diag2) => doChange28(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) + fixIds: [fixId43], + getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange27(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) }); } }); @@ -142337,7 +145904,7 @@ ${lanes.join("\n")} return void 0; return binaryExpr; } - function doChange29(changeTracker, sf, node) { + function doChange28(changeTracker, sf, node) { const jsx = flattenInvalidBinaryExpr(node); if (jsx) changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment())); @@ -142360,30 +145927,30 @@ ${lanes.join("\n")} return void 0; } } - var fixID2, errorCodes56; + var fixID2, errorCodes55; var init_wrapJsxInFragment = __esm({ "src/services/codefixes/wrapJsxInFragment.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixID2 = "wrapJsxInFragment"; - errorCodes56 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code]; + errorCodes55 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code]; registerCodeFix({ - errorCodes: errorCodes56, + errorCodes: errorCodes55, getCodeActions: function getCodeActionsToWrapJsxInFragment(context) { const { sourceFile, span } = context; const node = findNodeToFix(sourceFile, span.start); if (!node) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, node)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, node)); return [createCodeFixAction(fixID2, changes, Diagnostics.Wrap_in_JSX_fragment, fixID2, Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]; }, fixIds: [fixID2], - getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes55, (changes, diag2) => { const node = findNodeToFix(context.sourceFile, diag2.start); if (!node) return void 0; - doChange29(changes, context.sourceFile, node); + doChange28(changes, context.sourceFile, node); }) }); } @@ -142403,7 +145970,7 @@ ${lanes.join("\n")} function createTypeAliasFromInterface(declaration, type) { return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type); } - function doChange30(changes, sourceFile, { indexSignature, container }) { + function doChange29(changes, sourceFile, { indexSignature, container }) { const members = isInterfaceDeclaration(container) ? container.members : container.type.members; const otherMembers = members.filter((member) => !isIndexSignatureDeclaration(member)); const parameter = first(indexSignature.parameters); @@ -142430,48 +145997,48 @@ ${lanes.join("\n")} ]); changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType)); } - var fixId45, errorCodes57; + var fixId44, errorCodes56; var init_convertToMappedObjectType = __esm({ "src/services/codefixes/convertToMappedObjectType.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId45 = "fixConvertToMappedObjectType"; - errorCodes57 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; + fixId44 = "fixConvertToMappedObjectType"; + errorCodes56 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; registerCodeFix({ - errorCodes: errorCodes57, + errorCodes: errorCodes56, getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) { const { sourceFile, span } = context; const info = getInfo16(sourceFile, span.start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, info)); const name = idText(info.container.name); - return [createCodeFixAction(fixId45, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId45, [Diagnostics.Convert_0_to_mapped_object_type, name])]; + return [createCodeFixAction(fixId44, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId44, [Diagnostics.Convert_0_to_mapped_object_type, name])]; }, - fixIds: [fixId45], - getAllCodeActions: (context) => codeFixAll(context, errorCodes57, (changes, diag2) => { + fixIds: [fixId44], + getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { const info = getInfo16(diag2.file, diag2.start); if (info) - doChange30(changes, diag2.file, info); + doChange29(changes, diag2.file, info); }) }); } }); // src/services/codefixes/removeAccidentalCallParentheses.ts - var fixId46, errorCodes58; + var fixId45, errorCodes57; var init_removeAccidentalCallParentheses = __esm({ "src/services/codefixes/removeAccidentalCallParentheses.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId46 = "removeAccidentalCallParentheses"; - errorCodes58 = [ + fixId45 = "removeAccidentalCallParentheses"; + errorCodes57 = [ Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code ]; registerCodeFix({ - errorCodes: errorCodes58, + errorCodes: errorCodes57, getCodeActions(context) { const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression); if (!callExpression) { @@ -142480,9 +146047,9 @@ ${lanes.join("\n")} const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { t.deleteRange(context.sourceFile, { pos: callExpression.expression.end, end: callExpression.end }); }); - return [createCodeFixActionWithoutFixAll(fixId46, changes, Diagnostics.Remove_parentheses)]; + return [createCodeFixActionWithoutFixAll(fixId45, changes, Diagnostics.Remove_parentheses)]; }, - fixIds: [fixId46] + fixIds: [fixId45] }); } }); @@ -142511,27 +146078,27 @@ ${lanes.join("\n")} } changeTracker.replaceNode(sourceFile, expressionToReplace, awaitExpression.expression); } - var fixId47, errorCodes59; + var fixId46, errorCodes58; var init_removeUnnecessaryAwait = __esm({ "src/services/codefixes/removeUnnecessaryAwait.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId47 = "removeUnnecessaryAwait"; - errorCodes59 = [ + fixId46 = "removeUnnecessaryAwait"; + errorCodes58 = [ Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code ]; registerCodeFix({ - errorCodes: errorCodes59, + errorCodes: errorCodes58, getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span)); if (changes.length > 0) { - return [createCodeFixAction(fixId47, changes, Diagnostics.Remove_unnecessary_await, fixId47, Diagnostics.Remove_all_unnecessary_uses_of_await)]; + return [createCodeFixAction(fixId46, changes, Diagnostics.Remove_unnecessary_await, fixId46, Diagnostics.Remove_all_unnecessary_uses_of_await)]; } }, - fixIds: [fixId47], + fixIds: [fixId46], getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes59, (changes, diag2) => makeChange10(changes, diag2.file, diag2)); + return codeFixAll(context, errorCodes58, (changes, diag2) => makeChange10(changes, diag2.file, diag2)); } }); } @@ -142573,26 +146140,26 @@ ${lanes.join("\n")} importDeclaration.assertClause )); } - var errorCodes60, fixId48; + var errorCodes59, fixId47; var init_splitTypeOnlyImport = __esm({ "src/services/codefixes/splitTypeOnlyImport.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - errorCodes60 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; - fixId48 = "splitTypeOnlyImport"; + errorCodes59 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; + fixId47 = "splitTypeOnlyImport"; registerCodeFix({ - errorCodes: errorCodes60, - fixIds: [fixId48], + errorCodes: errorCodes59, + fixIds: [fixId47], getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { return splitTypeOnlyImport(t, getImportDeclaration2(context.sourceFile, context.span), context); }); if (changes.length) { - return [createCodeFixAction(fixId48, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId48, Diagnostics.Split_all_invalid_type_only_imports)]; + return [createCodeFixAction(fixId47, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId47, Diagnostics.Split_all_invalid_type_only_imports)]; } }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes60, (changes, error) => { + getAllCodeActions: (context) => codeFixAll(context, errorCodes59, (changes, error) => { splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error), context); }) }); @@ -142614,43 +146181,43 @@ ${lanes.join("\n")} return; return { symbol, token: constToken }; } - function doChange31(changes, sourceFile, token) { + function doChange30(changes, sourceFile, token) { changes.replaceNode(sourceFile, token, factory.createToken(119 /* LetKeyword */)); } - var fixId49, errorCodes61; + var fixId48, errorCodes60; var init_convertConstToLet = __esm({ "src/services/codefixes/convertConstToLet.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId49 = "fixConvertConstToLet"; - errorCodes61 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; + fixId48 = "fixConvertConstToLet"; + errorCodes60 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; registerCodeFix({ - errorCodes: errorCodes61, + errorCodes: errorCodes60, getCodeActions: function getCodeActionsToConvertConstToLet(context) { const { sourceFile, span, program } = context; const info = getInfo17(sourceFile, span.start, program); if (info === void 0) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info.token)); - return [createCodeFixActionMaybeFixAll(fixId49, changes, Diagnostics.Convert_const_to_let, fixId49, Diagnostics.Convert_all_const_to_let)]; + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info.token)); + return [createCodeFixActionMaybeFixAll(fixId48, changes, Diagnostics.Convert_const_to_let, fixId48, Diagnostics.Convert_all_const_to_let)]; }, getAllCodeActions: (context) => { const { program } = context; const seen = /* @__PURE__ */ new Map(); return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes61, (diag2) => { + eachDiagnostic(context, errorCodes60, (diag2) => { const info = getInfo17(diag2.file, diag2.start, program); if (info) { if (addToSeen(seen, getSymbolId(info.symbol))) { - return doChange31(changes, diag2.file, info.token); + return doChange30(changes, diag2.file, info.token); } } return void 0; }); })); }, - fixIds: [fixId49] + fixIds: [fixId48] }); } }); @@ -142660,40 +146227,40 @@ ${lanes.join("\n")} const node = getTokenAtPosition(sourceFile, pos); return node.kind === 26 /* SemicolonToken */ && node.parent && (isObjectLiteralExpression(node.parent) || isArrayLiteralExpression(node.parent)) ? { node } : void 0; } - function doChange32(changes, sourceFile, { node }) { + function doChange31(changes, sourceFile, { node }) { const newNode = factory.createToken(27 /* CommaToken */); changes.replaceNode(sourceFile, node, newNode); } - var fixId50, expectedErrorCode, errorCodes62; + var fixId49, expectedErrorCode, errorCodes61; var init_fixExpectedComma = __esm({ "src/services/codefixes/fixExpectedComma.ts"() { "use strict"; init_ts4(); init_ts_codefix(); - fixId50 = "fixExpectedComma"; + fixId49 = "fixExpectedComma"; expectedErrorCode = Diagnostics._0_expected.code; - errorCodes62 = [expectedErrorCode]; + errorCodes61 = [expectedErrorCode]; registerCodeFix({ - errorCodes: errorCodes62, + errorCodes: errorCodes61, getCodeActions(context) { const { sourceFile } = context; const info = getInfo18(sourceFile, context.span.start, context.errorCode); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info)); return [createCodeFixAction( - fixId50, + fixId49, changes, [Diagnostics.Change_0_to_1, ";", ","], - fixId50, + fixId49, [Diagnostics.Change_0_to_1, ";", ","] )]; }, - fixIds: [fixId50], - getAllCodeActions: (context) => codeFixAll(context, errorCodes62, (changes, diag2) => { + fixIds: [fixId49], + getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, diag2) => { const info = getInfo18(diag2.file, diag2.start, diag2.code); if (info) - doChange32(changes, context.sourceFile, info); + doChange31(changes, context.sourceFile, info); }) }); } @@ -142749,29 +146316,29 @@ ${lanes.join("\n")} return node.typeArguments; } } - var fixName7, fixId51, errorCodes63; + var fixName7, fixId50, errorCodes62; var init_fixAddVoidToPromise = __esm({ "src/services/codefixes/fixAddVoidToPromise.ts"() { "use strict"; init_ts4(); init_ts_codefix(); fixName7 = "addVoidToPromise"; - fixId51 = "addVoidToPromise"; - errorCodes63 = [ + fixId50 = "addVoidToPromise"; + errorCodes62 = [ Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code, Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code ]; registerCodeFix({ - errorCodes: errorCodes63, - fixIds: [fixId51], + errorCodes: errorCodes62, + fixIds: [fixId50], getCodeActions(context) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span, context.program)); if (changes.length > 0) { - return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId51, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; + return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId50, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; } }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes63, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set())); + return codeFixAll(context, errorCodes62, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set())); } }); } @@ -142857,7 +146424,6 @@ ${lanes.join("\n")} init_fixClassDoesntImplementInheritedAbstractMember(); init_fixClassSuperMustPrecedeThisAccess(); init_fixConstructorForDerivedNeedSuperCall(); - init_fixEnableExperimentalDecorators(); init_fixEnableJsxFlag(); init_fixNaNEquality(); init_fixModuleAndTargetOptions(); @@ -142950,9 +146516,9 @@ ${lanes.join("\n")} (_b = host.log) == null ? void 0 : _b.call(host, `${logPrefix}: response is ${skippedAny ? "incomplete" : "complete"}`); (_c = host.log) == null ? void 0 : _c.call(host, `${logPrefix}: ${timestamp() - start}`); return result; - function tryResolve(exportInfo, symbolName2, isFromAmbientModule) { + function tryResolve(exportInfo, isFromAmbientModule) { if (isFromAmbientModule) { - const result3 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite); + const result3 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite); if (result3) { ambientCount++; } @@ -142960,7 +146526,7 @@ ${lanes.join("\n")} } const shouldResolveModuleSpecifier = needsFullResolution || preferences.allowIncompleteCompletions && resolvedCount < moduleSpecifierResolutionLimit; const shouldGetModuleSpecifierFromCache = !shouldResolveModuleSpecifier && preferences.allowIncompleteCompletions && cacheAttemptCount < moduleSpecifierResolutionCacheAttemptLimit; - const result2 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, symbolName2, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; + const result2 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; if (!shouldResolveModuleSpecifier && !shouldGetModuleSpecifierFromCache || shouldGetModuleSpecifierFromCache && !result2) { skippedAny = true; } @@ -142987,7 +146553,7 @@ ${lanes.join("\n")} const compilerOptions = program.getCompilerOptions(); const incompleteCompletionsCache = preferences.allowIncompleteCompletions ? (_a2 = host.getIncompleteCompletionsCache) == null ? void 0 : _a2.call(host) : void 0; if (incompleteCompletionsCache && completionKind === 3 /* TriggerForIncompleteCompletions */ && previousToken && isIdentifier(previousToken)) { - const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken); + const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken, position); if (incompleteContinuation) { return incompleteContinuation; } @@ -143056,10 +146622,11 @@ ${lanes.join("\n")} function completionEntryDataIsResolved(data) { return !!(data == null ? void 0 : data.moduleSpecifier); } - function continuePreviousIncompleteResponse(cache, file, location, program, host, preferences, cancellationToken) { + function continuePreviousIncompleteResponse(cache, file, location, program, host, preferences, cancellationToken, position) { const previousResponse = cache.get(); if (!previousResponse) return void 0; + const touchNode = getTouchingPropertyName(file, position); const lowerCaseTokenText = location.text.toLowerCase(); const exportMap = getExportInfoMap(file, host, program, preferences, cancellationToken); const newEntries = resolvingModuleSpecifiers( @@ -143083,7 +146650,7 @@ ${lanes.join("\n")} } const { origin } = Debug.checkDefined(getAutoImportSymbolFromCompletionEntryData(entry.name, entry.data, program, host)); const info = exportMap.get(file.path, entry.data.exportMapKey); - const result = info && context.tryResolve(info, entry.name, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); + const result = info && context.tryResolve(info, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); if (result === "skipped") return entry; if (!result || result === "failed") { @@ -143108,6 +146675,7 @@ ${lanes.join("\n")} ); previousResponse.entries = newEntries; previousResponse.flags = (previousResponse.flags || 0) | 4 /* IsContinuation */; + previousResponse.optionalReplacementSpan = getOptionalReplacementSpan(touchNode); return previousResponse; } function jsdocCompletionInfo(entries) { @@ -143202,6 +146770,7 @@ ${lanes.join("\n")} void 0, contextToken, location, + position, sourceFile, host, program, @@ -143315,10 +146884,10 @@ ${lanes.join("\n")} } else if (!tracker.hasValue(type.value)) { switch (typeof type.value) { case "object": - elements.push(factory.createBigIntLiteral(type.value)); + elements.push(type.value.negative ? factory.createPrefixUnaryExpression(40 /* MinusToken */, factory.createBigIntLiteral({ negative: false, base10Value: type.value.base10Value })) : factory.createBigIntLiteral(type.value)); break; case "number": - elements.push(factory.createNumericLiteral(type.value)); + elements.push(type.value < 0 ? factory.createPrefixUnaryExpression(40 /* MinusToken */, factory.createNumericLiteral(-type.value)) : factory.createNumericLiteral(type.value)); break; case "string": elements.push(factory.createStringLiteral(type.value, quotePreference === 0 /* Single */)); @@ -143330,7 +146899,7 @@ ${lanes.join("\n")} return void 0; } const newClauses = map(elements, (element) => factory.createCaseClause(element, [])); - const newLineChar = getNewLineCharacter(options, maybeBind(host, host.getNewLine)); + const newLineChar = getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options); const printer = createSnippetPrinter({ removeComments: true, module: options.module, @@ -143527,7 +147096,7 @@ ${lanes.join("\n")} function createCompletionEntryForLiteral(sourceFile, preferences, literal) { return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } - function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { + function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { let insertText; let replacementSpan = getReplacementSpanForContextToken(replacementToken); let data; @@ -143585,7 +147154,7 @@ ${lanes.join("\n")} } if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) { let importAdder; - ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext)); + ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext)); sortText = SortText.ClassMemberSnippets; if (importAdder == null ? void 0 : importAdder.hasFixes()) { hasAction = true; @@ -143649,7 +147218,7 @@ ${lanes.join("\n")} const memberFlags = 106500 /* ClassMember */ & 900095 /* EnumMemberExcludes */; return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent)); } - function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext) { + function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) { const classLikeDeclaration = findAncestor(location, isClassLike); if (!classLikeDeclaration) { return { insertText: name }; @@ -143664,7 +147233,7 @@ ${lanes.join("\n")} module: options.module, target: options.target, omitTrailingSemicolon: false, - newLine: getNewLineKind(getNewLineCharacter(options, maybeBind(host, host.getNewLine))) + newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) }); const importAdder = ts_codefix_exports.createImportAdder(sourceFile, program, preferences, host); let body; @@ -143685,7 +147254,7 @@ ${lanes.join("\n")} ); } let modifiers = 0 /* None */; - const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken); + const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken, sourceFile, position); const isAbstract = !!(presentModifiers & 256 /* Abstract */); const completionNodes = []; ts_codefix_exports.addNewNodeForMemberSymbol( @@ -143740,8 +147309,8 @@ ${lanes.join("\n")} } return { insertText, isSnippet, importAdder, replacementSpan }; } - function getPresentModifiers(contextToken) { - if (!contextToken) { + function getPresentModifiers(contextToken, sourceFile, position) { + if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) { return { modifiers: 0 /* None */ }; } let modifiers = 0 /* None */; @@ -143761,8 +147330,11 @@ ${lanes.join("\n")} if (isModifier(node)) { return node.kind; } - if (isIdentifier(node) && node.originalKeywordKind && isModifierKind(node.originalKeywordKind)) { - return node.originalKeywordKind; + if (isIdentifier(node)) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind && isModifierKind(originalKeywordKind)) { + return originalKeywordKind; + } } return void 0; } @@ -143779,7 +147351,7 @@ ${lanes.join("\n")} module: options.module, target: options.target, omitTrailingSemicolon: false, - newLine: getNewLineKind(getNewLineCharacter(options, maybeBind(host, host.getNewLine))) + newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) }); if (formatContext) { insertText = printer.printAndFormatSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, factory.createNodeArray( @@ -144104,7 +147676,7 @@ ${lanes.join("\n")} return "TypeOnlyAlias/" /* TypeOnlyAlias */; } } - function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { + function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { var _a2; const start = timestamp(); const variableDeclaration = getVariableDeclaration(location); @@ -144127,6 +147699,7 @@ ${lanes.join("\n")} replacementToken, contextToken, location, + position, sourceFile, host, program, @@ -144370,6 +147943,7 @@ ${lanes.join("\n")} name, symbol, location, + position, contextToken, formatContext ); @@ -144410,7 +147984,7 @@ ${lanes.join("\n")} targetSymbol, moduleSymbol, sourceFile, - getNameForExportedSymbol(symbol, getEmitScriptTarget(compilerOptions), isJsxOpeningTagName), + name, isJsxOpeningTagName, host, program, @@ -144733,6 +148307,7 @@ ${lanes.join("\n")} case 347 /* JSDocTypeTag */: case 349 /* JSDocTypedefTag */: case 352 /* JSDocThrowsTag */: + case 353 /* JSDocSatisfiesTag */: return true; case 348 /* JSDocTemplateTag */: return !!tag.constraint; @@ -144875,7 +148450,7 @@ ${lanes.join("\n")} moduleSymbol, symbol: firstAccessibleSymbol, targetFlags: skipAlias(firstAccessibleSymbol, typeChecker).flags - }], firstAccessibleSymbol.name, position, isValidTypeOnlyAliasUseSite(location)) || {}; + }], position, isValidTypeOnlyAliasUseSite(location)) || {}; if (moduleSpecifier) { const origin = { kind: getNullableSymbolOriginInfoKind(6 /* SymbolMemberExport */), @@ -144971,7 +148546,7 @@ ${lanes.join("\n")} symbolToSortTextMap[getSymbolId(symbol)] = SortText.GlobalsOrKeywords; } if (typeOnlyAliasNeedsPromotion && !(symbol.flags & 111551 /* Value */)) { - const typeOnlyAliasDeclaration = symbol.declarations && find(symbol.declarations, isTypeOnlyImportOrExportDeclaration); + const typeOnlyAliasDeclaration = symbol.declarations && find(symbol.declarations, isTypeOnlyImportDeclaration); if (typeOnlyAliasDeclaration) { const origin = { kind: 64 /* TypeOnlyAlias */, declaration: typeOnlyAliasDeclaration }; symbolToOriginInfoMap[i] = origin; @@ -145101,7 +148676,7 @@ ${lanes.join("\n")} if (!firstImportableExportInfo) { return; } - const result = context.tryResolve(info, symbolName2, isFromAmbientModule) || {}; + const result = context.tryResolve(info, isFromAmbientModule) || {}; if (result === "failed") return; let exportInfo2 = firstImportableExportInfo, moduleSpecifier; @@ -145931,7 +149506,8 @@ ${lanes.join("\n")} return kind === 132 /* AsyncKeyword */ || kind === 133 /* AwaitKeyword */ || kind === 128 /* AsKeyword */ || kind === 150 /* SatisfiesKeyword */ || kind === 154 /* TypeKeyword */ || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node) { - return isIdentifier(node) ? node.originalKeywordKind || 0 /* Unknown */ : node.kind; + var _a2; + return isIdentifier(node) ? (_a2 = identifierToKeywordKind(node)) != null ? _a2 : 0 /* Unknown */ : node.kind; } function getContextualKeywords(contextToken, position) { const entries = []; @@ -145977,8 +149553,9 @@ ${lanes.join("\n")} return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { + var _a2; switch (location.kind) { - case 353 /* SyntaxList */: + case 354 /* SyntaxList */: return tryCast(location.parent, isObjectTypeDeclaration); case 1 /* EndOfFileToken */: const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration); @@ -145987,8 +149564,8 @@ ${lanes.join("\n")} } break; case 79 /* Identifier */: { - const originalKeywordKind = location.originalKeywordKind; - if (originalKeywordKind && isKeyword(originalKeywordKind)) { + const originalKeywordKind = identifierToKeywordKind(location); + if (originalKeywordKind) { return void 0; } if (isPropertyDeclaration(location.parent) && location.parent.initializer === location) { @@ -146014,14 +149591,14 @@ ${lanes.join("\n")} case 27 /* CommaToken */: return tryCast(contextToken.parent, isObjectTypeDeclaration); default: - if (!isFromObjectTypeDeclaration(contextToken)) { - if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line && isObjectTypeDeclaration(location)) { + if (isObjectTypeDeclaration(location)) { + if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { return location; } - return void 0; + const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; + return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword((_a2 = identifierToKeywordKind(contextToken)) != null ? _a2 : 0 /* Unknown */) ? contextToken.parent.parent : void 0; } - const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; - return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword(stringToToken(contextToken.text)) ? contextToken.parent.parent : void 0; + return void 0; } } function tryGetTypeLiteralNode(node) { @@ -146396,10 +149973,10 @@ ${lanes.join("\n")} if (!contextToken || !isStringLiteralLike(contextToken)) return void 0; const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences); - return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences); + return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position); } } - function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences) { + function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) { if (completion === void 0) { return void 0; } @@ -146415,6 +149992,7 @@ ${lanes.join("\n")} contextToken, contextToken, sourceFile, + position, sourceFile, host, program, @@ -147044,7 +150622,7 @@ ${lanes.join("\n")} } function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) { const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name)); - const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment)); + const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.indexOf("*") < 0); if (fragmentDirectory !== void 0) { const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory); return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator)); @@ -149066,7 +152644,7 @@ ${lanes.join("\n")} } } if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { - const isDefaultExport = referenceLocation.originalKeywordKind === 88 /* DefaultKeyword */ || exportSpecifier.name.originalKeywordKind === 88 /* DefaultKeyword */; + const isDefaultExport = referenceLocation.escapedText === "default" || exportSpecifier.name.escapedText === "default"; const exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */; const exportSymbol = Debug.checkDefined(exportSpecifier.symbol); const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker); @@ -150579,6 +154157,7 @@ ${lanes.join("\n")} } return displayParts; case 347 /* JSDocTypeTag */: + case 353 /* JSDocSatisfiesTag */: return withNode(tag.typeExpression); case 349 /* JSDocTypedefTag */: case 341 /* JSDocCallbackTag */: @@ -150868,6 +154447,7 @@ ${lanes.join("\n")} "readonly", "requires", "returns", + "satisfies", "see", "since", "static", @@ -150915,18 +154495,21 @@ ${lanes.join("\n")} const shouldSort = mode === "SortAndCombine" /* SortAndCombine */ || mode === "All" /* All */; const shouldCombine = shouldSort; const shouldRemove = mode === "RemoveUnused" /* RemoveUnused */ || mode === "All" /* All */; - const maybeRemove = shouldRemove ? removeUnusedImports : identity; - const maybeCoalesce = shouldCombine ? coalesceImports : identity; const topLevelImportGroupDecls = groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)); - const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : shouldSort && detectSortingWorker(topLevelImportGroupDecls) === 2 /* CaseInsensitive */; + const comparer = getOrganizeImportsComparerWithDetection(preferences, shouldSort ? () => detectSortingWorker(topLevelImportGroupDecls, preferences) === 2 /* CaseInsensitive */ : void 0); const processImportsOfSameModuleSpecifier = (importGroup) => { - const processedDeclarations = maybeCoalesce(maybeRemove(importGroup, sourceFile, program), ignoreCase, sourceFile); - return shouldSort ? stableSort(processedDeclarations, (s1, s2) => compareImportsOrRequireStatements(s1, s2)) : processedDeclarations; + if (shouldRemove) + importGroup = removeUnusedImports(importGroup, sourceFile, program); + if (shouldCombine) + importGroup = coalesceImportsWorker(importGroup, comparer, sourceFile); + if (shouldSort) + importGroup = stableSort(importGroup, (s1, s2) => compareImportsOrRequireStatements(s1, s2, comparer)); + return importGroup; }; topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier)); if (mode !== "RemoveUnused" /* RemoveUnused */) { const topLevelExportDecls = sourceFile.statements.filter(isExportDeclaration); - organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExports(group2, ignoreCase)); + organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExportsWorker(group2, comparer)); } for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) { if (!ambientModule.body) @@ -150935,7 +154518,7 @@ ${lanes.join("\n")} ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier)); if (mode !== "RemoveUnused" /* RemoveUnused */) { const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration); - organizeImportsWorker(ambientModuleExportDecls, (group2) => coalesceExports(group2, ignoreCase)); + organizeImportsWorker(ambientModuleExportDecls, (group2) => coalesceExportsWorker(group2, comparer)); } } return changeTracker.getChanges(); @@ -150945,7 +154528,7 @@ ${lanes.join("\n")} } suppressLeadingTrivia(oldImportDecls[0]); const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls]; - const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiers2(group1[0].moduleSpecifier, group2[0].moduleSpecifier)) : oldImportGroups; + const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer)) : oldImportGroups; const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup); if (newImportDecls.length === 0) { changeTracker.deleteNodes( @@ -151068,12 +154651,14 @@ ${lanes.join("\n")} return specifier !== void 0 && isStringLiteralLike(specifier) ? specifier.text : void 0; } function coalesceImports(importGroup, ignoreCase, sourceFile) { - var _a2, _b, _c, _d; + const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); + return coalesceImportsWorker(importGroup, comparer, sourceFile); + } + function coalesceImportsWorker(importGroup, comparer, sourceFile) { if (importGroup.length === 0) { return importGroup; } const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroup); - const compareIdentifiers = ignoreCase ? compareIdentifiersCaseInsensitive : compareIdentifiersCaseSensitive; const coalescedImports = []; if (importWithoutClause) { coalescedImports.push(importWithoutClause); @@ -151088,7 +154673,7 @@ ${lanes.join("\n")} ); continue; } - const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => compareIdentifiers(i1.importClause.namedBindings.name, i2.importClause.namedBindings.name)); + const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text)); for (const namespaceImport of sortedNamespaceImports) { coalescedImports.push( updateImportDeclarationAndClause( @@ -151099,7 +154684,10 @@ ${lanes.join("\n")} ) ); } - if (defaultImports.length === 0 && namedImports.length === 0) { + const firstDefaultImport = firstOrUndefined(defaultImports); + const firstNamedImport = firstOrUndefined(namedImports); + const importDecl = firstDefaultImport != null ? firstDefaultImport : firstNamedImport; + if (!importDecl) { continue; } let newDefaultImport; @@ -151120,12 +154708,11 @@ ${lanes.join("\n")} } newImportSpecifiers.push(...getNewImportSpecifiers(namedImports)); const sortedImportSpecifiers = factory.createNodeArray( - sortSpecifiers(newImportSpecifiers, ignoreCase), - (_b = (_a2 = namedImports[0]) == null ? void 0 : _a2.importClause.namedBindings) == null ? void 0 : _b.elements.hasTrailingComma + sortSpecifiers(newImportSpecifiers, comparer), + firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma ); - const importDecl = defaultImports.length > 0 ? defaultImports[0] : namedImports[0]; - const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : namedImports.length === 0 ? factory.createNamedImports(sortedImportSpecifiers) : factory.updateNamedImports(namedImports[0].importClause.namedBindings, sortedImportSpecifiers); - if (sourceFile && newNamedImports && ((_c = namedImports[0]) == null ? void 0 : _c.importClause.namedBindings) && !rangeIsOnSingleLine(namedImports[0].importClause.namedBindings, sourceFile)) { + const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers); + if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) { setEmitFlags(newNamedImports, 2 /* MultiLine */); } if (isTypeOnly && newDefaultImport && newNamedImports) { @@ -151139,7 +154726,7 @@ ${lanes.join("\n")} ); coalescedImports.push( updateImportDeclarationAndClause( - (_d = namedImports[0]) != null ? _d : importDecl, + firstNamedImport != null ? firstNamedImport : importDecl, /*name*/ void 0, newNamedImports @@ -151182,6 +154769,10 @@ ${lanes.join("\n")} }; } function coalesceExports(exportGroup, ignoreCase) { + const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); + return coalesceExportsWorker(exportGroup, comparer); + } + function coalesceExportsWorker(exportGroup, comparer) { if (exportGroup.length === 0) { return exportGroup; } @@ -151196,7 +154787,7 @@ ${lanes.join("\n")} } const newExportSpecifiers = []; newExportSpecifiers.push(...flatMap(exportGroup2, (i) => i.exportClause && isNamedExports(i.exportClause) ? i.exportClause.elements : emptyArray)); - const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, ignoreCase); + const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, comparer); const exportDecl = exportGroup2[0]; coalescedExports.push( factory.updateExportDeclaration( @@ -151240,25 +154831,21 @@ ${lanes.join("\n")} importDeclaration.assertClause ); } - function sortSpecifiers(specifiers, ignoreCase) { - return stableSort(specifiers, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, ignoreCase)); - } - function compareImportOrExportSpecifiers(s1, s2, ignoreCase) { - const compareIdentifiers = ignoreCase ? compareIdentifiersCaseInsensitive : compareIdentifiersCaseSensitive; - return compareBooleans(s1.isTypeOnly, s2.isTypeOnly) || compareIdentifiers(s1.name, s2.name); + function sortSpecifiers(specifiers, comparer) { + return stableSort(specifiers, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer)); } - function compareIdentifiersCaseSensitive(s1, s2) { - return compareStringsCaseSensitive(s1.text, s2.text); - } - function compareIdentifiersCaseInsensitive(s1, s2) { - return compareStringsCaseInsensitiveEslintCompatible(s1.text, s2.text); + function compareImportOrExportSpecifiers(s1, s2, comparer) { + return compareBooleans(s1.isTypeOnly, s2.isTypeOnly) || comparer(s1.name.text, s2.name.text); } function compareModuleSpecifiers2(m1, m2, ignoreCase) { + const comparer = getOrganizeImportsOrdinalStringComparer(!!ignoreCase); + return compareModuleSpecifiersWorker(m1, m2, comparer); + } + function compareModuleSpecifiersWorker(m1, m2, comparer) { const name1 = m1 === void 0 ? void 0 : getExternalModuleName2(m1); const name2 = m2 === void 0 ? void 0 : getExternalModuleName2(m2); - const compareStrings = ignoreCase ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseSensitive; return compareBooleans(name1 === void 0, name2 === void 0) || compareBooleans(isExternalModuleNameRelative(name1), isExternalModuleNameRelative(name2)) || // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - compareStrings(name1, name2); + comparer(name1, name2); } function getModuleSpecifierExpression(declaration) { var _a2; @@ -151271,24 +154858,40 @@ ${lanes.join("\n")} return declaration.declarationList.declarations[0].initializer.arguments[0]; } } - function detectSorting(sourceFile) { + function detectSorting(sourceFile, preferences) { return detectSortingWorker( - groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)) + groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)), + preferences ); } - function detectSortingWorker(importGroups) { + function detectSortingWorker(importGroups, preferences) { + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); let sortState = 3 /* Both */; + let seenUnsortedGroup = false; for (const importGroup of importGroups) { if (importGroup.length > 1) { - sortState &= detectSortCaseSensitivity( + const moduleSpecifierSort = detectSortCaseSensitivity( importGroup, - /*useEslintOrdering*/ - true, (i) => { var _a2, _b; return (_b = (_a2 = tryCast(i.moduleSpecifier, isStringLiteral)) == null ? void 0 : _a2.text) != null ? _b : ""; - } + }, + collateCaseSensitive, + collateCaseInsensitive ); + if (moduleSpecifierSort) { + sortState &= moduleSpecifierSort; + seenUnsortedGroup = true; + } if (!sortState) { return sortState; } @@ -151301,7 +154904,11 @@ ${lanes.join("\n")} } ); if (declarationWithNamedImports) { - sortState &= detectImportSpecifierSorting(declarationWithNamedImports.importClause.namedBindings.elements); + const namedImportSort = detectImportSpecifierSorting(declarationWithNamedImports.importClause.namedBindings.elements, preferences); + if (namedImportSort) { + sortState &= namedImportSort; + seenUnsortedGroup = true; + } if (!sortState) { return sortState; } @@ -151310,26 +154917,36 @@ ${lanes.join("\n")} return sortState; } } - return sortState; + return seenUnsortedGroup ? 0 /* None */ : sortState; } - function detectImportDeclarationSorting(imports) { + function detectImportDeclarationSorting(imports, preferences) { + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); return detectSortCaseSensitivity( imports, - /*useEslintOrdering*/ - true, - (s) => getExternalModuleName2(getModuleSpecifierExpression(s)) || "" + (s) => getExternalModuleName2(getModuleSpecifierExpression(s)) || "", + collateCaseSensitive, + collateCaseInsensitive ); } - function getImportDeclarationInsertionIndex(sortedImports, newImport, ignoreCase) { - const index = binarySearch(sortedImports, newImport, identity, (a, b) => compareImportsOrRequireStatements(a, b, ignoreCase)); + function getImportDeclarationInsertionIndex(sortedImports, newImport, comparer) { + const index = binarySearch(sortedImports, newImport, identity, (a, b) => compareImportsOrRequireStatements(a, b, comparer)); return index < 0 ? ~index : index; } - function getImportSpecifierInsertionIndex(sortedImports, newImport, ignoreCase) { - const index = binarySearch(sortedImports, newImport, identity, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, ignoreCase)); + function getImportSpecifierInsertionIndex(sortedImports, newImport, comparer) { + const index = binarySearch(sortedImports, newImport, identity, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer)); return index < 0 ? ~index : index; } - function compareImportsOrRequireStatements(s1, s2, ignoreCase) { - return compareModuleSpecifiers2(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), ignoreCase) || compareImportKind(s1, s2); + function compareImportsOrRequireStatements(s1, s2, comparer) { + return compareModuleSpecifiersWorker(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), comparer) || compareImportKind(s1, s2); } function compareImportKind(s1, s2) { return compareValues(getImportKindOrder(s1), getImportKindOrder(s2)); @@ -151372,22 +154989,86 @@ ${lanes.join("\n")} var _a2; return ((_a2 = namedImport.importClause) == null ? void 0 : _a2.namedBindings) && isNamedImports(namedImport.importClause.namedBindings) ? namedImport.importClause.namedBindings.elements : void 0; } - var detectImportSpecifierSorting; + function getOrganizeImportsOrdinalStringComparer(ignoreCase) { + return ignoreCase ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseSensitive; + } + function getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) { + var _a2, _b, _c; + const resolvedLocale = getOrganizeImportsLocale(preferences); + const caseFirst = (_a2 = preferences.organizeImportsCaseFirst) != null ? _a2 : false; + const numeric = (_b = preferences.organizeImportsNumericCollation) != null ? _b : false; + const accents = (_c = preferences.organizeImportsAccentCollation) != null ? _c : true; + const sensitivity = ignoreCase ? accents ? "accent" : "base" : accents ? "variant" : "case"; + const collator = new Intl.Collator(resolvedLocale, { + usage: "sort", + caseFirst: caseFirst || "false", + sensitivity, + numeric + }); + return collator.compare; + } + function getOrganizeImportsLocale(preferences) { + let locale = preferences.organizeImportsLocale; + if (locale === "auto") + locale = getUILocale(); + if (locale === void 0) + locale = "en"; + const supportedLocales = Intl.Collator.supportedLocalesOf(locale); + const resolvedLocale = supportedLocales.length ? supportedLocales[0] : "en"; + return resolvedLocale; + } + function getOrganizeImportsComparer(preferences, ignoreCase) { + var _a2; + const collation = (_a2 = preferences.organizeImportsCollation) != null ? _a2 : "ordinal"; + return collation === "unicode" ? getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) : getOrganizeImportsOrdinalStringComparer(ignoreCase); + } + function getOrganizeImportsComparerWithDetection(preferences, detectIgnoreCase) { + var _a2; + const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : (_a2 = detectIgnoreCase == null ? void 0 : detectIgnoreCase()) != null ? _a2 : false; + return getOrganizeImportsComparer(preferences, ignoreCase); + } + var ImportSpecifierSortingCache, detectImportSpecifierSorting; var init_organizeImports = __esm({ "src/services/organizeImports.ts"() { "use strict"; init_ts4(); - detectImportSpecifierSorting = memoizeWeak((specifiers) => { + ImportSpecifierSortingCache = class { + has([specifiers, preferences]) { + if (this._lastPreferences !== preferences || !this._cache) + return false; + return this._cache.has(specifiers); + } + get([specifiers, preferences]) { + if (this._lastPreferences !== preferences || !this._cache) + return void 0; + return this._cache.get(specifiers); + } + set([specifiers, preferences], value) { + var _a2; + if (this._lastPreferences !== preferences) { + this._lastPreferences = preferences; + this._cache = void 0; + } + (_a2 = this._cache) != null ? _a2 : this._cache = /* @__PURE__ */ new WeakMap(); + this._cache.set(specifiers, value); + } + }; + detectImportSpecifierSorting = memoizeCached((specifiers, preferences) => { if (!arrayIsSorted(specifiers, (s1, s2) => compareBooleans(s1.isTypeOnly, s2.isTypeOnly))) { return 0 /* None */; } - return detectSortCaseSensitivity( - specifiers, - /*useEslintOrdering*/ - true, - (specifier) => specifier.name.text + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false ); - }); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); + return detectSortCaseSensitivity(specifiers, (specifier) => specifier.name.text, collateCaseSensitive, collateCaseInsensitive); + }, new ImportSpecifierSortingCache()); } }); @@ -151404,6 +155085,7 @@ ${lanes.join("\n")} detectSorting: () => detectSorting, getImportDeclarationInsertionIndex: () => getImportDeclarationInsertionIndex, getImportSpecifierInsertionIndex: () => getImportSpecifierInsertionIndex, + getOrganizeImportsComparer: () => getOrganizeImportsComparer, organizeImports: () => organizeImports }); var init_ts_OrganizeImports = __esm({ @@ -151883,7 +155565,7 @@ ${lanes.join("\n")} return void 0; } } - function doChange33(exportingSourceFile, program, info, changes, cancellationToken) { + function doChange32(exportingSourceFile, program, info, changes, cancellationToken) { changeExport(exportingSourceFile, info, changes, program.getTypeChecker()); changeImports(program, info, changes, cancellationToken); } @@ -152079,7 +155761,7 @@ ${lanes.join("\n")} Debug.assert(actionName2 === defaultToNamedAction.name || actionName2 === namedToDefaultAction.name, "Unexpected action name"); const info = getInfo19(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, info, t, context.cancellationToken)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(context.file, context.program, info, t, context.cancellationToken)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -152114,7 +155796,7 @@ ${lanes.join("\n")} function getShouldUseDefault(program, importClause) { return getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); } - function doChange34(sourceFile, program, changes, info) { + function doChange33(sourceFile, program, changes, info) { const checker = program.getTypeChecker(); if (info.convertTo === 0 /* Named */) { doChangeNamespaceToNamed(sourceFile, checker, changes, info.import, getAllowSyntheticDefaultImports(program.getCompilerOptions())); @@ -152306,7 +155988,7 @@ ${lanes.join("\n")} Debug.assert(some(getOwnValues(actions), (action) => action.name === actionName2), "Unexpected action name"); const info = getImportConversionInfo(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, t, info)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, t, info)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -152648,7 +156330,7 @@ ${lanes.join("\n")} afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex] }; } - function doChange35(oldFile, program, toMove, changes, host, preferences) { + function doChange34(oldFile, program, toMove, changes, host, preferences) { const checker = program.getTypeChecker(); const usage = getUsageInfo(oldFile, toMove.all, checker); const currentDirectory = getDirectoryPath(oldFile.fileName); @@ -152729,7 +156411,8 @@ ${lanes.join("\n")} oldFile, importsFromNewFile, /*blankLineBetween*/ - true + true, + preferences ); } deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker); @@ -153422,7 +157105,7 @@ ${lanes.join("\n")} getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) { Debug.assert(actionName2 === refactorName4, "Wrong refactor invoked"); const statements = Debug.checkDefined(getStatementsToMove(context)); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(context.file, context.program, statements, t, context.host, context.preferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, statements, t, context.host, context.preferences)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -154083,12 +157766,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; const groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); if (groupedReferences.valid) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(file, program, host, t, functionDeclaration, groupedReferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(file, program, host, t, functionDeclaration, groupedReferences)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return { edits: [] }; } - function doChange36(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { + function doChange35(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { const signature = groupedReferences.signature; const newFunctionDeclarationParams = map(createNewParameters(functionDeclaration, program, host), (param) => getSynthesizedDeepClone(param)); if (signature) { @@ -154881,7 +158564,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); const edits = ts_textChanges_exports.ChangeTracker.with( context, - (t) => doChange37(context.file, context.program.getTypeChecker(), t, info, actionName2) + (t) => doChange36(context.file, context.program.getTypeChecker(), t, info, actionName2) ); return { edits, renameFilename: void 0, renameLocation: void 0 }; } @@ -155037,7 +158720,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return toConvert; } - function doChange37(sourceFile, checker, changes, info, _actionName) { + function doChange36(sourceFile, checker, changes, info, _actionName) { const { finalExpression, occurrences, expression } = info; const firstOccurrence = occurrences[occurrences.length - 1]; const convertedChain = convertOccurrences(checker, finalExpression, occurrences); @@ -155945,7 +159628,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} 111551 /* Value */, /*excludeGlobals*/ false - ) && !isPrivateIdentifier(node.name) && !isKeyword(node.name.originalKeywordKind) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); + ) && !isPrivateIdentifier(node.name) && !identifierToKeywordKind(node.name) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); const isJS = isInJSFile(scope); let variableType = isJS || !checker.isContextSensitive(node) ? void 0 : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */); let initializer = transformConstantInitializer(skipParentheses(node), substitutions); @@ -156182,7 +159865,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} let ignoreReturns = false; const statements = factory.createNodeArray(isBlock(body) ? body.statements.slice(0) : [isStatement(body) ? body : factory.createReturnStatement(skipParentheses(body))]); if (hasWritesOrVariableDeclarations || substitutions.size) { - const rewrittenStatements = visitNodes2(statements, visitor).slice(); + const rewrittenStatements = visitNodes2(statements, visitor, isStatement).slice(); if (hasWritesOrVariableDeclarations && !hasReturn2 && isStatement(body)) { const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (assignments.length === 1) { @@ -156210,7 +159893,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!returnValueProperty) { returnValueProperty = "__return"; } - assignments.unshift(factory.createPropertyAssignment(returnValueProperty, visitNode(node.expression, visitor))); + assignments.unshift(factory.createPropertyAssignment(returnValueProperty, visitNode(node.expression, visitor, isExpression))); } if (assignments.length === 1) { return factory.createReturnStatement(assignments[0].name); @@ -156783,7 +160466,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getRefactorEditsToInferReturnType(context) { const info = getInfo21(context); if (info && !isRefactorErrorInfo(info)) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange38(context.file, t, info.declaration, info.returnTypeNode)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(context.file, t, info.declaration, info.returnTypeNode)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return void 0; @@ -156808,7 +160491,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return emptyArray; } - function doChange38(sourceFile, changes, declaration, typeNode) { + function doChange37(sourceFile, changes, declaration, typeNode) { const closeParen = findChildOfKind(declaration, 21 /* CloseParenToken */, sourceFile); const needParens = isArrowFunction(declaration) && closeParen === void 0; const endNode2 = needParens ? first(declaration.parameters) : closeParen; @@ -156960,7 +160643,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (declarations.some((declaration) => isDefinedInLibraryFile(program, declaration))) { return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } - if (isIdentifier(node) && node.originalKeywordKind === 88 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) { + if (isIdentifier(node) && node.escapedText === "default" && symbol.parent && symbol.parent.flags & 1536 /* Module */) { return void 0; } if (isStringLiteralLike(node) && tryGetImportFromModuleSpecifier(node)) { @@ -158665,7 +162348,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } const jsDocNode = parent2.parent.kind === 169 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; jsDocNode.jsDoc = parent2.jsDoc; - jsDocNode.jsDocCache = parent2.jsDocCache; return jsDocNode; } function tryMergeJsdocTags(oldTag, newTag) { @@ -158779,6 +162461,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!visited) { return visited; } + Debug.assert(nodes); const nodeArray = visited === nodes ? factory.createNodeArray(visited.slice(0)) : visited; setTextRangePosEnd(nodeArray, getPos2(nodes), getEnd(nodes)); return nodeArray; @@ -162717,7 +166400,7 @@ ${options.prefix}` : "\n" : options.prefix const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter; const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter; const since = typeof options.since === "string" ? new Version(options.since) : (_b = options.since) != null ? _b : warnAfter; - const error = options.error || errorAfter && version2.compareTo(errorAfter) <= 0; + const error = options.error || errorAfter && version2.compareTo(errorAfter) >= 0; const warn = !warnAfter || version2.compareTo(warnAfter) >= 0; return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop; } @@ -162793,1338 +166476,51 @@ ${options.prefix}` : "\n" : options.prefix } }); - // src/deprecatedCompat/4.0/nodeFactoryTopLevelExports.ts - var factoryDeprecation, createNodeArray, createNumericLiteral, createBigIntLiteral, createStringLiteral, createStringLiteralFromNode, createRegularExpressionLiteral, createLoopVariable, createUniqueName, createPrivateIdentifier, createSuper, createThis, createNull, createTrue, createFalse, createModifier, createModifiersFromModifierFlags, createQualifiedName, updateQualifiedName, createComputedPropertyName, updateComputedPropertyName, createTypeParameterDeclaration, updateTypeParameterDeclaration, createParameter, updateParameter, createDecorator, updateDecorator, createProperty, updateProperty, createMethod, updateMethod, createConstructor, updateConstructor, createGetAccessor, updateGetAccessor, createSetAccessor, updateSetAccessor, createCallSignature, updateCallSignature, createConstructSignature, updateConstructSignature, updateIndexSignature, createKeywordTypeNode, createTypePredicateNodeWithModifier, updateTypePredicateNodeWithModifier, createTypeReferenceNode, updateTypeReferenceNode, createFunctionTypeNode, updateFunctionTypeNode, createConstructorTypeNode, updateConstructorTypeNode, createTypeQueryNode, updateTypeQueryNode, createTypeLiteralNode, updateTypeLiteralNode, createArrayTypeNode, updateArrayTypeNode, createTupleTypeNode, updateTupleTypeNode, createOptionalTypeNode, updateOptionalTypeNode, createRestTypeNode, updateRestTypeNode, createUnionTypeNode, updateUnionTypeNode, createIntersectionTypeNode, updateIntersectionTypeNode, createConditionalTypeNode, updateConditionalTypeNode, createInferTypeNode, updateInferTypeNode, createImportTypeNode, updateImportTypeNode, createParenthesizedType, updateParenthesizedType, createThisTypeNode, updateTypeOperatorNode, createIndexedAccessTypeNode, updateIndexedAccessTypeNode, createMappedTypeNode, updateMappedTypeNode, createLiteralTypeNode, updateLiteralTypeNode, createObjectBindingPattern, updateObjectBindingPattern, createArrayBindingPattern, updateArrayBindingPattern, createBindingElement, updateBindingElement, createArrayLiteral, updateArrayLiteral, createObjectLiteral, updateObjectLiteral, createPropertyAccess, updatePropertyAccess, createPropertyAccessChain, updatePropertyAccessChain, createElementAccess, updateElementAccess, createElementAccessChain, updateElementAccessChain, createCall, updateCall, createCallChain, updateCallChain, createNew, updateNew, createTypeAssertion, updateTypeAssertion, createParen, updateParen, createFunctionExpression, updateFunctionExpression, createDelete, updateDelete, createTypeOf, updateTypeOf, createVoid, updateVoid, createAwait, updateAwait, createPrefix, updatePrefix, createPostfix, updatePostfix, createBinary, updateConditional, createTemplateExpression, updateTemplateExpression, createTemplateHead, createTemplateMiddle, createTemplateTail, createNoSubstitutionTemplateLiteral, updateYield, createSpread, updateSpread, createOmittedExpression, createAsExpression, updateAsExpression, createNonNullExpression, updateNonNullExpression, createNonNullChain, updateNonNullChain, createMetaProperty, updateMetaProperty, createTemplateSpan, updateTemplateSpan, createSemicolonClassElement, createBlock, updateBlock, createVariableStatement, updateVariableStatement, createEmptyStatement, createExpressionStatement, updateExpressionStatement, createStatement, updateStatement, createIf, updateIf, createDo, updateDo, createWhile, updateWhile, createFor, updateFor, createForIn, updateForIn, createForOf, updateForOf, createContinue, updateContinue, createBreak, updateBreak, createReturn, updateReturn, createWith, updateWith, createSwitch, updateSwitch, createLabel, updateLabel, createThrow, updateThrow, createTry, updateTry, createDebuggerStatement, createVariableDeclarationList, updateVariableDeclarationList, createFunctionDeclaration, updateFunctionDeclaration, createClassDeclaration, updateClassDeclaration, createInterfaceDeclaration, updateInterfaceDeclaration, createTypeAliasDeclaration, updateTypeAliasDeclaration, createEnumDeclaration, updateEnumDeclaration, createModuleDeclaration, updateModuleDeclaration, createModuleBlock, updateModuleBlock, createCaseBlock, updateCaseBlock, createNamespaceExportDeclaration, updateNamespaceExportDeclaration, createImportEqualsDeclaration, updateImportEqualsDeclaration, createImportDeclaration, updateImportDeclaration, createNamespaceImport, updateNamespaceImport, createNamedImports, updateNamedImports, createImportSpecifier, updateImportSpecifier, createExportAssignment2, updateExportAssignment, createNamedExports, updateNamedExports, createExportSpecifier, updateExportSpecifier, createExternalModuleReference, updateExternalModuleReference, createJSDocTypeExpression, createJSDocTypeTag, createJSDocReturnTag, createJSDocThisTag, createJSDocComment, createJSDocParameterTag, createJSDocClassTag, createJSDocAugmentsTag, createJSDocEnumTag, createJSDocTemplateTag, createJSDocTypedefTag, createJSDocCallbackTag, createJSDocSignature, createJSDocPropertyTag, createJSDocTypeLiteral, createJSDocImplementsTag, createJSDocAuthorTag, createJSDocPublicTag, createJSDocPrivateTag, createJSDocProtectedTag, createJSDocReadonlyTag, createJSDocTag, createJsxElement, updateJsxElement, createJsxSelfClosingElement, updateJsxSelfClosingElement, createJsxOpeningElement, updateJsxOpeningElement, createJsxClosingElement, updateJsxClosingElement, createJsxFragment, createJsxText, updateJsxText, createJsxOpeningFragment, createJsxJsxClosingFragment, updateJsxFragment, createJsxAttribute, updateJsxAttribute, createJsxAttributes, updateJsxAttributes, createJsxSpreadAttribute, updateJsxSpreadAttribute, createJsxExpression, updateJsxExpression, createCaseClause, updateCaseClause, createDefaultClause, updateDefaultClause, createHeritageClause, updateHeritageClause, createCatchClause, updateCatchClause, createPropertyAssignment, updatePropertyAssignment, createShorthandPropertyAssignment, updateShorthandPropertyAssignment, createSpreadAssignment, updateSpreadAssignment, createEnumMember, updateEnumMember, updateSourceFileNode, createNotEmittedStatement, createPartiallyEmittedExpression, updatePartiallyEmittedExpression, createCommaList, updateCommaList, createBundle, updateBundle, createImmediatelyInvokedFunctionExpression, createImmediatelyInvokedArrowFunction, createVoidZero, createExportDefault, createExternalModuleExport, createNamespaceExport, updateNamespaceExport, createToken, createIdentifier, createTempVariable, getGeneratedNameForNode, createOptimisticUniqueName, createFileLevelUniqueName, createIndexSignature, createTypePredicateNode, updateTypePredicateNode, createLiteral, createMethodSignature, updateMethodSignature, createTypeOperatorNode, createTaggedTemplate, updateTaggedTemplate, updateBinary, createConditional, createYield, createClassExpression, updateClassExpression, createPropertySignature, updatePropertySignature, createExpressionWithTypeArguments, updateExpressionWithTypeArguments, createArrowFunction, updateArrowFunction, createVariableDeclaration, updateVariableDeclaration, createImportClause, updateImportClause, createExportDeclaration, updateExportDeclaration, createJSDocParamTag, createComma, createLessThan, createAssignment, createStrictEquality, createStrictInequality, createAdd, createSubtract, createLogicalAnd, createLogicalOr, createPostfixIncrement, createLogicalNot, createNode2, getMutableClone; - var init_nodeFactoryTopLevelExports = __esm({ - "src/deprecatedCompat/4.0/nodeFactoryTopLevelExports.ts"() { + // src/deprecatedCompat/5.0/identifierProperties.ts + var init_identifierProperties = __esm({ + "src/deprecatedCompat/5.0/identifierProperties.ts"() { "use strict"; init_ts5(); init_deprecate(); - factoryDeprecation = { since: "4.0", warnAfter: "4.1", message: "Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead." }; - createNodeArray = deprecate(factory.createNodeArray, factoryDeprecation); - createNumericLiteral = deprecate(factory.createNumericLiteral, factoryDeprecation); - createBigIntLiteral = deprecate(factory.createBigIntLiteral, factoryDeprecation); - createStringLiteral = deprecate(factory.createStringLiteral, factoryDeprecation); - createStringLiteralFromNode = deprecate(factory.createStringLiteralFromNode, factoryDeprecation); - createRegularExpressionLiteral = deprecate(factory.createRegularExpressionLiteral, factoryDeprecation); - createLoopVariable = deprecate(factory.createLoopVariable, factoryDeprecation); - createUniqueName = deprecate(factory.createUniqueName, factoryDeprecation); - createPrivateIdentifier = deprecate(factory.createPrivateIdentifier, factoryDeprecation); - createSuper = deprecate(factory.createSuper, factoryDeprecation); - createThis = deprecate(factory.createThis, factoryDeprecation); - createNull = deprecate(factory.createNull, factoryDeprecation); - createTrue = deprecate(factory.createTrue, factoryDeprecation); - createFalse = deprecate(factory.createFalse, factoryDeprecation); - createModifier = deprecate(factory.createModifier, factoryDeprecation); - createModifiersFromModifierFlags = deprecate(factory.createModifiersFromModifierFlags, factoryDeprecation); - createQualifiedName = deprecate(factory.createQualifiedName, factoryDeprecation); - updateQualifiedName = deprecate(factory.updateQualifiedName, factoryDeprecation); - createComputedPropertyName = deprecate(factory.createComputedPropertyName, factoryDeprecation); - updateComputedPropertyName = deprecate(factory.updateComputedPropertyName, factoryDeprecation); - createTypeParameterDeclaration = deprecate(factory.createTypeParameterDeclaration, factoryDeprecation); - updateTypeParameterDeclaration = deprecate(factory.updateTypeParameterDeclaration, factoryDeprecation); - createParameter = deprecate(factory.createParameterDeclaration, factoryDeprecation); - updateParameter = deprecate(factory.updateParameterDeclaration, factoryDeprecation); - createDecorator = deprecate(factory.createDecorator, factoryDeprecation); - updateDecorator = deprecate(factory.updateDecorator, factoryDeprecation); - createProperty = deprecate(factory.createPropertyDeclaration, factoryDeprecation); - updateProperty = deprecate(factory.updatePropertyDeclaration, factoryDeprecation); - createMethod = deprecate(factory.createMethodDeclaration, factoryDeprecation); - updateMethod = deprecate(factory.updateMethodDeclaration, factoryDeprecation); - createConstructor = deprecate(factory.createConstructorDeclaration, factoryDeprecation); - updateConstructor = deprecate(factory.updateConstructorDeclaration, factoryDeprecation); - createGetAccessor = deprecate(factory.createGetAccessorDeclaration, factoryDeprecation); - updateGetAccessor = deprecate(factory.updateGetAccessorDeclaration, factoryDeprecation); - createSetAccessor = deprecate(factory.createSetAccessorDeclaration, factoryDeprecation); - updateSetAccessor = deprecate(factory.updateSetAccessorDeclaration, factoryDeprecation); - createCallSignature = deprecate(factory.createCallSignature, factoryDeprecation); - updateCallSignature = deprecate(factory.updateCallSignature, factoryDeprecation); - createConstructSignature = deprecate(factory.createConstructSignature, factoryDeprecation); - updateConstructSignature = deprecate(factory.updateConstructSignature, factoryDeprecation); - updateIndexSignature = deprecate(factory.updateIndexSignature, factoryDeprecation); - createKeywordTypeNode = deprecate(factory.createKeywordTypeNode, factoryDeprecation); - createTypePredicateNodeWithModifier = deprecate(factory.createTypePredicateNode, factoryDeprecation); - updateTypePredicateNodeWithModifier = deprecate(factory.updateTypePredicateNode, factoryDeprecation); - createTypeReferenceNode = deprecate(factory.createTypeReferenceNode, factoryDeprecation); - updateTypeReferenceNode = deprecate(factory.updateTypeReferenceNode, factoryDeprecation); - createFunctionTypeNode = deprecate(factory.createFunctionTypeNode, factoryDeprecation); - updateFunctionTypeNode = deprecate(factory.updateFunctionTypeNode, factoryDeprecation); - createConstructorTypeNode = deprecate((typeParameters, parameters, type) => { - return factory.createConstructorTypeNode( - /*modifiers*/ - void 0, - typeParameters, - parameters, - type - ); - }, factoryDeprecation); - updateConstructorTypeNode = deprecate((node, typeParameters, parameters, type) => { - return factory.updateConstructorTypeNode(node, node.modifiers, typeParameters, parameters, type); - }, factoryDeprecation); - createTypeQueryNode = deprecate(factory.createTypeQueryNode, factoryDeprecation); - updateTypeQueryNode = deprecate(factory.updateTypeQueryNode, factoryDeprecation); - createTypeLiteralNode = deprecate(factory.createTypeLiteralNode, factoryDeprecation); - updateTypeLiteralNode = deprecate(factory.updateTypeLiteralNode, factoryDeprecation); - createArrayTypeNode = deprecate(factory.createArrayTypeNode, factoryDeprecation); - updateArrayTypeNode = deprecate(factory.updateArrayTypeNode, factoryDeprecation); - createTupleTypeNode = deprecate(factory.createTupleTypeNode, factoryDeprecation); - updateTupleTypeNode = deprecate(factory.updateTupleTypeNode, factoryDeprecation); - createOptionalTypeNode = deprecate(factory.createOptionalTypeNode, factoryDeprecation); - updateOptionalTypeNode = deprecate(factory.updateOptionalTypeNode, factoryDeprecation); - createRestTypeNode = deprecate(factory.createRestTypeNode, factoryDeprecation); - updateRestTypeNode = deprecate(factory.updateRestTypeNode, factoryDeprecation); - createUnionTypeNode = deprecate(factory.createUnionTypeNode, factoryDeprecation); - updateUnionTypeNode = deprecate(factory.updateUnionTypeNode, factoryDeprecation); - createIntersectionTypeNode = deprecate(factory.createIntersectionTypeNode, factoryDeprecation); - updateIntersectionTypeNode = deprecate(factory.updateIntersectionTypeNode, factoryDeprecation); - createConditionalTypeNode = deprecate(factory.createConditionalTypeNode, factoryDeprecation); - updateConditionalTypeNode = deprecate(factory.updateConditionalTypeNode, factoryDeprecation); - createInferTypeNode = deprecate(factory.createInferTypeNode, factoryDeprecation); - updateInferTypeNode = deprecate(factory.updateInferTypeNode, factoryDeprecation); - createImportTypeNode = deprecate(factory.createImportTypeNode, factoryDeprecation); - updateImportTypeNode = deprecate(factory.updateImportTypeNode, factoryDeprecation); - createParenthesizedType = deprecate(factory.createParenthesizedType, factoryDeprecation); - updateParenthesizedType = deprecate(factory.updateParenthesizedType, factoryDeprecation); - createThisTypeNode = deprecate(factory.createThisTypeNode, factoryDeprecation); - updateTypeOperatorNode = deprecate(factory.updateTypeOperatorNode, factoryDeprecation); - createIndexedAccessTypeNode = deprecate(factory.createIndexedAccessTypeNode, factoryDeprecation); - updateIndexedAccessTypeNode = deprecate(factory.updateIndexedAccessTypeNode, factoryDeprecation); - createMappedTypeNode = deprecate(factory.createMappedTypeNode, factoryDeprecation); - updateMappedTypeNode = deprecate(factory.updateMappedTypeNode, factoryDeprecation); - createLiteralTypeNode = deprecate(factory.createLiteralTypeNode, factoryDeprecation); - updateLiteralTypeNode = deprecate(factory.updateLiteralTypeNode, factoryDeprecation); - createObjectBindingPattern = deprecate(factory.createObjectBindingPattern, factoryDeprecation); - updateObjectBindingPattern = deprecate(factory.updateObjectBindingPattern, factoryDeprecation); - createArrayBindingPattern = deprecate(factory.createArrayBindingPattern, factoryDeprecation); - updateArrayBindingPattern = deprecate(factory.updateArrayBindingPattern, factoryDeprecation); - createBindingElement = deprecate(factory.createBindingElement, factoryDeprecation); - updateBindingElement = deprecate(factory.updateBindingElement, factoryDeprecation); - createArrayLiteral = deprecate(factory.createArrayLiteralExpression, factoryDeprecation); - updateArrayLiteral = deprecate(factory.updateArrayLiteralExpression, factoryDeprecation); - createObjectLiteral = deprecate(factory.createObjectLiteralExpression, factoryDeprecation); - updateObjectLiteral = deprecate(factory.updateObjectLiteralExpression, factoryDeprecation); - createPropertyAccess = deprecate(factory.createPropertyAccessExpression, factoryDeprecation); - updatePropertyAccess = deprecate(factory.updatePropertyAccessExpression, factoryDeprecation); - createPropertyAccessChain = deprecate(factory.createPropertyAccessChain, factoryDeprecation); - updatePropertyAccessChain = deprecate(factory.updatePropertyAccessChain, factoryDeprecation); - createElementAccess = deprecate(factory.createElementAccessExpression, factoryDeprecation); - updateElementAccess = deprecate(factory.updateElementAccessExpression, factoryDeprecation); - createElementAccessChain = deprecate(factory.createElementAccessChain, factoryDeprecation); - updateElementAccessChain = deprecate(factory.updateElementAccessChain, factoryDeprecation); - createCall = deprecate(factory.createCallExpression, factoryDeprecation); - updateCall = deprecate(factory.updateCallExpression, factoryDeprecation); - createCallChain = deprecate(factory.createCallChain, factoryDeprecation); - updateCallChain = deprecate(factory.updateCallChain, factoryDeprecation); - createNew = deprecate(factory.createNewExpression, factoryDeprecation); - updateNew = deprecate(factory.updateNewExpression, factoryDeprecation); - createTypeAssertion = deprecate(factory.createTypeAssertion, factoryDeprecation); - updateTypeAssertion = deprecate(factory.updateTypeAssertion, factoryDeprecation); - createParen = deprecate(factory.createParenthesizedExpression, factoryDeprecation); - updateParen = deprecate(factory.updateParenthesizedExpression, factoryDeprecation); - createFunctionExpression = deprecate(factory.createFunctionExpression, factoryDeprecation); - updateFunctionExpression = deprecate(factory.updateFunctionExpression, factoryDeprecation); - createDelete = deprecate(factory.createDeleteExpression, factoryDeprecation); - updateDelete = deprecate(factory.updateDeleteExpression, factoryDeprecation); - createTypeOf = deprecate(factory.createTypeOfExpression, factoryDeprecation); - updateTypeOf = deprecate(factory.updateTypeOfExpression, factoryDeprecation); - createVoid = deprecate(factory.createVoidExpression, factoryDeprecation); - updateVoid = deprecate(factory.updateVoidExpression, factoryDeprecation); - createAwait = deprecate(factory.createAwaitExpression, factoryDeprecation); - updateAwait = deprecate(factory.updateAwaitExpression, factoryDeprecation); - createPrefix = deprecate(factory.createPrefixUnaryExpression, factoryDeprecation); - updatePrefix = deprecate(factory.updatePrefixUnaryExpression, factoryDeprecation); - createPostfix = deprecate(factory.createPostfixUnaryExpression, factoryDeprecation); - updatePostfix = deprecate(factory.updatePostfixUnaryExpression, factoryDeprecation); - createBinary = deprecate(factory.createBinaryExpression, factoryDeprecation); - updateConditional = deprecate(factory.updateConditionalExpression, factoryDeprecation); - createTemplateExpression = deprecate(factory.createTemplateExpression, factoryDeprecation); - updateTemplateExpression = deprecate(factory.updateTemplateExpression, factoryDeprecation); - createTemplateHead = deprecate(factory.createTemplateHead, factoryDeprecation); - createTemplateMiddle = deprecate(factory.createTemplateMiddle, factoryDeprecation); - createTemplateTail = deprecate(factory.createTemplateTail, factoryDeprecation); - createNoSubstitutionTemplateLiteral = deprecate(factory.createNoSubstitutionTemplateLiteral, factoryDeprecation); - updateYield = deprecate(factory.updateYieldExpression, factoryDeprecation); - createSpread = deprecate(factory.createSpreadElement, factoryDeprecation); - updateSpread = deprecate(factory.updateSpreadElement, factoryDeprecation); - createOmittedExpression = deprecate(factory.createOmittedExpression, factoryDeprecation); - createAsExpression = deprecate(factory.createAsExpression, factoryDeprecation); - updateAsExpression = deprecate(factory.updateAsExpression, factoryDeprecation); - createNonNullExpression = deprecate(factory.createNonNullExpression, factoryDeprecation); - updateNonNullExpression = deprecate(factory.updateNonNullExpression, factoryDeprecation); - createNonNullChain = deprecate(factory.createNonNullChain, factoryDeprecation); - updateNonNullChain = deprecate(factory.updateNonNullChain, factoryDeprecation); - createMetaProperty = deprecate(factory.createMetaProperty, factoryDeprecation); - updateMetaProperty = deprecate(factory.updateMetaProperty, factoryDeprecation); - createTemplateSpan = deprecate(factory.createTemplateSpan, factoryDeprecation); - updateTemplateSpan = deprecate(factory.updateTemplateSpan, factoryDeprecation); - createSemicolonClassElement = deprecate(factory.createSemicolonClassElement, factoryDeprecation); - createBlock = deprecate(factory.createBlock, factoryDeprecation); - updateBlock = deprecate(factory.updateBlock, factoryDeprecation); - createVariableStatement = deprecate(factory.createVariableStatement, factoryDeprecation); - updateVariableStatement = deprecate(factory.updateVariableStatement, factoryDeprecation); - createEmptyStatement = deprecate(factory.createEmptyStatement, factoryDeprecation); - createExpressionStatement = deprecate(factory.createExpressionStatement, factoryDeprecation); - updateExpressionStatement = deprecate(factory.updateExpressionStatement, factoryDeprecation); - createStatement = deprecate(factory.createExpressionStatement, factoryDeprecation); - updateStatement = deprecate(factory.updateExpressionStatement, factoryDeprecation); - createIf = deprecate(factory.createIfStatement, factoryDeprecation); - updateIf = deprecate(factory.updateIfStatement, factoryDeprecation); - createDo = deprecate(factory.createDoStatement, factoryDeprecation); - updateDo = deprecate(factory.updateDoStatement, factoryDeprecation); - createWhile = deprecate(factory.createWhileStatement, factoryDeprecation); - updateWhile = deprecate(factory.updateWhileStatement, factoryDeprecation); - createFor = deprecate(factory.createForStatement, factoryDeprecation); - updateFor = deprecate(factory.updateForStatement, factoryDeprecation); - createForIn = deprecate(factory.createForInStatement, factoryDeprecation); - updateForIn = deprecate(factory.updateForInStatement, factoryDeprecation); - createForOf = deprecate(factory.createForOfStatement, factoryDeprecation); - updateForOf = deprecate(factory.updateForOfStatement, factoryDeprecation); - createContinue = deprecate(factory.createContinueStatement, factoryDeprecation); - updateContinue = deprecate(factory.updateContinueStatement, factoryDeprecation); - createBreak = deprecate(factory.createBreakStatement, factoryDeprecation); - updateBreak = deprecate(factory.updateBreakStatement, factoryDeprecation); - createReturn = deprecate(factory.createReturnStatement, factoryDeprecation); - updateReturn = deprecate(factory.updateReturnStatement, factoryDeprecation); - createWith = deprecate(factory.createWithStatement, factoryDeprecation); - updateWith = deprecate(factory.updateWithStatement, factoryDeprecation); - createSwitch = deprecate(factory.createSwitchStatement, factoryDeprecation); - updateSwitch = deprecate(factory.updateSwitchStatement, factoryDeprecation); - createLabel = deprecate(factory.createLabeledStatement, factoryDeprecation); - updateLabel = deprecate(factory.updateLabeledStatement, factoryDeprecation); - createThrow = deprecate(factory.createThrowStatement, factoryDeprecation); - updateThrow = deprecate(factory.updateThrowStatement, factoryDeprecation); - createTry = deprecate(factory.createTryStatement, factoryDeprecation); - updateTry = deprecate(factory.updateTryStatement, factoryDeprecation); - createDebuggerStatement = deprecate(factory.createDebuggerStatement, factoryDeprecation); - createVariableDeclarationList = deprecate(factory.createVariableDeclarationList, factoryDeprecation); - updateVariableDeclarationList = deprecate(factory.updateVariableDeclarationList, factoryDeprecation); - createFunctionDeclaration = deprecate(factory.createFunctionDeclaration, factoryDeprecation); - updateFunctionDeclaration = deprecate(factory.updateFunctionDeclaration, factoryDeprecation); - createClassDeclaration = deprecate(factory.createClassDeclaration, factoryDeprecation); - updateClassDeclaration = deprecate(factory.updateClassDeclaration, factoryDeprecation); - createInterfaceDeclaration = deprecate(factory.createInterfaceDeclaration, factoryDeprecation); - updateInterfaceDeclaration = deprecate(factory.updateInterfaceDeclaration, factoryDeprecation); - createTypeAliasDeclaration = deprecate(factory.createTypeAliasDeclaration, factoryDeprecation); - updateTypeAliasDeclaration = deprecate(factory.updateTypeAliasDeclaration, factoryDeprecation); - createEnumDeclaration = deprecate(factory.createEnumDeclaration, factoryDeprecation); - updateEnumDeclaration = deprecate(factory.updateEnumDeclaration, factoryDeprecation); - createModuleDeclaration = deprecate(factory.createModuleDeclaration, factoryDeprecation); - updateModuleDeclaration = deprecate(factory.updateModuleDeclaration, factoryDeprecation); - createModuleBlock = deprecate(factory.createModuleBlock, factoryDeprecation); - updateModuleBlock = deprecate(factory.updateModuleBlock, factoryDeprecation); - createCaseBlock = deprecate(factory.createCaseBlock, factoryDeprecation); - updateCaseBlock = deprecate(factory.updateCaseBlock, factoryDeprecation); - createNamespaceExportDeclaration = deprecate(factory.createNamespaceExportDeclaration, factoryDeprecation); - updateNamespaceExportDeclaration = deprecate(factory.updateNamespaceExportDeclaration, factoryDeprecation); - createImportEqualsDeclaration = deprecate(factory.createImportEqualsDeclaration, factoryDeprecation); - updateImportEqualsDeclaration = deprecate(factory.updateImportEqualsDeclaration, factoryDeprecation); - createImportDeclaration = deprecate(factory.createImportDeclaration, factoryDeprecation); - updateImportDeclaration = deprecate(factory.updateImportDeclaration, factoryDeprecation); - createNamespaceImport = deprecate(factory.createNamespaceImport, factoryDeprecation); - updateNamespaceImport = deprecate(factory.updateNamespaceImport, factoryDeprecation); - createNamedImports = deprecate(factory.createNamedImports, factoryDeprecation); - updateNamedImports = deprecate(factory.updateNamedImports, factoryDeprecation); - createImportSpecifier = deprecate(factory.createImportSpecifier, factoryDeprecation); - updateImportSpecifier = deprecate(factory.updateImportSpecifier, factoryDeprecation); - createExportAssignment2 = deprecate(factory.createExportAssignment, factoryDeprecation); - updateExportAssignment = deprecate(factory.updateExportAssignment, factoryDeprecation); - createNamedExports = deprecate(factory.createNamedExports, factoryDeprecation); - updateNamedExports = deprecate(factory.updateNamedExports, factoryDeprecation); - createExportSpecifier = deprecate(factory.createExportSpecifier, factoryDeprecation); - updateExportSpecifier = deprecate(factory.updateExportSpecifier, factoryDeprecation); - createExternalModuleReference = deprecate(factory.createExternalModuleReference, factoryDeprecation); - updateExternalModuleReference = deprecate(factory.updateExternalModuleReference, factoryDeprecation); - createJSDocTypeExpression = deprecate(factory.createJSDocTypeExpression, factoryDeprecation); - createJSDocTypeTag = deprecate(factory.createJSDocTypeTag, factoryDeprecation); - createJSDocReturnTag = deprecate(factory.createJSDocReturnTag, factoryDeprecation); - createJSDocThisTag = deprecate(factory.createJSDocThisTag, factoryDeprecation); - createJSDocComment = deprecate(factory.createJSDocComment, factoryDeprecation); - createJSDocParameterTag = deprecate(factory.createJSDocParameterTag, factoryDeprecation); - createJSDocClassTag = deprecate(factory.createJSDocClassTag, factoryDeprecation); - createJSDocAugmentsTag = deprecate(factory.createJSDocAugmentsTag, factoryDeprecation); - createJSDocEnumTag = deprecate(factory.createJSDocEnumTag, factoryDeprecation); - createJSDocTemplateTag = deprecate(factory.createJSDocTemplateTag, factoryDeprecation); - createJSDocTypedefTag = deprecate(factory.createJSDocTypedefTag, factoryDeprecation); - createJSDocCallbackTag = deprecate(factory.createJSDocCallbackTag, factoryDeprecation); - createJSDocSignature = deprecate(factory.createJSDocSignature, factoryDeprecation); - createJSDocPropertyTag = deprecate(factory.createJSDocPropertyTag, factoryDeprecation); - createJSDocTypeLiteral = deprecate(factory.createJSDocTypeLiteral, factoryDeprecation); - createJSDocImplementsTag = deprecate(factory.createJSDocImplementsTag, factoryDeprecation); - createJSDocAuthorTag = deprecate(factory.createJSDocAuthorTag, factoryDeprecation); - createJSDocPublicTag = deprecate(factory.createJSDocPublicTag, factoryDeprecation); - createJSDocPrivateTag = deprecate(factory.createJSDocPrivateTag, factoryDeprecation); - createJSDocProtectedTag = deprecate(factory.createJSDocProtectedTag, factoryDeprecation); - createJSDocReadonlyTag = deprecate(factory.createJSDocReadonlyTag, factoryDeprecation); - createJSDocTag = deprecate(factory.createJSDocUnknownTag, factoryDeprecation); - createJsxElement = deprecate(factory.createJsxElement, factoryDeprecation); - updateJsxElement = deprecate(factory.updateJsxElement, factoryDeprecation); - createJsxSelfClosingElement = deprecate(factory.createJsxSelfClosingElement, factoryDeprecation); - updateJsxSelfClosingElement = deprecate(factory.updateJsxSelfClosingElement, factoryDeprecation); - createJsxOpeningElement = deprecate(factory.createJsxOpeningElement, factoryDeprecation); - updateJsxOpeningElement = deprecate(factory.updateJsxOpeningElement, factoryDeprecation); - createJsxClosingElement = deprecate(factory.createJsxClosingElement, factoryDeprecation); - updateJsxClosingElement = deprecate(factory.updateJsxClosingElement, factoryDeprecation); - createJsxFragment = deprecate(factory.createJsxFragment, factoryDeprecation); - createJsxText = deprecate(factory.createJsxText, factoryDeprecation); - updateJsxText = deprecate(factory.updateJsxText, factoryDeprecation); - createJsxOpeningFragment = deprecate(factory.createJsxOpeningFragment, factoryDeprecation); - createJsxJsxClosingFragment = deprecate(factory.createJsxJsxClosingFragment, factoryDeprecation); - updateJsxFragment = deprecate(factory.updateJsxFragment, factoryDeprecation); - createJsxAttribute = deprecate(factory.createJsxAttribute, factoryDeprecation); - updateJsxAttribute = deprecate(factory.updateJsxAttribute, factoryDeprecation); - createJsxAttributes = deprecate(factory.createJsxAttributes, factoryDeprecation); - updateJsxAttributes = deprecate(factory.updateJsxAttributes, factoryDeprecation); - createJsxSpreadAttribute = deprecate(factory.createJsxSpreadAttribute, factoryDeprecation); - updateJsxSpreadAttribute = deprecate(factory.updateJsxSpreadAttribute, factoryDeprecation); - createJsxExpression = deprecate(factory.createJsxExpression, factoryDeprecation); - updateJsxExpression = deprecate(factory.updateJsxExpression, factoryDeprecation); - createCaseClause = deprecate(factory.createCaseClause, factoryDeprecation); - updateCaseClause = deprecate(factory.updateCaseClause, factoryDeprecation); - createDefaultClause = deprecate(factory.createDefaultClause, factoryDeprecation); - updateDefaultClause = deprecate(factory.updateDefaultClause, factoryDeprecation); - createHeritageClause = deprecate(factory.createHeritageClause, factoryDeprecation); - updateHeritageClause = deprecate(factory.updateHeritageClause, factoryDeprecation); - createCatchClause = deprecate(factory.createCatchClause, factoryDeprecation); - updateCatchClause = deprecate(factory.updateCatchClause, factoryDeprecation); - createPropertyAssignment = deprecate(factory.createPropertyAssignment, factoryDeprecation); - updatePropertyAssignment = deprecate(factory.updatePropertyAssignment, factoryDeprecation); - createShorthandPropertyAssignment = deprecate(factory.createShorthandPropertyAssignment, factoryDeprecation); - updateShorthandPropertyAssignment = deprecate(factory.updateShorthandPropertyAssignment, factoryDeprecation); - createSpreadAssignment = deprecate(factory.createSpreadAssignment, factoryDeprecation); - updateSpreadAssignment = deprecate(factory.updateSpreadAssignment, factoryDeprecation); - createEnumMember = deprecate(factory.createEnumMember, factoryDeprecation); - updateEnumMember = deprecate(factory.updateEnumMember, factoryDeprecation); - updateSourceFileNode = deprecate(factory.updateSourceFile, factoryDeprecation); - createNotEmittedStatement = deprecate(factory.createNotEmittedStatement, factoryDeprecation); - createPartiallyEmittedExpression = deprecate(factory.createPartiallyEmittedExpression, factoryDeprecation); - updatePartiallyEmittedExpression = deprecate(factory.updatePartiallyEmittedExpression, factoryDeprecation); - createCommaList = deprecate(factory.createCommaListExpression, factoryDeprecation); - updateCommaList = deprecate(factory.updateCommaListExpression, factoryDeprecation); - createBundle = deprecate(factory.createBundle, factoryDeprecation); - updateBundle = deprecate(factory.updateBundle, factoryDeprecation); - createImmediatelyInvokedFunctionExpression = deprecate(factory.createImmediatelyInvokedFunctionExpression, factoryDeprecation); - createImmediatelyInvokedArrowFunction = deprecate(factory.createImmediatelyInvokedArrowFunction, factoryDeprecation); - createVoidZero = deprecate(factory.createVoidZero, factoryDeprecation); - createExportDefault = deprecate(factory.createExportDefault, factoryDeprecation); - createExternalModuleExport = deprecate(factory.createExternalModuleExport, factoryDeprecation); - createNamespaceExport = deprecate(factory.createNamespaceExport, factoryDeprecation); - updateNamespaceExport = deprecate(factory.updateNamespaceExport, factoryDeprecation); - createToken = deprecate(function createToken2(kind) { - return factory.createToken(kind); - }, factoryDeprecation); - createIdentifier = deprecate(function createIdentifier2(text) { - return factory.createIdentifier( - text, - /*typeArguments*/ - void 0, - /*originalKeywordKind*/ - void 0 - ); - }, factoryDeprecation); - createTempVariable = deprecate(function createTempVariable2(recordTempVariable) { - return factory.createTempVariable( - recordTempVariable, - /*reserveInNestedScopes*/ - void 0 - ); - }, factoryDeprecation); - getGeneratedNameForNode = deprecate(function getGeneratedNameForNode2(node) { - return factory.getGeneratedNameForNode( - node, - /*flags*/ - void 0 - ); - }, factoryDeprecation); - createOptimisticUniqueName = deprecate(function createOptimisticUniqueName2(text) { - return factory.createUniqueName(text, 16 /* Optimistic */); - }, factoryDeprecation); - createFileLevelUniqueName = deprecate(function createFileLevelUniqueName2(text) { - return factory.createUniqueName(text, 16 /* Optimistic */ | 32 /* FileLevel */); - }, factoryDeprecation); - createIndexSignature = deprecate(function createIndexSignature2(decorators, modifiers, parameters, type) { - return factory.createIndexSignature(decorators, modifiers, parameters, type); - }, factoryDeprecation); - createTypePredicateNode = deprecate(function createTypePredicateNode2(parameterName, type) { - return factory.createTypePredicateNode( - /*assertsModifier*/ - void 0, - parameterName, - type - ); - }, factoryDeprecation); - updateTypePredicateNode = deprecate(function updateTypePredicateNode2(node, parameterName, type) { - return factory.updateTypePredicateNode( - node, - /*assertsModifier*/ - void 0, - parameterName, - type - ); - }, factoryDeprecation); - createLiteral = deprecate(function createLiteral2(value) { - if (typeof value === "number") { - return factory.createNumericLiteral(value); - } - if (typeof value === "object" && "base10Value" in value) { - return factory.createBigIntLiteral(value); - } - if (typeof value === "boolean") { - return value ? factory.createTrue() : factory.createFalse(); - } - if (typeof value === "string") { - return factory.createStringLiteral( - value, - /*isSingleQuote*/ - void 0 - ); - } - return factory.createStringLiteralFromNode(value); - }, { since: "4.0", warnAfter: "4.1", message: "Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead." }); - createMethodSignature = deprecate(function createMethodSignature2(typeParameters, parameters, type, name, questionToken) { - return factory.createMethodSignature( - /*modifiers*/ - void 0, - name, - questionToken, - typeParameters, - parameters, - type - ); - }, factoryDeprecation); - updateMethodSignature = deprecate(function updateMethodSignature2(node, typeParameters, parameters, type, name, questionToken) { - return factory.updateMethodSignature(node, node.modifiers, name, questionToken, typeParameters, parameters, type); - }, factoryDeprecation); - createTypeOperatorNode = deprecate(function createTypeOperatorNode2(operatorOrType, type) { - let operator; - if (type) { - operator = operatorOrType; - } else { - type = operatorOrType; - operator = 141 /* KeyOfKeyword */; - } - return factory.createTypeOperatorNode(operator, type); - }, factoryDeprecation); - createTaggedTemplate = deprecate(function createTaggedTemplate2(tag, typeArgumentsOrTemplate, template) { - let typeArguments; - if (template) { - typeArguments = typeArgumentsOrTemplate; - } else { - template = typeArgumentsOrTemplate; + addObjectAllocatorPatcher((objectAllocator2) => { + const Identifier73 = objectAllocator2.getIdentifierConstructor(); + if (!hasProperty(Identifier73.prototype, "originalKeywordKind")) { + Object.defineProperty(Identifier73.prototype, "originalKeywordKind", { + get: deprecate(function() { + return identifierToKeywordKind(this); + }, { + name: "originalKeywordKind", + since: "5.0", + warnAfter: "5.1", + errorAfter: "5.2", + message: "Use 'identifierToKeywordKind(identifier)' instead." + }) + }); } - return factory.createTaggedTemplateExpression(tag, typeArguments, template); - }, factoryDeprecation); - updateTaggedTemplate = deprecate(function updateTaggedTemplate2(node, tag, typeArgumentsOrTemplate, template) { - let typeArguments; - if (template) { - typeArguments = typeArgumentsOrTemplate; - } else { - template = typeArgumentsOrTemplate; - } - return factory.updateTaggedTemplateExpression(node, tag, typeArguments, template); - }, factoryDeprecation); - updateBinary = deprecate(function updateBinary2(node, left, right, operator = node.operatorToken) { - if (typeof operator === "number") { - operator = operator === node.operatorToken.kind ? node.operatorToken : factory.createToken(operator); - } - return factory.updateBinaryExpression(node, left, operator, right); - }, factoryDeprecation); - createConditional = deprecate(function createConditional2(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - return arguments.length === 5 ? factory.createConditionalExpression(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) : arguments.length === 3 ? factory.createConditionalExpression(condition, factory.createToken(57 /* QuestionToken */), questionTokenOrWhenTrue, factory.createToken(58 /* ColonToken */), whenTrueOrWhenFalse) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - createYield = deprecate(function createYield2(asteriskTokenOrExpression, expression) { - let asteriskToken; - if (expression) { - asteriskToken = asteriskTokenOrExpression; - } else { - expression = asteriskTokenOrExpression; + if (!hasProperty(Identifier73.prototype, "isInJSDocNamespace")) { + Object.defineProperty(Identifier73.prototype, "isInJSDocNamespace", { + get: deprecate(function() { + return this.flags & 2048 /* IdentifierIsInJSDocNamespace */ ? true : void 0; + }, { + name: "isInJSDocNamespace", + since: "5.0", + warnAfter: "5.1", + errorAfter: "5.2", + message: "Use '.parent' or the surrounding context to determine this instead." + }) + }); } - return factory.createYieldExpression(asteriskToken, expression); - }, factoryDeprecation); - createClassExpression = deprecate(function createClassExpression2(modifiers, name, typeParameters, heritageClauses, members) { - return factory.createClassExpression( - /*decorators*/ - void 0, - modifiers, - name, - typeParameters, - heritageClauses, - members - ); - }, factoryDeprecation); - updateClassExpression = deprecate(function updateClassExpression2(node, modifiers, name, typeParameters, heritageClauses, members) { - return factory.updateClassExpression( - node, - /*decorators*/ - void 0, - modifiers, - name, - typeParameters, - heritageClauses, - members - ); - }, factoryDeprecation); - createPropertySignature = deprecate(function createPropertySignature2(modifiers, name, questionToken, type, initializer) { - const node = factory.createPropertySignature(modifiers, name, questionToken, type); - node.initializer = initializer; - return node; - }, factoryDeprecation); - updatePropertySignature = deprecate(function updatePropertySignature2(node, modifiers, name, questionToken, type, initializer) { - let updated = factory.updatePropertySignature(node, modifiers, name, questionToken, type); - if (node.initializer !== initializer) { - if (updated === node) { - updated = factory.cloneNode(node); - } - updated.initializer = initializer; - } - return updated; - }, factoryDeprecation); - createExpressionWithTypeArguments = deprecate(function createExpressionWithTypeArguments2(typeArguments, expression) { - return factory.createExpressionWithTypeArguments(expression, typeArguments); - }, factoryDeprecation); - updateExpressionWithTypeArguments = deprecate(function updateExpressionWithTypeArguments2(node, typeArguments, expression) { - return factory.updateExpressionWithTypeArguments(node, expression, typeArguments); - }, factoryDeprecation); - createArrowFunction = deprecate(function createArrowFunction2(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) { - return arguments.length === 6 ? factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) : arguments.length === 5 ? factory.createArrowFunction( - modifiers, - typeParameters, - parameters, - type, - /*equalsGreaterThanToken*/ - void 0, - equalsGreaterThanTokenOrBody - ) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - updateArrowFunction = deprecate(function updateArrowFunction2(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) { - return arguments.length === 7 ? factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) : arguments.length === 6 ? factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, equalsGreaterThanTokenOrBody) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - createVariableDeclaration = deprecate(function createVariableDeclaration2(name, exclamationTokenOrType, typeOrInitializer, initializer) { - return arguments.length === 4 ? factory.createVariableDeclaration(name, exclamationTokenOrType, typeOrInitializer, initializer) : arguments.length >= 1 && arguments.length <= 3 ? factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - exclamationTokenOrType, - typeOrInitializer - ) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - updateVariableDeclaration = deprecate(function updateVariableDeclaration2(node, name, exclamationTokenOrType, typeOrInitializer, initializer) { - return arguments.length === 5 ? factory.updateVariableDeclaration(node, name, exclamationTokenOrType, typeOrInitializer, initializer) : arguments.length === 4 ? factory.updateVariableDeclaration(node, name, node.exclamationToken, exclamationTokenOrType, typeOrInitializer) : Debug.fail("Argument count mismatch"); - }, factoryDeprecation); - createImportClause = deprecate(function createImportClause2(name, namedBindings, isTypeOnly = false) { - return factory.createImportClause(isTypeOnly, name, namedBindings); - }, factoryDeprecation); - updateImportClause = deprecate(function updateImportClause2(node, name, namedBindings, isTypeOnly) { - return factory.updateImportClause(node, isTypeOnly, name, namedBindings); - }, factoryDeprecation); - createExportDeclaration = deprecate(function createExportDeclaration2(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly = false) { - return factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier); - }, factoryDeprecation); - updateExportDeclaration = deprecate(function updateExportDeclaration2(node, decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { - return factory.updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, node.assertClause); - }, factoryDeprecation); - createJSDocParamTag = deprecate(function createJSDocParamTag2(name, isBracketed, typeExpression, comment) { - return factory.createJSDocParameterTag( - /*tagName*/ - void 0, - name, - isBracketed, - typeExpression, - /*isNameFirst*/ - false, - comment ? factory.createNodeArray([factory.createJSDocText(comment)]) : void 0 - ); - }, factoryDeprecation); - createComma = deprecate(function createComma2(left, right) { - return factory.createComma(left, right); - }, factoryDeprecation); - createLessThan = deprecate(function createLessThan2(left, right) { - return factory.createLessThan(left, right); - }, factoryDeprecation); - createAssignment = deprecate(function createAssignment2(left, right) { - return factory.createAssignment(left, right); - }, factoryDeprecation); - createStrictEquality = deprecate(function createStrictEquality2(left, right) { - return factory.createStrictEquality(left, right); - }, factoryDeprecation); - createStrictInequality = deprecate(function createStrictInequality2(left, right) { - return factory.createStrictInequality(left, right); - }, factoryDeprecation); - createAdd = deprecate(function createAdd2(left, right) { - return factory.createAdd(left, right); - }, factoryDeprecation); - createSubtract = deprecate(function createSubtract2(left, right) { - return factory.createSubtract(left, right); - }, factoryDeprecation); - createLogicalAnd = deprecate(function createLogicalAnd2(left, right) { - return factory.createLogicalAnd(left, right); - }, factoryDeprecation); - createLogicalOr = deprecate(function createLogicalOr2(left, right) { - return factory.createLogicalOr(left, right); - }, factoryDeprecation); - createPostfixIncrement = deprecate(function createPostfixIncrement2(operand) { - return factory.createPostfixIncrement(operand); - }, factoryDeprecation); - createLogicalNot = deprecate(function createLogicalNot2(operand) { - return factory.createLogicalNot(operand); - }, factoryDeprecation); - createNode2 = deprecate(function createNode3(kind, pos = 0, end = 0) { - return setTextRangePosEnd( - kind === 308 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind), - pos, - end - ); - }, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory` method instead." }); - getMutableClone = deprecate(function getMutableClone2(node) { - const clone2 = factory.cloneNode(node); - setTextRange(clone2, node); - setParent(clone2, node.parent); - return clone2; - }, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`." }); - } - }); - - // src/deprecatedCompat/4.0/renamedNodeTests.ts - var isTypeAssertion; - var init_renamedNodeTests = __esm({ - "src/deprecatedCompat/4.0/renamedNodeTests.ts"() { - "use strict"; - init_ts5(); - init_deprecate(); - isTypeAssertion = deprecate(function isTypeAssertion2(node) { - return node.kind === 213 /* TypeAssertionExpression */; - }, { - since: "4.0", - warnAfter: "4.1", - message: "Use `isTypeAssertionExpression` instead." - }); - } - }); - - // src/deprecatedCompat/4.2/renamedNodeTests.ts - var isIdentifierOrPrivateIdentifier; - var init_renamedNodeTests2 = __esm({ - "src/deprecatedCompat/4.2/renamedNodeTests.ts"() { - "use strict"; - init_ts5(); - init_deprecate(); - isIdentifierOrPrivateIdentifier = deprecate(function isIdentifierOrPrivateIdentifier2(node) { - return isMemberName(node); - }, { - since: "4.2", - warnAfter: "4.3", - message: "Use `isMemberName` instead." }); } }); - // src/deprecatedCompat/4.2/abstractConstructorTypes.ts - function patchNodeFactory(factory2) { - const { - createConstructorTypeNode: createConstructorTypeNode2, - updateConstructorTypeNode: updateConstructorTypeNode2 - } = factory2; - factory2.createConstructorTypeNode = buildOverload("createConstructorTypeNode").overload({ - 0(modifiers, typeParameters, parameters, type) { - return createConstructorTypeNode2(modifiers, typeParameters, parameters, type); - }, - 1(typeParameters, parameters, type) { - return createConstructorTypeNode2( - /*modifiers*/ - void 0, - typeParameters, - parameters, - type - ); - } - }).bind({ - 0: (args) => args.length === 4, - 1: (args) => args.length === 3 - }).deprecate({ - 1: { since: "4.2", warnAfter: "4.3", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - factory2.updateConstructorTypeNode = buildOverload("updateConstructorTypeNode").overload({ - 0(node, modifiers, typeParameters, parameters, type) { - return updateConstructorTypeNode2(node, modifiers, typeParameters, parameters, type); - }, - 1(node, typeParameters, parameters, type) { - return updateConstructorTypeNode2(node, node.modifiers, typeParameters, parameters, type); - } - }).bind({ - 0: (args) => args.length === 5, - 1: (args) => args.length === 4 - }).deprecate({ - 1: { since: "4.2", warnAfter: "4.3", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - } - var init_abstractConstructorTypes = __esm({ - "src/deprecatedCompat/4.2/abstractConstructorTypes.ts"() { - "use strict"; - init_ts5(); - addNodeFactoryPatcher(patchNodeFactory); - patchNodeFactory(factory); - } - }); - - // src/deprecatedCompat/4.6/importTypeAssertions.ts - function patchNodeFactory2(factory2) { - const { - createImportTypeNode: createImportTypeNode2, - updateImportTypeNode: updateImportTypeNode2 - } = factory2; - factory2.createImportTypeNode = buildOverload("createImportTypeNode").overload({ - 0(argument, assertions, qualifier, typeArguments, isTypeOf) { - return createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf); - }, - 1(argument, qualifier, typeArguments, isTypeOf) { - return createImportTypeNode2( - argument, - /*assertions*/ - void 0, - qualifier, - typeArguments, - isTypeOf - ); - } - }).bind({ - 0: ([, assertions, qualifier, typeArguments, isTypeOf]) => (assertions === void 0 || isImportTypeAssertionContainer(assertions)) && (qualifier === void 0 || !isArray(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"), - 1: ([, qualifier, typeArguments, isTypeOf, other]) => other === void 0 && (qualifier === void 0 || isEntityName(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean") - }).deprecate({ - 1: { since: "4.6", warnAfter: "4.7", message: "Use the overload that accepts 'assertions'" } - }).finish(); - factory2.updateImportTypeNode = buildOverload("updateImportTypeNode").overload({ - 0(node, argument, assertions, qualifier, typeArguments, isTypeOf) { - return updateImportTypeNode2(node, argument, assertions, qualifier, typeArguments, isTypeOf); - }, - 1(node, argument, qualifier, typeArguments, isTypeOf) { - return updateImportTypeNode2(node, argument, node.assertions, qualifier, typeArguments, isTypeOf); - } - }).bind({ - 0: ([, , assertions, qualifier, typeArguments, isTypeOf]) => (assertions === void 0 || isImportTypeAssertionContainer(assertions)) && (qualifier === void 0 || !isArray(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"), - 1: ([, , qualifier, typeArguments, isTypeOf, other]) => other === void 0 && (qualifier === void 0 || isEntityName(qualifier)) && (typeArguments === void 0 || isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean") - }).deprecate({ - 1: { since: "4.6", warnAfter: "4.7", message: "Use the overload that accepts 'assertions'" } - }).finish(); - } - var init_importTypeAssertions = __esm({ - "src/deprecatedCompat/4.6/importTypeAssertions.ts"() { - "use strict"; - init_ts5(); - addNodeFactoryPatcher(patchNodeFactory2); - patchNodeFactory2(factory); - } - }); - - // src/deprecatedCompat/4.7/typeParameterModifiers.ts - function patchNodeFactory3(factory2) { - const { - createTypeParameterDeclaration: createTypeParameterDeclaration2, - updateTypeParameterDeclaration: updateTypeParameterDeclaration2 - } = factory2; - factory2.createTypeParameterDeclaration = buildOverload("createTypeParameterDeclaration").overload({ - 0(modifiers, name, constraint, defaultType) { - return createTypeParameterDeclaration2(modifiers, name, constraint, defaultType); - }, - 1(name, constraint, defaultType) { - return createTypeParameterDeclaration2( - /*modifiers*/ - void 0, - name, - constraint, - defaultType - ); - } - }).bind({ - 0: ([modifiers]) => modifiers === void 0 || isArray(modifiers), - 1: ([name]) => name !== void 0 && !isArray(name) - }).deprecate({ - 1: { since: "4.7", warnAfter: "4.8", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - factory2.updateTypeParameterDeclaration = buildOverload("updateTypeParameterDeclaration").overload({ - 0(node, modifiers, name, constraint, defaultType) { - return updateTypeParameterDeclaration2(node, modifiers, name, constraint, defaultType); - }, - 1(node, name, constraint, defaultType) { - return updateTypeParameterDeclaration2(node, node.modifiers, name, constraint, defaultType); - } - }).bind({ - 0: ([, modifiers]) => modifiers === void 0 || isArray(modifiers), - 1: ([, name]) => name !== void 0 && !isArray(name) - }).deprecate({ - 1: { since: "4.7", warnAfter: "4.8", message: "Use the overload that accepts 'modifiers'" } - }).finish(); - } - var init_typeParameterModifiers = __esm({ - "src/deprecatedCompat/4.7/typeParameterModifiers.ts"() { - "use strict"; - init_ts5(); - addNodeFactoryPatcher(patchNodeFactory3); - patchNodeFactory3(factory); - } - }); - - // src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts - function patchNodeFactory4(factory2) { - const { - createParameterDeclaration, - updateParameterDeclaration, - createPropertyDeclaration, - updatePropertyDeclaration: updatePropertyDeclaration2, - createMethodDeclaration, - updateMethodDeclaration, - createConstructorDeclaration, - updateConstructorDeclaration, - createGetAccessorDeclaration, - updateGetAccessorDeclaration, - createSetAccessorDeclaration, - updateSetAccessorDeclaration, - createIndexSignature: createIndexSignature3, - updateIndexSignature: updateIndexSignature2, - createClassStaticBlockDeclaration, - updateClassStaticBlockDeclaration, - createClassExpression: createClassExpression3, - updateClassExpression: updateClassExpression3, - createFunctionDeclaration: createFunctionDeclaration2, - updateFunctionDeclaration: updateFunctionDeclaration2, - createClassDeclaration: createClassDeclaration2, - updateClassDeclaration: updateClassDeclaration2, - createInterfaceDeclaration: createInterfaceDeclaration2, - updateInterfaceDeclaration: updateInterfaceDeclaration2, - createTypeAliasDeclaration: createTypeAliasDeclaration2, - updateTypeAliasDeclaration: updateTypeAliasDeclaration2, - createEnumDeclaration: createEnumDeclaration2, - updateEnumDeclaration: updateEnumDeclaration2, - createModuleDeclaration: createModuleDeclaration2, - updateModuleDeclaration: updateModuleDeclaration2, - createImportEqualsDeclaration: createImportEqualsDeclaration2, - updateImportEqualsDeclaration: updateImportEqualsDeclaration2, - createImportDeclaration: createImportDeclaration2, - updateImportDeclaration: updateImportDeclaration2, - createExportAssignment: createExportAssignment3, - updateExportAssignment: updateExportAssignment2, - createExportDeclaration: createExportDeclaration3, - updateExportDeclaration: updateExportDeclaration3 - } = factory2; - factory2.createParameterDeclaration = buildOverload("createParameterDeclaration").overload({ - 0(modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer); - }, - 1(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return createParameterDeclaration(concatenate(decorators, modifiers), dotDotDotToken, name, questionToken, type, initializer); - } - }).bind({ - 0: ([, dotDotDotToken, name, questionToken, type, initializer, other]) => other === void 0 && (dotDotDotToken === void 0 || !isArray(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, modifiers, dotDotDotToken, name, questionToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (dotDotDotToken === void 0 || typeof dotDotDotToken === "object" && isDotDotDotToken(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateParameterDeclaration = buildOverload("updateParameterDeclaration").overload({ - 0(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer); - }, - 1(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - return updateParameterDeclaration(node, concatenate(decorators, modifiers), dotDotDotToken, name, questionToken, type, initializer); - } - }).bind({ - 0: ([, , dotDotDotToken, name, questionToken, type, initializer, other]) => other === void 0 && (dotDotDotToken === void 0 || !isArray(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, , modifiers, dotDotDotToken, name, questionToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (dotDotDotToken === void 0 || typeof dotDotDotToken === "object" && isDotDotDotToken(dotDotDotToken)) && (name === void 0 || typeof name === "string" || isBindingName(name)) && (questionToken === void 0 || isQuestionToken(questionToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createPropertyDeclaration = buildOverload("createPropertyDeclaration").overload({ - 0(modifiers, name, questionOrExclamationToken, type, initializer) { - return createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer); - }, - 1(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - return createPropertyDeclaration(concatenate(decorators, modifiers), name, questionOrExclamationToken, type, initializer); - } - }).bind({ - 0: ([, name, questionOrExclamationToken, type, initializer, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (questionOrExclamationToken === void 0 || typeof questionOrExclamationToken === "object" && isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, modifiers, name, questionOrExclamationToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionOrExclamationToken === void 0 || isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updatePropertyDeclaration = buildOverload("updatePropertyDeclaration").overload({ - 0(node, modifiers, name, questionOrExclamationToken, type, initializer) { - return updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer); - }, - 1(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - return updatePropertyDeclaration2(node, concatenate(decorators, modifiers), name, questionOrExclamationToken, type, initializer); - } - }).bind({ - 0: ([, , name, questionOrExclamationToken, type, initializer, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (questionOrExclamationToken === void 0 || typeof questionOrExclamationToken === "object" && isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)), - 1: ([, , modifiers, name, questionOrExclamationToken, type, initializer]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionOrExclamationToken === void 0 || isQuestionOrExclamationToken(questionOrExclamationToken)) && (type === void 0 || isTypeNode(type)) && (initializer === void 0 || isExpression(initializer)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createMethodDeclaration = buildOverload("createMethodDeclaration").overload({ - 0(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body); - }, - 1(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return createMethodDeclaration(concatenate(decorators, modifiers), asteriskToken, name, questionToken, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, asteriskToken, name, questionToken, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || !some(parameters, isTypeParameterDeclaration)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken === "object" && isAsteriskToken(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || !isArray(questionToken)) && (typeParameters === void 0 || !some(typeParameters, isParameter)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateMethodDeclaration = buildOverload("updateMethodDeclaration").overload({ - 0(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return updateMethodDeclaration(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body); - }, - 1(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return updateMethodDeclaration(node, concatenate(decorators, modifiers), asteriskToken, name, questionToken, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, , asteriskToken, name, questionToken, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || typeof questionToken === "object" && isQuestionToken(questionToken)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || !some(parameters, isTypeParameterDeclaration)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken === "object" && isAsteriskToken(asteriskToken)) && (name === void 0 || typeof name === "string" || isPropertyName(name)) && (questionToken === void 0 || !isArray(questionToken)) && (typeParameters === void 0 || !some(typeParameters, isParameter)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createConstructorDeclaration = buildOverload("createConstructorDeclaration").overload({ - 0(modifiers, parameters, body) { - return createConstructorDeclaration(modifiers, parameters, body); - }, - 1(_decorators, modifiers, parameters, body) { - return createConstructorDeclaration(modifiers, parameters, body); - } - }).bind({ - 0: ([modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)), - 1: ([decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateConstructorDeclaration = buildOverload("updateConstructorDeclaration").overload({ - 0(node, modifiers, parameters, body) { - return updateConstructorDeclaration(node, modifiers, parameters, body); - }, - 1(node, _decorators, modifiers, parameters, body) { - return updateConstructorDeclaration(node, modifiers, parameters, body); - } - }).bind({ - 0: ([, modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)), - 1: ([, decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createGetAccessorDeclaration = buildOverload("createGetAccessorDeclaration").overload({ - 0(modifiers, name, parameters, type, body) { - return createGetAccessorDeclaration(modifiers, name, parameters, type, body); - }, - 1(decorators, modifiers, name, parameters, type, body) { - return createGetAccessorDeclaration(concatenate(decorators, modifiers), name, parameters, type, body); - } - }).bind({ - 0: ([, name, parameters, type, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, name, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateGetAccessorDeclaration = buildOverload("updateGetAccessorDeclaration").overload({ - 0(node, modifiers, name, parameters, type, body) { - return updateGetAccessorDeclaration(node, modifiers, name, parameters, type, body); - }, - 1(node, decorators, modifiers, name, parameters, type, body) { - return updateGetAccessorDeclaration(node, concatenate(decorators, modifiers), name, parameters, type, body); - } - }).bind({ - 0: ([, , name, parameters, type, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, name, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createSetAccessorDeclaration = buildOverload("createSetAccessorDeclaration").overload({ - 0(modifiers, name, parameters, body) { - return createSetAccessorDeclaration(modifiers, name, parameters, body); - }, - 1(decorators, modifiers, name, parameters, body) { - return createSetAccessorDeclaration(concatenate(decorators, modifiers), name, parameters, body); - } - }).bind({ - 0: ([, name, parameters, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || !isArray(body)), - 1: ([, modifiers, name, parameters, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateSetAccessorDeclaration = buildOverload("updateSetAccessorDeclaration").overload({ - 0(node, modifiers, name, parameters, body) { - return updateSetAccessorDeclaration(node, modifiers, name, parameters, body); - }, - 1(node, decorators, modifiers, name, parameters, body) { - return updateSetAccessorDeclaration(node, concatenate(decorators, modifiers), name, parameters, body); - } - }).bind({ - 0: ([, , name, parameters, body, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || !isArray(body)), - 1: ([, , modifiers, name, parameters, body]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createIndexSignature = buildOverload("createIndexSignature").overload({ - 0(modifiers, parameters, type) { - return createIndexSignature3(modifiers, parameters, type); - }, - 1(_decorators, modifiers, parameters, type) { - return createIndexSignature3(modifiers, parameters, type); - } - }).bind({ - 0: ([modifiers, parameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)), - 1: ([decorators, modifiers, parameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateIndexSignature = buildOverload("updateIndexSignature").overload({ - 0(node, modifiers, parameters, type) { - return updateIndexSignature2(node, modifiers, parameters, type); - }, - 1(node, _decorators, modifiers, parameters, type) { - return updateIndexSignature2(node, modifiers, parameters, type); - } - }).bind({ - 0: ([, modifiers, parameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)), - 1: ([, decorators, modifiers, parameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || every(modifiers, isModifier)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createClassStaticBlockDeclaration = buildOverload("createClassStaticBlockDeclaration").overload({ - 0(body) { - return createClassStaticBlockDeclaration(body); - }, - 1(_decorators, _modifiers, body) { - return createClassStaticBlockDeclaration(body); - } - }).bind({ - 0: ([body, other1, other2]) => other1 === void 0 && other2 === void 0 && (body === void 0 || !isArray(body)), - 1: ([decorators, modifiers, body]) => (decorators === void 0 || isArray(decorators)) && (modifiers === void 0 || isArray(decorators)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS_AND_MODIFIERS - }).finish(); - factory2.updateClassStaticBlockDeclaration = buildOverload("updateClassStaticBlockDeclaration").overload({ - 0(node, body) { - return updateClassStaticBlockDeclaration(node, body); - }, - 1(node, _decorators, _modifiers, body) { - return updateClassStaticBlockDeclaration(node, body); - } - }).bind({ - 0: ([, body, other1, other2]) => other1 === void 0 && other2 === void 0 && (body === void 0 || !isArray(body)), - 1: ([, decorators, modifiers, body]) => (decorators === void 0 || isArray(decorators)) && (modifiers === void 0 || isArray(decorators)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS_AND_MODIFIERS - }).finish(); - factory2.createClassExpression = buildOverload("createClassExpression").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createClassExpression3(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createClassExpression3(concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateClassExpression = buildOverload("updateClassExpression").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassExpression3(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassExpression3(node, concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, , name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, , modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createFunctionDeclaration = buildOverload("createFunctionDeclaration").overload({ - 0(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - }, - 1(_decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, asteriskToken, name, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || typeof name === "string" || isIdentifier(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, modifiers, asteriskToken, name, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken !== "string" && isAsteriskToken(asteriskToken)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateFunctionDeclaration = buildOverload("updateFunctionDeclaration").overload({ - 0(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body); - }, - 1(node, _decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return updateFunctionDeclaration2(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body); - } - }).bind({ - 0: ([, , asteriskToken, name, typeParameters, parameters, type, body, other]) => other === void 0 && (asteriskToken === void 0 || !isArray(asteriskToken)) && (name === void 0 || isIdentifier(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (parameters === void 0 || every(parameters, isParameter)) && (type === void 0 || !isArray(type)) && (body === void 0 || isBlock(body)), - 1: ([, , modifiers, asteriskToken, name, typeParameters, parameters, type, body]) => (modifiers === void 0 || isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken !== "string" && isAsteriskToken(asteriskToken)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (parameters === void 0 || isArray(parameters)) && (type === void 0 || isTypeNode(type)) && (body === void 0 || isBlock(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createClassDeclaration = buildOverload("createClassDeclaration").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createClassDeclaration2(concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: () => true - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.updateClassDeclaration = buildOverload("updateClassDeclaration").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateClassDeclaration2(node, concatenate(decorators, modifiers), name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, , name, typeParameters, heritageClauses, members, other]) => other === void 0 && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isClassElement)), - 1: ([, , modifiers, name, typeParameters, heritageClauses, members]) => (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: MUST_MERGE - }).finish(); - factory2.createInterfaceDeclaration = buildOverload("createInterfaceDeclaration").overload({ - 0(modifiers, name, typeParameters, heritageClauses, members) { - return createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - }, - 1(_decorators, modifiers, name, typeParameters, heritageClauses, members) { - return createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)), - 1: ([decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateInterfaceDeclaration = buildOverload("updateInterfaceDeclaration").overload({ - 0(node, modifiers, name, typeParameters, heritageClauses, members) { - return updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - }, - 1(node, _decorators, modifiers, name, typeParameters, heritageClauses, members) { - return updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members); - } - }).bind({ - 0: ([, modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)), - 1: ([, decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createTypeAliasDeclaration = buildOverload("createTypeAliasDeclaration").overload({ - 0(modifiers, name, typeParameters, type) { - return createTypeAliasDeclaration2(modifiers, name, typeParameters, type); - }, - 1(_decorators, modifiers, name, typeParameters, type) { - return createTypeAliasDeclaration2(modifiers, name, typeParameters, type); - } - }).bind({ - 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)), - 1: ([decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateTypeAliasDeclaration = buildOverload("updateTypeAliasDeclaration").overload({ - 0(node, modifiers, name, typeParameters, type) { - return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type); - }, - 1(node, _decorators, modifiers, name, typeParameters, type) { - return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type); - } - }).bind({ - 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)), - 1: ([, decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createEnumDeclaration = buildOverload("createEnumDeclaration").overload({ - 0(modifiers, name, members) { - return createEnumDeclaration2(modifiers, name, members); - }, - 1(_decorators, modifiers, name, members) { - return createEnumDeclaration2(modifiers, name, members); - } - }).bind({ - 0: ([modifiers, name, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)), - 1: ([decorators, modifiers, name, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateEnumDeclaration = buildOverload("updateEnumDeclaration").overload({ - 0(node, modifiers, name, members) { - return updateEnumDeclaration2(node, modifiers, name, members); - }, - 1(node, _decorators, modifiers, name, members) { - return updateEnumDeclaration2(node, modifiers, name, members); - } - }).bind({ - 0: ([, modifiers, name, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)), - 1: ([, decorators, modifiers, name, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (members === void 0 || isArray(members)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createModuleDeclaration = buildOverload("createModuleDeclaration").overload({ - 0(modifiers, name, body, flags) { - return createModuleDeclaration2(modifiers, name, body, flags); - }, - 1(_decorators, modifiers, name, body, flags) { - return createModuleDeclaration2(modifiers, name, body, flags); - } - }).bind({ - 0: ([modifiers, name, body, flags, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name !== void 0 && !isArray(name)) && (body === void 0 || isModuleBody(body)) && (flags === void 0 || typeof flags === "number"), - 1: ([decorators, modifiers, name, body, flags]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name !== void 0 && isModuleName(name)) && (body === void 0 || typeof body === "object") && (flags === void 0 || typeof flags === "number") - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateModuleDeclaration = buildOverload("updateModuleDeclaration").overload({ - 0(node, modifiers, name, body) { - return updateModuleDeclaration2(node, modifiers, name, body); - }, - 1(node, _decorators, modifiers, name, body) { - return updateModuleDeclaration2(node, modifiers, name, body); - } - }).bind({ - 0: ([, modifiers, name, body, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (body === void 0 || isModuleBody(body)), - 1: ([, decorators, modifiers, name, body]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name !== void 0 && isModuleName(name)) && (body === void 0 || isModuleBody(body)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createImportEqualsDeclaration = buildOverload("createImportEqualsDeclaration").overload({ - 0(modifiers, isTypeOnly, name, moduleReference) { - return createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference); - }, - 1(_decorators, modifiers, isTypeOnly, name, moduleReference) { - return createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference); - } - }).bind({ - 0: ([modifiers, isTypeOnly, name, moduleReference, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && typeof name !== "boolean" && typeof moduleReference !== "string", - 1: ([decorators, modifiers, isTypeOnly, name, moduleReference]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && (typeof name === "string" || isIdentifier(name)) && (moduleReference !== void 0 && isModuleReference(moduleReference)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateImportEqualsDeclaration = buildOverload("updateImportEqualsDeclaration").overload({ - 0(node, modifiers, isTypeOnly, name, moduleReference) { - return updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference); - }, - 1(node, _decorators, modifiers, isTypeOnly, name, moduleReference) { - return updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference); - } - }).bind({ - 0: ([, modifiers, isTypeOnly, name, moduleReference, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && typeof name !== "boolean" && typeof moduleReference !== "string", - 1: ([, decorators, modifiers, isTypeOnly, name, moduleReference]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && (typeof name === "string" || isIdentifier(name)) && (moduleReference !== void 0 && isModuleReference(moduleReference)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createImportDeclaration = buildOverload("createImportDeclaration").overload({ - 0(modifiers, importClause, moduleSpecifier, assertClause) { - return createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause); - }, - 1(_decorators, modifiers, importClause, moduleSpecifier, assertClause) { - return createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([modifiers, importClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (importClause === void 0 || !isArray(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (importClause === void 0 || isImportClause(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateImportDeclaration = buildOverload("updateImportDeclaration").overload({ - 0(node, modifiers, importClause, moduleSpecifier, assertClause) { - return updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause); - }, - 1(node, _decorators, modifiers, importClause, moduleSpecifier, assertClause) { - return updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (importClause === void 0 || !isArray(importClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (importClause === void 0 || isImportClause(importClause)) && (moduleSpecifier !== void 0 && isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createExportAssignment = buildOverload("createExportAssignment").overload({ - 0(modifiers, isExportEquals, expression) { - return createExportAssignment3(modifiers, isExportEquals, expression); - }, - 1(_decorators, modifiers, isExportEquals, expression) { - return createExportAssignment3(modifiers, isExportEquals, expression); - } - }).bind({ - 0: ([modifiers, isExportEquals, expression, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (isExportEquals === void 0 || typeof isExportEquals === "boolean") && typeof expression === "object", - 1: ([decorators, modifiers, isExportEquals, expression]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (isExportEquals === void 0 || typeof isExportEquals === "boolean") && (expression !== void 0 && isExpression(expression)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateExportAssignment = buildOverload("updateExportAssignment").overload({ - 0(node, modifiers, expression) { - return updateExportAssignment2(node, modifiers, expression); - }, - 1(node, _decorators, modifiers, expression) { - return updateExportAssignment2(node, modifiers, expression); - } - }).bind({ - 0: ([, modifiers, expression, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (expression !== void 0 && !isArray(expression)), - 1: ([, decorators, modifiers, expression]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (expression !== void 0 && isExpression(expression)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.createExportDeclaration = buildOverload("createExportDeclaration").overload({ - 0(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - }, - 1(_decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && typeof isTypeOnly === "boolean" && typeof exportClause !== "boolean" && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && typeof isTypeOnly === "boolean" && (exportClause === void 0 || isNamedExportBindings(exportClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - factory2.updateExportDeclaration = buildOverload("updateExportDeclaration").overload({ - 0(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - }, - 1(node, _decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - } - }).bind({ - 0: ([, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && typeof isTypeOnly === "boolean" && typeof exportClause !== "boolean" && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)), - 1: ([, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && typeof isTypeOnly === "boolean" && (exportClause === void 0 || isNamedExportBindings(exportClause)) && (moduleSpecifier === void 0 || isExpression(moduleSpecifier)) && (assertClause === void 0 || isAssertClause(assertClause)) - }).deprecate({ - 1: DISALLOW_DECORATORS - }).finish(); - } - var MUST_MERGE, DISALLOW_DECORATORS, DISALLOW_DECORATORS_AND_MODIFIERS; - var init_mergeDecoratorsAndModifiers = __esm({ - "src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts"() { - "use strict"; - init_ts5(); - MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload that does not accept a 'decorators' parameter." }; - DISALLOW_DECORATORS = { since: "4.8", warnAfter: "4.9.0-0", message: `Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter.` }; - DISALLOW_DECORATORS_AND_MODIFIERS = { since: "4.8", warnAfter: "4.9.0-0", message: `Decorators and modifiers are no longer supported for this function. Callers should switch to an overload that does not accept the 'decorators' and 'modifiers' parameters.` }; - addNodeFactoryPatcher(patchNodeFactory4); - patchNodeFactory4(factory); - } - }); - // src/deprecatedCompat/_namespaces/ts.ts var init_ts5 = __esm({ "src/deprecatedCompat/_namespaces/ts.ts"() { "use strict"; init_ts2(); init_deprecations(); - init_nodeFactoryTopLevelExports(); - init_renamedNodeTests(); - init_renamedNodeTests2(); - init_abstractConstructorTypes(); - init_importTypeAssertions(); - init_typeParameterModifiers(); - init_mergeDecoratorsAndModifiers(); + init_identifierProperties(); } }); @@ -164192,6 +166588,7 @@ ${options.prefix}` : "\n" : options.prefix InferencePriority: () => InferencePriority, InlayHintKind: () => InlayHintKind, InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, InternalSymbolName: () => InternalSymbolName, InvalidatedProjectKind: () => InvalidatedProjectKind, JsDoc: () => ts_JsDoc_exports, @@ -164235,7 +166632,7 @@ ${options.prefix}` : "\n" : options.prefix PollingInterval: () => PollingInterval, PollingWatchKind: () => PollingWatchKind, PragmaKindFlags: () => PragmaKindFlags, - PrivateIdentifierKind: () => PrivateIdentifierKind2, + PrivateIdentifierKind: () => PrivateIdentifierKind, ProcessLevel: () => ProcessLevel, QuotePreference: () => QuotePreference, RelationComparisonResult: () => RelationComparisonResult, @@ -164285,10 +166682,13 @@ ${options.prefix}` : "\n" : options.prefix WatchFileKind: () => WatchFileKind, WatchLogLevel: () => WatchLogLevel, WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, addEmitFlags: () => addEmitFlags, addEmitHelper: () => addEmitHelper, addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, addRange: () => addRange, addRelatedInfo: () => addRelatedInfo, addSyntheticLeadingComment: () => addSyntheticLeadingComment, @@ -164359,6 +166759,7 @@ ${options.prefix}` : "\n" : options.prefix changesAffectModuleResolution: () => changesAffectModuleResolution, changesAffectingProgramStructure: () => changesAffectingProgramStructure, childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, classPrivateFieldInHelper: () => classPrivateFieldInHelper, @@ -164407,6 +166808,7 @@ ${options.prefix}` : "\n" : options.prefix compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, computeLineOfPosition: () => computeLineOfPosition, @@ -164424,7 +166826,6 @@ ${options.prefix}` : "\n" : options.prefix containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, - convertEnableAutoDiscoveryToEnable: () => convertEnableAutoDiscoveryToEnable, convertJsonOption: () => convertJsonOption, convertToBase64: () => convertToBase64, convertToObject: () => convertToObject, @@ -164445,41 +166846,17 @@ ${options.prefix}` : "\n" : options.prefix createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, - createAdd: () => createAdd, - createArrayBindingPattern: () => createArrayBindingPattern, - createArrayLiteral: () => createArrayLiteral, - createArrayTypeNode: () => createArrayTypeNode, - createArrowFunction: () => createArrowFunction, - createAsExpression: () => createAsExpression, - createAssignment: () => createAssignment, - createAwait: () => createAwait, createBaseNodeFactory: () => createBaseNodeFactory, - createBigIntLiteral: () => createBigIntLiteral, - createBinary: () => createBinary, createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, - createBindingElement: () => createBindingElement, createBindingHelper: () => createBindingHelper, - createBlock: () => createBlock, - createBreak: () => createBreak, createBuildInfo: () => createBuildInfo, createBuilderProgram: () => createBuilderProgram, createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, createBuilderStatusReporter: () => createBuilderStatusReporter, - createBundle: () => createBundle, createCacheWithRedirects: () => createCacheWithRedirects, createCacheableExportInfoMap: () => createCacheableExportInfoMap, createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, - createCall: () => createCall, - createCallChain: () => createCallChain, - createCallSignature: () => createCallSignature, - createCaseBlock: () => createCaseBlock, - createCaseClause: () => createCaseClause, - createCatchClause: () => createCatchClause, - createClassDeclaration: () => createClassDeclaration, - createClassExpression: () => createClassExpression, createClassifier: () => createClassifier, - createComma: () => createComma, - createCommaList: () => createCommaList, createCommentDirectivesMap: () => createCommentDirectivesMap, createCompilerDiagnostic: () => createCompilerDiagnostic, createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, @@ -164487,212 +166864,73 @@ ${options.prefix}` : "\n" : options.prefix createCompilerHost: () => createCompilerHost, createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, createCompilerHostWorker: () => createCompilerHostWorker, - createComputedPropertyName: () => createComputedPropertyName, - createConditional: () => createConditional, - createConditionalTypeNode: () => createConditionalTypeNode, - createConstructSignature: () => createConstructSignature, - createConstructor: () => createConstructor, - createConstructorTypeNode: () => createConstructorTypeNode, - createContinue: () => createContinue, - createDebuggerStatement: () => createDebuggerStatement, - createDecorator: () => createDecorator, - createDefaultClause: () => createDefaultClause, - createDelete: () => createDelete, createDetachedDiagnostic: () => createDetachedDiagnostic, createDiagnosticCollection: () => createDiagnosticCollection, createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, createDiagnosticForNode: () => createDiagnosticForNode, createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, createDiagnosticForRange: () => createDiagnosticForRange, createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, createDiagnosticReporter: () => createDiagnosticReporter, - createDo: () => createDo, createDocumentPositionMapper: () => createDocumentPositionMapper, createDocumentRegistry: () => createDocumentRegistry, createDocumentRegistryInternal: () => createDocumentRegistryInternal, - createElementAccess: () => createElementAccess, - createElementAccessChain: () => createElementAccessChain, createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, createEmitHelperFactory: () => createEmitHelperFactory, createEmptyExports: () => createEmptyExports, - createEmptyStatement: () => createEmptyStatement, - createEnumDeclaration: () => createEnumDeclaration, - createEnumMember: () => createEnumMember, - createExportAssignment: () => createExportAssignment2, - createExportDeclaration: () => createExportDeclaration, - createExportDefault: () => createExportDefault, - createExportSpecifier: () => createExportSpecifier, createExpressionForJsxElement: () => createExpressionForJsxElement, createExpressionForJsxFragment: () => createExpressionForJsxFragment, createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, createExpressionForPropertyName: () => createExpressionForPropertyName, createExpressionFromEntityName: () => createExpressionFromEntityName, - createExpressionStatement: () => createExpressionStatement, - createExpressionWithTypeArguments: () => createExpressionWithTypeArguments, createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createExternalModuleExport: () => createExternalModuleExport, - createExternalModuleReference: () => createExternalModuleReference, - createFalse: () => createFalse, createFileDiagnostic: () => createFileDiagnostic, createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createFileLevelUniqueName: () => createFileLevelUniqueName, - createFor: () => createFor, - createForIn: () => createForIn, - createForOf: () => createForOf, createForOfBindingStatement: () => createForOfBindingStatement, - createFunctionDeclaration: () => createFunctionDeclaration, - createFunctionExpression: () => createFunctionExpression, - createFunctionTypeNode: () => createFunctionTypeNode, - createGetAccessor: () => createGetAccessor, createGetCanonicalFileName: () => createGetCanonicalFileName, createGetSourceFile: () => createGetSourceFile, createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, createGetSymbolWalker: () => createGetSymbolWalker, - createHeritageClause: () => createHeritageClause, - createIdentifier: () => createIdentifier, - createIf: () => createIf, - createImmediatelyInvokedArrowFunction: () => createImmediatelyInvokedArrowFunction, - createImmediatelyInvokedFunctionExpression: () => createImmediatelyInvokedFunctionExpression, - createImportClause: () => createImportClause, - createImportDeclaration: () => createImportDeclaration, - createImportEqualsDeclaration: () => createImportEqualsDeclaration, - createImportSpecifier: () => createImportSpecifier, - createImportTypeNode: () => createImportTypeNode, createIncrementalCompilerHost: () => createIncrementalCompilerHost, createIncrementalProgram: () => createIncrementalProgram, - createIndexSignature: () => createIndexSignature, - createIndexedAccessTypeNode: () => createIndexedAccessTypeNode, - createInferTypeNode: () => createInferTypeNode, createInputFiles: () => createInputFiles, createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, - createInterfaceDeclaration: () => createInterfaceDeclaration, - createIntersectionTypeNode: () => createIntersectionTypeNode, - createJSDocAugmentsTag: () => createJSDocAugmentsTag, - createJSDocAuthorTag: () => createJSDocAuthorTag, - createJSDocCallbackTag: () => createJSDocCallbackTag, - createJSDocClassTag: () => createJSDocClassTag, - createJSDocComment: () => createJSDocComment, - createJSDocEnumTag: () => createJSDocEnumTag, - createJSDocImplementsTag: () => createJSDocImplementsTag, - createJSDocParamTag: () => createJSDocParamTag, - createJSDocParameterTag: () => createJSDocParameterTag, - createJSDocPrivateTag: () => createJSDocPrivateTag, - createJSDocPropertyTag: () => createJSDocPropertyTag, - createJSDocProtectedTag: () => createJSDocProtectedTag, - createJSDocPublicTag: () => createJSDocPublicTag, - createJSDocReadonlyTag: () => createJSDocReadonlyTag, - createJSDocReturnTag: () => createJSDocReturnTag, - createJSDocSignature: () => createJSDocSignature, - createJSDocTag: () => createJSDocTag, - createJSDocTemplateTag: () => createJSDocTemplateTag, - createJSDocThisTag: () => createJSDocThisTag, - createJSDocTypeExpression: () => createJSDocTypeExpression, - createJSDocTypeLiteral: () => createJSDocTypeLiteral, - createJSDocTypeTag: () => createJSDocTypeTag, - createJSDocTypedefTag: () => createJSDocTypedefTag, - createJsxAttribute: () => createJsxAttribute, - createJsxAttributes: () => createJsxAttributes, - createJsxClosingElement: () => createJsxClosingElement, - createJsxElement: () => createJsxElement, - createJsxExpression: () => createJsxExpression, createJsxFactoryExpression: () => createJsxFactoryExpression, - createJsxFragment: () => createJsxFragment, - createJsxJsxClosingFragment: () => createJsxJsxClosingFragment, - createJsxOpeningElement: () => createJsxOpeningElement, - createJsxOpeningFragment: () => createJsxOpeningFragment, - createJsxSelfClosingElement: () => createJsxSelfClosingElement, - createJsxSpreadAttribute: () => createJsxSpreadAttribute, - createJsxText: () => createJsxText, - createKeywordTypeNode: () => createKeywordTypeNode, - createLabel: () => createLabel, createLanguageService: () => createLanguageService, createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createLessThan: () => createLessThan, - createLiteral: () => createLiteral, - createLiteralTypeNode: () => createLiteralTypeNode, - createLogicalAnd: () => createLogicalAnd, - createLogicalNot: () => createLogicalNot, - createLogicalOr: () => createLogicalOr, - createLoopVariable: () => createLoopVariable, - createMappedTypeNode: () => createMappedTypeNode, createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createMetaProperty: () => createMetaProperty, - createMethod: () => createMethod, - createMethodSignature: () => createMethodSignature, createModeAwareCache: () => createModeAwareCache, createModeAwareCacheKey: () => createModeAwareCacheKey, - createModifier: () => createModifier, - createModifiersFromModifierFlags: () => createModifiersFromModifierFlags, - createModuleBlock: () => createModuleBlock, - createModuleDeclaration: () => createModuleDeclaration, createModuleResolutionCache: () => createModuleResolutionCache, createModuleResolutionLoader: () => createModuleResolutionLoader, createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, createMultiMap: () => createMultiMap, - createNamedExports: () => createNamedExports, - createNamedImports: () => createNamedImports, - createNamespaceExport: () => createNamespaceExport, - createNamespaceExportDeclaration: () => createNamespaceExportDeclaration, - createNamespaceImport: () => createNamespaceImport, - createNew: () => createNew, - createNoSubstitutionTemplateLiteral: () => createNoSubstitutionTemplateLiteral, - createNode: () => createNode2, - createNodeArray: () => createNodeArray, createNodeConverters: () => createNodeConverters, createNodeFactory: () => createNodeFactory, - createNonNullChain: () => createNonNullChain, - createNonNullExpression: () => createNonNullExpression, - createNotEmittedStatement: () => createNotEmittedStatement, - createNull: () => createNull, - createNumericLiteral: () => createNumericLiteral, - createObjectBindingPattern: () => createObjectBindingPattern, - createObjectLiteral: () => createObjectLiteral, - createOmittedExpression: () => createOmittedExpression, - createOptimisticUniqueName: () => createOptimisticUniqueName, createOptionNameMap: () => createOptionNameMap, - createOptionalTypeNode: () => createOptionalTypeNode, createOverload: () => createOverload, createPackageJsonImportFilter: () => createPackageJsonImportFilter, createPackageJsonInfo: () => createPackageJsonInfo, - createParameter: () => createParameter, - createParen: () => createParen, - createParenthesizedType: () => createParenthesizedType, createParenthesizerRules: () => createParenthesizerRules, - createPartiallyEmittedExpression: () => createPartiallyEmittedExpression, createPatternMatcher: () => createPatternMatcher, - createPostfix: () => createPostfix, - createPostfixIncrement: () => createPostfixIncrement, - createPrefix: () => createPrefix, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, - createPrivateIdentifier: () => createPrivateIdentifier, createProgram: () => createProgram, createProgramHost: () => createProgramHost, - createProperty: () => createProperty, - createPropertyAccess: () => createPropertyAccess, - createPropertyAccessChain: () => createPropertyAccessChain, - createPropertyAssignment: () => createPropertyAssignment, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, - createPropertySignature: () => createPropertySignature, - createQualifiedName: () => createQualifiedName, createQueue: () => createQueue, createRange: () => createRange, createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, - createRegularExpressionLiteral: () => createRegularExpressionLiteral, createResolutionCache: () => createResolutionCache, - createRestTypeNode: () => createRestTypeNode, - createReturn: () => createReturn, createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, createScanner: () => createScanner, createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, - createSemicolonClassElement: () => createSemicolonClassElement, createSet: () => createSet, - createSetAccessor: () => createSetAccessor, - createShorthandPropertyAssignment: () => createShorthandPropertyAssignment, createSolutionBuilder: () => createSolutionBuilder, createSolutionBuilderHost: () => createSolutionBuilderHost, createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, @@ -164701,27 +166939,10 @@ ${options.prefix}` : "\n" : options.prefix createSourceFile: () => createSourceFile, createSourceMapGenerator: () => createSourceMapGenerator, createSourceMapSource: () => createSourceMapSource, - createSpread: () => createSpread, - createSpreadAssignment: () => createSpreadAssignment, - createStatement: () => createStatement, - createStrictEquality: () => createStrictEquality, - createStrictInequality: () => createStrictInequality, - createStringLiteral: () => createStringLiteral, - createStringLiteralFromNode: () => createStringLiteralFromNode, - createSubtract: () => createSubtract, - createSuper: () => createSuper, createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, - createSwitch: () => createSwitch, createSymbolTable: () => createSymbolTable, createSymlinkCache: () => createSymlinkCache, createSystemWatchFunctions: () => createSystemWatchFunctions, - createTaggedTemplate: () => createTaggedTemplate, - createTempVariable: () => createTempVariable, - createTemplateExpression: () => createTemplateExpression, - createTemplateHead: () => createTemplateHead, - createTemplateMiddle: () => createTemplateMiddle, - createTemplateSpan: () => createTemplateSpan, - createTemplateTail: () => createTemplateTail, createTextChange: () => createTextChange, createTextChangeFromStartLength: () => createTextChangeFromStartLength, createTextChangeRange: () => createTextChangeRange, @@ -164733,36 +166954,12 @@ ${options.prefix}` : "\n" : options.prefix createTextSpanFromRange: () => createTextSpanFromRange, createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, createTextWriter: () => createTextWriter, - createThis: () => createThis, - createThisTypeNode: () => createThisTypeNode, - createThrow: () => createThrow, - createToken: () => createToken, createTokenRange: () => createTokenRange, - createTrue: () => createTrue, - createTry: () => createTry, - createTupleTypeNode: () => createTupleTypeNode, - createTypeAliasDeclaration: () => createTypeAliasDeclaration, - createTypeAssertion: () => createTypeAssertion, createTypeChecker: () => createTypeChecker, - createTypeLiteralNode: () => createTypeLiteralNode, - createTypeOf: () => createTypeOf, - createTypeOperatorNode: () => createTypeOperatorNode, - createTypeParameterDeclaration: () => createTypeParameterDeclaration, - createTypePredicateNode: () => createTypePredicateNode, - createTypePredicateNodeWithModifier: () => createTypePredicateNodeWithModifier, - createTypeQueryNode: () => createTypeQueryNode, createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, - createTypeReferenceNode: () => createTypeReferenceNode, createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap, - createUnionTypeNode: () => createUnionTypeNode, - createUniqueName: () => createUniqueName, createUnparsedSourceFile: () => createUnparsedSourceFile, - createVariableDeclaration: () => createVariableDeclaration, - createVariableDeclarationList: () => createVariableDeclarationList, - createVariableStatement: () => createVariableStatement, - createVoid: () => createVoid, - createVoidZero: () => createVoidZero, createWatchCompilerHost: () => createWatchCompilerHost2, createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, @@ -164770,10 +166967,7 @@ ${options.prefix}` : "\n" : options.prefix createWatchHost: () => createWatchHost, createWatchProgram: () => createWatchProgram, createWatchStatusReporter: () => createWatchStatusReporter, - createWhile: () => createWhile, - createWith: () => createWith, createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - createYield: () => createYield, declarationNameToString: () => declarationNameToString, decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, @@ -164820,6 +167014,7 @@ ${options.prefix}` : "\n" : options.prefix equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, equateStringsCaseSensitive: () => equateStringsCaseSensitive, equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, escapeJsxAttributeString: () => escapeJsxAttributeString, escapeLeadingUnderscores: () => escapeLeadingUnderscores, escapeNonAsciiString: () => escapeNonAsciiString, @@ -164848,6 +167043,7 @@ ${options.prefix}` : "\n" : options.prefix findAncestor: () => findAncestor, findBestPatternMatch: () => findBestPatternMatch, findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, findConfigFile: () => findConfigFile, findContainingList: () => findContainingList, findDiagnosticForNode: () => findDiagnosticForNode, @@ -164878,6 +167074,7 @@ ${options.prefix}` : "\n" : options.prefix flatMapIterator: () => flatMapIterator, flatMapToMutable: () => flatMapToMutable, flatten: () => flatten, + flattenCommaList: () => flattenCommaList, flattenDestructuringAssignment: () => flattenDestructuringAssignment, flattenDestructuringBinding: () => flattenDestructuringBinding, flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, @@ -164983,6 +167180,7 @@ ${options.prefix}` : "\n" : options.prefix getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, getDecorators: () => getDecorators, getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, getDefaultLibFileName: () => getDefaultLibFileName, getDefaultLibFilePath: () => getDefaultLibFilePath, @@ -165054,9 +167252,11 @@ ${options.prefix}` : "\n" : options.prefix getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, getFullWidth: () => getFullWidth, getFunctionFlags: () => getFunctionFlags, - getGeneratedNameForNode: () => getGeneratedNameForNode, getHeritageClause: () => getHeritageClause, getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, @@ -165068,7 +167268,9 @@ ${options.prefix}` : "\n" : options.prefix getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, getJSDocAugmentsTag: () => getJSDocAugmentsTag, getJSDocClassTag: () => getJSDocClassTag, getJSDocCommentRanges: () => getJSDocCommentRanges, @@ -165092,6 +167294,8 @@ ${options.prefix}` : "\n" : options.prefix getJSDocReturnTag: () => getJSDocReturnTag, getJSDocReturnType: () => getJSDocReturnType, getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, getJSDocTags: () => getJSDocTags, getJSDocTagsNoCache: () => getJSDocTagsNoCache, getJSDocTemplateTag: () => getJSDocTemplateTag, @@ -165146,7 +167350,6 @@ ${options.prefix}` : "\n" : options.prefix getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, - getMutableClone: () => getMutableClone, getNameForExportedSymbol: () => getNameForExportedSymbol, getNameFromIndexInfo: () => getNameFromIndexInfo, getNameFromPropertyName: () => getNameFromPropertyName, @@ -165220,6 +167423,7 @@ ${options.prefix}` : "\n" : options.prefix getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, getPreEmitDiagnostics: () => getPreEmitDiagnostics, getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, getProperties: () => getProperties, getProperty: () => getProperty, getPropertyArrayElementValue: () => getPropertyArrayElementValue, @@ -165345,6 +167549,7 @@ ${options.prefix}` : "\n" : options.prefix getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, getWatchFactory: () => getWatchFactory, group: () => group, + groupBy: () => groupBy, guessIndentation: () => guessIndentation, handleNoEmitOptions: () => handleNoEmitOptions, hasAbstractModifier: () => hasAbstractModifier, @@ -165390,12 +167595,14 @@ ${options.prefix}` : "\n" : options.prefix hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, idText: () => idText, identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, identity: () => identity, identitySourceMapConsumer: () => identitySourceMapConsumer, ignoreSourceNewlines: () => ignoreSourceNewlines, ignoredPaths: () => ignoredPaths, importDefaultHelper: () => importDefaultHelper, importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, importStarHelper: () => importStarHelper, indexOfAnyCharCode: () => indexOfAnyCharCode, indexOfNode: () => indexOfNode, @@ -165421,6 +167628,7 @@ ${options.prefix}` : "\n" : options.prefix isAliasableExpression: () => isAliasableExpression, isAmbientModule: () => isAmbientModule, isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, isAnyDirectorySeparator: () => isAnyDirectorySeparator, isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, isAnyImportOrReExport: () => isAnyImportOrReExport, @@ -165430,6 +167638,7 @@ ${options.prefix}` : "\n" : options.prefix isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, isArray: () => isArray, isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, isArrayBindingPattern: () => isArrayBindingPattern, isArrayLiteralExpression: () => isArrayLiteralExpression, @@ -165461,7 +167670,9 @@ ${options.prefix}` : "\n" : options.prefix isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, isBindableStaticNameExpression: () => isBindableStaticNameExpression, isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, isBindingPattern: () => isBindingPattern, isBlock: () => isBlock, @@ -165502,6 +167713,7 @@ ${options.prefix}` : "\n" : options.prefix isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, isCollapsedRange: () => isCollapsedRange, isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, isCommaListExpression: () => isCommaListExpression, isCommaSequence: () => isCommaSequence, isCommaToken: () => isCommaToken, @@ -165535,6 +167747,7 @@ ${options.prefix}` : "\n" : options.prefix isDecoratorTarget: () => isDecoratorTarget, isDefaultClause: () => isDefaultClause, isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, isDeleteExpression: () => isDeleteExpression, isDeleteTarget: () => isDeleteTarget, @@ -165558,6 +167771,7 @@ ${options.prefix}` : "\n" : options.prefix isEmptyBindingPattern: () => isEmptyBindingPattern, isEmptyObjectLiteral: () => isEmptyObjectLiteral, isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, isEndOfDeclarationMarker: () => isEndOfDeclarationMarker, isEntityName: () => isEntityName, isEntityNameExpression: () => isEntityNameExpression, @@ -165574,6 +167788,7 @@ ${options.prefix}` : "\n" : options.prefix isExportModifier: () => isExportModifier, isExportName: () => isExportName, isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, isExportSpecifier: () => isExportSpecifier, isExportsIdentifier: () => isExportsIdentifier, isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, @@ -165628,7 +167843,6 @@ ${options.prefix}` : "\n" : options.prefix isIdentifier: () => isIdentifier, isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, isIdentifierName: () => isIdentifierName, - isIdentifierOrPrivateIdentifier: () => isIdentifierOrPrivateIdentifier, isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, isIdentifierPart: () => isIdentifierPart, isIdentifierStart: () => isIdentifierStart, @@ -165668,6 +167882,7 @@ ${options.prefix}` : "\n" : options.prefix isInferTypeNode: () => isInferTypeNode, isInfinityOrNaNString: () => isInfinityOrNaNString, isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, isInsideJsxElement: () => isInsideJsxElement, isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, isInsideNodeModules: () => isInsideNodeModules, @@ -165717,6 +167932,8 @@ ${options.prefix}` : "\n" : options.prefix isJSDocPublicTag: () => isJSDocPublicTag, isJSDocReadonlyTag: () => isJSDocReadonlyTag, isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, isJSDocSeeTag: () => isJSDocSeeTag, isJSDocSignature: () => isJSDocSignature, isJSDocTag: () => isJSDocTag, @@ -165772,11 +167989,14 @@ ${options.prefix}` : "\n" : options.prefix isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, isLiteralTypeNode: () => isLiteralTypeNode, isLocalName: () => isLocalName, isLogicalOperator: () => isLogicalOperator, isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, isMappedTypeNode: () => isMappedTypeNode, isMemberName: () => isMemberName, isMergeDeclarationMarker: () => isMergeDeclarationMarker, @@ -165804,6 +168024,8 @@ ${options.prefix}` : "\n" : options.prefix isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, isNamedClassElement: () => isNamedClassElement, isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, isNamedExportBindings: () => isNamedExportBindings, isNamedExports: () => isNamedExports, isNamedImportBindings: () => isNamedImportBindings, @@ -165828,6 +168050,7 @@ ${options.prefix}` : "\n" : options.prefix isNodeModulesDirectory: () => isNodeModulesDirectory, isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, isNonGlobalDeclaration: () => isNonGlobalDeclaration, isNonNullAccess: () => isNonNullAccess, @@ -165896,6 +168119,7 @@ ${options.prefix}` : "\n" : options.prefix isPropertyName: () => isPropertyName, isPropertyNameLiteral: () => isPropertyNameLiteral, isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, isPrototypeAccess: () => isPrototypeAccess, isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, isPunctuation: () => isPunctuation, @@ -166007,7 +168231,6 @@ ${options.prefix}` : "\n" : options.prefix isTupleTypeNode: () => isTupleTypeNode, isTypeAlias: () => isTypeAlias, isTypeAliasDeclaration: () => isTypeAliasDeclaration, - isTypeAssertion: () => isTypeAssertion, isTypeAssertionExpression: () => isTypeAssertionExpression, isTypeDeclaration: () => isTypeDeclaration, isTypeElement: () => isTypeElement, @@ -166017,8 +168240,9 @@ ${options.prefix}` : "\n" : options.prefix isTypeLiteralNode: () => isTypeLiteralNode, isTypeNode: () => isTypeNode, isTypeNodeKind: () => isTypeNodeKind, - isTypeNodeOrTypeParameterDeclaration: () => isTypeNodeOrTypeParameterDeclaration, isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, isTypeOperatorNode: () => isTypeOperatorNode, isTypeParameterDeclaration: () => isTypeParameterDeclaration, @@ -166093,6 +168317,7 @@ ${options.prefix}` : "\n" : options.prefix maybeBind: () => maybeBind, maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, memoize: () => memoize, + memoizeCached: () => memoizeCached, memoizeOne: () => memoizeOne, memoizeWeak: () => memoizeWeak, metadataHelper: () => metadataHelper, @@ -166118,6 +168343,7 @@ ${options.prefix}` : "\n" : options.prefix mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, noTransformers: () => noTransformers, @@ -166211,6 +168437,7 @@ ${options.prefix}` : "\n" : options.prefix programContainsEsModules: () => programContainsEsModules, programContainsModules: () => programContainsModules, projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, propertyNamePart: () => propertyNamePart, pseudoBigIntToString: () => pseudoBigIntToString, punctuationPart: () => punctuationPart, @@ -166275,10 +168502,12 @@ ${options.prefix}` : "\n" : options.prefix returnTrue: () => returnTrue, returnUndefined: () => returnUndefined, returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, sameFlatMap: () => sameFlatMap, sameMap: () => sameMap, sameMapping: () => sameMapping, scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, scanner: () => scanner, screenStartingMessageCodes: () => screenStartingMessageCodes, semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, @@ -166290,7 +168519,12 @@ ${options.prefix}` : "\n" : options.prefix setConstantValue: () => setConstantValue, setEachParent: () => setEachParent, setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, setModuleDefaultHelper: () => setModuleDefaultHelper, setNodeFlags: () => setNodeFlags, @@ -166298,6 +168532,7 @@ ${options.prefix}` : "\n" : options.prefix setOriginalNode: () => setOriginalNode, setParent: () => setParent, setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, setResolvedModule: () => setResolvedModule, setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective, setSnippetElement: () => setSnippetElement, @@ -166338,6 +168573,7 @@ ${options.prefix}` : "\n" : options.prefix skipTrivia: () => skipTrivia, skipTypeChecking: () => skipTypeChecking, skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, sliceAfter: () => sliceAfter, some: () => some, sort: () => sort, @@ -166432,6 +168668,7 @@ ${options.prefix}` : "\n" : options.prefix transformES2020: () => transformES2020, transformES2021: () => transformES2021, transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, transformESNext: () => transformESNext, transformGenerators: () => transformGenerators, transformJsx: () => transformJsx, @@ -166458,6 +168695,7 @@ ${options.prefix}` : "\n" : options.prefix tryGetDirectories: () => tryGetDirectories, tryGetExtensionFromPath: () => tryGetExtensionFromPath2, tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, @@ -166492,148 +168730,14 @@ ${options.prefix}` : "\n" : options.prefix unreachableCodeIsError: () => unreachableCodeIsError, unusedLabelIsError: () => unusedLabelIsError, unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, - updateArrayBindingPattern: () => updateArrayBindingPattern, - updateArrayLiteral: () => updateArrayLiteral, - updateArrayTypeNode: () => updateArrayTypeNode, - updateArrowFunction: () => updateArrowFunction, - updateAsExpression: () => updateAsExpression, - updateAwait: () => updateAwait, - updateBinary: () => updateBinary, - updateBindingElement: () => updateBindingElement, - updateBlock: () => updateBlock, - updateBreak: () => updateBreak, - updateBundle: () => updateBundle, - updateCall: () => updateCall, - updateCallChain: () => updateCallChain, - updateCallSignature: () => updateCallSignature, - updateCaseBlock: () => updateCaseBlock, - updateCaseClause: () => updateCaseClause, - updateCatchClause: () => updateCatchClause, - updateClassDeclaration: () => updateClassDeclaration, - updateClassExpression: () => updateClassExpression, - updateCommaList: () => updateCommaList, - updateComputedPropertyName: () => updateComputedPropertyName, - updateConditional: () => updateConditional, - updateConditionalTypeNode: () => updateConditionalTypeNode, - updateConstructSignature: () => updateConstructSignature, - updateConstructor: () => updateConstructor, - updateConstructorTypeNode: () => updateConstructorTypeNode, - updateContinue: () => updateContinue, - updateDecorator: () => updateDecorator, - updateDefaultClause: () => updateDefaultClause, - updateDelete: () => updateDelete, - updateDo: () => updateDo, - updateElementAccess: () => updateElementAccess, - updateElementAccessChain: () => updateElementAccessChain, - updateEnumDeclaration: () => updateEnumDeclaration, - updateEnumMember: () => updateEnumMember, updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, - updateExportAssignment: () => updateExportAssignment, - updateExportDeclaration: () => updateExportDeclaration, - updateExportSpecifier: () => updateExportSpecifier, - updateExpressionStatement: () => updateExpressionStatement, - updateExpressionWithTypeArguments: () => updateExpressionWithTypeArguments, - updateExternalModuleReference: () => updateExternalModuleReference, - updateFor: () => updateFor, - updateForIn: () => updateForIn, - updateForOf: () => updateForOf, - updateFunctionDeclaration: () => updateFunctionDeclaration, - updateFunctionExpression: () => updateFunctionExpression, - updateFunctionTypeNode: () => updateFunctionTypeNode, - updateGetAccessor: () => updateGetAccessor, - updateHeritageClause: () => updateHeritageClause, - updateIf: () => updateIf, - updateImportClause: () => updateImportClause, - updateImportDeclaration: () => updateImportDeclaration, - updateImportEqualsDeclaration: () => updateImportEqualsDeclaration, - updateImportSpecifier: () => updateImportSpecifier, - updateImportTypeNode: () => updateImportTypeNode, - updateIndexSignature: () => updateIndexSignature, - updateIndexedAccessTypeNode: () => updateIndexedAccessTypeNode, - updateInferTypeNode: () => updateInferTypeNode, - updateInterfaceDeclaration: () => updateInterfaceDeclaration, - updateIntersectionTypeNode: () => updateIntersectionTypeNode, - updateJsxAttribute: () => updateJsxAttribute, - updateJsxAttributes: () => updateJsxAttributes, - updateJsxClosingElement: () => updateJsxClosingElement, - updateJsxElement: () => updateJsxElement, - updateJsxExpression: () => updateJsxExpression, - updateJsxFragment: () => updateJsxFragment, - updateJsxOpeningElement: () => updateJsxOpeningElement, - updateJsxSelfClosingElement: () => updateJsxSelfClosingElement, - updateJsxSpreadAttribute: () => updateJsxSpreadAttribute, - updateJsxText: () => updateJsxText, - updateLabel: () => updateLabel, updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, - updateLiteralTypeNode: () => updateLiteralTypeNode, - updateMappedTypeNode: () => updateMappedTypeNode, - updateMetaProperty: () => updateMetaProperty, - updateMethod: () => updateMethod, - updateMethodSignature: () => updateMethodSignature, updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updateModuleBlock: () => updateModuleBlock, - updateModuleDeclaration: () => updateModuleDeclaration, - updateNamedExports: () => updateNamedExports, - updateNamedImports: () => updateNamedImports, - updateNamespaceExport: () => updateNamespaceExport, - updateNamespaceExportDeclaration: () => updateNamespaceExportDeclaration, - updateNamespaceImport: () => updateNamespaceImport, - updateNew: () => updateNew, - updateNonNullChain: () => updateNonNullChain, - updateNonNullExpression: () => updateNonNullExpression, - updateObjectBindingPattern: () => updateObjectBindingPattern, - updateObjectLiteral: () => updateObjectLiteral, - updateOptionalTypeNode: () => updateOptionalTypeNode, updatePackageJsonWatch: () => updatePackageJsonWatch, - updateParameter: () => updateParameter, - updateParen: () => updateParen, - updateParenthesizedType: () => updateParenthesizedType, - updatePartiallyEmittedExpression: () => updatePartiallyEmittedExpression, - updatePostfix: () => updatePostfix, - updatePrefix: () => updatePrefix, - updateProperty: () => updateProperty, - updatePropertyAccess: () => updatePropertyAccess, - updatePropertyAccessChain: () => updatePropertyAccessChain, - updatePropertyAssignment: () => updatePropertyAssignment, - updatePropertySignature: () => updatePropertySignature, - updateQualifiedName: () => updateQualifiedName, updateResolutionField: () => updateResolutionField, - updateRestTypeNode: () => updateRestTypeNode, - updateReturn: () => updateReturn, - updateSetAccessor: () => updateSetAccessor, updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, - updateShorthandPropertyAssignment: () => updateShorthandPropertyAssignment, updateSourceFile: () => updateSourceFile, - updateSourceFileNode: () => updateSourceFileNode, - updateSpread: () => updateSpread, - updateSpreadAssignment: () => updateSpreadAssignment, - updateStatement: () => updateStatement, - updateSwitch: () => updateSwitch, - updateTaggedTemplate: () => updateTaggedTemplate, - updateTemplateExpression: () => updateTemplateExpression, - updateTemplateSpan: () => updateTemplateSpan, - updateThrow: () => updateThrow, - updateTry: () => updateTry, - updateTupleTypeNode: () => updateTupleTypeNode, - updateTypeAliasDeclaration: () => updateTypeAliasDeclaration, - updateTypeAssertion: () => updateTypeAssertion, - updateTypeLiteralNode: () => updateTypeLiteralNode, - updateTypeOf: () => updateTypeOf, - updateTypeOperatorNode: () => updateTypeOperatorNode, - updateTypeParameterDeclaration: () => updateTypeParameterDeclaration, - updateTypePredicateNode: () => updateTypePredicateNode, - updateTypePredicateNodeWithModifier: () => updateTypePredicateNodeWithModifier, - updateTypeQueryNode: () => updateTypeQueryNode, - updateTypeReferenceNode: () => updateTypeReferenceNode, - updateUnionTypeNode: () => updateUnionTypeNode, - updateVariableDeclaration: () => updateVariableDeclaration, - updateVariableDeclarationList: () => updateVariableDeclarationList, - updateVariableStatement: () => updateVariableStatement, - updateVoid: () => updateVoid, updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, - updateWhile: () => updateWhile, - updateWith: () => updateWith, - updateYield: () => updateYield, usesExtensionsOnImports: () => usesExtensionsOnImports, usingSingleLineStringWriter: () => usingSingleLineStringWriter, utf16EncodeAsString: () => utf16EncodeAsString, @@ -166642,6 +168746,7 @@ ${options.prefix}` : "\n" : options.prefix version: () => version, versionMajorMinor: () => versionMajorMinor, visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, visitEachChild: () => visitEachChild, visitFunctionBody: () => visitFunctionBody, visitIterationBody: () => visitIterationBody, @@ -166650,6 +168755,8 @@ ${options.prefix}` : "\n" : options.prefix visitNodes: () => visitNodes2, visitParameterList: () => visitParameterList, walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index b76938e71dc4e..2b20b45f48052 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -54,7 +54,7 @@ var path = __toESM(require("path")); // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.0-dev.20230112`; +var version = `${versionMajorMinor}.0-beta`; // src/compiler/core.ts var emptyArray = []; @@ -843,18 +843,6 @@ function isPatternMatch({ prefix, suffix }, candidate) { function and(f, g) { return (arg) => f(arg) && g(arg); } -function or(...fs2) { - return (...args) => { - let lastResult; - for (const f of fs2) { - lastResult = f(...args); - if (lastResult) { - return lastResult; - } - } - return lastResult; - }; -} function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) { unchanged = unchanged || noop; let newIndex = 0; @@ -2966,14 +2954,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => { SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 350] = "JSDocSeeTag"; SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 351] = "JSDocPropertyTag"; SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 352] = "JSDocThrowsTag"; - SyntaxKind4[SyntaxKind4["SyntaxList"] = 353] = "SyntaxList"; - SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 354] = "NotEmittedStatement"; - SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression"; - SyntaxKind4[SyntaxKind4["CommaListExpression"] = 356] = "CommaListExpression"; - SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 357] = "MergeDeclarationMarker"; - SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 358] = "EndOfDeclarationMarker"; - SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 359] = "SyntheticReferenceExpression"; - SyntaxKind4[SyntaxKind4["Count"] = 360] = "Count"; + SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag"; + SyntaxKind4[SyntaxKind4["SyntaxList"] = 354] = "SyntaxList"; + SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 355] = "NotEmittedStatement"; + SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression"; + SyntaxKind4[SyntaxKind4["CommaListExpression"] = 357] = "CommaListExpression"; + SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker"; + SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker"; + SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression"; + SyntaxKind4[SyntaxKind4["Count"] = 361] = "Count"; SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment"; SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment"; SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment"; @@ -3002,9 +2991,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => { SyntaxKind4[SyntaxKind4["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement"; SyntaxKind4[SyntaxKind4["FirstNode"] = 163 /* QualifiedName */] = "FirstNode"; SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocNode"; + SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocNode"; SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocTagNode"; + SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocTagNode"; SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword"; SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword"; return SyntaxKind4; @@ -3046,6 +3035,8 @@ var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { NodeFlags3[NodeFlags3["ContextFlags"] = 50720768] = "ContextFlags"; NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; + NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape"; + NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace"; return NodeFlags3; })(NodeFlags || {}); var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { @@ -3418,11 +3409,6 @@ var EmitFlags = /* @__PURE__ */ ((EmitFlags3) => { EmitFlags3[EmitFlags3["HasEndOfDeclarationMarker"] = 8388608] = "HasEndOfDeclarationMarker"; EmitFlags3[EmitFlags3["Iterator"] = 16777216] = "Iterator"; EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 33554432] = "NoAsciiEscaping"; - EmitFlags3[EmitFlags3["TypeScriptClassWrapper"] = 67108864] = "TypeScriptClassWrapper"; - EmitFlags3[EmitFlags3["NeverApplyImportHelper"] = 134217728] = "NeverApplyImportHelper"; - EmitFlags3[EmitFlags3["IgnoreSourceNewlines"] = 268435456] = "IgnoreSourceNewlines"; - EmitFlags3[EmitFlags3["Immutable"] = 536870912] = "Immutable"; - EmitFlags3[EmitFlags3["IndirectCall"] = 1073741824] = "IndirectCall"; return EmitFlags3; })(EmitFlags || {}); var commentPragmas = { @@ -5360,10 +5346,9 @@ var Diagnostics = { Line_terminator_not_permitted_before_arrow: diag(1200, 1 /* Error */, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, 1 /* Error */, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, 1 /* Error */, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), - Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), + Re_exporting_a_type_when_0_is_enabled_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205", "Re-exporting a type when '{0}' is enabled requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, 1 /* Error */, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, 1 /* Error */, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, 1 /* Error */, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, 1 /* Error */, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, 1 /* Error */, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, 1 /* Error */, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), @@ -5373,7 +5358,6 @@ var Diagnostics = { Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, 1 /* Error */, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, 1 /* Error */, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, 1 /* Error */, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, 1 /* Error */, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."), Generators_are_not_allowed_in_an_ambient_context: diag(1221, 1 /* Error */, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, 1 /* Error */, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), _0_tag_already_specified: diag(1223, 1 /* Error */, "_0_tag_already_specified_1223", "'{0}' tag already specified."), @@ -5420,7 +5404,7 @@ var Diagnostics = { An_optional_element_cannot_follow_a_rest_element: diag(1266, 1 /* Error */, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, 1 /* Error */, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, 1 /* Error */, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), - Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."), + Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269", "Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."), Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, 1 /* Error */, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, 1 /* Error */, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, 1 /* Error */, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), @@ -5429,6 +5413,17 @@ var Diagnostics = { accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1 /* Error */, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), An_accessor_property_cannot_be_declared_optional: diag(1276, 1 /* Error */, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), _0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: diag(1277, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0: diag(1278, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278", "The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0: diag(1279, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279", "The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."), + Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement: diag(1280, 1 /* Error */, "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280", "Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."), + Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead: diag(1281, 1 /* Error */, "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281", "Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."), + An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1282, 1 /* Error */, "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282", "An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), @@ -5500,7 +5495,6 @@ var Diagnostics = { An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), - Only_named_exports_may_use_export_type: diag(1383, 1 /* Error */, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."), Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), @@ -5548,7 +5542,7 @@ var Diagnostics = { The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."), - Decorators_may_not_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."), + Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."), Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, 1 /* Error */, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), @@ -5561,7 +5555,7 @@ var Diagnostics = { Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, 1 /* Error */, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), - _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."), Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"), Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"), @@ -5589,6 +5583,8 @@ var Diagnostics = { To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), + _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -6046,7 +6042,7 @@ var Diagnostics = { This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1 /* Error */, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), - Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), + Cannot_access_ambient_const_enums_when_0_is_enabled: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."), _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1 /* Error */, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, 1 /* Error */, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), @@ -6294,12 +6290,12 @@ var Diagnostics = { The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, 1 /* Error */, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, 1 /* Error */, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, 1 /* Error */, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), - Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."), + Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."), The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), - Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_eithe_5096", "Option 'allowImportingTsExtensions' can only be used when 'moduleResolution' is set to 'bundler' and either 'noEmit' or 'emitDeclarationOnly' is set."), + Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), @@ -6307,6 +6303,9 @@ var Diagnostics = { Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), + Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), + Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), + Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -6589,6 +6588,8 @@ var Diagnostics = { package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."), + Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."), + There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`), Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), @@ -6713,7 +6714,7 @@ var Diagnostics = { Filters_results_from_the_include_option: diag(6627, 3 /* Message */, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), Remove_a_list_of_directories_from_the_watch_process: diag(6628, 3 /* Message */, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, 3 /* Message */, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), - Enable_experimental_support_for_TC39_stage_2_draft_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630", "Enable experimental support for TC39 stage 2 draft decorators."), + Enable_experimental_support_for_legacy_experimental_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_legacy_experimental_decorators_6630", "Enable experimental support for legacy experimental decorators."), Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, 3 /* Message */, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), Output_more_detailed_compiler_performance_information_after_building: diag(6632, 3 /* Message */, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, 3 /* Message */, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), @@ -6799,6 +6800,7 @@ var Diagnostics = { Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), + Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."), one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"), one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"), type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"), @@ -6934,6 +6936,7 @@ var Diagnostics = { You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), + Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -7219,7 +7222,8 @@ var Diagnostics = { _0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), _0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), - The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here.") + The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."), + Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.") }; // src/compiler/scanner.ts @@ -7752,10 +7756,7 @@ function reduceEachTrailingCommentRange(text, pos, cb, state, initial) { initial ); } -function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) { - if (!comments) { - comments = []; - } +function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments = []) { comments.push({ kind, pos, end, hasTrailingNewLine }); return comments; } @@ -9333,7 +9334,7 @@ function createTextChangeRange(span, newLength) { } var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); function isParameterPropertyDeclaration(node, parent) { - return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 173 /* Constructor */; + return isParameter(node) && hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 173 /* Constructor */; } function walkUpBindingElementsAndPatterns(binding) { let node = binding.parent; @@ -9402,6 +9403,10 @@ function unescapeLeadingUnderscores(identifier) { function idText(identifierOrPrivateName) { return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); } +function identifierToKeywordKind(node) { + const token = stringToToken(node.escapedText); + return token ? tryCast(token, isKeyword) : void 0; +} function symbolName(symbol) { if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { return idText(symbol.valueDeclaration.name); @@ -9532,6 +9537,11 @@ function getAssignedName(node) { return node.parent.name; } } +function getModifiers(node) { + if (hasSyntacticModifier(node, 126975 /* Modifier */)) { + return filter(node.modifiers, isModifier); + } +} function getJSDocParameterTagsWorker(param, noCache) { if (param.name) { if (isIdentifier(param.name)) { @@ -9636,15 +9646,17 @@ function getJSDocTypeTag(node) { return void 0; } function getJSDocTagsWorker(node, noCache) { + var _a2, _b; if (!canHaveJSDoc(node)) return emptyArray; - let tags = node.jsDocCache; + let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache; if (tags === void 0 || noCache) { const comments = getJSDocCommentsAndTags(node, noCache); Debug.assert(comments.length < 2 || comments[0] !== comments[1]); tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j); if (!noCache) { - node.jsDocCache = tags; + (_b = node.jsDoc) != null ? _b : node.jsDoc = []; + node.jsDoc.jsDocCache = tags; } } return tags; @@ -9692,18 +9704,15 @@ function isNamedExportBindings(node) { function isNodeKind(kind) { return kind >= 163 /* FirstNode */; } -function isTokenKind(kind) { - return kind >= 0 /* FirstToken */ && kind <= 162 /* LastToken */; -} -function isToken(n) { - return isTokenKind(n.kind); -} function isNodeArray(array) { return hasProperty(array, "pos") && hasProperty(array, "end"); } function isLiteralKind(kind) { return 8 /* FirstLiteralToken */ <= kind && kind <= 14 /* LastLiteralToken */; } +function isLiteralExpression(node) { + return isLiteralKind(node.kind); +} function isTemplateLiteralKind(kind) { return 14 /* FirstTemplateToken */ <= kind && kind <= 17 /* LastTemplateToken */; } @@ -9715,10 +9724,12 @@ function isAssertionKey(node) { return isStringLiteral(node) || isIdentifier(node); } function isGeneratedIdentifier(node) { - return isIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isGeneratedPrivateIdentifier(node) { - return isPrivateIdentifier(node) && node.autoGenerate !== void 0; + var _a2; + return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; } function isPrivateIdentifierClassElementDeclaration(node) { return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name); @@ -9911,6 +9922,7 @@ function isLeftHandSideExpressionKind(kind) { case 230 /* ExpressionWithTypeArguments */: case 233 /* MetaProperty */: case 100 /* ImportKeyword */: + case 279 /* MissingDeclaration */: return true; default: return false; @@ -9933,6 +9945,17 @@ function isUnaryExpressionKind(kind) { return isLeftHandSideExpressionKind(kind); } } +function isLiteralTypeLiteral(node) { + switch (node.kind) { + case 104 /* NullKeyword */: + case 110 /* TrueKeyword */: + case 95 /* FalseKeyword */: + case 221 /* PrefixUnaryExpression */: + return true; + default: + return isLiteralExpression(node); + } +} function isExpression(node) { return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); } @@ -9945,8 +9968,8 @@ function isExpressionKind(kind) { case 227 /* SpreadElement */: case 231 /* AsExpression */: case 229 /* OmittedExpression */: - case 356 /* CommaListExpression */: - case 355 /* PartiallyEmittedExpression */: + case 357 /* CommaListExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: return true; default: @@ -10085,7 +10108,7 @@ function isDeclarationStatementKind(kind) { return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 354 /* NotEmittedStatement */ || kind === 358 /* EndOfDeclarationMarker */ || kind === 357 /* MergeDeclarationMarker */; + return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 355 /* NotEmittedStatement */ || kind === 359 /* EndOfDeclarationMarker */ || kind === 358 /* MergeDeclarationMarker */; } function isDeclaration(node) { if (node.kind === 165 /* TypeParameter */) { @@ -10142,7 +10165,7 @@ function isCaseOrDefaultClause(node) { return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */; } function isJSDocNode(node) { - return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */; + return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */; } function hasJSDocNodes(node) { if (!canHaveJSDoc(node)) @@ -10277,7 +10300,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (includeJsDoc && hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 353 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return skipTrivia( @@ -10375,10 +10398,11 @@ function isComputedNonLiteralName(name) { return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } function tryGetTextOfPropertyName(name) { + var _a2; switch (name.kind) { case 79 /* Identifier */: case 80 /* PrivateIdentifier */: - return name.autoGenerate ? void 0 : name.escapedText; + return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: @@ -10867,7 +10891,7 @@ function isSpecialPropertyDeclaration(expr) { } function setValueDeclaration(symbol, node) { const { valueDeclaration } = symbol; - if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { + if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !isInJSFile(node) && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { symbol.valueDeclaration = node; } } @@ -11011,7 +11035,7 @@ function filterOwnedJSDocTags(hostNode, jsDoc) { return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0; } function ownsJSDocTag(hostNode, tag) { - return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; + return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; } function getNextJSDocCommentLocation(node) { const parent = node.parent; @@ -11266,7 +11290,7 @@ function getOperator(expression) { } function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return 0 /* Comma */; case 227 /* SpreadElement */: return 1 /* Spread */; @@ -11456,7 +11480,7 @@ function isThisIdentifier(node) { return !!node && node.kind === 79 /* Identifier */ && identifierIsThisKeyword(node); } function identifierIsThisKeyword(id) { - return id.originalKeywordKind === 108 /* ThisKeyword */; + return id.escapedText === "this"; } function hasSyntacticModifier(node, flags) { return !!getSelectedSyntacticModifierFlags(node, flags); @@ -11524,7 +11548,7 @@ function getEffectiveModifierFlagsNoCache(node) { } function getSyntacticModifierFlagsNoCache(node) { let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */; - if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) { + if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { flags |= 1 /* Export */; } return flags; @@ -11575,9 +11599,21 @@ function modifierToFlag(token) { } return 0 /* None */; } +function isBinaryLogicalOperator(token) { + return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */; +} function isLogicalOrCoalescingAssignmentOperator(token) { return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */; } +function isLogicalOrCoalescingAssignmentExpression(expr) { + return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); +} +function isLogicalOrCoalescingBinaryOperator(token) { + return isBinaryLogicalOperator(token) || token === 60 /* QuestionQuestionToken */; +} +function isLogicalOrCoalescingBinaryExpression(expr) { + return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind); +} function isAssignmentOperator(token) { return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */; } @@ -11653,7 +11689,7 @@ function getLastChild(node) { return lastChild; } function isTypeNodeKind(kind) { - return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; + return kind >= 179 /* FirstTypeNode */ && kind <= 202 /* LastTypeNode */ || kind === 131 /* AnyKeyword */ || kind === 157 /* UnknownKeyword */ || kind === 148 /* NumberKeyword */ || kind === 160 /* BigIntKeyword */ || kind === 149 /* ObjectKeyword */ || kind === 134 /* BooleanKeyword */ || kind === 152 /* StringKeyword */ || kind === 153 /* SymbolKeyword */ || kind === 114 /* VoidKeyword */ || kind === 155 /* UndefinedKeyword */ || kind === 144 /* NeverKeyword */ || kind === 139 /* IntrinsicKeyword */ || kind === 230 /* ExpressionWithTypeArguments */ || kind === 315 /* JSDocAllType */ || kind === 316 /* JSDocUnknownType */ || kind === 317 /* JSDocNullableType */ || kind === 318 /* JSDocNonNullableType */ || kind === 319 /* JSDocOptionalType */ || kind === 320 /* JSDocFunctionType */ || kind === 321 /* JSDocVariadicType */; } function isAccessExpression(node) { return node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */; @@ -11687,7 +11723,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) { case 209 /* ElementAccessExpression */: case 208 /* PropertyAccessExpression */: case 232 /* NonNullExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 235 /* SatisfiesExpression */: node = node.expression; continue; @@ -11755,7 +11791,6 @@ function Identifier2(kind, pos, end) { this.parent = void 0; this.original = void 0; this.emitNode = void 0; - this.flowNode = void 0; } function SourceMapSource(fileName, text, skipTrivia2) { this.fileName = fileName; @@ -12799,7 +12834,7 @@ function createNodeConverters(factory2) { if (!node.body) return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); const updated = factory2.createFunctionExpression( - node.modifiers, + getModifiers(node), node.asteriskToken, node.name, node.typeParameters, @@ -12938,7 +12973,6 @@ function createNodeFactory(flags, baseFactory2) { createRegularExpressionLiteral, createLiteralLikeNode, createIdentifier, - updateIdentifier, createTempVariable, createLoopVariable, createUniqueName, @@ -13348,6 +13382,12 @@ function createNodeFactory(flags, baseFactory2) { get updateJSDocThrowsTag() { return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */); }, + get createJSDocSatisfiesTag() { + return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */); + }, + get updateJSDocSatisfiesTag() { + return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */); + }, createJSDocEnumTag, updateJSDocEnumTag, createJSDocUnknownTag, @@ -13529,6 +13569,7 @@ function createNodeFactory(flags, baseFactory2) { createArraySliceCall, createArrayConcatCall, createObjectDefinePropertyCall, + createObjectGetOwnPropertyDescriptorCall, createReflectGetCall, createReflectSetCall, createPropertyDescriptor, @@ -13681,55 +13722,43 @@ function createNodeFactory(flags, baseFactory2) { ); } } - function createBaseIdentifier(escapedText, originalKeywordKind) { + function createBaseIdentifier(escapedText) { const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */); - node.originalKeywordKind = originalKeywordKind; node.escapedText = escapedText; - node.autoGenerate = void 0; - node.typeArguments = void 0; - node.hasExtendedUnicodeEscape = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.symbol = void 0; return node; } function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { - const node = createBaseIdentifier( - escapeLeadingUnderscores(text), - /*originalKeywordKind*/ - void 0 - ); - node.autoGenerate = { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } - function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) { + function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) { if (originalKeywordKind === void 0 && text) { originalKeywordKind = stringToToken(text); } if (originalKeywordKind === 79 /* Identifier */) { originalKeywordKind = void 0; } - const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind); - node.typeArguments = asNodeArray(typeArguments); - node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; - if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + if (hasExtendedUnicodeEscape) + node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */; + if (node.escapedText === "await") { node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */; } - if (node.hasExtendedUnicodeEscape) { + if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { node.transformFlags |= 1024 /* ContainsES2015 */; } return node; } - function updateIdentifier(node, typeArguments) { - return node.typeArguments !== typeArguments ? update(createIdentifier(idText(node), typeArguments), node) : node; - } function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { let flags2 = 1 /* Auto */; if (reservedInNestedScopes) @@ -13777,7 +13806,6 @@ function createNodeFactory(flags, baseFactory2) { function createBasePrivateIdentifier(escapedText) { const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */); node.escapedText = escapedText; - node.autoGenerate = void 0; node.transformFlags |= 16777216 /* ContainsClassFields */; return node; } @@ -13788,12 +13816,12 @@ function createNodeFactory(flags, baseFactory2) { } function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text)); - node.autoGenerate = { + setIdentifierAutoGenerate(node, { flags: autoGenerateFlags, id: nextAutoGenerateId, prefix, suffix - }; + }); nextAutoGenerateId++; return node; } @@ -13955,7 +13983,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.expression = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) { @@ -13976,7 +14003,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */); } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { @@ -14004,7 +14030,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.initializer = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertySignature(node, modifiers, name, questionToken, type) { @@ -14027,7 +14052,6 @@ function createNodeFactory(flags, baseFactory2) { const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertyDeclaration(node, modifiers, name, questionOrExclamationToken, type, initializer) { @@ -14043,7 +14067,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -14073,7 +14096,6 @@ function createNodeFactory(flags, baseFactory2) { } node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -14094,10 +14116,8 @@ function createNodeFactory(flags, baseFactory2) { const node = createBaseDeclaration(172 /* ClassStaticBlockDeclaration */); node.body = body; node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -14109,7 +14129,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateClassStaticBlockDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); @@ -14120,12 +14139,10 @@ function createNodeFactory(flags, baseFactory2) { node.parameters = createNodeArray(parameters); node.body = body; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */; - node.illegalDecorators = void 0; node.typeParameters = void 0; node.type = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -14137,7 +14154,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateConstructorDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.typeParameters = original.typeParameters; updated.type = original.type; } @@ -14158,7 +14174,6 @@ function createNodeFactory(flags, baseFactory2) { node.typeArguments = void 0; node.typeParameters = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -14190,7 +14205,6 @@ function createNodeFactory(flags, baseFactory2) { node.typeParameters = void 0; node.type = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -14215,7 +14229,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -14231,7 +14244,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -14246,9 +14258,7 @@ function createNodeFactory(flags, baseFactory2) { node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -14299,7 +14309,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = 1 /* ContainsTypeScript */; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -14325,7 +14334,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -14394,7 +14402,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) { @@ -14596,7 +14603,6 @@ function createNodeFactory(flags, baseFactory2) { node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateObjectLiteralExpression(node, properties) { @@ -14609,7 +14615,6 @@ function createNodeFactory(flags, baseFactory2) { node.name = name; node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -14660,7 +14665,6 @@ function createNodeFactory(flags, baseFactory2) { node.argumentExpression = argumentExpression; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -14811,7 +14815,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateParenthesizedExpression(node, expression) { @@ -14832,7 +14835,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -14855,7 +14857,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -14953,7 +14954,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */; } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function propagateAssignmentPatternFlags(node) { @@ -15095,7 +15095,6 @@ function createNodeFactory(flags, baseFactory2) { node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { @@ -15211,7 +15210,6 @@ function createNodeFactory(flags, baseFactory2) { node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; @@ -15227,9 +15225,7 @@ function createNodeFactory(flags, baseFactory2) { if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15239,7 +15235,6 @@ function createNodeFactory(flags, baseFactory2) { function createEmptyStatement() { const node = createBaseNode(239 /* EmptyStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function createExpressionStatement(expression) { @@ -15247,7 +15242,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15261,7 +15255,6 @@ function createNodeFactory(flags, baseFactory2) { node.elseStatement = asEmbeddedStatement(elseStatement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15274,7 +15267,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15287,7 +15279,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15302,7 +15293,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -15318,7 +15308,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -15337,7 +15326,6 @@ function createNodeFactory(flags, baseFactory2) { if (awaitModifier) node.transformFlags |= 128 /* ContainsES2018 */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.flowNode = void 0; @@ -15351,7 +15339,6 @@ function createNodeFactory(flags, baseFactory2) { node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15363,7 +15350,6 @@ function createNodeFactory(flags, baseFactory2) { node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15375,7 +15361,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15388,7 +15373,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15401,7 +15385,6 @@ function createNodeFactory(flags, baseFactory2) { node.caseBlock = caseBlock; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; node.possiblyExhaustive = false; return node; @@ -15415,7 +15398,6 @@ function createNodeFactory(flags, baseFactory2) { node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15427,7 +15409,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15441,7 +15422,6 @@ function createNodeFactory(flags, baseFactory2) { node.finallyBlock = finallyBlock; node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15451,7 +15431,6 @@ function createNodeFactory(flags, baseFactory2) { function createDebuggerStatement() { const node = createBaseNode(256 /* DebuggerStatement */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.flowNode = void 0; return node; } @@ -15464,7 +15443,6 @@ function createNodeFactory(flags, baseFactory2) { node.initializer = asInitializer(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateVariableDeclaration(node, name, exclamationToken, type, initializer) { @@ -15500,10 +15478,8 @@ function createNodeFactory(flags, baseFactory2) { const isAsyncGenerator = isAsync && isGenerator; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; } - node.illegalDecorators = void 0; node.typeArguments = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.endFlowNode = void 0; @@ -15515,7 +15491,9 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateFunctionDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return finishUpdateBaseSignatureDeclaration(updated, original); } @@ -15535,7 +15513,6 @@ function createNodeFactory(flags, baseFactory2) { } } node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { @@ -15549,19 +15526,11 @@ function createNodeFactory(flags, baseFactory2) { node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? finishUpdateInterfaceDeclaration(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; - } - function finishUpdateInterfaceDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { const node = createBaseDeclaration(262 /* TypeAliasDeclaration */); @@ -15570,21 +15539,13 @@ function createNodeFactory(flags, baseFactory2) { node.typeParameters = asNodeArray(typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) { - return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? finishUpdateTypeAliasDeclaration(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; - } - function finishUpdateTypeAliasDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? update(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; } function createEnumDeclaration(modifiers, name, members) { const node = createBaseDeclaration(263 /* EnumDeclaration */); @@ -15593,19 +15554,11 @@ function createNodeFactory(flags, baseFactory2) { node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateEnumDeclaration(node, modifiers, name, members) { - return node.modifiers !== modifiers || node.name !== name || node.members !== members ? finishUpdateEnumDeclaration(createEnumDeclaration(modifiers, name, members), node) : node; - } - function finishUpdateEnumDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createEnumDeclaration(modifiers, name, members), node) : node; } function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { const node = createBaseDeclaration(264 /* ModuleDeclaration */); @@ -15619,28 +15572,19 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; } function updateModuleDeclaration(node, modifiers, name, body) { - return node.modifiers !== modifiers || node.name !== name || node.body !== body ? finishUpdateModuleDeclaration(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; - } - function finishUpdateModuleDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.name !== name || node.body !== body ? update(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; } function createModuleBlock(statements) { const node = createBaseNode(265 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateModuleBlock(node, statements) { @@ -15661,10 +15605,8 @@ function createNodeFactory(flags, baseFactory2) { const node = createBaseDeclaration(267 /* NamespaceExportDeclaration */); node.name = asName(name); node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; - node.illegalDecorators = void 0; node.modifiers = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateNamespaceExportDeclaration(node, name) { @@ -15672,7 +15614,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateNamespaceExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; } return update(updated, original); @@ -15688,19 +15629,11 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? finishUpdateImportEqualsDeclaration(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; - } - function finishUpdateImportEqualsDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; } function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) { const node = createBaseNode(269 /* ImportDeclaration */); @@ -15710,19 +15643,11 @@ function createNodeFactory(flags, baseFactory2) { node.assertClause = assertClause; node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateImportDeclaration(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; - } - function finishUpdateImportDeclaration(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; } function createImportClause(isTypeOnly, name, namedBindings) { const node = createBaseDeclaration(270 /* ImportClause */); @@ -15822,19 +15747,11 @@ function createNodeFactory(flags, baseFactory2) { ) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateExportAssignment(node, modifiers, expression) { - return node.modifiers !== modifiers || node.expression !== expression ? finishUpdateExportAssignment(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node; - } - function finishUpdateExportAssignment(updated, original) { - if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; - } - return update(updated, original); + return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node; } function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { const node = createBaseDeclaration(275 /* ExportDeclaration */); @@ -15845,9 +15762,7 @@ function createNodeFactory(flags, baseFactory2) { node.assertClause = assertClause; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.illegalDecorators = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { @@ -15855,7 +15770,9 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateExportDeclaration(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } } return update(updated, original); } @@ -15877,7 +15794,6 @@ function createNodeFactory(flags, baseFactory2) { node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateExportSpecifier(node, isTypeOnly, propertyName, name) { @@ -15886,7 +15802,6 @@ function createNodeFactory(flags, baseFactory2) { function createMissingDeclaration() { const node = createBaseDeclaration(279 /* MissingDeclaration */); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function createExternalModuleReference(expression) { @@ -15927,7 +15842,6 @@ function createNodeFactory(flags, baseFactory2) { node.type = type; node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; node.typeArguments = void 0; @@ -15959,7 +15873,6 @@ function createNodeFactory(flags, baseFactory2) { node.parameters = createNodeArray(parameters); node.type = type; node.jsDoc = void 0; - node.jsDocCache = void 0; node.locals = void 0; node.nextContainer = void 0; return node; @@ -16287,7 +16200,6 @@ function createNodeFactory(flags, baseFactory2) { node.statements = createNodeArray(statements); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateCaseClause(node, expression, statements) { @@ -16339,12 +16251,10 @@ function createNodeFactory(flags, baseFactory2) { node.name = asName(name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updatePropertyAssignment(node, name, initializer) { @@ -16352,7 +16262,6 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdatePropertyAssignment(updated, original) { if (updated !== original) { - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; @@ -16365,12 +16274,10 @@ function createNodeFactory(flags, baseFactory2) { node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; node.equalsToken = void 0; - node.illegalDecorators = void 0; node.modifiers = void 0; node.questionToken = void 0; node.exclamationToken = void 0; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { @@ -16378,11 +16285,10 @@ function createNodeFactory(flags, baseFactory2) { } function finishUpdateShorthandPropertyAssignment(updated, original) { if (updated !== original) { - updated.equalsToken = original.equalsToken; - updated.illegalDecorators = original.illegalDecorators; updated.modifiers = original.modifiers; updated.questionToken = original.questionToken; updated.exclamationToken = original.exclamationToken; + updated.equalsToken = original.equalsToken; } return update(updated, original); } @@ -16391,7 +16297,6 @@ function createNodeFactory(flags, baseFactory2) { node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateSpreadAssignment(node, expression) { @@ -16403,7 +16308,6 @@ function createNodeFactory(flags, baseFactory2) { node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; node.jsDoc = void 0; - node.jsDocCache = void 0; return node; } function updateEnumMember(node, name, initializer) { @@ -16585,18 +16489,18 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createSyntaxList(children) { - const node = createBaseNode(353 /* SyntaxList */); + const node = createBaseNode(354 /* SyntaxList */); node._children = children; return node; } function createNotEmittedStatement(original) { - const node = createBaseNode(354 /* NotEmittedStatement */); + const node = createBaseNode(355 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; } function createPartiallyEmittedExpression(expression, original) { - const node = createBaseNode(355 /* PartiallyEmittedExpression */); + const node = createBaseNode(356 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; @@ -16618,7 +16522,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createCommaListExpression(elements) { - const node = createBaseNode(356 /* CommaListExpression */); + const node = createBaseNode(357 /* CommaListExpression */); node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -16627,19 +16531,19 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; } function createEndOfDeclarationMarker(original) { - const node = createBaseNode(358 /* EndOfDeclarationMarker */); + const node = createBaseNode(359 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createMergeDeclarationMarker(original) { - const node = createBaseNode(357 /* MergeDeclarationMarker */); + const node = createBaseNode(358 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(359 /* SyntheticReferenceExpression */); + const node = createBaseNode(360 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); @@ -16649,36 +16553,32 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node; } function cloneGeneratedIdentifier(node) { - const clone2 = createBaseIdentifier( - node.escapedText, - /*originalKeywordKind*/ - void 0 - ); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function cloneIdentifier(node) { - const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind); + const clone2 = createBaseIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.typeArguments = node.typeArguments; - clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape; clone2.jsDoc = node.jsDoc; - clone2.jsDocCache = node.jsDocCache; clone2.flowNode = node.flowNode; clone2.symbol = node.symbol; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + const typeArguments = getIdentifierTypeArguments(node); + if (typeArguments) + setIdentifierTypeArguments(clone2, typeArguments); return clone2; } function cloneGeneratedPrivateIdentifier(node) { const clone2 = createBasePrivateIdentifier(node.escapedText); clone2.flags |= node.flags & ~8 /* Synthesized */; - clone2.autoGenerate = { ...node.autoGenerate }; clone2.transformFlags = node.transformFlags; setOriginalNode(clone2, node); + setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function clonePrivateIdentifier(node) { @@ -16847,6 +16747,9 @@ function createNodeFactory(flags, baseFactory2) { function createObjectDefinePropertyCall(target, propertyName, attributes) { return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); } + function createObjectGetOwnPropertyDescriptorCall(target, propertyName) { + return createGlobalMethodCall("Object", "getOwnPropertyDescriptor", [target, asExpression(propertyName)]); + } function createReflectGetCall(target, propertyKey, receiver) { return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); } @@ -16883,7 +16786,7 @@ function createNodeFactory(flags, baseFactory2) { return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); case 232 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } @@ -17419,7 +17322,7 @@ function getTransformFlagsSubtreeExclusions(kind) { case 213 /* TypeAssertionExpression */: case 235 /* SatisfiesExpression */: case 231 /* AsExpression */: - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: case 214 /* ParenthesizedExpression */: case 106 /* SuperKeyword */: return -2147483648 /* OuterExpressionExcludes */; @@ -17455,6 +17358,7 @@ function setOriginalNode(node, original) { function mergeEmitNode(sourceEmitNode, destEmitNode) { const { flags, + internalFlags, leadingComments, trailingComments, commentRange, @@ -17472,7 +17376,9 @@ function mergeEmitNode(sourceEmitNode, destEmitNode) { if (trailingComments) destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); if (flags) - destEmitNode.flags = flags & ~536870912 /* Immutable */; + destEmitNode.flags = flags; + if (internalFlags) + destEmitNode.internalFlags = internalFlags & ~8 /* Immutable */; if (commentRange) destEmitNode.commentRange = commentRange; if (sourceMapRange) @@ -17514,7 +17420,7 @@ function getOrCreateEmitNode(node) { } node.emitNode = {}; } else { - Debug.assert(!(node.emitNode.flags & 536870912 /* Immutable */), "Invalid attempt to mutate an immutable node."); + Debug.assert(!(node.emitNode.internalFlags & 8 /* Immutable */), "Invalid attempt to mutate an immutable node."); } return node.emitNode; } @@ -17546,6 +17452,18 @@ function getSyntheticTrailingComments(node) { var _a2; return (_a2 = node.emitNode) == null ? void 0 : _a2.trailingComments; } +function setIdentifierTypeArguments(node, typeArguments) { + getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; + return node; +} +function getIdentifierTypeArguments(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments; +} +function setIdentifierAutoGenerate(node, autoGenerate) { + getOrCreateEmitNode(node).autoGenerate = autoGenerate; + return node; +} // src/compiler/factory/emitHelpers.ts function helperString(input, ...args) { @@ -17832,7 +17750,7 @@ function isMetaProperty(node) { return node.kind === 233 /* MetaProperty */; } function isCommaListExpression(node) { - return node.kind === 356 /* CommaListExpression */; + return node.kind === 357 /* CommaListExpression */; } function isTemplateSpan(node) { return node.kind === 236 /* TemplateSpan */; @@ -17913,7 +17831,7 @@ function isExportSpecifier(node) { return node.kind === 278 /* ExportSpecifier */; } function isNotEmittedStatement(node) { - return node.kind === 354 /* NotEmittedStatement */; + return node.kind === 355 /* NotEmittedStatement */; } function isExternalModuleReference(node) { return node.kind === 280 /* ExternalModuleReference */; @@ -17999,6 +17917,9 @@ function isJSDocTypeTag(node) { function isJSDocTemplateTag(node) { return node.kind === 348 /* JSDocTemplateTag */; } +function isJSDocSatisfiesTag(node) { + return node.kind === 353 /* JSDocSatisfiesTag */; +} // src/compiler/factory/utilities.ts function isLocalName(node) { @@ -18019,8 +17940,11 @@ function findUseStrictPrologue(statements) { } return void 0; } +function isCommaExpression(node) { + return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */; +} function isCommaSequence(node) { - return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 356 /* CommaListExpression */; + return isCommaExpression(node) || isCommaListExpression(node); } function isJSDocTypeAssertion(node) { return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node); @@ -18034,11 +17958,12 @@ function isOuterExpression(node, kinds = 15 /* All */) { return (kinds & 1 /* Parentheses */) !== 0; case 213 /* TypeAssertionExpression */: case 231 /* AsExpression */: + case 230 /* ExpressionWithTypeArguments */: case 235 /* SatisfiesExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; case 232 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -18104,12 +18029,21 @@ function getJSDocTypeAliasName(fullName) { } } } -var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration); -var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken); -var isIdentifierOrThisTypeNode = or(isIdentifier, isThisTypeNode); -var isReadonlyKeywordOrPlusOrMinusToken = or(isReadonlyKeyword, isPlusToken, isMinusToken); -var isQuestionOrPlusOrMinusToken = or(isQuestionToken, isPlusToken, isMinusToken); -var isModuleName = or(isIdentifier, isStringLiteral); +function isQuestionOrExclamationToken(node) { + return isQuestionToken(node) || isExclamationToken(node); +} +function isIdentifierOrThisTypeNode(node) { + return isIdentifier(node) || isThisTypeNode(node); +} +function isReadonlyKeywordOrPlusOrMinusToken(node) { + return isReadonlyKeyword(node) || isPlusToken(node) || isMinusToken(node); +} +function isQuestionOrPlusOrMinusToken(node) { + return isQuestionToken(node) || isPlusToken(node) || isMinusToken(node); +} +function isModuleName(node) { + return isIdentifier(node) || isStringLiteral(node); +} function isExponentiationOperator(kind) { return kind === 42 /* AsteriskAsteriskToken */; } @@ -18382,7 +18316,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); }, [300 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); }, [301 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); @@ -18397,7 +18331,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, [299 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); }, [257 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); @@ -18406,7 +18340,7 @@ var forEachChildTable = { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [178 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [182 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -18423,7 +18357,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, [173 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [174 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -18432,7 +18366,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [259 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, [215 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); @@ -18441,7 +18375,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); }, [172 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); }, [180 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); @@ -18562,7 +18496,7 @@ var forEachChildTable = { return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); }, [240 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); }, [258 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.declarations); @@ -18626,25 +18560,25 @@ var forEachChildTable = { [260 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, [228 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, [261 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); }, [262 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); }, [263 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); }, [302 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, [264 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); }, [268 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); }, [269 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [270 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); @@ -18656,7 +18590,7 @@ var forEachChildTable = { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); }, [267 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); }, [271 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); @@ -18667,12 +18601,12 @@ var forEachChildTable = { [272 /* NamedImports */]: forEachChildInNamedImportsOrExports, [276 /* NamedExports */]: forEachChildInNamedImportsOrExports, [275 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); }, [273 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, [278 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, [274 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); }, [225 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); @@ -18699,9 +18633,9 @@ var forEachChildTable = { return visitNode2(cbNode, node.expression); }, [279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers); + return visitNodes(cbNode, cbNodes, node.modifiers); }, - [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, [281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { @@ -18773,6 +18707,7 @@ var forEachChildTable = { [347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, [346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, [343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, + [353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, [352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, [342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, [326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { @@ -18792,7 +18727,7 @@ var forEachChildTable = { [339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, [334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, [340 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression + [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -19756,8 +19691,6 @@ var Parser; const pos = getNodePos(); const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( "", - /*typeArguments*/ - void 0, /*originalKeywordKind*/ void 0 ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode( @@ -19792,13 +19725,7 @@ var Parser; const text = internIdentifier(scanner.getTokenValue()); const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind, - hasExtendedUnicodeEscape - ), pos); + return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); @@ -19909,7 +19836,7 @@ var Parser; } } function canFollowExportModifier() { - return token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); + return token() === 59 /* AtToken */ || token() !== 41 /* AsteriskToken */ && token() !== 128 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); } function nextTokenCanFollowExportModifier() { nextToken(); @@ -19923,7 +19850,7 @@ var Parser; } function nextTokenCanFollowDefaultKeyword() { nextToken(); - return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); + return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ || token() === 118 /* InterfaceKeyword */ || token() === 59 /* AtToken */ || token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); } function isListElement(parsingContext2, inErrorRecovery) { const node = currentNode(parsingContext2); @@ -20140,6 +20067,7 @@ var Parser; return parseElement(); } function currentNode(parsingContext2, pos) { + var _a2; if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { return void 0; } @@ -20154,8 +20082,8 @@ var Parser; if (!canReuseNode(node, parsingContext2)) { return void 0; } - if (canHaveJSDoc(node) && node.jsDocCache) { - node.jsDocCache = void 0; + if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) { + node.jsDoc.jsDocCache = void 0; } return node; } @@ -20214,7 +20142,7 @@ var Parser; return true; case 171 /* MethodDeclaration */: const methodDeclaration = node; - const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 135 /* ConstructorKeyword */; + const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; } } @@ -20436,13 +20364,10 @@ var Parser; function parseEntityName(allowReservedWords, diagnosticMessage) { const pos = getNodePos(); let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); - let dotPos = getNodePos(); while (parseOptional(24 /* DotToken */)) { if (token() === 29 /* LessThanToken */) { - entity.jsdocDotPos = dotPos; break; } - dotPos = getNodePos(); entity = finishNode( factory2.createQualifiedName( entity, @@ -20772,6 +20697,8 @@ var Parser; function parseTypeParameter() { const pos = getNodePos(); const modifiers = parseModifiers( + /*allowDecorators*/ + false, /*permitConstAsModifier*/ true ); @@ -20824,10 +20751,16 @@ var Parser; function parseParameterWorker(inOuterAwaitContext, allowAmbiguity = true) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : doOutsideOfAwaitContext(parseDecorators); + const modifiers = inOuterAwaitContext ? doInAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )) : doOutsideOfAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )); if (token() === 108 /* ThisKeyword */) { const node2 = factory2.createParameterDeclaration( - decorators, + modifiers, /*dotDotDotToken*/ void 0, createIdentifier( @@ -20840,14 +20773,14 @@ var Parser; /*initializer*/ void 0 ); - if (decorators) { - parseErrorAtRange(decorators[0], Diagnostics.Decorators_may_not_be_applied_to_this_parameters); + const modifier = firstOrUndefined(modifiers); + if (modifier) { + parseErrorAtRange(modifier, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); } return withJSDoc(finishNode(node2, pos), hasJSDoc); } const savedTopLevel = topLevel; topLevel = false; - const modifiers = combineDecoratorsAndModifiers(decorators, parseModifiers()); const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); if (!allowAmbiguity && !isParameterNameStart()) { return void 0; @@ -20959,7 +20892,7 @@ var Parser; nextToken(); return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } - function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( /*inOuterAwaitContext*/ false @@ -20967,7 +20900,6 @@ var Parser; const type = parseTypeAnnotation(); parseTypeMemberSemicolon(); const node = factory2.createIndexSignature(modifiers, parameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { @@ -21022,37 +20954,18 @@ var Parser; } const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 174 /* GetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 4 /* Type */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers, - 175 /* SetAccessor */, - 4 /* Type */ - ); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 4 /* Type */); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration( - pos, - hasJSDoc, - /*decorators*/ - void 0, - modifiers - ); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); } @@ -21532,7 +21445,10 @@ var Parser; } function skipParameterStart() { if (isModifierKind(token())) { - parseModifiers(); + parseModifiers( + /*allowDecorators*/ + false + ); } if (isIdentifier2() || token() === 108 /* ThisKeyword */) { nextToken(); @@ -21660,6 +21576,7 @@ var Parser; case 133 /* AwaitKeyword */: case 125 /* YieldKeyword */: case 80 /* PrivateIdentifier */: + case 59 /* AtToken */: return true; default: if (isBinaryOperator2()) { @@ -22751,6 +22668,8 @@ var Parser; break; } return parseFunctionExpression(); + case 59 /* AtToken */: + return parseDecoratedExpression(); case 84 /* ClassKeyword */: return parseClassExpression(); case 98 /* FunctionKeyword */: @@ -22818,13 +22737,15 @@ var Parser; ); return withJSDoc(finishNode(factory2.createSpreadAssignment(expression), pos), hasJSDoc); } - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const tokenIsIdentifier = isIdentifier2(); @@ -22832,7 +22753,7 @@ var Parser; const questionToken = parseOptionalToken(57 /* QuestionToken */); const exclamationToken = parseOptionalToken(53 /* ExclamationToken */); if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken); + return parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken); } let node; const isShorthandPropertyAssignment2 = tokenIsIdentifier && token() !== 58 /* ColonToken */; @@ -22852,7 +22773,6 @@ var Parser; )); node = factory2.createPropertyAssignment(name, initializer); } - node.illegalDecorators = decorators; node.modifiers = modifiers; node.questionToken = questionToken; node.exclamationToken = exclamationToken; @@ -22880,7 +22800,10 @@ var Parser; ); const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); parseExpected(98 /* FunctionKeyword */); const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; @@ -23252,7 +23175,7 @@ var Parser; if (currentToken2 === 154 /* TypeKeyword */) { currentToken2 = lookAhead(nextToken); } - if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */) { + if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 88 /* DefaultKeyword */ || currentToken2 === 128 /* AsKeyword */ || currentToken2 === 59 /* AtToken */) { return true; } continue; @@ -23336,8 +23259,6 @@ var Parser; return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -23346,8 +23267,6 @@ var Parser; return parseVariableStatement( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -23357,8 +23276,6 @@ var Parser; return parseFunctionDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -23366,8 +23283,6 @@ var Parser; return parseClassDeclaration( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0 ); @@ -23430,8 +23345,10 @@ var Parser; function parseDeclaration() { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); - const modifiers = parseModifiers(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); const isAmbient = some(modifiers, isDeclareModifier); if (isAmbient) { const node = tryReuseAmbientDeclaration(pos); @@ -23441,9 +23358,9 @@ var Parser; for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); } else { - return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); + return parseDeclarationWorker(pos, hasJSDoc, modifiers); } } function tryReuseAmbientDeclaration(pos) { @@ -23454,41 +23371,41 @@ var Parser; } }); } - function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) { + function parseDeclarationWorker(pos, hasJSDoc, modifiersIn) { switch (token()) { case 113 /* VarKeyword */: case 119 /* LetKeyword */: case 85 /* ConstKeyword */: - return parseVariableStatement(pos, hasJSDoc, decorators, modifiers); + return parseVariableStatement(pos, hasJSDoc, modifiersIn); case 98 /* FunctionKeyword */: - return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseFunctionDeclaration(pos, hasJSDoc, modifiersIn); case 84 /* ClassKeyword */: - return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassDeclaration(pos, hasJSDoc, modifiersIn); case 118 /* InterfaceKeyword */: - return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseInterfaceDeclaration(pos, hasJSDoc, modifiersIn); case 154 /* TypeKeyword */: - return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseTypeAliasDeclaration(pos, hasJSDoc, modifiersIn); case 92 /* EnumKeyword */: - return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseEnumDeclaration(pos, hasJSDoc, modifiersIn); case 159 /* GlobalKeyword */: case 142 /* ModuleKeyword */: case 143 /* NamespaceKeyword */: - return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseModuleDeclaration(pos, hasJSDoc, modifiersIn); case 100 /* ImportKeyword */: - return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiersIn); case 93 /* ExportKeyword */: nextToken(); switch (token()) { case 88 /* DefaultKeyword */: case 63 /* EqualsToken */: - return parseExportAssignment(pos, hasJSDoc, decorators, modifiers); + return parseExportAssignment(pos, hasJSDoc, modifiersIn); case 128 /* AsKeyword */: - return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseNamespaceExportDeclaration(pos, hasJSDoc, modifiersIn); default: - return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseExportDeclaration(pos, hasJSDoc, modifiersIn); } default: - if (decorators || modifiers) { + if (modifiersIn) { const missing = createMissingNode( 279 /* MissingDeclaration */, /*reportAtCurrentPosition*/ @@ -23496,8 +23413,7 @@ var Parser; Diagnostics.Declaration_expected ); setTextRangePos(missing, pos); - missing.illegalDecorators = decorators; - missing.modifiers = modifiers; + missing.modifiers = modifiersIn; return missing; } return void 0; @@ -23630,17 +23546,16 @@ var Parser; function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } - function parseVariableStatement(pos, hasJSDoc, decorators, modifiers) { + function parseVariableStatement(pos, hasJSDoc, modifiers) { const declarationList = parseVariableDeclarationList( /*inForStatementInitializer*/ false ); parseSemicolon(); const node = factory2.createVariableStatement(modifiers, declarationList); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); const modifierFlags = modifiersToFlags(modifiers); parseExpected(98 /* FunctionKeyword */); @@ -23663,7 +23578,6 @@ var Parser; const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, Diagnostics.or_expected); setAwaitContext(savedAwaitContext); const node = factory2.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseConstructorName() { @@ -23677,7 +23591,7 @@ var Parser; }); } } - function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) { + function tryParseConstructorDeclaration(pos, hasJSDoc, modifiers) { return tryParse(() => { if (parseConstructorName()) { const typeParameters = parseTypeParameters(); @@ -23689,14 +23603,13 @@ var Parser; ); const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected); const node = factory2.createConstructorDeclaration(modifiers, parameters, body); - node.illegalDecorators = decorators; node.typeParameters = typeParameters; node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } }); } - function parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { + function parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; const typeParameters = parseTypeParameters(); @@ -23708,7 +23621,7 @@ var Parser; ); const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage); const node = factory2.createMethodDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, asteriskToken, name, questionToken, @@ -23720,13 +23633,13 @@ var Parser; node.exclamationToken = exclamationToken; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken) { + function parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken) { const exclamationToken = !questionToken && !scanner.hasPrecedingLineBreak() ? parseOptionalToken(53 /* ExclamationToken */) : void 0; const type = parseTypeAnnotation(); const initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer); parseSemicolonAfterPropertyName(name, type, initializer); const node = factory2.createPropertyDeclaration( - combineDecoratorsAndModifiers(decorators, modifiers), + modifiers, name, questionToken || exclamationToken, type, @@ -23734,7 +23647,7 @@ var Parser; ); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers) { const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); const name = parsePropertyName(); const questionToken = parseOptionalToken(57 /* QuestionToken */); @@ -23742,7 +23655,6 @@ var Parser; return parseMethodDeclaration( pos, hasJSDoc, - decorators, modifiers, asteriskToken, name, @@ -23752,9 +23664,9 @@ var Parser; Diagnostics.or_expected ); } - return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken); + return parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken); } - function parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, kind, flags) { + function parseAccessorDeclaration(pos, hasJSDoc, modifiers, kind, flags) { const name = parsePropertyName(); const typeParameters = parseTypeParameters(); const parameters = parseParameters(0 /* None */); @@ -23764,7 +23676,7 @@ var Parser; false ); const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body); + const node = kind === 174 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); node.typeParameters = typeParameters; if (isSetAccessorDeclaration(node)) node.type = type; @@ -23810,11 +23722,10 @@ var Parser; } return false; } - function parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers) { parseExpectedToken(124 /* StaticKeyword */); const body = parseClassStaticBlockBody(); const node = withJSDoc(finishNode(factory2.createClassStaticBlockDeclaration(body), pos), hasJSDoc); - node.illegalDecorators = decorators; node.modifiers = modifiers; return node; } @@ -23854,15 +23765,7 @@ var Parser; const expression = doInDecoratorContext(parseDecoratorExpression); return finishNode(factory2.createDecorator(expression), pos); } - function parseDecorators() { - const pos = getNodePos(); - let list, decorator; - while (decorator = tryParseDecorator()) { - list = append(list, decorator); - } - return list && createNodeArray(list, pos); - } - function tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { + function tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); const kind = token(); if (token() === 85 /* ConstKeyword */ && permitConstAsModifier) { @@ -23880,23 +23783,26 @@ var Parser; } return finishNode(factory2.createToken(kind), pos); } - function combineDecoratorsAndModifiers(decorators, modifiers) { - if (!decorators) - return modifiers; - if (!modifiers) - return decorators; - const decoratorsAndModifiers = factory2.createNodeArray(concatenate(decorators, modifiers)); - setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end); - return decoratorsAndModifiers; - } - function parseModifiers(permitConstAsModifier, stopOnStartOfClassStaticBlock) { + function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); - let list, modifier, hasSeenStatic = false; - while (modifier = tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) { + let list; + let modifier, hasSeenStaticModifier = false; + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) - hasSeenStatic = true; + hasSeenStaticModifier = true; list = append(list, modifier); } + if (allowDecorators && token() === 59 /* AtToken */) { + let decorator; + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { + if (modifier.kind === 124 /* StaticKeyword */) + hasSeenStaticModifier = true; + list = append(list, modifier); + } + } return list && createNodeArray(list, pos); } function parseModifiersForArrowFunction() { @@ -23916,30 +23822,31 @@ var Parser; return finishNode(factory2.createSemicolonClassElement(), pos); } const hasJSDoc = hasPrecedingJSDocComment(); - const decorators = parseDecorators(); const modifiers = parseModifiers( + /*allowDecorators*/ + true, /*permitConstAsModifier*/ true, /*stopOnStartOfClassStaticBlock*/ true ); if (token() === 124 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { - return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); } if (parseContextualModifier(137 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 174 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 174 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(151 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 175 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 175 /* SetAccessor */, 0 /* None */); } if (token() === 135 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { - const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); + const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); if (constructorDeclaration) { return constructorDeclaration; } } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); } if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) { const isAmbient = some(modifiers, isDeclareModifier); @@ -23947,12 +23854,12 @@ var Parser; for (const m of modifiers) { m.flags |= 16777216 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers)); + return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); } else { - return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); + return parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers); } } - if (decorators || modifiers) { + if (modifiers) { const name = createMissingNode( 79 /* Identifier */, /*reportAtCurrentPosition*/ @@ -23962,7 +23869,6 @@ var Parser; return parsePropertyDeclaration( pos, hasJSDoc, - decorators, modifiers, name, /*questionToken*/ @@ -23971,21 +23877,39 @@ var Parser; } return Debug.fail("Should not have attempted to parse class member declaration."); } + function parseDecoratedExpression() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); + if (token() === 84 /* ClassKeyword */) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 228 /* ClassExpression */); + } + const missing = createMissingNode( + 279 /* MissingDeclaration */, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Expression_expected + ); + setTextRangePos(missing, pos); + missing.modifiers = modifiers; + return missing; + } function parseClassExpression() { return parseClassDeclarationOrExpression( getNodePos(), hasPrecedingJSDocComment(), - /*decorators*/ - void 0, /*modifiers*/ void 0, 228 /* ClassExpression */ ); } - function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 260 /* ClassDeclaration */); + function parseClassDeclaration(pos, hasJSDoc, modifiers) { + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 260 /* ClassDeclaration */); } - function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { + function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { const savedAwaitContext = inAwaitContext(); parseExpected(84 /* ClassKeyword */); const name = parseNameOfClassDeclarationOrExpression(); @@ -24004,7 +23928,7 @@ var Parser; members = createMissingList(); } setAwaitContext(savedAwaitContext); - const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members); + const node = kind === 260 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseNameOfClassDeclarationOrExpression() { @@ -24045,17 +23969,16 @@ var Parser; function parseClassMembers() { return parseList(ParsingContext.ClassMembers, parseClassElement); } - function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); const heritageClauses = parseHeritageClauses(); const members = parseObjectTypeMembers(); const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) { parseExpected(154 /* TypeKeyword */); const name = parseIdentifier(); const typeParameters = parseTypeParameters(); @@ -24063,7 +23986,6 @@ var Parser; const type = token() === 139 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); parseSemicolon(); const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseEnumMember() { @@ -24073,7 +23995,7 @@ var Parser; const initializer = allowInAnd(parseInitializer); return withJSDoc(finishNode(factory2.createEnumMember(name, initializer), pos), hasJSDoc); } - function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseEnumDeclaration(pos, hasJSDoc, modifiers) { parseExpected(92 /* EnumKeyword */); const name = parseIdentifier(); let members; @@ -24084,7 +24006,6 @@ var Parser; members = createMissingList(); } const node = factory2.createEnumDeclaration(modifiers, name, members); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseModuleBlock() { @@ -24098,24 +24019,21 @@ var Parser; } return finishNode(factory2.createModuleBlock(statements), pos); } - function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags) { + function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) { const namespaceFlag = flags & 16 /* Namespace */; const name = parseIdentifier(); const body = parseOptional(24 /* DotToken */) ? parseModuleOrNamespaceDeclaration( getNodePos(), /*hasJSDoc*/ false, - /*decorators*/ - void 0, /*modifiers*/ void 0, 4 /* NestedNamespace */ | namespaceFlag ) : parseModuleBlock(); const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; let name; if (token() === 159 /* GlobalKeyword */) { @@ -24131,23 +24049,22 @@ var Parser; } else { parseSemicolon(); } - const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - node.illegalDecorators = decorators; + const node = factory2.createModuleDeclaration(modifiersIn, name, body, flags); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; if (token() === 159 /* GlobalKeyword */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } else if (parseOptional(143 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { parseExpected(142 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } } - return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); + return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiersIn, flags); } function isExternalModuleReference2() { return token() === 147 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); @@ -24161,17 +24078,16 @@ var Parser; function nextTokenIsSlash() { return nextToken() === 43 /* SlashToken */; } - function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseNamespaceExportDeclaration(pos, hasJSDoc, modifiers) { parseExpected(128 /* AsKeyword */); parseExpected(143 /* NamespaceKeyword */); const name = parseIdentifier(); parseSemicolon(); const node = factory2.createNamespaceExportDeclaration(name); - node.illegalDecorators = decorators; node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) { parseExpected(100 /* ImportKeyword */); const afterImportPos = scanner.getStartPos(); let identifier; @@ -24184,7 +24100,7 @@ var Parser; identifier = isIdentifier2() ? parseIdentifier() : void 0; } if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { - return parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly); + return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly); } let importClause; if (identifier || // import id @@ -24200,7 +24116,6 @@ var Parser; } parseSemicolon(); const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseAssertEntry() { @@ -24259,12 +24174,11 @@ var Parser; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { return token() === 27 /* CommaToken */ || token() === 158 /* FromKeyword */; } - function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { + function parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly) { parseExpected(63 /* EqualsToken */); const moduleReference = parseModuleReference(); parseSemicolon(); const node = factory2.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); - node.illegalDecorators = decorators; const finished = withJSDoc(finishNode(node, pos), hasJSDoc); return finished; } @@ -24374,7 +24288,7 @@ var Parser; function parseNamespaceExport(pos) { return finishNode(factory2.createNamespaceExport(parseIdentifierName()), pos); } - function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + function parseExportDeclaration(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -24404,10 +24318,9 @@ var Parser; parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) { + function parseExportAssignment(pos, hasJSDoc, modifiers) { const savedAwaitContext = inAwaitContext(); setAwaitContext( /*value*/ @@ -24426,7 +24339,6 @@ var Parser; parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory2.createExportAssignment(modifiers, isExportEquals, expression); - node.illegalDecorators = decorators; return withJSDoc(finishNode(node, pos), hasJSDoc); } let ParsingContext; @@ -24810,6 +24722,9 @@ var Parser; case "overload": tag = parseOverloadTag(start2, tagName, margin, indentText); break; + case "satisfies": + tag = parseSatisfiesTag(start2, tagName, margin, indentText); + break; case "see": tag = parseSeeTag(start2, tagName, margin, indentText); break; @@ -25118,6 +25033,14 @@ var Parser; const className = parseExpressionWithTypeArgumentsForAugments(); return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); } + function parseSatisfiesTag(start2, tagName, margin, indentText) { + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + false + ); + const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0; + return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2); + } function parseExpressionWithTypeArgumentsForAugments() { const usedBrace = parseOptional(18 /* OpenBraceToken */); const pos = getNodePos(); @@ -25222,7 +25145,7 @@ var Parser; return finishNode(jsDocNamespaceNode, pos); } if (nested) { - typeNameOrNamespaceName.isInJSDocNamespace = true; + typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */; } return typeNameOrNamespaceName; } @@ -25426,12 +25349,7 @@ var Parser; const end2 = scanner.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner.getTokenValue()); - const result = finishNode(factory2.createIdentifier( - text, - /*typeArguments*/ - void 0, - originalKeywordKind - ), pos, end2); + const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -26053,6 +25971,7 @@ var libEntries = [ ["es2020", "lib.es2020.d.ts"], ["es2021", "lib.es2021.d.ts"], ["es2022", "lib.es2022.d.ts"], + ["es2023", "lib.es2023.d.ts"], ["esnext", "lib.esnext.d.ts"], // Host only ["dom", "lib.dom.d.ts"], @@ -26106,14 +26025,17 @@ var libEntries = [ ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"], ["es2022.string", "lib.es2022.string.d.ts"], ["es2022.regexp", "lib.es2022.regexp.d.ts"], - ["esnext.array", "lib.es2022.array.d.ts"], + ["es2023.array", "lib.es2023.array.d.ts"], + ["esnext.array", "lib.es2023.array.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.es2022.string.d.ts"], ["esnext.promise", "lib.es2021.promise.d.ts"], - ["esnext.weakref", "lib.es2021.weakref.d.ts"] + ["esnext.weakref", "lib.es2021.weakref.d.ts"], + ["decorators", "lib.decorators.d.ts"], + ["decorators.legacy", "lib.decorators.legacy.d.ts"] ]; var libs = libEntries.map((entry) => entry[0]); var libMap = new Map(libEntries); @@ -26656,6 +26578,13 @@ var commandOptionsWithoutBuild = [ transpileOptionValue: true, defaultValueDescription: false }, + { + name: "verbatimModuleSyntax", + type: "boolean", + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting, + defaultValueDescription: false + }, // Strict Type Checks { name: "strict", @@ -26957,7 +26886,7 @@ var commandOptionsWithoutBuild = [ { name: "allowImportingTsExtensions", type: "boolean", - affectsModuleResolution: true, + affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, defaultValueDescription: false @@ -27021,10 +26950,11 @@ var commandOptionsWithoutBuild = [ { name: "experimentalDecorators", type: "boolean", + affectsEmit: true, affectsSemanticDiagnostics: true, affectsBuildInfo: true, category: Diagnostics.Language_and_Environment, - description: Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators, + description: Diagnostics.Enable_experimental_support_for_legacy_experimental_decorators, defaultValueDescription: false }, { @@ -27138,7 +27068,7 @@ var commandOptionsWithoutBuild = [ paramType: Diagnostics.NEWLINE, category: Diagnostics.Emit, description: Diagnostics.Set_the_newline_character_for_emitting_files, - defaultValueDescription: Diagnostics.Platform_specific + defaultValueDescription: "lf" }, { name: "noErrorTruncation", @@ -27314,7 +27244,7 @@ var commandOptionsWithoutBuild = [ affectsModuleResolution: true, category: Diagnostics.Interop_Constraints, description: Diagnostics.Ensure_that_casing_is_correct_in_imports, - defaultValueDescription: false + defaultValueDescription: true }, { name: "maxNodeModuleJsDepth", @@ -27438,14 +27368,6 @@ var buildOpts = [ ...optionsForBuild ]; var typeAcquisitionDeclarations = [ - { - /* @deprecated typingOptions.enableAutoDiscovery - * Use typeAcquisition.enable instead. - */ - name: "enableAutoDiscovery", - type: "boolean", - defaultValueDescription: false - }, { name: "enable", type: "boolean", @@ -27627,12 +27549,6 @@ function getTsconfigRootOptionsMap() { elementOptions: getCommandLineWatchOptionsMap(), extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics }, - { - name: "typingOptions", - type: "object", - elementOptions: getCommandLineTypeAcquisitionMap(), - extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics - }, { name: "typeAcquisition", type: "object", @@ -27947,6 +27863,7 @@ function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNam return !hasExtension(pathToCheck) && excludeRegex.test(ensureTrailingDirectorySeparator(pathToCheck)); } function specToDiagnostic(spec, disallowTrailingRecursion) { + Debug.assert(typeof spec === "string"); if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return [Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; } else if (invalidDotDotAfterRecursiveWildcard(spec)) { @@ -28000,7 +27917,7 @@ function formatExtensions(extensions) { result.push("JSON"); return result.join(", "); } -function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) { +function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations); @@ -28018,7 +27935,8 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra }, failedLookupLocations: initializeResolutionField(failedLookupLocations), affectingLocations: initializeResolutionField(affectingLocations), - resolutionDiagnostics: initializeResolutionField(diagnostics) + resolutionDiagnostics: initializeResolutionField(diagnostics), + node10Result: legacyResult }; } function initializeResolutionField(value) { @@ -28470,7 +28388,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference); } function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) { - var _a2, _b; + var _a2, _b, _c, _d; const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations = []; const affectingLocations = []; @@ -28497,44 +28415,60 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) { const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */); const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */); - result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0; + result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0; } else { - result = tryResolve(extensions); + result = tryResolve(extensions, state); + } + let legacyResult; + if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) { + traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update); + const diagnosticState = { + ...state, + features: state.features & ~8 /* Exports */, + failedLookupLocations: [], + affectingLocations: [], + reportDiagnostic: noop + }; + const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState); + if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) { + legacyResult = diagnosticResult.value.resolved.path; + } } return createResolvedModuleWithFailedLookupLocations( - (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved, - (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport, + (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, + (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state.resultFromCache, + legacyResult ); - function tryResolve(extensions2) { - const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName( + function tryResolve(extensions2, state2) { + const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName( extensions3, candidate, onlyRecordFailures, - state2, + state3, /*considerPackageJson*/ true ); - const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state); + const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2); if (resolved) { return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) }); } if (!isExternalModuleNameRelative(moduleName)) { let resolved2; if (features & 2 /* Imports */ && startsWith(moduleName, "#")) { - resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2 && features & 4 /* SelfName */) { - resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) { if (traceEnabled) { trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2)); } - resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); + resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) return void 0; @@ -28553,7 +28487,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, candidate, /*onlyRecordFailures*/ false, - state, + state2, /*considerPackageJson*/ true ); @@ -29710,7 +29644,7 @@ function getModuleInstanceStateWorker(node, visited) { case 264 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { return 0 /* NonInstantiated */; } } @@ -30139,6 +30073,7 @@ function createBinder() { } else if (containerFlags & 64 /* IsInterface */) { seenThisKeyword = false; bindChildren(node); + Debug.assertNotNode(node, isIdentifier); node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */; } else { bindChildren(node); @@ -30439,13 +30374,12 @@ function createBinder() { } else if (node.kind === 221 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 223 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); + return isLogicalOrCoalescingBinaryExpression(node); } } } function isLogicalAssignmentExpression(node) { - node = skipParentheses(node); - return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind); + return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node)); } function isTopLevelLogicalExpression(node) { while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) { @@ -30828,7 +30762,7 @@ function createBinder() { }; } const operator = node.operatorToken.kind; - if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */ || isLogicalOrCoalescingAssignmentOperator(operator)) { + if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) { if (isTopLevelLogicalExpression(node)) { const postExpressionLabel = createBranchLabel(); bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); @@ -31298,13 +31232,17 @@ function createBinder() { } function checkContextualIdentifier(node) { if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) { - if (inStrictMode && node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 125 /* LastFutureReservedWord */) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind === void 0) { + return; + } + if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, getStrictModeIdentifierMessage(node), declarationNameToString(node) )); - } else if (node.originalKeywordKind === 133 /* AwaitKeyword */) { + } else if (originalKeywordKind === 133 /* AwaitKeyword */) { if (isExternalModule(file) && isInTopLevelContext(node)) { file.bindDiagnostics.push(createDiagnosticForNode2( node, @@ -31318,7 +31256,7 @@ function createBinder() { declarationNameToString(node) )); } - } else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { + } else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { file.bindDiagnostics.push(createDiagnosticForNode2( node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, @@ -31530,7 +31468,7 @@ function createBinder() { function bindWorker(node) { switch (node.kind) { case 79 /* Identifier */: - if (node.isInJSDocNamespace) { + if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { let parentNode = node.parent; while (parentNode && !isJSDocTypeAlias(parentNode)) { parentNode = parentNode.parent; @@ -32646,13 +32584,10 @@ var JsxNames; // src/compiler/visitorPublic.ts function visitNode(node, visitor, test, lift) { - if (node === void 0 || visitor === void 0) { + if (node === void 0) { return node; } const visited = visitor(node); - if (visited === node) { - return node; - } let visitedNode; if (visited === void 0) { return void 0; @@ -32665,7 +32600,7 @@ function visitNode(node, visitor, test, lift) { return visitedNode; } function visitNodes2(nodes, visitor, test, start, count) { - if (nodes === void 0 || visitor === void 0) { + if (nodes === void 0) { return nodes; } const length2 = nodes.length; @@ -32701,25 +32636,30 @@ function visitArrayWorker(nodes, visitor, test, start, count) { } for (let i = 0; i < count; i++) { const node = nodes[i + start]; - const visited = node !== void 0 ? visitor(node) : void 0; + const visited = node !== void 0 ? visitor ? visitor(node) : node : void 0; if (updated !== void 0 || visited === void 0 || visited !== node) { if (updated === void 0) { updated = nodes.slice(0, i); + Debug.assertEachNode(updated, test); } if (visited) { if (isArray(visited)) { for (const visitedNode of visited) { - void Debug.assertNode(visitedNode, test); + Debug.assertNode(visitedNode, test); updated.push(visitedNode); } } else { - void Debug.assertNode(visited, test); + Debug.assertNode(visited, test); updated.push(visited); } } } } - return updated != null ? updated : nodes; + if (updated) { + return updated; + } + Debug.assertEachNode(nodes, test); + return nodes; } function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict, nodesVisitor = visitNodes2) { context.startLexicalEnvironment(); @@ -32733,7 +32673,7 @@ function visitParameterList(nodes, visitor, context, nodesVisitor = visitNodes2) context.startLexicalEnvironment(); if (nodes) { context.setLexicalEnvironmentFlags(1 /* InParameters */, true); - updated = nodesVisitor(nodes, visitor, isParameterDeclaration); + updated = nodesVisitor(nodes, visitor, isParameter); if (context.getLexicalEnvironmentFlags() & 2 /* VariablesHoistedInParameters */ && getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { updated = addDefaultValueAssignmentsIfNeeded(updated, context); } @@ -32855,6 +32795,7 @@ function visitFunctionBody(node, visitor, context, nodeVisitor = visitNode) { function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { context.startBlockScope(); const updated = nodeVisitor(body, visitor, isStatement, context.factory.liftToBlock); + Debug.assert(updated); const declarations = context.endBlockScope(); if (some(declarations)) { if (isBlock(updated)) { @@ -32867,23 +32808,17 @@ function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { return updated; } var visitEachChildTable = { - [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateIdentifier( - node, - nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration) - ); - }, [163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateQualifiedName( node, - nodeVisitor(node.left, visitor, isEntityName), - nodeVisitor(node.right, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), + Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) ); }, [164 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateComputedPropertyName( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Signature elements @@ -32891,7 +32826,7 @@ var visitEachChildTable = { return context.factory.updateTypeParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.constraint, visitor, isTypeNode), nodeVisitor(node.default, visitor, isTypeNode) ); @@ -32900,9 +32835,9 @@ var visitEachChildTable = { return context.factory.updateParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -32910,7 +32845,7 @@ var visitEachChildTable = { [167 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDecorator( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Type elements @@ -32918,19 +32853,19 @@ var visitEachChildTable = { return context.factory.updatePropertySignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode) ); }, [169 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - var _a2; + var _a2, _b; return context.factory.updatePropertyDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration - nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken), + tokenVisitor ? nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken) : (_b = node.questionToken) != null ? _b : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -32939,10 +32874,10 @@ var visitEachChildTable = { return context.factory.updateMethodSignature( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -32950,9 +32885,9 @@ var visitEachChildTable = { return context.factory.updateMethodDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), @@ -32962,7 +32897,7 @@ var visitEachChildTable = { [173 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -32971,7 +32906,7 @@ var visitEachChildTable = { return context.factory.updateGetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor) @@ -32981,7 +32916,7 @@ var visitEachChildTable = { return context.factory.updateSetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor) ); @@ -32998,7 +32933,7 @@ var visitEachChildTable = { return context.factory.updateCallSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, @@ -33006,16 +32941,16 @@ var visitEachChildTable = { return context.factory.updateConstructSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), nodeVisitor(node.type, visitor, isTypeNode) ); }, [178 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexSignature( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, // Types @@ -33023,14 +32958,14 @@ var visitEachChildTable = { return context.factory.updateTypePredicateNode( node, nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), - nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode), + Debug.checkDefined(nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode)), nodeVisitor(node.type, visitor, isTypeNode) ); }, [180 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeReferenceNode( node, - nodeVisitor(node.typeName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -33038,8 +32973,8 @@ var visitEachChildTable = { return context.factory.updateFunctionTypeNode( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [182 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -33047,14 +32982,14 @@ var visitEachChildTable = { node, nodesVisitor(node.modifiers, visitor, isModifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [183 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeQueryNode( node, - nodeVisitor(node.exprName, visitor, isEntityName), + Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, @@ -33067,7 +33002,7 @@ var visitEachChildTable = { [185 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateArrayTypeNode( node, - nodeVisitor(node.elementType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) ); }, [186 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -33079,13 +33014,13 @@ var visitEachChildTable = { [187 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateOptionalTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [188 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateRestTypeNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [189 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -33103,22 +33038,22 @@ var visitEachChildTable = { [191 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConditionalTypeNode( node, - nodeVisitor(node.checkType, visitor, isTypeNode), - nodeVisitor(node.extendsType, visitor, isTypeNode), - nodeVisitor(node.trueType, visitor, isTypeNode), - nodeVisitor(node.falseType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.extendsType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.trueType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) ); }, [192 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInferTypeNode( node, - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration) + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) ); }, [202 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeNode( node, - nodeVisitor(node.argument, visitor, isTypeNode), + Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer), nodeVisitor(node.qualifier, visitor, isEntityName), nodesVisitor(node.typeArguments, visitor, isTypeNode), @@ -33128,45 +33063,45 @@ var visitEachChildTable = { [298 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeAssertionContainer( node, - nodeVisitor(node.assertClause, visitor, isAssertClause), + Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), node.multiLine ); }, [199 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateNamedTupleMember( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.type, visitor, isTypeNode) + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [193 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedType( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [195 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOperatorNode( node, - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [196 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexedAccessTypeNode( node, - nodeVisitor(node.objectType, visitor, isTypeNode), - nodeVisitor(node.indexType, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) ); }, [197 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMappedTypeNode( node, - nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken), - nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration), + tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)), nodeVisitor(node.nameType, visitor, isTypeNode), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken) : node.questionToken, nodeVisitor(node.type, visitor, isTypeNode), nodesVisitor(node.members, visitor, isTypeElement) ); @@ -33174,21 +33109,21 @@ var visitEachChildTable = { [198 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLiteralTypeNode( node, - nodeVisitor(node.literal, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) ); }, [200 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralType( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) ); }, [201 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralTypeSpan( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Binding patterns @@ -33207,9 +33142,9 @@ var visitEachChildTable = { [205 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBindingElement( node, - nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, nodeVisitor(node.propertyName, visitor, isPropertyName), - nodeVisitor(node.name, visitor, isBindingName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -33229,37 +33164,37 @@ var visitEachChildTable = { [208 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ) : context.factory.updatePropertyAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.name, visitor, isMemberName) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ); }, [209 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isElementAccessChain(node) ? context.factory.updateElementAccessChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ) : context.factory.updateElementAccessExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.argumentExpression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ); }, [210 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return isCallChain(node) ? context.factory.updateCallChain( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ) : context.factory.updateCallExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -33267,7 +33202,7 @@ var visitEachChildTable = { [211 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNewExpression( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), nodesVisitor(node.arguments, visitor, isExpression) ); @@ -33275,29 +33210,29 @@ var visitEachChildTable = { [212 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTaggedTemplateExpression( node, - nodeVisitor(node.tag, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.template, visitor, isTemplateLiteral) + Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) ); }, [213 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAssertion( node, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [214 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [215 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionExpression( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -33312,82 +33247,82 @@ var visitEachChildTable = { nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken)) : node.equalsGreaterThanToken, visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, [217 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDeleteExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [218 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOfExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [219 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVoidExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [220 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAwaitExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [221 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePrefixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [222 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePostfixUnaryExpression( node, - nodeVisitor(node.operand, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, [223 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBinaryExpression( node, - nodeVisitor(node.left, visitor, isExpression), - nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken), - nodeVisitor(node.right, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken)) : node.operatorToken, + Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) ); }, [224 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateConditionalExpression( node, - nodeVisitor(node.condition, visitor, isExpression), - nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), - nodeVisitor(node.whenTrue, visitor, isExpression), - nodeVisitor(node.colonToken, tokenVisitor, isColonToken), - nodeVisitor(node.whenFalse, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken)) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.whenTrue, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.colonToken, tokenVisitor, isColonToken)) : node.colonToken, + Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) ); }, [225 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateExpression( node, - nodeVisitor(node.head, visitor, isTemplateHead), + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateSpan) ); }, [226 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateYieldExpression( node, - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.expression, visitor, isExpression) ); }, [227 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadElement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [228 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -33403,45 +33338,45 @@ var visitEachChildTable = { [230 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionWithTypeArguments( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, [231 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAsExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [235 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSatisfiesExpression( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [232 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return isOptionalChain(node) ? context.factory.updateNonNullChain( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ) : context.factory.updateNonNullExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [233 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateMetaProperty( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Misc [236 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateSpan( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) ); }, // Element @@ -33454,21 +33389,21 @@ var visitEachChildTable = { [240 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVariableStatement( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.declarationList, visitor, isVariableDeclarationList) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) ); }, [241 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [242 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIfStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock)), nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) ); }, @@ -33476,13 +33411,13 @@ var visitEachChildTable = { return context.factory.updateDoStatement( node, visitIterationBody(node.statement, visitor, context, nodeVisitor), - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [244 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWhileStatement( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -33498,17 +33433,17 @@ var visitEachChildTable = { [246 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForInStatement( node, - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, [247 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateForOfStatement( node, - nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword), - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.expression, visitor, isExpression), + tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, @@ -33533,34 +33468,34 @@ var visitEachChildTable = { [251 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWithStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [252 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSwitchStatement( node, - nodeVisitor(node.expression, visitor, isExpression), - nodeVisitor(node.caseBlock, visitor, isCaseBlock) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) ); }, [253 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLabeledStatement( node, - nodeVisitor(node.label, visitor, isIdentifier), - nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) + Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, [254 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateThrowStatement( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [255 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTryStatement( node, - nodeVisitor(node.tryBlock, visitor, isBlock), + Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), nodeVisitor(node.catchClause, visitor, isCatchClause), nodeVisitor(node.finallyBlock, visitor, isBlock) ); @@ -33568,8 +33503,8 @@ var visitEachChildTable = { [257 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateVariableDeclaration( node, - nodeVisitor(node.name, visitor, isBindingName), - nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken) : node.exclamationToken, nodeVisitor(node.type, visitor, isTypeNode), nodeVisitor(node.initializer, visitor, isExpression) ); @@ -33584,7 +33519,7 @@ var visitEachChildTable = { return context.factory.updateFunctionDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.name, visitor, isIdentifier), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), @@ -33605,8 +33540,8 @@ var visitEachChildTable = { [261 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInterfaceDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, isHeritageClause), nodesVisitor(node.members, visitor, isTypeElement) @@ -33615,25 +33550,25 @@ var visitEachChildTable = { [262 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAliasDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodeVisitor(node.type, visitor, isTypeNode) + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, [263 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodesVisitor(node.members, visitor, isEnumMember) ); }, [264 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateModuleDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.name, visitor, isModuleName), + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleName)), nodeVisitor(node.body, visitor, isModuleBody) ); }, @@ -33652,24 +33587,24 @@ var visitEachChildTable = { [267 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExportDeclaration( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [268 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportEqualsDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.moduleReference, visitor, isModuleReference) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) ); }, [269 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), nodeVisitor(node.importClause, visitor, isImportClause), - nodeVisitor(node.moduleSpecifier, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)), nodeVisitor(node.assertClause, visitor, isAssertClause) ); }, @@ -33683,8 +33618,8 @@ var visitEachChildTable = { [297 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAssertEntry( node, - nodeVisitor(node.name, visitor, isAssertionKey), - nodeVisitor(node.value, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)), + Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) ); }, [270 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -33698,13 +33633,13 @@ var visitEachChildTable = { [271 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceImport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [277 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExport( node, - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [272 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { @@ -33718,20 +33653,20 @@ var visitEachChildTable = { node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, [274 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportAssignment( node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodeVisitor(node.expression, visitor, isExpression) + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [275 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportDeclaration( node, - nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, isExpression), @@ -33749,59 +33684,59 @@ var visitEachChildTable = { node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, isIdentifier), - nodeVisitor(node.name, visitor, isIdentifier) + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Module references [280 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExternalModuleReference( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // JSX [281 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxElement( node, - nodeVisitor(node.openingElement, visitor, isJsxOpeningElement), + Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingElement, visitor, isJsxClosingElement) + Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) ); }, [282 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSelfClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [283 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxOpeningElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodeVisitor(node.attributes, visitor, isJsxAttributes) + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, [284 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxClosingElement( node, - nodeVisitor(node.tagName, visitor, isJsxTagNameExpression) + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) ); }, [285 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxFragment( node, - nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment), + Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), nodesVisitor(node.children, visitor, isJsxChild), - nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment) + Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) ); }, [288 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) ); }, @@ -33814,20 +33749,20 @@ var visitEachChildTable = { [290 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSpreadAttribute( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Clauses [292 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCaseClause( node, - nodeVisitor(node.expression, visitor, isExpression), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.statements, visitor, isStatement) ); }, @@ -33847,35 +33782,35 @@ var visitEachChildTable = { return context.factory.updateCatchClause( node, nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), - nodeVisitor(node.block, visitor, isBlock) + Debug.checkDefined(nodeVisitor(node.block, visitor, isBlock)) ); }, // Property assignments [299 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePropertyAssignment( node, - nodeVisitor(node.name, visitor, isPropertyName), - nodeVisitor(node.initializer, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) ); }, [300 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateShorthandPropertyAssignment( node, - nodeVisitor(node.name, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) ); }, [301 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadAssignment( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Enum [302 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumMember( node, - nodeVisitor(node.name, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), nodeVisitor(node.initializer, visitor, isExpression) ); }, @@ -33887,13 +33822,13 @@ var visitEachChildTable = { ); }, // Transformation nodes - [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePartiallyEmittedExpression( node, - nodeVisitor(node.expression, visitor, isExpression) + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCommaListExpression( node, nodesVisitor(node.elements, visitor, isExpression) @@ -35275,7 +35210,7 @@ function sameFiles(a, b, caseSensitive) { return a === b || !caseSensitive && compareStringsCaseInsensitive(a, b) === 0 /* EqualTo */; } function getDetailWatchInfo(projectName, watchers) { - return `Project: ${projectName} watcher already invoked: ${watchers.isInvoked}`; + return `Project: ${projectName} watcher already invoked: ${watchers == null ? void 0 : watchers.isInvoked}`; } var TypingsInstaller = class { constructor(installTypingHost, globalCachePath, safeListPath, typesMapLocation2, throttleLimit, log2 = nullLog) { diff --git a/package.json b/package.json index 1c05fb6ec644b..9e94c0639bc1f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "5.0.0", + "version": "5.0.0-beta", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 80df5e0515ff7..3ff67b980a4cc 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -4,7 +4,7 @@ export const versionMajorMinor = "5.0"; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = `${versionMajorMinor}.0-dev`; +export const version: string = `${versionMajorMinor}.0-beta`; /** * Type of objects whose values are all of the same type. diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.errors.txt index 6fa0f1db4f150..2deab106f6100 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.errors.txt +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.errors.txt @@ -1,6 +1,8 @@ error TS2468: Cannot find global value 'Promise'. tests/cases/conformance/node/other.cts(2,18): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. +tests/cases/conformance/node/other.cts(3,14): error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/other.cts(3,18): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. +tests/cases/conformance/node/other.cts(4,14): error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/other.cts(4,18): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. tests/cases/conformance/node/other.cts(5,18): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. tests/cases/conformance/node/other.mts(2,18): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. @@ -20,6 +22,7 @@ tests/cases/conformance/node/other.ts(4,24): error TS2712: A dynamic import call tests/cases/conformance/node/other.ts(5,18): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/other.ts(5,24): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. tests/cases/conformance/node/other2.cts(2,18): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. +tests/cases/conformance/node/other2.cts(3,14): error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/other2.cts(3,18): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. tests/cases/conformance/node/other2.mts(2,18): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/other2.mts(2,24): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. @@ -109,26 +112,32 @@ tests/cases/conformance/node/other2.ts(3,24): error TS2712: A dynamic import cal !!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. ~~~~~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. -==== tests/cases/conformance/node/other.cts (4 errors) ==== +==== tests/cases/conformance/node/other.cts (6 errors) ==== // cjs format file, no TLA export const a = import("package/cjs"); ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. export const b = import("package/mjs"); + ~ +!!! error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. export const c = import("package"); + ~ +!!! error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ~~~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. export const f = import("inner"); ~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. -==== tests/cases/conformance/node/other2.cts (2 errors) ==== +==== tests/cases/conformance/node/other2.cts (3 errors) ==== // cjs format file, no TLA export const d = import("inner/cjs"); ~~~~~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. export const e = import("inner/mjs"); + ~ +!!! error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ~~~~~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. ==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js index 6ea138c379ffc..902a661b5e84a 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js @@ -153,19 +153,3 @@ export declare const d: { cjsNonmain: true; }; export declare const e: typeof import("inner/mjs"); -//// [other.d.cts] -export declare const a: Promise<{ - default: typeof import("./index.cjs"); -}>; -export declare const b: Promise; -export declare const c: Promise; -export declare const f: Promise<{ - default: typeof import("inner"); - cjsMain: true; -}>; -//// [other2.d.cts] -export declare const d: Promise<{ - default: typeof import("inner/cjs"); - cjsNonmain: true; -}>; -export declare const e: Promise; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt index a8a76a05152b7..1216d8820077d 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt @@ -1,26 +1,44 @@ +/index.ts(1,45): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(2,44): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(6,50): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. /index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(7,49): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(10,45): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(11,44): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. -==== /index.ts (3 errors) ==== +==== /index.ts (9 errors) ==== import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export interface LocalInterface extends RequireInterface, ImportInterface {} import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ~~~~~~~~~~~~~~~ !!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export interface Loc extends Req, Imp {} export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /node_modules/pkg/package.json (0 errors) ==== { diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js index 1b8bc65976edc..e24fd94dba7de 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js @@ -30,16 +30,3 @@ export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [index.d.ts] -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} -import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; -import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; -export interface Loc extends Req, Imp { -} -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).errors.txt index 5aaee4a285e8e..097bebc6d34a8 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).errors.txt @@ -1,26 +1,44 @@ +/index.ts(1,45): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(2,44): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(6,50): error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. +/index.ts(6,50): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. /index.ts(7,49): error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. +/index.ts(7,49): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(10,45): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(11,44): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. -==== /index.ts (3 errors) ==== +==== /index.ts (9 errors) ==== import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export interface LocalInterface extends RequireInterface, ImportInterface {} import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ~~~~~~~~~~~~~~~ !!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export interface Loc extends Req, Imp {} export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /node_modules/pkg/package.json (0 errors) ==== { diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).js index 1b8bc65976edc..e24fd94dba7de 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).js @@ -30,16 +30,3 @@ export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [index.d.ts] -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} -import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; -import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; -export interface Loc extends Req, Imp { -} -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt index 0403a6e026ffe..299c92f3b0d53 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt @@ -1,11 +1,21 @@ +/index.ts(1,45): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(2,44): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. /index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(6,50): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(7,49): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(10,45): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(11,44): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. -==== /index.ts (3 errors) ==== +==== /index.ts (9 errors) ==== import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export interface LocalInterface extends RequireInterface, ImportInterface {} @@ -14,13 +24,21 @@ !!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export interface Loc extends Req, Imp {} export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /node_modules/pkg/package.json (0 errors) ==== { diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).js index fad19d466a6ac..817fbde7e0798 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).js @@ -34,16 +34,3 @@ export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" //// [index.js] export {}; - - -//// [index.d.ts] -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} -import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; -import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; -export interface Loc extends Req, Imp { -} -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=nodenext).errors.txt index 47c2ad040c0db..d0ae4f1ef1aa6 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=nodenext).errors.txt @@ -1,11 +1,21 @@ +/index.ts(1,45): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(2,44): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. /index.ts(6,50): error TS1454: `resolution-mode` can only be set for type-only imports. +/index.ts(6,50): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(7,49): error TS1454: `resolution-mode` can only be set for type-only imports. +/index.ts(7,49): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(10,45): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(11,44): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. -==== /index.ts (3 errors) ==== +==== /index.ts (9 errors) ==== import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export interface LocalInterface extends RequireInterface, ImportInterface {} @@ -14,13 +24,21 @@ !!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1454: `resolution-mode` can only be set for type-only imports. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1454: `resolution-mode` can only be set for type-only imports. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export interface Loc extends Req, Imp {} export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /node_modules/pkg/package.json (0 errors) ==== { diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=nodenext).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=nodenext).js index fad19d466a6ac..817fbde7e0798 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=nodenext).js @@ -34,16 +34,3 @@ export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" //// [index.js] export {}; - - -//// [index.d.ts] -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} -import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; -import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; -export interface Loc extends Req, Imp { -} -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt index bc3eb30565c6f..4934625b136e9 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt @@ -2,10 +2,11 @@ /index.ts(2,73): error TS1453: `resolution-mode` should be either `require` or `import`. /index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. /index.ts(4,39): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(4,39): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(6,76): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -==== /index.ts (5 errors) ==== +==== /index.ts (6 errors) ==== // incorrect mode import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -18,6 +19,8 @@ !!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. // not exclusively type-only import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).js index 3b2af2656d08b..7daaa0cda7eee 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).js @@ -30,10 +30,3 @@ export interface LocalInterface extends RequireInterface, ImportInterface {} //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [index.d.ts] -import type { RequireInterface } from "pkg"; -import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=nodenext).errors.txt index 49a86cf598055..4d564793b0c59 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=nodenext).errors.txt @@ -2,10 +2,11 @@ /index.ts(2,73): error TS1453: `resolution-mode` should be either `require` or `import`. /index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. /index.ts(4,39): error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. +/index.ts(4,39): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(6,76): error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. -==== /index.ts (5 errors) ==== +==== /index.ts (6 errors) ==== // incorrect mode import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -18,6 +19,8 @@ !!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. // not exclusively type-only import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=nodenext).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=nodenext).js index 3b2af2656d08b..7daaa0cda7eee 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=nodenext).js @@ -30,10 +30,3 @@ export interface LocalInterface extends RequireInterface, ImportInterface {} //// [index.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [index.d.ts] -import type { RequireInterface } from "pkg"; -import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).errors.txt new file mode 100644 index 0000000000000..224e7b20e2dad --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).errors.txt @@ -0,0 +1,38 @@ +/index.ts(2,31): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(3,31): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(5,58): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(6,14): error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(6,58): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +==== /index.ts (5 errors) ==== + export type LocalInterface = + & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); + ~ +!!! error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js index 1b444aae0dfb3..ac1cb24c8b3a7 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js @@ -28,9 +28,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.b = exports.a = void 0; exports.a = null; exports.b = null; - - -//// [index.d.ts] -export type LocalInterface = import("pkg", { assert: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; -export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).errors.txt new file mode 100644 index 0000000000000..224e7b20e2dad --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).errors.txt @@ -0,0 +1,38 @@ +/index.ts(2,31): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(3,31): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(5,58): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(6,14): error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(6,58): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +==== /index.ts (5 errors) ==== + export type LocalInterface = + & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); + ~ +!!! error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).js index 1b444aae0dfb3..ac1cb24c8b3a7 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).js @@ -28,9 +28,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.b = exports.a = void 0; exports.a = null; exports.b = null; - - -//// [index.d.ts] -export type LocalInterface = import("pkg", { assert: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; -export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt index 9cca0bcdb64a5..cbc83003bfdcb 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt @@ -1,6 +1,9 @@ error TS2468: Cannot find global value 'Promise'. /index.ts(2,51): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(3,31): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(5,78): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(6,14): error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(6,58): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? /other.ts(3,22): error TS1005: 'assert' expected. /other.ts(3,39): error TS1005: ';' expected. @@ -94,17 +97,23 @@ error TS2468: Cannot find global value 'Promise'. export interface ImportInterface {} ==== /node_modules/pkg/require.d.ts (0 errors) ==== export interface RequireInterface {} -==== /index.ts (2 errors) ==== +==== /index.ts (5 errors) ==== export type LocalInterface = & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface ~~~~~~~~ !!! error TS1453: `resolution-mode` should be either `require` or `import`. & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); ~~~~~~~~ !!! error TS1453: `resolution-mode` should be either `require` or `import`. export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); + ~ +!!! error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /other.ts (28 errors) ==== // missing assert: export type LocalInterface = diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js index 6b34fb98748ad..258fffcef2b03 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js @@ -119,10 +119,6 @@ exports.a = null; exports.b = null; -//// [index.d.ts] -export type LocalInterface = import("pkg", { assert: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; -export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; //// [other.d.ts] export type LocalInterface = import("pkg", { assert: {} }); export declare const a: any; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt index 9cca0bcdb64a5..cbc83003bfdcb 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt @@ -1,6 +1,9 @@ error TS2468: Cannot find global value 'Promise'. /index.ts(2,51): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(3,31): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /index.ts(5,78): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(6,14): error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +/index.ts(6,58): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? /other.ts(3,22): error TS1005: 'assert' expected. /other.ts(3,39): error TS1005: ';' expected. @@ -94,17 +97,23 @@ error TS2468: Cannot find global value 'Promise'. export interface ImportInterface {} ==== /node_modules/pkg/require.d.ts (0 errors) ==== export interface RequireInterface {} -==== /index.ts (2 errors) ==== +==== /index.ts (5 errors) ==== export type LocalInterface = & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface ~~~~~~~~ !!! error TS1453: `resolution-mode` should be either `require` or `import`. & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); ~~~~~~~~ !!! error TS1453: `resolution-mode` should be either `require` or `import`. export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); + ~ +!!! error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /other.ts (28 errors) ==== // missing assert: export type LocalInterface = diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).js index 6b34fb98748ad..258fffcef2b03 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).js @@ -119,10 +119,6 @@ exports.a = null; exports.b = null; -//// [index.d.ts] -export type LocalInterface = import("pkg", { assert: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; -export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; //// [other.d.ts] export type LocalInterface = import("pkg", { assert: {} }); export declare const a: any; diff --git a/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js b/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js index 99ac0dfe2e5f5..7f0b6e7dfbe99 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js @@ -118,12 +118,22 @@ File '/user/username/projects/myproject/node_modules/pkg/package.json' exists ac File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. +index.ts:1:44 - error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +1 import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + index.ts:2:39 - error TS2307: Cannot find module 'pkg1' or its corresponding type declarations. 2 import type { RequireInterface } from "pkg1" assert { "resolution-mode": "require" };    ~~~~~~ -[12:00:44 AM] Found 1 error. Watching for file changes. +index.ts:2:46 - error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +2 import type { RequireInterface } from "pkg1" assert { "resolution-mode": "require" }; +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[12:00:44 AM] Found 3 errors. Watching for file changes. @@ -256,12 +266,27 @@ Reusing resolution of module 'pkg1' from '/user/username/projects/myproject/inde File '/a/lib/package.json' does not exist according to earlier cached lookups. File '/a/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. +a.ts:2:44 - error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +2 import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" } +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +index.ts:1:44 - error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +1 import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + index.ts:2:39 - error TS2307: Cannot find module 'pkg1' or its corresponding type declarations. 2 import type { RequireInterface } from "pkg1" assert { "resolution-mode": "require" };    ~~~~~~ -[12:00:54 AM] Found 1 error. Watching for file changes. +index.ts:2:46 - error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +2 import type { RequireInterface } from "pkg1" assert { "resolution-mode": "require" }; +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[12:00:54 AM] Found 4 errors. Watching for file changes. From dcad07ffd29854e2b93a86da0ba197f6eec21698 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 25 Jan 2023 20:14:47 +0000 Subject: [PATCH 02/35] Update LKG --- lib/tsc.js | 34 +- lib/tsserver.js | 87 +- lib/tsserverlibrary.d.ts | 2 +- lib/tsserverlibrary.js | 85 +- lib/typescript.d.ts | 2 +- lib/typescript.js | 79 +- lib/typingsInstaller.js | 5661 +++++++++++++++++++++++++++++++++++++- 7 files changed, 5835 insertions(+), 115 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index f572475b0eb04..26516cd868574 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -11724,6 +11724,20 @@ function getScriptTargetFeatures() { BigUint64Array: ["at"], ObjectConstructor: ["hasOwn"], Error: ["cause"] + }, + es2023: { + Array: ["findLastIndex", "findLast"], + Int8Array: ["findLastIndex", "findLast"], + Uint8Array: ["findLastIndex", "findLast"], + Uint8ClampedArray: ["findLastIndex", "findLast"], + Int16Array: ["findLastIndex", "findLast"], + Uint16Array: ["findLastIndex", "findLast"], + Int32Array: ["findLastIndex", "findLast"], + Uint32Array: ["findLastIndex", "findLast"], + Float32Array: ["findLastIndex", "findLast"], + Float64Array: ["findLastIndex", "findLast"], + BigInt64Array: ["findLastIndex", "findLast"], + BigUint64Array: ["findLastIndex", "findLast"] } }; } @@ -46308,7 +46322,7 @@ function createTypeChecker(host) { return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); function symbolToStringWorker(writer2) { const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); - const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true }); + const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -46330,7 +46344,7 @@ function createTypeChecker(host) { sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */; } const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -46347,8 +46361,7 @@ function createTypeChecker(host) { const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0)); if (typeNode === void 0) return Debug.fail("should always get typenode"); - const options = { removeComments: type !== unresolvedType }; - const printer = createPrinter(options); + const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -49699,7 +49712,7 @@ function createTypeChecker(host) { typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */) // TODO: GH#18217 ); - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -64727,7 +64740,7 @@ function createTypeChecker(host) { return getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */); } function isSymbolAssigned(symbol) { if (!symbol.valueDeclaration) { @@ -64988,14 +65001,13 @@ function createTypeChecker(host) { const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); - const isCatch = flowContainer.kind === 295 /* CatchClause */; const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -78255,7 +78267,7 @@ function createTypeChecker(host) { if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } - const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); + const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; const sym = resolveEntityName( @@ -106274,6 +106286,10 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme ); return outputFiles; } +var createPrinterWithDefaults = memoize(() => createPrinter({})); +var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); +var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); +var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); function createPrinter(printerOptions = {}, handlers = {}) { const { hasGlobalName, diff --git a/lib/tsserver.js b/lib/tsserver.js index ec5cf96a87517..31db324c0bdd3 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -429,6 +429,10 @@ __export(server_exports, { createPatternMatcher: () => createPatternMatcher, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, createProgram: () => createProgram, createProgramHost: () => createProgramHost, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, @@ -15492,6 +15496,20 @@ function getScriptTargetFeatures() { BigUint64Array: ["at"], ObjectConstructor: ["hasOwn"], Error: ["cause"] + }, + es2023: { + Array: ["findLastIndex", "findLast"], + Int8Array: ["findLastIndex", "findLast"], + Uint8Array: ["findLastIndex", "findLast"], + Uint8ClampedArray: ["findLastIndex", "findLast"], + Int16Array: ["findLastIndex", "findLast"], + Uint16Array: ["findLastIndex", "findLast"], + Int32Array: ["findLastIndex", "findLast"], + Uint32Array: ["findLastIndex", "findLast"], + Float32Array: ["findLastIndex", "findLast"], + Float64Array: ["findLastIndex", "findLast"], + BigInt64Array: ["findLastIndex", "findLast"], + BigUint64Array: ["findLastIndex", "findLast"] } }; } @@ -50977,7 +50995,7 @@ function createTypeChecker(host) { return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); function symbolToStringWorker(writer2) { const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); - const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true }); + const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -50999,7 +51017,7 @@ function createTypeChecker(host) { sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */; } const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -51016,8 +51034,7 @@ function createTypeChecker(host) { const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0)); if (typeNode === void 0) return Debug.fail("should always get typenode"); - const options = { removeComments: type !== unresolvedType }; - const printer = createPrinter(options); + const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -54368,7 +54385,7 @@ function createTypeChecker(host) { typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */) // TODO: GH#18217 ); - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -69396,7 +69413,7 @@ function createTypeChecker(host) { return getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */); } function isSymbolAssigned(symbol) { if (!symbol.valueDeclaration) { @@ -69657,14 +69674,13 @@ function createTypeChecker(host) { const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); - const isCatch = flowContainer.kind === 295 /* CatchClause */; const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -82924,7 +82940,7 @@ function createTypeChecker(host) { if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } - const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); + const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; const sym = resolveEntityName( @@ -111125,6 +111141,10 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme ); return outputFiles; } +var createPrinterWithDefaults = memoize(() => createPrinter({})); +var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); +var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); +var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); function createPrinter(printerOptions = {}, handlers = {}) { const { hasGlobalName, @@ -126912,6 +126932,10 @@ __export(ts_exports3, { createPatternMatcher: () => createPatternMatcher, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, createProgram: () => createProgram, createProgramHost: () => createProgramHost, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, @@ -131004,7 +131028,7 @@ function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, f function nodeToDisplayParts(node, enclosingDeclaration) { const file = enclosingDeclaration.getSourceFile(); return mapToDisplayParts((writer) => { - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); printer.writeNode(4 /* Unspecified */, node, file, writer); }); } @@ -137389,12 +137413,9 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h Debug.assertEqual(action.type, "install package"); return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); } - function getDocCommentTemplateAtPosition2(fileName, position, options) { - return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost( - host, - /*formatSettings*/ - void 0 - ), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + function getDocCommentTemplateAtPosition2(fileName, position, options, formatOptions) { + const formatSettings = formatOptions ? ts_formatting_exports.getFormatContext(formatOptions, host).options : void 0; + return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host, formatSettings), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); } function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { if (openingBrace === 60 /* lessThan */) { @@ -138575,10 +138596,10 @@ var LanguageServiceShimObject = class extends ShimBase { } ); } - getDocCommentTemplateAtPosition(fileName, position, options) { + getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) { return this.forwardJSONCall( `getDocCommentTemplateAtPosition('${fileName}', ${position})`, - () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options) + () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) ); } /// NAVIGATE TO @@ -139470,7 +139491,7 @@ function getCallHierarchyItemName(program, node) { } } if (text === void 0) { - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer)); } return { text, pos: declName.getStart(), end: declName.getEnd() }; @@ -146192,7 +146213,7 @@ function getDeleteAction(context, { name, jsDocHost, jsDocParameterTag }) { Diagnostics.Delete_all_unused_param_tags ); } -function getRenameAction(context, { name, signature, jsDocParameterTag }) { +function getRenameAction(context, { name, jsDocHost, signature, jsDocParameterTag }) { if (!length(signature.parameters)) return void 0; const sourceFile = context.sourceFile; @@ -146215,7 +146236,7 @@ function getRenameAction(context, { name, signature, jsDocParameterTag }) { jsDocParameterTag.isNameFirst, jsDocParameterTag.comment ); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, signature, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t))); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t))); return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]); } function getInfo10(sourceFile, pos) { @@ -157240,8 +157261,7 @@ function provideInlayHints(context) { } function printTypeInSingleLine(type) { const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; - const options = { removeComments: true }; - const printer = createPrinter(options); + const printer = createPrinterWithRemoveComments(); return usingSingleLineStringWriter((writer) => { const typeNode = checker.typeToTypeNode( type, @@ -157331,6 +157351,8 @@ var jsDocTagNames = [ "lends", "license", "link", + "linkcode", + "linkplain", "listens", "member", "memberof", @@ -157343,6 +157365,7 @@ var jsDocTagNames = [ "package", "param", "private", + "prop", "property", "protected", "public", @@ -164169,7 +164192,7 @@ function createTypeHelpItems(symbol, { argumentCount, argumentsSpan: applicableS } function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) { const typeSymbolDisplay = symbolToDisplayParts(checker, symbol); - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer)); const documentation = symbol.getDocumentationComment(checker); const tags = symbol.getJsDocTags(checker); @@ -164213,7 +164236,7 @@ function returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, chec } function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { const typeParameters = (candidateSignature.target || candidateSignature).typeParameters; - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer)); const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : []; return checker.getExpandedParameters(candidateSignature).map((paramList) => { @@ -164225,7 +164248,7 @@ function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclara }); } function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const typeParameterParts = mapToDisplayParts((writer) => { if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags))); @@ -164600,7 +164623,6 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so let hasAddedSymbolInfo = false; const isThisExpression = location.kind === 108 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location); let type; - let printer; let documentationFromAlias; let tagsFromAlias; let hasMultipleSignatures = false; @@ -164993,10 +165015,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so } return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags }; function getPrinter() { - if (!printer) { - printer = createPrinter({ removeComments: true }); - } - return printer; + return createPrinterWithRemoveComments(); } function prefixNextMeaning() { if (displayParts.length) { @@ -178153,7 +178172,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter getDocCommentTemplate(args) { const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); const position = this.getPositionInFile(args, file); - return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file)); + return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file), this.getFormatOptions(file)); } getSpanOfEnclosingComment(args) { const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); @@ -181076,6 +181095,10 @@ start(initializeNodeSystem(), require("os").platform()); createPatternMatcher, createPrependNodes, createPrinter, + createPrinterWithDefaults, + createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon, createProgram, createProgramHost, createPropertyNameNodeForIdentifierOrLiteral, diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index d37896300e8f8..65f9a35b41dc6 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -9990,7 +9990,7 @@ declare namespace ts { getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; - getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined; + getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; /** * This will return a defined result if the position is after the `>` of the opening tag, or somewhere in the text, of a JSXElement with no closing tag. diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 11d554ba63f83..f16c5a06498a0 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -13247,6 +13247,20 @@ ${lanes.join("\n")} BigUint64Array: ["at"], ObjectConstructor: ["hasOwn"], Error: ["cause"] + }, + es2023: { + Array: ["findLastIndex", "findLast"], + Int8Array: ["findLastIndex", "findLast"], + Uint8Array: ["findLastIndex", "findLast"], + Uint8ClampedArray: ["findLastIndex", "findLast"], + Int16Array: ["findLastIndex", "findLast"], + Uint16Array: ["findLastIndex", "findLast"], + Int32Array: ["findLastIndex", "findLast"], + Uint32Array: ["findLastIndex", "findLast"], + Float32Array: ["findLastIndex", "findLast"], + Float64Array: ["findLastIndex", "findLast"], + BigInt64Array: ["findLastIndex", "findLast"], + BigUint64Array: ["findLastIndex", "findLast"] } }; } @@ -48708,7 +48722,7 @@ ${lanes.join("\n")} return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); function symbolToStringWorker(writer2) { const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); - const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true }); + const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -48730,7 +48744,7 @@ ${lanes.join("\n")} sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */; } const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -48747,8 +48761,7 @@ ${lanes.join("\n")} const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0)); if (typeNode === void 0) return Debug.fail("should always get typenode"); - const options = { removeComments: type !== unresolvedType }; - const printer = createPrinter(options); + const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -52099,7 +52112,7 @@ ${lanes.join("\n")} typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */) // TODO: GH#18217 ); - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -67127,7 +67140,7 @@ ${lanes.join("\n")} return getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */); } function isSymbolAssigned(symbol) { if (!symbol.valueDeclaration) { @@ -67388,14 +67401,13 @@ ${lanes.join("\n")} const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); - const isCatch = flowContainer.kind === 295 /* CatchClause */; const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -80655,7 +80667,7 @@ ${lanes.join("\n")} if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } - const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); + const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; const sym = resolveEntityName( @@ -113784,7 +113796,7 @@ ${lanes.join("\n")} function getEmitListItem(emit, parenthesizerRule) { return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; } - var brackets, notImplementedResolver, TempFlags; + var brackets, notImplementedResolver, createPrinterWithDefaults, createPrinterWithRemoveComments, createPrinterWithRemoveCommentsNeverAsciiEscape, createPrinterWithRemoveCommentsOmitTrailingSemicolon, TempFlags; var init_emitter = __esm({ "src/compiler/emitter.ts"() { "use strict"; @@ -113835,6 +113847,10 @@ ${lanes.join("\n")} getDeclarationStatementsForSourceFile: notImplemented, isImportRequiredByAugmentation: notImplemented }; + createPrinterWithDefaults = memoize(() => createPrinter({})); + createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); + createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); + createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); TempFlags = /* @__PURE__ */ ((TempFlags2) => { TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; @@ -126889,7 +126905,7 @@ ${lanes.join("\n")} function nodeToDisplayParts(node, enclosingDeclaration) { const file = enclosingDeclaration.getSourceFile(); return mapToDisplayParts((writer) => { - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); printer.writeNode(4 /* Unspecified */, node, file, writer); }); } @@ -132743,12 +132759,9 @@ ${lanes.join("\n")} Debug.assertEqual(action.type, "install package"); return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); } - function getDocCommentTemplateAtPosition2(fileName, position, options) { - return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost( - host, - /*formatSettings*/ - void 0 - ), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + function getDocCommentTemplateAtPosition2(fileName, position, options, formatOptions) { + const formatSettings = formatOptions ? ts_formatting_exports.getFormatContext(formatOptions, host).options : void 0; + return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host, formatSettings), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); } function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { if (openingBrace === 60 /* lessThan */) { @@ -134620,10 +134633,10 @@ ${lanes.join("\n")} } ); } - getDocCommentTemplateAtPosition(fileName, position, options) { + getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) { return this.forwardJSONCall( `getDocCommentTemplateAtPosition('${fileName}', ${position})`, - () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options) + () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) ); } /// NAVIGATE TO @@ -135517,7 +135530,7 @@ ${lanes.join("\n")} } } if (text === void 0) { - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer)); } return { text, pos: declName.getStart(), end: declName.getEnd() }; @@ -142522,7 +142535,7 @@ ${lanes.join("\n")} Diagnostics.Delete_all_unused_param_tags ); } - function getRenameAction(context, { name, signature, jsDocParameterTag }) { + function getRenameAction(context, { name, jsDocHost, signature, jsDocParameterTag }) { if (!length(signature.parameters)) return void 0; const sourceFile = context.sourceFile; @@ -142545,7 +142558,7 @@ ${lanes.join("\n")} jsDocParameterTag.isNameFirst, jsDocParameterTag.comment ); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, signature, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t))); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t))); return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]); } function getInfo10(sourceFile, pos) { @@ -153998,8 +154011,7 @@ ${lanes.join("\n")} } function printTypeInSingleLine(type) { const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; - const options = { removeComments: true }; - const printer = createPrinter(options); + const printer = createPrinterWithRemoveComments(); return usingSingleLineStringWriter((writer) => { const typeNode = checker.typeToTypeNode( type, @@ -154415,6 +154427,8 @@ ${lanes.join("\n")} "lends", "license", "link", + "linkcode", + "linkplain", "listens", "member", "memberof", @@ -154427,6 +154441,7 @@ ${lanes.join("\n")} "package", "param", "private", + "prop", "property", "protected", "public", @@ -161171,7 +161186,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) { const typeSymbolDisplay = symbolToDisplayParts(checker, symbol); - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer)); const documentation = symbol.getDocumentationComment(checker); const tags = symbol.getJsDocTags(checker); @@ -161214,7 +161229,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { const typeParameters = (candidateSignature.target || candidateSignature).typeParameters; - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer)); const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : []; return checker.getExpandedParameters(candidateSignature).map((paramList) => { @@ -161226,7 +161241,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }); } function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const typeParameterParts = mapToDisplayParts((writer) => { if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags))); @@ -161632,7 +161647,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} let hasAddedSymbolInfo = false; const isThisExpression = location.kind === 108 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location); let type; - let printer; let documentationFromAlias; let tagsFromAlias; let hasMultipleSignatures = false; @@ -162025,10 +162039,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags }; function getPrinter() { - if (!printer) { - printer = createPrinter({ removeComments: true }); - } - return printer; + return createPrinterWithRemoveComments(); } function prefixNextMeaning() { if (displayParts.length) { @@ -175499,7 +175510,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter getDocCommentTemplate(args) { const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); const position = this.getPositionInFile(args, file); - return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file)); + return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file), this.getFormatOptions(file)); } getSpanOfEnclosingComment(args) { const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); @@ -177735,6 +177746,10 @@ ${e.message}`; createPatternMatcher: () => createPatternMatcher, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, createProgram: () => createProgram, createProgramHost: () => createProgramHost, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, @@ -180087,6 +180102,10 @@ ${e.message}`; createPatternMatcher: () => createPatternMatcher, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, createProgram: () => createProgram, createProgramHost: () => createProgramHost, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index c9eeb8a00a1a5..e973a18179380 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -6088,7 +6088,7 @@ declare namespace ts { getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; - getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined; + getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; /** * This will return a defined result if the position is after the `>` of the opening tag, or somewhere in the text, of a JSXElement with no closing tag. diff --git a/lib/typescript.js b/lib/typescript.js index 6a3f7a4f37324..cdd6065a75b05 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -13247,6 +13247,20 @@ ${lanes.join("\n")} BigUint64Array: ["at"], ObjectConstructor: ["hasOwn"], Error: ["cause"] + }, + es2023: { + Array: ["findLastIndex", "findLast"], + Int8Array: ["findLastIndex", "findLast"], + Uint8Array: ["findLastIndex", "findLast"], + Uint8ClampedArray: ["findLastIndex", "findLast"], + Int16Array: ["findLastIndex", "findLast"], + Uint16Array: ["findLastIndex", "findLast"], + Int32Array: ["findLastIndex", "findLast"], + Uint32Array: ["findLastIndex", "findLast"], + Float32Array: ["findLastIndex", "findLast"], + Float64Array: ["findLastIndex", "findLast"], + BigInt64Array: ["findLastIndex", "findLast"], + BigUint64Array: ["findLastIndex", "findLast"] } }; } @@ -48708,7 +48722,7 @@ ${lanes.join("\n")} return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); function symbolToStringWorker(writer2) { const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); - const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true }); + const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -48730,7 +48744,7 @@ ${lanes.join("\n")} sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */; } const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -48747,8 +48761,7 @@ ${lanes.join("\n")} const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0)); if (typeNode === void 0) return Debug.fail("should always get typenode"); - const options = { removeComments: type !== unresolvedType }; - const printer = createPrinter(options); + const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -52099,7 +52112,7 @@ ${lanes.join("\n")} typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */) // TODO: GH#18217 ); - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -67127,7 +67140,7 @@ ${lanes.join("\n")} return getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */); } function isSymbolAssigned(symbol) { if (!symbol.valueDeclaration) { @@ -67388,14 +67401,13 @@ ${lanes.join("\n")} const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); - const isCatch = flowContainer.kind === 295 /* CatchClause */; const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -80655,7 +80667,7 @@ ${lanes.join("\n")} if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } - const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); + const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; const sym = resolveEntityName( @@ -113784,7 +113796,7 @@ ${lanes.join("\n")} function getEmitListItem(emit, parenthesizerRule) { return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; } - var brackets, notImplementedResolver, TempFlags; + var brackets, notImplementedResolver, createPrinterWithDefaults, createPrinterWithRemoveComments, createPrinterWithRemoveCommentsNeverAsciiEscape, createPrinterWithRemoveCommentsOmitTrailingSemicolon, TempFlags; var init_emitter = __esm({ "src/compiler/emitter.ts"() { "use strict"; @@ -113835,6 +113847,10 @@ ${lanes.join("\n")} getDeclarationStatementsForSourceFile: notImplemented, isImportRequiredByAugmentation: notImplemented }; + createPrinterWithDefaults = memoize(() => createPrinter({})); + createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); + createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); + createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); TempFlags = /* @__PURE__ */ ((TempFlags2) => { TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; @@ -126903,7 +126919,7 @@ ${lanes.join("\n")} function nodeToDisplayParts(node, enclosingDeclaration) { const file = enclosingDeclaration.getSourceFile(); return mapToDisplayParts((writer) => { - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); printer.writeNode(4 /* Unspecified */, node, file, writer); }); } @@ -132757,12 +132773,9 @@ ${lanes.join("\n")} Debug.assertEqual(action.type, "install package"); return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); } - function getDocCommentTemplateAtPosition2(fileName, position, options) { - return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost( - host, - /*formatSettings*/ - void 0 - ), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + function getDocCommentTemplateAtPosition2(fileName, position, options, formatOptions) { + const formatSettings = formatOptions ? ts_formatting_exports.getFormatContext(formatOptions, host).options : void 0; + return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host, formatSettings), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); } function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { if (openingBrace === 60 /* lessThan */) { @@ -134634,10 +134647,10 @@ ${lanes.join("\n")} } ); } - getDocCommentTemplateAtPosition(fileName, position, options) { + getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) { return this.forwardJSONCall( `getDocCommentTemplateAtPosition('${fileName}', ${position})`, - () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options) + () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) ); } /// NAVIGATE TO @@ -135531,7 +135544,7 @@ ${lanes.join("\n")} } } if (text === void 0) { - const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer)); } return { text, pos: declName.getStart(), end: declName.getEnd() }; @@ -142536,7 +142549,7 @@ ${lanes.join("\n")} Diagnostics.Delete_all_unused_param_tags ); } - function getRenameAction(context, { name, signature, jsDocParameterTag }) { + function getRenameAction(context, { name, jsDocHost, signature, jsDocParameterTag }) { if (!length(signature.parameters)) return void 0; const sourceFile = context.sourceFile; @@ -142559,7 +142572,7 @@ ${lanes.join("\n")} jsDocParameterTag.isNameFirst, jsDocParameterTag.comment ); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, signature, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t))); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t))); return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]); } function getInfo10(sourceFile, pos) { @@ -154012,8 +154025,7 @@ ${lanes.join("\n")} } function printTypeInSingleLine(type) { const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; - const options = { removeComments: true }; - const printer = createPrinter(options); + const printer = createPrinterWithRemoveComments(); return usingSingleLineStringWriter((writer) => { const typeNode = checker.typeToTypeNode( type, @@ -154429,6 +154441,8 @@ ${lanes.join("\n")} "lends", "license", "link", + "linkcode", + "linkplain", "listens", "member", "memberof", @@ -154441,6 +154455,7 @@ ${lanes.join("\n")} "package", "param", "private", + "prop", "property", "protected", "public", @@ -161185,7 +161200,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) { const typeSymbolDisplay = symbolToDisplayParts(checker, symbol); - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer)); const documentation = symbol.getDocumentationComment(checker); const tags = symbol.getJsDocTags(checker); @@ -161228,7 +161243,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { const typeParameters = (candidateSignature.target || candidateSignature).typeParameters; - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer)); const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : []; return checker.getExpandedParameters(candidateSignature).map((paramList) => { @@ -161240,7 +161255,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }); } function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { - const printer = createPrinter({ removeComments: true }); + const printer = createPrinterWithRemoveComments(); const typeParameterParts = mapToDisplayParts((writer) => { if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags))); @@ -161646,7 +161661,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} let hasAddedSymbolInfo = false; const isThisExpression = location.kind === 108 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location); let type; - let printer; let documentationFromAlias; let tagsFromAlias; let hasMultipleSignatures = false; @@ -162039,10 +162053,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags }; function getPrinter() { - if (!printer) { - printer = createPrinter({ removeComments: true }); - } - return printer; + return createPrinterWithRemoveComments(); } function prefixNextMeaning() { if (displayParts.length) { @@ -166920,6 +166931,10 @@ ${options.prefix}` : "\n" : options.prefix createPatternMatcher: () => createPatternMatcher, createPrependNodes: () => createPrependNodes, createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, createProgram: () => createProgram, createProgramHost: () => createProgramHost, createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 2b20b45f48052..2d892a7d711e4 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -102,6 +102,17 @@ function find(array, predicate, startIndex) { } return void 0; } +function findLast(array, predicate, startIndex) { + if (array === void 0) + return void 0; + for (let i = startIndex != null ? startIndex : array.length - 1; i >= 0; i--) { + const value = array[i]; + if (predicate(value, i)) { + return value; + } + } + return void 0; +} function findIndex(array, predicate, startIndex) { if (array === void 0) return -1; @@ -473,6 +484,15 @@ function arrayToMap(array, makeKey, makeValue = identity) { } return result; } +function clone(object) { + const result = {}; + for (const id in object) { + if (hasOwnProperty.call(object, id)) { + result[id] = object[id]; + } + } + return result; +} function createMultiMap() { const map2 = /* @__PURE__ */ new Map(); map2.add = multiMapAdd; @@ -2297,6 +2317,30 @@ var perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : // src/compiler/performance.ts var performanceImpl; +function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : nullTimer; +} +function createTimer(measureName, startMarkName, endMarkName) { + let enterCount = 0; + return { + enter, + exit + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } else if (enterCount < 0) { + Debug.fail("enter/exit count does not match."); + } + } +} +var nullTimer = { enter: noop, exit: noop }; var enabled = false; var timeorigin = timestamp(); var marks = /* @__PURE__ */ new Map(); @@ -3078,6 +3122,19 @@ var RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => { RelationComparisonResult3[RelationComparisonResult3["ReportsMask"] = 24] = "ReportsMask"; return RelationComparisonResult3; })(RelationComparisonResult || {}); +var GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => { + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Loop"] = 2] = "Loop"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Unique"] = 3] = "Unique"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Node"] = 4] = "Node"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["KindMask"] = 7] = "KindMask"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Optimistic"] = 16] = "Optimistic"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["FileLevel"] = 32] = "FileLevel"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; + return GeneratedIdentifierFlags2; +})(GeneratedIdentifierFlags || {}); var FlowFlags = /* @__PURE__ */ ((FlowFlags2) => { FlowFlags2[FlowFlags2["Unreachable"] = 1] = "Unreachable"; FlowFlags2[FlowFlags2["Start"] = 2] = "Start"; @@ -7476,6 +7533,17 @@ function computeLineOfPosition(lineStarts, position, lowerBound) { } return lineNumber; } +function getLinesBetweenPositions(sourceFile, pos1, pos2) { + if (pos1 === pos2) + return 0; + const lineStarts = getLineStarts(sourceFile); + const lower = Math.min(pos1, pos2); + const isNegative = lower === pos2; + const upper = isNegative ? pos1 : pos2; + const lowerLine = computeLineOfPosition(lineStarts, lower); + const upperLine = computeLineOfPosition(lineStarts, upper, lowerLine); + return isNegative ? lowerLine - upperLine : upperLine - lowerLine; +} function getLineAndCharacterOfPosition(sourceFile, position) { return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } @@ -7730,6 +7798,30 @@ function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) { } return accumulator; } +function forEachLeadingCommentRange(text, pos, cb, state) { + return iterateCommentRanges( + /*reduce*/ + false, + text, + pos, + /*trailing*/ + false, + cb, + state + ); +} +function forEachTrailingCommentRange(text, pos, cb, state) { + return iterateCommentRanges( + /*reduce*/ + false, + text, + pos, + /*trailing*/ + true, + cb, + state + ); +} function reduceEachLeadingCommentRange(text, pos, cb, state, initial) { return iterateCommentRanges( /*reduce*/ @@ -9366,6 +9458,17 @@ function getCombinedModifierFlags(node) { function getCombinedNodeFlags(node) { return getCombinedFlags(node, (n) => n.flags); } +function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== void 0) { + node = node.original; + } + } + if (!node || !nodeTest) { + return node; + } + return nodeTest(node) ? node : void 0; +} function findAncestor(node, callback) { while (node) { const result = callback(node); @@ -9664,6 +9767,15 @@ function getJSDocTagsWorker(node, noCache) { function getFirstJSDocTag(node, predicate, noCache) { return find(getJSDocTagsWorker(node, noCache), predicate); } +function getTextOfJSDocComment(comment) { + return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 324 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); +} +function formatJSDocLink(link) { + const kind = link.kind === 327 /* JSDocLink */ ? "link" : link.kind === 328 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; + const name = link.name ? entityNameToString(link.name) : ""; + const space = link.name && link.text.startsWith("://") ? "" : " "; + return `{@${kind} ${name}${space}${link.text}}`; +} function isMemberName(node) { return node.kind === 79 /* Identifier */ || node.kind === 80 /* PrivateIdentifier */; } @@ -9701,9 +9813,24 @@ function isNonNullChain(node) { function isNamedExportBindings(node) { return node.kind === 277 /* NamespaceExport */ || node.kind === 276 /* NamedExports */; } +function isUnparsedTextLike(node) { + switch (node.kind) { + case 305 /* UnparsedText */: + case 306 /* UnparsedInternalText */: + return true; + default: + return false; + } +} +function isUnparsedNode(node) { + return isUnparsedTextLike(node) || node.kind === 303 /* UnparsedPrologue */ || node.kind === 307 /* UnparsedSyntheticReference */; +} function isNodeKind(kind) { return kind >= 163 /* FirstNode */; } +function isTokenKind(kind) { + return kind >= 0 /* FirstToken */ && kind <= 162 /* LastToken */; +} function isNodeArray(array) { return hasProperty(array, "pos") && hasProperty(array, "end"); } @@ -10167,6 +10294,9 @@ function isCaseOrDefaultClause(node) { function isJSDocNode(node) { return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */; } +function isJSDocTag(node) { + return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */; +} function hasJSDocNodes(node) { if (!canHaveJSDoc(node)) return false; @@ -10176,6 +10306,28 @@ function hasJSDocNodes(node) { function hasInitializer(node) { return !!node.initializer; } +var MAX_SMI_X86 = 1073741823; +function guessIndentation(lines) { + let indentation = MAX_SMI_X86; + for (const line of lines) { + if (!line.length) { + continue; + } + let i = 0; + for (; i < line.length && i < indentation; i++) { + if (!isWhiteSpaceLike(line.charCodeAt(i))) { + break; + } + } + if (i < indentation) { + indentation = i; + } + if (indentation === 0) { + return 0; + } + } + return indentation === MAX_SMI_X86 ? void 0 : indentation; +} function isStringLiteralLike(node) { return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */; } @@ -10274,6 +10426,9 @@ function getEndLinePosition(line, sourceFile) { return pos; } } +function isFileLevelUniqueName(sourceFile, name, hasGlobalName) { + return !(hasGlobalName && hasGlobalName(name)) && !sourceFile.identifiers.has(name); +} function nodeIsMissing(node) { if (node === void 0) { return true; @@ -10283,6 +10438,16 @@ function nodeIsMissing(node) { function nodeIsPresent(node) { return !nodeIsMissing(node); } +function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47 /* slash */) { + const textSubStr = text.substring(commentPos, commentEnd); + return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false; + } + return false; +} +function isPinnedComment(text, start) { + return text.charCodeAt(start + 1) === 42 /* asterisk */ && text.charCodeAt(start + 2) === 33 /* exclamation */; +} function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -10336,6 +10501,65 @@ function getEmitFlags(node) { const emitNode = node.emitNode; return emitNode && emitNode.flags || 0; } +function getInternalEmitFlags(node) { + const emitNode = node.emitNode; + return emitNode && emitNode.internalFlags || 0; +} +function getLiteralText(node, sourceFile, flags) { + var _a2; + if (sourceFile && canUseOriginalText(node, flags)) { + return getSourceTextOfNodeFromSourceFile(sourceFile, node); + } + switch (node.kind) { + case 10 /* StringLiteral */: { + const escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; + if (node.singleQuote) { + return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; + } else { + return '"' + escapeText(node.text, 34 /* doubleQuote */) + '"'; + } + } + case 14 /* NoSubstitutionTemplateLiteral */: + case 15 /* TemplateHead */: + case 16 /* TemplateMiddle */: + case 17 /* TemplateTail */: { + const escapeText = flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; + const rawText = (_a2 = node.rawText) != null ? _a2 : escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); + switch (node.kind) { + case 14 /* NoSubstitutionTemplateLiteral */: + return "`" + rawText + "`"; + case 15 /* TemplateHead */: + return "`" + rawText + "${"; + case 16 /* TemplateMiddle */: + return "}" + rawText + "${"; + case 17 /* TemplateTail */: + return "}" + rawText + "`"; + } + break; + } + case 8 /* NumericLiteral */: + case 9 /* BigIntLiteral */: + return node.text; + case 13 /* RegularExpressionLiteral */: + if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { + return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); + } + return node.text; + } + return Debug.fail(`Literal kind '${node.kind}' not accounted for.`); +} +function canUseOriginalText(node, flags) { + if (nodeIsSynthesized(node) || !node.parent || flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { + return false; + } + if (isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) { + return !!(flags & 8 /* AllowNumericSeparator */); + } + return !isBigIntLiteral(node); +} +function makeIdentifierFromModuleName(moduleName) { + return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); +} function isBlockOrCatchScoped(declaration) { return (getCombinedNodeFlags(declaration) & 3 /* BlockScoped */) !== 0 || isCatchClauseVariableDeclarationOrBindingElement(declaration); } @@ -10418,6 +10642,27 @@ function tryGetTextOfPropertyName(name) { function getTextOfPropertyName(name) { return Debug.checkDefined(tryGetTextOfPropertyName(name)); } +function entityNameToString(name) { + switch (name.kind) { + case 108 /* ThisKeyword */: + return "this"; + case 80 /* PrivateIdentifier */: + case 79 /* Identifier */: + return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name); + case 163 /* QualifiedName */: + return entityNameToString(name.left) + "." + entityNameToString(name.right); + case 208 /* PropertyAccessExpression */: + if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) { + return entityNameToString(name.expression) + "." + entityNameToString(name.name); + } else { + return Debug.assertNever(name.name); + } + case 314 /* JSDocMemberName */: + return entityNameToString(name.left) + entityNameToString(name.right); + default: + return Debug.assertNever(name); + } +} function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); @@ -10521,6 +10766,15 @@ function isJsonSourceFile(file) { function isEnumConst(node) { return !!(getCombinedModifierFlags(node) & 2048 /* Const */); } +function isVarConst(node) { + return !!(getCombinedNodeFlags(node) & 2 /* Const */); +} +function isLet(node) { + return !!(getCombinedNodeFlags(node) & 1 /* Let */); +} +function isLiteralImportTypeNode(n) { + return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal); +} function isPrologueDirective(node) { return node.kind === 241 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } @@ -10536,10 +10790,17 @@ function isHoistedVariable(node) { function isHoistedVariableStatement(node) { return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable); } +function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { + return node.kind !== 11 /* JsxText */ ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; +} function getJSDocCommentRanges(node, text) { const commentRanges = node.kind === 166 /* Parameter */ || node.kind === 165 /* TypeParameter */ || node.kind === 215 /* FunctionExpression */ || node.kind === 216 /* ArrowFunction */ || node.kind === 214 /* ParenthesizedExpression */ || node.kind === 257 /* VariableDeclaration */ || node.kind === 278 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */); } +var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; +var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; +var fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; +var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isVariableLike(node) { if (node) { switch (node.kind) { @@ -10656,6 +10917,9 @@ function isPartOfTypeQuery(node) { function isInJSFile(node) { return !!node && !!(node.flags & 262144 /* JavaScriptFile */); } +function isInJsonFile(node) { + return !!node && !!(node.flags & 67108864 /* JsonFile */); +} function isInJSDoc(node) { return !!node && !!(node.flags & 8388608 /* JSDoc */); } @@ -10902,6 +11166,23 @@ function isFunctionSymbol(symbol) { const decl = symbol.valueDeclaration; return decl.kind === 259 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); } +function getExternalModuleName(node) { + switch (node.kind) { + case 269 /* ImportDeclaration */: + case 275 /* ExportDeclaration */: + return node.moduleSpecifier; + case 268 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 280 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; + case 202 /* ImportType */: + return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; + case 210 /* CallExpression */: + return node.arguments[0]; + case 264 /* ModuleDeclaration */: + return node.name.kind === 10 /* StringLiteral */ ? node.name : void 0; + default: + return Debug.assertNever(node); + } +} function isJSDocConstructSignature(node) { const param = isJSDocFunctionType(node) ? firstOrUndefined(node.parameters) : void 0; const name = tryCast(param && param.name, isIdentifier); @@ -11130,6 +11411,14 @@ function skipParentheses(node, excludeJSDocTypeAssertions) { const flags = excludeJSDocTypeAssertions ? 1 /* Parentheses */ | 16 /* ExcludeJSDocTypeAssertion */ : 1 /* Parentheses */; return skipOuterExpressions(node, flags); } +function isNodeDescendantOf(node, ancestor) { + while (node) { + if (node === ancestor) + return true; + node = node.parent; + } + return false; +} function isIdentifierName(node) { const parent = node.parent; switch (parent.kind) { @@ -11416,9 +11705,16 @@ function getBinaryOperatorPrecedence(kind) { } return -1; } +var templateSubstitutionRegExp = /\$\{/g; +function escapeTemplateSubstitution(str) { + return str.replace(templateSubstitutionRegExp, "\\${"); +} function hasInvalidEscape(template) { return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags)); } +var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; +var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; +var backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g; var escapedCharsMap = new Map(Object.entries({ " ": "\\t", "\v": "\\v", @@ -11439,10 +11735,231 @@ var escapedCharsMap = new Map(Object.entries({ "\r\n": "\\r\\n" // special case for CRLFs in backticks })); +function encodeUtf16EscapeSequence(charCode) { + const hexCharCode = charCode.toString(16).toUpperCase(); + const paddedHexCode = ("0000" + hexCharCode).slice(-4); + return "\\u" + paddedHexCode; +} +function getReplacement(c, offset, input) { + if (c.charCodeAt(0) === 0 /* nullCharacter */) { + const lookAhead = input.charCodeAt(offset + c.length); + if (lookAhead >= 48 /* _0 */ && lookAhead <= 57 /* _9 */) { + return "\\x00"; + } + return "\\0"; + } + return escapedCharsMap.get(c) || encodeUtf16EscapeSequence(c.charCodeAt(0)); +} +function escapeString(s, quoteChar) { + const escapedCharsRegExp = quoteChar === 96 /* backtick */ ? backtickQuoteEscapedCharsRegExp : quoteChar === 39 /* singleQuote */ ? singleQuoteEscapedCharsRegExp : doubleQuoteEscapedCharsRegExp; + return s.replace(escapedCharsRegExp, getReplacement); +} +var nonAsciiCharacters = /[^\u0000-\u007F]/g; +function escapeNonAsciiString(s, quoteChar) { + s = escapeString(s, quoteChar); + return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, (c) => encodeUtf16EscapeSequence(c.charCodeAt(0))) : s; +} +var jsxDoubleQuoteEscapedCharsRegExp = /[\"\u0000-\u001f\u2028\u2029\u0085]/g; +var jsxSingleQuoteEscapedCharsRegExp = /[\'\u0000-\u001f\u2028\u2029\u0085]/g; var jsxEscapedCharsMap = new Map(Object.entries({ '"': """, "'": "'" })); +function encodeJsxCharacterEntity(charCode) { + const hexCharCode = charCode.toString(16).toUpperCase(); + return "&#x" + hexCharCode + ";"; +} +function getJsxAttributeStringReplacement(c) { + if (c.charCodeAt(0) === 0 /* nullCharacter */) { + return "�"; + } + return jsxEscapedCharsMap.get(c) || encodeJsxCharacterEntity(c.charCodeAt(0)); +} +function escapeJsxAttributeString(s, quoteChar) { + const escapedCharsRegExp = quoteChar === 39 /* singleQuote */ ? jsxSingleQuoteEscapedCharsRegExp : jsxDoubleQuoteEscapedCharsRegExp; + return s.replace(escapedCharsRegExp, getJsxAttributeStringReplacement); +} +var indentStrings = ["", " "]; +function getIndentString(level) { + const singleLevel = indentStrings[1]; + for (let current = indentStrings.length; current <= level; current++) { + indentStrings.push(indentStrings[current - 1] + singleLevel); + } + return indentStrings[level]; +} +function getIndentSize() { + return indentStrings[1].length; +} +function createTextWriter(newLine) { + let output; + let indent2; + let lineStart; + let lineCount; + let linePos; + let hasTrailingComment = false; + function updateLineCountAndPosFor(s) { + const lineStartsOfS = computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + last(lineStartsOfS); + lineStart = linePos - output.length === 0; + } else { + lineStart = false; + } + } + function writeText(s) { + if (s && s.length) { + if (lineStart) { + s = getIndentString(indent2) + s; + lineStart = false; + } + output += s; + updateLineCountAndPosFor(s); + } + } + function write(s) { + if (s) + hasTrailingComment = false; + writeText(s); + } + function writeComment(s) { + if (s) + hasTrailingComment = true; + writeText(s); + } + function reset() { + output = ""; + indent2 = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + hasTrailingComment = false; + } + function rawWrite(s) { + if (s !== void 0) { + output += s; + updateLineCountAndPosFor(s); + hasTrailingComment = false; + } + } + function writeLiteral(s) { + if (s && s.length) { + write(s); + } + } + function writeLine(force) { + if (!lineStart || force) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + hasTrailingComment = false; + } + } + function getTextPosWithWriteLine() { + return lineStart ? output.length : output.length + newLine.length; + } + reset(); + return { + write, + rawWrite, + writeLiteral, + writeLine, + increaseIndent: () => { + indent2++; + }, + decreaseIndent: () => { + indent2--; + }, + getIndent: () => indent2, + getTextPos: () => output.length, + getLine: () => lineCount, + getColumn: () => lineStart ? indent2 * getIndentSize() : output.length - linePos, + getText: () => output, + isAtStartOfLine: () => lineStart, + hasTrailingComment: () => hasTrailingComment, + hasTrailingWhitespace: () => !!output.length && isWhiteSpaceLike(output.charCodeAt(output.length - 1)), + clear: reset, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: (s, _) => write(s), + writeTrailingSemicolon: write, + writeComment, + getTextPosWithWriteLine + }; +} +function getTrailingSemicolonDeferringWriter(writer) { + let pendingTrailingSemicolon = false; + function commitPendingTrailingSemicolon() { + if (pendingTrailingSemicolon) { + writer.writeTrailingSemicolon(";"); + pendingTrailingSemicolon = false; + } + } + return { + ...writer, + writeTrailingSemicolon() { + pendingTrailingSemicolon = true; + }, + writeLiteral(s) { + commitPendingTrailingSemicolon(); + writer.writeLiteral(s); + }, + writeStringLiteral(s) { + commitPendingTrailingSemicolon(); + writer.writeStringLiteral(s); + }, + writeSymbol(s, sym) { + commitPendingTrailingSemicolon(); + writer.writeSymbol(s, sym); + }, + writePunctuation(s) { + commitPendingTrailingSemicolon(); + writer.writePunctuation(s); + }, + writeKeyword(s) { + commitPendingTrailingSemicolon(); + writer.writeKeyword(s); + }, + writeOperator(s) { + commitPendingTrailingSemicolon(); + writer.writeOperator(s); + }, + writeParameter(s) { + commitPendingTrailingSemicolon(); + writer.writeParameter(s); + }, + writeSpace(s) { + commitPendingTrailingSemicolon(); + writer.writeSpace(s); + }, + writeProperty(s) { + commitPendingTrailingSemicolon(); + writer.writeProperty(s); + }, + writeComment(s) { + commitPendingTrailingSemicolon(); + writer.writeComment(s); + }, + writeLine() { + commitPendingTrailingSemicolon(); + writer.writeLine(); + }, + increaseIndent() { + commitPendingTrailingSemicolon(); + writer.increaseIndent(); + }, + decreaseIndent() { + commitPendingTrailingSemicolon(); + writer.decreaseIndent(); + } + }; +} function hostUsesCaseSensitiveFileNames(host) { return host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false; } @@ -11476,12 +11993,156 @@ function writeFileEnsuringDirectories(path2, data, writeByteOrderMark, writeFile writeFile2(path2, data, writeByteOrderMark); } } +function getLineOfLocalPositionFromLineMap(lineMap, pos) { + return computeLineOfPosition(lineMap, pos); +} function isThisIdentifier(node) { return !!node && node.kind === 79 /* Identifier */ && identifierIsThisKeyword(node); } function identifierIsThisKeyword(id) { return id.escapedText === "this"; } +function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { + emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments); +} +function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) { + if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { + writer.writeLine(); + } +} +function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) { + if (pos !== commentPos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) { + writer.writeLine(); + } +} +function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) { + if (comments && comments.length > 0) { + if (leadingSeparator) { + writer.writeSpace(" "); + } + let emitInterveningSeparator = false; + for (const comment of comments) { + if (emitInterveningSeparator) { + writer.writeSpace(" "); + emitInterveningSeparator = false; + } + writeComment(text, lineMap, writer, comment.pos, comment.end, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } else { + emitInterveningSeparator = true; + } + } + if (emitInterveningSeparator && trailingSeparator) { + writer.writeSpace(" "); + } + } +} +function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { + let leadingComments; + let currentDetachedCommentInfo; + if (removeComments) { + if (node.pos === 0) { + leadingComments = filter(getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); + } + } else { + leadingComments = getLeadingCommentRanges(text, node.pos); + } + if (leadingComments) { + const detachedComments = []; + let lastComment; + for (const comment of leadingComments) { + if (lastComment) { + const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + const commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); + if (commentLine >= lastCommentLine + 2) { + break; + } + } + detachedComments.push(comment); + lastComment = comment; + } + if (detachedComments.length) { + const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, last(detachedComments).end); + const nodeLine = getLineOfLocalPositionFromLineMap(lineMap, skipTrivia(text, node.pos)); + if (nodeLine >= lastCommentLine + 2) { + emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); + emitComments( + text, + lineMap, + writer, + detachedComments, + /*leadingSeparator*/ + false, + /*trailingSeparator*/ + true, + newLine, + writeComment + ); + currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: last(detachedComments).end }; + } + } + } + return currentDetachedCommentInfo; + function isPinnedCommentLocal(comment) { + return isPinnedComment(text, comment.pos); + } +} +function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) { + if (text.charCodeAt(commentPos + 1) === 42 /* asterisk */) { + const firstCommentLineAndCharacter = computeLineAndCharacterOfPosition(lineMap, commentPos); + const lineCount = lineMap.length; + let firstCommentLineIndent; + for (let pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) { + const nextLineStart = currentLine + 1 === lineCount ? text.length + 1 : lineMap[currentLine + 1]; + if (pos !== commentPos) { + if (firstCommentLineIndent === void 0) { + firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos); + } + const currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + const spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); + if (spacesToEmit > 0) { + let numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + const indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + writer.rawWrite(indentSizeSpaceString); + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } else { + writer.rawWrite(""); + } + } + writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart); + pos = nextLineStart; + } + } else { + writer.writeComment(text.substring(commentPos, commentEnd)); + } +} +function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { + const end = Math.min(commentEnd, nextLineStart - 1); + const currentLineText = trimString(text.substring(pos, end)); + if (currentLineText) { + writer.writeComment(currentLineText); + if (end !== commentEnd) { + writer.writeLine(); + } + } else { + writer.rawWrite(newLine); + } +} +function calculateIndent(text, pos, end) { + let currentLineIndent = 0; + for (; pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === 9 /* tab */) { + currentLineIndent += getIndentSize() - currentLineIndent % getIndentSize(); + } else { + currentLineIndent++; + } + } + return currentLineIndent; +} function hasSyntacticModifier(node, flags) { return !!getSelectedSyntacticModifierFlags(node, flags); } @@ -11662,6 +12323,118 @@ function readJson(path2, host) { function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); } +var carriageReturnLineFeed = "\r\n"; +var lineFeed = "\n"; +function getNewLineCharacter(options) { + switch (options.newLine) { + case 0 /* CarriageReturnLineFeed */: + return carriageReturnLineFeed; + case 1 /* LineFeed */: + case void 0: + return lineFeed; + } +} +function createRange(pos, end = pos) { + Debug.assert(end >= pos || end === -1); + return { pos, end }; +} +function moveRangePos(range, pos) { + return createRange(pos, range.end); +} +function moveRangePastDecorators(node) { + const lastDecorator = canHaveModifiers(node) ? findLast(node.modifiers, isDecorator) : void 0; + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; +} +function moveRangePastModifiers(node) { + if (isPropertyDeclaration(node) || isMethodDeclaration(node)) { + return moveRangePos(node, node.name.pos); + } + const lastModifier = canHaveModifiers(node) ? lastOrUndefined(node.modifiers) : void 0; + return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); +} +function rangeIsOnSingleLine(range, sourceFile) { + return rangeStartIsOnSameLineAsRangeEnd(range, range, sourceFile); +} +function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) { + return positionsAreOnSameLine( + getStartPositionOfRange( + range1, + sourceFile, + /*includeComments*/ + false + ), + getStartPositionOfRange( + range2, + sourceFile, + /*includeComments*/ + false + ), + sourceFile + ); +} +function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) { + return positionsAreOnSameLine(range1.end, range2.end, sourceFile); +} +function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) { + return positionsAreOnSameLine(getStartPositionOfRange( + range1, + sourceFile, + /*includeComments*/ + false + ), range2.end, sourceFile); +} +function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) { + return positionsAreOnSameLine(range1.end, getStartPositionOfRange( + range2, + sourceFile, + /*includeComments*/ + false + ), sourceFile); +} +function getLinesBetweenRangeEndAndRangeStart(range1, range2, sourceFile, includeSecondRangeComments) { + const range2Start = getStartPositionOfRange(range2, sourceFile, includeSecondRangeComments); + return getLinesBetweenPositions(sourceFile, range1.end, range2Start); +} +function positionsAreOnSameLine(pos1, pos2, sourceFile) { + return getLinesBetweenPositions(sourceFile, pos1, pos2) === 0; +} +function getStartPositionOfRange(range, sourceFile, includeComments) { + return positionIsSynthesized(range.pos) ? -1 : skipTrivia( + sourceFile.text, + range.pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); +} +function getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { + const startPos = skipTrivia( + sourceFile.text, + pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); + const prevPos = getPreviousNonWhitespacePosition(startPos, stopPos, sourceFile); + return getLinesBetweenPositions(sourceFile, prevPos != null ? prevPos : stopPos, startPos); +} +function getLinesBetweenPositionAndNextNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { + const nextPos = skipTrivia( + sourceFile.text, + pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); + return getLinesBetweenPositions(sourceFile, pos, Math.min(stopPos, nextPos)); +} +function getPreviousNonWhitespacePosition(pos, stopPos = 0, sourceFile) { + while (pos-- > stopPos) { + if (!isWhiteSpaceLike(sourceFile.text.charCodeAt(pos))) { + return pos; + } + } +} function closeFileWatcher(watcher) { watcher.close(); } @@ -11694,6 +12467,15 @@ function isTypeNodeKind(kind) { function isAccessExpression(node) { return node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */; } +function isBundleFileTextLike(section) { + switch (section.kind) { + case "text" /* Text */: + case "internal" /* Internal */: + return true; + default: + return false; + } +} function getLeftmostAccessExpression(expr) { while (isAccessExpression(expr)) { expr = expr.expression; @@ -12369,6 +13151,71 @@ function setParentRecursive(rootNode, incremental) { return bindParentToChildIgnoringJSDoc(child, parent) || bindJSDoc(child); } } +function getContainingNodeArray(node) { + if (!node.parent) + return void 0; + switch (node.kind) { + case 165 /* TypeParameter */: + const { parent: parent2 } = node; + return parent2.kind === 192 /* InferType */ ? void 0 : parent2.typeParameters; + case 166 /* Parameter */: + return node.parent.parameters; + case 201 /* TemplateLiteralTypeSpan */: + return node.parent.templateSpans; + case 236 /* TemplateSpan */: + return node.parent.templateSpans; + case 167 /* Decorator */: { + const { parent: parent3 } = node; + return canHaveDecorators(parent3) ? parent3.modifiers : void 0; + } + case 294 /* HeritageClause */: + return node.parent.heritageClauses; + } + const { parent } = node; + if (isJSDocTag(node)) { + return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; + } + switch (parent.kind) { + case 184 /* TypeLiteral */: + case 261 /* InterfaceDeclaration */: + return isTypeElement(node) ? parent.members : void 0; + case 189 /* UnionType */: + case 190 /* IntersectionType */: + return parent.types; + case 186 /* TupleType */: + case 206 /* ArrayLiteralExpression */: + case 357 /* CommaListExpression */: + case 272 /* NamedImports */: + case 276 /* NamedExports */: + return parent.elements; + case 207 /* ObjectLiteralExpression */: + case 289 /* JsxAttributes */: + return parent.properties; + case 210 /* CallExpression */: + case 211 /* NewExpression */: + return isTypeNode(node) ? parent.typeArguments : parent.expression === node ? void 0 : parent.arguments; + case 281 /* JsxElement */: + case 285 /* JsxFragment */: + return isJsxChild(node) ? parent.children : void 0; + case 283 /* JsxOpeningElement */: + case 282 /* JsxSelfClosingElement */: + return isTypeNode(node) ? parent.typeArguments : void 0; + case 238 /* Block */: + case 292 /* CaseClause */: + case 293 /* DefaultClause */: + case 265 /* ModuleBlock */: + return parent.statements; + case 266 /* CaseBlock */: + return parent.clauses; + case 260 /* ClassDeclaration */: + case 228 /* ClassExpression */: + return isClassElement(node) ? parent.members : void 0; + case 263 /* EnumDeclaration */: + return isEnumMember(node) ? parent.members : void 0; + case 308 /* SourceFile */: + return parent.statements; + } +} // src/compiler/factory/baseNodeFactory.ts function createBaseNodeFactory() { @@ -17452,6 +18299,22 @@ function getSyntheticTrailingComments(node) { var _a2; return (_a2 = node.emitNode) == null ? void 0 : _a2.trailingComments; } +function getConstantValue(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.constantValue; +} +function getEmitHelpers(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.helpers; +} +function getSnippetElement(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.snippetElement; +} +function getTypeNode(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode; +} function setIdentifierTypeArguments(node, typeArguments) { getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; return node; @@ -17466,6 +18329,17 @@ function setIdentifierAutoGenerate(node, autoGenerate) { } // src/compiler/factory/emitHelpers.ts +function compareEmitHelpers(x, y) { + if (x === y) + return 0 /* EqualTo */; + if (x.priority === y.priority) + return 0 /* EqualTo */; + if (x.priority === void 0) + return 1 /* GreaterThan */; + if (y.priority === void 0) + return -1 /* LessThan */; + return compareValues(x.priority, y.priority); +} function helperString(input, ...args) { return (uniqueName) => { let result = ""; @@ -17749,6 +18623,9 @@ function isNonNullExpression(node) { function isMetaProperty(node) { return node.kind === 233 /* MetaProperty */; } +function isPartiallyEmittedExpression(node) { + return node.kind === 356 /* PartiallyEmittedExpression */; +} function isCommaListExpression(node) { return node.kind === 357 /* CommaListExpression */; } @@ -17761,6 +18638,9 @@ function isBlock(node) { function isVariableStatement(node) { return node.kind === 240 /* VariableStatement */; } +function isEmptyStatement(node) { + return node.kind === 239 /* EmptyStatement */; +} function isExpressionStatement(node) { return node.kind === 241 /* ExpressionStatement */; } @@ -17869,9 +18749,15 @@ function isShorthandPropertyAssignment(node) { function isEnumMember(node) { return node.kind === 302 /* EnumMember */; } +function isUnparsedPrepend(node) { + return node.kind === 304 /* UnparsedPrepend */; +} function isSourceFile(node) { return node.kind === 308 /* SourceFile */; } +function isUnparsedSource(node) { + return node.kind === 310 /* UnparsedSource */; +} function isJSDocTypeExpression(node) { return node.kind === 312 /* JSDocTypeExpression */; } @@ -17884,6 +18770,9 @@ function isJSDocFunctionType(node) { function isJSDoc(node) { return node.kind === 323 /* JSDoc */; } +function isJSDocTypeLiteral(node) { + return node.kind === 325 /* JSDocTypeLiteral */; +} function isJSDocPublicTag(node) { return node.kind === 336 /* JSDocPublicTag */; } @@ -17981,6 +18870,16 @@ function startOnNewLine(node) { true ); } +function getExternalHelpersModuleName(node) { + const parseNode = getOriginalNode(node, isSourceFile); + const emitNode = parseNode && parseNode.emitNode; + return emitNode && emitNode.externalHelpersModuleName; +} +function hasRecordedExternalHelpers(sourceFile) { + const parseNode = getOriginalNode(sourceFile, isSourceFile); + const emitNode = parseNode && parseNode.emitNode; + return !!emitNode && (!!emitNode.externalHelpersModuleName || !!emitNode.externalHelpers); +} function getTargetOfBindingOrAssignmentElement(bindingElement) { if (isDeclarationBindingElement(bindingElement)) { return bindingElement.name; @@ -18225,6 +19124,25 @@ function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, return resultHolder.value; } } +function getNodeForGeneratedName(name) { + var _a2; + const autoGenerate = name.emitNode.autoGenerate; + if (autoGenerate.flags & 4 /* Node */) { + const autoGenerateId = autoGenerate.id; + let node = name; + let original = node.original; + while (original) { + node = original; + const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) { + break; + } + original = node.original; + } + return node; + } + return name; +} function formatGeneratedNamePart(part, generateName) { return typeof part === "object" ? formatGeneratedName( /*privateName*/ @@ -18256,6 +19174,10 @@ function canHaveModifiers(node) { const kind = node.kind; return kind === 165 /* TypeParameter */ || kind === 166 /* Parameter */ || kind === 168 /* PropertySignature */ || kind === 169 /* PropertyDeclaration */ || kind === 170 /* MethodSignature */ || kind === 171 /* MethodDeclaration */ || kind === 173 /* Constructor */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */ || kind === 178 /* IndexSignature */ || kind === 182 /* ConstructorType */ || kind === 215 /* FunctionExpression */ || kind === 216 /* ArrowFunction */ || kind === 228 /* ClassExpression */ || kind === 240 /* VariableStatement */ || kind === 259 /* FunctionDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 275 /* ExportDeclaration */; } +function canHaveDecorators(node) { + const kind = node.kind; + return kind === 166 /* Parameter */ || kind === 169 /* PropertyDeclaration */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */ || kind === 228 /* ClassExpression */ || kind === 260 /* ClassDeclaration */; +} // src/compiler/parser.ts var NodeConstructor; @@ -33840,6 +34762,24 @@ function extractSingleNode(nodes) { return singleOrUndefined(nodes); } +// src/compiler/sourcemap.ts +function isStringOrNull(x) { + return typeof x === "string" || x === null; +} +function isRawSourceMap(x) { + return x !== null && typeof x === "object" && x.version === 3 && typeof x.file === "string" && typeof x.mappings === "string" && isArray(x.sources) && every(x.sources, isString) && (x.sourceRoot === void 0 || x.sourceRoot === null || typeof x.sourceRoot === "string") && (x.sourcesContent === void 0 || x.sourcesContent === null || isArray(x.sourcesContent) && every(x.sourcesContent, isStringOrNull)) && (x.names === void 0 || x.names === null || isArray(x.names) && every(x.names, isString)); +} +function tryParseRawSourceMap(text) { + try { + const parsed = JSON.parse(text); + if (isRawSourceMap(parsed)) { + return parsed; + } + } catch (e) { + } + return void 0; +} + // src/compiler/transformers/jsx.ts var entities = new Map(Object.entries({ quot: 34, @@ -34098,8 +35038,54 @@ var entities = new Map(Object.entries({ })); // src/compiler/transformers/declarations.ts +function hasInternalAnnotation(range, currentSourceFile) { + const comment = currentSourceFile.text.substring(range.pos, range.end); + return stringContains(comment, "@internal"); +} +function isInternalDeclaration(node, currentSourceFile) { + const parseTreeNode = getParseTreeNode(node); + if (parseTreeNode && parseTreeNode.kind === 166 /* Parameter */) { + const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); + const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0; + const text = currentSourceFile.text; + const commentRanges = previousSibling ? concatenate( + // to handle + // ... parameters, /** @internal */ + // public param: string + getTrailingCommentRanges(text, skipTrivia( + text, + previousSibling.end + 1, + /* stopAfterLineBreak */ + false, + /* stopAtComments */ + true + )), + getLeadingCommentRanges(text, node.pos) + ) : getTrailingCommentRanges(text, skipTrivia( + text, + node.pos, + /* stopAfterLineBreak */ + false, + /* stopAtComments */ + true + )); + return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile); + } + const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile); + return !!forEach(leadingCommentRanges, (range) => { + return hasInternalAnnotation(range, currentSourceFile); + }); +} var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */; +// src/compiler/transformer.ts +function noEmitSubstitution(_hint, node) { + return node; +} +function noEmitNotification(hint, node, callback) { + callback(hint, node); +} + // src/compiler/emitter.ts var brackets = createBracketsMap(); function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCanonicalFileName, checkSourceFilesBelongToPath) { @@ -34118,13 +35104,4674 @@ function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCa } return commonSourceDirectory; } -function createBracketsMap() { - const brackets2 = []; - brackets2[1024 /* Braces */] = ["{", "}"]; - brackets2[2048 /* Parenthesis */] = ["(", ")"]; - brackets2[4096 /* AngleBrackets */] = ["<", ">"]; - brackets2[8192 /* SquareBrackets */] = ["[", "]"]; - return brackets2; +var createPrinterWithDefaults = memoize(() => createPrinter({})); +var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); +var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); +var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); +function createPrinter(printerOptions = {}, handlers = {}) { + const { + hasGlobalName, + onEmitNode = noEmitNotification, + isEmitNotificationEnabled, + substituteNode = noEmitSubstitution, + onBeforeEmitNode, + onAfterEmitNode, + onBeforeEmitNodeArray, + onAfterEmitNodeArray, + onBeforeEmitToken, + onAfterEmitToken + } = handlers; + const extendedDiagnostics = !!printerOptions.extendedDiagnostics; + const newLine = getNewLineCharacter(printerOptions); + const moduleKind = getEmitModuleKind(printerOptions); + const bundledHelpers = /* @__PURE__ */ new Map(); + let currentSourceFile; + let nodeIdToGeneratedName; + let nodeIdToGeneratedPrivateName; + let autoGeneratedIdToGeneratedName; + let generatedNames; + let formattedNameTempFlagsStack; + let formattedNameTempFlags; + let privateNameTempFlagsStack; + let privateNameTempFlags; + let tempFlagsStack; + let tempFlags; + let reservedNamesStack; + let reservedNames; + let reservedPrivateNamesStack; + let reservedPrivateNames; + let preserveSourceNewlines = printerOptions.preserveSourceNewlines; + let nextListElementPos; + let writer; + let ownWriter; + let write = writeBase; + let isOwnFileEmit; + const bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; + const relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; + const recordInternalSection = printerOptions.recordInternalSection; + let sourceFileTextPos = 0; + let sourceFileTextKind = "text" /* Text */; + let sourceMapsDisabled = true; + let sourceMapGenerator; + let sourceMapSource; + let sourceMapSourceIndex = -1; + let mostRecentlyAddedSourceMapSource; + let mostRecentlyAddedSourceMapSourceIndex = -1; + let containerPos = -1; + let containerEnd = -1; + let declarationListContainerEnd = -1; + let currentLineMap; + let detachedCommentsInfo; + let hasWrittenComment = false; + let commentsDisabled = !!printerOptions.removeComments; + let lastSubstitution; + let currentParenthesizerRule; + const { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); + const parenthesizer = factory.parenthesizer; + const typeArgumentParenthesizerRuleSelector = { + select: (index) => index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 + }; + const emitBinaryExpression = createEmitBinaryExpression(); + reset(); + return { + // public API + printNode, + printList, + printFile, + printBundle, + // internal API + writeNode, + writeList, + writeFile: writeFile2, + writeBundle, + bundleFileInfo + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0 /* SourceFile */: + Debug.assert(isSourceFile(node), "Expected a SourceFile node."); + break; + case 2 /* IdentifierName */: + Debug.assert(isIdentifier(node), "Expected an Identifier node."); + break; + case 1 /* Expression */: + Debug.assert(isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 308 /* SourceFile */: + return printFile(node); + case 309 /* Bundle */: + return printBundle(node); + case 310 /* UnparsedSource */: + return printUnparsedSource(node); + } + writeNode(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printList(format, nodes, sourceFile) { + writeList(format, nodes, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle( + bundle, + beginPrint(), + /*sourceMapEmitter*/ + void 0 + ); + return endPrint(); + } + function printFile(sourceFile) { + writeFile2( + sourceFile, + beginPrint(), + /*sourceMapEmitter*/ + void 0 + ); + return endPrint(); + } + function printUnparsedSource(unparsed) { + writeUnparsedSource(unparsed, beginPrint()); + return endPrint(); + } + function writeNode(hint, node, sourceFile, output) { + const previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + print(hint, node, sourceFile); + reset(); + writer = previousWriter; + } + function writeList(format, nodes, sourceFile, output) { + const previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + if (sourceFile) { + setSourceFile(sourceFile); + } + emitList( + /*parentNode*/ + void 0, + nodes, + format + ); + reset(); + writer = previousWriter; + } + function getTextPosWithWriteLine() { + return writer.getTextPosWithWriteLine ? writer.getTextPosWithWriteLine() : writer.getTextPos(); + } + function updateOrPushBundleFileTextLike(pos, end, kind) { + const last2 = lastOrUndefined(bundleFileInfo.sections); + if (last2 && last2.kind === kind) { + last2.end = end; + } else { + bundleFileInfo.sections.push({ pos, end, kind }); + } + } + function recordBundleFileInternalSectionStart(node) { + if (recordInternalSection && bundleFileInfo && currentSourceFile && (isDeclaration(node) || isVariableStatement(node)) && isInternalDeclaration(node, currentSourceFile) && sourceFileTextKind !== "internal" /* Internal */) { + const prevSourceFileTextKind = sourceFileTextKind; + recordBundleFileTextLikeSection(writer.getTextPos()); + sourceFileTextPos = getTextPosWithWriteLine(); + sourceFileTextKind = "internal" /* Internal */; + return prevSourceFileTextKind; + } + return void 0; + } + function recordBundleFileInternalSectionEnd(prevSourceFileTextKind) { + if (prevSourceFileTextKind) { + recordBundleFileTextLikeSection(writer.getTextPos()); + sourceFileTextPos = getTextPosWithWriteLine(); + sourceFileTextKind = prevSourceFileTextKind; + } + } + function recordBundleFileTextLikeSection(end) { + if (sourceFileTextPos < end) { + updateOrPushBundleFileTextLike(sourceFileTextPos, end, sourceFileTextKind); + return true; + } + return false; + } + function writeBundle(bundle, output, sourceMapGenerator2) { + isOwnFileEmit = false; + const previousWriter = writer; + setWriter(output, sourceMapGenerator2); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpers(bundle); + emitSyntheticTripleSlashReferencesIfNeeded(bundle); + for (const prepend of bundle.prepends) { + writeLine(); + const pos = writer.getTextPos(); + const savedSections = bundleFileInfo && bundleFileInfo.sections; + if (savedSections) + bundleFileInfo.sections = []; + print( + 4 /* Unspecified */, + prepend, + /*sourceFile*/ + void 0 + ); + if (bundleFileInfo) { + const newSections = bundleFileInfo.sections; + bundleFileInfo.sections = savedSections; + if (prepend.oldFileOfCurrentEmit) + bundleFileInfo.sections.push(...newSections); + else { + newSections.forEach((section) => Debug.assert(isBundleFileTextLike(section))); + bundleFileInfo.sections.push({ + pos, + end: writer.getTextPos(), + kind: "prepend" /* Prepend */, + data: relativeToBuildInfo(prepend.fileName), + texts: newSections + }); + } + } + } + sourceFileTextPos = getTextPosWithWriteLine(); + for (const sourceFile of bundle.sourceFiles) { + print(0 /* SourceFile */, sourceFile, sourceFile); + } + if (bundleFileInfo && bundle.sourceFiles.length) { + const end = writer.getTextPos(); + if (recordBundleFileTextLikeSection(end)) { + const prologues = getPrologueDirectivesFromBundledSourceFiles(bundle); + if (prologues) { + if (!bundleFileInfo.sources) + bundleFileInfo.sources = {}; + bundleFileInfo.sources.prologues = prologues; + } + const helpers = getHelpersFromBundledSourceFiles(bundle); + if (helpers) { + if (!bundleFileInfo.sources) + bundleFileInfo.sources = {}; + bundleFileInfo.sources.helpers = helpers; + } + } + } + reset(); + writer = previousWriter; + } + function writeUnparsedSource(unparsed, output) { + const previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + print( + 4 /* Unspecified */, + unparsed, + /*sourceFile*/ + void 0 + ); + reset(); + writer = previousWriter; + } + function writeFile2(sourceFile, output, sourceMapGenerator2) { + isOwnFileEmit = true; + const previousWriter = writer; + setWriter(output, sourceMapGenerator2); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0 /* SourceFile */, sourceFile, sourceFile); + reset(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = createTextWriter(newLine)); + } + function endPrint() { + const text = ownWriter.getText(); + ownWriter.clear(); + return text; + } + function print(hint, node, sourceFile) { + if (sourceFile) { + setSourceFile(sourceFile); + } + pipelineEmit( + hint, + node, + /*parenthesizerRule*/ + void 0 + ); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + currentLineMap = void 0; + detachedCommentsInfo = void 0; + if (sourceFile) { + setSourceMapSource(sourceFile); + } + } + function setWriter(_writer, _sourceMapGenerator) { + if (_writer && printerOptions.omitTrailingSemicolon) { + _writer = getTrailingSemicolonDeferringWriter(_writer); + } + writer = _writer; + sourceMapGenerator = _sourceMapGenerator; + sourceMapsDisabled = !writer || !sourceMapGenerator; + } + function reset() { + nodeIdToGeneratedName = []; + nodeIdToGeneratedPrivateName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = /* @__PURE__ */ new Set(); + formattedNameTempFlagsStack = []; + formattedNameTempFlags = /* @__PURE__ */ new Map(); + privateNameTempFlagsStack = []; + privateNameTempFlags = TempFlags.Auto; + tempFlagsStack = []; + tempFlags = TempFlags.Auto; + reservedNamesStack = []; + reservedNames = void 0; + reservedPrivateNamesStack = []; + reservedPrivateNames = void 0; + currentSourceFile = void 0; + currentLineMap = void 0; + detachedCommentsInfo = void 0; + setWriter( + /*output*/ + void 0, + /*_sourceMapGenerator*/ + void 0 + ); + } + function getCurrentLineMap() { + return currentLineMap || (currentLineMap = getLineStarts(Debug.checkDefined(currentSourceFile))); + } + function emit(node, parenthesizerRule) { + if (node === void 0) + return; + const prevSourceFileTextKind = recordBundleFileInternalSectionStart(node); + pipelineEmit(4 /* Unspecified */, node, parenthesizerRule); + recordBundleFileInternalSectionEnd(prevSourceFileTextKind); + } + function emitIdentifierName(node) { + if (node === void 0) + return; + pipelineEmit( + 2 /* IdentifierName */, + node, + /*parenthesizerRule*/ + void 0 + ); + } + function emitExpression(node, parenthesizerRule) { + if (node === void 0) + return; + pipelineEmit(1 /* Expression */, node, parenthesizerRule); + } + function emitJsxAttributeValue(node) { + pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node); + } + function beforeEmitNode(node) { + if (preserveSourceNewlines && getInternalEmitFlags(node) & 4 /* IgnoreSourceNewlines */) { + preserveSourceNewlines = false; + } + } + function afterEmitNode(savedPreserveSourceNewlines) { + preserveSourceNewlines = savedPreserveSourceNewlines; + } + function pipelineEmit(emitHint, node, parenthesizerRule) { + currentParenthesizerRule = parenthesizerRule; + const pipelinePhase = getPipelinePhase(0 /* Notification */, emitHint, node); + pipelinePhase(emitHint, node); + currentParenthesizerRule = void 0; + } + function shouldEmitComments(node) { + return !commentsDisabled && !isSourceFile(node); + } + function shouldEmitSourceMaps(node) { + return !sourceMapsDisabled && !isSourceFile(node) && !isInJsonFile(node) && !isUnparsedSource(node) && !isUnparsedPrepend(node); + } + function getPipelinePhase(phase, emitHint, node) { + switch (phase) { + case 0 /* Notification */: + if (onEmitNode !== noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) { + return pipelineEmitWithNotification; + } + case 1 /* Substitution */: + if (substituteNode !== noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) { + if (currentParenthesizerRule) { + lastSubstitution = currentParenthesizerRule(lastSubstitution); + } + return pipelineEmitWithSubstitution; + } + case 2 /* Comments */: + if (shouldEmitComments(node)) { + return pipelineEmitWithComments; + } + case 3 /* SourceMaps */: + if (shouldEmitSourceMaps(node)) { + return pipelineEmitWithSourceMaps; + } + case 4 /* Emit */: + return pipelineEmitWithHint; + default: + return Debug.assertNever(phase); + } + } + function getNextPipelinePhase(currentPhase, emitHint, node) { + return getPipelinePhase(currentPhase + 1, emitHint, node); + } + function pipelineEmitWithNotification(hint, node) { + const pipelinePhase = getNextPipelinePhase(0 /* Notification */, hint, node); + onEmitNode(hint, node, pipelinePhase); + } + function pipelineEmitWithHint(hint, node) { + onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); + if (preserveSourceNewlines) { + const savedPreserveSourceNewlines = preserveSourceNewlines; + beforeEmitNode(node); + pipelineEmitWithHintWorker(hint, node); + afterEmitNode(savedPreserveSourceNewlines); + } else { + pipelineEmitWithHintWorker(hint, node); + } + onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); + currentParenthesizerRule = void 0; + } + function pipelineEmitWithHintWorker(hint, node, allowSnippets = true) { + if (allowSnippets) { + const snippet = getSnippetElement(node); + if (snippet) { + return emitSnippetNode(hint, node, snippet); + } + } + if (hint === 0 /* SourceFile */) + return emitSourceFile(cast(node, isSourceFile)); + if (hint === 2 /* IdentifierName */) + return emitIdentifier(cast(node, isIdentifier)); + if (hint === 6 /* JsxAttributeValue */) + return emitLiteral( + cast(node, isStringLiteral), + /*jsxAttributeEscape*/ + true + ); + if (hint === 3 /* MappedTypeParameter */) + return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration)); + if (hint === 5 /* EmbeddedStatement */) { + Debug.assertNode(node, isEmptyStatement); + return emitEmptyStatement( + /*isEmbeddedStatement*/ + true + ); + } + if (hint === 4 /* Unspecified */) { + switch (node.kind) { + case 15 /* TemplateHead */: + case 16 /* TemplateMiddle */: + case 17 /* TemplateTail */: + return emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + case 79 /* Identifier */: + return emitIdentifier(node); + case 80 /* PrivateIdentifier */: + return emitPrivateIdentifier(node); + case 163 /* QualifiedName */: + return emitQualifiedName(node); + case 164 /* ComputedPropertyName */: + return emitComputedPropertyName(node); + case 165 /* TypeParameter */: + return emitTypeParameter(node); + case 166 /* Parameter */: + return emitParameter(node); + case 167 /* Decorator */: + return emitDecorator(node); + case 168 /* PropertySignature */: + return emitPropertySignature(node); + case 169 /* PropertyDeclaration */: + return emitPropertyDeclaration(node); + case 170 /* MethodSignature */: + return emitMethodSignature(node); + case 171 /* MethodDeclaration */: + return emitMethodDeclaration(node); + case 172 /* ClassStaticBlockDeclaration */: + return emitClassStaticBlockDeclaration(node); + case 173 /* Constructor */: + return emitConstructor(node); + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: + return emitAccessorDeclaration(node); + case 176 /* CallSignature */: + return emitCallSignature(node); + case 177 /* ConstructSignature */: + return emitConstructSignature(node); + case 178 /* IndexSignature */: + return emitIndexSignature(node); + case 179 /* TypePredicate */: + return emitTypePredicate(node); + case 180 /* TypeReference */: + return emitTypeReference(node); + case 181 /* FunctionType */: + return emitFunctionType(node); + case 182 /* ConstructorType */: + return emitConstructorType(node); + case 183 /* TypeQuery */: + return emitTypeQuery(node); + case 184 /* TypeLiteral */: + return emitTypeLiteral(node); + case 185 /* ArrayType */: + return emitArrayType(node); + case 186 /* TupleType */: + return emitTupleType(node); + case 187 /* OptionalType */: + return emitOptionalType(node); + case 189 /* UnionType */: + return emitUnionType(node); + case 190 /* IntersectionType */: + return emitIntersectionType(node); + case 191 /* ConditionalType */: + return emitConditionalType(node); + case 192 /* InferType */: + return emitInferType(node); + case 193 /* ParenthesizedType */: + return emitParenthesizedType(node); + case 230 /* ExpressionWithTypeArguments */: + return emitExpressionWithTypeArguments(node); + case 194 /* ThisType */: + return emitThisType(); + case 195 /* TypeOperator */: + return emitTypeOperator(node); + case 196 /* IndexedAccessType */: + return emitIndexedAccessType(node); + case 197 /* MappedType */: + return emitMappedType(node); + case 198 /* LiteralType */: + return emitLiteralType(node); + case 199 /* NamedTupleMember */: + return emitNamedTupleMember(node); + case 200 /* TemplateLiteralType */: + return emitTemplateType(node); + case 201 /* TemplateLiteralTypeSpan */: + return emitTemplateTypeSpan(node); + case 202 /* ImportType */: + return emitImportTypeNode(node); + case 203 /* ObjectBindingPattern */: + return emitObjectBindingPattern(node); + case 204 /* ArrayBindingPattern */: + return emitArrayBindingPattern(node); + case 205 /* BindingElement */: + return emitBindingElement(node); + case 236 /* TemplateSpan */: + return emitTemplateSpan(node); + case 237 /* SemicolonClassElement */: + return emitSemicolonClassElement(); + case 238 /* Block */: + return emitBlock(node); + case 240 /* VariableStatement */: + return emitVariableStatement(node); + case 239 /* EmptyStatement */: + return emitEmptyStatement( + /*isEmbeddedStatement*/ + false + ); + case 241 /* ExpressionStatement */: + return emitExpressionStatement(node); + case 242 /* IfStatement */: + return emitIfStatement(node); + case 243 /* DoStatement */: + return emitDoStatement(node); + case 244 /* WhileStatement */: + return emitWhileStatement(node); + case 245 /* ForStatement */: + return emitForStatement(node); + case 246 /* ForInStatement */: + return emitForInStatement(node); + case 247 /* ForOfStatement */: + return emitForOfStatement(node); + case 248 /* ContinueStatement */: + return emitContinueStatement(node); + case 249 /* BreakStatement */: + return emitBreakStatement(node); + case 250 /* ReturnStatement */: + return emitReturnStatement(node); + case 251 /* WithStatement */: + return emitWithStatement(node); + case 252 /* SwitchStatement */: + return emitSwitchStatement(node); + case 253 /* LabeledStatement */: + return emitLabeledStatement(node); + case 254 /* ThrowStatement */: + return emitThrowStatement(node); + case 255 /* TryStatement */: + return emitTryStatement(node); + case 256 /* DebuggerStatement */: + return emitDebuggerStatement(node); + case 257 /* VariableDeclaration */: + return emitVariableDeclaration(node); + case 258 /* VariableDeclarationList */: + return emitVariableDeclarationList(node); + case 259 /* FunctionDeclaration */: + return emitFunctionDeclaration(node); + case 260 /* ClassDeclaration */: + return emitClassDeclaration(node); + case 261 /* InterfaceDeclaration */: + return emitInterfaceDeclaration(node); + case 262 /* TypeAliasDeclaration */: + return emitTypeAliasDeclaration(node); + case 263 /* EnumDeclaration */: + return emitEnumDeclaration(node); + case 264 /* ModuleDeclaration */: + return emitModuleDeclaration(node); + case 265 /* ModuleBlock */: + return emitModuleBlock(node); + case 266 /* CaseBlock */: + return emitCaseBlock(node); + case 267 /* NamespaceExportDeclaration */: + return emitNamespaceExportDeclaration(node); + case 268 /* ImportEqualsDeclaration */: + return emitImportEqualsDeclaration(node); + case 269 /* ImportDeclaration */: + return emitImportDeclaration(node); + case 270 /* ImportClause */: + return emitImportClause(node); + case 271 /* NamespaceImport */: + return emitNamespaceImport(node); + case 277 /* NamespaceExport */: + return emitNamespaceExport(node); + case 272 /* NamedImports */: + return emitNamedImports(node); + case 273 /* ImportSpecifier */: + return emitImportSpecifier(node); + case 274 /* ExportAssignment */: + return emitExportAssignment(node); + case 275 /* ExportDeclaration */: + return emitExportDeclaration(node); + case 276 /* NamedExports */: + return emitNamedExports(node); + case 278 /* ExportSpecifier */: + return emitExportSpecifier(node); + case 296 /* AssertClause */: + return emitAssertClause(node); + case 297 /* AssertEntry */: + return emitAssertEntry(node); + case 279 /* MissingDeclaration */: + return; + case 280 /* ExternalModuleReference */: + return emitExternalModuleReference(node); + case 11 /* JsxText */: + return emitJsxText(node); + case 283 /* JsxOpeningElement */: + case 286 /* JsxOpeningFragment */: + return emitJsxOpeningElementOrFragment(node); + case 284 /* JsxClosingElement */: + case 287 /* JsxClosingFragment */: + return emitJsxClosingElementOrFragment(node); + case 288 /* JsxAttribute */: + return emitJsxAttribute(node); + case 289 /* JsxAttributes */: + return emitJsxAttributes(node); + case 290 /* JsxSpreadAttribute */: + return emitJsxSpreadAttribute(node); + case 291 /* JsxExpression */: + return emitJsxExpression(node); + case 292 /* CaseClause */: + return emitCaseClause(node); + case 293 /* DefaultClause */: + return emitDefaultClause(node); + case 294 /* HeritageClause */: + return emitHeritageClause(node); + case 295 /* CatchClause */: + return emitCatchClause(node); + case 299 /* PropertyAssignment */: + return emitPropertyAssignment(node); + case 300 /* ShorthandPropertyAssignment */: + return emitShorthandPropertyAssignment(node); + case 301 /* SpreadAssignment */: + return emitSpreadAssignment(node); + case 302 /* EnumMember */: + return emitEnumMember(node); + case 303 /* UnparsedPrologue */: + return writeUnparsedNode(node); + case 310 /* UnparsedSource */: + case 304 /* UnparsedPrepend */: + return emitUnparsedSourceOrPrepend(node); + case 305 /* UnparsedText */: + case 306 /* UnparsedInternalText */: + return emitUnparsedTextLike(node); + case 307 /* UnparsedSyntheticReference */: + return emitUnparsedSyntheticReference(node); + case 308 /* SourceFile */: + return emitSourceFile(node); + case 309 /* Bundle */: + return Debug.fail("Bundles should be printed using printBundle"); + case 311 /* InputFiles */: + return Debug.fail("InputFiles should not be printed"); + case 312 /* JSDocTypeExpression */: + return emitJSDocTypeExpression(node); + case 313 /* JSDocNameReference */: + return emitJSDocNameReference(node); + case 315 /* JSDocAllType */: + return writePunctuation("*"); + case 316 /* JSDocUnknownType */: + return writePunctuation("?"); + case 317 /* JSDocNullableType */: + return emitJSDocNullableType(node); + case 318 /* JSDocNonNullableType */: + return emitJSDocNonNullableType(node); + case 319 /* JSDocOptionalType */: + return emitJSDocOptionalType(node); + case 320 /* JSDocFunctionType */: + return emitJSDocFunctionType(node); + case 188 /* RestType */: + case 321 /* JSDocVariadicType */: + return emitRestOrJSDocVariadicType(node); + case 322 /* JSDocNamepathType */: + return; + case 323 /* JSDoc */: + return emitJSDoc(node); + case 325 /* JSDocTypeLiteral */: + return emitJSDocTypeLiteral(node); + case 326 /* JSDocSignature */: + return emitJSDocSignature(node); + case 330 /* JSDocTag */: + case 335 /* JSDocClassTag */: + case 340 /* JSDocOverrideTag */: + return emitJSDocSimpleTag(node); + case 331 /* JSDocAugmentsTag */: + case 332 /* JSDocImplementsTag */: + return emitJSDocHeritageTag(node); + case 333 /* JSDocAuthorTag */: + case 334 /* JSDocDeprecatedTag */: + return; + case 336 /* JSDocPublicTag */: + case 337 /* JSDocPrivateTag */: + case 338 /* JSDocProtectedTag */: + case 339 /* JSDocReadonlyTag */: + return; + case 341 /* JSDocCallbackTag */: + return emitJSDocCallbackTag(node); + case 342 /* JSDocOverloadTag */: + return emitJSDocOverloadTag(node); + case 344 /* JSDocParameterTag */: + case 351 /* JSDocPropertyTag */: + return emitJSDocPropertyLikeTag(node); + case 343 /* JSDocEnumTag */: + case 345 /* JSDocReturnTag */: + case 346 /* JSDocThisTag */: + case 347 /* JSDocTypeTag */: + case 352 /* JSDocThrowsTag */: + case 353 /* JSDocSatisfiesTag */: + return emitJSDocSimpleTypedTag(node); + case 348 /* JSDocTemplateTag */: + return emitJSDocTemplateTag(node); + case 349 /* JSDocTypedefTag */: + return emitJSDocTypedefTag(node); + case 350 /* JSDocSeeTag */: + return emitJSDocSeeTag(node); + case 355 /* NotEmittedStatement */: + case 359 /* EndOfDeclarationMarker */: + case 358 /* MergeDeclarationMarker */: + return; + } + if (isExpression(node)) { + hint = 1 /* Expression */; + if (substituteNode !== noEmitSubstitution) { + const substitute = substituteNode(hint, node) || node; + if (substitute !== node) { + node = substitute; + if (currentParenthesizerRule) { + node = currentParenthesizerRule(node); + } + } + } + } + } + if (hint === 1 /* Expression */) { + switch (node.kind) { + case 8 /* NumericLiteral */: + case 9 /* BigIntLiteral */: + return emitNumericOrBigIntLiteral(node); + case 10 /* StringLiteral */: + case 13 /* RegularExpressionLiteral */: + case 14 /* NoSubstitutionTemplateLiteral */: + return emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + case 79 /* Identifier */: + return emitIdentifier(node); + case 80 /* PrivateIdentifier */: + return emitPrivateIdentifier(node); + case 206 /* ArrayLiteralExpression */: + return emitArrayLiteralExpression(node); + case 207 /* ObjectLiteralExpression */: + return emitObjectLiteralExpression(node); + case 208 /* PropertyAccessExpression */: + return emitPropertyAccessExpression(node); + case 209 /* ElementAccessExpression */: + return emitElementAccessExpression(node); + case 210 /* CallExpression */: + return emitCallExpression(node); + case 211 /* NewExpression */: + return emitNewExpression(node); + case 212 /* TaggedTemplateExpression */: + return emitTaggedTemplateExpression(node); + case 213 /* TypeAssertionExpression */: + return emitTypeAssertionExpression(node); + case 214 /* ParenthesizedExpression */: + return emitParenthesizedExpression(node); + case 215 /* FunctionExpression */: + return emitFunctionExpression(node); + case 216 /* ArrowFunction */: + return emitArrowFunction(node); + case 217 /* DeleteExpression */: + return emitDeleteExpression(node); + case 218 /* TypeOfExpression */: + return emitTypeOfExpression(node); + case 219 /* VoidExpression */: + return emitVoidExpression(node); + case 220 /* AwaitExpression */: + return emitAwaitExpression(node); + case 221 /* PrefixUnaryExpression */: + return emitPrefixUnaryExpression(node); + case 222 /* PostfixUnaryExpression */: + return emitPostfixUnaryExpression(node); + case 223 /* BinaryExpression */: + return emitBinaryExpression(node); + case 224 /* ConditionalExpression */: + return emitConditionalExpression(node); + case 225 /* TemplateExpression */: + return emitTemplateExpression(node); + case 226 /* YieldExpression */: + return emitYieldExpression(node); + case 227 /* SpreadElement */: + return emitSpreadElement(node); + case 228 /* ClassExpression */: + return emitClassExpression(node); + case 229 /* OmittedExpression */: + return; + case 231 /* AsExpression */: + return emitAsExpression(node); + case 232 /* NonNullExpression */: + return emitNonNullExpression(node); + case 230 /* ExpressionWithTypeArguments */: + return emitExpressionWithTypeArguments(node); + case 235 /* SatisfiesExpression */: + return emitSatisfiesExpression(node); + case 233 /* MetaProperty */: + return emitMetaProperty(node); + case 234 /* SyntheticExpression */: + return Debug.fail("SyntheticExpression should never be printed."); + case 279 /* MissingDeclaration */: + return; + case 281 /* JsxElement */: + return emitJsxElement(node); + case 282 /* JsxSelfClosingElement */: + return emitJsxSelfClosingElement(node); + case 285 /* JsxFragment */: + return emitJsxFragment(node); + case 354 /* SyntaxList */: + return Debug.fail("SyntaxList should not be printed"); + case 355 /* NotEmittedStatement */: + return; + case 356 /* PartiallyEmittedExpression */: + return emitPartiallyEmittedExpression(node); + case 357 /* CommaListExpression */: + return emitCommaList(node); + case 358 /* MergeDeclarationMarker */: + case 359 /* EndOfDeclarationMarker */: + return; + case 360 /* SyntheticReferenceExpression */: + return Debug.fail("SyntheticReferenceExpression should not be printed"); + } + } + if (isKeyword(node.kind)) + return writeTokenNode(node, writeKeyword); + if (isTokenKind(node.kind)) + return writeTokenNode(node, writePunctuation); + Debug.fail(`Unhandled SyntaxKind: ${Debug.formatSyntaxKind(node.kind)}.`); + } + function emitMappedTypeParameter(node) { + emit(node.name); + writeSpace(); + writeKeyword("in"); + writeSpace(); + emit(node.constraint); + } + function pipelineEmitWithSubstitution(hint, node) { + const pipelinePhase = getNextPipelinePhase(1 /* Substitution */, hint, node); + Debug.assertIsDefined(lastSubstitution); + node = lastSubstitution; + lastSubstitution = void 0; + pipelinePhase(hint, node); + } + function getHelpersFromBundledSourceFiles(bundle) { + let result; + if (moduleKind === 0 /* None */ || printerOptions.noEmitHelpers) { + return void 0; + } + const bundledHelpers2 = /* @__PURE__ */ new Map(); + for (const sourceFile of bundle.sourceFiles) { + const shouldSkip = getExternalHelpersModuleName(sourceFile) !== void 0; + const helpers = getSortedEmitHelpers(sourceFile); + if (!helpers) + continue; + for (const helper of helpers) { + if (!helper.scoped && !shouldSkip && !bundledHelpers2.get(helper.name)) { + bundledHelpers2.set(helper.name, true); + (result || (result = [])).push(helper.name); + } + } + } + return result; + } + function emitHelpers(node) { + let helpersEmitted = false; + const bundle = node.kind === 309 /* Bundle */ ? node : void 0; + if (bundle && moduleKind === 0 /* None */) { + return; + } + const numPrepends = bundle ? bundle.prepends.length : 0; + const numNodes = bundle ? bundle.sourceFiles.length + numPrepends : 1; + for (let i = 0; i < numNodes; i++) { + const currentNode = bundle ? i < numPrepends ? bundle.prepends[i] : bundle.sourceFiles[i - numPrepends] : node; + const sourceFile = isSourceFile(currentNode) ? currentNode : isUnparsedSource(currentNode) ? void 0 : currentSourceFile; + const shouldSkip = printerOptions.noEmitHelpers || !!sourceFile && hasRecordedExternalHelpers(sourceFile); + const shouldBundle = (isSourceFile(currentNode) || isUnparsedSource(currentNode)) && !isOwnFileEmit; + const helpers = isUnparsedSource(currentNode) ? currentNode.helpers : getSortedEmitHelpers(currentNode); + if (helpers) { + for (const helper of helpers) { + if (!helper.scoped) { + if (shouldSkip) + continue; + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } else if (bundle) { + continue; + } + const pos = getTextPosWithWriteLine(); + if (typeof helper.text === "string") { + writeLines(helper.text); + } else { + writeLines(helper.text(makeFileLevelOptimisticUniqueName)); + } + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "emitHelpers" /* EmitHelpers */, data: helper.name }); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + function getSortedEmitHelpers(node) { + const helpers = getEmitHelpers(node); + return helpers && stableSort(helpers, compareEmitHelpers); + } + function emitNumericOrBigIntLiteral(node) { + emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + } + function emitLiteral(node, jsxAttributeEscape) { + const text = getLiteralTextOfNode(node, printerOptions.neverAsciiEscape, jsxAttributeEscape); + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind))) { + writeLiteral(text); + } else { + writeStringLiteral(text); + } + } + function emitUnparsedSourceOrPrepend(unparsed) { + for (const text of unparsed.texts) { + writeLine(); + emit(text); + } + } + function writeUnparsedNode(unparsed) { + writer.rawWrite(unparsed.parent.text.substring(unparsed.pos, unparsed.end)); + } + function emitUnparsedTextLike(unparsed) { + const pos = getTextPosWithWriteLine(); + writeUnparsedNode(unparsed); + if (bundleFileInfo) { + updateOrPushBundleFileTextLike( + pos, + writer.getTextPos(), + unparsed.kind === 305 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */ + ); + } + } + function emitUnparsedSyntheticReference(unparsed) { + const pos = getTextPosWithWriteLine(); + writeUnparsedNode(unparsed); + if (bundleFileInfo) { + const section = clone(unparsed.section); + section.pos = pos; + section.end = writer.getTextPos(); + bundleFileInfo.sections.push(section); + } + } + function emitSnippetNode(hint, node, snippet) { + switch (snippet.kind) { + case 1 /* Placeholder */: + emitPlaceholder(hint, node, snippet); + break; + case 0 /* TabStop */: + emitTabStop(hint, node, snippet); + break; + } + } + function emitPlaceholder(hint, node, snippet) { + nonEscapingWrite(`\${${snippet.order}:`); + pipelineEmitWithHintWorker( + hint, + node, + /*allowSnippets*/ + false + ); + nonEscapingWrite(`}`); + } + function emitTabStop(hint, node, snippet) { + Debug.assert( + node.kind === 239 /* EmptyStatement */, + `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.` + ); + Debug.assert( + hint !== 5 /* EmbeddedStatement */, + `A tab stop cannot be attached to an embedded statement.` + ); + nonEscapingWrite(`$${snippet.order}`); + } + function emitIdentifier(node) { + const writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode2( + node, + /*includeTrivia*/ + false + ), node.symbol); + emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */); + } + function emitPrivateIdentifier(node) { + write(getTextOfNode2( + node, + /*includeTrivia*/ + false + )); + } + function emitQualifiedName(node) { + emitEntityName(node.left); + writePunctuation("."); + emit(node.right); + } + function emitEntityName(node) { + if (node.kind === 79 /* Identifier */) { + emitExpression(node); + } else { + emit(node); + } + } + function emitComputedPropertyName(node) { + const savedPrivateNameTempFlags = privateNameTempFlags; + const savedReservedMemberNames = reservedPrivateNames; + popPrivateNameGenerationScope(); + writePunctuation("["); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName); + writePunctuation("]"); + pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames); + } + function emitTypeParameter(node) { + emitModifierList(node, node.modifiers); + emit(node.name); + if (node.constraint) { + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.constraint); + } + if (node.default) { + writeSpace(); + writeOperator("="); + writeSpace(); + emit(node.default); + } + } + function emitParameter(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emit(node.dotDotDotToken); + emitNodeWithWriter(node.name, writeParameter); + emit(node.questionToken); + if (node.parent && node.parent.kind === 320 /* JSDocFunctionType */ && !node.name) { + emit(node.type); + } else { + emitTypeAnnotation(node.type); + } + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.pos, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitDecorator(decorator) { + writePunctuation("@"); + emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); + } + function emitPropertySignature(node) { + emitModifierList(node, node.modifiers); + emitNodeWithWriter(node.name, writeProperty); + emit(node.questionToken); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + } + function emitPropertyDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emit(node.name); + emit(node.questionToken); + emit(node.exclamationToken); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); + writeTrailingSemicolon(); + } + function emitMethodSignature(node) { + pushNameGenerationScope(node); + emitModifierList(node, node.modifiers); + emit(node.name); + emit(node.questionToken); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitMethodDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emit(node.asteriskToken); + emit(node.name); + emit(node.questionToken); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitClassStaticBlockDeclaration(node) { + writeKeyword("static"); + emitBlockFunctionBody(node.body); + } + function emitConstructor(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("constructor"); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitAccessorDeclaration(node) { + const pos = emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + const token = node.kind === 174 /* GetAccessor */ ? 137 /* GetKeyword */ : 151 /* SetKeyword */; + emitTokenWithComment(token, pos, writeKeyword, node); + writeSpace(); + emit(node.name); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitCallSignature(node) { + pushNameGenerationScope(node); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitConstructSignature(node) { + pushNameGenerationScope(node); + writeKeyword("new"); + writeSpace(); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitIndexSignature(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + emitParametersForIndexSignature(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + } + function emitTemplateTypeSpan(node) { + emit(node.type); + emit(node.literal); + } + function emitSemicolonClassElement() { + writeTrailingSemicolon(); + } + function emitTypePredicate(node) { + if (node.assertsModifier) { + emit(node.assertsModifier); + writeSpace(); + } + emit(node.parameterName); + if (node.type) { + writeSpace(); + writeKeyword("is"); + writeSpace(); + emit(node.type); + } + } + function emitTypeReference(node) { + emit(node.typeName); + emitTypeArguments(node, node.typeArguments); + } + function emitFunctionType(node) { + pushNameGenerationScope(node); + emitTypeParameters(node, node.typeParameters); + emitParametersForArrow(node, node.parameters); + writeSpace(); + writePunctuation("=>"); + writeSpace(); + emit(node.type); + popNameGenerationScope(node); + } + function emitJSDocFunctionType(node) { + writeKeyword("function"); + emitParameters(node, node.parameters); + writePunctuation(":"); + emit(node.type); + } + function emitJSDocNullableType(node) { + writePunctuation("?"); + emit(node.type); + } + function emitJSDocNonNullableType(node) { + writePunctuation("!"); + emit(node.type); + } + function emitJSDocOptionalType(node) { + emit(node.type); + writePunctuation("="); + } + function emitConstructorType(node) { + pushNameGenerationScope(node); + emitModifierList(node, node.modifiers); + writeKeyword("new"); + writeSpace(); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + writeSpace(); + writePunctuation("=>"); + writeSpace(); + emit(node.type); + popNameGenerationScope(node); + } + function emitTypeQuery(node) { + writeKeyword("typeof"); + writeSpace(); + emit(node.exprName); + emitTypeArguments(node, node.typeArguments); + } + function emitTypeLiteral(node) { + pushPrivateNameGenerationScope( + TempFlags.Auto, + /*newReservedMemberNames*/ + void 0 + ); + writePunctuation("{"); + const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */; + emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */); + writePunctuation("}"); + popPrivateNameGenerationScope(); + } + function emitArrayType(node) { + emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); + writePunctuation("["); + writePunctuation("]"); + } + function emitRestOrJSDocVariadicType(node) { + writePunctuation("..."); + emit(node.type); + } + function emitTupleType(node) { + emitTokenWithComment(22 /* OpenBracketToken */, node.pos, writePunctuation, node); + const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 528 /* SingleLineTupleTypeElements */ : 657 /* MultiLineTupleTypeElements */; + emitList(node, node.elements, flags | 524288 /* NoSpaceIfEmpty */, parenthesizer.parenthesizeElementTypeOfTupleType); + emitTokenWithComment(23 /* CloseBracketToken */, node.elements.end, writePunctuation, node); + } + function emitNamedTupleMember(node) { + emit(node.dotDotDotToken); + emit(node.name); + emit(node.questionToken); + emitTokenWithComment(58 /* ColonToken */, node.name.end, writePunctuation, node); + writeSpace(); + emit(node.type); + } + function emitOptionalType(node) { + emit(node.type, parenthesizer.parenthesizeTypeOfOptionalType); + writePunctuation("?"); + } + function emitUnionType(node) { + emitList(node, node.types, 516 /* UnionTypeConstituents */, parenthesizer.parenthesizeConstituentTypeOfUnionType); + } + function emitIntersectionType(node) { + emitList(node, node.types, 520 /* IntersectionTypeConstituents */, parenthesizer.parenthesizeConstituentTypeOfIntersectionType); + } + function emitConditionalType(node) { + emit(node.checkType, parenthesizer.parenthesizeCheckTypeOfConditionalType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.extendsType, parenthesizer.parenthesizeExtendsTypeOfConditionalType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit(node.typeParameter); + } + function emitParenthesizedType(node) { + writePunctuation("("); + emit(node.type); + writePunctuation(")"); + } + function emitThisType() { + writeKeyword("this"); + } + function emitTypeOperator(node) { + writeTokenText(node.operator, writeKeyword); + writeSpace(); + const parenthesizerRule = node.operator === 146 /* ReadonlyKeyword */ ? parenthesizer.parenthesizeOperandOfReadonlyTypeOperator : parenthesizer.parenthesizeOperandOfTypeOperator; + emit(node.type, parenthesizerRule); + } + function emitIndexedAccessType(node) { + emit(node.objectType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); + writePunctuation("["); + emit(node.indexType); + writePunctuation("]"); + } + function emitMappedType(node) { + const emitFlags = getEmitFlags(node); + writePunctuation("{"); + if (emitFlags & 1 /* SingleLine */) { + writeSpace(); + } else { + writeLine(); + increaseIndent(); + } + if (node.readonlyToken) { + emit(node.readonlyToken); + if (node.readonlyToken.kind !== 146 /* ReadonlyKeyword */) { + writeKeyword("readonly"); + } + writeSpace(); + } + writePunctuation("["); + pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); + if (node.nameType) { + writeSpace(); + writeKeyword("as"); + writeSpace(); + emit(node.nameType); + } + writePunctuation("]"); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== 57 /* QuestionToken */) { + writePunctuation("?"); + } + } + writePunctuation(":"); + writeSpace(); + emit(node.type); + writeTrailingSemicolon(); + if (emitFlags & 1 /* SingleLine */) { + writeSpace(); + } else { + writeLine(); + decreaseIndent(); + } + emitList(node, node.members, 2 /* PreserveLines */); + writePunctuation("}"); + } + function emitLiteralType(node) { + emitExpression(node.literal); + } + function emitTemplateType(node) { + emit(node.head); + emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); + } + function emitImportTypeNode(node) { + if (node.isTypeOf) { + writeKeyword("typeof"); + writeSpace(); + } + writeKeyword("import"); + writePunctuation("("); + emit(node.argument); + if (node.assertions) { + writePunctuation(","); + writeSpace(); + writePunctuation("{"); + writeSpace(); + writeKeyword("assert"); + writePunctuation(":"); + writeSpace(); + const elements = node.assertions.assertClause.elements; + emitList(node.assertions.assertClause, elements, 526226 /* ImportClauseEntries */); + writeSpace(); + writePunctuation("}"); + } + writePunctuation(")"); + if (node.qualifier) { + writePunctuation("."); + emit(node.qualifier); + } + emitTypeArguments(node, node.typeArguments); + } + function emitObjectBindingPattern(node) { + writePunctuation("{"); + emitList(node, node.elements, 525136 /* ObjectBindingPatternElements */); + writePunctuation("}"); + } + function emitArrayBindingPattern(node) { + writePunctuation("["); + emitList(node, node.elements, 524880 /* ArrayBindingPatternElements */); + writePunctuation("]"); + } + function emitBindingElement(node) { + emit(node.dotDotDotToken); + if (node.propertyName) { + emit(node.propertyName); + writePunctuation(":"); + writeSpace(); + } + emit(node.name); + emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitArrayLiteralExpression(node) { + const elements = node.elements; + const preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */; + emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitObjectLiteralExpression(node) { + pushPrivateNameGenerationScope( + TempFlags.Auto, + /*newReservedMemberNames*/ + void 0 + ); + forEach(node.properties, generateMemberNames); + const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; + if (indentedFlag) { + increaseIndent(); + } + const preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */; + const allowTrailingComma = currentSourceFile && currentSourceFile.languageVersion >= 1 /* ES5 */ && !isJsonSourceFile(currentSourceFile) ? 64 /* AllowTrailingComma */ : 0 /* None */; + emitList(node, node.properties, 526226 /* ObjectLiteralExpressionProperties */ | allowTrailingComma | preferNewLine); + if (indentedFlag) { + decreaseIndent(); + } + popPrivateNameGenerationScope(); + } + function emitPropertyAccessExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + const token = node.questionDotToken || setTextRangePosEnd(factory.createToken(24 /* DotToken */), node.expression.end, node.name.pos); + const linesBeforeDot = getLinesBetweenNodes(node, node.expression, token); + const linesAfterDot = getLinesBetweenNodes(node, token, node.name); + writeLinesAndIndent( + linesBeforeDot, + /*writeSpaceIfNotIndenting*/ + false + ); + const shouldEmitDotDot = token.kind !== 28 /* QuestionDotToken */ && mayNeedDotDotForPropertyAccess(node.expression) && !writer.hasTrailingComment() && !writer.hasTrailingWhitespace(); + if (shouldEmitDotDot) { + writePunctuation("."); + } + if (node.questionDotToken) { + emit(token); + } else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } + writeLinesAndIndent( + linesAfterDot, + /*writeSpaceIfNotIndenting*/ + false + ); + emit(node.name); + decreaseIndentIf(linesBeforeDot, linesAfterDot); + } + function mayNeedDotDotForPropertyAccess(expression) { + expression = skipPartiallyEmittedExpressions(expression); + if (isNumericLiteral(expression)) { + const text = getLiteralTextOfNode( + expression, + /*neverAsciiEscape*/ + true, + /*jsxAttributeEscape*/ + false + ); + return !expression.numericLiteralFlags && !stringContains(text, tokenToString(24 /* DotToken */)); + } else if (isAccessExpression(expression)) { + const constantValue = getConstantValue(expression); + return typeof constantValue === "number" && isFinite(constantValue) && Math.floor(constantValue) === constantValue; + } + } + function emitElementAccessExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + emit(node.questionDotToken); + emitTokenWithComment(22 /* OpenBracketToken */, node.expression.end, writePunctuation, node); + emitExpression(node.argumentExpression); + emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node); + } + function emitCallExpression(node) { + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; + if (indirectCall) { + writePunctuation("("); + writeLiteral("0"); + writePunctuation(","); + writeSpace(); + } + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + if (indirectCall) { + writePunctuation(")"); + } + emit(node.questionDotToken); + emitTypeArguments(node, node.typeArguments); + emitExpressionList(node, node.arguments, 2576 /* CallExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitNewExpression(node) { + emitTokenWithComment(103 /* NewKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfNew); + emitTypeArguments(node, node.typeArguments); + emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitTaggedTemplateExpression(node) { + const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; + if (indirectCall) { + writePunctuation("("); + writeLiteral("0"); + writePunctuation(","); + writeSpace(); + } + emitExpression(node.tag, parenthesizer.parenthesizeLeftSideOfAccess); + if (indirectCall) { + writePunctuation(")"); + } + emitTypeArguments(node, node.typeArguments); + writeSpace(); + emitExpression(node.template); + } + function emitTypeAssertionExpression(node) { + writePunctuation("<"); + emit(node.type); + writePunctuation(">"); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitParenthesizedExpression(node) { + const openParenPos = emitTokenWithComment(20 /* OpenParenToken */, node.pos, writePunctuation, node); + const indented = writeLineSeparatorsAndIndentBefore(node.expression, node); + emitExpression( + node.expression, + /*parenthesizerRules*/ + void 0 + ); + writeLineSeparatorsAfter(node.expression, node); + decreaseIndentIf(indented); + emitTokenWithComment(21 /* CloseParenToken */, node.expression ? node.expression.end : openParenPos, writePunctuation, node); + } + function emitFunctionExpression(node) { + generateNameIfNeeded(node.name); + emitFunctionDeclarationOrExpression(node); + } + function emitArrowFunction(node) { + emitModifierList(node, node.modifiers); + emitSignatureAndBody(node, emitArrowFunctionHead); + } + function emitArrowFunctionHead(node) { + emitTypeParameters(node, node.typeParameters); + emitParametersForArrow(node, node.parameters); + emitTypeAnnotation(node.type); + writeSpace(); + emit(node.equalsGreaterThanToken); + } + function emitDeleteExpression(node) { + emitTokenWithComment(89 /* DeleteKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitTypeOfExpression(node) { + emitTokenWithComment(112 /* TypeOfKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitVoidExpression(node) { + emitTokenWithComment(114 /* VoidKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitAwaitExpression(node) { + emitTokenWithComment(133 /* AwaitKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitPrefixUnaryExpression(node) { + writeTokenText(node.operator, writeOperator); + if (shouldEmitWhitespaceBeforeOperand(node)) { + writeSpace(); + } + emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function shouldEmitWhitespaceBeforeOperand(node) { + const operand = node.operand; + return operand.kind === 221 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */)); + } + function emitPostfixUnaryExpression(node) { + emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary); + writeTokenText(node.operator, writeOperator); + } + function createEmitBinaryExpression() { + return createBinaryExpressionTrampoline( + onEnter, + onLeft, + onOperator, + onRight, + onExit, + /*foldState*/ + void 0 + ); + function onEnter(node, state) { + if (state) { + state.stackIndex++; + state.preserveSourceNewlinesStack[state.stackIndex] = preserveSourceNewlines; + state.containerPosStack[state.stackIndex] = containerPos; + state.containerEndStack[state.stackIndex] = containerEnd; + state.declarationListContainerEndStack[state.stackIndex] = declarationListContainerEnd; + const emitComments2 = state.shouldEmitCommentsStack[state.stackIndex] = shouldEmitComments(node); + const emitSourceMaps = state.shouldEmitSourceMapsStack[state.stackIndex] = shouldEmitSourceMaps(node); + onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); + if (emitComments2) + emitCommentsBeforeNode(node); + if (emitSourceMaps) + emitSourceMapsBeforeNode(node); + beforeEmitNode(node); + } else { + state = { + stackIndex: 0, + preserveSourceNewlinesStack: [void 0], + containerPosStack: [-1], + containerEndStack: [-1], + declarationListContainerEndStack: [-1], + shouldEmitCommentsStack: [false], + shouldEmitSourceMapsStack: [false] + }; + } + return state; + } + function onLeft(next, _workArea, parent) { + return maybeEmitExpression(next, parent, "left"); + } + function onOperator(operatorToken, _state, node) { + const isCommaOperator = operatorToken.kind !== 27 /* CommaToken */; + const linesBeforeOperator = getLinesBetweenNodes(node, node.left, operatorToken); + const linesAfterOperator = getLinesBetweenNodes(node, operatorToken, node.right); + writeLinesAndIndent(linesBeforeOperator, isCommaOperator); + emitLeadingCommentsOfPosition(operatorToken.pos); + writeTokenNode(operatorToken, operatorToken.kind === 101 /* InKeyword */ ? writeKeyword : writeOperator); + emitTrailingCommentsOfPosition( + operatorToken.end, + /*prefixSpace*/ + true + ); + writeLinesAndIndent( + linesAfterOperator, + /*writeSpaceIfNotIndenting*/ + true + ); + } + function onRight(next, _workArea, parent) { + return maybeEmitExpression(next, parent, "right"); + } + function onExit(node, state) { + const linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken); + const linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right); + decreaseIndentIf(linesBeforeOperator, linesAfterOperator); + if (state.stackIndex > 0) { + const savedPreserveSourceNewlines = state.preserveSourceNewlinesStack[state.stackIndex]; + const savedContainerPos = state.containerPosStack[state.stackIndex]; + const savedContainerEnd = state.containerEndStack[state.stackIndex]; + const savedDeclarationListContainerEnd = state.declarationListContainerEndStack[state.stackIndex]; + const shouldEmitComments2 = state.shouldEmitCommentsStack[state.stackIndex]; + const shouldEmitSourceMaps2 = state.shouldEmitSourceMapsStack[state.stackIndex]; + afterEmitNode(savedPreserveSourceNewlines); + if (shouldEmitSourceMaps2) + emitSourceMapsAfterNode(node); + if (shouldEmitComments2) + emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); + state.stackIndex--; + } + } + function maybeEmitExpression(next, parent, side) { + const parenthesizerRule = side === "left" ? parenthesizer.getParenthesizeLeftSideOfBinaryForOperator(parent.operatorToken.kind) : parenthesizer.getParenthesizeRightSideOfBinaryForOperator(parent.operatorToken.kind); + let pipelinePhase = getPipelinePhase(0 /* Notification */, 1 /* Expression */, next); + if (pipelinePhase === pipelineEmitWithSubstitution) { + Debug.assertIsDefined(lastSubstitution); + next = parenthesizerRule(cast(lastSubstitution, isExpression)); + pipelinePhase = getNextPipelinePhase(1 /* Substitution */, 1 /* Expression */, next); + lastSubstitution = void 0; + } + if (pipelinePhase === pipelineEmitWithComments || pipelinePhase === pipelineEmitWithSourceMaps || pipelinePhase === pipelineEmitWithHint) { + if (isBinaryExpression(next)) { + return next; + } + } + currentParenthesizerRule = parenthesizerRule; + pipelinePhase(1 /* Expression */, next); + } + } + function emitConditionalExpression(node) { + const linesBeforeQuestion = getLinesBetweenNodes(node, node.condition, node.questionToken); + const linesAfterQuestion = getLinesBetweenNodes(node, node.questionToken, node.whenTrue); + const linesBeforeColon = getLinesBetweenNodes(node, node.whenTrue, node.colonToken); + const linesAfterColon = getLinesBetweenNodes(node, node.colonToken, node.whenFalse); + emitExpression(node.condition, parenthesizer.parenthesizeConditionOfConditionalExpression); + writeLinesAndIndent( + linesBeforeQuestion, + /*writeSpaceIfNotIndenting*/ + true + ); + emit(node.questionToken); + writeLinesAndIndent( + linesAfterQuestion, + /*writeSpaceIfNotIndenting*/ + true + ); + emitExpression(node.whenTrue, parenthesizer.parenthesizeBranchOfConditionalExpression); + decreaseIndentIf(linesBeforeQuestion, linesAfterQuestion); + writeLinesAndIndent( + linesBeforeColon, + /*writeSpaceIfNotIndenting*/ + true + ); + emit(node.colonToken); + writeLinesAndIndent( + linesAfterColon, + /*writeSpaceIfNotIndenting*/ + true + ); + emitExpression(node.whenFalse, parenthesizer.parenthesizeBranchOfConditionalExpression); + decreaseIndentIf(linesBeforeColon, linesAfterColon); + } + function emitTemplateExpression(node) { + emit(node.head); + emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); + } + function emitYieldExpression(node) { + emitTokenWithComment(125 /* YieldKeyword */, node.pos, writeKeyword, node); + emit(node.asteriskToken); + emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsiAndDisallowedComma); + } + function emitSpreadElement(node) { + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitClassExpression(node) { + generateNameIfNeeded(node.name); + emitClassDeclarationOrExpression(node); + } + function emitExpressionWithTypeArguments(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + emitTypeArguments(node, node.typeArguments); + } + function emitAsExpression(node) { + emitExpression( + node.expression, + /*parenthesizerRules*/ + void 0 + ); + if (node.type) { + writeSpace(); + writeKeyword("as"); + writeSpace(); + emit(node.type); + } + } + function emitNonNullExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + writeOperator("!"); + } + function emitSatisfiesExpression(node) { + emitExpression( + node.expression, + /*parenthesizerRules*/ + void 0 + ); + if (node.type) { + writeSpace(); + writeKeyword("satisfies"); + writeSpace(); + emit(node.type); + } + } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos, writePunctuation); + writePunctuation("."); + emit(node.name); + } + function emitTemplateSpan(node) { + emitExpression(node.expression); + emit(node.literal); + } + function emitBlock(node) { + emitBlockStatements( + node, + /*forceSingleLine*/ + !node.multiLine && isEmptyBlock(node) + ); + } + function emitBlockStatements(node, forceSingleLine) { + emitTokenWithComment( + 18 /* OpenBraceToken */, + node.pos, + writePunctuation, + /*contextNode*/ + node + ); + const format = forceSingleLine || getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineBlockStatements */ : 129 /* MultiLineBlockStatements */; + emitList(node, node.statements, format); + emitTokenWithComment( + 19 /* CloseBraceToken */, + node.statements.end, + writePunctuation, + /*contextNode*/ + node, + /*indentLeading*/ + !!(format & 1 /* MultiLine */) + ); + } + function emitVariableStatement(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + emit(node.declarationList); + writeTrailingSemicolon(); + } + function emitEmptyStatement(isEmbeddedStatement) { + if (isEmbeddedStatement) { + writePunctuation(";"); + } else { + writeTrailingSemicolon(); + } + } + function emitExpressionStatement(node) { + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement); + if (!currentSourceFile || !isJsonSourceFile(currentSourceFile) || nodeIsSynthesized(node.expression)) { + writeTrailingSemicolon(); + } + } + function emitIfStatement(node) { + const openParenPos = emitTokenWithComment(99 /* IfKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.thenStatement); + if (node.elseStatement) { + writeLineOrSpace(node, node.thenStatement, node.elseStatement); + emitTokenWithComment(91 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 242 /* IfStatement */) { + writeSpace(); + emit(node.elseStatement); + } else { + emitEmbeddedStatement(node, node.elseStatement); + } + } + } + function emitWhileClause(node, startPos) { + const openParenPos = emitTokenWithComment(115 /* WhileKeyword */, startPos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); + } + function emitDoStatement(node) { + emitTokenWithComment(90 /* DoKeyword */, node.pos, writeKeyword, node); + emitEmbeddedStatement(node, node.statement); + if (isBlock(node.statement) && !preserveSourceNewlines) { + writeSpace(); + } else { + writeLineOrSpace(node, node.statement, node.expression); + } + emitWhileClause(node, node.statement.end); + writeTrailingSemicolon(); + } + function emitWhileStatement(node) { + emitWhileClause(node, node.pos); + emitEmbeddedStatement(node, node.statement); + } + function emitForStatement(node) { + const openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node); + writeSpace(); + let pos = emitTokenWithComment( + 20 /* OpenParenToken */, + openParenPos, + writePunctuation, + /*contextNode*/ + node + ); + emitForBinding(node.initializer); + pos = emitTokenWithComment(26 /* SemicolonToken */, node.initializer ? node.initializer.end : pos, writePunctuation, node); + emitExpressionWithLeadingSpace(node.condition); + pos = emitTokenWithComment(26 /* SemicolonToken */, node.condition ? node.condition.end : pos, writePunctuation, node); + emitExpressionWithLeadingSpace(node.incrementor); + emitTokenWithComment(21 /* CloseParenToken */, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForInStatement(node) { + const openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitForBinding(node.initializer); + writeSpace(); + emitTokenWithComment(101 /* InKeyword */, node.initializer.end, writeKeyword, node); + writeSpace(); + emitExpression(node.expression); + emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForOfStatement(node) { + const openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitWithTrailingSpace(node.awaitModifier); + emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitForBinding(node.initializer); + writeSpace(); + emitTokenWithComment(162 /* OfKeyword */, node.initializer.end, writeKeyword, node); + writeSpace(); + emitExpression(node.expression); + emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForBinding(node) { + if (node !== void 0) { + if (node.kind === 258 /* VariableDeclarationList */) { + emit(node); + } else { + emitExpression(node); + } + } + } + function emitContinueStatement(node) { + emitTokenWithComment(86 /* ContinueKeyword */, node.pos, writeKeyword, node); + emitWithLeadingSpace(node.label); + writeTrailingSemicolon(); + } + function emitBreakStatement(node) { + emitTokenWithComment(81 /* BreakKeyword */, node.pos, writeKeyword, node); + emitWithLeadingSpace(node.label); + writeTrailingSemicolon(); + } + function emitTokenWithComment(token, pos, writer2, contextNode, indentLeading) { + const node = getParseTreeNode(contextNode); + const isSimilarNode = node && node.kind === contextNode.kind; + const startPos = pos; + if (isSimilarNode && currentSourceFile) { + pos = skipTrivia(currentSourceFile.text, pos); + } + if (isSimilarNode && contextNode.pos !== startPos) { + const needsIndent = indentLeading && currentSourceFile && !positionsAreOnSameLine(startPos, pos, currentSourceFile); + if (needsIndent) { + increaseIndent(); + } + emitLeadingCommentsOfPosition(startPos); + if (needsIndent) { + decreaseIndent(); + } + } + pos = writeTokenText(token, writer2, pos); + if (isSimilarNode && contextNode.end !== pos) { + const isJsxExprContext = contextNode.kind === 291 /* JsxExpression */; + emitTrailingCommentsOfPosition( + pos, + /*prefixSpace*/ + !isJsxExprContext, + /*forceNoNewline*/ + isJsxExprContext + ); + } + return pos; + } + function commentWillEmitNewLine(node) { + return node.kind === 2 /* SingleLineCommentTrivia */ || !!node.hasTrailingNewLine; + } + function willEmitLeadingNewLine(node) { + if (!currentSourceFile) + return false; + if (some(getLeadingCommentRanges(currentSourceFile.text, node.pos), commentWillEmitNewLine)) + return true; + if (some(getSyntheticLeadingComments(node), commentWillEmitNewLine)) + return true; + if (isPartiallyEmittedExpression(node)) { + if (node.pos !== node.expression.pos) { + if (some(getTrailingCommentRanges(currentSourceFile.text, node.expression.pos), commentWillEmitNewLine)) + return true; + } + return willEmitLeadingNewLine(node.expression); + } + return false; + } + function parenthesizeExpressionForNoAsi(node) { + if (!commentsDisabled && isPartiallyEmittedExpression(node) && willEmitLeadingNewLine(node)) { + const parseNode = getParseTreeNode(node); + if (parseNode && isParenthesizedExpression(parseNode)) { + const parens = factory.createParenthesizedExpression(node.expression); + setOriginalNode(parens, node); + setTextRange(parens, parseNode); + return parens; + } + return factory.createParenthesizedExpression(node); + } + return node; + } + function parenthesizeExpressionForNoAsiAndDisallowedComma(node) { + return parenthesizeExpressionForNoAsi(parenthesizer.parenthesizeExpressionForDisallowedComma(node)); + } + function emitReturnStatement(node) { + emitTokenWithComment( + 105 /* ReturnKeyword */, + node.pos, + writeKeyword, + /*contextNode*/ + node + ); + emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); + writeTrailingSemicolon(); + } + function emitWithStatement(node) { + const openParenPos = emitTokenWithComment(116 /* WithKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitSwitchStatement(node) { + const openParenPos = emitTokenWithComment(107 /* SwitchKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); + writeSpace(); + emit(node.caseBlock); + } + function emitLabeledStatement(node) { + emit(node.label); + emitTokenWithComment(58 /* ColonToken */, node.label.end, writePunctuation, node); + writeSpace(); + emit(node.statement); + } + function emitThrowStatement(node) { + emitTokenWithComment(109 /* ThrowKeyword */, node.pos, writeKeyword, node); + emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); + writeTrailingSemicolon(); + } + function emitTryStatement(node) { + emitTokenWithComment(111 /* TryKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emit(node.tryBlock); + if (node.catchClause) { + writeLineOrSpace(node, node.tryBlock, node.catchClause); + emit(node.catchClause); + } + if (node.finallyBlock) { + writeLineOrSpace(node, node.catchClause || node.tryBlock, node.finallyBlock); + emitTokenWithComment(96 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node); + writeSpace(); + emit(node.finallyBlock); + } + } + function emitDebuggerStatement(node) { + writeToken(87 /* DebuggerKeyword */, node.pos, writeKeyword); + writeTrailingSemicolon(); + } + function emitVariableDeclaration(node) { + var _a2, _b, _c, _d, _e; + emit(node.name); + emit(node.exclamationToken); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer, (_e = (_d = (_a2 = node.type) == null ? void 0 : _a2.end) != null ? _d : (_c = (_b = node.name.emitNode) == null ? void 0 : _b.typeNode) == null ? void 0 : _c.end) != null ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitVariableDeclarationList(node) { + writeKeyword(isLet(node) ? "let" : isVarConst(node) ? "const" : "var"); + writeSpace(); + emitList(node, node.declarations, 528 /* VariableDeclarationList */); + } + function emitFunctionDeclaration(node) { + emitFunctionDeclarationOrExpression(node); + } + function emitFunctionDeclarationOrExpression(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("function"); + emit(node.asteriskToken); + writeSpace(); + emitIdentifierName(node.name); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitSignatureAndBody(node, emitSignatureHead2) { + const body = node.body; + if (body) { + if (isBlock(body)) { + const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; + if (indentedFlag) { + increaseIndent(); + } + pushNameGenerationScope(node); + forEach(node.parameters, generateNames); + generateNames(node.body); + emitSignatureHead2(node); + emitBlockFunctionBody(body); + popNameGenerationScope(node); + if (indentedFlag) { + decreaseIndent(); + } + } else { + emitSignatureHead2(node); + writeSpace(); + emitExpression(body, parenthesizer.parenthesizeConciseBodyOfArrowFunction); + } + } else { + emitSignatureHead2(node); + writeTrailingSemicolon(); + } + } + function emitSignatureHead(node) { + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + } + function shouldEmitBlockFunctionBodyOnSingleLine(body) { + if (getEmitFlags(body) & 1 /* SingleLine */) { + return true; + } + if (body.multiLine) { + return false; + } + if (!nodeIsSynthesized(body) && currentSourceFile && !rangeIsOnSingleLine(body, currentSourceFile)) { + return false; + } + if (getLeadingLineTerminatorCount(body, firstOrUndefined(body.statements), 2 /* PreserveLines */) || getClosingLineTerminatorCount(body, lastOrUndefined(body.statements), 2 /* PreserveLines */, body.statements)) { + return false; + } + let previousStatement; + for (const statement of body.statements) { + if (getSeparatingLineTerminatorCount(previousStatement, statement, 2 /* PreserveLines */) > 0) { + return false; + } + previousStatement = statement; + } + return true; + } + function emitBlockFunctionBody(body) { + onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(body); + writeSpace(); + writePunctuation("{"); + increaseIndent(); + const emitBlockFunctionBody2 = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine : emitBlockFunctionBodyWorker; + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody2); + decreaseIndent(); + writeToken(19 /* CloseBraceToken */, body.statements.end, writePunctuation, body); + onAfterEmitNode == null ? void 0 : onAfterEmitNode(body); + } + function emitBlockFunctionBodyOnSingleLine(body) { + emitBlockFunctionBodyWorker( + body, + /*emitBlockFunctionBodyOnSingleLine*/ + true + ); + } + function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine2) { + const statementOffset = emitPrologueDirectives(body.statements); + const pos = writer.getTextPos(); + emitHelpers(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine2) { + decreaseIndent(); + emitList(body, body.statements, 768 /* SingleLineFunctionBodyStatements */); + increaseIndent(); + } else { + emitList( + body, + body.statements, + 1 /* MultiLineFunctionBodyStatements */, + /*parenthesizerRule*/ + void 0, + statementOffset + ); + } + } + function emitClassDeclaration(node) { + emitClassDeclarationOrExpression(node); + } + function emitClassDeclarationOrExpression(node) { + pushPrivateNameGenerationScope( + TempFlags.Auto, + /*newReservedMemberNames*/ + void 0 + ); + forEach(node.members, generateMemberNames); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emitTokenWithComment(84 /* ClassKeyword */, moveRangePastModifiers(node).pos, writeKeyword, node); + if (node.name) { + writeSpace(); + emitIdentifierName(node.name); + } + const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; + if (indentedFlag) { + increaseIndent(); + } + emitTypeParameters(node, node.typeParameters); + emitList(node, node.heritageClauses, 0 /* ClassHeritageClauses */); + writeSpace(); + writePunctuation("{"); + emitList(node, node.members, 129 /* ClassMembers */); + writePunctuation("}"); + if (indentedFlag) { + decreaseIndent(); + } + popPrivateNameGenerationScope(); + } + function emitInterfaceDeclaration(node) { + pushPrivateNameGenerationScope( + TempFlags.Auto, + /*newReservedMemberNames*/ + void 0 + ); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("interface"); + writeSpace(); + emit(node.name); + emitTypeParameters(node, node.typeParameters); + emitList(node, node.heritageClauses, 512 /* HeritageClauses */); + writeSpace(); + writePunctuation("{"); + emitList(node, node.members, 129 /* InterfaceMembers */); + writePunctuation("}"); + popPrivateNameGenerationScope(); + } + function emitTypeAliasDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("type"); + writeSpace(); + emit(node.name); + emitTypeParameters(node, node.typeParameters); + writeSpace(); + writePunctuation("="); + writeSpace(); + emit(node.type); + writeTrailingSemicolon(); + } + function emitEnumDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("enum"); + writeSpace(); + emit(node.name); + writeSpace(); + writePunctuation("{"); + emitList(node, node.members, 145 /* EnumMembers */); + writePunctuation("}"); + } + function emitModuleDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + if (~node.flags & 1024 /* GlobalAugmentation */) { + writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); + writeSpace(); + } + emit(node.name); + let body = node.body; + if (!body) + return writeTrailingSemicolon(); + while (body && isModuleDeclaration(body)) { + writePunctuation("."); + emit(body.name); + body = body.body; + } + writeSpace(); + emit(body); + } + function emitModuleBlock(node) { + pushNameGenerationScope(node); + forEach(node.statements, generateNames); + emitBlockStatements( + node, + /*forceSingleLine*/ + isEmptyBlock(node) + ); + popNameGenerationScope(node); + } + function emitCaseBlock(node) { + emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node); + emitList(node, node.clauses, 129 /* CaseBlockClauses */); + emitTokenWithComment( + 19 /* CloseBraceToken */, + node.clauses.end, + writePunctuation, + node, + /*indentLeading*/ + true + ); + } + function emitImportEqualsDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); + writeSpace(); + if (node.isTypeOnly) { + emitTokenWithComment(154 /* TypeKeyword */, node.pos, writeKeyword, node); + writeSpace(); + } + emit(node.name); + writeSpace(); + emitTokenWithComment(63 /* EqualsToken */, node.name.end, writePunctuation, node); + writeSpace(); + emitModuleReference(node.moduleReference); + writeTrailingSemicolon(); + } + function emitModuleReference(node) { + if (node.kind === 79 /* Identifier */) { + emitExpression(node); + } else { + emit(node); + } + } + function emitImportDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); + writeSpace(); + if (node.importClause) { + emit(node.importClause); + writeSpace(); + emitTokenWithComment(158 /* FromKeyword */, node.importClause.end, writeKeyword, node); + writeSpace(); + } + emitExpression(node.moduleSpecifier); + if (node.assertClause) { + emitWithLeadingSpace(node.assertClause); + } + writeTrailingSemicolon(); + } + function emitImportClause(node) { + if (node.isTypeOnly) { + emitTokenWithComment(154 /* TypeKeyword */, node.pos, writeKeyword, node); + writeSpace(); + } + emit(node.name); + if (node.name && node.namedBindings) { + emitTokenWithComment(27 /* CommaToken */, node.name.end, writePunctuation, node); + writeSpace(); + } + emit(node.namedBindings); + } + function emitNamespaceImport(node) { + const asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node); + writeSpace(); + emitTokenWithComment(128 /* AsKeyword */, asPos, writeKeyword, node); + writeSpace(); + emit(node.name); + } + function emitNamedImports(node) { + emitNamedImportsOrExports(node); + } + function emitImportSpecifier(node) { + emitImportOrExportSpecifier(node); + } + function emitExportAssignment(node) { + const nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); + writeSpace(); + if (node.isExportEquals) { + emitTokenWithComment(63 /* EqualsToken */, nextPos, writeOperator, node); + } else { + emitTokenWithComment(88 /* DefaultKeyword */, nextPos, writeKeyword, node); + } + writeSpace(); + emitExpression(node.expression, node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator(63 /* EqualsToken */) : parenthesizer.parenthesizeExpressionOfExportDefault); + writeTrailingSemicolon(); + } + function emitExportDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + let nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); + writeSpace(); + if (node.isTypeOnly) { + nextPos = emitTokenWithComment(154 /* TypeKeyword */, nextPos, writeKeyword, node); + writeSpace(); + } + if (node.exportClause) { + emit(node.exportClause); + } else { + nextPos = emitTokenWithComment(41 /* AsteriskToken */, nextPos, writePunctuation, node); + } + if (node.moduleSpecifier) { + writeSpace(); + const fromPos = node.exportClause ? node.exportClause.end : nextPos; + emitTokenWithComment(158 /* FromKeyword */, fromPos, writeKeyword, node); + writeSpace(); + emitExpression(node.moduleSpecifier); + } + if (node.assertClause) { + emitWithLeadingSpace(node.assertClause); + } + writeTrailingSemicolon(); + } + function emitAssertClause(node) { + emitTokenWithComment(130 /* AssertKeyword */, node.pos, writeKeyword, node); + writeSpace(); + const elements = node.elements; + emitList(node, elements, 526226 /* ImportClauseEntries */); + } + function emitAssertEntry(node) { + emit(node.name); + writePunctuation(":"); + writeSpace(); + const value = node.value; + if ((getEmitFlags(value) & 1024 /* NoLeadingComments */) === 0) { + const commentRange = getCommentRange(value); + emitTrailingCommentsOfPosition(commentRange.pos); + } + emit(value); + } + function emitNamespaceExportDeclaration(node) { + let nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); + writeSpace(); + nextPos = emitTokenWithComment(128 /* AsKeyword */, nextPos, writeKeyword, node); + writeSpace(); + nextPos = emitTokenWithComment(143 /* NamespaceKeyword */, nextPos, writeKeyword, node); + writeSpace(); + emit(node.name); + writeTrailingSemicolon(); + } + function emitNamespaceExport(node) { + const asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node); + writeSpace(); + emitTokenWithComment(128 /* AsKeyword */, asPos, writeKeyword, node); + writeSpace(); + emit(node.name); + } + function emitNamedExports(node) { + emitNamedImportsOrExports(node); + } + function emitExportSpecifier(node) { + emitImportOrExportSpecifier(node); + } + function emitNamedImportsOrExports(node) { + writePunctuation("{"); + emitList(node, node.elements, 525136 /* NamedImportsOrExportsElements */); + writePunctuation("}"); + } + function emitImportOrExportSpecifier(node) { + if (node.isTypeOnly) { + writeKeyword("type"); + writeSpace(); + } + if (node.propertyName) { + emit(node.propertyName); + writeSpace(); + emitTokenWithComment(128 /* AsKeyword */, node.propertyName.end, writeKeyword, node); + writeSpace(); + } + emit(node.name); + } + function emitExternalModuleReference(node) { + writeKeyword("require"); + writePunctuation("("); + emitExpression(node.expression); + writePunctuation(")"); + } + function emitJsxElement(node) { + emit(node.openingElement); + emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */); + emit(node.closingElement); + } + function emitJsxSelfClosingElement(node) { + writePunctuation("<"); + emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); + writeSpace(); + emit(node.attributes); + writePunctuation("/>"); + } + function emitJsxFragment(node) { + emit(node.openingFragment); + emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */); + emit(node.closingFragment); + } + function emitJsxOpeningElementOrFragment(node) { + writePunctuation("<"); + if (isJsxOpeningElement(node)) { + const indented = writeLineSeparatorsAndIndentBefore(node.tagName, node); + emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); + if (node.attributes.properties && node.attributes.properties.length > 0) { + writeSpace(); + } + emit(node.attributes); + writeLineSeparatorsAfter(node.attributes, node); + decreaseIndentIf(indented); + } + writePunctuation(">"); + } + function emitJsxText(node) { + writer.writeLiteral(node.text); + } + function emitJsxClosingElementOrFragment(node) { + writePunctuation(""); + } + function emitJsxAttributes(node) { + emitList(node, node.properties, 262656 /* JsxElementAttributes */); + } + function emitJsxAttribute(node) { + emit(node.name); + emitNodeWithPrefix("=", writePunctuation, node.initializer, emitJsxAttributeValue); + } + function emitJsxSpreadAttribute(node) { + writePunctuation("{..."); + emitExpression(node.expression); + writePunctuation("}"); + } + function hasTrailingCommentsAtPosition(pos) { + let result = false; + forEachTrailingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result = true); + return result; + } + function hasLeadingCommentsAtPosition(pos) { + let result = false; + forEachLeadingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result = true); + return result; + } + function hasCommentsAtPosition(pos) { + return hasTrailingCommentsAtPosition(pos) || hasLeadingCommentsAtPosition(pos); + } + function emitJsxExpression(node) { + var _a2; + if (node.expression || !commentsDisabled && !nodeIsSynthesized(node) && hasCommentsAtPosition(node.pos)) { + const isMultiline = currentSourceFile && !nodeIsSynthesized(node) && getLineAndCharacterOfPosition(currentSourceFile, node.pos).line !== getLineAndCharacterOfPosition(currentSourceFile, node.end).line; + if (isMultiline) { + writer.increaseIndent(); + } + const end = emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node); + emit(node.dotDotDotToken); + emitExpression(node.expression); + emitTokenWithComment(19 /* CloseBraceToken */, ((_a2 = node.expression) == null ? void 0 : _a2.end) || end, writePunctuation, node); + if (isMultiline) { + writer.decreaseIndent(); + } + } + } + function emitJsxTagName(node) { + if (node.kind === 79 /* Identifier */) { + emitExpression(node); + } else { + emit(node); + } + } + function emitCaseClause(node) { + emitTokenWithComment(82 /* CaseKeyword */, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); + } + function emitDefaultClause(node) { + const pos = emitTokenWithComment(88 /* DefaultKeyword */, node.pos, writeKeyword, node); + emitCaseOrDefaultClauseRest(node, node.statements, pos); + } + function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { + const emitAsSingleStatement = statements.length === 1 && // treat synthesized nodes as located on the same line for emit purposes + (!currentSourceFile || nodeIsSynthesized(parentNode) || nodeIsSynthesized(statements[0]) || rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)); + let format = 163969 /* CaseOrDefaultClauseStatements */; + if (emitAsSingleStatement) { + writeToken(58 /* ColonToken */, colonPos, writePunctuation, parentNode); + writeSpace(); + format &= ~(1 /* MultiLine */ | 128 /* Indented */); + } else { + emitTokenWithComment(58 /* ColonToken */, colonPos, writePunctuation, parentNode); + } + emitList(parentNode, statements, format); + } + function emitHeritageClause(node) { + writeSpace(); + writeTokenText(node.token, writeKeyword); + writeSpace(); + emitList(node, node.types, 528 /* HeritageClauseTypes */); + } + function emitCatchClause(node) { + const openParenPos = emitTokenWithComment(83 /* CatchKeyword */, node.pos, writeKeyword, node); + writeSpace(); + if (node.variableDeclaration) { + emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); + emit(node.variableDeclaration); + emitTokenWithComment(21 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation, node); + writeSpace(); + } + emit(node.block); + } + function emitPropertyAssignment(node) { + emit(node.name); + writePunctuation(":"); + writeSpace(); + const initializer = node.initializer; + if ((getEmitFlags(initializer) & 1024 /* NoLeadingComments */) === 0) { + const commentRange = getCommentRange(initializer); + emitTrailingCommentsOfPosition(commentRange.pos); + } + emitExpression(initializer, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitShorthandPropertyAssignment(node) { + emit(node.name); + if (node.objectAssignmentInitializer) { + writeSpace(); + writePunctuation("="); + writeSpace(); + emitExpression(node.objectAssignmentInitializer, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + } + function emitSpreadAssignment(node) { + if (node.expression) { + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + } + function emitEnumMember(node) { + emit(node.name); + emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitJSDoc(node) { + write("/**"); + if (node.comment) { + const text = getTextOfJSDocComment(node.comment); + if (text) { + const lines = text.split(/\r\n?|\n/g); + for (const line of lines) { + writeLine(); + writeSpace(); + writePunctuation("*"); + writeSpace(); + write(line); + } + } + } + if (node.tags) { + if (node.tags.length === 1 && node.tags[0].kind === 347 /* JSDocTypeTag */ && !node.comment) { + writeSpace(); + emit(node.tags[0]); + } else { + emitList(node, node.tags, 33 /* JSDocComment */); + } + } + writeSpace(); + write("*/"); + } + function emitJSDocSimpleTypedTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocTypeExpression(tag.typeExpression); + emitJSDocComment(tag.comment); + } + function emitJSDocSeeTag(tag) { + emitJSDocTagName(tag.tagName); + emit(tag.name); + emitJSDocComment(tag.comment); + } + function emitJSDocNameReference(node) { + writeSpace(); + writePunctuation("{"); + emit(node.name); + writePunctuation("}"); + } + function emitJSDocHeritageTag(tag) { + emitJSDocTagName(tag.tagName); + writeSpace(); + writePunctuation("{"); + emit(tag.class); + writePunctuation("}"); + emitJSDocComment(tag.comment); + } + function emitJSDocTemplateTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocTypeExpression(tag.constraint); + writeSpace(); + emitList(tag, tag.typeParameters, 528 /* CommaListElements */); + emitJSDocComment(tag.comment); + } + function emitJSDocTypedefTag(tag) { + emitJSDocTagName(tag.tagName); + if (tag.typeExpression) { + if (tag.typeExpression.kind === 312 /* JSDocTypeExpression */) { + emitJSDocTypeExpression(tag.typeExpression); + } else { + writeSpace(); + writePunctuation("{"); + write("Object"); + if (tag.typeExpression.isArrayType) { + writePunctuation("["); + writePunctuation("]"); + } + writePunctuation("}"); + } + } + if (tag.fullName) { + writeSpace(); + emit(tag.fullName); + } + emitJSDocComment(tag.comment); + if (tag.typeExpression && tag.typeExpression.kind === 325 /* JSDocTypeLiteral */) { + emitJSDocTypeLiteral(tag.typeExpression); + } + } + function emitJSDocCallbackTag(tag) { + emitJSDocTagName(tag.tagName); + if (tag.name) { + writeSpace(); + emit(tag.name); + } + emitJSDocComment(tag.comment); + emitJSDocSignature(tag.typeExpression); + } + function emitJSDocOverloadTag(tag) { + emitJSDocComment(tag.comment); + emitJSDocSignature(tag.typeExpression); + } + function emitJSDocSimpleTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocComment(tag.comment); + } + function emitJSDocTypeLiteral(lit) { + emitList(lit, factory.createNodeArray(lit.jsDocPropertyTags), 33 /* JSDocComment */); + } + function emitJSDocSignature(sig) { + if (sig.typeParameters) { + emitList(sig, factory.createNodeArray(sig.typeParameters), 33 /* JSDocComment */); + } + if (sig.parameters) { + emitList(sig, factory.createNodeArray(sig.parameters), 33 /* JSDocComment */); + } + if (sig.type) { + writeLine(); + writeSpace(); + writePunctuation("*"); + writeSpace(); + emit(sig.type); + } + } + function emitJSDocPropertyLikeTag(param) { + emitJSDocTagName(param.tagName); + emitJSDocTypeExpression(param.typeExpression); + writeSpace(); + if (param.isBracketed) { + writePunctuation("["); + } + emit(param.name); + if (param.isBracketed) { + writePunctuation("]"); + } + emitJSDocComment(param.comment); + } + function emitJSDocTagName(tagName) { + writePunctuation("@"); + emit(tagName); + } + function emitJSDocComment(comment) { + const text = getTextOfJSDocComment(comment); + if (text) { + writeSpace(); + write(text); + } + } + function emitJSDocTypeExpression(typeExpression) { + if (typeExpression) { + writeSpace(); + writePunctuation("{"); + emit(typeExpression.type); + writePunctuation("}"); + } + } + function emitSourceFile(node) { + writeLine(); + const statements = node.statements; + const shouldEmitDetachedComment = statements.length === 0 || !isPrologueDirective(statements[0]) || nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + emitSourceFileWorker(node); + } + function emitSyntheticTripleSlashReferencesIfNeeded(node) { + emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []); + for (const prepend of node.prepends) { + if (isUnparsedSource(prepend) && prepend.syntheticReferences) { + for (const ref of prepend.syntheticReferences) { + emit(ref); + writeLine(); + } + } + } + } + function emitTripleSlashDirectivesIfNeeded(node) { + if (node.isDeclarationFile) + emitTripleSlashDirectives(node.hasNoDefaultLib, node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives); + } + function emitTripleSlashDirectives(hasNoDefaultLib, files, types, libs2) { + if (hasNoDefaultLib) { + const pos = writer.getTextPos(); + writeComment(`/// `); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "no-default-lib" /* NoDefaultLib */ }); + writeLine(); + } + if (currentSourceFile && currentSourceFile.moduleName) { + writeComment(`/// `); + writeLine(); + } + if (currentSourceFile && currentSourceFile.amdDependencies) { + for (const dep of currentSourceFile.amdDependencies) { + if (dep.name) { + writeComment(`/// `); + } else { + writeComment(`/// `); + } + writeLine(); + } + } + for (const directive of files) { + const pos = writer.getTextPos(); + writeComment(`/// `); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); + writeLine(); + } + for (const directive of types) { + const pos = writer.getTextPos(); + const resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile == null ? void 0 : currentSourceFile.impliedNodeFormat) ? `resolution-mode="${directive.resolutionMode === 99 /* ESNext */ ? "import" : "require"}"` : ""; + writeComment(`/// `); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: !directive.resolutionMode ? "type" /* Type */ : directive.resolutionMode === 99 /* ESNext */ ? "type-import" /* TypeResolutionModeImport */ : "type-require" /* TypeResolutionModeRequire */, data: directive.fileName }); + writeLine(); + } + for (const directive of libs2) { + const pos = writer.getTextPos(); + writeComment(`/// `); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName }); + writeLine(); + } + } + function emitSourceFileWorker(node) { + const statements = node.statements; + pushNameGenerationScope(node); + forEach(node.statements, generateNames); + emitHelpers(node); + const index = findIndex(statements, (statement) => !isPrologueDirective(statement)); + emitTripleSlashDirectivesIfNeeded(node); + emitList( + node, + statements, + 1 /* MultiLine */, + /*parenthesizerRule*/ + void 0, + index === -1 ? statements.length : index + ); + popNameGenerationScope(node); + } + function emitPartiallyEmittedExpression(node) { + const emitFlags = getEmitFlags(node); + if (!(emitFlags & 1024 /* NoLeadingComments */) && node.pos !== node.expression.pos) { + emitTrailingCommentsOfPosition(node.expression.pos); + } + emitExpression(node.expression); + if (!(emitFlags & 2048 /* NoTrailingComments */) && node.end !== node.expression.end) { + emitLeadingCommentsOfPosition(node.expression.end); + } + } + function emitCommaList(node) { + emitExpressionList( + node, + node.elements, + 528 /* CommaListElements */, + /*parenthesizerRule*/ + void 0 + ); + } + function emitPrologueDirectives(statements, sourceFile, seenPrologueDirectives, recordBundleFileSection) { + let needsToSetSourceFile = !!sourceFile; + for (let i = 0; i < statements.length; i++) { + const statement = statements[i]; + if (isPrologueDirective(statement)) { + const shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (needsToSetSourceFile) { + needsToSetSourceFile = false; + setSourceFile(sourceFile); + } + writeLine(); + const pos = writer.getTextPos(); + emit(statement); + if (recordBundleFileSection && bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue" /* Prologue */, data: statement.expression.text }); + if (seenPrologueDirectives) { + seenPrologueDirectives.add(statement.expression.text); + } + } + } else { + return i; + } + } + return statements.length; + } + function emitUnparsedPrologues(prologues, seenPrologueDirectives) { + for (const prologue of prologues) { + if (!seenPrologueDirectives.has(prologue.data)) { + writeLine(); + const pos = writer.getTextPos(); + emit(prologue); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue" /* Prologue */, data: prologue.data }); + if (seenPrologueDirectives) { + seenPrologueDirectives.add(prologue.data); + } + } + } + } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (isSourceFile(sourceFileOrBundle)) { + emitPrologueDirectives(sourceFileOrBundle.statements, sourceFileOrBundle); + } else { + const seenPrologueDirectives = /* @__PURE__ */ new Set(); + for (const prepend of sourceFileOrBundle.prepends) { + emitUnparsedPrologues(prepend.prologues, seenPrologueDirectives); + } + for (const sourceFile of sourceFileOrBundle.sourceFiles) { + emitPrologueDirectives( + sourceFile.statements, + sourceFile, + seenPrologueDirectives, + /*recordBundleFileSection*/ + true + ); + } + setSourceFile(void 0); + } + } + function getPrologueDirectivesFromBundledSourceFiles(bundle) { + const seenPrologueDirectives = /* @__PURE__ */ new Set(); + let prologues; + for (let index = 0; index < bundle.sourceFiles.length; index++) { + const sourceFile = bundle.sourceFiles[index]; + let directives; + let end = 0; + for (const statement of sourceFile.statements) { + if (!isPrologueDirective(statement)) + break; + if (seenPrologueDirectives.has(statement.expression.text)) + continue; + seenPrologueDirectives.add(statement.expression.text); + (directives || (directives = [])).push({ + pos: statement.pos, + end: statement.end, + expression: { + pos: statement.expression.pos, + end: statement.expression.end, + text: statement.expression.text + } + }); + end = end < statement.end ? statement.end : end; + } + if (directives) + (prologues || (prologues = [])).push({ file: index, text: sourceFile.text.substring(0, end), directives }); + } + return prologues; + } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (isSourceFile(sourceFileOrBundle) || isUnparsedSource(sourceFileOrBundle)) { + const shebang = getShebang(sourceFileOrBundle.text); + if (shebang) { + writeComment(shebang); + writeLine(); + return true; + } + } else { + for (const prepend of sourceFileOrBundle.prepends) { + Debug.assertNode(prepend, isUnparsedSource); + if (emitShebangIfNeeded(prepend)) { + return true; + } + } + for (const sourceFile of sourceFileOrBundle.sourceFiles) { + if (emitShebangIfNeeded(sourceFile)) { + return true; + } + } + } + } + function emitNodeWithWriter(node, writer2) { + if (!node) + return; + const savedWrite = write; + write = writer2; + emit(node); + write = savedWrite; + } + function emitDecoratorsAndModifiers(node, modifiers, allowDecorators) { + if (modifiers == null ? void 0 : modifiers.length) { + if (every(modifiers, isModifier)) { + return emitModifierList(node, modifiers); + } + if (every(modifiers, isDecorator)) { + if (allowDecorators) { + return emitDecoratorList(node, modifiers); + } + return node.pos; + } + onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); + let lastMode; + let mode; + let start = 0; + let pos = 0; + let lastModifier; + while (start < modifiers.length) { + while (pos < modifiers.length) { + lastModifier = modifiers[pos]; + mode = isDecorator(lastModifier) ? "decorators" : "modifiers"; + if (lastMode === void 0) { + lastMode = mode; + } else if (mode !== lastMode) { + break; + } + pos++; + } + const textRange = { pos: -1, end: -1 }; + if (start === 0) + textRange.pos = modifiers.pos; + if (pos === modifiers.length - 1) + textRange.end = modifiers.end; + if (lastMode === "modifiers" || allowDecorators) { + emitNodeListItems( + emit, + node, + modifiers, + lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, + /*parenthesizerRule*/ + void 0, + start, + pos - start, + /*hasTrailingComma*/ + false, + textRange + ); + } + start = pos; + lastMode = mode; + pos++; + } + onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); + if (lastModifier && !positionIsSynthesized(lastModifier.end)) { + return lastModifier.end; + } + } + return node.pos; + } + function emitModifierList(node, modifiers) { + emitList(node, modifiers, 2359808 /* Modifiers */); + const lastModifier = lastOrUndefined(modifiers); + return lastModifier && !positionIsSynthesized(lastModifier.end) ? lastModifier.end : node.pos; + } + function emitTypeAnnotation(node) { + if (node) { + writePunctuation(":"); + writeSpace(); + emit(node); + } + } + function emitInitializer(node, equalCommentStartPos, container, parenthesizerRule) { + if (node) { + writeSpace(); + emitTokenWithComment(63 /* EqualsToken */, equalCommentStartPos, writeOperator, container); + writeSpace(); + emitExpression(node, parenthesizerRule); + } + } + function emitNodeWithPrefix(prefix, prefixWriter, node, emit2) { + if (node) { + prefixWriter(prefix); + emit2(node); + } + } + function emitWithLeadingSpace(node) { + if (node) { + writeSpace(); + emit(node); + } + } + function emitExpressionWithLeadingSpace(node, parenthesizerRule) { + if (node) { + writeSpace(); + emitExpression(node, parenthesizerRule); + } + } + function emitWithTrailingSpace(node) { + if (node) { + emit(node); + writeSpace(); + } + } + function emitEmbeddedStatement(parent, node) { + if (isBlock(node) || getEmitFlags(parent) & 1 /* SingleLine */) { + writeSpace(); + emit(node); + } else { + writeLine(); + increaseIndent(); + if (isEmptyStatement(node)) { + pipelineEmit(5 /* EmbeddedStatement */, node); + } else { + emit(node); + } + decreaseIndent(); + } + } + function emitDecoratorList(parentNode, decorators) { + emitList(parentNode, decorators, 2146305 /* Decorators */); + const lastDecorator = lastOrUndefined(decorators); + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos; + } + function emitTypeArguments(parentNode, typeArguments) { + emitList(parentNode, typeArguments, 53776 /* TypeArguments */, typeArgumentParenthesizerRuleSelector); + } + function emitTypeParameters(parentNode, typeParameters) { + if (isFunctionLike(parentNode) && parentNode.typeArguments) { + return emitTypeArguments(parentNode, parentNode.typeArguments); + } + emitList(parentNode, typeParameters, 53776 /* TypeParameters */); + } + function emitParameters(parentNode, parameters) { + emitList(parentNode, parameters, 2576 /* Parameters */); + } + function canEmitSimpleArrowHead(parentNode, parameters) { + const parameter = singleOrUndefined(parameters); + return parameter && parameter.pos === parentNode.pos && isArrowFunction(parentNode) && !parentNode.type && !some(parentNode.modifiers) && !some(parentNode.typeParameters) && !some(parameter.modifiers) && !parameter.dotDotDotToken && !parameter.questionToken && !parameter.type && !parameter.initializer && isIdentifier(parameter.name); + } + function emitParametersForArrow(parentNode, parameters) { + if (canEmitSimpleArrowHead(parentNode, parameters)) { + emitList(parentNode, parameters, 2576 /* Parameters */ & ~2048 /* Parenthesis */); + } else { + emitParameters(parentNode, parameters); + } + } + function emitParametersForIndexSignature(parentNode, parameters) { + emitList(parentNode, parameters, 8848 /* IndexSignatureParameters */); + } + function writeDelimiter(format) { + switch (format & 60 /* DelimitersMask */) { + case 0 /* None */: + break; + case 16 /* CommaDelimited */: + writePunctuation(","); + break; + case 4 /* BarDelimited */: + writeSpace(); + writePunctuation("|"); + break; + case 32 /* AsteriskDelimited */: + writeSpace(); + writePunctuation("*"); + writeSpace(); + break; + case 8 /* AmpersandDelimited */: + writeSpace(); + writePunctuation("&"); + break; + } + } + function emitList(parentNode, children, format, parenthesizerRule, start, count) { + emitNodeList( + emit, + parentNode, + children, + format | (parentNode && getEmitFlags(parentNode) & 2 /* MultiLine */ ? 65536 /* PreferNewLine */ : 0), + parenthesizerRule, + start, + count + ); + } + function emitExpressionList(parentNode, children, format, parenthesizerRule, start, count) { + emitNodeList(emitExpression, parentNode, children, format, parenthesizerRule, start, count); + } + function emitNodeList(emit2, parentNode, children, format, parenthesizerRule, start = 0, count = children ? children.length - start : 0) { + const isUndefined = children === void 0; + if (isUndefined && format & 16384 /* OptionalIfUndefined */) { + return; + } + const isEmpty = children === void 0 || start >= children.length || count === 0; + if (isEmpty && format & 32768 /* OptionalIfEmpty */) { + onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); + onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); + return; + } + if (format & 15360 /* BracketsMask */) { + writePunctuation(getOpeningBracket(format)); + if (isEmpty && children) { + emitTrailingCommentsOfPosition( + children.pos, + /*prefixSpace*/ + true + ); + } + } + onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); + if (isEmpty) { + if (format & 1 /* MultiLine */ && !(preserveSourceNewlines && (!parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile)))) { + writeLine(); + } else if (format & 256 /* SpaceBetweenBraces */ && !(format & 524288 /* NoSpaceIfEmpty */)) { + writeSpace(); + } + } else { + emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start, count, children.hasTrailingComma, children); + } + onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); + if (format & 15360 /* BracketsMask */) { + if (isEmpty && children) { + emitLeadingCommentsOfPosition(children.end); + } + writePunctuation(getClosingBracket(format)); + } + } + function emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start, count, hasTrailingComma, childrenTextRange) { + const mayEmitInterveningComments = (format & 262144 /* NoInterveningComments */) === 0; + let shouldEmitInterveningComments = mayEmitInterveningComments; + const leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children[start], format); + if (leadingLineTerminatorCount) { + writeLine(leadingLineTerminatorCount); + shouldEmitInterveningComments = false; + } else if (format & 256 /* SpaceBetweenBraces */) { + writeSpace(); + } + if (format & 128 /* Indented */) { + increaseIndent(); + } + const emitListItem = getEmitListItem(emit2, parenthesizerRule); + let previousSibling; + let previousSourceFileTextKind; + let shouldDecreaseIndentAfterEmit = false; + for (let i = 0; i < count; i++) { + const child = children[start + i]; + if (format & 32 /* AsteriskDelimited */) { + writeLine(); + writeDelimiter(format); + } else if (previousSibling) { + if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) { + const previousSiblingEmitFlags = getEmitFlags(previousSibling); + if (!(previousSiblingEmitFlags & 2048 /* NoTrailingComments */)) { + emitLeadingCommentsOfPosition(previousSibling.end); + } + } + writeDelimiter(format); + recordBundleFileInternalSectionEnd(previousSourceFileTextKind); + const separatingLineTerminatorCount = getSeparatingLineTerminatorCount(previousSibling, child, format); + if (separatingLineTerminatorCount > 0) { + if ((format & (3 /* LinesMask */ | 128 /* Indented */)) === 0 /* SingleLine */) { + increaseIndent(); + shouldDecreaseIndentAfterEmit = true; + } + writeLine(separatingLineTerminatorCount); + shouldEmitInterveningComments = false; + } else if (previousSibling && format & 512 /* SpaceBetweenSiblings */) { + writeSpace(); + } + } + previousSourceFileTextKind = recordBundleFileInternalSectionStart(child); + if (shouldEmitInterveningComments) { + const commentRange = getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } else { + shouldEmitInterveningComments = mayEmitInterveningComments; + } + nextListElementPos = child.pos; + emitListItem(child, emit2, parenthesizerRule, i); + if (shouldDecreaseIndentAfterEmit) { + decreaseIndent(); + shouldDecreaseIndentAfterEmit = false; + } + previousSibling = child; + } + const emitFlags = previousSibling ? getEmitFlags(previousSibling) : 0; + const skipTrailingComments = commentsDisabled || !!(emitFlags & 2048 /* NoTrailingComments */); + const emitTrailingComma = hasTrailingComma && format & 64 /* AllowTrailingComma */ && format & 16 /* CommaDelimited */; + if (emitTrailingComma) { + if (previousSibling && !skipTrailingComments) { + emitTokenWithComment(27 /* CommaToken */, previousSibling.end, writePunctuation, previousSibling); + } else { + writePunctuation(","); + } + } + if (previousSibling && (parentNode ? parentNode.end : -1) !== previousSibling.end && format & 60 /* DelimitersMask */ && !skipTrailingComments) { + emitLeadingCommentsOfPosition(emitTrailingComma && (childrenTextRange == null ? void 0 : childrenTextRange.end) ? childrenTextRange.end : previousSibling.end); + } + if (format & 128 /* Indented */) { + decreaseIndent(); + } + recordBundleFileInternalSectionEnd(previousSourceFileTextKind); + const closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children[start + count - 1], format, childrenTextRange); + if (closingLineTerminatorCount) { + writeLine(closingLineTerminatorCount); + } else if (format & (2097152 /* SpaceAfterList */ | 256 /* SpaceBetweenBraces */)) { + writeSpace(); + } + } + function writeLiteral(s) { + writer.writeLiteral(s); + } + function writeStringLiteral(s) { + writer.writeStringLiteral(s); + } + function writeBase(s) { + writer.write(s); + } + function writeSymbol(s, sym) { + writer.writeSymbol(s, sym); + } + function writePunctuation(s) { + writer.writePunctuation(s); + } + function writeTrailingSemicolon() { + writer.writeTrailingSemicolon(";"); + } + function writeKeyword(s) { + writer.writeKeyword(s); + } + function writeOperator(s) { + writer.writeOperator(s); + } + function writeParameter(s) { + writer.writeParameter(s); + } + function writeComment(s) { + writer.writeComment(s); + } + function writeSpace() { + writer.writeSpace(" "); + } + function writeProperty(s) { + writer.writeProperty(s); + } + function nonEscapingWrite(s) { + if (writer.nonEscapingWrite) { + writer.nonEscapingWrite(s); + } else { + writer.write(s); + } + } + function writeLine(count = 1) { + for (let i = 0; i < count; i++) { + writer.writeLine(i > 0); + } + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } + function writeToken(token, pos, writer2, contextNode) { + return !sourceMapsDisabled ? emitTokenWithSourceMap(contextNode, token, writer2, pos, writeTokenText) : writeTokenText(token, writer2, pos); + } + function writeTokenNode(node, writer2) { + if (onBeforeEmitToken) { + onBeforeEmitToken(node); + } + writer2(tokenToString(node.kind)); + if (onAfterEmitToken) { + onAfterEmitToken(node); + } + } + function writeTokenText(token, writer2, pos) { + const tokenString = tokenToString(token); + writer2(tokenString); + return pos < 0 ? pos : pos + tokenString.length; + } + function writeLineOrSpace(parentNode, prevChildNode, nextChildNode) { + if (getEmitFlags(parentNode) & 1 /* SingleLine */) { + writeSpace(); + } else if (preserveSourceNewlines) { + const lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode); + if (lines) { + writeLine(lines); + } else { + writeSpace(); + } + } else { + writeLine(); + } + } + function writeLines(text) { + const lines = text.split(/\r\n?|\n/g); + const indentation = guessIndentation(lines); + for (const lineText of lines) { + const line = indentation ? lineText.slice(indentation) : lineText; + if (line.length) { + writeLine(); + write(line); + } + } + } + function writeLinesAndIndent(lineCount, writeSpaceIfNotIndenting) { + if (lineCount) { + increaseIndent(); + writeLine(lineCount); + } else if (writeSpaceIfNotIndenting) { + writeSpace(); + } + } + function decreaseIndentIf(value1, value2) { + if (value1) { + decreaseIndent(); + } + if (value2) { + decreaseIndent(); + } + } + function getLeadingLineTerminatorCount(parentNode, firstChild, format) { + if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { + if (format & 65536 /* PreferNewLine */) { + return 1; + } + if (firstChild === void 0) { + return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; + } + if (firstChild.pos === nextListElementPos) { + return 0; + } + if (firstChild.kind === 11 /* JsxText */) { + return 0; + } + if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(firstChild) && (!firstChild.parent || getOriginalNode(firstChild.parent) === getOriginalNode(parentNode))) { + if (preserveSourceNewlines) { + return getEffectiveLines( + (includeComments) => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter( + firstChild.pos, + parentNode.pos, + currentSourceFile, + includeComments + ) + ); + } + return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile) ? 0 : 1; + } + if (synthesizedNodeStartsOnNewLine(firstChild, format)) { + return 1; + } + } + return format & 1 /* MultiLine */ ? 1 : 0; + } + function getSeparatingLineTerminatorCount(previousNode, nextNode, format) { + if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { + if (previousNode === void 0 || nextNode === void 0) { + return 0; + } + if (nextNode.kind === 11 /* JsxText */) { + return 0; + } else if (currentSourceFile && !nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) { + if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) { + return getEffectiveLines( + (includeComments) => getLinesBetweenRangeEndAndRangeStart( + previousNode, + nextNode, + currentSourceFile, + includeComments + ) + ); + } else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) { + return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1; + } + return format & 65536 /* PreferNewLine */ ? 1 : 0; + } else if (synthesizedNodeStartsOnNewLine(previousNode, format) || synthesizedNodeStartsOnNewLine(nextNode, format)) { + return 1; + } + } else if (getStartsOnNewLine(nextNode)) { + return 1; + } + return format & 1 /* MultiLine */ ? 1 : 0; + } + function getClosingLineTerminatorCount(parentNode, lastChild, format, childrenTextRange) { + if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { + if (format & 65536 /* PreferNewLine */) { + return 1; + } + if (lastChild === void 0) { + return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; + } + if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) { + if (preserveSourceNewlines) { + const end = childrenTextRange && !positionIsSynthesized(childrenTextRange.end) ? childrenTextRange.end : lastChild.end; + return getEffectiveLines( + (includeComments) => getLinesBetweenPositionAndNextNonWhitespaceCharacter( + end, + parentNode.end, + currentSourceFile, + includeComments + ) + ); + } + return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1; + } + if (synthesizedNodeStartsOnNewLine(lastChild, format)) { + return 1; + } + } + if (format & 1 /* MultiLine */ && !(format & 131072 /* NoTrailingNewLine */)) { + return 1; + } + return 0; + } + function getEffectiveLines(getLineDifference) { + Debug.assert(!!preserveSourceNewlines); + const lines = getLineDifference( + /*includeComments*/ + true + ); + if (lines === 0) { + return getLineDifference( + /*includeComments*/ + false + ); + } + return lines; + } + function writeLineSeparatorsAndIndentBefore(node, parent) { + const leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent, node, 0 /* None */); + if (leadingNewlines) { + writeLinesAndIndent( + leadingNewlines, + /*writeSpaceIfNotIndenting*/ + false + ); + } + return !!leadingNewlines; + } + function writeLineSeparatorsAfter(node, parent) { + const trailingNewlines = preserveSourceNewlines && getClosingLineTerminatorCount( + parent, + node, + 0 /* None */, + /*childrenTextRange*/ + void 0 + ); + if (trailingNewlines) { + writeLine(trailingNewlines); + } + } + function synthesizedNodeStartsOnNewLine(node, format) { + if (nodeIsSynthesized(node)) { + const startsOnNewLine = getStartsOnNewLine(node); + if (startsOnNewLine === void 0) { + return (format & 65536 /* PreferNewLine */) !== 0; + } + return startsOnNewLine; + } + return (format & 65536 /* PreferNewLine */) !== 0; + } + function getLinesBetweenNodes(parent, node1, node2) { + if (getEmitFlags(parent) & 262144 /* NoIndentation */) { + return 0; + } + parent = skipSynthesizedParentheses(parent); + node1 = skipSynthesizedParentheses(node1); + node2 = skipSynthesizedParentheses(node2); + if (getStartsOnNewLine(node2)) { + return 1; + } + if (currentSourceFile && !nodeIsSynthesized(parent) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) { + if (preserveSourceNewlines) { + return getEffectiveLines( + (includeComments) => getLinesBetweenRangeEndAndRangeStart( + node1, + node2, + currentSourceFile, + includeComments + ) + ); + } + return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1; + } + return 0; + } + function isEmptyBlock(block) { + return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); + } + function skipSynthesizedParentheses(node) { + while (node.kind === 214 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { + node = node.expression; + } + return node; + } + function getTextOfNode2(node, includeTrivia) { + if (isGeneratedIdentifier(node) || isGeneratedPrivateIdentifier(node)) { + return generateName(node); + } + if (isStringLiteral(node) && node.textSourceNode) { + return getTextOfNode2(node.textSourceNode, includeTrivia); + } + const sourceFile = currentSourceFile; + const canUseSourceFile = !!sourceFile && !!node.parent && !nodeIsSynthesized(node); + if (isMemberName(node)) { + if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) { + return idText(node); + } + } else { + Debug.assertNode(node, isLiteralExpression); + if (!canUseSourceFile) { + return node.text; + } + } + return getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia); + } + function getLiteralTextOfNode(node, neverAsciiEscape, jsxAttributeEscape) { + if (node.kind === 10 /* StringLiteral */ && node.textSourceNode) { + const textSourceNode = node.textSourceNode; + if (isIdentifier(textSourceNode) || isPrivateIdentifier(textSourceNode) || isNumericLiteral(textSourceNode)) { + const text = isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode2(textSourceNode); + return jsxAttributeEscape ? `"${escapeJsxAttributeString(text)}"` : neverAsciiEscape || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? `"${escapeString(text)}"` : `"${escapeNonAsciiString(text)}"`; + } else { + return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); + } + } + const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0); + return getLiteralText(node, currentSourceFile, flags); + } + function pushNameGenerationScope(node) { + if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { + return; + } + tempFlagsStack.push(tempFlags); + tempFlags = TempFlags.Auto; + formattedNameTempFlagsStack.push(formattedNameTempFlags); + formattedNameTempFlags = void 0; + reservedNamesStack.push(reservedNames); + } + function popNameGenerationScope(node) { + if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { + return; + } + tempFlags = tempFlagsStack.pop(); + formattedNameTempFlags = formattedNameTempFlagsStack.pop(); + reservedNames = reservedNamesStack.pop(); + } + function reserveNameInNestedScopes(name) { + if (!reservedNames || reservedNames === lastOrUndefined(reservedNamesStack)) { + reservedNames = /* @__PURE__ */ new Set(); + } + reservedNames.add(name); + } + function pushPrivateNameGenerationScope(newPrivateNameTempFlags, newReservedMemberNames) { + privateNameTempFlagsStack.push(privateNameTempFlags); + privateNameTempFlags = newPrivateNameTempFlags; + reservedPrivateNamesStack.push(reservedNames); + reservedPrivateNames = newReservedMemberNames; + } + function popPrivateNameGenerationScope() { + privateNameTempFlags = privateNameTempFlagsStack.pop(); + reservedPrivateNames = reservedPrivateNamesStack.pop(); + } + function reservePrivateNameInNestedScopes(name) { + if (!reservedPrivateNames || reservedPrivateNames === lastOrUndefined(reservedPrivateNamesStack)) { + reservedPrivateNames = /* @__PURE__ */ new Set(); + } + reservedPrivateNames.add(name); + } + function generateNames(node) { + if (!node) + return; + switch (node.kind) { + case 238 /* Block */: + forEach(node.statements, generateNames); + break; + case 253 /* LabeledStatement */: + case 251 /* WithStatement */: + case 243 /* DoStatement */: + case 244 /* WhileStatement */: + generateNames(node.statement); + break; + case 242 /* IfStatement */: + generateNames(node.thenStatement); + generateNames(node.elseStatement); + break; + case 245 /* ForStatement */: + case 247 /* ForOfStatement */: + case 246 /* ForInStatement */: + generateNames(node.initializer); + generateNames(node.statement); + break; + case 252 /* SwitchStatement */: + generateNames(node.caseBlock); + break; + case 266 /* CaseBlock */: + forEach(node.clauses, generateNames); + break; + case 292 /* CaseClause */: + case 293 /* DefaultClause */: + forEach(node.statements, generateNames); + break; + case 255 /* TryStatement */: + generateNames(node.tryBlock); + generateNames(node.catchClause); + generateNames(node.finallyBlock); + break; + case 295 /* CatchClause */: + generateNames(node.variableDeclaration); + generateNames(node.block); + break; + case 240 /* VariableStatement */: + generateNames(node.declarationList); + break; + case 258 /* VariableDeclarationList */: + forEach(node.declarations, generateNames); + break; + case 257 /* VariableDeclaration */: + case 166 /* Parameter */: + case 205 /* BindingElement */: + case 260 /* ClassDeclaration */: + generateNameIfNeeded(node.name); + break; + case 259 /* FunctionDeclaration */: + generateNameIfNeeded(node.name); + if (getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { + forEach(node.parameters, generateNames); + generateNames(node.body); + } + break; + case 203 /* ObjectBindingPattern */: + case 204 /* ArrayBindingPattern */: + forEach(node.elements, generateNames); + break; + case 269 /* ImportDeclaration */: + generateNames(node.importClause); + break; + case 270 /* ImportClause */: + generateNameIfNeeded(node.name); + generateNames(node.namedBindings); + break; + case 271 /* NamespaceImport */: + generateNameIfNeeded(node.name); + break; + case 277 /* NamespaceExport */: + generateNameIfNeeded(node.name); + break; + case 272 /* NamedImports */: + forEach(node.elements, generateNames); + break; + case 273 /* ImportSpecifier */: + generateNameIfNeeded(node.propertyName || node.name); + break; + } + } + function generateMemberNames(node) { + if (!node) + return; + switch (node.kind) { + case 299 /* PropertyAssignment */: + case 300 /* ShorthandPropertyAssignment */: + case 169 /* PropertyDeclaration */: + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: + generateNameIfNeeded(node.name); + break; + } + } + function generateNameIfNeeded(name) { + if (name) { + if (isGeneratedIdentifier(name) || isGeneratedPrivateIdentifier(name)) { + generateName(name); + } else if (isBindingPattern(name)) { + generateNames(name); + } + } + } + function generateName(name) { + const autoGenerate = name.emitNode.autoGenerate; + if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { + return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix); + } else { + const autoGenerateId = autoGenerate.id; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name)); + } + } + function generateNameCached(node, privateName, flags, prefix, suffix) { + const nodeId = getNodeId(node); + const cache = privateName ? nodeIdToGeneratedPrivateName : nodeIdToGeneratedName; + return cache[nodeId] || (cache[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); + } + function isUniqueName(name, privateName) { + return isFileLevelUniqueName2(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name); + } + function isReservedName(name, privateName) { + return privateName ? !!(reservedPrivateNames == null ? void 0 : reservedPrivateNames.has(name)) : !!(reservedNames == null ? void 0 : reservedNames.has(name)); + } + function isFileLevelUniqueName2(name, _isPrivate) { + return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true; + } + function isUniqueLocalName(name, container) { + for (let node = container; node && isNodeDescendantOf(node, container); node = node.nextContainer) { + if (canHaveLocals(node) && node.locals) { + const local = node.locals.get(escapeLeadingUnderscores(name)); + if (local && local.flags & (111551 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) { + return false; + } + } + } + return true; + } + function getTempFlags(formattedNameKey) { + var _a2; + switch (formattedNameKey) { + case "": + return tempFlags; + case "#": + return privateNameTempFlags; + default: + return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : TempFlags.Auto; + } + } + function setTempFlags(formattedNameKey, flags) { + switch (formattedNameKey) { + case "": + tempFlags = flags; + break; + case "#": + privateNameTempFlags = flags; + break; + default: + formattedNameTempFlags != null ? formattedNameTempFlags : formattedNameTempFlags = /* @__PURE__ */ new Map(); + formattedNameTempFlags.set(formattedNameKey, flags); + break; + } + } + function makeTempVariableName(flags, reservedInNestedScopes, privateName, prefix, suffix) { + if (prefix.length > 0 && prefix.charCodeAt(0) === 35 /* hash */) { + prefix = prefix.slice(1); + } + const key = formatGeneratedName(privateName, prefix, "", suffix); + let tempFlags2 = getTempFlags(key); + if (flags && !(tempFlags2 & flags)) { + const name = flags === TempFlags._i ? "_i" : "_n"; + const fullName = formatGeneratedName(privateName, prefix, name, suffix); + if (isUniqueName(fullName, privateName)) { + tempFlags2 |= flags; + if (privateName) { + reservePrivateNameInNestedScopes(fullName); + } else if (reservedInNestedScopes) { + reserveNameInNestedScopes(fullName); + } + setTempFlags(key, tempFlags2); + return fullName; + } + } + while (true) { + const count = tempFlags2 & TempFlags.CountMask; + tempFlags2++; + if (count !== 8 && count !== 13) { + const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); + const fullName = formatGeneratedName(privateName, prefix, name, suffix); + if (isUniqueName(fullName, privateName)) { + if (privateName) { + reservePrivateNameInNestedScopes(fullName); + } else if (reservedInNestedScopes) { + reserveNameInNestedScopes(fullName); + } + setTempFlags(key, tempFlags2); + return fullName; + } + } + } + } + function makeUniqueName(baseName, checkFn = isUniqueName, optimistic, scoped, privateName, prefix, suffix) { + if (baseName.length > 0 && baseName.charCodeAt(0) === 35 /* hash */) { + baseName = baseName.slice(1); + } + if (prefix.length > 0 && prefix.charCodeAt(0) === 35 /* hash */) { + prefix = prefix.slice(1); + } + if (optimistic) { + const fullName = formatGeneratedName(privateName, prefix, baseName, suffix); + if (checkFn(fullName, privateName)) { + if (privateName) { + reservePrivateNameInNestedScopes(fullName); + } else if (scoped) { + reserveNameInNestedScopes(fullName); + } else { + generatedNames.add(fullName); + } + return fullName; + } + } + if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { + baseName += "_"; + } + let i = 1; + while (true) { + const fullName = formatGeneratedName(privateName, prefix, baseName + i, suffix); + if (checkFn(fullName, privateName)) { + if (privateName) { + reservePrivateNameInNestedScopes(fullName); + } else if (scoped) { + reserveNameInNestedScopes(fullName); + } else { + generatedNames.add(fullName); + } + return fullName; + } + i++; + } + } + function makeFileLevelOptimisticUniqueName(name) { + return makeUniqueName( + name, + isFileLevelUniqueName2, + /*optimistic*/ + true, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForModuleOrEnum(node) { + const name = getTextOfNode2(node.name); + return isUniqueLocalName(name, tryCast(node, canHaveLocals)) ? name : makeUniqueName( + name, + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForImportOrExportDeclaration(node) { + const expr = getExternalModuleName(node); + const baseName = isStringLiteral(expr) ? makeIdentifierFromModuleName(expr.text) : "module"; + return makeUniqueName( + baseName, + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForExportDefault() { + return makeUniqueName( + "default", + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForClassExpression() { + return makeUniqueName( + "class", + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForMethodOrAccessor(node, privateName, prefix, suffix) { + if (isIdentifier(node.name)) { + return generateNameCached(node.name, privateName); + } + return makeTempVariableName( + TempFlags.Auto, + /*reservedInNestedScopes*/ + false, + privateName, + prefix, + suffix + ); + } + function generateNameForNode(node, privateName, flags, prefix, suffix) { + switch (node.kind) { + case 79 /* Identifier */: + case 80 /* PrivateIdentifier */: + return makeUniqueName( + getTextOfNode2(node), + isUniqueName, + !!(flags & 16 /* Optimistic */), + !!(flags & 8 /* ReservedInNestedScopes */), + privateName, + prefix, + suffix + ); + case 264 /* ModuleDeclaration */: + case 263 /* EnumDeclaration */: + Debug.assert(!prefix && !suffix && !privateName); + return generateNameForModuleOrEnum(node); + case 269 /* ImportDeclaration */: + case 275 /* ExportDeclaration */: + Debug.assert(!prefix && !suffix && !privateName); + return generateNameForImportOrExportDeclaration(node); + case 259 /* FunctionDeclaration */: + case 260 /* ClassDeclaration */: { + Debug.assert(!prefix && !suffix && !privateName); + const name = node.name; + if (name && !isGeneratedIdentifier(name)) { + return generateNameForNode( + name, + /*privateName*/ + false, + flags, + prefix, + suffix + ); + } + return generateNameForExportDefault(); + } + case 274 /* ExportAssignment */: + Debug.assert(!prefix && !suffix && !privateName); + return generateNameForExportDefault(); + case 228 /* ClassExpression */: + Debug.assert(!prefix && !suffix && !privateName); + return generateNameForClassExpression(); + case 171 /* MethodDeclaration */: + case 174 /* GetAccessor */: + case 175 /* SetAccessor */: + return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); + case 164 /* ComputedPropertyName */: + return makeTempVariableName( + TempFlags.Auto, + /*reserveInNestedScopes*/ + true, + privateName, + prefix, + suffix + ); + default: + return makeTempVariableName( + TempFlags.Auto, + /*reserveInNestedScopes*/ + false, + privateName, + prefix, + suffix + ); + } + } + function makeName(name) { + const autoGenerate = name.emitNode.autoGenerate; + const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName); + const suffix = formatGeneratedNamePart(autoGenerate.suffix); + switch (autoGenerate.flags & 7 /* KindMask */) { + case 1 /* Auto */: + return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + case 2 /* Loop */: + Debug.assertNode(name, isIdentifier); + return makeTempVariableName( + TempFlags._i, + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), + /*privateName*/ + false, + prefix, + suffix + ); + case 3 /* Unique */: + return makeUniqueName( + idText(name), + autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, + !!(autoGenerate.flags & 16 /* Optimistic */), + !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), + isPrivateIdentifier(name), + prefix, + suffix + ); + } + return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum( + autoGenerate.flags & 7 /* KindMask */, + GeneratedIdentifierFlags, + /*isFlags*/ + true + )}.`); + } + function pipelineEmitWithComments(hint, node) { + const pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node); + const savedContainerPos = containerPos; + const savedContainerEnd = containerEnd; + const savedDeclarationListContainerEnd = declarationListContainerEnd; + emitCommentsBeforeNode(node); + pipelinePhase(hint, node); + emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + } + function emitCommentsBeforeNode(node) { + const emitFlags = getEmitFlags(node); + const commentRange = getCommentRange(node); + emitLeadingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end); + if (emitFlags & 4096 /* NoNestedComments */) { + commentsDisabled = true; + } + } + function emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { + const emitFlags = getEmitFlags(node); + const commentRange = getCommentRange(node); + if (emitFlags & 4096 /* NoNestedComments */) { + commentsDisabled = false; + } + emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + const typeNode = getTypeNode(node); + if (typeNode) { + emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + } + } + function emitLeadingCommentsOfNode(node, emitFlags, pos, end) { + enterComment(); + hasWrittenComment = false; + const skipLeadingComments = pos < 0 || (emitFlags & 1024 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; + const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */; + if ((pos > 0 || end > 0) && pos !== end) { + if (!skipLeadingComments) { + emitLeadingComments( + pos, + /*isEmittedNode*/ + node.kind !== 355 /* NotEmittedStatement */ + ); + } + if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { + containerPos = pos; + } + if (!skipTrailingComments || end >= 0 && (emitFlags & 2048 /* NoTrailingComments */) !== 0) { + containerEnd = end; + if (node.kind === 258 /* VariableDeclarationList */) { + declarationListContainerEnd = end; + } + } + } + forEach(getSyntheticLeadingComments(node), emitLeadingSynthesizedComment); + exitComment(); + } + function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { + enterComment(); + const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */; + forEach(getSyntheticTrailingComments(node), emitTrailingSynthesizedComment); + if ((pos > 0 || end > 0) && pos !== end) { + containerPos = savedContainerPos; + containerEnd = savedContainerEnd; + declarationListContainerEnd = savedDeclarationListContainerEnd; + if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) { + emitTrailingComments(end); + } + } + exitComment(); + } + function emitLeadingSynthesizedComment(comment) { + if (comment.hasLeadingNewline || comment.kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } else { + writer.writeSpace(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.writeSpace(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + const text = formatSynthesizedComment(comment); + const lineMap = comment.kind === 3 /* MultiLineCommentTrivia */ ? computeLineStarts(text) : void 0; + writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 /* MultiLineCommentTrivia */ ? `/*${comment.text}*/` : `//${comment.text}`; + } + function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { + enterComment(); + const { pos, end } = detachedRange; + const emitFlags = getEmitFlags(node); + const skipLeadingComments = pos < 0 || (emitFlags & 1024 /* NoLeadingComments */) !== 0; + const skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0; + if (!skipLeadingComments) { + emitDetachedCommentsAndUpdateCommentsInfo(detachedRange); + } + exitComment(); + if (emitFlags & 4096 /* NoNestedComments */ && !commentsDisabled) { + commentsDisabled = true; + emitCallback(node); + commentsDisabled = false; + } else { + emitCallback(node); + } + enterComment(); + if (!skipTrailingComments) { + emitLeadingComments( + detachedRange.end, + /*isEmittedNode*/ + true + ); + if (hasWrittenComment && !writer.isAtStartOfLine()) { + writer.writeLine(); + } + } + exitComment(); + } + function originalNodesHaveSameParent(nodeA, nodeB) { + nodeA = getOriginalNode(nodeA); + return nodeA.parent && nodeA.parent === getOriginalNode(nodeB).parent; + } + function siblingNodePositionsAreComparable(previousNode, nextNode) { + if (nextNode.pos < previousNode.end) { + return false; + } + previousNode = getOriginalNode(previousNode); + nextNode = getOriginalNode(nextNode); + const parent = previousNode.parent; + if (!parent || parent !== nextNode.parent) { + return false; + } + const parentNodeArray = getContainingNodeArray(previousNode); + const prevNodeIndex = parentNodeArray == null ? void 0 : parentNodeArray.indexOf(previousNode); + return prevNodeIndex !== void 0 && prevNodeIndex > -1 && parentNodeArray.indexOf(nextNode) === prevNodeIndex + 1; + } + function emitLeadingComments(pos, isEmittedNode) { + hasWrittenComment = false; + if (isEmittedNode) { + if (pos === 0 && (currentSourceFile == null ? void 0 : currentSourceFile.isDeclarationFile)) { + forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); + } else { + forEachLeadingCommentToEmit(pos, emitLeadingComment); + } + } else if (pos === 0) { + forEachLeadingCommentToEmit(pos, emitTripleSlashLeadingComment); + } + } + function emitTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (isTripleSlashComment(commentPos, commentEnd)) { + emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); + } + } + function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (!isTripleSlashComment(commentPos, commentEnd)) { + emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); + } + } + function shouldWriteComment(text, pos) { + if (printerOptions.onlyPrintJsDocStyle) { + return isJSDocLikeText(text, pos) || isPinnedComment(text, pos); + } + return true; + } + function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + if (!hasWrittenComment) { + emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos); + hasWrittenComment = true; + } + emitPos(commentPos); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } else if (kind === 3 /* MultiLineCommentTrivia */) { + writer.writeSpace(" "); + } + } + function emitLeadingCommentsOfPosition(pos) { + if (commentsDisabled || pos === -1) { + return; + } + emitLeadingComments( + pos, + /*isEmittedNode*/ + true + ); + } + function emitTrailingComments(pos) { + forEachTrailingCommentToEmit(pos, emitTrailingComment); + } + function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + if (!writer.isAtStartOfLine()) { + writer.writeSpace(" "); + } + emitPos(commentPos); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } + } + function emitTrailingCommentsOfPosition(pos, prefixSpace, forceNoNewline) { + if (commentsDisabled) { + return; + } + enterComment(); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : forceNoNewline ? emitTrailingCommentOfPositionNoNewline : emitTrailingCommentOfPosition); + exitComment(); + } + function emitTrailingCommentOfPositionNoNewline(commentPos, commentEnd, kind) { + if (!currentSourceFile) + return; + emitPos(commentPos); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (kind === 2 /* SingleLineCommentTrivia */) { + writer.writeLine(); + } + } + function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { + if (!currentSourceFile) + return; + emitPos(commentPos); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } else { + writer.writeSpace(" "); + } + } + function forEachLeadingCommentToEmit(pos, cb) { + if (currentSourceFile && (containerPos === -1 || pos !== containerPos)) { + if (hasDetachedComments(pos)) { + forEachLeadingCommentWithoutDetachedComments(cb); + } else { + forEachLeadingCommentRange( + currentSourceFile.text, + pos, + cb, + /*state*/ + pos + ); + } + } + } + function forEachTrailingCommentToEmit(end, cb) { + if (currentSourceFile && (containerEnd === -1 || end !== containerEnd && end !== declarationListContainerEnd)) { + forEachTrailingCommentRange(currentSourceFile.text, end, cb); + } + } + function hasDetachedComments(pos) { + return detachedCommentsInfo !== void 0 && last(detachedCommentsInfo).nodePos === pos; + } + function forEachLeadingCommentWithoutDetachedComments(cb) { + if (!currentSourceFile) + return; + const pos = last(detachedCommentsInfo).detachedCommentEndPos; + if (detachedCommentsInfo.length - 1) { + detachedCommentsInfo.pop(); + } else { + detachedCommentsInfo = void 0; + } + forEachLeadingCommentRange( + currentSourceFile.text, + pos, + cb, + /*state*/ + pos + ); + } + function emitDetachedCommentsAndUpdateCommentsInfo(range) { + const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled); + if (currentDetachedCommentInfo) { + if (detachedCommentsInfo) { + detachedCommentsInfo.push(currentDetachedCommentInfo); + } else { + detachedCommentsInfo = [currentDetachedCommentInfo]; + } + } + } + function emitComment(text, lineMap, writer2, commentPos, commentEnd, newLine2) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + emitPos(commentPos); + writeCommentRange(text, lineMap, writer2, commentPos, commentEnd, newLine2); + emitPos(commentEnd); + } + function isTripleSlashComment(commentPos, commentEnd) { + return !!currentSourceFile && isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd); + } + function getParsedSourceMap(node) { + if (node.parsedSourceMap === void 0 && node.sourceMapText !== void 0) { + node.parsedSourceMap = tryParseRawSourceMap(node.sourceMapText) || false; + } + return node.parsedSourceMap || void 0; + } + function pipelineEmitWithSourceMaps(hint, node) { + const pipelinePhase = getNextPipelinePhase(3 /* SourceMaps */, hint, node); + emitSourceMapsBeforeNode(node); + pipelinePhase(hint, node); + emitSourceMapsAfterNode(node); + } + function emitSourceMapsBeforeNode(node) { + const emitFlags = getEmitFlags(node); + const sourceMapRange = getSourceMapRange(node); + if (isUnparsedNode(node)) { + Debug.assertIsDefined(node.parent, "UnparsedNodes must have parent pointers"); + const parsed = getParsedSourceMap(node.parent); + if (parsed && sourceMapGenerator) { + sourceMapGenerator.appendSourceMap( + writer.getLine(), + writer.getColumn(), + parsed, + node.parent.sourceMapPath, + node.parent.getLineAndCharacterOfPosition(node.pos), + node.parent.getLineAndCharacterOfPosition(node.end) + ); + } + } else { + const source = sourceMapRange.source || sourceMapSource; + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { + emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); + } + if (emitFlags & 128 /* NoNestedSourceMaps */) { + sourceMapsDisabled = true; + } + } + } + function emitSourceMapsAfterNode(node) { + const emitFlags = getEmitFlags(node); + const sourceMapRange = getSourceMapRange(node); + if (!isUnparsedNode(node)) { + if (emitFlags & 128 /* NoNestedSourceMaps */) { + sourceMapsDisabled = false; + } + if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { + emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); + } + } + } + function skipSourceTrivia(source, pos) { + return source.skipTrivia ? source.skipTrivia(pos) : skipTrivia(source.text, pos); + } + function emitPos(pos) { + if (sourceMapsDisabled || positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) { + return; + } + const { line: sourceLine, character: sourceCharacter } = getLineAndCharacterOfPosition(sourceMapSource, pos); + sourceMapGenerator.addMapping( + writer.getLine(), + writer.getColumn(), + sourceMapSourceIndex, + sourceLine, + sourceCharacter, + /*nameIndex*/ + void 0 + ); + } + function emitSourcePos(source, pos) { + if (source !== sourceMapSource) { + const savedSourceMapSource = sourceMapSource; + const savedSourceMapSourceIndex = sourceMapSourceIndex; + setSourceMapSource(source); + emitPos(pos); + resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + } else { + emitPos(pos); + } + } + function emitTokenWithSourceMap(node, token, writer2, tokenPos, emitCallback) { + if (sourceMapsDisabled || node && isInJsonFile(node)) { + return emitCallback(token, writer2, tokenPos); + } + const emitNode = node && node.emitNode; + const emitFlags = emitNode && emitNode.flags || 0 /* None */; + const range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token]; + const source = range && range.source || sourceMapSource; + tokenPos = skipSourceTrivia(source, range ? range.pos : tokenPos); + if ((emitFlags & 256 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) { + emitSourcePos(source, tokenPos); + } + tokenPos = emitCallback(token, writer2, tokenPos); + if (range) + tokenPos = range.end; + if ((emitFlags & 512 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) { + emitSourcePos(source, tokenPos); + } + return tokenPos; + } + function setSourceMapSource(source) { + if (sourceMapsDisabled) { + return; + } + sourceMapSource = source; + if (source === mostRecentlyAddedSourceMapSource) { + sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; + return; + } + if (isJsonSourceMapSource(source)) { + return; + } + sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName); + if (printerOptions.inlineSources) { + sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); + } + mostRecentlyAddedSourceMapSource = source; + mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; + } + function resetSourceMapSource(source, sourceIndex) { + sourceMapSource = source; + sourceMapSourceIndex = sourceIndex; + } + function isJsonSourceMapSource(sourceFile) { + return fileExtensionIs(sourceFile.fileName, ".json" /* Json */); + } +} +function createBracketsMap() { + const brackets2 = []; + brackets2[1024 /* Braces */] = ["{", "}"]; + brackets2[2048 /* Parenthesis */] = ["(", ")"]; + brackets2[4096 /* AngleBrackets */] = ["<", ">"]; + brackets2[8192 /* SquareBrackets */] = ["[", "]"]; + return brackets2; +} +function getOpeningBracket(format) { + return brackets[format & 15360 /* BracketsMask */][0]; +} +function getClosingBracket(format) { + return brackets[format & 15360 /* BracketsMask */][1]; +} +var TempFlags = /* @__PURE__ */ ((TempFlags2) => { + TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; + TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; + TempFlags2[TempFlags2["_i"] = 268435456] = "_i"; + return TempFlags2; +})(TempFlags || {}); +function emitListItemNoParenthesizer(node, emit, _parenthesizerRule, _index) { + emit(node); +} +function emitListItemWithParenthesizerRuleSelector(node, emit, parenthesizerRuleSelector, index) { + emit(node, parenthesizerRuleSelector.select(index)); +} +function emitListItemWithParenthesizerRule(node, emit, parenthesizerRule, _index) { + emit(node, parenthesizerRule); +} +function getEmitListItem(emit, parenthesizerRule) { + return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; } // src/compiler/watchUtilities.ts From 89515ce7e31d0bfaef776ac25929a78015cceb82 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 25 Feb 2023 02:46:19 +0000 Subject: [PATCH 03/35] Update version to 5.0.1-rc and LKG. --- lib/lib.d.ts | 2 - lib/lib.decorators.d.ts | 209 +- lib/lib.decorators.legacy.d.ts | 2 - lib/lib.dom.d.ts | 2 - lib/lib.dom.iterable.d.ts | 2 - lib/lib.es2015.collection.d.ts | 2 - lib/lib.es2015.core.d.ts | 2 - lib/lib.es2015.d.ts | 2 - lib/lib.es2015.generator.d.ts | 2 - lib/lib.es2015.iterable.d.ts | 2 - lib/lib.es2015.promise.d.ts | 2 - lib/lib.es2015.proxy.d.ts | 2 - lib/lib.es2015.reflect.d.ts | 2 - lib/lib.es2015.symbol.d.ts | 2 - lib/lib.es2015.symbol.wellknown.d.ts | 26 +- lib/lib.es2016.array.include.d.ts | 2 - lib/lib.es2016.d.ts | 2 - lib/lib.es2016.full.d.ts | 2 - lib/lib.es2017.d.ts | 2 - lib/lib.es2017.full.d.ts | 2 - lib/lib.es2017.intl.d.ts | 2 - lib/lib.es2017.object.d.ts | 2 - lib/lib.es2017.sharedmemory.d.ts | 2 - lib/lib.es2017.string.d.ts | 2 - lib/lib.es2017.typedarrays.d.ts | 2 - lib/lib.es2018.asyncgenerator.d.ts | 2 - lib/lib.es2018.asynciterable.d.ts | 2 - lib/lib.es2018.d.ts | 2 - lib/lib.es2018.full.d.ts | 2 - lib/lib.es2018.intl.d.ts | 2 - lib/lib.es2018.promise.d.ts | 2 - lib/lib.es2018.regexp.d.ts | 2 - lib/lib.es2019.array.d.ts | 2 - lib/lib.es2019.d.ts | 2 - lib/lib.es2019.full.d.ts | 2 - lib/lib.es2019.intl.d.ts | 2 - lib/lib.es2019.object.d.ts | 2 - lib/lib.es2019.string.d.ts | 2 - lib/lib.es2019.symbol.d.ts | 2 - lib/lib.es2020.bigint.d.ts | 2 - lib/lib.es2020.d.ts | 2 - lib/lib.es2020.date.d.ts | 2 - lib/lib.es2020.full.d.ts | 2 - lib/lib.es2020.intl.d.ts | 2 - lib/lib.es2020.number.d.ts | 2 - lib/lib.es2020.promise.d.ts | 2 - lib/lib.es2020.sharedmemory.d.ts | 2 - lib/lib.es2020.string.d.ts | 2 - lib/lib.es2020.symbol.wellknown.d.ts | 2 - lib/lib.es2021.d.ts | 2 - lib/lib.es2021.full.d.ts | 2 - lib/lib.es2021.intl.d.ts | 2 - lib/lib.es2021.promise.d.ts | 2 - lib/lib.es2021.string.d.ts | 2 - lib/lib.es2021.weakref.d.ts | 2 - lib/lib.es2022.array.d.ts | 2 - lib/lib.es2022.d.ts | 2 - lib/lib.es2022.error.d.ts | 2 - lib/lib.es2022.full.d.ts | 2 - lib/lib.es2022.intl.d.ts | 2 - lib/lib.es2022.object.d.ts | 2 - lib/lib.es2022.regexp.d.ts | 2 - lib/lib.es2022.sharedmemory.d.ts | 2 - lib/lib.es2022.string.d.ts | 2 - lib/lib.es2023.array.d.ts | 2 - lib/lib.es2023.d.ts | 2 - lib/lib.es2023.full.d.ts | 2 - lib/lib.es5.d.ts | 2 - lib/lib.es6.d.ts | 2 - lib/lib.esnext.d.ts | 2 - lib/lib.esnext.full.d.ts | 2 - lib/lib.esnext.intl.d.ts | 2 - lib/lib.scripthost.d.ts | 2 - lib/lib.webworker.d.ts | 2 - lib/lib.webworker.importscripts.d.ts | 2 - lib/lib.webworker.iterable.d.ts | 2 - lib/tsc.js | 3129 +++++---- lib/tsserver.js | 9233 ++++++++++++++------------ lib/tsserverlibrary.d.ts | 46 +- lib/tsserverlibrary.js | 3795 +++++++---- lib/typescript.d.ts | 46 +- lib/typescript.js | 3779 +++++++---- lib/typingsInstaller.js | 7121 +++----------------- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 85 files changed, 12704 insertions(+), 14832 deletions(-) diff --git a/lib/lib.d.ts b/lib/lib.d.ts index 9152c4dfcef7e..b6bb44b2cafff 100644 --- a/lib/lib.d.ts +++ b/lib/lib.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.decorators.d.ts b/lib/lib.decorators.d.ts index d2b6b29a63ce1..2d2b4ee2af880 100644 --- a/lib/lib.decorators.d.ts +++ b/lib/lib.decorators.d.ts @@ -14,12 +14,10 @@ and limitations under the License. ***************************************************************************** */ - /// - /** - * The decorator context types provided to class member decorators. + * The decorator context types provided to class element decorators. */ type ClassMemberDecoratorContext = | ClassMethodDecoratorContext @@ -80,34 +78,37 @@ interface ClassMethodDecoratorContext< This = unknown, Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any, > { - /** The kind of class member that was decorated. */ + /** The kind of class element that was decorated. */ readonly kind: "method"; - /** The name of the decorated class member. */ + /** The name of the decorated class element. */ readonly name: string | symbol; - /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ readonly static: boolean; - /** A value indicating whether the class member has a private name. */ + /** A value indicating whether the class element has a private name. */ readonly private: boolean; - // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 - // /** An object that can be used to access the current value of the class member at runtime. */ - // readonly access: { - // /** - // * Gets the current value of the method from the provided receiver. - // * - // * @example - // * let fn = context.access.get.call(instance); - // */ - // get(this: This): Value; - // }; + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Gets the current value of the method from the provided object. + * + * @example + * let fn = context.access.get(instance); + */ + get(object: This): Value; + }; /** * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` member), or before instance initializers are run (when - * decorating a non-`static` member). + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). * * @example * ```ts @@ -141,34 +142,37 @@ interface ClassGetterDecoratorContext< This = unknown, Value = unknown, > { - /** The kind of class member that was decorated. */ + /** The kind of class element that was decorated. */ readonly kind: "getter"; - /** The name of the decorated class member. */ + /** The name of the decorated class element. */ readonly name: string | symbol; - /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ readonly static: boolean; - /** A value indicating whether the class member has a private name. */ + /** A value indicating whether the class element has a private name. */ readonly private: boolean; - // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 - // /** An object that can be used to access the current value of the class member at runtime. */ - // readonly access: { - // /** - // * Invokes the getter on the provided receiver. - // * - // * @example - // * let value = context.access.get.call(instance); - // */ - // get(this: This): Value; - // }; + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Invokes the getter on the provided object. + * + * @example + * let value = context.access.get(instance); + */ + get(object: This): Value; + }; /** * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` member), or before instance initializers are run (when - * decorating a non-`static` member). + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). */ addInitializer(initializer: (this: This) => void): void; } @@ -183,34 +187,37 @@ interface ClassSetterDecoratorContext< This = unknown, Value = unknown, > { - /** The kind of class member that was decorated. */ + /** The kind of class element that was decorated. */ readonly kind: "setter"; - /** The name of the decorated class member. */ + /** The name of the decorated class element. */ readonly name: string | symbol; - /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ readonly static: boolean; - /** A value indicating whether the class member has a private name. */ + /** A value indicating whether the class element has a private name. */ readonly private: boolean; - // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 - /** An object that can be used to access the current value of the class member at runtime. */ - // readonly access: { - // /** - // * Invokes the setter on the provided receiver. - // * - // * @example - // * context.access.set.call(instance, value); - // */ - // set(this: This, value: Value): void; - // }; + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Invokes the setter on the provided object. + * + * @example + * context.access.set(instance, value); + */ + set(object: This, value: Value): void; + }; /** * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` member), or before instance initializers are run (when - * decorating a non-`static` member). + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). */ addInitializer(initializer: (this: This) => void): void; } @@ -225,42 +232,46 @@ interface ClassAccessorDecoratorContext< This = unknown, Value = unknown, > { - /** The kind of class member that was decorated. */ + /** The kind of class element that was decorated. */ readonly kind: "accessor"; - /** The name of the decorated class member. */ + /** The name of the decorated class element. */ readonly name: string | symbol; - /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ readonly static: boolean; - /** A value indicating whether the class member has a private name. */ + /** A value indicating whether the class element has a private name. */ readonly private: boolean; - // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 - // /** An object that can be used to access the current value of the class member at runtime. */ - // readonly access: { - // /** - // * Invokes the getter on the provided receiver. - // * - // * @example - // * let value = context.access.get.call(instance); - // */ - // get(this: This): Value; - - // /** - // * Invokes the setter on the provided receiver. - // * - // * @example - // * context.access.set.call(instance, value); - // */ - // set(this: This, value: Value): void; - // }; + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + + /** + * Invokes the getter on the provided object. + * + * @example + * let value = context.access.get(instance); + */ + get(object: This): Value; + + /** + * Invokes the setter on the provided object. + * + * @example + * context.access.set(instance, value); + */ + set(object: This, value: Value): void; + }; /** * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` member), or before instance initializers are run (when - * decorating a non-`static` member). + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). */ addInitializer(initializer: (this: This) => void): void; } @@ -322,36 +333,40 @@ interface ClassFieldDecoratorContext< This = unknown, Value = unknown, > { - /** The kind of class member that was decorated. */ + /** The kind of class element that was decorated. */ readonly kind: "field"; - /** The name of the decorated class member. */ + /** The name of the decorated class element. */ readonly name: string | symbol; - /** A value indicating whether the class member is a static (`true`) or instance (`false`) member. */ + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ readonly static: boolean; - /** A value indicating whether the class member has a private name. */ + /** A value indicating whether the class element has a private name. */ readonly private: boolean; - // NOTE: Disabled, pending the outcome of https://github.com/tc39/proposal-decorators/issues/494 - // /** An object that can be used to access the current value of the class member at runtime. */ - // readonly access: { - // /** - // * Gets the value of the field on the provided receiver. - // */ - // get(this: This): Value; + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + + /** + * Gets the value of the field on the provided object. + */ + get(object: This): Value; - // /** - // * Sets the value of the field on the provided receiver. - // */ - // set(this: This, value: Value): void; - // }; + /** + * Sets the value of the field on the provided object. + */ + set(object: This, value: Value): void; + }; /** * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` member), or before instance initializers are run (when - * decorating a non-`static` member). + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). */ addInitializer(initializer: (this: This) => void): void; } diff --git a/lib/lib.decorators.legacy.d.ts b/lib/lib.decorators.legacy.d.ts index e8783bef48a15..39bf2413e2baa 100644 --- a/lib/lib.decorators.legacy.d.ts +++ b/lib/lib.decorators.legacy.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - declare type ClassDecorator = (target: TFunction) => TFunction | void; declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts index a1bc18a50cb5b..4a1be1170b5f3 100644 --- a/lib/lib.dom.d.ts +++ b/lib/lib.dom.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - ///////////////////////////// /// Window APIs ///////////////////////////// diff --git a/lib/lib.dom.iterable.d.ts b/lib/lib.dom.iterable.d.ts index 3e0340d61ea38..56d6fdcbcd63d 100644 --- a/lib/lib.dom.iterable.d.ts +++ b/lib/lib.dom.iterable.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - ///////////////////////////// /// Window Iterable APIs ///////////////////////////// diff --git a/lib/lib.es2015.collection.d.ts b/lib/lib.es2015.collection.d.ts index c2e7733ae54b4..8528c77251c3d 100644 --- a/lib/lib.es2015.collection.d.ts +++ b/lib/lib.es2015.collection.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Map { clear(): void; diff --git a/lib/lib.es2015.core.d.ts b/lib/lib.es2015.core.d.ts index c585d071b1ff6..ecd2e029ef0f8 100644 --- a/lib/lib.es2015.core.d.ts +++ b/lib/lib.es2015.core.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Array { /** * Returns the value of the first element in the array where predicate is true, and undefined diff --git a/lib/lib.es2015.d.ts b/lib/lib.es2015.d.ts index 791284b6dad0b..74b440fd8b132 100644 --- a/lib/lib.es2015.d.ts +++ b/lib/lib.es2015.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2015.generator.d.ts b/lib/lib.es2015.generator.d.ts index 78f9fd5bd430a..716bac29c1966 100644 --- a/lib/lib.es2015.generator.d.ts +++ b/lib/lib.es2015.generator.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface Generator extends Iterator { diff --git a/lib/lib.es2015.iterable.d.ts b/lib/lib.es2015.iterable.d.ts index 8a7292383442d..31be935fea29c 100644 --- a/lib/lib.es2015.iterable.d.ts +++ b/lib/lib.es2015.iterable.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface SymbolConstructor { diff --git a/lib/lib.es2015.promise.d.ts b/lib/lib.es2015.promise.d.ts index 685f7164f5d61..cd2adb675b736 100644 --- a/lib/lib.es2015.promise.d.ts +++ b/lib/lib.es2015.promise.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface PromiseConstructor { /** * A reference to the prototype. diff --git a/lib/lib.es2015.proxy.d.ts b/lib/lib.es2015.proxy.d.ts index 8c465ab06a0e2..22a0c174600b0 100644 --- a/lib/lib.es2015.proxy.d.ts +++ b/lib/lib.es2015.proxy.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface ProxyHandler { /** * A trap method for a function call. diff --git a/lib/lib.es2015.reflect.d.ts b/lib/lib.es2015.reflect.d.ts index 2e2b3893d4d51..3ee27b5250b6a 100644 --- a/lib/lib.es2015.reflect.d.ts +++ b/lib/lib.es2015.reflect.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - declare namespace Reflect { /** * Calls the function with the specified object as the this value diff --git a/lib/lib.es2015.symbol.d.ts b/lib/lib.es2015.symbol.d.ts index 253d2806ce7b0..4b529a53539aa 100644 --- a/lib/lib.es2015.symbol.d.ts +++ b/lib/lib.es2015.symbol.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface SymbolConstructor { /** * A reference to the prototype. diff --git a/lib/lib.es2015.symbol.wellknown.d.ts b/lib/lib.es2015.symbol.wellknown.d.ts index 81e052bf26d27..f2d9b4f0a0973 100644 --- a/lib/lib.es2015.symbol.wellknown.d.ts +++ b/lib/lib.es2015.symbol.wellknown.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface SymbolConstructor { @@ -76,7 +74,7 @@ interface SymbolConstructor { readonly toStringTag: unique symbol; /** - * An Object whose own property names are property names that are excluded from the 'with' + * An Object whose truthy properties are properties that are excluded from the 'with' * environment bindings of the associated objects. */ readonly unscopables: unique symbol; @@ -93,17 +91,21 @@ interface Symbol { interface Array { /** - * Returns an object whose properties have the value 'true' + * Is an object whose properties have the value 'true' + * when they will be absent when used in a 'with' statement. + */ + readonly [Symbol.unscopables]: { + [K in keyof any[]]?: boolean; + }; +} + +interface ReadonlyArray { + /** + * Is an object whose properties have the value 'true' * when they will be absent when used in a 'with' statement. */ - [Symbol.unscopables](): { - copyWithin: boolean; - entries: boolean; - fill: boolean; - find: boolean; - findIndex: boolean; - keys: boolean; - values: boolean; + readonly [Symbol.unscopables]: { + [K in keyof readonly any[]]?: boolean; }; } diff --git a/lib/lib.es2016.array.include.d.ts b/lib/lib.es2016.array.include.d.ts index 6bc6ef30e7e42..8acbe4aeb38fd 100644 --- a/lib/lib.es2016.array.include.d.ts +++ b/lib/lib.es2016.array.include.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Array { /** * Determines whether an array includes a certain element, returning true or false as appropriate. diff --git a/lib/lib.es2016.d.ts b/lib/lib.es2016.d.ts index ade8175f52cd1..795703948bac4 100644 --- a/lib/lib.es2016.d.ts +++ b/lib/lib.es2016.d.ts @@ -14,9 +14,7 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// \ No newline at end of file diff --git a/lib/lib.es2016.full.d.ts b/lib/lib.es2016.full.d.ts index ad61d232522c1..d50bde9dd02b6 100644 --- a/lib/lib.es2016.full.d.ts +++ b/lib/lib.es2016.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2017.d.ts b/lib/lib.es2017.d.ts index d89f58071b0cb..bbeabf42255ff 100644 --- a/lib/lib.es2017.d.ts +++ b/lib/lib.es2017.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2017.full.d.ts b/lib/lib.es2017.full.d.ts index f57c645c5c76f..07a98db084c64 100644 --- a/lib/lib.es2017.full.d.ts +++ b/lib/lib.es2017.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2017.intl.d.ts b/lib/lib.es2017.intl.d.ts index c2ab43e8fc304..628d7f5339b9f 100644 --- a/lib/lib.es2017.intl.d.ts +++ b/lib/lib.es2017.intl.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - declare namespace Intl { interface DateTimeFormatPartTypesRegistry { diff --git a/lib/lib.es2017.object.d.ts b/lib/lib.es2017.object.d.ts index 4900d9261e2f0..fd7dd4d926c3c 100644 --- a/lib/lib.es2017.object.d.ts +++ b/lib/lib.es2017.object.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface ObjectConstructor { /** * Returns an array of values of the enumerable properties of an object diff --git a/lib/lib.es2017.sharedmemory.d.ts b/lib/lib.es2017.sharedmemory.d.ts index 3a4ea26bd49be..a46c5ccb13d7d 100644 --- a/lib/lib.es2017.sharedmemory.d.ts +++ b/lib/lib.es2017.sharedmemory.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// diff --git a/lib/lib.es2017.string.d.ts b/lib/lib.es2017.string.d.ts index 4b219e6c5c570..e3a3c1a375eab 100644 --- a/lib/lib.es2017.string.d.ts +++ b/lib/lib.es2017.string.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface String { /** * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. diff --git a/lib/lib.es2017.typedarrays.d.ts b/lib/lib.es2017.typedarrays.d.ts index ac6984100f5c3..2182ec12f8884 100644 --- a/lib/lib.es2017.typedarrays.d.ts +++ b/lib/lib.es2017.typedarrays.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Int8ArrayConstructor { new (): Int8Array; } diff --git a/lib/lib.es2018.asyncgenerator.d.ts b/lib/lib.es2018.asyncgenerator.d.ts index 546a8c2e99613..092a34f010149 100644 --- a/lib/lib.es2018.asyncgenerator.d.ts +++ b/lib/lib.es2018.asyncgenerator.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface AsyncGenerator extends AsyncIterator { diff --git a/lib/lib.es2018.asynciterable.d.ts b/lib/lib.es2018.asynciterable.d.ts index 88f9d8fbab16e..6d2e226def595 100644 --- a/lib/lib.es2018.asynciterable.d.ts +++ b/lib/lib.es2018.asynciterable.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// diff --git a/lib/lib.es2018.d.ts b/lib/lib.es2018.d.ts index db0a3d1b027cf..7751029910020 100644 --- a/lib/lib.es2018.d.ts +++ b/lib/lib.es2018.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2018.full.d.ts b/lib/lib.es2018.full.d.ts index b517dc59003f5..7bc5e011c5e11 100644 --- a/lib/lib.es2018.full.d.ts +++ b/lib/lib.es2018.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2018.intl.d.ts b/lib/lib.es2018.intl.d.ts index 97c0eedb069f5..56eb9228996f9 100644 --- a/lib/lib.es2018.intl.d.ts +++ b/lib/lib.es2018.intl.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - declare namespace Intl { // http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories diff --git a/lib/lib.es2018.promise.d.ts b/lib/lib.es2018.promise.d.ts index 1a95d7c87c053..e5044b766aac2 100644 --- a/lib/lib.es2018.promise.d.ts +++ b/lib/lib.es2018.promise.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /** * Represents the completion of an asynchronous operation */ diff --git a/lib/lib.es2018.regexp.d.ts b/lib/lib.es2018.regexp.d.ts index 9cb3710b5d354..9464390a97557 100644 --- a/lib/lib.es2018.regexp.d.ts +++ b/lib/lib.es2018.regexp.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface RegExpMatchArray { groups?: { [key: string]: string diff --git a/lib/lib.es2019.array.d.ts b/lib/lib.es2019.array.d.ts index 1607483465a27..a293248d8c381 100644 --- a/lib/lib.es2019.array.d.ts +++ b/lib/lib.es2019.array.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - type FlatArray = { "done": Arr, "recur": Arr extends ReadonlyArray diff --git a/lib/lib.es2019.d.ts b/lib/lib.es2019.d.ts index 77d3d6b5f093f..8a26e9fd19018 100644 --- a/lib/lib.es2019.d.ts +++ b/lib/lib.es2019.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2019.full.d.ts b/lib/lib.es2019.full.d.ts index 1ebdb1fe0be8c..e3ae1a6a13f88 100644 --- a/lib/lib.es2019.full.d.ts +++ b/lib/lib.es2019.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2019.intl.d.ts b/lib/lib.es2019.intl.d.ts index fe17c7cd7194d..1018481898e3c 100644 --- a/lib/lib.es2019.intl.d.ts +++ b/lib/lib.es2019.intl.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - declare namespace Intl { interface DateTimeFormatPartTypesRegistry { unknown: any diff --git a/lib/lib.es2019.object.d.ts b/lib/lib.es2019.object.d.ts index 09b937af044f8..fdfab8ecbe775 100644 --- a/lib/lib.es2019.object.d.ts +++ b/lib/lib.es2019.object.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface ObjectConstructor { diff --git a/lib/lib.es2019.string.d.ts b/lib/lib.es2019.string.d.ts index c7150833bc69a..8011c9fcf78c6 100644 --- a/lib/lib.es2019.string.d.ts +++ b/lib/lib.es2019.string.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface String { /** Removes the trailing white space and line terminator characters from a string. */ trimEnd(): string; diff --git a/lib/lib.es2019.symbol.d.ts b/lib/lib.es2019.symbol.d.ts index 58b38d5f9db20..4b4bdb82f0a1f 100644 --- a/lib/lib.es2019.symbol.d.ts +++ b/lib/lib.es2019.symbol.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Symbol { /** * Expose the [[Description]] internal slot of a symbol directly. diff --git a/lib/lib.es2020.bigint.d.ts b/lib/lib.es2020.bigint.d.ts index a0ebccaf9ca77..73df22e21ebf7 100644 --- a/lib/lib.es2020.bigint.d.ts +++ b/lib/lib.es2020.bigint.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface BigIntToLocaleStringOptions { diff --git a/lib/lib.es2020.d.ts b/lib/lib.es2020.d.ts index ae81c40b46a3d..937da6bcad093 100644 --- a/lib/lib.es2020.d.ts +++ b/lib/lib.es2020.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2020.date.d.ts b/lib/lib.es2020.date.d.ts index 8eeb6b981dd39..1e0470aa690fe 100644 --- a/lib/lib.es2020.date.d.ts +++ b/lib/lib.es2020.date.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface Date { diff --git a/lib/lib.es2020.full.d.ts b/lib/lib.es2020.full.d.ts index 165b566d24f6f..5fa8b55c52806 100644 --- a/lib/lib.es2020.full.d.ts +++ b/lib/lib.es2020.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2020.intl.d.ts b/lib/lib.es2020.intl.d.ts index 5ee8e4cdc414b..71093d30f13d1 100644 --- a/lib/lib.es2020.intl.d.ts +++ b/lib/lib.es2020.intl.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// declare namespace Intl { diff --git a/lib/lib.es2020.number.d.ts b/lib/lib.es2020.number.d.ts index 89f6a2723d365..f1a01bae03ef6 100644 --- a/lib/lib.es2020.number.d.ts +++ b/lib/lib.es2020.number.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface Number { diff --git a/lib/lib.es2020.promise.d.ts b/lib/lib.es2020.promise.d.ts index 8107144efe00c..1a05d75c008e3 100644 --- a/lib/lib.es2020.promise.d.ts +++ b/lib/lib.es2020.promise.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface PromiseFulfilledResult { status: "fulfilled"; value: T; diff --git a/lib/lib.es2020.sharedmemory.d.ts b/lib/lib.es2020.sharedmemory.d.ts index f86c5ad50b488..3c7c14f4bdf76 100644 --- a/lib/lib.es2020.sharedmemory.d.ts +++ b/lib/lib.es2020.sharedmemory.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Atomics { /** * Adds a value to the value at the given position in the array, returning the original value. diff --git a/lib/lib.es2020.string.d.ts b/lib/lib.es2020.string.d.ts index 19c730752fbb3..ed6a7ff4e279a 100644 --- a/lib/lib.es2020.string.d.ts +++ b/lib/lib.es2020.string.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// interface String { diff --git a/lib/lib.es2020.symbol.wellknown.d.ts b/lib/lib.es2020.symbol.wellknown.d.ts index 7df0a2f45774a..89262b74c98fc 100644 --- a/lib/lib.es2020.symbol.wellknown.d.ts +++ b/lib/lib.es2020.symbol.wellknown.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// diff --git a/lib/lib.es2021.d.ts b/lib/lib.es2021.d.ts index 74b5288d103b4..0d1ffaa63500b 100644 --- a/lib/lib.es2021.d.ts +++ b/lib/lib.es2021.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2021.full.d.ts b/lib/lib.es2021.full.d.ts index 53488737712c8..dd10e3ef1b744 100644 --- a/lib/lib.es2021.full.d.ts +++ b/lib/lib.es2021.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2021.intl.d.ts b/lib/lib.es2021.intl.d.ts index 9a8ac5593b56b..ac9ffdb7e746d 100644 --- a/lib/lib.es2021.intl.d.ts +++ b/lib/lib.es2021.intl.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - declare namespace Intl { interface DateTimeFormatPartTypesRegistry { diff --git a/lib/lib.es2021.promise.d.ts b/lib/lib.es2021.promise.d.ts index e3db43ffafd45..6ef98b6383ab2 100644 --- a/lib/lib.es2021.promise.d.ts +++ b/lib/lib.es2021.promise.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface AggregateError extends Error { errors: any[] } diff --git a/lib/lib.es2021.string.d.ts b/lib/lib.es2021.string.d.ts index 89b27e2fe9094..563ee82d2dacc 100644 --- a/lib/lib.es2021.string.d.ts +++ b/lib/lib.es2021.string.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface String { /** * Replace all instances of a substring in a string, using a regular expression or search string. diff --git a/lib/lib.es2021.weakref.d.ts b/lib/lib.es2021.weakref.d.ts index eb7764242d7b9..9ff32d0ddad05 100644 --- a/lib/lib.es2021.weakref.d.ts +++ b/lib/lib.es2021.weakref.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface WeakRef { readonly [Symbol.toStringTag]: "WeakRef"; diff --git a/lib/lib.es2022.array.d.ts b/lib/lib.es2022.array.d.ts index 1c117c530af89..621857ba0878c 100644 --- a/lib/lib.es2022.array.d.ts +++ b/lib/lib.es2022.array.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Array { /** * Returns the item located at the specified index. diff --git a/lib/lib.es2022.d.ts b/lib/lib.es2022.d.ts index baf7b0b344e64..2ae78aba3f6b6 100644 --- a/lib/lib.es2022.d.ts +++ b/lib/lib.es2022.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2022.error.d.ts b/lib/lib.es2022.error.d.ts index 4b16e09121d45..1888f3079fb22 100644 --- a/lib/lib.es2022.error.d.ts +++ b/lib/lib.es2022.error.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface ErrorOptions { cause?: unknown; } diff --git a/lib/lib.es2022.full.d.ts b/lib/lib.es2022.full.d.ts index 19e78d48de5f6..12c8d73777a46 100644 --- a/lib/lib.es2022.full.d.ts +++ b/lib/lib.es2022.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es2022.intl.d.ts b/lib/lib.es2022.intl.d.ts index ff487a11c955c..96200eff93f86 100644 --- a/lib/lib.es2022.intl.d.ts +++ b/lib/lib.es2022.intl.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - declare namespace Intl { /** diff --git a/lib/lib.es2022.object.d.ts b/lib/lib.es2022.object.d.ts index 2fe2a1917f15e..25b64c97c1081 100644 --- a/lib/lib.es2022.object.d.ts +++ b/lib/lib.es2022.object.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface ObjectConstructor { /** * Determines whether an object has a property with the specified name. diff --git a/lib/lib.es2022.regexp.d.ts b/lib/lib.es2022.regexp.d.ts index fdb0ea6007aa3..88ebbce9b6b31 100644 --- a/lib/lib.es2022.regexp.d.ts +++ b/lib/lib.es2022.regexp.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface RegExpMatchArray { indices?: RegExpIndicesArray; } diff --git a/lib/lib.es2022.sharedmemory.d.ts b/lib/lib.es2022.sharedmemory.d.ts index f3661cf87923e..5126a4b58e6eb 100644 --- a/lib/lib.es2022.sharedmemory.d.ts +++ b/lib/lib.es2022.sharedmemory.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Atomics { /** * A non-blocking, asynchronous version of wait which is usable on the main thread. diff --git a/lib/lib.es2022.string.d.ts b/lib/lib.es2022.string.d.ts index fbfc17f16d8d0..a7868f178eec8 100644 --- a/lib/lib.es2022.string.d.ts +++ b/lib/lib.es2022.string.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface String { /** * Returns a new String consisting of the single UTF-16 code unit located at the specified index. diff --git a/lib/lib.es2023.array.d.ts b/lib/lib.es2023.array.d.ts index cd6dee2825211..9b01b26bdeb16 100644 --- a/lib/lib.es2023.array.d.ts +++ b/lib/lib.es2023.array.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - interface Array { /** * Returns the value of the last element in the array where predicate is true, and undefined diff --git a/lib/lib.es2023.d.ts b/lib/lib.es2023.d.ts index 3cd069499be71..d8e06577462c3 100644 --- a/lib/lib.es2023.d.ts +++ b/lib/lib.es2023.d.ts @@ -14,9 +14,7 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// diff --git a/lib/lib.es2023.full.d.ts b/lib/lib.es2023.full.d.ts index 66ee8a719a072..5cdfd5ca80246 100644 --- a/lib/lib.es2023.full.d.ts +++ b/lib/lib.es2023.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index 7ce8e4a1b179c..e1fc0f44535da 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// diff --git a/lib/lib.es6.d.ts b/lib/lib.es6.d.ts index fabf4386173ae..36c71160fb5fd 100644 --- a/lib/lib.es6.d.ts +++ b/lib/lib.es6.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.esnext.d.ts b/lib/lib.esnext.d.ts index 822b0182f17a4..e04d1f8b73626 100644 --- a/lib/lib.esnext.d.ts +++ b/lib/lib.esnext.d.ts @@ -14,9 +14,7 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// diff --git a/lib/lib.esnext.full.d.ts b/lib/lib.esnext.full.d.ts index be12ba8e47718..d5308f3b89897 100644 --- a/lib/lib.esnext.full.d.ts +++ b/lib/lib.esnext.full.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - /// /// /// diff --git a/lib/lib.esnext.intl.d.ts b/lib/lib.esnext.intl.d.ts index 0eaac02b97688..4f1cee2f54d8a 100644 --- a/lib/lib.esnext.intl.d.ts +++ b/lib/lib.esnext.intl.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - declare namespace Intl { interface NumberRangeFormatPart extends NumberFormatPart { source: "startRange" | "endRange" | "shared" diff --git a/lib/lib.scripthost.d.ts b/lib/lib.scripthost.d.ts index 8ac760bab4735..14cebb5314f77 100644 --- a/lib/lib.scripthost.d.ts +++ b/lib/lib.scripthost.d.ts @@ -14,12 +14,10 @@ and limitations under the License. ***************************************************************************** */ - /// - ///////////////////////////// /// Windows Script Host APIS ///////////////////////////// diff --git a/lib/lib.webworker.d.ts b/lib/lib.webworker.d.ts index 2329afedbc247..6b995a42c17b7 100644 --- a/lib/lib.webworker.d.ts +++ b/lib/lib.webworker.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - ///////////////////////////// /// Worker APIs ///////////////////////////// diff --git a/lib/lib.webworker.importscripts.d.ts b/lib/lib.webworker.importscripts.d.ts index 73bd281664b04..5ca328c567cee 100644 --- a/lib/lib.webworker.importscripts.d.ts +++ b/lib/lib.webworker.importscripts.d.ts @@ -14,11 +14,9 @@ and limitations under the License. ***************************************************************************** */ - /// - ///////////////////////////// /// WorkerGlobalScope APIs ///////////////////////////// diff --git a/lib/lib.webworker.iterable.d.ts b/lib/lib.webworker.iterable.d.ts index b8035985329ab..e84c89d49b00f 100644 --- a/lib/lib.webworker.iterable.d.ts +++ b/lib/lib.webworker.iterable.d.ts @@ -14,10 +14,8 @@ and limitations under the License. ***************************************************************************** */ - /// - ///////////////////////////// /// Worker Iterable APIs ///////////////////////////// diff --git a/lib/tsc.js b/lib/tsc.js index 26516cd868574..92bf3cf998750 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -23,7 +23,7 @@ var __export = (target, all) => { // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.0-beta`; +var version = `${versionMajorMinor}.1-rc`; // src/compiler/core.ts var emptyArray = []; @@ -614,6 +614,12 @@ function first(array) { Debug.assert(array.length !== 0); return array[0]; } +function firstIterator(iter) { + for (const value of iter) { + return value; + } + Debug.fail("iterator is empty"); +} function lastOrUndefined(array) { return array === void 0 || array.length === 0 ? void 0 : array[array.length - 1]; } @@ -2676,7 +2682,7 @@ var nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerforma function tryGetNativePerformanceHooks() { return nativePerformanceHooks; } -var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +new Date(); +var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date(); // src/compiler/perfLogger.ts var nullLogger = { @@ -2769,6 +2775,9 @@ function mark(markName) { counts.set(markName, count + 1); marks.set(markName, timestamp()); performanceImpl == null ? void 0 : performanceImpl.mark(markName); + if (typeof onProfilerEvent === "function") { + onProfilerEvent(markName); + } } } function measure(measureName, startMarkName, endMarkName) { @@ -3739,13 +3748,14 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => { TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; - TypeFlags2[TypeFlags2["Unit"] = 109440] = "Unit"; + TypeFlags2[TypeFlags2["Unit"] = 109472] = "Unit"; + TypeFlags2[TypeFlags2["Freshable"] = 2976] = "Freshable"; TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; - TypeFlags2[TypeFlags2["Primitive"] = 131068] = "Primitive"; + TypeFlags2[TypeFlags2["Primitive"] = 134348796] = "Primitive"; TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; @@ -4028,7 +4038,7 @@ var PollingInterval = /* @__PURE__ */ ((PollingInterval3) => { PollingInterval3[PollingInterval3["Low"] = 250] = "Low"; return PollingInterval3; })(PollingInterval || {}); -var missingFileModifiedTime = new Date(0); +var missingFileModifiedTime = /* @__PURE__ */ new Date(0); function getModifiedTime(host, fileName) { return host.getModifiedTime(fileName) || missingFileModifiedTime; } @@ -4253,7 +4263,7 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { const watcher = fsWatch( dirName, - FileSystemEntryKind.Directory, + 1 /* Directory */, (_eventName, relativeFileName, modifiedTime) => { if (!isString(relativeFileName)) return; @@ -4453,7 +4463,7 @@ function createDirectoryWatcherSupportingRecursive({ } function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { const parentWatcher = cache.get(dirPath); - if (parentWatcher && fileSystemEntryExists(dirName, FileSystemEntryKind.Directory)) { + if (parentWatcher && fileSystemEntryExists(dirName, 1 /* Directory */)) { scheduleUpdateChildWatches(dirName, dirPath, fileName, options); return; } @@ -4518,7 +4528,7 @@ function createDirectoryWatcherSupportingRecursive({ return false; let newChildWatches; const hasChanges = enumerateInsertsAndDeletes( - fileSystemEntryExists(parentDir, FileSystemEntryKind.Directory) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { + fileSystemEntryExists(parentDir, 1 /* Directory */) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { const childFullName = getNormalizedAbsolutePath(child, parentDir); return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath(childFullName))) === 0 /* EqualTo */ ? childFullName : void 0; }) : emptyArray, @@ -4549,11 +4559,6 @@ function createDirectoryWatcherSupportingRecursive({ return stringContains(toCanonicalFilePath(path), searchPath); } } -var FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => { - FileSystemEntryKind2[FileSystemEntryKind2["File"] = 0] = "File"; - FileSystemEntryKind2[FileSystemEntryKind2["Directory"] = 1] = "Directory"; - return FileSystemEntryKind2; -})(FileSystemEntryKind || {}); function createFileWatcherCallback(callback) { return (_fileName, eventKind, modifiedTime) => callback(eventKind === 1 /* Changed */ ? "change" : "rename", "", modifiedTime); } @@ -5123,7 +5128,7 @@ var sys = (() => { if (!err) { try { if ((_a2 = statSync(profilePath)) == null ? void 0 : _a2.isDirectory()) { - profilePath = _path.join(profilePath, `${new Date().toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); + profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); } } catch (e) { } @@ -6048,7 +6053,6 @@ var Diagnostics = { Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), - Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."), A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), @@ -6177,6 +6181,7 @@ var Diagnostics = { To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -6570,7 +6575,6 @@ var Diagnostics = { Cannot_find_type_definition_file_for_0: diag(2688, 1 /* Error */, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), - An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, 1 /* Error */, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), @@ -6694,7 +6698,7 @@ var Diagnostics = { Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."), A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), - Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."), + Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."), Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), @@ -6886,13 +6890,11 @@ var Diagnostics = { The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), - Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), + Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."), Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), - Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), + Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), @@ -6980,7 +6982,7 @@ var Diagnostics = { Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."), File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."), - File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."), + File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."), Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."), Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), @@ -7270,6 +7272,11 @@ var Diagnostics = { Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."), Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."), true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."), + Entering_conditional_exports: diag(6413, 3 /* Message */, "Entering_conditional_exports_6413", "Entering conditional exports."), + Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."), + Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."), + Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), @@ -7431,6 +7438,7 @@ var Diagnostics = { new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), + This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."), Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), @@ -7528,7 +7536,7 @@ var Diagnostics = { You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), - Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), + Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -8457,18 +8465,18 @@ function isIdentifierText(name, languageVersion, identifierVariant) { return true; } function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start, length2) { - let text = textInitial; - let pos; - let end; - let startPos; - let tokenPos; - let token; - let tokenValue; - let tokenFlags; - let commentDirectives; - let inJSDocType = 0; + var text = textInitial; + var pos; + var end; + var startPos; + var tokenPos; + var token; + var tokenValue; + var tokenFlags; + var commentDirectives; + var inJSDocType = 0; setText(text, start, length2); - const scanner = { + var scanner = { getStartPos: () => startPos, getTextPos: () => pos, getToken: () => token, @@ -10707,6 +10715,9 @@ function isFunctionLikeOrClassStaticBlockDeclaration(node) { function isFunctionLikeDeclaration(node) { return node && isFunctionLikeDeclarationKind(node.kind); } +function isBooleanLiteral(node) { + return node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */; +} function isFunctionLikeDeclarationKind(kind) { switch (kind) { case 259 /* FunctionDeclaration */: @@ -11316,7 +11327,7 @@ function isTransientSymbol(symbol) { } var stringWriter = createSingleLineStringWriter(); function createSingleLineStringWriter() { - let str = ""; + var str = ""; const writeText = (text) => str += text; return { getText: () => str, @@ -11645,101 +11656,400 @@ function getInternalEmitFlags(node) { return emitNode && emitNode.internalFlags || 0; } function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: emptyArray, - AsyncIterator: emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: emptyArray, - SharedArrayBuffer: emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: emptyArray, - AsyncIterableIterator: emptyArray, - AsyncGenerator: emptyArray, - AsyncGeneratorFunction: emptyArray, - NumberFormat: ["formatToParts"] - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: emptyArray, - BigInt64Array: emptyArray, - BigUint64Array: emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - es2021: { - PromiseConstructor: ["any"], - String: ["replaceAll"] - }, - es2022: { - Array: ["at"], - String: ["at"], - Int8Array: ["at"], - Uint8Array: ["at"], - Uint8ClampedArray: ["at"], - Int16Array: ["at"], - Uint16Array: ["at"], - Int32Array: ["at"], - Uint32Array: ["at"], - Float32Array: ["at"], - Float64Array: ["at"], - BigInt64Array: ["at"], - BigUint64Array: ["at"], - ObjectConstructor: ["hasOwn"], - Error: ["cause"] - }, - es2023: { - Array: ["findLastIndex", "findLast"], - Int8Array: ["findLastIndex", "findLast"], - Uint8Array: ["findLastIndex", "findLast"], - Uint8ClampedArray: ["findLastIndex", "findLast"], - Int16Array: ["findLastIndex", "findLast"], - Uint16Array: ["findLastIndex", "findLast"], - Int32Array: ["findLastIndex", "findLast"], - Uint32Array: ["findLastIndex", "findLast"], - Float32Array: ["findLastIndex", "findLast"], - Float64Array: ["findLastIndex", "findLast"], - BigInt64Array: ["findLastIndex", "findLast"], - BigUint64Array: ["findLastIndex", "findLast"] - } - }; + return new Map(Object.entries({ + Array: new Map(Object.entries({ + es2015: [ + "find", + "findIndex", + "fill", + "copyWithin", + "entries", + "keys", + "values" + ], + es2016: [ + "includes" + ], + es2019: [ + "flat", + "flatMap" + ], + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Iterator: new Map(Object.entries({ + es2015: emptyArray + })), + AsyncIterator: new Map(Object.entries({ + es2015: emptyArray + })), + Atomics: new Map(Object.entries({ + es2017: emptyArray + })), + SharedArrayBuffer: new Map(Object.entries({ + es2017: emptyArray + })), + AsyncIterable: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncIterableIterator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGenerator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGeneratorFunction: new Map(Object.entries({ + es2018: emptyArray + })), + RegExp: new Map(Object.entries({ + es2015: [ + "flags", + "sticky", + "unicode" + ], + es2018: [ + "dotAll" + ] + })), + Reflect: new Map(Object.entries({ + es2015: [ + "apply", + "construct", + "defineProperty", + "deleteProperty", + "get", + " getOwnPropertyDescriptor", + "getPrototypeOf", + "has", + "isExtensible", + "ownKeys", + "preventExtensions", + "set", + "setPrototypeOf" + ] + })), + ArrayConstructor: new Map(Object.entries({ + es2015: [ + "from", + "of" + ] + })), + ObjectConstructor: new Map(Object.entries({ + es2015: [ + "assign", + "getOwnPropertySymbols", + "keys", + "is", + "setPrototypeOf" + ], + es2017: [ + "values", + "entries", + "getOwnPropertyDescriptors" + ], + es2019: [ + "fromEntries" + ], + es2022: [ + "hasOwn" + ] + })), + NumberConstructor: new Map(Object.entries({ + es2015: [ + "isFinite", + "isInteger", + "isNaN", + "isSafeInteger", + "parseFloat", + "parseInt" + ] + })), + Math: new Map(Object.entries({ + es2015: [ + "clz32", + "imul", + "sign", + "log10", + "log2", + "log1p", + "expm1", + "cosh", + "sinh", + "tanh", + "acosh", + "asinh", + "atanh", + "hypot", + "trunc", + "fround", + "cbrt" + ] + })), + Map: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + Set: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + PromiseConstructor: new Map(Object.entries({ + es2015: [ + "all", + "race", + "reject", + "resolve" + ], + es2020: [ + "allSettled" + ], + es2021: [ + "any" + ] + })), + Symbol: new Map(Object.entries({ + es2015: [ + "for", + "keyFor" + ], + es2019: [ + "description" + ] + })), + WeakMap: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + WeakSet: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + String: new Map(Object.entries({ + es2015: [ + "codePointAt", + "includes", + "endsWith", + "normalize", + "repeat", + "startsWith", + "anchor", + "big", + "blink", + "bold", + "fixed", + "fontcolor", + "fontsize", + "italics", + "link", + "small", + "strike", + "sub", + "sup" + ], + es2017: [ + "padStart", + "padEnd" + ], + es2019: [ + "trimStart", + "trimEnd", + "trimLeft", + "trimRight" + ], + es2020: [ + "matchAll" + ], + es2021: [ + "replaceAll" + ], + es2022: [ + "at" + ] + })), + StringConstructor: new Map(Object.entries({ + es2015: [ + "fromCodePoint", + "raw" + ] + })), + DateTimeFormat: new Map(Object.entries({ + es2017: [ + "formatToParts" + ] + })), + Promise: new Map(Object.entries({ + es2015: emptyArray, + es2018: [ + "finally" + ] + })), + RegExpMatchArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + RegExpExecArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + Intl: new Map(Object.entries({ + es2018: [ + "PluralRules" + ] + })), + NumberFormat: new Map(Object.entries({ + es2018: [ + "formatToParts" + ] + })), + SymbolConstructor: new Map(Object.entries({ + es2020: [ + "matchAll" + ] + })), + DataView: new Map(Object.entries({ + es2020: [ + "setBigInt64", + "setBigUint64", + "getBigInt64", + "getBigUint64" + ] + })), + BigInt: new Map(Object.entries({ + es2020: emptyArray + })), + RelativeTimeFormat: new Map(Object.entries({ + es2020: [ + "format", + "formatToParts", + "resolvedOptions" + ] + })), + Int8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8ClampedArray: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float64Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigInt64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigUint64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Error: new Map(Object.entries({ + es2022: [ + "cause" + ] + })) + })); } function getLiteralText(node, sourceFile, flags) { var _a2; @@ -11847,7 +12157,7 @@ function isCommonJSContainingModuleKind(kind) { return kind === 1 /* CommonJS */ || kind === 100 /* Node16 */ || kind === 199 /* NodeNext */; } function isEffectiveExternalModule(node, compilerOptions) { - return isExternalModule(node) || compilerOptions.isolatedModules || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; + return isExternalModule(node) || getIsolatedModules(compilerOptions) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; } function isEffectiveStrictModeSourceFile(node, compilerOptions) { switch (node.scriptKind) { @@ -11868,7 +12178,7 @@ function isEffectiveStrictModeSourceFile(node, compilerOptions) { if (startsWithUseStrict(node.statements)) { return true; } - if (isExternalModule(node) || compilerOptions.isolatedModules) { + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { if (getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */) { return true; } @@ -14293,12 +14603,12 @@ function isNightly() { return stringContains(version, "-dev") || stringContains(version, "-insiders"); } function createTextWriter(newLine) { - let output; - let indent2; - let lineStart; - let lineCount; - let linePos; - let hasTrailingComment = false; + var output; + var indent2; + var lineStart; + var lineCount; + var linePos; + var hasTrailingComment = false; function updateLineCountAndPosFor(s) { const lineStartsOfS = computeLineStarts(s); if (lineStartsOfS.length > 1) { @@ -15335,17 +15645,11 @@ function getCombinedLocalAndExportSymbolFlags(symbol) { return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags; } function isWriteOnlyAccess(node) { - return accessKind(node) === AccessKind.Write; + return accessKind(node) === 1 /* Write */; } function isWriteAccess(node) { - return accessKind(node) !== AccessKind.Read; -} -var AccessKind = /* @__PURE__ */ ((AccessKind2) => { - AccessKind2[AccessKind2["Read"] = 0] = "Read"; - AccessKind2[AccessKind2["Write"] = 1] = "Write"; - AccessKind2[AccessKind2["ReadWrite"] = 2] = "ReadWrite"; - return AccessKind2; -})(AccessKind || {}); + return accessKind(node) !== 0 /* Read */; +} function accessKind(node) { const { parent } = node; if (!parent) @@ -15438,9 +15742,6 @@ function getClassLikeDeclarationOfSymbol(symbol) { function getObjectFlags(type) { return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0; } -function typeHasCallOrConstructSignatures(type, checker) { - return checker.getSignaturesOfType(type, 0 /* Call */).length !== 0 || checker.getSignaturesOfType(type, 1 /* Construct */).length !== 0; -} function isUMDExportSymbol(symbol) { return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]); } @@ -15904,6 +16205,22 @@ function getAllowSyntheticDefaultImports(compilerOptions) { function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } +function getResolvePackageJsonExports(compilerOptions) { + const moduleResolution = getEmitModuleResolutionKind(compilerOptions); + if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { + return false; + } + if (compilerOptions.resolvePackageJsonExports !== void 0) { + return compilerOptions.resolvePackageJsonExports; + } + switch (moduleResolution) { + case 3 /* Node16 */: + case 99 /* NodeNext */: + case 100 /* Bundler */: + return true; + } + return false; +} function getResolveJsonModule(compilerOptions) { if (compilerOptions.resolveJsonModule !== void 0) { return compilerOptions.resolveJsonModule; @@ -15914,7 +16231,7 @@ function getEmitDeclarations(compilerOptions) { return !!(compilerOptions.declaration || compilerOptions.composite); } function shouldPreserveConstEnums(compilerOptions) { - return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); + return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions)); } function isIncrementalCompilation(options) { return !!(options.incremental || options.composite); @@ -16479,7 +16796,7 @@ function rangeOfNode(node) { } function rangeOfTypeParameters(sourceFile, typeParameters) { const pos = typeParameters.pos - 1; - const end = skipTrivia(sourceFile.text, typeParameters.end) + 1; + const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1); return { pos, end }; } function skipTypeChecking(sourceFile, options, host) { @@ -19517,24 +19834,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) - return 65536 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 128 /* ContainsES2018 */) { - for (const element of getElementsOfBindingOrAssignmentPattern(node)) { - const target = getTargetOfBindingOrAssignmentElement(element); - if (target && isAssignmentPattern(target)) { - if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - return 65536 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 128 /* ContainsES2018 */) { - const flags2 = propagateAssignmentPatternFlags(target); - if (flags2) - return flags2; - } - } - } - } - return 0 /* None */; + return containsObjectRestOrSpread(node) ? 65536 /* ContainsObjectRestOrSpread */ : 0 /* None */; } function updateBinaryExpression(node, left, operator, right) { return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; @@ -22486,14 +22786,114 @@ function createEmitHelperFactory(context) { factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) ]); } + function createESDecorateClassElementAccessGetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "get", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + accessor + ) + ); + } + function createESDecorateClassElementAccessSetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "set", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("value") + ) + ], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + accessor, + factory2.createIdentifier("value") + ) + ) + ]) + ) + ); + } + function createESDecorateClassElementAccessHasMethod(elementName) { + const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name; + return factory2.createPropertyAssignment( + "has", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBinaryExpression( + propertyName, + 101 /* InKeyword */, + factory2.createIdentifier("obj") + ) + ) + ); + } + function createESDecorateClassElementAccessObject(name, access) { + const properties = []; + properties.push(createESDecorateClassElementAccessHasMethod(name)); + if (access.get) + properties.push(createESDecorateClassElementAccessGetMethod(name)); + if (access.set) + properties.push(createESDecorateClassElementAccessSetMethod(name)); + return factory2.createObjectLiteralExpression(properties); + } function createESDecorateClassElementContextObject(contextIn) { return factory2.createObjectLiteralExpression([ factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), - factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()) - // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494 - // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) ]); } function createESDecorateContextObject(contextIn) { @@ -24566,7 +24966,7 @@ function canHaveIllegalDecorators(node) { } function canHaveIllegalModifiers(node) { const kind = node.kind; - return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; + return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; } function isQuestionOrExclamationToken(node) { return isQuestionToken(node) || isExclamationToken(node); @@ -24931,6 +25331,25 @@ function flattenCommaList(node) { flattenCommaListWorker(node, expressions); return expressions; } +function containsObjectRestOrSpread(node) { + if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) + return true; + if (node.transformFlags & 128 /* ContainsES2018 */) { + for (const element of getElementsOfBindingOrAssignmentPattern(node)) { + const target = getTargetOfBindingOrAssignmentElement(element); + if (target && isAssignmentPattern(target)) { + if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + return true; + } + if (target.transformFlags & 128 /* ContainsES2018 */) { + if (containsObjectRestOrSpread(target)) + return true; + } + } + } + } + return false; +} // src/compiler/factory/utilitiesPublic.ts function setTextRange(range, location) { @@ -25586,22 +26005,22 @@ function isExternalModule(file) { } var Parser; ((Parser2) => { - const scanner = createScanner( + var scanner = createScanner( 99 /* Latest */, /*skipTrivia*/ true ); - const disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; - let NodeConstructor2; - let TokenConstructor2; - let IdentifierConstructor2; - let PrivateIdentifierConstructor2; - let SourceFileConstructor2; + var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; + var NodeConstructor2; + var TokenConstructor2; + var IdentifierConstructor2; + var PrivateIdentifierConstructor2; + var SourceFileConstructor2; function countNode(node) { nodeCount++; return node; } - const baseNodeFactory = { + var baseNodeFactory = { createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2( kind, /*pos*/ @@ -25638,25 +26057,53 @@ var Parser; 0 )) }; - const factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); - let fileName; - let sourceFlags; - let sourceText; - let languageVersion; - let scriptKind; - let languageVariant; - let parseDiagnostics; - let jsDocDiagnostics; - let syntaxCursor; - let currentToken; - let nodeCount; - let identifiers; - let identifierCount; - let parsingContext; - let notParenthesizedArrow; - let contextFlags; - let topLevel = true; - let parseErrorBeforeNextFinishedNode = false; + var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); + var { + createNodeArray: factoryCreateNodeArray, + createNumericLiteral: factoryCreateNumericLiteral, + createStringLiteral: factoryCreateStringLiteral, + createLiteralLikeNode: factoryCreateLiteralLikeNode, + createIdentifier: factoryCreateIdentifier, + createPrivateIdentifier: factoryCreatePrivateIdentifier, + createToken: factoryCreateToken, + createArrayLiteralExpression: factoryCreateArrayLiteralExpression, + createObjectLiteralExpression: factoryCreateObjectLiteralExpression, + createPropertyAccessExpression: factoryCreatePropertyAccessExpression, + createPropertyAccessChain: factoryCreatePropertyAccessChain, + createElementAccessExpression: factoryCreateElementAccessExpression, + createElementAccessChain: factoryCreateElementAccessChain, + createCallExpression: factoryCreateCallExpression, + createCallChain: factoryCreateCallChain, + createNewExpression: factoryCreateNewExpression, + createParenthesizedExpression: factoryCreateParenthesizedExpression, + createBlock: factoryCreateBlock, + createVariableStatement: factoryCreateVariableStatement, + createExpressionStatement: factoryCreateExpressionStatement, + createIfStatement: factoryCreateIfStatement, + createWhileStatement: factoryCreateWhileStatement, + createForStatement: factoryCreateForStatement, + createForOfStatement: factoryCreateForOfStatement, + createVariableDeclaration: factoryCreateVariableDeclaration, + createVariableDeclarationList: factoryCreateVariableDeclarationList + } = factory2; + var fileName; + var sourceFlags; + var sourceText; + var languageVersion; + var scriptKind; + var languageVariant; + var parseDiagnostics; + var jsDocDiagnostics; + var syntaxCursor; + var currentToken; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; + var notParenthesizedArrow; + var contextFlags; + var topLevel = true; + var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) { var _a2; scriptKind2 = ensureScriptKind(fileName2, scriptKind2); @@ -25756,8 +26203,8 @@ var Parser; } } } - const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); - const statement = factory2.createExpressionStatement(expression); + const expression = isArray(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); + const statement = factoryCreateExpressionStatement(expression); finishNode(statement, pos); statements = createNodeArray([statement], pos); endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); @@ -25849,7 +26296,7 @@ var Parser; } sourceFlags = contextFlags; nextToken(); - const statements = parseList(ParsingContext.SourceElements, parseStatement); + const statements = parseList(0 /* SourceElements */, parseStatement); Debug.assert(token() === 1 /* EndOfFileToken */); const endOfFileToken = addJSDocComment(parseTokenNode()); const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); @@ -25912,7 +26359,7 @@ var Parser; nextToken(); while (token() !== 1 /* EndOfFileToken */) { const startPos = scanner.getStartPos(); - const statement = parseListElement(ParsingContext.SourceElements, parseStatement); + const statement = parseListElement(0 /* SourceElements */, parseStatement); statements.push(statement); if (startPos === scanner.getStartPos()) { nextToken(); @@ -25940,7 +26387,7 @@ var Parser; } } syntaxCursor = savedSyntaxCursor; - return factory2.updateSourceFile(sourceFile, setTextRange(factory2.createNodeArray(statements), sourceFile.statements)); + return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements)); function containsPossibleTopLevelAwait(node) { return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); } @@ -26381,13 +26828,13 @@ var Parser; const pos = getNodePos(); const kind = token(); nextToken(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseTokenNodeJSDoc() { const pos = getNodePos(); const kind = token(); nextTokenJSDoc(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function canParseSemicolon() { if (token() === 26 /* SemicolonToken */) { @@ -26408,7 +26855,7 @@ var Parser; return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); } function createNodeArray(elements, pos, end, hasTrailingComma) { - const array = factory2.createNodeArray(elements, hasTrailingComma); + const array = factoryCreateNodeArray(elements, hasTrailingComma); setTextRangePosEnd(array, pos, end != null ? end : scanner.getStartPos()); return array; } @@ -26430,7 +26877,7 @@ var Parser; parseErrorAtCurrentToken(diagnosticMessage, arg0); } const pos = getNodePos(); - const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( + const result = kind === 79 /* Identifier */ ? factoryCreateIdentifier( "", /*originalKeywordKind*/ void 0 @@ -26440,15 +26887,15 @@ var Parser; "", /*templateFlags*/ void 0 - ) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral( + ) : kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral( "", /*numericLiteralFlags*/ void 0 - ) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + ) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( "", /*isSingleQuote*/ void 0 - ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind); + ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); return finishNode(result, pos); } function internIdentifier(text) { @@ -26466,7 +26913,7 @@ var Parser; const text = internIdentifier(scanner.getTokenValue()); const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); + return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); @@ -26537,7 +26984,7 @@ var Parser; } function parsePrivateIdentifier() { const pos = getNodePos(); - const node = factory2.createPrivateIdentifier(internIdentifier(scanner.getTokenValue())); + const node = factoryCreatePrivateIdentifier(internIdentifier(scanner.getTokenValue())); nextToken(); return finishNode(node, pos); } @@ -26566,7 +27013,6 @@ var Parser; return canFollowExportModifier(); case 88 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); - case 127 /* AccessorKeyword */: case 124 /* StaticKeyword */: case 137 /* GetKeyword */: case 151 /* SetKeyword */: @@ -26599,19 +27045,19 @@ var Parser; return true; } switch (parsingContext2) { - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return lookAhead(isTypeMemberStart); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return lookAhead(isClassMemberStart) || token() === 26 /* SemicolonToken */ && !inErrorRecovery; - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return token() === 22 /* OpenBracketToken */ || isLiteralPropertyName(); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: switch (token()) { case 22 /* OpenBracketToken */: case 41 /* AsteriskToken */: @@ -26621,13 +27067,13 @@ var Parser; default: return isLiteralPropertyName(); } - case ParsingContext.RestProperties: + case 18 /* RestProperties */: return isLiteralPropertyName(); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName(); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return isAssertionKey2(); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: if (token() === 18 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); } @@ -26636,40 +27082,40 @@ var Parser; } else { return isIdentifier2() && !isHeritageClauseExtendsOrImplementsKeyword(); } - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 101 /* InKeyword */ || token() === 85 /* ConstKeyword */ || isIdentifier2(); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: switch (token()) { case 27 /* CommaToken */: case 24 /* DotToken */: return true; } - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 25 /* DotDotDotToken */ || isStartOfExpression(); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isStartOfParameter( /*isJSDocParameter*/ false ); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return isStartOfParameter( /*isJSDocParameter*/ true ); - case ParsingContext.TypeArguments: - case ParsingContext.TupleElementTypes: + case 20 /* TypeArguments */: + case 21 /* TupleElementTypes */: return token() === 27 /* CommaToken */ || isStartOfType(); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return isHeritageClause2(); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return tokenIsIdentifierOrKeyword(token()); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return true; } return Debug.fail("Non-exhaustive case in 'isListElement'."); @@ -26713,41 +27159,41 @@ var Parser; return true; } switch (kind) { - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauses: - case ParsingContext.TypeMembers: - case ParsingContext.ClassMembers: - case ParsingContext.EnumMembers: - case ParsingContext.ObjectLiteralMembers: - case ParsingContext.ObjectBindingElements: - case ParsingContext.ImportOrExportSpecifiers: - case ParsingContext.AssertEntries: + case 1 /* BlockStatements */: + case 2 /* SwitchClauses */: + case 4 /* TypeMembers */: + case 5 /* ClassMembers */: + case 6 /* EnumMembers */: + case 12 /* ObjectLiteralMembers */: + case 9 /* ObjectBindingElements */: + case 23 /* ImportOrExportSpecifiers */: + case 24 /* AssertEntries */: return token() === 19 /* CloseBraceToken */; - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return token() === 19 /* CloseBraceToken */ || token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */; - case ParsingContext.ArrayLiteralMembers: - case ParsingContext.TupleElementTypes: - case ParsingContext.ArrayBindingElements: + case 15 /* ArrayLiteralMembers */: + case 21 /* TupleElementTypes */: + case 10 /* ArrayBindingElements */: return token() === 23 /* CloseBracketToken */; - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: - case ParsingContext.RestProperties: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: + case 18 /* RestProperties */: return token() === 21 /* CloseParenToken */ || token() === 23 /* CloseBracketToken */; - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return token() !== 27 /* CommaToken */; - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return token() === 18 /* OpenBraceToken */ || token() === 19 /* CloseBraceToken */; - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return token() === 31 /* GreaterThanToken */ || token() === 43 /* SlashToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsSlash); default: return false; @@ -26766,7 +27212,7 @@ var Parser; return false; } function isInSomeParsingContext() { - for (let kind = 0; kind < ParsingContext.Count; kind++) { + for (let kind = 0; kind < 25 /* Count */; kind++) { if (parsingContext & 1 << kind) { if (isListElement( kind, @@ -26835,38 +27281,38 @@ var Parser; } function isReusableParsingContext(parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: - case ParsingContext.SwitchClauses: - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: - case ParsingContext.EnumMembers: - case ParsingContext.TypeMembers: - case ParsingContext.VariableDeclarations: - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 5 /* ClassMembers */: + case 2 /* SwitchClauses */: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: + case 6 /* EnumMembers */: + case 4 /* TypeMembers */: + case 8 /* VariableDeclarations */: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return true; } return false; } function canReuseNode(node, parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return isReusableClassMember(node); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return isReusableSwitchClause(node); - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return isReusableStatement(node); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return isReusableEnumMember(node); - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return isReusableTypeMember(node); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isReusableVariableDeclaration(node); - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return isReusableParameter(node); } return false; @@ -26976,56 +27422,56 @@ var Parser; } function parsingContextErrors(context) { switch (context) { - case ParsingContext.SourceElements: + case 0 /* SourceElements */: return token() === 88 /* DefaultKeyword */ ? parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(93 /* ExportKeyword */)) : parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.BlockStatements: + case 1 /* BlockStatements */: return parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(Diagnostics.case_or_default_expected); - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(Diagnostics.Statement_expected); - case ParsingContext.RestProperties: - case ParsingContext.TypeMembers: + case 18 /* RestProperties */: + case 4 /* TypeMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return parseErrorAtCurrentToken(Diagnostics.Enum_member_expected); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(Diagnostics.Expression_expected); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Variable_declaration_expected); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Property_destructuring_pattern_expected); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Array_element_destructuring_pattern_expected); - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(Diagnostics.Argument_expression_expected); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_assignment_expected); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Expression_or_comma_expected); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_parameter_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return parseErrorAtCurrentToken(Diagnostics.Type_parameter_declaration_expected); - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return parseErrorAtCurrentToken(Diagnostics.Type_argument_expected); - case ParsingContext.TupleElementTypes: + case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(Diagnostics.Type_expected); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); - case ParsingContext.Count: + case 25 /* Count */: return Debug.fail("ParsingContext.Count used as a context"); default: Debug.assertNever(context); @@ -27084,7 +27530,7 @@ var Parser; ); } function getExpectedCommaDiagnostic(kind) { - return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; + return kind === 6 /* EnumMembers */ ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; } function createMissingList() { const list = createNodeArray([], getNodePos()); @@ -27253,12 +27699,12 @@ var Parser; // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( scanner.getTokenValue(), /*isSingleQuote*/ void 0, scanner.hasExtendedUnicodeEscape() - ) : isLiteralKind(kind) ? factory2.createLiteralLikeNode(kind, scanner.getTokenValue()) : Debug.fail() + ) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner.getTokenValue()) : Debug.fail() ); if (scanner.hasExtendedUnicodeEscape()) { node.hasExtendedUnicodeEscape = true; @@ -27278,7 +27724,7 @@ var Parser; } function parseTypeArgumentsOfTypeReference() { if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function parseTypeReference() { @@ -27460,7 +27906,7 @@ var Parser; } function parseTypeParameters() { if (token() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function isStartOfParameter(isJSDocParameter) { @@ -27566,7 +28012,7 @@ var Parser; const savedAwaitContext = inAwaitContext(); setYieldContext(!!(flags & 1 /* Yield */)); setAwaitContext(!!(flags & 2 /* Await */)); - const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(ParsingContext.JSDocParameters, parseJSDocParameter) : parseDelimitedList(ParsingContext.Parameters, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); + const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(17 /* JSDocParameters */, parseJSDocParameter) : parseDelimitedList(16 /* Parameters */, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); setYieldContext(savedYieldContext); setAwaitContext(savedAwaitContext); return parameters; @@ -27634,7 +28080,7 @@ var Parser; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { - const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( + const parameters = parseBracketedList(16 /* Parameters */, () => parseParameter( /*inOuterAwaitContext*/ false ), 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); @@ -27733,7 +28179,7 @@ var Parser; function parseObjectTypeMembers() { let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = parseList(ParsingContext.TypeMembers, parseTypeMember); + members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -27787,7 +28233,7 @@ var Parser; } const type = parseTypeAnnotation(); parseSemicolon(); - const members = parseList(ParsingContext.TypeMembers, parseTypeMember); + const members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), pos); } @@ -27832,7 +28278,7 @@ var Parser; const pos = getNodePos(); return finishNode( factory2.createTupleTypeNode( - parseBracketedList(ParsingContext.TupleElementTypes, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) + parseBracketedList(21 /* TupleElementTypes */, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) ), pos ); @@ -27849,7 +28295,7 @@ var Parser; if (token() === 126 /* AbstractKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(126 /* AbstractKeyword */), pos); + const modifier = finishNode(factoryCreateToken(126 /* AbstractKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -27859,6 +28305,7 @@ var Parser; const hasJSDoc = hasPrecedingJSDocComment(); const modifiers = parseModifiersForConstructorType(); const isConstructorType = parseOptional(103 /* NewKeyword */); + Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers."); const typeParameters = parseTypeParameters(); const parameters = parseParameters(4 /* Type */); const type = parseReturnType( @@ -27867,8 +28314,6 @@ var Parser; false ); const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type); - if (!isConstructorType) - node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseKeywordAndNoDot() { @@ -28460,10 +28905,10 @@ var Parser; } function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { const triState = isParenthesizedArrowFunctionExpression(); - if (triState === Tristate.False) { + if (triState === 0 /* False */) { return void 0; } - return triState === Tristate.True ? parseParenthesizedArrowFunctionExpression( + return triState === 1 /* True */ ? parseParenthesizedArrowFunctionExpression( /*allowAmbiguity*/ true, /*allowReturnTypeInArrowFunction*/ @@ -28475,18 +28920,18 @@ var Parser; return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } if (token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner.hasPrecedingLineBreak()) { - return Tristate.False; + return 0 /* False */; } if (token() !== 20 /* OpenParenToken */ && token() !== 29 /* LessThanToken */) { - return Tristate.False; + return 0 /* False */; } } const first2 = token(); @@ -28498,45 +28943,45 @@ var Parser; case 38 /* EqualsGreaterThanToken */: case 58 /* ColonToken */: case 18 /* OpenBraceToken */: - return Tristate.True; + return 1 /* True */; default: - return Tristate.False; + return 0 /* False */; } } if (second === 22 /* OpenBracketToken */ || second === 18 /* OpenBraceToken */) { - return Tristate.Unknown; + return 2 /* Unknown */; } if (second === 25 /* DotDotDotToken */) { - return Tristate.True; + return 1 /* True */; } if (isModifierKind(second) && second !== 132 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { if (nextToken() === 128 /* AsKeyword */) { - return Tristate.False; + return 0 /* False */; } - return Tristate.True; + return 1 /* True */; } if (!isIdentifier2() && second !== 108 /* ThisKeyword */) { - return Tristate.False; + return 0 /* False */; } switch (nextToken()) { case 58 /* ColonToken */: - return Tristate.True; + return 1 /* True */; case 57 /* QuestionToken */: nextToken(); if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 63 /* EqualsToken */ || token() === 21 /* CloseParenToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; case 27 /* CommaToken */: case 63 /* EqualsToken */: case 21 /* CloseParenToken */: - return Tristate.Unknown; + return 2 /* Unknown */; } - return Tristate.False; + return 0 /* False */; } else { Debug.assert(first2 === 29 /* LessThanToken */); if (!isIdentifier2() && token() !== 85 /* ConstKeyword */) { - return Tristate.False; + return 0 /* False */; } if (languageVariant === 1 /* JSX */) { const isArrowFunctionInJsx = lookAhead(() => { @@ -28547,6 +28992,7 @@ var Parser; switch (fourth) { case 63 /* EqualsToken */: case 31 /* GreaterThanToken */: + case 43 /* SlashToken */: return false; default: return true; @@ -28557,11 +29003,11 @@ var Parser; return false; }); if (isArrowFunctionInJsx) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } - return Tristate.Unknown; + return 2 /* Unknown */; } } function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { @@ -28581,7 +29027,7 @@ var Parser; } function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { if (token() === 132 /* AsyncKeyword */) { - if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === Tristate.True) { + if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) { const pos = getNodePos(); const asyncModifier = parseModifiersForArrowFunction(); const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); @@ -28594,14 +29040,14 @@ var Parser; if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner.hasPrecedingLineBreak() || token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.False; + return 0 /* False */; } const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); if (!scanner.hasPrecedingLineBreak() && expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } } - return Tristate.False; + return 0 /* False */; } function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { const pos = getNodePos(); @@ -28806,6 +29252,12 @@ var Parser; case 114 /* VoidKeyword */: return parseVoidExpression(); case 29 /* LessThanToken */: + if (languageVariant === 1 /* JSX */) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } return parseTypeAssertion(); case 133 /* AwaitKeyword */: if (isAwaitExpression2()) { @@ -28900,7 +29352,7 @@ var Parser; return expression; } parseExpectedToken(24 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - return finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -28921,7 +29373,7 @@ var Parser; factory2.createJsxElement( lastChild.openingElement, lastChild.children, - finishNode(factory2.createJsxClosingElement(finishNode(factory2.createIdentifier(""), end, end)), end, end) + finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end) ), lastChild.openingElement.pos, end @@ -29009,7 +29461,7 @@ var Parser; const list = []; const listPos = getNodePos(); const saveParsingContext = parsingContext; - parsingContext |= 1 << ParsingContext.JsxChildren; + parsingContext |= 1 << 14 /* JsxChildren */; while (true) { const child = parseJsxChild(openingTag, currentToken = scanner.reScanJsxToken()); if (!child) @@ -29024,7 +29476,7 @@ var Parser; } function parseJsxAttributes() { const pos = getNodePos(); - return finishNode(factory2.createJsxAttributes(parseList(ParsingContext.JsxAttributes, parseJsxAttribute)), pos); + return finishNode(factory2.createJsxAttributes(parseList(13 /* JsxAttributes */, parseJsxAttribute)), pos); } function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { const pos = getNodePos(); @@ -29064,7 +29516,7 @@ var Parser; scanJsxIdentifier(); let expression = token() === 108 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - expression = finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -29158,13 +29610,9 @@ var Parser; function parseJsxClosingFragment(inExpressionContext) { const pos = getNodePos(); parseExpected(30 /* LessThanSlashToken */); - if (tokenIsIdentifierOrKeyword(token())) { - parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); - } if (parseExpected( 31 /* GreaterThanToken */, - /*diagnostic*/ - void 0, + Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment, /*shouldAdvance*/ false )) { @@ -29177,6 +29625,7 @@ var Parser; return finishNode(factory2.createJsxJsxClosingFragment(), pos); } function parseTypeAssertion() { + Debug.assert(languageVariant !== 1 /* JSX */, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments."); const pos = getNodePos(); parseExpected(29 /* LessThanToken */); const type = parseType(); @@ -29218,7 +29667,7 @@ var Parser; true ); const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); - const propertyAccess = isOptionalChain2 ? factory2.createPropertyAccessChain(expression, questionDotToken, name) : factory2.createPropertyAccessExpression(expression, name); + const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name) : factoryCreatePropertyAccessExpression(expression, name); if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers); } @@ -29246,7 +29695,7 @@ var Parser; argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createElementAccessChain(expression, questionDotToken, argumentExpression) : factory2.createElementAccessExpression(expression, argumentExpression); + const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression); return finishNode(indexedAccess, pos); } function parseMemberExpressionRest(pos, expression, allowOptionalChain) { @@ -29333,7 +29782,7 @@ var Parser; expression = expression.expression; } const argumentList = parseArgumentList(); - const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList); + const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList); expression = finishNode(callExpr, pos); continue; } @@ -29344,7 +29793,7 @@ var Parser; false, Diagnostics.Identifier_expected ); - expression = finishNode(factory2.createPropertyAccessChain(expression, questionDotToken, name), pos); + expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name), pos); } break; } @@ -29352,7 +29801,7 @@ var Parser; } function parseArgumentList() { parseExpected(20 /* OpenParenToken */); - const result = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); + const result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(21 /* CloseParenToken */); return result; } @@ -29364,7 +29813,7 @@ var Parser; return void 0; } nextToken(); - const typeArguments = parseDelimitedList(ParsingContext.TypeArguments, parseType); + const typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType); if (reScanGreaterToken() !== 31 /* GreaterThanToken */) { return void 0; } @@ -29439,7 +29888,7 @@ var Parser; parseExpected(20 /* OpenParenToken */); const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - return withJSDoc(finishNode(factory2.createParenthesizedExpression(expression), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc); } function parseSpreadElement() { const pos = getNodePos(); @@ -29464,9 +29913,9 @@ var Parser; const openBracketPosition = scanner.getTokenPos(); const openBracketParsed = parseExpected(22 /* OpenBracketToken */); const multiLine = scanner.hasPrecedingLineBreak(); - const elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArgumentOrArrayLiteralElement); + const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketParsed, openBracketPosition); - return finishNode(factory2.createArrayLiteralExpression(elements, multiLine), pos); + return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos); } function parseObjectLiteralElement() { const pos = getNodePos(); @@ -29525,13 +29974,13 @@ var Parser; const openBraceParsed = parseExpected(18 /* OpenBraceToken */); const multiLine = scanner.hasPrecedingLineBreak(); const properties = parseDelimitedList( - ParsingContext.ObjectLiteralMembers, + 12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true ); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - return finishNode(factory2.createObjectLiteralExpression(properties, multiLine), pos); + return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos); } function parseFunctionExpression() { const savedDecoratorContext = inDecoratorContext(); @@ -29588,7 +30037,7 @@ var Parser; parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression)); } const argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : void 0; - return finishNode(factory2.createNewExpression(expression, typeArguments, argumentList), pos); + return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { const pos = getNodePos(); @@ -29597,17 +30046,17 @@ var Parser; const openBraceParsed = parseExpected(18 /* OpenBraceToken */, diagnosticMessage); if (openBraceParsed || ignoreMissingOpenBrace) { const multiLine = scanner.hasPrecedingLineBreak(); - const statements = parseList(ParsingContext.BlockStatements, parseStatement); + const statements = parseList(1 /* BlockStatements */, parseStatement); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc); + const result = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc); if (token() === 63 /* EqualsToken */) { - parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); + parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses); nextToken(); } return result; } else { const statements = createMissingList(); - return withJSDoc(finishNode(factory2.createBlock( + return withJSDoc(finishNode(factoryCreateBlock( statements, /*multiLine*/ void 0 @@ -29656,7 +30105,7 @@ var Parser; parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const thenStatement = parseStatement(); const elseStatement = parseOptional(91 /* ElseKeyword */) ? parseStatement() : void 0; - return withJSDoc(finishNode(factory2.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); } function parseDoStatement() { const pos = getNodePos(); @@ -29680,7 +30129,7 @@ var Parser; const expression = allowInAnd(parseExpression); parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const statement = parseStatement(); - return withJSDoc(finishNode(factory2.createWhileStatement(expression, statement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc); } function parseForOrForInOrForOfStatement() { const pos = getNodePos(); @@ -29706,7 +30155,7 @@ var Parser; true )); parseExpected(21 /* CloseParenToken */); - node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement()); + node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement()); } else if (parseOptional(101 /* InKeyword */)) { const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); @@ -29717,7 +30166,7 @@ var Parser; parseExpected(26 /* SemicolonToken */); const incrementor = token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; parseExpected(21 /* CloseParenToken */); - node = factory2.createForStatement(initializer, condition, incrementor, parseStatement()); + node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement()); } return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -29755,14 +30204,14 @@ var Parser; parseExpected(82 /* CaseKeyword */); const expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return withJSDoc(finishNode(factory2.createCaseClause(expression, statements), pos), hasJSDoc); } function parseDefaultClause() { const pos = getNodePos(); parseExpected(88 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(factory2.createDefaultClause(statements), pos); } function parseCaseOrDefaultClause() { @@ -29771,7 +30220,7 @@ var Parser; function parseCaseBlock() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const clauses = parseList(ParsingContext.SwitchClauses, parseCaseOrDefaultClause); + const clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createCaseBlock(clauses), pos); } @@ -29792,7 +30241,7 @@ var Parser; let expression = scanner.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); if (expression === void 0) { identifierCount++; - expression = finishNode(factory2.createIdentifier(""), getNodePos()); + expression = finishNode(factoryCreateIdentifier(""), getNodePos()); } if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); @@ -29853,7 +30302,7 @@ var Parser; if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); } - node = factory2.createExpressionStatement(expression); + node = factoryCreateExpressionStatement(expression); if (hasParen) { hasJSDoc = false; } @@ -30212,14 +30661,14 @@ var Parser; function parseObjectBindingPattern() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const elements = parseDelimitedList(ParsingContext.ObjectBindingElements, parseObjectBindingElement); + const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createObjectBindingPattern(elements), pos); } function parseArrayBindingPattern() { const pos = getNodePos(); parseExpected(22 /* OpenBracketToken */); - const elements = parseDelimitedList(ParsingContext.ArrayBindingElements, parseArrayBindingElement); + const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); return finishNode(factory2.createArrayBindingPattern(elements), pos); } @@ -30251,7 +30700,7 @@ var Parser; } const type = parseTypeAnnotation(); const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); - const node = factory2.createVariableDeclaration(name, exclamationToken, type, initializer); + const node = factoryCreateVariableDeclaration(name, exclamationToken, type, initializer); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseVariableDeclarationList(inForStatementInitializer) { @@ -30277,12 +30726,12 @@ var Parser; const savedDisallowIn = inDisallowInContext(); setDisallowInContext(inForStatementInitializer); declarations = parseDelimitedList( - ParsingContext.VariableDeclarations, + 8 /* VariableDeclarations */, inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation ); setDisallowInContext(savedDisallowIn); } - return finishNode(factory2.createVariableDeclarationList(declarations, flags), pos); + return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos); } function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; @@ -30293,7 +30742,7 @@ var Parser; false ); parseSemicolon(); - const node = factory2.createVariableStatement(modifiers, declarationList); + const node = factoryCreateVariableStatement(modifiers, declarationList); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { @@ -30522,22 +30971,30 @@ var Parser; return void 0; } } - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); let list; - let modifier, hasSeenStaticModifier = false; + let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false; + if (allowDecorators && token() === 59 /* AtToken */) { + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + } while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; list = append(list, modifier); + hasLeadingModifier = true; } - if (allowDecorators && token() === 59 /* AtToken */) { - let decorator; + if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) { while (decorator = tryParseDecorator()) { list = append(list, decorator); + hasTrailingDecorator = true; } + } + if (hasTrailingDecorator) { while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; @@ -30551,7 +31008,7 @@ var Parser; if (token() === 132 /* AsyncKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(132 /* AsyncKeyword */), pos); + const modifier = finishNode(factoryCreateToken(132 /* AsyncKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -30680,7 +31137,7 @@ var Parser; } function parseHeritageClauses() { if (isHeritageClause2()) { - return parseList(ParsingContext.HeritageClauses, parseHeritageClause); + return parseList(22 /* HeritageClauses */, parseHeritageClause); } return void 0; } @@ -30689,7 +31146,7 @@ var Parser; const tok = token(); Debug.assert(tok === 94 /* ExtendsKeyword */ || tok === 117 /* ImplementsKeyword */); nextToken(); - const types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseExpressionWithTypeArguments); + const types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(factory2.createHeritageClause(tok, types), pos); } function parseExpressionWithTypeArguments() { @@ -30702,13 +31159,13 @@ var Parser; return finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); } function tryParseTypeArguments() { - return token() === 29 /* LessThanToken */ ? parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; + return token() === 29 /* LessThanToken */ ? parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; } function isHeritageClause2() { return token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; } function parseClassMembers() { - return parseList(ParsingContext.ClassMembers, parseClassElement); + return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); @@ -30741,7 +31198,7 @@ var Parser; const name = parseIdentifier(); let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(ParsingContext.EnumMembers, parseEnumMember)); + members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(6 /* EnumMembers */, parseEnumMember)); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -30753,7 +31210,7 @@ var Parser; const pos = getNodePos(); let statements; if (parseExpected(18 /* OpenBraceToken */)) { - statements = parseList(ParsingContext.BlockStatements, parseStatement); + statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); } else { statements = createMissingList(); @@ -30878,7 +31335,7 @@ var Parser; if (parseExpected(18 /* OpenBraceToken */)) { const multiLine = scanner.hasPrecedingLineBreak(); const elements = parseDelimitedList( - ParsingContext.AssertEntries, + 24 /* AssertEntries */, parseAssertEntry, /*considerSemicolonAsDelimiter*/ true @@ -30962,7 +31419,7 @@ var Parser; } function parseNamedImportsOrExports(kind) { const pos = getNodePos(); - const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); + const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { @@ -31138,7 +31595,7 @@ var Parser; /*isDeclarationFile*/ false, [], - factory2.createToken(1 /* EndOfFileToken */), + factoryCreateToken(1 /* EndOfFileToken */), 0 /* None */, noop ); @@ -31799,7 +32256,7 @@ var Parser; let node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { const name = parseJSDocIdentifierName(); - node = finishNode(factory2.createPropertyAccessExpression(node, name), pos); + node = finishNode(factoryCreatePropertyAccessExpression(node, name), pos); } return node; } @@ -32090,7 +32547,7 @@ var Parser; const end2 = scanner.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner.getTokenValue()); - const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); + const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -32412,7 +32869,7 @@ var IncrementalParser; let currentArrayIndex = 0; Debug.assert(currentArrayIndex < currentArray.length); let current = currentArray[currentArrayIndex]; - let lastQueriedPosition = InvalidPosition.Value; + let lastQueriedPosition = -1 /* Value */; return { currentNode(position) { if (position !== lastQueriedPosition) { @@ -32431,7 +32888,7 @@ var IncrementalParser; }; function findHighestListElementThatStartsAtPosition(position) { currentArray = void 0; - currentArrayIndex = InvalidPosition.Value; + currentArrayIndex = -1 /* Value */; current = void 0; forEachChild(sourceFile, visitNode3, visitArray2); return; @@ -33745,7 +34202,7 @@ var commandOptionsWithoutBuild = [ { name: "allowArbitraryExtensions", type: "boolean", - affectsModuleResolution: true, + affectsProgramStructure: true, category: Diagnostics.Modules, description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present, defaultValueDescription: false @@ -35931,6 +36388,22 @@ function resolvedTypeScriptOnly(resolved) { Debug.assert(extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } +function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) { + if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) { + const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled); + if (originalPath) + resolved = { ...resolved, path: resolvedFileName, originalPath }; + } + return createResolvedModuleWithFailedLookupLocations( + resolved, + isExternalLibraryImport, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache, + legacyResult + ); +} function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); @@ -36091,6 +36564,15 @@ function arePathsEqual(path1, path2, host) { const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */; } +function getOriginalAndResolvedFileName(fileName, host, traceEnabled) { + const resolvedFileName = realPath(fileName, host, traceEnabled); + const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + return { + // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames + resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, + originalPath: pathsAreEqual ? void 0 : fileName + }; +} function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) { Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself."); const traceEnabled = isTraceEnabled(options, host); @@ -36135,9 +36617,9 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil const affectingLocations = []; let features = getNodeResolutionFeatures(options); if (resolutionMode === 99 /* ESNext */ && (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */)) { - features |= NodeResolutionFeatures.EsmMode; + features |= 32 /* EsmMode */; } - const conditions = features & NodeResolutionFeatures.Exports ? getConditions(options, !!(features & NodeResolutionFeatures.EsmMode)) : []; + const conditions = features & 8 /* Exports */ ? getConditions(options, !!(features & 32 /* EsmMode */)) : []; const diagnostics = []; const moduleResolutionState = { compilerOptions: options, @@ -36162,13 +36644,13 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil let resolvedTypeReferenceDirective; if (resolved) { const { fileName, packageId } = resolved; - const resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled); - const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + let resolvedFileName = fileName, originalPath; + if (!options.preserveSymlinks) + ({ resolvedFileName, originalPath } = getOriginalAndResolvedFileName(fileName, host, traceEnabled)); resolvedTypeReferenceDirective = { primary, - // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames - resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, - originalPath: pathsAreEqual ? void 0 : fileName, + resolvedFileName, + originalPath, packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) }; @@ -36270,35 +36752,38 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil } } function getNodeResolutionFeatures(options) { - let features = NodeResolutionFeatures.None; + let features = 0 /* None */; switch (getEmitModuleResolutionKind(options)) { case 3 /* Node16 */: - features = NodeResolutionFeatures.Node16Default; + features = 30 /* Node16Default */; break; case 99 /* NodeNext */: - features = NodeResolutionFeatures.NodeNextDefault; + features = 30 /* NodeNextDefault */; break; case 100 /* Bundler */: - features = NodeResolutionFeatures.BundlerDefault; + features = 30 /* BundlerDefault */; break; } if (options.resolvePackageJsonExports) { - features |= NodeResolutionFeatures.Exports; + features |= 8 /* Exports */; } else if (options.resolvePackageJsonExports === false) { - features &= ~NodeResolutionFeatures.Exports; + features &= ~8 /* Exports */; } if (options.resolvePackageJsonImports) { - features |= NodeResolutionFeatures.Imports; + features |= 2 /* Imports */; } else if (options.resolvePackageJsonImports === false) { - features &= ~NodeResolutionFeatures.Imports; + features &= ~2 /* Imports */; } return features; } function getConditions(options, esmMode) { - const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["node", "import"] : ["node", "require"]; + const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["import"] : ["require"]; if (!options.noDtsResolution) { conditions.push("types"); } + if (getEmitModuleResolutionKind(options) !== 100 /* Bundler */) { + conditions.push("node"); + } return concatenate(conditions, options.customConditions); } function getAutomaticTypeDirectiveNames(options, host) { @@ -36858,19 +37343,6 @@ function resolveJSModule(moduleName, initialDir, host) { } return resolvedModule.resolvedFileName; } -var NodeResolutionFeatures = /* @__PURE__ */ ((NodeResolutionFeatures2) => { - NodeResolutionFeatures2[NodeResolutionFeatures2["None"] = 0] = "None"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Imports"] = 2] = "Imports"; - NodeResolutionFeatures2[NodeResolutionFeatures2["SelfName"] = 4] = "SelfName"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Exports"] = 8] = "Exports"; - NodeResolutionFeatures2[NodeResolutionFeatures2["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; - NodeResolutionFeatures2[NodeResolutionFeatures2["AllFeatures"] = 30] = "AllFeatures"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Node16Default"] = 30] = "Node16Default"; - NodeResolutionFeatures2[NodeResolutionFeatures2["NodeNextDefault"] = 30 /* AllFeatures */] = "NodeNextDefault"; - NodeResolutionFeatures2[NodeResolutionFeatures2["BundlerDefault"] = 30] = "BundlerDefault"; - NodeResolutionFeatures2[NodeResolutionFeatures2["EsmMode"] = 32] = "EsmMode"; - return NodeResolutionFeatures2; -})(NodeResolutionFeatures || {}); function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { return nodeNextModuleNameResolverWorker( 30 /* Node16Default */, @@ -37000,7 +37472,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, isConfigLookup, candidateIsFromPackageJsonField: false }; - if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) { + if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(compilerOptions))) { trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", ")); } let result; @@ -37026,13 +37498,14 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, legacyResult = diagnosticResult.value.resolved.path; } } - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache, + state, legacyResult ); function tryResolve(extensions2, state2) { @@ -37062,16 +37535,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, } resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } - if (!resolved2) - return void 0; - let resolvedValue = resolved2.value; - if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) { - const path = realPath(resolvedValue.path, host, traceEnabled); - const pathsAreEqual = arePathsEqual(path, resolvedValue.path, host); - const originalPath = pathsAreEqual ? void 0 : resolvedValue.path; - resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path, originalPath }; - } - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } }; } else { const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName); const resolved2 = nodeLoadModuleByRelativeName( @@ -37254,7 +37718,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) { if (!onlyRecordFailures) { if (state.host.fileExists(fileName)) { if (state.traceEnabled) { - trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); + trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName); } return fileName; } else { @@ -37748,18 +38212,24 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec ))); } else if (typeof target === "object" && target !== null) { if (!Array.isArray(target)) { + traceIfEnabled(state, Diagnostics.Entering_conditional_exports); for (const condition of getOwnKeys(target)) { if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) { traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); const subTarget = target[condition]; const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key); if (result) { + traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition); + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return result; + } else { + traceIfEnabled(state, Diagnostics.Failed_to_resolve_under_condition_0, condition); } } else { traceIfEnabled(state, Diagnostics.Saw_non_matching_condition_0, condition); } } + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return void 0; } else { if (!length(target)) { @@ -38126,13 +38596,14 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host, candidateIsFromPackageJsonField: false }; const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0)); - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, resolved && resolved.value, (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path), failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state ); function tryResolve(extensions) { const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); @@ -38366,35 +38837,36 @@ function bindSourceFile(file, options) { measure("Bind", "beforeBind", "afterBind"); } function createBinder() { - let file; - let options; - let languageVersion; - let parent; - let container; - let thisParentContainer; - let blockScopeContainer; - let lastContainer; - let delayedTypeAliases; - let seenThisKeyword; - let currentFlow; - let currentBreakTarget; - let currentContinueTarget; - let currentReturnTarget; - let currentTrueTarget; - let currentFalseTarget; - let currentExceptionTarget; - let preSwitchCaseFlow; - let activeLabelList; - let hasExplicitReturn; - let emitFlags; - let inStrictMode; - let inAssignmentPattern = false; - let symbolCount = 0; - let Symbol12; - let classifiableNames; - const unreachableFlow = { flags: 1 /* Unreachable */ }; - const reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; - const bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + var file; + var options; + var languageVersion; + var parent; + var container; + var thisParentContainer; + var blockScopeContainer; + var lastContainer; + var delayedTypeAliases; + var seenThisKeyword; + var currentFlow; + var currentBreakTarget; + var currentContinueTarget; + var currentReturnTarget; + var currentTrueTarget; + var currentFalseTarget; + var currentExceptionTarget; + var preSwitchCaseFlow; + var activeLabelList; + var hasExplicitReturn; + var emitFlags; + var inStrictMode; + var inAssignmentPattern = false; + var symbolCount = 0; + var Symbol12; + var classifiableNames; + var unreachableFlow = { flags: 1 /* Unreachable */ }; + var reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; + var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + return bindSourceFile2; function createDiagnosticForNode2(node, message, arg0, arg1, arg2) { return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2); } @@ -38445,7 +38917,6 @@ function createBinder() { inAssignmentPattern = false; emitFlags = 0 /* None */; } - return bindSourceFile2; function bindInStrictMode(file2, opts) { if (getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { return true; @@ -41388,7 +41859,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi let redirectPathsSpecifiers; let relativeSpecifiers; for (const modulePath of modulePaths) { - const specifier = tryGetModuleNameAsNodeModule( + const specifier = modulePath.isInNodeModules ? tryGetModuleNameAsNodeModule( modulePath, info, importingSourceFile, @@ -41398,7 +41869,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi /*packageNameOnly*/ void 0, options.overrideImportMode - ); + ) : void 0; nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier); if (specifier && modulePath.isRedirect) { return nodeModulesSpecifiers; @@ -41810,9 +42281,11 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa if (typeof cachedPackageJson === "object" || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) { const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath)); const importMode = overrideMode || importingSourceFile.impliedNodeFormat; - if (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */) { - const conditions = ["node", importMode === 99 /* ESNext */ ? "import" : "require", "types"]; - const fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions) : void 0; + if (getResolvePackageJsonExports(options)) { + const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1); + const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2); + const conditions = getConditions(options, importMode === 99 /* ESNext */); + const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0; if (fromExports) { const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) }; return { ...withJsExtension, verbatimFromExports: true }; @@ -42069,6 +42542,7 @@ var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => { SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback"; SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity"; + SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature"; SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback"; return SignatureCheckMode3; })(SignatureCheckMode || {}); @@ -42103,8 +42577,8 @@ function isInstantiatedModule(node, preserveConstEnums) { return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */; } function createTypeChecker(host) { - const getPackagesMap = memoize(() => { - const map2 = /* @__PURE__ */ new Map(); + var getPackagesMap = memoize(() => { + var map2 = /* @__PURE__ */ new Map(); host.getSourceFiles().forEach((sf) => { if (!sf.resolvedModules) return; @@ -42115,57 +42589,58 @@ function createTypeChecker(host) { }); return map2; }); - let deferredDiagnosticsCallbacks = []; - let addLazyDiagnostic = (arg) => { + var deferredDiagnosticsCallbacks = []; + var addLazyDiagnostic = (arg) => { deferredDiagnosticsCallbacks.push(arg); }; - let cancellationToken; - const requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); - let requestedExternalEmitHelpers; - let externalHelpersModule; - const Symbol12 = objectAllocator.getSymbolConstructor(); - const Type7 = objectAllocator.getTypeConstructor(); - const Signature5 = objectAllocator.getSignatureConstructor(); - let typeCount = 0; - let symbolCount = 0; - let totalInstantiationCount = 0; - let instantiationCount = 0; - let instantiationDepth = 0; - let inlineLevel = 0; - let currentNode; - let varianceTypeParameter; - const emptySymbols = createSymbolTable(); - const arrayVariances = [1 /* Covariant */]; - const compilerOptions = host.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const moduleKind = getEmitModuleKind(compilerOptions); - const legacyDecorators = !!compilerOptions.experimentalDecorators; - const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); - const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); - const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); - const strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); - const strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); - const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); - const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); - const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); - const useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); - const keyofStringsOnly = !!compilerOptions.keyofStringsOnly; - const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */; - const exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; - const checkBinaryExpression = createCheckBinaryExpression(); - const emitResolver = createResolver(); - const nodeBuilder = createNodeBuilder(); - const globals = createSymbolTable(); - const undefinedSymbol = createSymbol(4 /* Property */, "undefined"); + var cancellationToken; + var requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); + var requestedExternalEmitHelpers; + var externalHelpersModule; + var Symbol12 = objectAllocator.getSymbolConstructor(); + var Type7 = objectAllocator.getTypeConstructor(); + var Signature5 = objectAllocator.getSignatureConstructor(); + var typeCount = 0; + var symbolCount = 0; + var totalInstantiationCount = 0; + var instantiationCount = 0; + var instantiationDepth = 0; + var inlineLevel = 0; + var currentNode; + var varianceTypeParameter; + var isInferencePartiallyBlocked = false; + var emptySymbols = createSymbolTable(); + var arrayVariances = [1 /* Covariant */]; + var compilerOptions = host.getCompilerOptions(); + var languageVersion = getEmitScriptTarget(compilerOptions); + var moduleKind = getEmitModuleKind(compilerOptions); + var legacyDecorators = !!compilerOptions.experimentalDecorators; + var useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); + var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); + var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); + var strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); + var strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); + var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); + var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); + var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); + var keyofStringsOnly = !!compilerOptions.keyofStringsOnly; + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */; + var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; + var checkBinaryExpression = createCheckBinaryExpression(); + var emitResolver = createResolver(); + var nodeBuilder = createNodeBuilder(); + var globals = createSymbolTable(); + var undefinedSymbol = createSymbol(4 /* Property */, "undefined"); undefinedSymbol.declarations = []; - const globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); + var globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); globalThisSymbol.exports = globals; globalThisSymbol.declarations = []; globals.set(globalThisSymbol.escapedName, globalThisSymbol); - const argumentsSymbol = createSymbol(4 /* Property */, "arguments"); - const requireSymbol = createSymbol(4 /* Property */, "require"); - const isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; - let apparentArgumentCount; + var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); + var requireSymbol = createSymbol(4 /* Property */, "require"); + var isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; + var apparentArgumentCount; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0), @@ -42343,15 +42818,14 @@ function createTypeChecker(host) { getTypeOfPropertyOfContextualType, getFullyQualifiedName, getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */), - getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => getResolvedSignatureWorker( + getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker( call, candidatesOutArray, /*argumentCount*/ void 0, - 32 /* IsForStringLiteralArgumentCompletions */, - editingArgument - ), - getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */), + 32 /* IsForStringLiteralArgumentCompletions */ + )), + getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)), getExpandedParameters, hasEffectiveRestParameter, containsArgumentsReference, @@ -42456,6 +42930,7 @@ function createTypeChecker(host) { isArrayType, isTupleType, isArrayLikeType, + isEmptyAnonymousObjectType, isTypeInvalidDueToUnionDiscriminant, getExactOptionalProperties, getAllPossiblePropertiesOfTypes, @@ -42542,81 +43017,93 @@ function createTypeChecker(host) { isPropertyAccessible, getTypeOnlyAliasDeclaration, getMemberOverrideModifierStatus, - isTypeParameterPossiblyReferenced + isTypeParameterPossiblyReferenced, + typeHasCallOrConstructSignatures }; - function runWithInferenceBlockedFromSourceNode(node, fn) { + function runWithoutResolvedSignatureCaching(node, fn) { const containingCall = findAncestor(node, isCallLikeExpression); const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature; + if (containingCall) { + getNodeLinks(containingCall).resolvedSignature = void 0; + } + const result = fn(); + if (containingCall) { + getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; + } + return result; + } + function runWithInferenceBlockedFromSourceNode(node, fn) { + const containingCall = findAncestor(node, isCallLikeExpression); if (containingCall) { let toMarkSkip = node; do { getNodeLinks(toMarkSkip).skipDirectInference = true; toMarkSkip = toMarkSkip.parent; } while (toMarkSkip && toMarkSkip !== containingCall); - getNodeLinks(containingCall).resolvedSignature = void 0; } - const result = fn(); + isInferencePartiallyBlocked = true; + const result = runWithoutResolvedSignatureCaching(node, fn); + isInferencePartiallyBlocked = false; if (containingCall) { let toMarkSkip = node; do { getNodeLinks(toMarkSkip).skipDirectInference = void 0; toMarkSkip = toMarkSkip.parent; } while (toMarkSkip && toMarkSkip !== containingCall); - getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; } return result; } - function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode, editingArgument) { + function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) { const node = getParseTreeNode(nodeIn, isCallLikeExpression); apparentArgumentCount = argumentCount; - const res = !node ? void 0 : editingArgument ? runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignature(node, candidatesOutArray, checkMode)) : getResolvedSignature(node, candidatesOutArray, checkMode); + const res = !node ? void 0 : getResolvedSignature(node, candidatesOutArray, checkMode); apparentArgumentCount = void 0; return res; } - const tupleTypes = /* @__PURE__ */ new Map(); - const unionTypes = /* @__PURE__ */ new Map(); - const intersectionTypes = /* @__PURE__ */ new Map(); - const stringLiteralTypes = /* @__PURE__ */ new Map(); - const numberLiteralTypes = /* @__PURE__ */ new Map(); - const bigIntLiteralTypes = /* @__PURE__ */ new Map(); - const enumLiteralTypes = /* @__PURE__ */ new Map(); - const indexedAccessTypes = /* @__PURE__ */ new Map(); - const templateLiteralTypes = /* @__PURE__ */ new Map(); - const stringMappingTypes = /* @__PURE__ */ new Map(); - const substitutionTypes = /* @__PURE__ */ new Map(); - const subtypeReductionCache = /* @__PURE__ */ new Map(); - const decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); - const cachedTypes = /* @__PURE__ */ new Map(); - const evolvingArrayTypes = []; - const undefinedProperties = /* @__PURE__ */ new Map(); - const markerTypes = /* @__PURE__ */ new Set(); - const unknownSymbol = createSymbol(4 /* Property */, "unknown"); - const resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); - const unresolvedSymbols = /* @__PURE__ */ new Map(); - const errorTypes = /* @__PURE__ */ new Map(); - const anyType = createIntrinsicType(1 /* Any */, "any"); - const autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); - const wildcardType = createIntrinsicType(1 /* Any */, "any"); - const errorType = createIntrinsicType(1 /* Any */, "error"); - const unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); - const nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); - const intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); - const unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - const nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - const undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); - const missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; - const optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const nullType = createIntrinsicType(65536 /* Null */, "null"); - const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); - const stringType = createIntrinsicType(4 /* String */, "string"); - const numberType = createIntrinsicType(8 /* Number */, "number"); - const bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); - const falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - const regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - const trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); - const regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var tupleTypes = /* @__PURE__ */ new Map(); + var unionTypes = /* @__PURE__ */ new Map(); + var intersectionTypes = /* @__PURE__ */ new Map(); + var stringLiteralTypes = /* @__PURE__ */ new Map(); + var numberLiteralTypes = /* @__PURE__ */ new Map(); + var bigIntLiteralTypes = /* @__PURE__ */ new Map(); + var enumLiteralTypes = /* @__PURE__ */ new Map(); + var indexedAccessTypes = /* @__PURE__ */ new Map(); + var templateLiteralTypes = /* @__PURE__ */ new Map(); + var stringMappingTypes = /* @__PURE__ */ new Map(); + var substitutionTypes = /* @__PURE__ */ new Map(); + var subtypeReductionCache = /* @__PURE__ */ new Map(); + var decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); + var cachedTypes = /* @__PURE__ */ new Map(); + var evolvingArrayTypes = []; + var undefinedProperties = /* @__PURE__ */ new Map(); + var markerTypes = /* @__PURE__ */ new Set(); + var unknownSymbol = createSymbol(4 /* Property */, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); + var unresolvedSymbols = /* @__PURE__ */ new Map(); + var errorTypes = /* @__PURE__ */ new Map(); + var anyType = createIntrinsicType(1 /* Any */, "any"); + var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); + var errorType = createIntrinsicType(1 /* Any */, "error"); + var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); + var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); + var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); + var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); + var missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; + var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var nullType = createIntrinsicType(65536 /* Null */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); + var stringType = createIntrinsicType(4 /* String */, "string"); + var numberType = createIntrinsicType(8 /* Number */, "number"); + var bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); + var falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); trueType.regularType = regularTrueType; trueType.freshType = trueType; regularTrueType.regularType = regularTrueType; @@ -42625,26 +43112,26 @@ function createTypeChecker(host) { falseType.freshType = falseType; regularFalseType.regularType = regularFalseType; regularFalseType.freshType = falseType; - const booleanType = getUnionType([regularFalseType, regularTrueType]); - const esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); - const voidType = createIntrinsicType(16384 /* Void */, "void"); - const neverType = createIntrinsicType(131072 /* Never */, "never"); - const silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); - const implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); - const unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); - const nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); - const stringOrNumberType = getUnionType([stringType, numberType]); - const stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); - const keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; - const numberOrBigIntType = getUnionType([numberType, bigintType]); - const templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); - const numericStringType = getTemplateLiteralType(["", ""], [numberType]); - const restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); - const permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); - const uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); - const uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); - let outofbandVarianceMarkerHandler; - const reportUnreliableMapper = makeFunctionTypeMapper((t) => { + var booleanType = getUnionType([regularFalseType, regularTrueType]); + var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); + var voidType = createIntrinsicType(16384 /* Void */, "void"); + var neverType = createIntrinsicType(131072 /* Never */, "never"); + var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); + var implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); + var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); + var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); + var stringOrNumberType = getUnionType([stringType, numberType]); + var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); + var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; + var numberOrBigIntType = getUnionType([numberType, bigintType]); + var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); + var numericStringType = getTemplateLiteralType(["", ""], [numberType]); + var restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); + var permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); + var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); + var uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); + var outofbandVarianceMarkerHandler; + var reportUnreliableMapper = makeFunctionTypeMapper((t) => { if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { outofbandVarianceMarkerHandler( /*onlyUnreliable*/ @@ -42653,7 +43140,7 @@ function createTypeChecker(host) { } return t; }, () => "(unmeasurable reporter)"); - const reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { + var reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { outofbandVarianceMarkerHandler( /*onlyUnreliable*/ @@ -42662,30 +43149,30 @@ function createTypeChecker(host) { } return t; }, () => "(unreliable reporter)"); - const emptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */; - const emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); + var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = createSymbolTable(); - const emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); - const unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; - const emptyGenericType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; + var emptyGenericType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); emptyGenericType.instantiations = /* @__PURE__ */ new Map(); - const anyFunctionType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var anyFunctionType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); anyFunctionType.objectFlags |= 262144 /* NonInferrableType */; - const noConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const circularConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const resolvingDefaultType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const markerSuperType = createTypeParameter(); - const markerSubType = createTypeParameter(); + var noConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var circularConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var resolvingDefaultType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var markerSuperType = createTypeParameter(); + var markerSubType = createTypeParameter(); markerSubType.constraint = markerSuperType; - const markerOtherType = createTypeParameter(); - const markerSuperTypeForCheck = createTypeParameter(); - const markerSubTypeForCheck = createTypeParameter(); + var markerOtherType = createTypeParameter(); + var markerSuperTypeForCheck = createTypeParameter(); + var markerSubTypeForCheck = createTypeParameter(); markerSubTypeForCheck.constraint = markerSuperTypeForCheck; - const noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); - const anySignature = createSignature( + var noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); + var anySignature = createSignature( void 0, void 0, void 0, @@ -42696,7 +43183,7 @@ function createTypeChecker(host) { 0, 0 /* None */ ); - const unknownSignature = createSignature( + var unknownSignature = createSignature( void 0, void 0, void 0, @@ -42707,7 +43194,7 @@ function createTypeChecker(host) { 0, 0 /* None */ ); - const resolvingSignature = createSignature( + var resolvingSignature = createSignature( void 0, void 0, void 0, @@ -42718,7 +43205,7 @@ function createTypeChecker(host) { 0, 0 /* None */ ); - const silentNeverSignature = createSignature( + var silentNeverSignature = createSignature( void 0, void 0, void 0, @@ -42729,14 +43216,14 @@ function createTypeChecker(host) { 0, 0 /* None */ ); - const enumNumberIndexInfo = createIndexInfo( + var enumNumberIndexInfo = createIndexInfo( numberType, stringType, /*isReadonly*/ true ); - const iterationTypesCache = /* @__PURE__ */ new Map(); - const noIterationTypes = { + var iterationTypesCache = /* @__PURE__ */ new Map(); + var noIterationTypes = { get yieldType() { return Debug.fail("Not supported"); }, @@ -42747,10 +43234,10 @@ function createTypeChecker(host) { return Debug.fail("Not supported"); } }; - const anyIterationTypes = createIterationTypes(anyType, anyType, anyType); - const anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); - const defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); - const asyncIterationTypesResolver = { + var anyIterationTypes = createIterationTypes(anyType, anyType, anyType); + var anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); + var defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); + var asyncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfAsyncIterable", iteratorCacheKey: "iterationTypesOfAsyncIterator", iteratorSymbolName: "asyncIterator", @@ -42763,7 +43250,7 @@ function createTypeChecker(host) { mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method, mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property }; - const syncIterationTypesResolver = { + var syncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfIterable", iteratorCacheKey: "iterationTypesOfIterator", iteratorSymbolName: "iterator", @@ -42776,117 +43263,118 @@ function createTypeChecker(host) { mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_iterator_must_be_a_method, mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property }; - let amalgamatedDuplicates; - const reverseMappedCache = /* @__PURE__ */ new Map(); - let inInferTypeForHomomorphicMappedType = false; - let ambientModulesCache; - let patternAmbientModules; - let patternAmbientModuleAugmentations; - let globalObjectType; - let globalFunctionType; - let globalCallableFunctionType; - let globalNewableFunctionType; - let globalArrayType; - let globalReadonlyArrayType; - let globalStringType; - let globalNumberType; - let globalBooleanType; - let globalRegExpType; - let globalThisType; - let anyArrayType; - let autoArrayType; - let anyReadonlyArrayType; - let deferredGlobalNonNullableTypeAlias; - let deferredGlobalESSymbolConstructorSymbol; - let deferredGlobalESSymbolConstructorTypeSymbol; - let deferredGlobalESSymbolType; - let deferredGlobalTypedPropertyDescriptorType; - let deferredGlobalPromiseType; - let deferredGlobalPromiseLikeType; - let deferredGlobalPromiseConstructorSymbol; - let deferredGlobalPromiseConstructorLikeType; - let deferredGlobalIterableType; - let deferredGlobalIteratorType; - let deferredGlobalIterableIteratorType; - let deferredGlobalGeneratorType; - let deferredGlobalIteratorYieldResultType; - let deferredGlobalIteratorReturnResultType; - let deferredGlobalAsyncIterableType; - let deferredGlobalAsyncIteratorType; - let deferredGlobalAsyncIterableIteratorType; - let deferredGlobalAsyncGeneratorType; - let deferredGlobalTemplateStringsArrayType; - let deferredGlobalImportMetaType; - let deferredGlobalImportMetaExpressionType; - let deferredGlobalImportCallOptionsType; - let deferredGlobalExtractSymbol; - let deferredGlobalOmitSymbol; - let deferredGlobalAwaitedSymbol; - let deferredGlobalBigIntType; - let deferredGlobalNaNSymbol; - let deferredGlobalRecordSymbol; - let deferredGlobalClassDecoratorContextType; - let deferredGlobalClassMethodDecoratorContextType; - let deferredGlobalClassGetterDecoratorContextType; - let deferredGlobalClassSetterDecoratorContextType; - let deferredGlobalClassAccessorDecoratorContextType; - let deferredGlobalClassAccessorDecoratorTargetType; - let deferredGlobalClassAccessorDecoratorResultType; - let deferredGlobalClassFieldDecoratorContextType; - const allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); - let flowLoopStart = 0; - let flowLoopCount = 0; - let sharedFlowCount = 0; - let flowAnalysisDisabled = false; - let flowInvocationCount = 0; - let lastFlowNode; - let lastFlowNodeReachable; - let flowTypeCache; - const contextualTypeNodes = []; - const contextualTypes = []; - let contextualTypeCount = 0; - const inferenceContextNodes = []; - const inferenceContexts = []; - let inferenceContextCount = 0; - const emptyStringType = getStringLiteralType(""); - const zeroType = getNumberLiteralType(0); - const zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); - const resolutionTargets = []; - const resolutionResults = []; - const resolutionPropertyNames = []; - let suggestionCount = 0; - const maximumSuggestionCount = 10; - const mergedSymbols = []; - const symbolLinks = []; - const nodeLinks = []; - const flowLoopCaches = []; - const flowLoopNodes = []; - const flowLoopKeys = []; - const flowLoopTypes = []; - const sharedFlowNodes = []; - const sharedFlowTypes = []; - const flowNodeReachable = []; - const flowNodePostSuper = []; - const potentialThisCollisions = []; - const potentialNewTargetCollisions = []; - const potentialWeakMapSetCollisions = []; - const potentialReflectCollisions = []; - const potentialUnusedRenamedBindingElementsInTypes = []; - const awaitedTypeStack = []; - const diagnostics = createDiagnosticCollection(); - const suggestionDiagnostics = createDiagnosticCollection(); - const typeofType = createTypeofType(); - let _jsxNamespace; - let _jsxFactoryEntity; - const subtypeRelation = /* @__PURE__ */ new Map(); - const strictSubtypeRelation = /* @__PURE__ */ new Map(); - const assignableRelation = /* @__PURE__ */ new Map(); - const comparableRelation = /* @__PURE__ */ new Map(); - const identityRelation = /* @__PURE__ */ new Map(); - const enumRelation = /* @__PURE__ */ new Map(); - const builtinGlobals = createSymbolTable(); + var amalgamatedDuplicates; + var reverseMappedCache = /* @__PURE__ */ new Map(); + var inInferTypeForHomomorphicMappedType = false; + var ambientModulesCache; + var patternAmbientModules; + var patternAmbientModuleAugmentations; + var globalObjectType; + var globalFunctionType; + var globalCallableFunctionType; + var globalNewableFunctionType; + var globalArrayType; + var globalReadonlyArrayType; + var globalStringType; + var globalNumberType; + var globalBooleanType; + var globalRegExpType; + var globalThisType; + var anyArrayType; + var autoArrayType; + var anyReadonlyArrayType; + var deferredGlobalNonNullableTypeAlias; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolConstructorTypeSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseLikeType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalGeneratorType; + var deferredGlobalIteratorYieldResultType; + var deferredGlobalIteratorReturnResultType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalAsyncGeneratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredGlobalImportMetaType; + var deferredGlobalImportMetaExpressionType; + var deferredGlobalImportCallOptionsType; + var deferredGlobalExtractSymbol; + var deferredGlobalOmitSymbol; + var deferredGlobalAwaitedSymbol; + var deferredGlobalBigIntType; + var deferredGlobalNaNSymbol; + var deferredGlobalRecordSymbol; + var deferredGlobalClassDecoratorContextType; + var deferredGlobalClassMethodDecoratorContextType; + var deferredGlobalClassGetterDecoratorContextType; + var deferredGlobalClassSetterDecoratorContextType; + var deferredGlobalClassAccessorDecoratorContextType; + var deferredGlobalClassAccessorDecoratorTargetType; + var deferredGlobalClassAccessorDecoratorResultType; + var deferredGlobalClassFieldDecoratorContextType; + var allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); + var flowLoopStart = 0; + var flowLoopCount = 0; + var sharedFlowCount = 0; + var flowAnalysisDisabled = false; + var flowInvocationCount = 0; + var lastFlowNode; + var lastFlowNodeReachable; + var flowTypeCache; + var contextualTypeNodes = []; + var contextualTypes = []; + var contextualIsCache = []; + var contextualTypeCount = 0; + var inferenceContextNodes = []; + var inferenceContexts = []; + var inferenceContextCount = 0; + var emptyStringType = getStringLiteralType(""); + var zeroType = getNumberLiteralType(0); + var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); + var resolutionTargets = []; + var resolutionResults = []; + var resolutionPropertyNames = []; + var suggestionCount = 0; + var maximumSuggestionCount = 10; + var mergedSymbols = []; + var symbolLinks = []; + var nodeLinks = []; + var flowLoopCaches = []; + var flowLoopNodes = []; + var flowLoopKeys = []; + var flowLoopTypes = []; + var sharedFlowNodes = []; + var sharedFlowTypes = []; + var flowNodeReachable = []; + var flowNodePostSuper = []; + var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; + var potentialWeakMapSetCollisions = []; + var potentialReflectCollisions = []; + var potentialUnusedRenamedBindingElementsInTypes = []; + var awaitedTypeStack = []; + var diagnostics = createDiagnosticCollection(); + var suggestionDiagnostics = createDiagnosticCollection(); + var typeofType = createTypeofType(); + var _jsxNamespace; + var _jsxFactoryEntity; + var subtypeRelation = /* @__PURE__ */ new Map(); + var strictSubtypeRelation = /* @__PURE__ */ new Map(); + var assignableRelation = /* @__PURE__ */ new Map(); + var comparableRelation = /* @__PURE__ */ new Map(); + var identityRelation = /* @__PURE__ */ new Map(); + var enumRelation = /* @__PURE__ */ new Map(); + var builtinGlobals = createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); - const suggestedExtensions = [ + var suggestedExtensions = [ [".mts", ".mjs"], [".ts", ".js"], [".cts", ".cjs"], @@ -44278,7 +44766,12 @@ function createTypeChecker(host) { } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { const exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - const exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + const exportSymbol = exportValue ? getPropertyOfType( + getTypeOfSymbol(exportValue), + name, + /*skipObjectFunctionPropertyAugment*/ + true + ) : moduleSymbol.exports.get(name); const resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly( sourceNode, @@ -45313,12 +45806,9 @@ function createTypeChecker(host) { if (resolutionDiagnostic) { error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); } else { - const tsExtension = tryExtractTSExtension(moduleReference); const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); const resolutionIsNode16OrNext = moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */; - if (tsExtension) { - errorOnTSExtensionImport(tsExtension); - } else if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { + if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); @@ -45338,14 +45828,12 @@ function createTypeChecker(host) { } } return void 0; - function errorOnTSExtensionImport(tsExtension) { - const diag2 = Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead; - error(errorNode, diag2, tsExtension, getSuggestedImportSource(tsExtension)); - } function getSuggestedImportSource(tsExtension) { const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension); if (emitModuleKindIsNonNodeESM(moduleKind) || mode === 99 /* ESNext */) { - return importSourceWithoutExtension + (tsExtension === ".mts" /* Mts */ ? ".mjs" : tsExtension === ".cts" /* Cts */ ? ".cjs" : ".js"); + const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions); + const ext = tsExtension === ".mts" /* Mts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" /* Cts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js"; + return importSourceWithoutExtension + ext; } return importSourceWithoutExtension; } @@ -45532,7 +46020,7 @@ function createTypeChecker(host) { return shouldTreatPropertiesOfExternalModuleAsExports(type) ? getPropertyOfType(type, memberName) : void 0; } function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) { - return !(resolvedExternalModuleType.flags & 131068 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path + return !(resolvedExternalModuleType.flags & 134348796 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path isArrayType(resolvedExternalModuleType) || isTupleType(resolvedExternalModuleType)); } function getExportsOfSymbol(symbol) { @@ -46831,7 +47319,7 @@ function createTypeChecker(host) { return result; } function createAnonymousTypeNode(type2) { - var _a3; + var _a3, _b2; const typeId = type2.id; const symbol = type2.symbol; if (symbol) { @@ -46857,6 +47345,20 @@ function createTypeChecker(host) { return visitAndTransformType(type2, createTypeNodeFromObjectType); } } else { + const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */); + if (isInstantiationExpressionType) { + const instantiationExpressionType = type2; + if (isTypeQueryNode(instantiationExpressionType.node)) { + const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node); + if (typeNode) { + return typeNode; + } + } + if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { + return createElidedInformationPlaceholder(context); + } + return visitAndTransformType(type2, createTypeNodeFromObjectType); + } return createTypeNodeFromObjectType(type2); } function shouldWriteTypeOfFunctionSymbol() { @@ -47365,7 +47867,7 @@ function createTypeChecker(host) { ); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { - var _a2, _b, _c, _d; + var _a2, _b, _c, _d, _e; const suppressAny = context.flags & 256 /* SuppressAnyReturnType */; if (suppressAny) context.flags &= ~256 /* SuppressAnyReturnType */; @@ -47382,6 +47884,39 @@ function createTypeChecker(host) { /*skipUnionExpanding*/ true )[0]; + let cleanup; + if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) { + const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0; + Debug.assertOptionalNode(existingFakeScope, isBlock); + const locals = (_a2 = existingFakeScope == null ? void 0 : existingFakeScope.locals) != null ? _a2 : createSymbolTable(); + let newLocals; + for (const param of expandedParams) { + if (!locals.has(param.escapedName)) { + newLocals = append(newLocals, param.escapedName); + locals.set(param.escapedName, param); + } + } + if (newLocals) { + let removeNewLocals2 = function() { + forEach(newLocals, (s) => locals.delete(s)); + }; + var removeNewLocals = removeNewLocals2; + if (existingFakeScope) { + cleanup = removeNewLocals2; + } else { + const fakeScope = parseNodeFactory.createBlock(emptyArray); + getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true; + fakeScope.locals = locals; + const saveEnclosingDeclaration = context.enclosingDeclaration; + setParent(fakeScope, saveEnclosingDeclaration); + context.enclosingDeclaration = fakeScope; + cleanup = () => { + context.enclosingDeclaration = saveEnclosingDeclaration; + removeNewLocals2(); + }; + } + } + } const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports)); const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context); if (thisParameter) { @@ -47407,11 +47942,11 @@ function createTypeChecker(host) { const flags = modifiersToFlags(modifiers); modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */); } - const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration( + const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration( modifiers, /*asteriskToken*/ void 0, - (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), + (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), /*questionToken*/ void 0, typeParameters, @@ -47426,14 +47961,14 @@ function createTypeChecker(host) { void 0 ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration( modifiers, - (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), + (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ void 0 ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration( modifiers, - (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), + (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""), parameters, /*body*/ void 0 @@ -47468,13 +48003,14 @@ function createTypeChecker(host) { if (typeArguments) { node.typeArguments = factory.createNodeArray(typeArguments); } + cleanup == null ? void 0 : cleanup(); return node; } function tryGetThisParameterDeclaration(signature, context) { if (signature.thisParameter) { return symbolToParameterDeclaration(signature.thisParameter, context); } - if (signature.declaration) { + if (signature.declaration && isInJSFile(signature.declaration)) { const thisTag = getJSDocThisTag(signature.declaration); if (thisTag && thisTag.typeExpression) { return factory.createParameterDeclaration( @@ -48082,9 +48618,12 @@ function createTypeChecker(host) { function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) { return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters); } + function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) { + return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration; + } function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) { if (!isErrorType(type) && enclosingDeclaration) { - const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration); + const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration)); if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) { const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation); if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) { @@ -48116,7 +48655,8 @@ function createTypeChecker(host) { function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) { if (!isErrorType(type) && context.enclosingDeclaration) { const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); - if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) { + const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration); + if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) { const annotated = getTypeFromTypeNode(annotation); const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated; if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) { @@ -49731,8 +50271,8 @@ function createTypeChecker(host) { const t = types[i]; flags |= t.flags; if (!(t.flags & 98304 /* Nullable */)) { - if (t.flags & (512 /* BooleanLiteral */ | 1024 /* EnumLiteral */)) { - const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLiteralType(t); + if (t.flags & (512 /* BooleanLiteral */ | 1056 /* EnumLike */)) { + const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLikeType(t); if (baseType.flags & 1048576 /* Union */) { const count = baseType.types.length; if (i + count <= types.length && getRegularTypeOfLiteralType(types[i + count - 1]) === getRegularTypeOfLiteralType(baseType.types[count - 1])) { @@ -49987,7 +50527,7 @@ function createTypeChecker(host) { } function findResolutionCycleStartIndex(target, propertyName) { for (let i = resolutionTargets.length - 1; i >= 0; i--) { - if (hasType2(resolutionTargets[i], resolutionPropertyNames[i])) { + if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) { return -1; } if (resolutionTargets[i] === target && resolutionPropertyNames[i] === propertyName) { @@ -49996,7 +50536,7 @@ function createTypeChecker(host) { } return -1; } - function hasType2(target, propertyName) { + function resolutionTargetHasProperty(target, propertyName) { switch (propertyName) { case 0 /* Type */: return !!getSymbolLinks(target).type; @@ -50016,6 +50556,8 @@ function createTypeChecker(host) { return !!target.baseTypesResolved; case 8 /* WriteType */: return !!getSymbolLinks(target).writeType; + case 9 /* ParameterInitializerContainsUndefined */: + return getNodeLinks(target).parameterInitializerContainsUndefined !== void 0; } return Debug.assertNever(propertyName); } @@ -50455,7 +50997,7 @@ function createTypeChecker(host) { function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) { const container = getAssignedExpandoInitializer(symbol.valueDeclaration); if (container) { - const tag = getJSDocTypeTag(container); + const tag = isInJSFile(container) ? getJSDocTypeTag(container) : void 0; if (tag && tag.typeExpression) { return getTypeFromTypeNode(tag.typeExpression); } @@ -51607,8 +52149,8 @@ function createTypeChecker(host) { } return links.declaredType; } - function getBaseTypeOfEnumLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; + function getBaseTypeOfEnumLikeType(type) { + return type.flags & 1056 /* EnumLike */ && type.symbol.flags & 8 /* EnumMember */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; } function getDeclaredTypeOfEnum(symbol) { const links = getSymbolLinks(symbol); @@ -51621,7 +52163,7 @@ function createTypeChecker(host) { if (hasBindableName(member)) { const memberSymbol = getSymbolOfDeclaration(member); const value = getEnumMemberValue(member); - const memberType = value !== void 0 ? getFreshTypeOfLiteralType(getEnumLiteralType(value, getSymbolId(symbol), memberSymbol)) : createTypeWithSymbol(32 /* Enum */, memberSymbol); + const memberType = getFreshTypeOfLiteralType(value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol)); getSymbolLinks(memberSymbol).declaredType = memberType; memberTypeList.push(getRegularTypeOfLiteralType(memberType)); } @@ -51635,7 +52177,7 @@ function createTypeChecker(host) { symbol, /*aliasTypeArguments*/ void 0 - ) : createTypeWithSymbol(32 /* Enum */, symbol); + ) : createComputedEnumType(symbol); if (enumType.flags & 1048576 /* Union */) { enumType.flags |= 1024 /* EnumLiteral */; enumType.symbol = symbol; @@ -51644,6 +52186,15 @@ function createTypeChecker(host) { } return links.declaredType; } + function createComputedEnumType(symbol) { + const regularType = createTypeWithSymbol(32 /* Enum */, symbol); + const freshType = createTypeWithSymbol(32 /* Enum */, symbol); + regularType.regularType = regularType; + regularType.freshType = freshType; + freshType.regularType = regularType; + freshType.freshType = freshType; + return regularType; + } function getDeclaredTypeOfEnumMember(symbol) { const links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -52592,6 +53143,7 @@ function createTypeChecker(host) { const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); const nameType = getNameTypeFromMappedType(type.target || type); + const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); const templateType = getTemplateTypeFromMappedType(type.target || type); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); const templateModifiers = getMappedTypeModifiers(type); @@ -52629,7 +53181,7 @@ function createTypeChecker(host) { prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = nameType ? void 0 : modifiersProp.declarations; + prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0; } members.set(propName, prop); } @@ -53573,6 +54125,12 @@ function createTypeChecker(host) { thisParameter = getAnnotatedAccessorThisParameter(other); } } + if (isInJSFile(declaration)) { + const thisTag = getJSDocThisTag(declaration); + if (thisTag && thisTag.typeExpression) { + thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression)); + } + } const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0; const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) { @@ -53686,7 +54244,11 @@ function createTypeChecker(host) { if (node.tags) { for (const tag of node.tags) { if (isJSDocOverloadTag(tag)) { - result.push(getSignatureFromDeclaration(tag.typeExpression)); + const jsDocSignature = tag.typeExpression; + if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) { + reportImplicitAny(jsDocSignature, anyType); + } + result.push(getSignatureFromDeclaration(jsDocSignature)); hasJSDocOverloads = true; } } @@ -53795,6 +54357,12 @@ function createTypeChecker(host) { if (declaration.kind === 173 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } + if (isJSDocSignature(declaration)) { + const root = getJSDocRoot(declaration); + if (root && isConstructorDeclaration(root.parent)) { + return getDeclaredTypeOfClassOrInterface(getMergedSymbol(root.parent.parent.symbol)); + } + } if (isJSDocConstructSignature(declaration)) { return getTypeFromTypeNode(declaration.parameters[0].type); } @@ -53973,7 +54541,7 @@ function createTypeChecker(host) { const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); if (grandParent.kind === 180 /* TypeReference */ && !omitTypeReferences) { const typeReference = grandParent; - const typeParameters = getTypeParametersForTypeReference(typeReference); + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); if (typeParameters) { const index = typeReference.typeArguments.indexOf(childTypeParameter); if (index < typeParameters.length) { @@ -54323,7 +54891,7 @@ function createTypeChecker(host) { return links.resolvedJSDocType; } function getSubstitutionType(baseType, constraint) { - if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) { + if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */) { return baseType; } const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`; @@ -55266,7 +55834,7 @@ function createTypeChecker(host) { } } function removeStringLiteralsMatchedByTemplateLiterals(types) { - const templates = filter(types, isPatternLiteralType); + const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)); if (templates.length) { let i = types.length; while (i > 0) { @@ -55316,7 +55884,7 @@ function createTypeChecker(host) { orderedRemoveItemAt(typeSet, 1); } } - if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) { + if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) { removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */)); } if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { @@ -55385,7 +55953,7 @@ function createTypeChecker(host) { function typePredicateKindsMatch(a, b) { return a.kind === b.kind && a.parameterIndex === b.parameterIndex; } - function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments, origin) { + function getUnionTypeFromSortedList(types, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) { if (types.length === 0) { return neverType; } @@ -55397,7 +55965,7 @@ function createTypeChecker(host) { let type = unionTypes.get(id); if (!type) { type = createType(1048576 /* Union */); - type.objectFlags = objectFlags | getPropagatingFlagsOfTypes( + type.objectFlags = precomputedObjectFlags | getPropagatingFlagsOfTypes( types, /*excludeKinds*/ 98304 /* Nullable */ @@ -55447,7 +56015,7 @@ function createTypeChecker(host) { type = undefinedType; } if (!typeSet.has(type.id.toString())) { - if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) { + if (type.flags & 109472 /* Unit */ && includes & 109472 /* Unit */) { includes |= 67108864 /* NonPrimitive */; } typeSet.set(type.id.toString(), type); @@ -55723,7 +56291,7 @@ function createTypeChecker(host) { const typeVariable = getTypeParameterFromMappedType(mappedType); return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable); function isDistributive(type) { - return type.flags & (3 /* AnyOrUnknown */ | 131068 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; + return type.flags & (3 /* AnyOrUnknown */ | 134348796 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; } } function getLiteralTypeFromPropertyName(name) { @@ -56010,7 +56578,7 @@ function createTypeChecker(host) { } } const propType = getTypeOfSymbol(prop); - return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : propType; + return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : accessNode && isIndexedAccessTypeNode(accessNode) && containsMissingType(propType) ? getUnionType([propType, undefinedType]) : propType; } if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) { const index = +propName; @@ -56376,7 +56944,7 @@ function createTypeChecker(host) { } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.baseType; + return getActualTypeVariable(type.baseType); } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { return getIndexedAccessType(getActualTypeVariable(type.objectType), getActualTypeVariable(type.indexType)); @@ -56574,11 +57142,6 @@ function createTypeChecker(host) { var _a2; const links = getNodeLinks(node); if (!links.resolvedType) { - if (node.isTypeOf && node.typeArguments) { - error(node, Diagnostics.Type_arguments_cannot_be_used_here); - links.resolvedSymbol = unknownSymbol; - return links.resolvedType = errorType; - } if (!isLiteralImportTypeNode(node)) { error(node.argument, Diagnostics.String_literal_expected); links.resolvedSymbol = unknownSymbol; @@ -56639,15 +57202,8 @@ function createTypeChecker(host) { const resolvedSymbol = resolveSymbol(symbol); links.resolvedSymbol = resolvedSymbol; if (meaning === 111551 /* Value */) { - return getTypeOfSymbol(symbol); + return getInstantiationExpressionType(getTypeOfSymbol(symbol), node); } else { - const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol); - const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol); - if (node.typeArguments && typeParameters) { - addLazyDiagnostic(() => { - checkTypeArgumentConstraints(node, typeParameters); - }); - } return getTypeReferenceType(node, resolvedSymbol); } } @@ -56825,7 +57381,7 @@ function createTypeChecker(host) { return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 2944 /* Literal */) { + if (type.flags & 2976 /* Freshable */) { if (!type.freshType) { const freshType = createLiteralType(type.flags, type.value, type.symbol, type); freshType.freshType = freshType; @@ -56836,10 +57392,10 @@ function createTypeChecker(host) { return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 2944 /* Literal */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; + return type.flags & 2976 /* Freshable */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; } function isFreshLiteralType(type) { - return !!(type.flags & 2944 /* Literal */) && type.freshType === type; + return !!(type.flags & 2976 /* Freshable */) && type.freshType === type; } function getStringLiteralType(value) { let type; @@ -57518,13 +58074,13 @@ function createTypeChecker(host) { return type; } function getUniqueLiteralFilledInstantiation(type) { - return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); + return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); } function getPermissiveInstantiation(type) { - return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); + return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); } function getRestrictiveInstantiation(type) { - if (type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { + if (type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { return type; } if (type.restrictiveInstantiation) { @@ -57796,7 +58352,12 @@ function createTypeChecker(host) { } } function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) { - pushContextualType(next, sourcePropType); + pushContextualType( + next, + sourcePropType, + /*isCache*/ + false + ); const result = checkExpressionForMutableLocation(next, 1 /* Contextual */); popContextualType(); return result; @@ -58099,12 +58660,17 @@ function createTypeChecker(host) { } } function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (131068 /* Primitive */ | 131072 /* Never */)) + if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */)) return false; if (isTupleLikeType(source)) { return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); } - pushContextualType(node, target); + pushContextualType( + node, + target, + /*isCache*/ + false + ); const tupleizedType = checkArrayLiteral( node, 1 /* Contextual */, @@ -58143,7 +58709,7 @@ function createTypeChecker(host) { } } function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (131068 /* Primitive */ | 131072 /* Never */)) + if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */)) return false; return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); } @@ -58166,16 +58732,24 @@ function createTypeChecker(host) { void 0 ) !== 0 /* False */; } - function isAnySignature(s) { - return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s)); + function isTopSignature(s) { + if (!s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s)) { + const paramType = getTypeOfParameter(s.parameters[0]); + const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType; + return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */); + } + return false; } function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) { if (source === target) { return -1 /* True */; } - if (isAnySignature(target)) { + if (!(checkMode & 16 /* StrictTopSignature */ && isTopSignature(source)) && isTopSignature(target)) { return -1 /* True */; } + if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) { + return 0 /* False */; + } const targetCount = getParameterCount(target); const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { @@ -58393,7 +58967,9 @@ function createTypeChecker(host) { function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { const s = source.flags; const t = target.flags; - if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType) + if (t & 1 /* Any */ || s & 131072 /* Never */ || source === wildcardType) + return true; + if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */)) return true; if (t & 131072 /* Never */) return false; @@ -58520,7 +59096,6 @@ function createTypeChecker(host) { let overrideNextErrorInfo = 0; let lastSkippedInfo; let incompatibleStack; - let inPropertyCheck = false; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); const result = isRelatedTo( source, @@ -58717,7 +59292,8 @@ function createTypeChecker(host) { Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable"); generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource); } - if (target2.flags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { + const targetFlags = target2.flags & 8388608 /* IndexedAccess */ && !(source2.flags & 8388608 /* IndexedAccess */) ? target2.objectType.flags : target2.flags; + if (targetFlags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { const constraint = getBaseConstraintOfType(target2); let needsOriginalSource; if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) { @@ -58790,7 +59366,7 @@ function createTypeChecker(host) { return isRelatedTo(source2, target2, 3 /* Both */, reportErrors2); } function isRelatedTo(originalSource, originalTarget, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2, intersectionState = 0 /* None */) { - if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 131068 /* Primitive */) { + if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 134348796 /* Primitive */) { if (relation === comparableRelation && !(originalTarget.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(originalTarget, originalSource, relation) || isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors2 ? reportError : void 0)) { return -1 /* True */; } @@ -58854,7 +59430,7 @@ function createTypeChecker(host) { return 0 /* False */; } } - const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures2(source2)); + const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (134348796 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2)); const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */); if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) { if (reportErrors2) { @@ -58916,7 +59492,7 @@ function createTypeChecker(host) { maybeSuppress = !!errorInfo; } } - if (source2.flags & 524288 /* Object */ && target2.flags & 131068 /* Primitive */) { + if (source2.flags & 524288 /* Object */ && target2.flags & 134348796 /* Primitive */) { tryElaborateErrorsForPrimitivesAndObjects(source2, target2); } else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) { reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead); @@ -59062,15 +59638,15 @@ function createTypeChecker(host) { } function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) { if (source2.flags & 1048576 /* Union */) { - return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */), intersectionState); + return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState); } if (target2.flags & 1048576 /* Union */) { - return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */) && !(target2.flags & 131068 /* Primitive */)); + return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */) && !(target2.flags & 134348796 /* Primitive */)); } if (target2.flags & 2097152 /* Intersection */) { return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */); } - if (relation === comparableRelation && target2.flags & 131068 /* Primitive */) { + if (relation === comparableRelation && target2.flags & 134348796 /* Primitive */) { const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t); if (constraints !== source2.types) { source2 = getIntersectionType(constraints); @@ -59478,14 +60054,15 @@ function createTypeChecker(host) { ); } } - if (result2 && !inPropertyCheck && (target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */) || isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */)))) { - inPropertyCheck = true; + if (result2 && !(intersectionState & 2 /* Target */) && target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */)) { result2 &= propertiesRelatedTo( source2, target2, reportErrors2, /*excludedProperties*/ void 0, + /*optionalsOnly*/ + false, 0 /* None */ ); if (result2 && isObjectLiteralType(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */) { @@ -59498,7 +60075,17 @@ function createTypeChecker(host) { 0 /* None */ ); } - inPropertyCheck = false; + } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { + result2 &= propertiesRelatedTo( + source2, + target2, + reportErrors2, + /*excludedProperties*/ + void 0, + /*optionalsOnly*/ + true, + intersectionState + ); } } if (result2) { @@ -59952,7 +60539,7 @@ function createTypeChecker(host) { } return 0 /* False */; } - const sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */); + const sourceIsPrimitive = !!(sourceFlags & 134348796 /* Primitive */); if (relation !== identityRelation) { source2 = getApparentType(source2); sourceFlags = source2.flags; @@ -59988,12 +60575,14 @@ function createTypeChecker(host) { reportStructuralErrors, /*excludedProperties*/ void 0, + /*optionalsOnly*/ + false, intersectionState ); if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors); + result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors, intersectionState); if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors); + result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors, intersectionState); if (result2) { result2 &= indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportStructuralErrors, intersectionState); } @@ -60122,6 +60711,8 @@ function createTypeChecker(host) { /*reportErrors*/ false, excludedProperties, + /*optionalsOnly*/ + false, 0 /* None */ ); if (result2) { @@ -60130,7 +60721,8 @@ function createTypeChecker(host) { type, 0 /* Call */, /*reportStructuralErrors*/ - false + false, + 0 /* None */ ); if (result2) { result2 &= signaturesRelatedTo( @@ -60138,7 +60730,8 @@ function createTypeChecker(host) { type, 1 /* Construct */, /*reportStructuralErrors*/ - false + false, + 0 /* None */ ); if (result2 && !(isTupleType(source2) && isTupleType(type))) { result2 &= indexSignaturesRelatedTo( @@ -60316,7 +60909,7 @@ function createTypeChecker(host) { } } } - function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, intersectionState) { + function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) { if (relation === identityRelation) { return propertiesIdenticalTo(source2, target2, excludedProperties); } @@ -60452,7 +61045,7 @@ function createTypeChecker(host) { const numericNamesOnly = isTupleType(source2) && isTupleType(target2); for (const targetProp of excludeProperties(properties, excludedProperties)) { const name = targetProp.escapedName; - if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) { + if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length") && (!optionalsOnly || targetProp.flags & 16777216 /* Optional */)) { const sourceProp = getPropertyOfType(source2, name); if (sourceProp && sourceProp !== targetProp) { const related = propertyRelatedTo(source2, target2, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors2, intersectionState, relation === comparableRelation); @@ -60488,7 +61081,7 @@ function createTypeChecker(host) { } return result2; } - function signaturesRelatedTo(source2, target2, kind, reportErrors2) { + function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) { var _a3, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source2, target2, kind); @@ -60525,6 +61118,7 @@ function createTypeChecker(host) { /*erase*/ true, reportErrors2, + intersectionState, incompatibleReporter(sourceSignatures[i], targetSignatures[i]) ); if (!related) { @@ -60536,7 +61130,7 @@ function createTypeChecker(host) { const eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); - result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature)); + result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature)); if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 173 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 173 /* Constructor */)) { const constructSignatureToString = (signature) => signatureToString( signature, @@ -60561,6 +61155,7 @@ function createTypeChecker(host) { /*erase*/ true, shouldElaborateErrors, + intersectionState, incompatibleReporter(s, t) ); if (related) { @@ -60613,17 +61208,29 @@ function createTypeChecker(host) { } return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); } - function signatureRelatedTo(source2, target2, erase, reportErrors2, incompatibleReporter) { + function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) { + const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */; return compareSignaturesRelated( erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, - relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, + checkMode, reportErrors2, reportError, incompatibleReporter, - isRelatedToWorker, + isRelatedToWorker2, reportUnreliableMapper ); + function isRelatedToWorker2(source3, target3, reportErrors3) { + return isRelatedTo( + source3, + target3, + 3 /* Both */, + reportErrors3, + /*headMessage*/ + void 0, + intersectionState + ); + } } function signaturesIdenticalTo(source2, target2, kind) { const sourceSignatures = getSignaturesOfType(source2, kind); @@ -60682,7 +61289,7 @@ function createTypeChecker(host) { } for (const info of getIndexInfosOfType(source2)) { if (isApplicableIndexType(info.keyType, keyType)) { - const related = indexInfoRelatedTo(info, targetInfo, reportErrors2); + const related = indexInfoRelatedTo(info, targetInfo, reportErrors2, intersectionState); if (!related) { return 0 /* False */; } @@ -60691,8 +61298,16 @@ function createTypeChecker(host) { } return result2; } - function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2) { - const related = isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */, reportErrors2); + function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState) { + const related = isRelatedTo( + sourceInfo.type, + targetInfo.type, + 3 /* Both */, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); if (!related && reportErrors2) { if (sourceInfo.keyType === targetInfo.keyType) { reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType)); @@ -60721,9 +61336,9 @@ function createTypeChecker(host) { function typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) { const sourceInfo = getApplicableIndexInfo(source2, targetInfo.keyType); if (sourceInfo) { - return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2); + return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState); } - if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) { + if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) { return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); } if (reportErrors2) { @@ -61012,12 +61627,15 @@ function createTypeChecker(host) { } function isDeeplyNestedType(type, stack, depth, maxDepth = 3) { if (depth >= maxDepth) { + if (type.flags & 2097152 /* Intersection */) { + return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth)); + } const identity2 = getRecursionIdentity(type); let count = 0; let lastTypeId = 0; for (let i = 0; i < depth; i++) { const t = stack[i]; - if (getRecursionIdentity(t) === identity2) { + if (t.flags & 2097152 /* Intersection */ ? some(t.types, (u) => getRecursionIdentity(u) === identity2) : getRecursionIdentity(t) === identity2) { if (t.id >= lastTypeId) { count++; if (count >= maxDepth) { @@ -61250,15 +61868,25 @@ function createTypeChecker(host) { return propType; } if (everyType(type, isTupleType)) { - return mapType(type, (t) => getRestTypeOfTupleType(t) || undefinedType); + return mapType(type, (t) => { + const tupleType = t; + const restType = getRestTypeOfTupleType(tupleType); + if (!restType) { + return undefinedType; + } + if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) { + return getUnionType([restType, undefinedType]); + } + return restType; + }); } return void 0; } function isNeitherUnitTypeNorNever(type) { - return !(type.flags & (109440 /* Unit */ | 131072 /* Never */)); + return !(type.flags & (109472 /* Unit */ | 131072 /* Never */)); } function isUnitType(type) { - return !!(type.flags & 109440 /* Unit */); + return !!(type.flags & 109472 /* Unit */); } function isUnitLikeType(type) { const t = getBaseConstraintOrType(type); @@ -61271,15 +61899,18 @@ function createTypeChecker(host) { return type.flags & 16 /* Boolean */ ? true : type.flags & 1048576 /* Union */ ? type.flags & 1024 /* EnumLiteral */ ? true : every(type.types, isUnitType) : isUnitType(type); } function getBaseTypeOfLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; + return type.flags & 1056 /* EnumLike */ ? getBaseTypeOfEnumLikeType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; } function getBaseTypeOfLiteralTypeUnion(type) { var _a2; const key = `B${getTypeId(type)}`; return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralType)); } + function getBaseTypeOfLiteralTypeForComparison(type) { + return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type; + } function getWidenedLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; + return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; } function getWidenedUniqueESSymbolType(type) { return type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedUniqueESSymbolType) : type; @@ -61320,7 +61951,7 @@ function createTypeChecker(host) { const restType = getRestTypeOfTupleType(type); return restType && createArrayType(restType); } - function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false) { + function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false, noReductions = false) { const length2 = getTypeReferenceArity(type) - endSkipCount; if (index < length2) { const typeArguments = getTypeArguments(type); @@ -61329,7 +61960,7 @@ function createTypeChecker(host) { const t = typeArguments[i]; elementTypes.push(type.target.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t); } - return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes); + return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes, noReductions ? 0 /* None */ : 1 /* Literal */); } return void 0; } @@ -61397,7 +62028,7 @@ function createTypeChecker(host) { } function isObjectTypeWithInferableIndex(type) { const objectFlags = getObjectFlags(type); - return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures2(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); + return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); } function createSymbolWithType(source, type) { const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */); @@ -61635,6 +62266,11 @@ function createTypeChecker(host) { case 320 /* JSDocFunctionType */: error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; + case 326 /* JSDocSignature */: + if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { + error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); + } + return; case 259 /* FunctionDeclaration */: case 171 /* MethodDeclaration */: case 170 /* MethodSignature */: @@ -61807,8 +62443,8 @@ function createTypeChecker(host) { } return false; } - function isTypeParameterAtTopLevel(type, typeParameter) { - return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + function isTypeParameterAtTopLevel(type, tp, depth = 0) { + return !!(type === tp || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, tp, depth)) || depth < 3 && type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), tp, depth + 1) || isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), tp, depth + 1))); } function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { const typePredicate = getTypePredicateOfSignature(signature); @@ -61902,7 +62538,7 @@ function createTypeChecker(host) { yield targetProp; } else if (matchDiscriminantProperties) { const targetType = getTypeOfSymbol(targetProp); - if (targetType.flags & 109440 /* Unit */) { + if (targetType.flags & 109472 /* Unit */) { const sourceType = getTypeOfSymbol(sourceProp); if (!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) { yield targetProp; @@ -61963,10 +62599,10 @@ function createTypeChecker(host) { return getBigIntLiteralType(parseValidBigInt(text)); } function isMemberOfStringMapping(source, target) { - if (target.flags & (4 /* String */ | 1 /* Any */)) { + if (target.flags & 1 /* Any */) { return true; } - if (target.flags & 134217728 /* TemplateLiteral */) { + if (target.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) { return isTypeAssignableTo(source, target); } if (target.flags & 268435456 /* StringMapping */) { @@ -62661,7 +63297,7 @@ function createTypeChecker(host) { } function hasPrimitiveConstraint(type) { const constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); } function isObjectLiteralType(type) { return !!(getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -63143,7 +63779,7 @@ function createTypeChecker(host) { return 83886079 /* UnknownFacts */; } function getIntersectionTypeFacts(type) { - const ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */); + const ignoreObjects = maybeTypeOfKind(type, 134348796 /* Primitive */); let oredFacts = 0 /* None */; let andedFacts = 134217727 /* All */; for (const t of type.types) { @@ -63342,7 +63978,7 @@ function createTypeChecker(host) { } return true; } - if (source.flags & 1024 /* EnumLiteral */ && getBaseTypeOfEnumLiteralType(source) === target) { + if (source.flags & 1056 /* EnumLike */ && getBaseTypeOfEnumLikeType(source) === target) { return true; } return containsType(target.types, source); @@ -63380,7 +64016,7 @@ function createTypeChecker(host) { } return getUnionTypeFromSortedList( filtered, - type.objectFlags, + type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */), /*aliasSymbol*/ void 0, /*aliasTypeArguments*/ @@ -63738,10 +64374,12 @@ function createTypeChecker(host) { } function isConstantReference(node) { switch (node.kind) { - case 79 /* Identifier */: { - const symbol = getResolvedSymbol(node); - return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); - } + case 79 /* Identifier */: + if (!isThisInTypeQuery(node)) { + const symbol = getResolvedSymbol(node); + return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); + } + break; case 208 /* PropertyAccessExpression */: case 209 /* ElementAccessExpression */: return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); @@ -63887,7 +64525,7 @@ function createTypeChecker(host) { } return declaredType; } - if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))); } return void 0; @@ -64404,7 +65042,7 @@ function createTypeChecker(host) { } if (assumeTrue) { if (!doubleEquals && (type.flags & 2 /* Unknown */ || someType(type, isEmptyAnonymousObjectType))) { - if (valueType.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { + if (valueType.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { return valueType; } if (valueType.flags & 524288 /* Object */) { @@ -64437,7 +65075,7 @@ function createTypeChecker(host) { return narrowTypeByLiteralExpression(type, literal, assumeTrue); } function narrowTypeByLiteralExpression(type, literal, assumeTrue) { - return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); + return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); } function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) { const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck); @@ -64454,7 +65092,7 @@ function createTypeChecker(host) { let groundClauseTypes; for (let i = 0; i < clauseTypes.length; i += 1) { const t = clauseTypes[i]; - if (t.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */)) { + if (t.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */)) { if (groundClauseTypes !== void 0) { groundClauseTypes.push(t); } @@ -64573,52 +65211,58 @@ function createTypeChecker(host) { if (!isTypeDerivedFrom(rightType, globalFunctionType)) { return type; } - let targetType; - const prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (prototypeProperty) { - const prototypePropertyType = getTypeOfSymbol(prototypeProperty); - if (!isTypeAny(prototypePropertyType)) { - targetType = prototypePropertyType; - } - } - if (isTypeAny(type) && (targetType === globalObjectType || targetType === globalFunctionType)) { + const instanceType = mapType(rightType, getInstanceType); + if (isTypeAny(type) && (instanceType === globalObjectType || instanceType === globalFunctionType) || !assumeTrue && !(instanceType.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(instanceType))) { return type; } - if (!targetType) { - const constructSignatures = getSignaturesOfType(rightType, 1 /* Construct */); - targetType = constructSignatures.length ? getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))) : emptyObjectType; - } - if (!assumeTrue && rightType.flags & 1048576 /* Union */) { - const nonConstructorTypeInUnion = find(rightType.types, (t) => !isConstructorType(t)); - if (!nonConstructorTypeInUnion) - return type; - } return getNarrowedType( type, - targetType, + instanceType, assumeTrue, /*checkDerived*/ true ); } + function getInstanceType(constructorType) { + const prototypePropertyType = getTypeOfPropertyOfType(constructorType, "prototype"); + if (prototypePropertyType && !isTypeAny(prototypePropertyType)) { + return prototypePropertyType; + } + const constructSignatures = getSignaturesOfType(constructorType, 1 /* Construct */); + if (constructSignatures.length) { + return getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))); + } + return emptyObjectType; + } function getNarrowedType(type, candidate, assumeTrue, checkDerived) { var _a3; const key2 = type.flags & 1048576 /* Union */ ? `N${getTypeId(type)},${getTypeId(candidate)},${(assumeTrue ? 1 : 0) | (checkDerived ? 2 : 0)}` : void 0; return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived)); } function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) { - const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; if (!assumeTrue) { - return filterType(type, (t) => !isRelated(t, candidate)); + if (checkDerived) { + return filterType(type, (t) => !isTypeDerivedFrom(t, candidate)); + } + const trueType2 = getNarrowedType( + type, + candidate, + /*assumeTrue*/ + true, + /*checkDerived*/ + false + ); + return filterType(type, (t) => !isTypeSubsetOf(t, trueType2)); } if (type.flags & 3 /* AnyOrUnknown */) { return candidate; } + const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0; const narrowedType = mapType(candidate, (c) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -64722,7 +65366,7 @@ function createTypeChecker(host) { } } function getTypeOfSymbolAtLocation(symbol, location) { - symbol = symbol.exportSymbol || symbol; + symbol = getExportSymbolOfValueSymbolIfExported(symbol); if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) { if (isRightSideOfQualifiedNameOrPropertyAccess(location)) { location = location.parent; @@ -64774,15 +65418,25 @@ function createTypeChecker(host) { function isConstVariable(symbol) { return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0; } - function removeOptionalityFromDeclaredType(declaredType, declaration) { - if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { - const annotationIncludesUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */); - popTypeResolution(); - return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; - } else { - reportCircularityError(declaration.symbol); - return declaredType; + function parameterInitializerContainsUndefined(declaration) { + const links = getNodeLinks(declaration); + if (links.parameterInitializerContainsUndefined === void 0) { + if (!pushTypeResolution(declaration, 9 /* ParameterInitializerContainsUndefined */)) { + reportCircularityError(declaration.symbol); + return true; + } + const containsUndefined = !!(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */); + if (!popTypeResolution()) { + reportCircularityError(declaration.symbol); + return true; + } + links.parameterInitializerContainsUndefined = containsUndefined; } + return links.parameterInitializerContainsUndefined; + } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + const removeUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !parameterInitializerContainsUndefined(declaration); + return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; } function isConstraintPosition(type, node) { const parent = node.parent; @@ -65893,9 +66547,18 @@ function createTypeChecker(host) { if (prop) { return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop); } - if (isTupleType(t)) { - const restType = getRestTypeOfTupleType(t); - if (restType && isNumericLiteralName(name) && +name >= 0) { + if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) { + const restType = getElementTypeOfSliceOfTupleType( + t, + t.target.fixedLength, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ); + if (restType) { return restType; } } @@ -65942,9 +66605,18 @@ function createTypeChecker(host) { return void 0; } function getContextualTypeForElementExpression(arrayContextualType, index) { - return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType( + return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType( arrayContextualType, - (t) => getIteratedTypeOrElementType( + (t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType( + t, + 0, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ) : getIteratedTypeOrElementType( 1 /* Element */, t, undefinedType, @@ -66097,14 +66769,17 @@ function createTypeChecker(host) { return type; } function getContextualType(node, contextFlags) { + var _a2, _b; if (node.flags & 33554432 /* InWithStatement */) { return void 0; } - const index = findContextualNode(node); + const index = findContextualNode( + node, + /*includeCaches*/ + !contextFlags + ); if (index >= 0) { - const cached = contextualTypes[index]; - if (cached || !contextFlags) - return cached; + return contextualTypes[index]; } const { parent } = node; switch (parent.kind) { @@ -66139,7 +66814,9 @@ function createTypeChecker(host) { case 206 /* ArrayLiteralExpression */: { const arrayLiteral = parent; const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); - return getContextualTypeForElementExpression(type, indexOfNode(arrayLiteral.elements, node)); + const spreadIndex = (_b = (_a2 = getNodeLinks(arrayLiteral)).firstSpreadIndex) != null ? _b : _a2.firstSpreadIndex = findIndex(arrayLiteral.elements, isSpreadElement); + const elementIndex = indexOfNode(arrayLiteral.elements, node); + return getContextualTypeForElementExpression(type, spreadIndex < 0 || elementIndex < spreadIndex ? elementIndex : -1); } case 224 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); @@ -66175,17 +66852,30 @@ function createTypeChecker(host) { } return void 0; } - function pushContextualType(node, type) { + function pushCachedContextualType(node) { + pushContextualType( + node, + getContextualType( + node, + /*contextFlags*/ + void 0 + ), + /*isCache*/ + true + ); + } + function pushContextualType(node, type, isCache) { contextualTypeNodes[contextualTypeCount] = node; contextualTypes[contextualTypeCount] = type; + contextualIsCache[contextualTypeCount] = isCache; contextualTypeCount++; } function popContextualType() { contextualTypeCount--; } - function findContextualNode(node) { + function findContextualNode(node, includeCaches) { for (let i = contextualTypeCount - 1; i >= 0; i--) { - if (node === contextualTypeNodes[i]) { + if (node === contextualTypeNodes[i] && (includeCaches || !contextualIsCache[i])) { return i; } } @@ -66208,7 +66898,11 @@ function createTypeChecker(host) { } function getContextualJsxElementAttributesType(node, contextFlags) { if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) { - const index = findContextualNode(node.parent); + const index = findContextualNode( + node.parent, + /*includeCaches*/ + !contextFlags + ); if (index >= 0) { return contextualTypes[index]; } @@ -66479,11 +67173,7 @@ function createTypeChecker(host) { const elementCount = elements.length; const elementTypes = []; const elementFlags = []; - pushContextualType(node, getContextualType( - node, - /*contextFlags*/ - void 0 - )); + pushCachedContextualType(node); const inDestructuringPattern = isAssignmentTarget(node); const inConstContext = isConstContext(node); const contextualType = getApparentTypeOfContextualType( @@ -66646,11 +67336,7 @@ function createTypeChecker(host) { let propertiesTable = createSymbolTable(); let propertiesArray = []; let spread = emptyObjectType; - pushContextualType(node, getContextualType( - node, - /*contextFlags*/ - void 0 - )); + pushCachedContextualType(node); const contextualType = getApparentTypeOfContextualType( node, /*contextFlags*/ @@ -67937,7 +68623,7 @@ function createTypeChecker(host) { function reportNonexistentProperty(propNode, containingType, isUncheckedJS) { let errorInfo; let relatedInfo; - if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 131068 /* Primitive */)) { + if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 134348796 /* Primitive */)) { for (const subtype of containingType.types) { if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) { errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(subtype)); @@ -67990,26 +68676,22 @@ function createTypeChecker(host) { function getSuggestedLibForNonExistentName(name) { const missingName = diagnosticName(name); const allFeatures = getScriptTargetFeatures(); - const libTargets = getOwnKeys(allFeatures); - for (const libTarget of libTargets) { - const containingTypes = getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== void 0 && contains(containingTypes, missingName)) { - return libTarget; - } - } + const typeFeatures = allFeatures.get(missingName); + return typeFeatures && firstIterator(typeFeatures.keys()); } function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { const container = getApparentType(containingType).symbol; if (!container) { return void 0; } + const containingTypeName = symbolName(container); const allFeatures = getScriptTargetFeatures(); - const libTargets = getOwnKeys(allFeatures); - for (const libTarget of libTargets) { - const featuresOfLib = allFeatures[libTarget]; - const featuresOfContainingType = featuresOfLib[symbolName(container)]; - if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) { - return libTarget; + const typeFeatures = allFeatures.get(containingTypeName); + if (typeFeatures) { + for (const [libTarget, featuresOfType] of typeFeatures) { + if (contains(featuresOfType, missingProperty)) { + return libTarget; + } } } } @@ -68538,7 +69220,7 @@ function createTypeChecker(host) { } else { const contextualType = getIndexedAccessType(restType, getNumberLiteralType(i - index), 256 /* Contextual */); const argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } @@ -69072,7 +69754,7 @@ function createTypeChecker(host) { const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */; const isDecorator2 = node.kind === 167 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); - const reportErrors2 = !candidatesOutArray; + const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; let typeArguments; if (!isDecorator2 && !isSuperCall(node)) { typeArguments = node.typeArguments; @@ -70031,7 +70713,7 @@ function createTypeChecker(host) { } } function checkCallExpression(node, checkMode) { - var _a2; + var _a2, _b, _c; checkGrammarTypeArguments(node, node.typeArguments); const signature = getResolvedSignature( node, @@ -70048,7 +70730,7 @@ function createTypeChecker(host) { } if (node.kind === 211 /* NewExpression */) { const declaration = signature.declaration; - if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a2 = getJSDocRoot(declaration)) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 173 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -70076,7 +70758,7 @@ function createTypeChecker(host) { /*allowDeclaration*/ false ); - if ((_a2 = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _a2.size) { + if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) { const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray); jsAssignmentType.objectFlags |= 4096 /* JSLiteral */; return getIntersectionType([returnType, jsAssignmentType]); @@ -70362,6 +71044,9 @@ function createTypeChecker(host) { checkGrammarExpressionWithTypeArguments(node); forEach(node.typeArguments, checkSourceElement); const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + return getInstantiationExpressionType(exprType, node); + } + function getInstantiationExpressionType(exprType, node) { const typeArguments = node.typeArguments; if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) { return exprType; @@ -71785,10 +72470,10 @@ function createTypeChecker(host) { if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 131068 /* Primitive */)) { + if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 134348796 /* Primitive */)) { error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures2(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -72310,8 +72995,8 @@ function createTypeChecker(host) { case 32 /* LessThanEqualsToken */: case 33 /* GreaterThanEqualsToken */: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); - rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); + leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right)); reportOperatorErrorUnless((left2, right2) => { if (isTypeAny(left2) || isTypeAny(right2)) { return true; @@ -72371,7 +73056,7 @@ function createTypeChecker(host) { return leftType; } else { checkAssignmentOperator(rightType); - return getRegularTypeOfObjectLiteral(rightType); + return rightType; } case 27 /* CommaToken */: if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) { @@ -72662,14 +73347,19 @@ function createTypeChecker(host) { return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */)); } function getContextNode(node) { - if (node.kind === 289 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) { + if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) { return node.parent.parent; } return node; } function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) { const contextNode = getContextNode(node); - pushContextualType(contextNode, contextualType); + pushContextualType( + contextNode, + contextualType, + /*isCache*/ + false + ); pushInferenceContext(contextNode, inferenceContext); const type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0)); if (inferenceContext && inferenceContext.intraExpressionInferenceSites) { @@ -73000,7 +73690,7 @@ function createTypeChecker(host) { return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) { return getTypeFromTypeNode(expr.type); - } else if (node.kind === 8 /* NumericLiteral */ || node.kind === 10 /* StringLiteral */ || node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */) { + } else if (isLiteralExpression(node) || isBooleanLiteral(node)) { return checkExpression(node); } return void 0; @@ -73010,7 +73700,12 @@ function createTypeChecker(host) { if (links.contextFreeType) { return links.contextFreeType; } - pushContextualType(node, anyType); + pushContextualType( + node, + anyType, + /*isCache*/ + false + ); const type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */); popContextualType(); return type; @@ -73225,7 +73920,7 @@ function createTypeChecker(host) { error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } - if ((node.questionToken || isJSDocOptionalParameter(node)) && isBindingPattern(node.name) && func.body) { + if (!node.initializer && isOptionalDeclaration(node) && isBindingPattern(node.name) && func.body) { error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { @@ -73747,8 +74442,8 @@ function createTypeChecker(host) { } return void 0; } - function getTypeParametersForTypeReference(node) { - const type = getTypeFromTypeReference(node); + function getTypeParametersForTypeReferenceOrImport(node) { + const type = getTypeFromTypeNode(node); if (!isErrorType(type)) { const symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { @@ -73766,11 +74461,14 @@ function createTypeChecker(host) { } } forEach(node.typeArguments, checkSourceElement); - const type = getTypeFromTypeReference(node); + checkTypeReferenceOrImport(node); + } + function checkTypeReferenceOrImport(node) { + const type = getTypeFromTypeNode(node); if (!isErrorType(type)) { if (node.typeArguments) { addLazyDiagnostic(() => { - const typeParameters = getTypeParametersForTypeReference(node); + const typeParameters = getTypeParametersForTypeReferenceOrImport(node); if (typeParameters) { checkTypeArgumentConstraints(node, typeParameters); } @@ -73792,7 +74490,7 @@ function createTypeChecker(host) { const typeReferenceNode = tryCast(node.parent, isTypeReferenceType); if (!typeReferenceNode) return void 0; - const typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReferenceNode); if (!typeParameters) return void 0; const constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); @@ -73972,7 +74670,7 @@ function createTypeChecker(host) { } } } - getTypeFromTypeNode(node); + checkTypeReferenceOrImport(node); } function checkNamedTupleMember(node) { if (node.dotDotDotToken && node.questionToken) { @@ -74137,6 +74835,17 @@ function createTypeChecker(host) { lastSeenNonAmbientDeclaration = node; } } + if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) { + for (const node2 of current.jsDoc) { + if (node2.tags) { + for (const tag of node2.tags) { + if (isJSDocOverloadTag(tag)) { + hasOverloads = true; + } + } + } + } + } } } if (multipleConstructorImplementation) { @@ -74174,8 +74883,9 @@ function createTypeChecker(host) { const bodySignature = getSignatureFromDeclaration(bodyDeclaration); for (const signature of signatures) { if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { + const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration; addRelatedInfo( - error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), + error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here) ); break; @@ -74268,6 +74978,9 @@ function createTypeChecker(host) { case 273 /* ImportSpecifier */: case 79 /* Identifier */: return 1 /* ExportValue */; + case 170 /* MethodSignature */: + case 168 /* PropertySignature */: + return 2 /* ExportType */; default: return Debug.failBadSyntaxKind(d); } @@ -74291,7 +75004,7 @@ function createTypeChecker(host) { ))) { return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* Primitive */ | 131072 /* Never */)) { + if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) { return void 0; } const thenFunction = getTypeOfPropertyOfType(type, "then"); @@ -74343,7 +75056,7 @@ function createTypeChecker(host) { return awaitedType || errorType; } function isThenableType(type) { - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* Primitive */ | 131072 /* Never */)) { + if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) { return false; } const thenFunction = getTypeOfPropertyOfType(type, "then"); @@ -74392,7 +75105,7 @@ function createTypeChecker(host) { return awaitedType; } } - Debug.assert(getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); + Debug.assert(isAwaitedTypeInstantiation(type) || getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); return type; } function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { @@ -77205,20 +77918,19 @@ function createTypeChecker(host) { } } } - function getMemberOverrideModifierStatus(node, member) { + function getMemberOverrideModifierStatus(node, member, memberSymbol) { if (!member.name) { return 0 /* Ok */; } - const symbol = getSymbolOfDeclaration(node); - const type = getDeclaredTypeOfSymbol(symbol); + const classSymbol = getSymbolOfDeclaration(node); + const type = getDeclaredTypeOfSymbol(classSymbol); const typeWithThis = getTypeWithThisArgument(type); - const staticType = getTypeOfSymbol(symbol); + const staticType = getTypeOfSymbol(classSymbol); const baseTypeNode = getEffectiveBaseTypeNode(node); const baseTypes = baseTypeNode && getBaseTypes(type); const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0; const baseStaticType = getBaseConstructorTypeOfClass(type); const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */); - const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name)); return checkMemberForOverrideModifier( node, staticType, @@ -77231,7 +77943,7 @@ function createTypeChecker(host) { isStatic(member), /* memberIsParameterProperty */ false, - memberName + symbolName(memberSymbol) ); } function getTargetSymbol(s) { @@ -77783,7 +78495,7 @@ function createTypeChecker(host) { getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */) { + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || node.parent.impliedNodeFormat === 1 /* CommonJS */)) { const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 93 /* ExportKeyword */); if (exportModifier) { error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); @@ -78114,8 +78826,6 @@ function createTypeChecker(host) { } else { if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); - } else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) { - grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); } } } @@ -78270,7 +78980,7 @@ function createTypeChecker(host) { const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; - const sym = resolveEntityName( + const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName( id, 67108863 /* All */, /*ignoreErrors*/ @@ -78278,7 +78988,7 @@ function createTypeChecker(host) { /*dontResolveAlias*/ true, node - ); + )); if (sym) { markAliasReferenced(sym, id); if (getAllSymbolFlags(sym) & 111551 /* Value */) { @@ -78322,8 +79032,6 @@ function createTypeChecker(host) { grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead); } else if (moduleKind === 4 /* System */ && !(node.flags & 16777216 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); - } else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && !(node.flags & 16777216 /* Ambient */)) { - grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead); } } } @@ -78651,6 +79359,8 @@ function createTypeChecker(host) { if (!(links.flags & 1 /* TypeChecked */)) { links.deferredNodes || (links.deferredNodes = /* @__PURE__ */ new Set()); links.deferredNodes.add(node); + } else { + Debug.assert(!links.deferredNodes, "A type-checked file should have no deferred nodes."); } } function checkDeferredNodes(context) { @@ -78658,6 +79368,7 @@ function createTypeChecker(host) { if (links.deferredNodes) { links.deferredNodes.forEach(checkDeferredNode); } + links.deferredNodes = void 0; } function checkDeferredNode(node) { var _a2, _b; @@ -78913,7 +79624,7 @@ function createTypeChecker(host) { } return node.parent.kind === 180 /* TypeReference */; } - function isHeritageClauseElementIdentifier(node) { + function isInNameOfExpressionWithTypeArguments(node) { while (node.parent.kind === 208 /* PropertyAccessExpression */) { node = node.parent; } @@ -79023,10 +79734,10 @@ function createTypeChecker(host) { while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) { name = name.parent; } - if (isHeritageClauseElementIdentifier(name)) { + if (isInNameOfExpressionWithTypeArguments(name)) { let meaning = 0 /* None */; if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) { - meaning = 788968 /* Type */; + meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */; if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551 /* Value */; } @@ -79432,8 +80143,8 @@ function createTypeChecker(host) { } return getNamedMembers(propsByName); } - function typeHasCallOrConstructSignatures2(type) { - return typeHasCallOrConstructSignatures(type, checker); + function typeHasCallOrConstructSignatures(type) { + return getSignaturesOfType(type, 0 /* Call */).length !== 0 || getSignaturesOfType(type, 1 /* Construct */).length !== 0; } function getRootSymbols(symbol) { const roots = getImmediateRootSymbols(symbol); @@ -79738,7 +80449,7 @@ function createTypeChecker(host) { return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0; } function getTypeReferenceSerializationKind(typeNameIn, location) { - var _a2, _b; + var _a2; const typeName = getParseTreeNode(typeNameIn, isEntityName); if (!typeName) return 0 /* Unknown */; @@ -79770,7 +80481,7 @@ function createTypeChecker(host) { location ); const resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol; - isTypeOnly || (isTypeOnly = !!((_b = valueSymbol == null ? void 0 : valueSymbol.declarations) == null ? void 0 : _b.every(isTypeOnlyImportOrExportDeclaration))); + isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */))); const typeSymbol = resolveEntityName( typeName, 788968 /* Type */, @@ -79921,7 +80632,7 @@ function createTypeChecker(host) { return false; } function literalTypeToNode(type, enclosing, tracker) { - const enumResult = type.flags & 1024 /* EnumLiteral */ ? nodeBuilder.symbolToExpression( + const enumResult = type.flags & 1056 /* EnumLike */ ? nodeBuilder.symbolToExpression( type.symbol, 111551 /* Value */, enclosing, @@ -80464,6 +81175,7 @@ function createTypeChecker(host) { let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; let sawExportBeforeDecorators = false; + let hasLeadingDecorators = false; for (const modifier of node.modifiers) { if (isDecorator(modifier)) { if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { @@ -80481,8 +81193,22 @@ function createTypeChecker(host) { if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } + if (hasLeadingDecorators && flags & 126975 /* Modifier */) { + Debug.assertIsDefined(firstDecorator); + const sourceFile = getSourceFileOfNode(modifier); + if (!hasParseDiagnostics(sourceFile)) { + addRelatedInfo( + error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here) + ); + return true; + } + return false; + } flags |= 131072 /* Decorator */; - if (flags & 1 /* Export */) { + if (!(flags & 126975 /* Modifier */)) { + hasLeadingDecorators = true; + } else if (flags & 1 /* Export */) { sawExportBeforeDecorators = true; } firstDecorator != null ? firstDecorator : firstDecorator = modifier; @@ -80770,7 +81496,6 @@ function createTypeChecker(host) { case 299 /* PropertyAssignment */: case 300 /* ShorthandPropertyAssignment */: case 267 /* NamespaceExportDeclaration */: - case 181 /* FunctionType */: case 279 /* MissingDeclaration */: return find(node.modifiers, isModifier); default: @@ -81467,7 +82192,7 @@ function createTypeChecker(host) { } function isSimpleLiteralEnumReference(expr) { if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { - return !!(checkExpressionCached(expr).flags & 1024 /* EnumLiteral */); + return !!(checkExpressionCached(expr).flags & 1056 /* EnumLike */); } } function checkAmbientInitializer(node) { @@ -81869,10 +82594,10 @@ function createTypeChecker(host) { } function findMostOverlappyType(source, unionTarget) { let bestMatch; - if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { + if (!(source.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { let matchingCount = 0; for (const target of unionTarget.types) { - if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { + if (!(target.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { const overlap = getIntersectionType([getIndexType(source), getIndexType(target)]); if (overlap.flags & 4194304 /* Index */) { return target; @@ -81890,7 +82615,7 @@ function createTypeChecker(host) { } function filterPrimitivesIfContainsNonPrimitive(type) { if (maybeTypeOfKind(type, 67108864 /* NonPrimitive */)) { - const result = filterType(type, (t) => !(t.flags & 131068 /* Primitive */)); + const result = filterType(type, (t) => !(t.flags & 134348796 /* Primitive */)); if (!(result.flags & 131072 /* Never */)) { return result; } @@ -83293,7 +84018,7 @@ var visitEachChildTable = { [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + nodeVisitor(node.expression, visitor, isExpression) ); }, // Clauses @@ -83380,31 +84105,31 @@ function extractSingleNode(nodes) { // src/compiler/sourcemap.ts function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) { - const { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; - const rawSources = []; - const sources = []; - const sourceToSourceIndexMap = /* @__PURE__ */ new Map(); - let sourcesContent; - const names = []; - let nameToNameIndexMap; - const mappingCharCodes = []; - let mappings = ""; - let lastGeneratedLine = 0; - let lastGeneratedCharacter = 0; - let lastSourceIndex = 0; - let lastSourceLine = 0; - let lastSourceCharacter = 0; - let lastNameIndex = 0; - let hasLast = false; - let pendingGeneratedLine = 0; - let pendingGeneratedCharacter = 0; - let pendingSourceIndex = 0; - let pendingSourceLine = 0; - let pendingSourceCharacter = 0; - let pendingNameIndex = 0; - let hasPending = false; - let hasPendingSource = false; - let hasPendingName = false; + var { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; + var rawSources = []; + var sources = []; + var sourceToSourceIndexMap = /* @__PURE__ */ new Map(); + var sourcesContent; + var names = []; + var nameToNameIndexMap; + var mappingCharCodes = []; + var mappings = ""; + var lastGeneratedLine = 0; + var lastGeneratedCharacter = 0; + var lastSourceIndex = 0; + var lastSourceLine = 0; + var lastSourceCharacter = 0; + var lastNameIndex = 0; + var hasLast = false; + var pendingGeneratedLine = 0; + var pendingGeneratedCharacter = 0; + var pendingSourceIndex = 0; + var pendingSourceLine = 0; + var pendingSourceCharacter = 0; + var pendingNameIndex = 0; + var hasPending = false; + var hasPendingSource = false; + var hasPendingName = false; return { getSources: () => rawSources, addSource, @@ -86468,7 +87193,7 @@ function transformTypeScript(context) { return node; } function tryGetConstEnumValue(node) { - if (compilerOptions.isolatedModules) { + if (getIsolatedModules(compilerOptions)) { return void 0; } return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; @@ -87017,7 +87742,16 @@ function transformClassFields(context) { visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) ); } - return visitEachChild(node, visitor, context); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); } function transformPublicFieldInitializer(node) { if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) { @@ -92350,7 +93084,7 @@ function transformES2018(context) { ); } function visitBinaryExpression(node, expressionResultIsUnused2) { - if (isDestructuringAssignment(node) && node.left.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + if (isDestructuringAssignment(node) && containsObjectRestOrSpread(node.left)) { return flattenDestructuringAssignment( node, visitor, @@ -92482,7 +93216,7 @@ function transformES2018(context) { } function visitForOfStatement(node, outermostLabeledStatement) { const ancestorFacts = enterSubtree(0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */ || isAssignmentPattern(node.initializer) && containsObjectRestOrSpread(node.initializer)) { node = transformForOfStatementWithObjectRest(node); } const result = node.awaitModifier ? transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) : factory2.restoreEnclosingLabel(visitEachChild(node, visitor, context), outermostLabeledStatement); @@ -100319,6 +101053,9 @@ function transformModule(context) { return visitEachChild(node, visitor, context); } function visitImportCallExpression(node) { + if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) { + return visitEachChild(node, visitor, context); + } const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; @@ -102795,7 +103532,7 @@ function transformECMAScriptModule(context) { if (node.isDeclarationFile) { return node; } - if (isExternalModule(node) || compilerOptions.isolatedModules) { + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { currentSourceFile = node; importRequireStatements = void 0; let result = updateExternalModule(node); @@ -103002,7 +103739,7 @@ function transformECMAScriptModule(context) { } function onEmitNode(hint, node, emitCallback) { if (isSourceFile(node)) { - if ((isExternalModule(node) || compilerOptions.isolatedModules) && compilerOptions.importHelpers) { + if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) { helperNameSubstitutions = /* @__PURE__ */ new Map(); } previousOnEmitNode(hint, node, emitCallback); @@ -103854,7 +104591,7 @@ function transformDeclarations(context) { if (elem.kind === 229 /* OmittedExpression */) { return elem; } - if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) { + if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) { return factory2.updateBindingElement( elem, elem.dotDotDotToken, @@ -105716,15 +106453,15 @@ function getFirstProjectOutput(configFile, ignoreCase) { return Debug.fail(`project ${configFile.options.configFilePath} expected to have at least one output`); } function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, declarationTransformers }, emitOnly, onlyBuildInfo, forceDtsEmit) { - const compilerOptions = host.getCompilerOptions(); - const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; - const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; - const emitterDiagnostics = createDiagnosticCollection(); - const newLine = getNewLineCharacter(compilerOptions); - const writer = createTextWriter(newLine); - const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); - let bundleBuildInfo; - let emitSkipped = false; + var compilerOptions = host.getCompilerOptions(); + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; + var emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; + var emitterDiagnostics = createDiagnosticCollection(); + var newLine = getNewLineCharacter(compilerOptions); + var writer = createTextWriter(newLine); + var { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); + var bundleBuildInfo; + var emitSkipped = false; enter(); forEachEmittedFile( host, @@ -106286,12 +107023,12 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme ); return outputFiles; } -var createPrinterWithDefaults = memoize(() => createPrinter({})); -var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); -var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); -var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); +var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({})); +var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true })); +var createPrinterWithRemoveCommentsNeverAsciiEscape = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); +var createPrinterWithRemoveCommentsOmitTrailingSemicolon = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); function createPrinter(printerOptions = {}, handlers = {}) { - const { + var { hasGlobalName, onEmitNode = noEmitNotification, isEmitNotificationEnabled, @@ -106303,57 +107040,57 @@ function createPrinter(printerOptions = {}, handlers = {}) { onBeforeEmitToken, onAfterEmitToken } = handlers; - const extendedDiagnostics = !!printerOptions.extendedDiagnostics; - const newLine = getNewLineCharacter(printerOptions); - const moduleKind = getEmitModuleKind(printerOptions); - const bundledHelpers = /* @__PURE__ */ new Map(); - let currentSourceFile; - let nodeIdToGeneratedName; - let nodeIdToGeneratedPrivateName; - let autoGeneratedIdToGeneratedName; - let generatedNames; - let formattedNameTempFlagsStack; - let formattedNameTempFlags; - let privateNameTempFlagsStack; - let privateNameTempFlags; - let tempFlagsStack; - let tempFlags; - let reservedNamesStack; - let reservedNames; - let reservedPrivateNamesStack; - let reservedPrivateNames; - let preserveSourceNewlines = printerOptions.preserveSourceNewlines; - let nextListElementPos; - let writer; - let ownWriter; - let write = writeBase; - let isOwnFileEmit; - const bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; - const relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; - const recordInternalSection = printerOptions.recordInternalSection; - let sourceFileTextPos = 0; - let sourceFileTextKind = "text" /* Text */; - let sourceMapsDisabled = true; - let sourceMapGenerator; - let sourceMapSource; - let sourceMapSourceIndex = -1; - let mostRecentlyAddedSourceMapSource; - let mostRecentlyAddedSourceMapSourceIndex = -1; - let containerPos = -1; - let containerEnd = -1; - let declarationListContainerEnd = -1; - let currentLineMap; - let detachedCommentsInfo; - let hasWrittenComment = false; - let commentsDisabled = !!printerOptions.removeComments; - let lastSubstitution; - let currentParenthesizerRule; - const { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); - const parenthesizer = factory.parenthesizer; - const typeArgumentParenthesizerRuleSelector = { + var extendedDiagnostics = !!printerOptions.extendedDiagnostics; + var newLine = getNewLineCharacter(printerOptions); + var moduleKind = getEmitModuleKind(printerOptions); + var bundledHelpers = /* @__PURE__ */ new Map(); + var currentSourceFile; + var nodeIdToGeneratedName; + var nodeIdToGeneratedPrivateName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var formattedNameTempFlagsStack; + var formattedNameTempFlags; + var privateNameTempFlagsStack; + var privateNameTempFlags; + var tempFlagsStack; + var tempFlags; + var reservedNamesStack; + var reservedNames; + var reservedPrivateNamesStack; + var reservedPrivateNames; + var preserveSourceNewlines = printerOptions.preserveSourceNewlines; + var nextListElementPos; + var writer; + var ownWriter; + var write = writeBase; + var isOwnFileEmit; + var bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; + var relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; + var recordInternalSection = printerOptions.recordInternalSection; + var sourceFileTextPos = 0; + var sourceFileTextKind = "text" /* Text */; + var sourceMapsDisabled = true; + var sourceMapGenerator; + var sourceMapSource; + var sourceMapSourceIndex = -1; + var mostRecentlyAddedSourceMapSource; + var mostRecentlyAddedSourceMapSourceIndex = -1; + var containerPos = -1; + var containerEnd = -1; + var declarationListContainerEnd = -1; + var currentLineMap; + var detachedCommentsInfo; + var hasWrittenComment = false; + var commentsDisabled = !!printerOptions.removeComments; + var lastSubstitution; + var currentParenthesizerRule; + var { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); + var parenthesizer = factory.parenthesizer; + var typeArgumentParenthesizerRuleSelector = { select: (index) => index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 }; - const emitBinaryExpression = createEmitBinaryExpression(); + var emitBinaryExpression = createEmitBinaryExpression(); reset(); return { // public API @@ -106612,9 +107349,9 @@ function createPrinter(printerOptions = {}, handlers = {}) { formattedNameTempFlagsStack = []; formattedNameTempFlags = /* @__PURE__ */ new Map(); privateNameTempFlagsStack = []; - privateNameTempFlags = TempFlags.Auto; + privateNameTempFlags = 0 /* Auto */; tempFlagsStack = []; - tempFlags = TempFlags.Auto; + tempFlags = 0 /* Auto */; reservedNamesStack = []; reservedNames = void 0; reservedPrivateNamesStack = []; @@ -107583,7 +108320,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitTypeLiteral(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -107772,7 +108509,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitObjectLiteralExpression(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -108538,7 +109275,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitClassDeclarationOrExpression(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -108571,7 +109308,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitInterfaceDeclaration(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -110014,7 +110751,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { return; } tempFlagsStack.push(tempFlags); - tempFlags = TempFlags.Auto; + tempFlags = 0 /* Auto */; formattedNameTempFlagsStack.push(formattedNameTempFlags); formattedNameTempFlags = void 0; reservedNamesStack.push(reservedNames); @@ -110200,7 +110937,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { case "#": return privateNameTempFlags; default: - return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : TempFlags.Auto; + return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : 0 /* Auto */; } } function setTempFlags(formattedNameKey, flags) { @@ -110224,7 +110961,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { const key = formatGeneratedName(privateName, prefix, "", suffix); let tempFlags2 = getTempFlags(key); if (flags && !(tempFlags2 & flags)) { - const name = flags === TempFlags._i ? "_i" : "_n"; + const name = flags === 268435456 /* _i */ ? "_i" : "_n"; const fullName = formatGeneratedName(privateName, prefix, name, suffix); if (isUniqueName(fullName, privateName)) { tempFlags2 |= flags; @@ -110238,7 +110975,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } while (true) { - const count = tempFlags2 & TempFlags.CountMask; + const count = tempFlags2 & 268435455 /* CountMask */; tempFlags2++; if (count !== 8 && count !== 13) { const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); @@ -110382,7 +111119,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { return generateNameCached(node.name, privateName); } return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reservedInNestedScopes*/ false, privateName, @@ -110439,7 +111176,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); case 164 /* ComputedPropertyName */: return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reserveInNestedScopes*/ true, privateName, @@ -110448,7 +111185,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { ); default: return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reserveInNestedScopes*/ false, privateName, @@ -110463,11 +111200,11 @@ function createPrinter(printerOptions = {}, handlers = {}) { const suffix = formatGeneratedNamePart(autoGenerate.suffix); switch (autoGenerate.flags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + return makeTempVariableName(0 /* Auto */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); case 2 /* Loop */: Debug.assertNode(name, isIdentifier); return makeTempVariableName( - TempFlags._i, + 268435456 /* _i */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), /*privateName*/ false, @@ -110937,12 +111674,6 @@ function getOpeningBracket(format) { function getClosingBracket(format) { return brackets[format & 15360 /* BracketsMask */][1]; } -var TempFlags = /* @__PURE__ */ ((TempFlags2) => { - TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; - TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; - TempFlags2[TempFlags2["_i"] = 268435456] = "_i"; - return TempFlags2; -})(TempFlags || {}); function emitListItemNoParenthesizer(node, emit, _parenthesizerRule, _index) { emit(node); } @@ -111870,14 +112601,14 @@ var moduleResolutionNameAndModeGetter = { function createModuleResolutionLoader(containingFile, redirectedReference, options, host, cache) { return { nameAndMode: moduleResolutionNameAndModeGetter, - resolve: (moduleName, resoluionMode) => resolveModuleName( + resolve: (moduleName, resolutionMode) => resolveModuleName( moduleName, containingFile, options, host, cache, redirectedReference, - resoluionMode + resolutionMode ) }; } @@ -113412,11 +114143,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); } else if (isClassDeclaration(parent)) { const exportIndex = findIndex(parent.modifiers, isExportModifier); - const defaultIndex = findIndex(parent.modifiers, isDefaultModifier); - if (exportIndex >= 0 && decoratorIndex < exportIndex) { - diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files)); - } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) { - diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + if (exportIndex >= 0) { + const defaultIndex = findIndex(parent.modifiers, isDefaultModifier); + if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (exportIndex >= 0 && decoratorIndex < exportIndex) { + const trailingDecoratorIndex = findIndex(parent.modifiers, isDecorator, exportIndex); + if (trailingDecoratorIndex >= 0) { + diagnostics.push(addRelatedInfo( + createDiagnosticForNode2(parent.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here) + )); + } + } } } } @@ -113594,7 +114333,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config let imports; let moduleAugmentations; let ambientModules; - if ((options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { + if ((getIsolatedModules(options) || isExternalModuleFile) && !file.isDeclarationFile) { if (options.importHelpers) { imports = [createSyntheticImport(externalHelpersModuleNameText, file)]; } @@ -114315,12 +115054,12 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (options.exactOptionalPropertyTypes && !getStrictOptionValue(options, "strictNullChecks")) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks"); } - if (options.isolatedModules) { + if (options.isolatedModules || options.verbatimModuleSyntax) { if (options.out) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); } if (options.outFile) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", "isolatedModules"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); } } if (options.inlineSourceMap) { @@ -114531,10 +115270,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) { - createDiagnosticForOptionName(Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); } + const moduleKind = getEmitModuleKind(options); if (options.verbatimModuleSyntax) { - const moduleKind = getEmitModuleKind(options); if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } @@ -114553,13 +115292,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } const moduleResolution = getEmitModuleResolutionKind(options); if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("resolvePackageJsonExports", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); } if (options.resolvePackageJsonImports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("resolvePackageJsonImports", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); } if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("customConditions", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + } + if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)) { + createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "bundler"); } if (!options.noEmit && !options.suppressOutputPathCheck) { const emitHost = getEmitHost(); @@ -114714,7 +115456,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (version2 === "6.0" /* v6_0 */) { createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); } else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); } } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { @@ -115727,7 +116469,7 @@ var BuilderState; return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); } const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || outFile(compilerOptions))) { + if (compilerOptions && (getIsolatedModules(compilerOptions) || outFile(compilerOptions))) { return [sourceFileWithUpdatedShape]; } const seenFileNamesMap = /* @__PURE__ */ new Map(); @@ -116140,7 +116882,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile return; if (!isChangedSignature(state, affectedFile.resolvedPath)) return; - if (state.compilerOptions.isolatedModules) { + if (getIsolatedModules(state.compilerOptions)) { const seenFileNamesMap = /* @__PURE__ */ new Map(); seenFileNamesMap.set(affectedFile.resolvedPath, true); const queue = BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath); @@ -116233,14 +116975,17 @@ function getBuildInfo2(state, bundle) { const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0; const fileNames = []; const fileNameToFileId = /* @__PURE__ */ new Map(); + const root = []; if (outFile(state.compilerOptions)) { const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => { - toFileId(key); + const fileId = toFileId(key); + tryAddRoot(key, fileId); return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version; }); const program2 = { fileNames, fileInfos: fileInfos2, + root, options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), outSignature: state.outSignature, latestChangedDtsFile, @@ -116268,6 +117013,7 @@ function getBuildInfo2(state, bundle) { const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value]) => { var _a3, _b2; const fileId = toFileId(key); + tryAddRoot(key, fileId); Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key)); const oldSignature = (_a3 = state.oldSignatures) == null ? void 0 : _a3.get(key); const actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value.signature; @@ -116367,6 +117113,7 @@ function getBuildInfo2(state, bundle) { const program = { fileNames, fileInfos, + root, options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), fileIdsList, referencedMap, @@ -116402,6 +117149,24 @@ function getBuildInfo2(state, bundle) { } return fileIdListId; } + function tryAddRoot(path, fileId) { + const file = state.program.getSourceFile(path); + if (!state.program.getFileIncludeReasons().get(file.path).some((r) => r.kind === 0 /* RootFile */)) + return; + if (!root.length) + return root.push(fileId); + const last2 = root[root.length - 1]; + const isLastStartEnd = isArray(last2); + if (isLastStartEnd && last2[1] === fileId - 1) + return last2[1] = fileId; + if (isLastStartEnd || root.length === 1 || last2 !== fileId - 1) + return root.push(fileId); + const lastButOne = root[root.length - 2]; + if (!isNumber(lastButOne) || lastButOne !== last2 - 1) + return root.push(fileId); + root[root.length - 2] = [lastButOne, fileId]; + return root.length = root.length - 1; + } function convertToProgramBuildInfoCompilerOptions(options) { let result; const { optionsNameMap } = getOptionsNameMap(); @@ -116909,12 +117674,28 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) { const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); const fileInfos = /* @__PURE__ */ new Map(); + let rootIndex = 0; + const roots = []; program.fileInfos.forEach((fileInfo, index) => { const path = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName); const version2 = isString(fileInfo) ? fileInfo : fileInfo.version; fileInfos.set(path, version2); + if (rootIndex < program.root.length) { + const current = program.root[rootIndex]; + const fileId = index + 1; + if (isArray(current)) { + if (current[0] <= fileId && fileId <= current[1]) { + roots.push(path); + if (current[1] === fileId) + rootIndex++; + } + } else if (current === fileId) { + roots.push(path); + rootIndex++; + } + } }); - return fileInfos; + return { fileInfos, roots }; } function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) { return { @@ -117822,7 +118603,7 @@ function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) { return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine; } function getLocaleTimeString(system) { - return !system.now ? new Date().toLocaleTimeString() : ( + return !system.now ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : ( // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM. // This branch is solely for testing, so just switch it to a normal space for baseline stability. // See: @@ -119149,8 +119930,8 @@ function resolveConfigFileProjectName(project) { } // src/compiler/tsbuildPublic.ts -var minimumDate = new Date(-864e13); -var maximumDate = new Date(864e13); +var minimumDate = /* @__PURE__ */ new Date(-864e13); +var maximumDate = /* @__PURE__ */ new Date(864e13); function getOrCreateValueFromConfigFileMap(configFileMap, resolved, createT) { const existingValue = configFileMap.get(resolved); let newValue; @@ -119164,7 +119945,7 @@ function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) { return getOrCreateValueFromConfigFileMap(configFileMap, resolved, () => /* @__PURE__ */ new Map()); } function getCurrentTime(host) { - return host.now ? host.now() : new Date(); + return host.now ? host.now() : /* @__PURE__ */ new Date(); } function isCircularBuildOrder(buildOrder) { return !!buildOrder && !!buildOrder.buildOrder; @@ -120026,7 +120807,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { } continue; } - if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 14 /* UpToDateWithInputFileText */) { + if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) { reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); return { kind: 2 /* UpdateOutputFileStamps */, @@ -120038,7 +120819,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { }; } } - if (status.type === 11 /* UpstreamBlocked */) { + if (status.type === 12 /* UpstreamBlocked */) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); projectPendingBuild.delete(projectPath); @@ -120052,7 +120833,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { } continue; } - if (status.type === 15 /* ContainerOnly */) { + if (status.type === 16 /* ContainerOnly */) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); projectPendingBuild.delete(projectPath); @@ -120239,31 +121020,31 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { var _a2, _b; if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) { return { - type: 15 /* ContainerOnly */ + type: 16 /* ContainerOnly */ }; } let referenceStatuses; const force = !!state.options.force; if (project.projectReferences) { - state.projectStatus.set(resolvedPath, { type: 12 /* ComputingUpstream */ }); + state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ }); for (const ref of project.projectReferences) { const resolvedRef = resolveProjectReferencePath(ref); const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef); const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath); const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath); - if (refStatus.type === 12 /* ComputingUpstream */ || refStatus.type === 15 /* ContainerOnly */) { + if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) { continue; } - if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 11 /* UpstreamBlocked */) { + if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) { return { - type: 11 /* UpstreamBlocked */, + type: 12 /* UpstreamBlocked */, upstreamProjectName: ref.path, - upstreamProjectBlocked: refStatus.type === 11 /* UpstreamBlocked */ + upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */ }; } if (refStatus.type !== 1 /* UpToDate */) { return { - type: 10 /* UpstreamOutOfDate */, + type: 11 /* UpstreamOutOfDate */, upstreamProjectName: ref.path }; } @@ -120272,7 +121053,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { } } if (force) - return { type: 16 /* ForceBuild */ }; + return { type: 17 /* ForceBuild */ }; const { host } = state; const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options); let oldestOutputFileName; @@ -120305,7 +121086,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { } if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== version) { return { - type: 13 /* TsVersionOutputOfDate */, + type: 14 /* TsVersionOutputOfDate */, version: buildInfo.version }; } @@ -120330,6 +121111,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { let newestInputFileName = void 0; let newestInputFileTime = minimumDate; let pseudoInputUpToDate = false; + const seenRoots = /* @__PURE__ */ new Set(); for (const inputFile of project.fileNames) { const inputTime = getModifiedTime2(state, inputFile); if (inputTime === missingFileModifiedTime) { @@ -120344,7 +121126,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { if (buildInfoProgram) { if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); - version2 = buildInfoVersionMap.get(toPath2(state, inputFile)); + version2 = buildInfoVersionMap.fileInfos.get(toPath2(state, inputFile)); const text = version2 ? state.readFileWithCache(inputFile) : void 0; currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0; if (version2 && version2 === currentVersion) @@ -120362,6 +121144,21 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { newestInputFileName = inputFile; newestInputFileTime = inputTime; } + if (buildInfoProgram) + seenRoots.add(toPath2(state, inputFile)); + } + if (buildInfoProgram) { + if (!buildInfoVersionMap) + buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); + for (const existingRoot of buildInfoVersionMap.roots) { + if (!seenRoots.has(existingRoot)) { + return { + type: 10 /* OutOfDateRoots */, + buildInfoFile: buildInfoPath, + inputFile: existingRoot + }; + } + } } if (!buildInfoPath) { const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames()); @@ -120443,7 +121240,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { }; } return { - type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 14 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, + type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, newestInputFileTime, newestInputFileName, oldestOutputFileName @@ -120562,7 +121359,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con } break; } - case 14 /* UpToDateWithInputFileText */: + case 15 /* UpToDateWithInputFileText */: case 2 /* UpToDateWithUpstreamTypes */: case 3 /* OutOfDateWithPrepend */: if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) { @@ -120573,7 +121370,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con }); } break; - case 11 /* UpstreamBlocked */: + case 12 /* UpstreamBlocked */: if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) { clearProjectStatus(state, nextProjectPath); } @@ -121024,6 +121821,14 @@ function reportUpToDateStatus(state, configFileName, status) { relName(state, configFileName), relName(state, status.buildInfoFile) ); + case 10 /* OutOfDateRoots */: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more, + relName(state, configFileName), + relName(state, status.buildInfoFile), + relName(state, status.inputFile) + ); case 1 /* UpToDate */: if (status.newestInputFileTime !== void 0) { return reportStatus( @@ -121048,20 +121853,20 @@ function reportUpToDateStatus(state, configFileName, status) { Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName) ); - case 14 /* UpToDateWithInputFileText */: + case 15 /* UpToDateWithInputFileText */: return reportStatus( state, Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files, relName(state, configFileName) ); - case 10 /* UpstreamOutOfDate */: + case 11 /* UpstreamOutOfDate */: return reportStatus( state, Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, relName(state, configFileName), relName(state, status.upstreamProjectName) ); - case 11 /* UpstreamBlocked */: + case 12 /* UpstreamBlocked */: return reportStatus( state, status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, @@ -121075,7 +121880,7 @@ function reportUpToDateStatus(state, configFileName, status) { relName(state, configFileName), status.reason ); - case 13 /* TsVersionOutputOfDate */: + case 14 /* TsVersionOutputOfDate */: return reportStatus( state, Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, @@ -121083,14 +121888,14 @@ function reportUpToDateStatus(state, configFileName, status) { status.version, version ); - case 16 /* ForceBuild */: + case 17 /* ForceBuild */: return reportStatus( state, Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName) ); - case 15 /* ContainerOnly */: - case 12 /* ComputingUpstream */: + case 16 /* ContainerOnly */: + case 13 /* ComputingUpstream */: break; default: assertType(status); diff --git a/lib/tsserver.js b/lib/tsserver.js index 31db324c0bdd3..20cb517f86aaa 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -331,6 +331,7 @@ __export(server_exports, { consumesNodeCoreModules: () => consumesNodeCoreModules, contains: () => contains, containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, containsParseError: () => containsParseError, containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, @@ -669,6 +670,7 @@ __export(server_exports, { getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, getCompilerOptionValue: () => getCompilerOptionValue, getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, getConstantValue: () => getConstantValue, getContainerNode: () => getContainerNode, @@ -1350,6 +1352,7 @@ __export(server_exports, { isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, isGlobalDeclaration: () => isGlobalDeclaration, isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, + isGrammarError: () => isGrammarError, isHeritageClause: () => isHeritageClause, isHoistedFunction: () => isHoistedFunction, isHoistedVariableStatement: () => isHoistedVariableStatement, @@ -1692,6 +1695,7 @@ __export(server_exports, { isString: () => isString, isStringAKeyword: () => isStringAKeyword, isStringANonContextualKeyword: () => isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, isStringDoubleQuoted: () => isStringDoubleQuoted, isStringLiteral: () => isStringLiteral, isStringLiteralLike: () => isStringLiteralLike, @@ -1856,6 +1860,7 @@ __export(server_exports, { mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newCaseClauseTracker: () => newCaseClauseTracker, newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, @@ -2229,7 +2234,6 @@ __export(server_exports, { typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, typeAliasNamePart: () => typeAliasNamePart, typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, - typeHasCallOrConstructSignatures: () => typeHasCallOrConstructSignatures, typeKeywords: () => typeKeywords, typeParameterNamePart: () => typeParameterNamePart, typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter, @@ -2282,102 +2286,9 @@ __export(server_exports, { }); module.exports = __toCommonJS(server_exports); -// src/tsserver/_namespaces/ts.server.ts -var ts_server_exports3 = {}; -__export(ts_server_exports3, { - ActionInvalidate: () => ActionInvalidate, - ActionPackageInstalled: () => ActionPackageInstalled, - ActionSet: () => ActionSet, - Arguments: () => Arguments, - AutoImportProviderProject: () => AutoImportProviderProject, - CharRangeSection: () => CharRangeSection, - CommandNames: () => CommandNames, - ConfigFileDiagEvent: () => ConfigFileDiagEvent, - ConfiguredProject: () => ConfiguredProject2, - Errors: () => Errors, - EventBeginInstallTypes: () => EventBeginInstallTypes, - EventEndInstallTypes: () => EventEndInstallTypes, - EventInitializationFailed: () => EventInitializationFailed, - EventTypesRegistry: () => EventTypesRegistry, - ExternalProject: () => ExternalProject2, - GcTimer: () => GcTimer, - InferredProject: () => InferredProject2, - LargeFileReferencedEvent: () => LargeFileReferencedEvent, - LineIndex: () => LineIndex, - LineLeaf: () => LineLeaf, - LineNode: () => LineNode, - LogLevel: () => LogLevel2, - Msg: () => Msg, - OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, - Project: () => Project3, - ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, - ProjectKind: () => ProjectKind, - ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, - ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, - ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, - ProjectReferenceProjectLoadKind: () => ProjectReferenceProjectLoadKind, - ProjectService: () => ProjectService3, - ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, - ScriptInfo: () => ScriptInfo, - ScriptVersionCache: () => ScriptVersionCache, - Session: () => Session3, - TextStorage: () => TextStorage, - ThrottledOperations: () => ThrottledOperations, - TypingsCache: () => TypingsCache, - allFilesAreJsOrDts: () => allFilesAreJsOrDts, - allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts, - asNormalizedPath: () => asNormalizedPath, - convertCompilerOptions: () => convertCompilerOptions, - convertFormatOptions: () => convertFormatOptions, - convertScriptKindName: () => convertScriptKindName, - convertTypeAcquisition: () => convertTypeAcquisition, - convertUserPreferences: () => convertUserPreferences, - convertWatchOptions: () => convertWatchOptions, - countEachFileTypes: () => countEachFileTypes, - createInstallTypingsRequest: () => createInstallTypingsRequest, - createModuleSpecifierCache: () => createModuleSpecifierCache, - createNormalizedPathMap: () => createNormalizedPathMap, - createPackageJsonCache: () => createPackageJsonCache, - createSortedArray: () => createSortedArray2, - emptyArray: () => emptyArray2, - findArgument: () => findArgument, - forEachResolvedProjectReferenceProject: () => forEachResolvedProjectReferenceProject, - formatMessage: () => formatMessage2, - getBaseConfigFileName: () => getBaseConfigFileName, - getLocationInNewDocument: () => getLocationInNewDocument, - getLogLevel: () => getLogLevel, - hasArgument: () => hasArgument, - hasNoTypeScriptSource: () => hasNoTypeScriptSource, - indent: () => indent2, - initializeNodeSystem: () => initializeNodeSystem, - isConfigFile: () => isConfigFile, - isConfiguredProject: () => isConfiguredProject, - isDynamicFileName: () => isDynamicFileName, - isExternalProject: () => isExternalProject, - isInferredProject: () => isInferredProject, - isInferredProjectName: () => isInferredProjectName, - makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, - makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, - makeInferredProjectName: () => makeInferredProjectName, - maxFileSize: () => maxFileSize, - maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, - normalizedPathToPath: () => normalizedPathToPath, - nowString: () => nowString, - nullCancellationToken: () => nullCancellationToken, - nullTypingsInstaller: () => nullTypingsInstaller, - projectContainsInfoDirectly: () => projectContainsInfoDirectly, - protocol: () => ts_server_protocol_exports, - removeSorted: () => removeSorted, - stringifyIndented: () => stringifyIndented, - toEvent: () => toEvent, - toNormalizedPath: () => toNormalizedPath, - tryConvertScriptKindName: () => tryConvertScriptKindName, - updateProjectIfDirty: () => updateProjectIfDirty -}); - // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.0-beta`; +var version = `${versionMajorMinor}.1-rc`; var Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -5432,7 +5343,7 @@ var nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerforma function tryGetNativePerformanceHooks() { return nativePerformanceHooks; } -var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +new Date(); +var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date(); // src/compiler/perfLogger.ts var nullLogger = { @@ -5525,6 +5436,9 @@ function mark(markName) { counts.set(markName, count + 1); marks.set(markName, timestamp()); performanceImpl == null ? void 0 : performanceImpl.mark(markName); + if (typeof onProfilerEvent === "function") { + onProfilerEvent(markName); + } } } function measure(measureName, startMarkName, endMarkName) { @@ -6758,13 +6672,14 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => { TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; - TypeFlags2[TypeFlags2["Unit"] = 109440] = "Unit"; + TypeFlags2[TypeFlags2["Unit"] = 109472] = "Unit"; + TypeFlags2[TypeFlags2["Freshable"] = 2976] = "Freshable"; TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; - TypeFlags2[TypeFlags2["Primitive"] = 131068] = "Primitive"; + TypeFlags2[TypeFlags2["Primitive"] = 134348796] = "Primitive"; TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; @@ -7566,7 +7481,7 @@ var PollingInterval = /* @__PURE__ */ ((PollingInterval3) => { PollingInterval3[PollingInterval3["Low"] = 250] = "Low"; return PollingInterval3; })(PollingInterval || {}); -var missingFileModifiedTime = new Date(0); +var missingFileModifiedTime = /* @__PURE__ */ new Date(0); function getModifiedTime(host, fileName) { return host.getModifiedTime(fileName) || missingFileModifiedTime; } @@ -7791,7 +7706,7 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { const watcher = fsWatch( dirName, - FileSystemEntryKind.Directory, + 1 /* Directory */, (_eventName, relativeFileName, modifiedTime) => { if (!isString(relativeFileName)) return; @@ -7991,7 +7906,7 @@ function createDirectoryWatcherSupportingRecursive({ } function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { const parentWatcher = cache.get(dirPath); - if (parentWatcher && fileSystemEntryExists(dirName, FileSystemEntryKind.Directory)) { + if (parentWatcher && fileSystemEntryExists(dirName, 1 /* Directory */)) { scheduleUpdateChildWatches(dirName, dirPath, fileName, options); return; } @@ -8056,7 +7971,7 @@ function createDirectoryWatcherSupportingRecursive({ return false; let newChildWatches; const hasChanges = enumerateInsertsAndDeletes( - fileSystemEntryExists(parentDir, FileSystemEntryKind.Directory) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { + fileSystemEntryExists(parentDir, 1 /* Directory */) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { const childFullName = getNormalizedAbsolutePath(child, parentDir); return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath(childFullName))) === 0 /* EqualTo */ ? childFullName : void 0; }) : emptyArray, @@ -8661,7 +8576,7 @@ var sys = (() => { if (!err) { try { if ((_a2 = statSync(profilePath)) == null ? void 0 : _a2.isDirectory()) { - profilePath = _path.join(profilePath, `${new Date().toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); + profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); } } catch (e) { } @@ -9602,7 +9517,6 @@ var Diagnostics = { Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), - Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."), A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), @@ -9731,6 +9645,7 @@ var Diagnostics = { To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -10124,7 +10039,6 @@ var Diagnostics = { Cannot_find_type_definition_file_for_0: diag(2688, 1 /* Error */, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), - An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, 1 /* Error */, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), @@ -10248,7 +10162,7 @@ var Diagnostics = { Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."), A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), - Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."), + Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."), Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), @@ -10440,13 +10354,11 @@ var Diagnostics = { The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), - Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), + Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."), Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), - Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), + Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), @@ -10534,7 +10446,7 @@ var Diagnostics = { Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."), File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."), - File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."), + File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."), Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."), Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), @@ -10824,6 +10736,11 @@ var Diagnostics = { Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."), Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."), true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."), + Entering_conditional_exports: diag(6413, 3 /* Message */, "Entering_conditional_exports_6413", "Entering conditional exports."), + Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."), + Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."), + Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), @@ -10985,6 +10902,7 @@ var Diagnostics = { new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), + This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."), Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), @@ -11082,7 +11000,7 @@ var Diagnostics = { You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), - Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), + Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -12032,18 +11950,18 @@ function isIdentifierText(name, languageVersion, identifierVariant) { return true; } function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start2, length2) { - let text = textInitial; - let pos; - let end; - let startPos; - let tokenPos; - let token; - let tokenValue; - let tokenFlags; - let commentDirectives; - let inJSDocType = 0; + var text = textInitial; + var pos; + var end; + var startPos; + var tokenPos; + var token; + var tokenValue; + var tokenFlags; + var commentDirectives; + var inJSDocType = 0; setText(text, start2, length2); - const scanner2 = { + var scanner2 = { getStartPos: () => startPos, getTextPos: () => pos, getToken: () => token, @@ -15053,7 +14971,7 @@ function isTransientSymbol(symbol) { } var stringWriter = createSingleLineStringWriter(); function createSingleLineStringWriter() { - let str = ""; + var str = ""; const writeText = (text) => str += text; return { getText: () => str, @@ -15274,6 +15192,36 @@ function nodeIsMissing(node) { function nodeIsPresent(node) { return !nodeIsMissing(node); } +function isGrammarError(parent2, child) { + if (isTypeParameterDeclaration(parent2)) + return child === parent2.expression; + if (isClassStaticBlockDeclaration(parent2)) + return child === parent2.modifiers; + if (isPropertySignature(parent2)) + return child === parent2.initializer; + if (isPropertyDeclaration(parent2)) + return child === parent2.questionToken && isAutoAccessorPropertyDeclaration(parent2); + if (isPropertyAssignment(parent2)) + return child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + if (isShorthandPropertyAssignment(parent2)) + return child === parent2.equalsToken || child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + if (isMethodDeclaration(parent2)) + return child === parent2.exclamationToken; + if (isConstructorDeclaration(parent2)) + return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isGetAccessorDeclaration(parent2)) + return child === parent2.typeParameters || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isSetAccessorDeclaration(parent2)) + return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isNamespaceExportDeclaration(parent2)) + return child === parent2.modifiers || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + return false; +} +function isGrammarErrorElement(nodeArray, child, isElement) { + if (!nodeArray || isArray(child) || !isElement(child)) + return false; + return contains(nodeArray, child); +} function insertStatementsAfterPrologue(to, from, isPrologueDirective2) { if (from === void 0 || from.length === 0) return to; @@ -15417,101 +15365,400 @@ function getInternalEmitFlags(node) { return emitNode && emitNode.internalFlags || 0; } function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: emptyArray, - AsyncIterator: emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: emptyArray, - SharedArrayBuffer: emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: emptyArray, - AsyncIterableIterator: emptyArray, - AsyncGenerator: emptyArray, - AsyncGeneratorFunction: emptyArray, - NumberFormat: ["formatToParts"] - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: emptyArray, - BigInt64Array: emptyArray, - BigUint64Array: emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - es2021: { - PromiseConstructor: ["any"], - String: ["replaceAll"] - }, - es2022: { - Array: ["at"], - String: ["at"], - Int8Array: ["at"], - Uint8Array: ["at"], - Uint8ClampedArray: ["at"], - Int16Array: ["at"], - Uint16Array: ["at"], - Int32Array: ["at"], - Uint32Array: ["at"], - Float32Array: ["at"], - Float64Array: ["at"], - BigInt64Array: ["at"], - BigUint64Array: ["at"], - ObjectConstructor: ["hasOwn"], - Error: ["cause"] - }, - es2023: { - Array: ["findLastIndex", "findLast"], - Int8Array: ["findLastIndex", "findLast"], - Uint8Array: ["findLastIndex", "findLast"], - Uint8ClampedArray: ["findLastIndex", "findLast"], - Int16Array: ["findLastIndex", "findLast"], - Uint16Array: ["findLastIndex", "findLast"], - Int32Array: ["findLastIndex", "findLast"], - Uint32Array: ["findLastIndex", "findLast"], - Float32Array: ["findLastIndex", "findLast"], - Float64Array: ["findLastIndex", "findLast"], - BigInt64Array: ["findLastIndex", "findLast"], - BigUint64Array: ["findLastIndex", "findLast"] - } - }; + return new Map(Object.entries({ + Array: new Map(Object.entries({ + es2015: [ + "find", + "findIndex", + "fill", + "copyWithin", + "entries", + "keys", + "values" + ], + es2016: [ + "includes" + ], + es2019: [ + "flat", + "flatMap" + ], + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Iterator: new Map(Object.entries({ + es2015: emptyArray + })), + AsyncIterator: new Map(Object.entries({ + es2015: emptyArray + })), + Atomics: new Map(Object.entries({ + es2017: emptyArray + })), + SharedArrayBuffer: new Map(Object.entries({ + es2017: emptyArray + })), + AsyncIterable: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncIterableIterator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGenerator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGeneratorFunction: new Map(Object.entries({ + es2018: emptyArray + })), + RegExp: new Map(Object.entries({ + es2015: [ + "flags", + "sticky", + "unicode" + ], + es2018: [ + "dotAll" + ] + })), + Reflect: new Map(Object.entries({ + es2015: [ + "apply", + "construct", + "defineProperty", + "deleteProperty", + "get", + " getOwnPropertyDescriptor", + "getPrototypeOf", + "has", + "isExtensible", + "ownKeys", + "preventExtensions", + "set", + "setPrototypeOf" + ] + })), + ArrayConstructor: new Map(Object.entries({ + es2015: [ + "from", + "of" + ] + })), + ObjectConstructor: new Map(Object.entries({ + es2015: [ + "assign", + "getOwnPropertySymbols", + "keys", + "is", + "setPrototypeOf" + ], + es2017: [ + "values", + "entries", + "getOwnPropertyDescriptors" + ], + es2019: [ + "fromEntries" + ], + es2022: [ + "hasOwn" + ] + })), + NumberConstructor: new Map(Object.entries({ + es2015: [ + "isFinite", + "isInteger", + "isNaN", + "isSafeInteger", + "parseFloat", + "parseInt" + ] + })), + Math: new Map(Object.entries({ + es2015: [ + "clz32", + "imul", + "sign", + "log10", + "log2", + "log1p", + "expm1", + "cosh", + "sinh", + "tanh", + "acosh", + "asinh", + "atanh", + "hypot", + "trunc", + "fround", + "cbrt" + ] + })), + Map: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + Set: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + PromiseConstructor: new Map(Object.entries({ + es2015: [ + "all", + "race", + "reject", + "resolve" + ], + es2020: [ + "allSettled" + ], + es2021: [ + "any" + ] + })), + Symbol: new Map(Object.entries({ + es2015: [ + "for", + "keyFor" + ], + es2019: [ + "description" + ] + })), + WeakMap: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + WeakSet: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + String: new Map(Object.entries({ + es2015: [ + "codePointAt", + "includes", + "endsWith", + "normalize", + "repeat", + "startsWith", + "anchor", + "big", + "blink", + "bold", + "fixed", + "fontcolor", + "fontsize", + "italics", + "link", + "small", + "strike", + "sub", + "sup" + ], + es2017: [ + "padStart", + "padEnd" + ], + es2019: [ + "trimStart", + "trimEnd", + "trimLeft", + "trimRight" + ], + es2020: [ + "matchAll" + ], + es2021: [ + "replaceAll" + ], + es2022: [ + "at" + ] + })), + StringConstructor: new Map(Object.entries({ + es2015: [ + "fromCodePoint", + "raw" + ] + })), + DateTimeFormat: new Map(Object.entries({ + es2017: [ + "formatToParts" + ] + })), + Promise: new Map(Object.entries({ + es2015: emptyArray, + es2018: [ + "finally" + ] + })), + RegExpMatchArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + RegExpExecArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + Intl: new Map(Object.entries({ + es2018: [ + "PluralRules" + ] + })), + NumberFormat: new Map(Object.entries({ + es2018: [ + "formatToParts" + ] + })), + SymbolConstructor: new Map(Object.entries({ + es2020: [ + "matchAll" + ] + })), + DataView: new Map(Object.entries({ + es2020: [ + "setBigInt64", + "setBigUint64", + "getBigInt64", + "getBigUint64" + ] + })), + BigInt: new Map(Object.entries({ + es2020: emptyArray + })), + RelativeTimeFormat: new Map(Object.entries({ + es2020: [ + "format", + "formatToParts", + "resolvedOptions" + ] + })), + Int8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8ClampedArray: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float64Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigInt64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigUint64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Error: new Map(Object.entries({ + es2022: [ + "cause" + ] + })) + })); } var GetLiteralTextFlags = /* @__PURE__ */ ((GetLiteralTextFlags2) => { GetLiteralTextFlags2[GetLiteralTextFlags2["None"] = 0] = "None"; @@ -15630,7 +15877,7 @@ function isCommonJSContainingModuleKind(kind) { return kind === 1 /* CommonJS */ || kind === 100 /* Node16 */ || kind === 199 /* NodeNext */; } function isEffectiveExternalModule(node, compilerOptions) { - return isExternalModule(node) || compilerOptions.isolatedModules || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; + return isExternalModule(node) || getIsolatedModules(compilerOptions) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; } function isEffectiveStrictModeSourceFile(node, compilerOptions) { switch (node.scriptKind) { @@ -15651,7 +15898,7 @@ function isEffectiveStrictModeSourceFile(node, compilerOptions) { if (startsWithUseStrict(node.statements)) { return true; } - if (isExternalModule(node) || compilerOptions.isolatedModules) { + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { if (getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */) { return true; } @@ -18267,12 +18514,12 @@ function isNightly() { return stringContains(version, "-dev") || stringContains(version, "-insiders"); } function createTextWriter(newLine) { - let output; - let indent3; - let lineStart; - let lineCount; - let linePos; - let hasTrailingComment = false; + var output; + var indent3; + var lineStart; + var lineCount; + var linePos; + var hasTrailingComment = false; function updateLineCountAndPosFor(s) { const lineStartsOfS = computeLineStarts(s); if (lineStartsOfS.length > 1) { @@ -19398,17 +19645,11 @@ function getCombinedLocalAndExportSymbolFlags(symbol) { return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags; } function isWriteOnlyAccess(node) { - return accessKind(node) === AccessKind.Write; + return accessKind(node) === 1 /* Write */; } function isWriteAccess(node) { - return accessKind(node) !== AccessKind.Read; -} -var AccessKind = /* @__PURE__ */ ((AccessKind2) => { - AccessKind2[AccessKind2["Read"] = 0] = "Read"; - AccessKind2[AccessKind2["Write"] = 1] = "Write"; - AccessKind2[AccessKind2["ReadWrite"] = 2] = "ReadWrite"; - return AccessKind2; -})(AccessKind || {}); + return accessKind(node) !== 0 /* Read */; +} function accessKind(node) { const { parent: parent2 } = node; if (!parent2) @@ -19508,9 +19749,6 @@ function getClassLikeDeclarationOfSymbol(symbol) { function getObjectFlags(type) { return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0; } -function typeHasCallOrConstructSignatures(type, checker) { - return checker.getSignaturesOfType(type, 0 /* Call */).length !== 0 || checker.getSignaturesOfType(type, 1 /* Construct */).length !== 0; -} function forSomeAncestorDirectory(directory, callback) { return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0); } @@ -20088,7 +20326,7 @@ function getEmitDeclarations(compilerOptions) { return !!(compilerOptions.declaration || compilerOptions.composite); } function shouldPreserveConstEnums(compilerOptions) { - return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); + return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions)); } function isIncrementalCompilation(options) { return !!(options.incremental || options.composite); @@ -20676,7 +20914,7 @@ function rangeOfNode(node) { } function rangeOfTypeParameters(sourceFile, typeParameters) { const pos = typeParameters.pos - 1; - const end = skipTrivia(sourceFile.text, typeParameters.end) + 1; + const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1); return { pos, end }; } function skipTypeChecking(sourceFile, options, host) { @@ -23746,24 +23984,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) - return 65536 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 128 /* ContainsES2018 */) { - for (const element of getElementsOfBindingOrAssignmentPattern(node)) { - const target = getTargetOfBindingOrAssignmentElement(element); - if (target && isAssignmentPattern(target)) { - if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - return 65536 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 128 /* ContainsES2018 */) { - const flags2 = propagateAssignmentPatternFlags(target); - if (flags2) - return flags2; - } - } - } - } - return 0 /* None */; + return containsObjectRestOrSpread(node) ? 65536 /* ContainsObjectRestOrSpread */ : 0 /* None */; } function updateBinaryExpression(node, left, operator, right) { return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; @@ -26771,14 +26992,114 @@ function createEmitHelperFactory(context) { factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) ]); } + function createESDecorateClassElementAccessGetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "get", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + accessor + ) + ); + } + function createESDecorateClassElementAccessSetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "set", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("value") + ) + ], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + accessor, + factory2.createIdentifier("value") + ) + ) + ]) + ) + ); + } + function createESDecorateClassElementAccessHasMethod(elementName) { + const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name; + return factory2.createPropertyAssignment( + "has", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBinaryExpression( + propertyName, + 101 /* InKeyword */, + factory2.createIdentifier("obj") + ) + ) + ); + } + function createESDecorateClassElementAccessObject(name, access) { + const properties = []; + properties.push(createESDecorateClassElementAccessHasMethod(name)); + if (access.get) + properties.push(createESDecorateClassElementAccessGetMethod(name)); + if (access.set) + properties.push(createESDecorateClassElementAccessSetMethod(name)); + return factory2.createObjectLiteralExpression(properties); + } function createESDecorateClassElementContextObject(contextIn) { return factory2.createObjectLiteralExpression([ factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), - factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()) - // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494 - // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) ]); } function createESDecorateContextObject(contextIn) { @@ -28968,7 +29289,7 @@ function canHaveIllegalDecorators(node) { } function canHaveIllegalModifiers(node) { const kind = node.kind; - return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; + return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; } function isQuestionOrExclamationToken(node) { return isQuestionToken(node) || isExclamationToken(node); @@ -29341,6 +29662,25 @@ function flattenCommaList(node) { flattenCommaListWorker(node, expressions); return expressions; } +function containsObjectRestOrSpread(node) { + if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) + return true; + if (node.transformFlags & 128 /* ContainsES2018 */) { + for (const element of getElementsOfBindingOrAssignmentPattern(node)) { + const target = getTargetOfBindingOrAssignmentElement(element); + if (target && isAssignmentPattern(target)) { + if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + return true; + } + if (target.transformFlags & 128 /* ContainsES2018 */) { + if (containsObjectRestOrSpread(target)) + return true; + } + } + } + } + return false; +} // src/compiler/factory/utilitiesPublic.ts function setTextRange(range, location) { @@ -30011,22 +30351,22 @@ function parseJSDocTypeExpressionForTests(content, start2, length2) { } var Parser; ((Parser2) => { - const scanner2 = createScanner( + var scanner2 = createScanner( 99 /* Latest */, /*skipTrivia*/ true ); - const disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; - let NodeConstructor2; - let TokenConstructor2; - let IdentifierConstructor2; - let PrivateIdentifierConstructor2; - let SourceFileConstructor2; + var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; + var NodeConstructor2; + var TokenConstructor2; + var IdentifierConstructor2; + var PrivateIdentifierConstructor2; + var SourceFileConstructor2; function countNode(node) { nodeCount++; return node; } - const baseNodeFactory = { + var baseNodeFactory = { createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2( kind, /*pos*/ @@ -30063,25 +30403,53 @@ var Parser; 0 )) }; - const factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); - let fileName; - let sourceFlags; - let sourceText; - let languageVersion; - let scriptKind; - let languageVariant; - let parseDiagnostics; - let jsDocDiagnostics; - let syntaxCursor; - let currentToken; - let nodeCount; - let identifiers; - let identifierCount; - let parsingContext; - let notParenthesizedArrow; - let contextFlags; - let topLevel = true; - let parseErrorBeforeNextFinishedNode = false; + var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); + var { + createNodeArray: factoryCreateNodeArray, + createNumericLiteral: factoryCreateNumericLiteral, + createStringLiteral: factoryCreateStringLiteral, + createLiteralLikeNode: factoryCreateLiteralLikeNode, + createIdentifier: factoryCreateIdentifier, + createPrivateIdentifier: factoryCreatePrivateIdentifier, + createToken: factoryCreateToken, + createArrayLiteralExpression: factoryCreateArrayLiteralExpression, + createObjectLiteralExpression: factoryCreateObjectLiteralExpression, + createPropertyAccessExpression: factoryCreatePropertyAccessExpression, + createPropertyAccessChain: factoryCreatePropertyAccessChain, + createElementAccessExpression: factoryCreateElementAccessExpression, + createElementAccessChain: factoryCreateElementAccessChain, + createCallExpression: factoryCreateCallExpression, + createCallChain: factoryCreateCallChain, + createNewExpression: factoryCreateNewExpression, + createParenthesizedExpression: factoryCreateParenthesizedExpression, + createBlock: factoryCreateBlock, + createVariableStatement: factoryCreateVariableStatement, + createExpressionStatement: factoryCreateExpressionStatement, + createIfStatement: factoryCreateIfStatement, + createWhileStatement: factoryCreateWhileStatement, + createForStatement: factoryCreateForStatement, + createForOfStatement: factoryCreateForOfStatement, + createVariableDeclaration: factoryCreateVariableDeclaration, + createVariableDeclarationList: factoryCreateVariableDeclarationList + } = factory2; + var fileName; + var sourceFlags; + var sourceText; + var languageVersion; + var scriptKind; + var languageVariant; + var parseDiagnostics; + var jsDocDiagnostics; + var syntaxCursor; + var currentToken; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; + var notParenthesizedArrow; + var contextFlags; + var topLevel = true; + var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) { var _a2; scriptKind2 = ensureScriptKind(fileName2, scriptKind2); @@ -30181,8 +30549,8 @@ var Parser; } } } - const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); - const statement = factory2.createExpressionStatement(expression); + const expression = isArray(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); + const statement = factoryCreateExpressionStatement(expression); finishNode(statement, pos); statements = createNodeArray([statement], pos); endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); @@ -30274,7 +30642,7 @@ var Parser; } sourceFlags = contextFlags; nextToken(); - const statements = parseList(ParsingContext.SourceElements, parseStatement); + const statements = parseList(0 /* SourceElements */, parseStatement); Debug.assert(token() === 1 /* EndOfFileToken */); const endOfFileToken = addJSDocComment(parseTokenNode()); const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); @@ -30337,7 +30705,7 @@ var Parser; nextToken(); while (token() !== 1 /* EndOfFileToken */) { const startPos = scanner2.getStartPos(); - const statement = parseListElement(ParsingContext.SourceElements, parseStatement); + const statement = parseListElement(0 /* SourceElements */, parseStatement); statements.push(statement); if (startPos === scanner2.getStartPos()) { nextToken(); @@ -30365,7 +30733,7 @@ var Parser; } } syntaxCursor = savedSyntaxCursor; - return factory2.updateSourceFile(sourceFile, setTextRange(factory2.createNodeArray(statements), sourceFile.statements)); + return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements)); function containsPossibleTopLevelAwait(node) { return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); } @@ -30806,13 +31174,13 @@ var Parser; const pos = getNodePos(); const kind = token(); nextToken(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseTokenNodeJSDoc() { const pos = getNodePos(); const kind = token(); nextTokenJSDoc(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function canParseSemicolon() { if (token() === 26 /* SemicolonToken */) { @@ -30833,7 +31201,7 @@ var Parser; return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); } function createNodeArray(elements, pos, end, hasTrailingComma) { - const array = factory2.createNodeArray(elements, hasTrailingComma); + const array = factoryCreateNodeArray(elements, hasTrailingComma); setTextRangePosEnd(array, pos, end != null ? end : scanner2.getStartPos()); return array; } @@ -30855,7 +31223,7 @@ var Parser; parseErrorAtCurrentToken(diagnosticMessage, arg0); } const pos = getNodePos(); - const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( + const result = kind === 79 /* Identifier */ ? factoryCreateIdentifier( "", /*originalKeywordKind*/ void 0 @@ -30865,15 +31233,15 @@ var Parser; "", /*templateFlags*/ void 0 - ) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral( + ) : kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral( "", /*numericLiteralFlags*/ void 0 - ) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + ) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( "", /*isSingleQuote*/ void 0 - ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind); + ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); return finishNode(result, pos); } function internIdentifier(text) { @@ -30891,7 +31259,7 @@ var Parser; const text = internIdentifier(scanner2.getTokenValue()); const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); + return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); @@ -30962,7 +31330,7 @@ var Parser; } function parsePrivateIdentifier() { const pos = getNodePos(); - const node = factory2.createPrivateIdentifier(internIdentifier(scanner2.getTokenValue())); + const node = factoryCreatePrivateIdentifier(internIdentifier(scanner2.getTokenValue())); nextToken(); return finishNode(node, pos); } @@ -30991,7 +31359,6 @@ var Parser; return canFollowExportModifier(); case 88 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); - case 127 /* AccessorKeyword */: case 124 /* StaticKeyword */: case 137 /* GetKeyword */: case 151 /* SetKeyword */: @@ -31024,19 +31391,19 @@ var Parser; return true; } switch (parsingContext2) { - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return lookAhead(isTypeMemberStart); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return lookAhead(isClassMemberStart) || token() === 26 /* SemicolonToken */ && !inErrorRecovery; - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return token() === 22 /* OpenBracketToken */ || isLiteralPropertyName(); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: switch (token()) { case 22 /* OpenBracketToken */: case 41 /* AsteriskToken */: @@ -31046,13 +31413,13 @@ var Parser; default: return isLiteralPropertyName(); } - case ParsingContext.RestProperties: + case 18 /* RestProperties */: return isLiteralPropertyName(); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName(); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return isAssertionKey2(); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: if (token() === 18 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); } @@ -31061,40 +31428,40 @@ var Parser; } else { return isIdentifier2() && !isHeritageClauseExtendsOrImplementsKeyword(); } - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 101 /* InKeyword */ || token() === 85 /* ConstKeyword */ || isIdentifier2(); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: switch (token()) { case 27 /* CommaToken */: case 24 /* DotToken */: return true; } - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 25 /* DotDotDotToken */ || isStartOfExpression(); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isStartOfParameter( /*isJSDocParameter*/ false ); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return isStartOfParameter( /*isJSDocParameter*/ true ); - case ParsingContext.TypeArguments: - case ParsingContext.TupleElementTypes: + case 20 /* TypeArguments */: + case 21 /* TupleElementTypes */: return token() === 27 /* CommaToken */ || isStartOfType(); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return isHeritageClause2(); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return tokenIsIdentifierOrKeyword(token()); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return true; } return Debug.fail("Non-exhaustive case in 'isListElement'."); @@ -31138,41 +31505,41 @@ var Parser; return true; } switch (kind) { - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauses: - case ParsingContext.TypeMembers: - case ParsingContext.ClassMembers: - case ParsingContext.EnumMembers: - case ParsingContext.ObjectLiteralMembers: - case ParsingContext.ObjectBindingElements: - case ParsingContext.ImportOrExportSpecifiers: - case ParsingContext.AssertEntries: + case 1 /* BlockStatements */: + case 2 /* SwitchClauses */: + case 4 /* TypeMembers */: + case 5 /* ClassMembers */: + case 6 /* EnumMembers */: + case 12 /* ObjectLiteralMembers */: + case 9 /* ObjectBindingElements */: + case 23 /* ImportOrExportSpecifiers */: + case 24 /* AssertEntries */: return token() === 19 /* CloseBraceToken */; - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return token() === 19 /* CloseBraceToken */ || token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */; - case ParsingContext.ArrayLiteralMembers: - case ParsingContext.TupleElementTypes: - case ParsingContext.ArrayBindingElements: + case 15 /* ArrayLiteralMembers */: + case 21 /* TupleElementTypes */: + case 10 /* ArrayBindingElements */: return token() === 23 /* CloseBracketToken */; - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: - case ParsingContext.RestProperties: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: + case 18 /* RestProperties */: return token() === 21 /* CloseParenToken */ || token() === 23 /* CloseBracketToken */; - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return token() !== 27 /* CommaToken */; - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return token() === 18 /* OpenBraceToken */ || token() === 19 /* CloseBraceToken */; - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return token() === 31 /* GreaterThanToken */ || token() === 43 /* SlashToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsSlash); default: return false; @@ -31191,7 +31558,7 @@ var Parser; return false; } function isInSomeParsingContext() { - for (let kind = 0; kind < ParsingContext.Count; kind++) { + for (let kind = 0; kind < 25 /* Count */; kind++) { if (parsingContext & 1 << kind) { if (isListElement2( kind, @@ -31260,38 +31627,38 @@ var Parser; } function isReusableParsingContext(parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: - case ParsingContext.SwitchClauses: - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: - case ParsingContext.EnumMembers: - case ParsingContext.TypeMembers: - case ParsingContext.VariableDeclarations: - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 5 /* ClassMembers */: + case 2 /* SwitchClauses */: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: + case 6 /* EnumMembers */: + case 4 /* TypeMembers */: + case 8 /* VariableDeclarations */: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return true; } return false; } function canReuseNode(node, parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return isReusableClassMember(node); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return isReusableSwitchClause(node); - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return isReusableStatement(node); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return isReusableEnumMember(node); - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return isReusableTypeMember(node); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isReusableVariableDeclaration(node); - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return isReusableParameter(node); } return false; @@ -31401,56 +31768,56 @@ var Parser; } function parsingContextErrors(context) { switch (context) { - case ParsingContext.SourceElements: + case 0 /* SourceElements */: return token() === 88 /* DefaultKeyword */ ? parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(93 /* ExportKeyword */)) : parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.BlockStatements: + case 1 /* BlockStatements */: return parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(Diagnostics.case_or_default_expected); - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(Diagnostics.Statement_expected); - case ParsingContext.RestProperties: - case ParsingContext.TypeMembers: + case 18 /* RestProperties */: + case 4 /* TypeMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return parseErrorAtCurrentToken(Diagnostics.Enum_member_expected); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(Diagnostics.Expression_expected); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Variable_declaration_expected); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Property_destructuring_pattern_expected); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Array_element_destructuring_pattern_expected); - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(Diagnostics.Argument_expression_expected); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_assignment_expected); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Expression_or_comma_expected); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_parameter_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return parseErrorAtCurrentToken(Diagnostics.Type_parameter_declaration_expected); - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return parseErrorAtCurrentToken(Diagnostics.Type_argument_expected); - case ParsingContext.TupleElementTypes: + case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(Diagnostics.Type_expected); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); - case ParsingContext.Count: + case 25 /* Count */: return Debug.fail("ParsingContext.Count used as a context"); default: Debug.assertNever(context); @@ -31509,7 +31876,7 @@ var Parser; ); } function getExpectedCommaDiagnostic(kind) { - return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; + return kind === 6 /* EnumMembers */ ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; } function createMissingList() { const list = createNodeArray([], getNodePos()); @@ -31678,12 +32045,12 @@ var Parser; // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( scanner2.getTokenValue(), /*isSingleQuote*/ void 0, scanner2.hasExtendedUnicodeEscape() - ) : isLiteralKind(kind) ? factory2.createLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail() + ) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail() ); if (scanner2.hasExtendedUnicodeEscape()) { node.hasExtendedUnicodeEscape = true; @@ -31703,7 +32070,7 @@ var Parser; } function parseTypeArgumentsOfTypeReference() { if (!scanner2.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function parseTypeReference() { @@ -31885,7 +32252,7 @@ var Parser; } function parseTypeParameters() { if (token() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function isStartOfParameter(isJSDocParameter) { @@ -31991,7 +32358,7 @@ var Parser; const savedAwaitContext = inAwaitContext(); setYieldContext(!!(flags & 1 /* Yield */)); setAwaitContext(!!(flags & 2 /* Await */)); - const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(ParsingContext.JSDocParameters, parseJSDocParameter) : parseDelimitedList(ParsingContext.Parameters, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); + const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(17 /* JSDocParameters */, parseJSDocParameter) : parseDelimitedList(16 /* Parameters */, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); setYieldContext(savedYieldContext); setAwaitContext(savedAwaitContext); return parameters; @@ -32059,7 +32426,7 @@ var Parser; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { - const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( + const parameters = parseBracketedList(16 /* Parameters */, () => parseParameter( /*inOuterAwaitContext*/ false ), 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); @@ -32158,7 +32525,7 @@ var Parser; function parseObjectTypeMembers() { let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = parseList(ParsingContext.TypeMembers, parseTypeMember); + members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -32212,7 +32579,7 @@ var Parser; } const type = parseTypeAnnotation(); parseSemicolon(); - const members = parseList(ParsingContext.TypeMembers, parseTypeMember); + const members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), pos); } @@ -32257,7 +32624,7 @@ var Parser; const pos = getNodePos(); return finishNode( factory2.createTupleTypeNode( - parseBracketedList(ParsingContext.TupleElementTypes, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) + parseBracketedList(21 /* TupleElementTypes */, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) ), pos ); @@ -32274,7 +32641,7 @@ var Parser; if (token() === 126 /* AbstractKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(126 /* AbstractKeyword */), pos); + const modifier = finishNode(factoryCreateToken(126 /* AbstractKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -32284,6 +32651,7 @@ var Parser; const hasJSDoc = hasPrecedingJSDocComment(); const modifiers = parseModifiersForConstructorType(); const isConstructorType = parseOptional(103 /* NewKeyword */); + Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers."); const typeParameters = parseTypeParameters(); const parameters = parseParameters(4 /* Type */); const type = parseReturnType( @@ -32292,8 +32660,6 @@ var Parser; false ); const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type); - if (!isConstructorType) - node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseKeywordAndNoDot() { @@ -32885,10 +33251,10 @@ var Parser; } function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { const triState = isParenthesizedArrowFunctionExpression(); - if (triState === Tristate.False) { + if (triState === 0 /* False */) { return void 0; } - return triState === Tristate.True ? parseParenthesizedArrowFunctionExpression( + return triState === 1 /* True */ ? parseParenthesizedArrowFunctionExpression( /*allowAmbiguity*/ true, /*allowReturnTypeInArrowFunction*/ @@ -32900,18 +33266,18 @@ var Parser; return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } if (token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner2.hasPrecedingLineBreak()) { - return Tristate.False; + return 0 /* False */; } if (token() !== 20 /* OpenParenToken */ && token() !== 29 /* LessThanToken */) { - return Tristate.False; + return 0 /* False */; } } const first2 = token(); @@ -32923,45 +33289,45 @@ var Parser; case 38 /* EqualsGreaterThanToken */: case 58 /* ColonToken */: case 18 /* OpenBraceToken */: - return Tristate.True; + return 1 /* True */; default: - return Tristate.False; + return 0 /* False */; } } if (second === 22 /* OpenBracketToken */ || second === 18 /* OpenBraceToken */) { - return Tristate.Unknown; + return 2 /* Unknown */; } if (second === 25 /* DotDotDotToken */) { - return Tristate.True; + return 1 /* True */; } if (isModifierKind(second) && second !== 132 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { if (nextToken() === 128 /* AsKeyword */) { - return Tristate.False; + return 0 /* False */; } - return Tristate.True; + return 1 /* True */; } if (!isIdentifier2() && second !== 108 /* ThisKeyword */) { - return Tristate.False; + return 0 /* False */; } switch (nextToken()) { case 58 /* ColonToken */: - return Tristate.True; + return 1 /* True */; case 57 /* QuestionToken */: nextToken(); if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 63 /* EqualsToken */ || token() === 21 /* CloseParenToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; case 27 /* CommaToken */: case 63 /* EqualsToken */: case 21 /* CloseParenToken */: - return Tristate.Unknown; + return 2 /* Unknown */; } - return Tristate.False; + return 0 /* False */; } else { Debug.assert(first2 === 29 /* LessThanToken */); if (!isIdentifier2() && token() !== 85 /* ConstKeyword */) { - return Tristate.False; + return 0 /* False */; } if (languageVariant === 1 /* JSX */) { const isArrowFunctionInJsx = lookAhead(() => { @@ -32972,6 +33338,7 @@ var Parser; switch (fourth) { case 63 /* EqualsToken */: case 31 /* GreaterThanToken */: + case 43 /* SlashToken */: return false; default: return true; @@ -32982,11 +33349,11 @@ var Parser; return false; }); if (isArrowFunctionInJsx) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } - return Tristate.Unknown; + return 2 /* Unknown */; } } function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { @@ -33006,7 +33373,7 @@ var Parser; } function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { if (token() === 132 /* AsyncKeyword */) { - if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === Tristate.True) { + if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) { const pos = getNodePos(); const asyncModifier = parseModifiersForArrowFunction(); const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); @@ -33019,14 +33386,14 @@ var Parser; if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner2.hasPrecedingLineBreak() || token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.False; + return 0 /* False */; } const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); if (!scanner2.hasPrecedingLineBreak() && expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } } - return Tristate.False; + return 0 /* False */; } function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { const pos = getNodePos(); @@ -33231,6 +33598,12 @@ var Parser; case 114 /* VoidKeyword */: return parseVoidExpression(); case 29 /* LessThanToken */: + if (languageVariant === 1 /* JSX */) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } return parseTypeAssertion(); case 133 /* AwaitKeyword */: if (isAwaitExpression2()) { @@ -33325,7 +33698,7 @@ var Parser; return expression; } parseExpectedToken(24 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - return finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -33346,7 +33719,7 @@ var Parser; factory2.createJsxElement( lastChild.openingElement, lastChild.children, - finishNode(factory2.createJsxClosingElement(finishNode(factory2.createIdentifier(""), end, end)), end, end) + finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end) ), lastChild.openingElement.pos, end @@ -33434,7 +33807,7 @@ var Parser; const list = []; const listPos = getNodePos(); const saveParsingContext = parsingContext; - parsingContext |= 1 << ParsingContext.JsxChildren; + parsingContext |= 1 << 14 /* JsxChildren */; while (true) { const child = parseJsxChild(openingTag, currentToken = scanner2.reScanJsxToken()); if (!child) @@ -33449,7 +33822,7 @@ var Parser; } function parseJsxAttributes() { const pos = getNodePos(); - return finishNode(factory2.createJsxAttributes(parseList(ParsingContext.JsxAttributes, parseJsxAttribute)), pos); + return finishNode(factory2.createJsxAttributes(parseList(13 /* JsxAttributes */, parseJsxAttribute)), pos); } function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { const pos = getNodePos(); @@ -33489,7 +33862,7 @@ var Parser; scanJsxIdentifier(); let expression = token() === 108 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - expression = finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -33583,13 +33956,9 @@ var Parser; function parseJsxClosingFragment(inExpressionContext) { const pos = getNodePos(); parseExpected(30 /* LessThanSlashToken */); - if (tokenIsIdentifierOrKeyword(token())) { - parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); - } if (parseExpected( 31 /* GreaterThanToken */, - /*diagnostic*/ - void 0, + Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment, /*shouldAdvance*/ false )) { @@ -33602,6 +33971,7 @@ var Parser; return finishNode(factory2.createJsxJsxClosingFragment(), pos); } function parseTypeAssertion() { + Debug.assert(languageVariant !== 1 /* JSX */, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments."); const pos = getNodePos(); parseExpected(29 /* LessThanToken */); const type = parseType(); @@ -33643,7 +34013,7 @@ var Parser; true ); const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); - const propertyAccess = isOptionalChain2 ? factory2.createPropertyAccessChain(expression, questionDotToken, name) : factory2.createPropertyAccessExpression(expression, name); + const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name) : factoryCreatePropertyAccessExpression(expression, name); if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers); } @@ -33671,7 +34041,7 @@ var Parser; argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createElementAccessChain(expression, questionDotToken, argumentExpression) : factory2.createElementAccessExpression(expression, argumentExpression); + const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression); return finishNode(indexedAccess, pos); } function parseMemberExpressionRest(pos, expression, allowOptionalChain) { @@ -33758,7 +34128,7 @@ var Parser; expression = expression.expression; } const argumentList = parseArgumentList(); - const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList); + const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList); expression = finishNode(callExpr, pos); continue; } @@ -33769,7 +34139,7 @@ var Parser; false, Diagnostics.Identifier_expected ); - expression = finishNode(factory2.createPropertyAccessChain(expression, questionDotToken, name), pos); + expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name), pos); } break; } @@ -33777,7 +34147,7 @@ var Parser; } function parseArgumentList() { parseExpected(20 /* OpenParenToken */); - const result = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); + const result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(21 /* CloseParenToken */); return result; } @@ -33789,7 +34159,7 @@ var Parser; return void 0; } nextToken(); - const typeArguments = parseDelimitedList(ParsingContext.TypeArguments, parseType); + const typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType); if (reScanGreaterToken() !== 31 /* GreaterThanToken */) { return void 0; } @@ -33864,7 +34234,7 @@ var Parser; parseExpected(20 /* OpenParenToken */); const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - return withJSDoc(finishNode(factory2.createParenthesizedExpression(expression), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc); } function parseSpreadElement() { const pos = getNodePos(); @@ -33889,9 +34259,9 @@ var Parser; const openBracketPosition = scanner2.getTokenPos(); const openBracketParsed = parseExpected(22 /* OpenBracketToken */); const multiLine = scanner2.hasPrecedingLineBreak(); - const elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArgumentOrArrayLiteralElement); + const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketParsed, openBracketPosition); - return finishNode(factory2.createArrayLiteralExpression(elements, multiLine), pos); + return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos); } function parseObjectLiteralElement() { const pos = getNodePos(); @@ -33950,13 +34320,13 @@ var Parser; const openBraceParsed = parseExpected(18 /* OpenBraceToken */); const multiLine = scanner2.hasPrecedingLineBreak(); const properties = parseDelimitedList( - ParsingContext.ObjectLiteralMembers, + 12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true ); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - return finishNode(factory2.createObjectLiteralExpression(properties, multiLine), pos); + return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos); } function parseFunctionExpression() { const savedDecoratorContext = inDecoratorContext(); @@ -34013,7 +34383,7 @@ var Parser; parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression)); } const argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : void 0; - return finishNode(factory2.createNewExpression(expression, typeArguments, argumentList), pos); + return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { const pos = getNodePos(); @@ -34022,17 +34392,17 @@ var Parser; const openBraceParsed = parseExpected(18 /* OpenBraceToken */, diagnosticMessage); if (openBraceParsed || ignoreMissingOpenBrace) { const multiLine = scanner2.hasPrecedingLineBreak(); - const statements = parseList(ParsingContext.BlockStatements, parseStatement); + const statements = parseList(1 /* BlockStatements */, parseStatement); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc); + const result = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc); if (token() === 63 /* EqualsToken */) { - parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); + parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses); nextToken(); } return result; } else { const statements = createMissingList(); - return withJSDoc(finishNode(factory2.createBlock( + return withJSDoc(finishNode(factoryCreateBlock( statements, /*multiLine*/ void 0 @@ -34081,7 +34451,7 @@ var Parser; parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const thenStatement = parseStatement(); const elseStatement = parseOptional(91 /* ElseKeyword */) ? parseStatement() : void 0; - return withJSDoc(finishNode(factory2.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); } function parseDoStatement() { const pos = getNodePos(); @@ -34105,7 +34475,7 @@ var Parser; const expression = allowInAnd(parseExpression); parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const statement = parseStatement(); - return withJSDoc(finishNode(factory2.createWhileStatement(expression, statement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc); } function parseForOrForInOrForOfStatement() { const pos = getNodePos(); @@ -34131,7 +34501,7 @@ var Parser; true )); parseExpected(21 /* CloseParenToken */); - node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement()); + node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement()); } else if (parseOptional(101 /* InKeyword */)) { const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); @@ -34142,7 +34512,7 @@ var Parser; parseExpected(26 /* SemicolonToken */); const incrementor = token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; parseExpected(21 /* CloseParenToken */); - node = factory2.createForStatement(initializer, condition, incrementor, parseStatement()); + node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement()); } return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -34180,14 +34550,14 @@ var Parser; parseExpected(82 /* CaseKeyword */); const expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return withJSDoc(finishNode(factory2.createCaseClause(expression, statements), pos), hasJSDoc); } function parseDefaultClause() { const pos = getNodePos(); parseExpected(88 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(factory2.createDefaultClause(statements), pos); } function parseCaseOrDefaultClause() { @@ -34196,7 +34566,7 @@ var Parser; function parseCaseBlock() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const clauses = parseList(ParsingContext.SwitchClauses, parseCaseOrDefaultClause); + const clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createCaseBlock(clauses), pos); } @@ -34217,7 +34587,7 @@ var Parser; let expression = scanner2.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); if (expression === void 0) { identifierCount++; - expression = finishNode(factory2.createIdentifier(""), getNodePos()); + expression = finishNode(factoryCreateIdentifier(""), getNodePos()); } if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); @@ -34278,7 +34648,7 @@ var Parser; if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); } - node = factory2.createExpressionStatement(expression); + node = factoryCreateExpressionStatement(expression); if (hasParen) { hasJSDoc = false; } @@ -34637,14 +35007,14 @@ var Parser; function parseObjectBindingPattern() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const elements = parseDelimitedList(ParsingContext.ObjectBindingElements, parseObjectBindingElement); + const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createObjectBindingPattern(elements), pos); } function parseArrayBindingPattern() { const pos = getNodePos(); parseExpected(22 /* OpenBracketToken */); - const elements = parseDelimitedList(ParsingContext.ArrayBindingElements, parseArrayBindingElement); + const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); return finishNode(factory2.createArrayBindingPattern(elements), pos); } @@ -34676,7 +35046,7 @@ var Parser; } const type = parseTypeAnnotation(); const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); - const node = factory2.createVariableDeclaration(name, exclamationToken, type, initializer); + const node = factoryCreateVariableDeclaration(name, exclamationToken, type, initializer); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseVariableDeclarationList(inForStatementInitializer) { @@ -34702,12 +35072,12 @@ var Parser; const savedDisallowIn = inDisallowInContext(); setDisallowInContext(inForStatementInitializer); declarations = parseDelimitedList( - ParsingContext.VariableDeclarations, + 8 /* VariableDeclarations */, inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation ); setDisallowInContext(savedDisallowIn); } - return finishNode(factory2.createVariableDeclarationList(declarations, flags), pos); + return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos); } function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; @@ -34718,7 +35088,7 @@ var Parser; false ); parseSemicolon(); - const node = factory2.createVariableStatement(modifiers, declarationList); + const node = factoryCreateVariableStatement(modifiers, declarationList); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { @@ -34947,22 +35317,30 @@ var Parser; return void 0; } } - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); let list; - let modifier, hasSeenStaticModifier = false; + let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false; + if (allowDecorators && token() === 59 /* AtToken */) { + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + } while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; list = append(list, modifier); + hasLeadingModifier = true; } - if (allowDecorators && token() === 59 /* AtToken */) { - let decorator; + if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) { while (decorator = tryParseDecorator()) { list = append(list, decorator); + hasTrailingDecorator = true; } + } + if (hasTrailingDecorator) { while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; @@ -34976,7 +35354,7 @@ var Parser; if (token() === 132 /* AsyncKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(132 /* AsyncKeyword */), pos); + const modifier = finishNode(factoryCreateToken(132 /* AsyncKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -35105,7 +35483,7 @@ var Parser; } function parseHeritageClauses() { if (isHeritageClause2()) { - return parseList(ParsingContext.HeritageClauses, parseHeritageClause); + return parseList(22 /* HeritageClauses */, parseHeritageClause); } return void 0; } @@ -35114,7 +35492,7 @@ var Parser; const tok = token(); Debug.assert(tok === 94 /* ExtendsKeyword */ || tok === 117 /* ImplementsKeyword */); nextToken(); - const types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseExpressionWithTypeArguments); + const types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(factory2.createHeritageClause(tok, types), pos); } function parseExpressionWithTypeArguments() { @@ -35127,13 +35505,13 @@ var Parser; return finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); } function tryParseTypeArguments() { - return token() === 29 /* LessThanToken */ ? parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; + return token() === 29 /* LessThanToken */ ? parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; } function isHeritageClause2() { return token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; } function parseClassMembers() { - return parseList(ParsingContext.ClassMembers, parseClassElement); + return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); @@ -35166,7 +35544,7 @@ var Parser; const name = parseIdentifier(); let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(ParsingContext.EnumMembers, parseEnumMember)); + members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(6 /* EnumMembers */, parseEnumMember)); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -35178,7 +35556,7 @@ var Parser; const pos = getNodePos(); let statements; if (parseExpected(18 /* OpenBraceToken */)) { - statements = parseList(ParsingContext.BlockStatements, parseStatement); + statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); } else { statements = createMissingList(); @@ -35303,7 +35681,7 @@ var Parser; if (parseExpected(18 /* OpenBraceToken */)) { const multiLine = scanner2.hasPrecedingLineBreak(); const elements = parseDelimitedList( - ParsingContext.AssertEntries, + 24 /* AssertEntries */, parseAssertEntry, /*considerSemicolonAsDelimiter*/ true @@ -35387,7 +35765,7 @@ var Parser; } function parseNamedImportsOrExports(kind) { const pos = getNodePos(); - const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); + const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { @@ -35563,7 +35941,7 @@ var Parser; /*isDeclarationFile*/ false, [], - factory2.createToken(1 /* EndOfFileToken */), + factoryCreateToken(1 /* EndOfFileToken */), 0 /* None */, noop ); @@ -36224,7 +36602,7 @@ var Parser; let node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { const name = parseJSDocIdentifierName(); - node = finishNode(factory2.createPropertyAccessExpression(node, name), pos); + node = finishNode(factoryCreatePropertyAccessExpression(node, name), pos); } return node; } @@ -36515,7 +36893,7 @@ var Parser; const end2 = scanner2.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner2.getTokenValue()); - const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); + const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -36837,7 +37215,7 @@ var IncrementalParser; let currentArrayIndex = 0; Debug.assert(currentArrayIndex < currentArray.length); let current = currentArray[currentArrayIndex]; - let lastQueriedPosition = InvalidPosition.Value; + let lastQueriedPosition = -1 /* Value */; return { currentNode(position) { if (position !== lastQueriedPosition) { @@ -36856,7 +37234,7 @@ var IncrementalParser; }; function findHighestListElementThatStartsAtPosition(position) { currentArray = void 0; - currentArrayIndex = InvalidPosition.Value; + currentArrayIndex = -1 /* Value */; current = void 0; forEachChild(sourceFile, visitNode3, visitArray2); return; @@ -38170,7 +38548,7 @@ var commandOptionsWithoutBuild = [ { name: "allowArbitraryExtensions", type: "boolean", - affectsModuleResolution: true, + affectsProgramStructure: true, category: Diagnostics.Modules, description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present, defaultValueDescription: false @@ -40424,6 +40802,22 @@ function resolvedTypeScriptOnly(resolved) { Debug.assert(extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } +function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) { + if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) { + const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled); + if (originalPath) + resolved = { ...resolved, path: resolvedFileName, originalPath }; + } + return createResolvedModuleWithFailedLookupLocations( + resolved, + isExternalLibraryImport, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache, + legacyResult + ); +} function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); @@ -40584,6 +40978,15 @@ function arePathsEqual(path1, path2, host) { const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */; } +function getOriginalAndResolvedFileName(fileName, host, traceEnabled) { + const resolvedFileName = realPath(fileName, host, traceEnabled); + const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + return { + // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames + resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, + originalPath: pathsAreEqual ? void 0 : fileName + }; +} function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) { Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself."); const traceEnabled = isTraceEnabled(options, host); @@ -40628,9 +41031,9 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil const affectingLocations = []; let features = getNodeResolutionFeatures(options); if (resolutionMode === 99 /* ESNext */ && (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */)) { - features |= NodeResolutionFeatures.EsmMode; + features |= 32 /* EsmMode */; } - const conditions = features & NodeResolutionFeatures.Exports ? getConditions(options, !!(features & NodeResolutionFeatures.EsmMode)) : []; + const conditions = features & 8 /* Exports */ ? getConditions(options, !!(features & 32 /* EsmMode */)) : []; const diagnostics = []; const moduleResolutionState = { compilerOptions: options, @@ -40655,13 +41058,13 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil let resolvedTypeReferenceDirective; if (resolved) { const { fileName, packageId } = resolved; - const resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled); - const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + let resolvedFileName = fileName, originalPath; + if (!options.preserveSymlinks) + ({ resolvedFileName, originalPath } = getOriginalAndResolvedFileName(fileName, host, traceEnabled)); resolvedTypeReferenceDirective = { primary, - // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames - resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, - originalPath: pathsAreEqual ? void 0 : fileName, + resolvedFileName, + originalPath, packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) }; @@ -40763,35 +41166,38 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil } } function getNodeResolutionFeatures(options) { - let features = NodeResolutionFeatures.None; + let features = 0 /* None */; switch (getEmitModuleResolutionKind(options)) { case 3 /* Node16 */: - features = NodeResolutionFeatures.Node16Default; + features = 30 /* Node16Default */; break; case 99 /* NodeNext */: - features = NodeResolutionFeatures.NodeNextDefault; + features = 30 /* NodeNextDefault */; break; case 100 /* Bundler */: - features = NodeResolutionFeatures.BundlerDefault; + features = 30 /* BundlerDefault */; break; } if (options.resolvePackageJsonExports) { - features |= NodeResolutionFeatures.Exports; + features |= 8 /* Exports */; } else if (options.resolvePackageJsonExports === false) { - features &= ~NodeResolutionFeatures.Exports; + features &= ~8 /* Exports */; } if (options.resolvePackageJsonImports) { - features |= NodeResolutionFeatures.Imports; + features |= 2 /* Imports */; } else if (options.resolvePackageJsonImports === false) { - features &= ~NodeResolutionFeatures.Imports; + features &= ~2 /* Imports */; } return features; } function getConditions(options, esmMode) { - const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["node", "import"] : ["node", "require"]; + const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["import"] : ["require"]; if (!options.noDtsResolution) { conditions.push("types"); } + if (getEmitModuleResolutionKind(options) !== 100 /* Bundler */) { + conditions.push("node"); + } return concatenate(conditions, options.customConditions); } function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) { @@ -41518,7 +41924,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, isConfigLookup, candidateIsFromPackageJsonField: false }; - if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) { + if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(compilerOptions))) { trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", ")); } let result; @@ -41544,13 +41950,14 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, legacyResult = diagnosticResult.value.resolved.path; } } - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache, + state, legacyResult ); function tryResolve(extensions2, state2) { @@ -41580,16 +41987,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, } resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } - if (!resolved2) - return void 0; - let resolvedValue = resolved2.value; - if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) { - const path = realPath(resolvedValue.path, host, traceEnabled); - const pathsAreEqual = arePathsEqual(path, resolvedValue.path, host); - const originalPath = pathsAreEqual ? void 0 : resolvedValue.path; - resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path, originalPath }; - } - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } }; } else { const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName); const resolved2 = nodeLoadModuleByRelativeName( @@ -41772,7 +42170,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) { if (!onlyRecordFailures) { if (state.host.fileExists(fileName)) { if (state.traceEnabled) { - trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); + trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName); } return fileName; } else { @@ -42367,18 +42765,24 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec ))); } else if (typeof target === "object" && target !== null) { if (!Array.isArray(target)) { + traceIfEnabled(state, Diagnostics.Entering_conditional_exports); for (const condition of getOwnKeys(target)) { if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) { traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); const subTarget = target[condition]; const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key); if (result) { + traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition); + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return result; + } else { + traceIfEnabled(state, Diagnostics.Failed_to_resolve_under_condition_0, condition); } } else { traceIfEnabled(state, Diagnostics.Saw_non_matching_condition_0, condition); } } + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return void 0; } else { if (!length(target)) { @@ -42745,13 +43149,14 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host, candidateIsFromPackageJsonField: false }; const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0)); - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, resolved && resolved.value, (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path), failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state ); function tryResolve(extensions) { const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); @@ -42991,35 +43396,36 @@ function bindSourceFile(file, options) { measure("Bind", "beforeBind", "afterBind"); } function createBinder() { - let file; - let options; - let languageVersion; - let parent2; - let container; - let thisParentContainer; - let blockScopeContainer; - let lastContainer; - let delayedTypeAliases; - let seenThisKeyword; - let currentFlow; - let currentBreakTarget; - let currentContinueTarget; - let currentReturnTarget; - let currentTrueTarget; - let currentFalseTarget; - let currentExceptionTarget; - let preSwitchCaseFlow; - let activeLabelList; - let hasExplicitReturn; - let emitFlags; - let inStrictMode; - let inAssignmentPattern = false; - let symbolCount = 0; - let Symbol46; - let classifiableNames; - const unreachableFlow = { flags: 1 /* Unreachable */ }; - const reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; - const bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + var file; + var options; + var languageVersion; + var parent2; + var container; + var thisParentContainer; + var blockScopeContainer; + var lastContainer; + var delayedTypeAliases; + var seenThisKeyword; + var currentFlow; + var currentBreakTarget; + var currentContinueTarget; + var currentReturnTarget; + var currentTrueTarget; + var currentFalseTarget; + var currentExceptionTarget; + var preSwitchCaseFlow; + var activeLabelList; + var hasExplicitReturn; + var emitFlags; + var inStrictMode; + var inAssignmentPattern = false; + var symbolCount = 0; + var Symbol46; + var classifiableNames; + var unreachableFlow = { flags: 1 /* Unreachable */ }; + var reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; + var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + return bindSourceFile2; function createDiagnosticForNode2(node, message, arg0, arg1, arg2) { return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2); } @@ -43070,7 +43476,6 @@ function createBinder() { inAssignmentPattern = false; emitFlags = 0 /* None */; } - return bindSourceFile2; function bindInStrictMode(file2, opts) { if (getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { return true; @@ -46061,7 +46466,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi let redirectPathsSpecifiers; let relativeSpecifiers; for (const modulePath of modulePaths) { - const specifier = tryGetModuleNameAsNodeModule( + const specifier = modulePath.isInNodeModules ? tryGetModuleNameAsNodeModule( modulePath, info, importingSourceFile, @@ -46071,7 +46476,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi /*packageNameOnly*/ void 0, options.overrideImportMode - ); + ) : void 0; nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier); if (specifier && modulePath.isRedirect) { return nodeModulesSpecifiers; @@ -46483,9 +46888,11 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa if (typeof cachedPackageJson === "object" || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) { const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath)); const importMode = overrideMode || importingSourceFile.impliedNodeFormat; - if (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */) { - const conditions = ["node", importMode === 99 /* ESNext */ ? "import" : "require", "types"]; - const fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions) : void 0; + if (getResolvePackageJsonExports(options)) { + const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1); + const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2); + const conditions = getConditions(options, importMode === 99 /* ESNext */); + const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0; if (fromExports) { const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) }; return { ...withJsExtension, verbatimFromExports: true }; @@ -46742,6 +47149,7 @@ var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => { SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback"; SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity"; + SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature"; SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback"; return SignatureCheckMode3; })(SignatureCheckMode || {}); @@ -46776,8 +47184,8 @@ function isInstantiatedModule(node, preserveConstEnums) { return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */; } function createTypeChecker(host) { - const getPackagesMap = memoize(() => { - const map2 = /* @__PURE__ */ new Map(); + var getPackagesMap = memoize(() => { + var map2 = /* @__PURE__ */ new Map(); host.getSourceFiles().forEach((sf) => { if (!sf.resolvedModules) return; @@ -46788,57 +47196,58 @@ function createTypeChecker(host) { }); return map2; }); - let deferredDiagnosticsCallbacks = []; - let addLazyDiagnostic = (arg) => { + var deferredDiagnosticsCallbacks = []; + var addLazyDiagnostic = (arg) => { deferredDiagnosticsCallbacks.push(arg); }; - let cancellationToken; - const requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); - let requestedExternalEmitHelpers; - let externalHelpersModule; - const Symbol46 = objectAllocator.getSymbolConstructor(); - const Type27 = objectAllocator.getTypeConstructor(); - const Signature15 = objectAllocator.getSignatureConstructor(); - let typeCount = 0; - let symbolCount = 0; - let totalInstantiationCount = 0; - let instantiationCount = 0; - let instantiationDepth = 0; - let inlineLevel = 0; - let currentNode; - let varianceTypeParameter; - const emptySymbols = createSymbolTable(); - const arrayVariances = [1 /* Covariant */]; - const compilerOptions = host.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const moduleKind = getEmitModuleKind(compilerOptions); - const legacyDecorators = !!compilerOptions.experimentalDecorators; - const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); - const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); - const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); - const strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); - const strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); - const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); - const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); - const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); - const useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); - const keyofStringsOnly = !!compilerOptions.keyofStringsOnly; - const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */; - const exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; - const checkBinaryExpression = createCheckBinaryExpression(); - const emitResolver = createResolver(); - const nodeBuilder = createNodeBuilder(); - const globals = createSymbolTable(); - const undefinedSymbol = createSymbol(4 /* Property */, "undefined"); + var cancellationToken; + var requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); + var requestedExternalEmitHelpers; + var externalHelpersModule; + var Symbol46 = objectAllocator.getSymbolConstructor(); + var Type27 = objectAllocator.getTypeConstructor(); + var Signature15 = objectAllocator.getSignatureConstructor(); + var typeCount = 0; + var symbolCount = 0; + var totalInstantiationCount = 0; + var instantiationCount = 0; + var instantiationDepth = 0; + var inlineLevel = 0; + var currentNode; + var varianceTypeParameter; + var isInferencePartiallyBlocked = false; + var emptySymbols = createSymbolTable(); + var arrayVariances = [1 /* Covariant */]; + var compilerOptions = host.getCompilerOptions(); + var languageVersion = getEmitScriptTarget(compilerOptions); + var moduleKind = getEmitModuleKind(compilerOptions); + var legacyDecorators = !!compilerOptions.experimentalDecorators; + var useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); + var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); + var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); + var strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); + var strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); + var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); + var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); + var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); + var keyofStringsOnly = !!compilerOptions.keyofStringsOnly; + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */; + var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; + var checkBinaryExpression = createCheckBinaryExpression(); + var emitResolver = createResolver(); + var nodeBuilder = createNodeBuilder(); + var globals = createSymbolTable(); + var undefinedSymbol = createSymbol(4 /* Property */, "undefined"); undefinedSymbol.declarations = []; - const globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); + var globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); globalThisSymbol.exports = globals; globalThisSymbol.declarations = []; globals.set(globalThisSymbol.escapedName, globalThisSymbol); - const argumentsSymbol = createSymbol(4 /* Property */, "arguments"); - const requireSymbol = createSymbol(4 /* Property */, "require"); - const isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; - let apparentArgumentCount; + var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); + var requireSymbol = createSymbol(4 /* Property */, "require"); + var isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; + var apparentArgumentCount; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0), @@ -47016,15 +47425,14 @@ function createTypeChecker(host) { getTypeOfPropertyOfContextualType, getFullyQualifiedName, getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */), - getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => getResolvedSignatureWorker( + getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker( call, candidatesOutArray, /*argumentCount*/ void 0, - 32 /* IsForStringLiteralArgumentCompletions */, - editingArgument - ), - getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */), + 32 /* IsForStringLiteralArgumentCompletions */ + )), + getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)), getExpandedParameters, hasEffectiveRestParameter, containsArgumentsReference, @@ -47129,6 +47537,7 @@ function createTypeChecker(host) { isArrayType, isTupleType, isArrayLikeType, + isEmptyAnonymousObjectType, isTypeInvalidDueToUnionDiscriminant, getExactOptionalProperties, getAllPossiblePropertiesOfTypes, @@ -47215,81 +47624,93 @@ function createTypeChecker(host) { isPropertyAccessible, getTypeOnlyAliasDeclaration, getMemberOverrideModifierStatus, - isTypeParameterPossiblyReferenced + isTypeParameterPossiblyReferenced, + typeHasCallOrConstructSignatures }; - function runWithInferenceBlockedFromSourceNode(node, fn) { + function runWithoutResolvedSignatureCaching(node, fn) { const containingCall = findAncestor(node, isCallLikeExpression); const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature; + if (containingCall) { + getNodeLinks(containingCall).resolvedSignature = void 0; + } + const result = fn(); + if (containingCall) { + getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; + } + return result; + } + function runWithInferenceBlockedFromSourceNode(node, fn) { + const containingCall = findAncestor(node, isCallLikeExpression); if (containingCall) { let toMarkSkip = node; do { getNodeLinks(toMarkSkip).skipDirectInference = true; toMarkSkip = toMarkSkip.parent; } while (toMarkSkip && toMarkSkip !== containingCall); - getNodeLinks(containingCall).resolvedSignature = void 0; } - const result = fn(); + isInferencePartiallyBlocked = true; + const result = runWithoutResolvedSignatureCaching(node, fn); + isInferencePartiallyBlocked = false; if (containingCall) { let toMarkSkip = node; do { getNodeLinks(toMarkSkip).skipDirectInference = void 0; toMarkSkip = toMarkSkip.parent; } while (toMarkSkip && toMarkSkip !== containingCall); - getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; } return result; } - function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode, editingArgument) { + function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) { const node = getParseTreeNode(nodeIn, isCallLikeExpression); apparentArgumentCount = argumentCount; - const res = !node ? void 0 : editingArgument ? runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignature(node, candidatesOutArray, checkMode)) : getResolvedSignature(node, candidatesOutArray, checkMode); + const res = !node ? void 0 : getResolvedSignature(node, candidatesOutArray, checkMode); apparentArgumentCount = void 0; return res; } - const tupleTypes = /* @__PURE__ */ new Map(); - const unionTypes = /* @__PURE__ */ new Map(); - const intersectionTypes = /* @__PURE__ */ new Map(); - const stringLiteralTypes = /* @__PURE__ */ new Map(); - const numberLiteralTypes = /* @__PURE__ */ new Map(); - const bigIntLiteralTypes = /* @__PURE__ */ new Map(); - const enumLiteralTypes = /* @__PURE__ */ new Map(); - const indexedAccessTypes = /* @__PURE__ */ new Map(); - const templateLiteralTypes = /* @__PURE__ */ new Map(); - const stringMappingTypes = /* @__PURE__ */ new Map(); - const substitutionTypes = /* @__PURE__ */ new Map(); - const subtypeReductionCache = /* @__PURE__ */ new Map(); - const decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); - const cachedTypes = /* @__PURE__ */ new Map(); - const evolvingArrayTypes = []; - const undefinedProperties = /* @__PURE__ */ new Map(); - const markerTypes = /* @__PURE__ */ new Set(); - const unknownSymbol = createSymbol(4 /* Property */, "unknown"); - const resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); - const unresolvedSymbols = /* @__PURE__ */ new Map(); - const errorTypes = /* @__PURE__ */ new Map(); - const anyType = createIntrinsicType(1 /* Any */, "any"); - const autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); - const wildcardType = createIntrinsicType(1 /* Any */, "any"); - const errorType = createIntrinsicType(1 /* Any */, "error"); - const unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); - const nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); - const intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); - const unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - const nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - const undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); - const missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; - const optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const nullType = createIntrinsicType(65536 /* Null */, "null"); - const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); - const stringType = createIntrinsicType(4 /* String */, "string"); - const numberType = createIntrinsicType(8 /* Number */, "number"); - const bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); - const falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - const regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - const trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); - const regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var tupleTypes = /* @__PURE__ */ new Map(); + var unionTypes = /* @__PURE__ */ new Map(); + var intersectionTypes = /* @__PURE__ */ new Map(); + var stringLiteralTypes = /* @__PURE__ */ new Map(); + var numberLiteralTypes = /* @__PURE__ */ new Map(); + var bigIntLiteralTypes = /* @__PURE__ */ new Map(); + var enumLiteralTypes = /* @__PURE__ */ new Map(); + var indexedAccessTypes = /* @__PURE__ */ new Map(); + var templateLiteralTypes = /* @__PURE__ */ new Map(); + var stringMappingTypes = /* @__PURE__ */ new Map(); + var substitutionTypes = /* @__PURE__ */ new Map(); + var subtypeReductionCache = /* @__PURE__ */ new Map(); + var decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); + var cachedTypes = /* @__PURE__ */ new Map(); + var evolvingArrayTypes = []; + var undefinedProperties = /* @__PURE__ */ new Map(); + var markerTypes = /* @__PURE__ */ new Set(); + var unknownSymbol = createSymbol(4 /* Property */, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); + var unresolvedSymbols = /* @__PURE__ */ new Map(); + var errorTypes = /* @__PURE__ */ new Map(); + var anyType = createIntrinsicType(1 /* Any */, "any"); + var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); + var errorType = createIntrinsicType(1 /* Any */, "error"); + var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); + var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); + var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); + var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); + var missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; + var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var nullType = createIntrinsicType(65536 /* Null */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); + var stringType = createIntrinsicType(4 /* String */, "string"); + var numberType = createIntrinsicType(8 /* Number */, "number"); + var bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); + var falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); trueType.regularType = regularTrueType; trueType.freshType = trueType; regularTrueType.regularType = regularTrueType; @@ -47298,26 +47719,26 @@ function createTypeChecker(host) { falseType.freshType = falseType; regularFalseType.regularType = regularFalseType; regularFalseType.freshType = falseType; - const booleanType = getUnionType([regularFalseType, regularTrueType]); - const esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); - const voidType = createIntrinsicType(16384 /* Void */, "void"); - const neverType = createIntrinsicType(131072 /* Never */, "never"); - const silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); - const implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); - const unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); - const nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); - const stringOrNumberType = getUnionType([stringType, numberType]); - const stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); - const keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; - const numberOrBigIntType = getUnionType([numberType, bigintType]); - const templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); - const numericStringType = getTemplateLiteralType(["", ""], [numberType]); - const restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); - const permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); - const uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); - const uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); - let outofbandVarianceMarkerHandler; - const reportUnreliableMapper = makeFunctionTypeMapper((t) => { + var booleanType = getUnionType([regularFalseType, regularTrueType]); + var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); + var voidType = createIntrinsicType(16384 /* Void */, "void"); + var neverType = createIntrinsicType(131072 /* Never */, "never"); + var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); + var implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); + var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); + var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); + var stringOrNumberType = getUnionType([stringType, numberType]); + var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); + var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; + var numberOrBigIntType = getUnionType([numberType, bigintType]); + var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); + var numericStringType = getTemplateLiteralType(["", ""], [numberType]); + var restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); + var permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); + var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); + var uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); + var outofbandVarianceMarkerHandler; + var reportUnreliableMapper = makeFunctionTypeMapper((t) => { if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { outofbandVarianceMarkerHandler( /*onlyUnreliable*/ @@ -47326,7 +47747,7 @@ function createTypeChecker(host) { } return t; }, () => "(unmeasurable reporter)"); - const reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { + var reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { outofbandVarianceMarkerHandler( /*onlyUnreliable*/ @@ -47335,30 +47756,30 @@ function createTypeChecker(host) { } return t; }, () => "(unreliable reporter)"); - const emptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */; - const emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); + var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = createSymbolTable(); - const emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); - const unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; - const emptyGenericType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; + var emptyGenericType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); emptyGenericType.instantiations = /* @__PURE__ */ new Map(); - const anyFunctionType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var anyFunctionType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); anyFunctionType.objectFlags |= 262144 /* NonInferrableType */; - const noConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const circularConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const resolvingDefaultType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const markerSuperType = createTypeParameter(); - const markerSubType = createTypeParameter(); + var noConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var circularConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var resolvingDefaultType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var markerSuperType = createTypeParameter(); + var markerSubType = createTypeParameter(); markerSubType.constraint = markerSuperType; - const markerOtherType = createTypeParameter(); - const markerSuperTypeForCheck = createTypeParameter(); - const markerSubTypeForCheck = createTypeParameter(); + var markerOtherType = createTypeParameter(); + var markerSuperTypeForCheck = createTypeParameter(); + var markerSubTypeForCheck = createTypeParameter(); markerSubTypeForCheck.constraint = markerSuperTypeForCheck; - const noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); - const anySignature = createSignature( + var noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); + var anySignature = createSignature( void 0, void 0, void 0, @@ -47369,7 +47790,7 @@ function createTypeChecker(host) { 0, 0 /* None */ ); - const unknownSignature = createSignature( + var unknownSignature = createSignature( void 0, void 0, void 0, @@ -47380,7 +47801,7 @@ function createTypeChecker(host) { 0, 0 /* None */ ); - const resolvingSignature = createSignature( + var resolvingSignature = createSignature( void 0, void 0, void 0, @@ -47391,7 +47812,7 @@ function createTypeChecker(host) { 0, 0 /* None */ ); - const silentNeverSignature = createSignature( + var silentNeverSignature = createSignature( void 0, void 0, void 0, @@ -47402,14 +47823,14 @@ function createTypeChecker(host) { 0, 0 /* None */ ); - const enumNumberIndexInfo = createIndexInfo( + var enumNumberIndexInfo = createIndexInfo( numberType, stringType, /*isReadonly*/ true ); - const iterationTypesCache = /* @__PURE__ */ new Map(); - const noIterationTypes = { + var iterationTypesCache = /* @__PURE__ */ new Map(); + var noIterationTypes = { get yieldType() { return Debug.fail("Not supported"); }, @@ -47420,10 +47841,10 @@ function createTypeChecker(host) { return Debug.fail("Not supported"); } }; - const anyIterationTypes = createIterationTypes(anyType, anyType, anyType); - const anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); - const defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); - const asyncIterationTypesResolver = { + var anyIterationTypes = createIterationTypes(anyType, anyType, anyType); + var anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); + var defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); + var asyncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfAsyncIterable", iteratorCacheKey: "iterationTypesOfAsyncIterator", iteratorSymbolName: "asyncIterator", @@ -47436,7 +47857,7 @@ function createTypeChecker(host) { mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method, mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property }; - const syncIterationTypesResolver = { + var syncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfIterable", iteratorCacheKey: "iterationTypesOfIterator", iteratorSymbolName: "iterator", @@ -47449,117 +47870,118 @@ function createTypeChecker(host) { mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_iterator_must_be_a_method, mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property }; - let amalgamatedDuplicates; - const reverseMappedCache = /* @__PURE__ */ new Map(); - let inInferTypeForHomomorphicMappedType = false; - let ambientModulesCache; - let patternAmbientModules; - let patternAmbientModuleAugmentations; - let globalObjectType; - let globalFunctionType; - let globalCallableFunctionType; - let globalNewableFunctionType; - let globalArrayType; - let globalReadonlyArrayType; - let globalStringType; - let globalNumberType; - let globalBooleanType; - let globalRegExpType; - let globalThisType; - let anyArrayType; - let autoArrayType; - let anyReadonlyArrayType; - let deferredGlobalNonNullableTypeAlias; - let deferredGlobalESSymbolConstructorSymbol; - let deferredGlobalESSymbolConstructorTypeSymbol; - let deferredGlobalESSymbolType; - let deferredGlobalTypedPropertyDescriptorType; - let deferredGlobalPromiseType; - let deferredGlobalPromiseLikeType; - let deferredGlobalPromiseConstructorSymbol; - let deferredGlobalPromiseConstructorLikeType; - let deferredGlobalIterableType; - let deferredGlobalIteratorType; - let deferredGlobalIterableIteratorType; - let deferredGlobalGeneratorType; - let deferredGlobalIteratorYieldResultType; - let deferredGlobalIteratorReturnResultType; - let deferredGlobalAsyncIterableType; - let deferredGlobalAsyncIteratorType; - let deferredGlobalAsyncIterableIteratorType; - let deferredGlobalAsyncGeneratorType; - let deferredGlobalTemplateStringsArrayType; - let deferredGlobalImportMetaType; - let deferredGlobalImportMetaExpressionType; - let deferredGlobalImportCallOptionsType; - let deferredGlobalExtractSymbol; - let deferredGlobalOmitSymbol; - let deferredGlobalAwaitedSymbol; - let deferredGlobalBigIntType; - let deferredGlobalNaNSymbol; - let deferredGlobalRecordSymbol; - let deferredGlobalClassDecoratorContextType; - let deferredGlobalClassMethodDecoratorContextType; - let deferredGlobalClassGetterDecoratorContextType; - let deferredGlobalClassSetterDecoratorContextType; - let deferredGlobalClassAccessorDecoratorContextType; - let deferredGlobalClassAccessorDecoratorTargetType; - let deferredGlobalClassAccessorDecoratorResultType; - let deferredGlobalClassFieldDecoratorContextType; - const allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); - let flowLoopStart = 0; - let flowLoopCount = 0; - let sharedFlowCount = 0; - let flowAnalysisDisabled = false; - let flowInvocationCount = 0; - let lastFlowNode; - let lastFlowNodeReachable; - let flowTypeCache; - const contextualTypeNodes = []; - const contextualTypes = []; - let contextualTypeCount = 0; - const inferenceContextNodes = []; - const inferenceContexts = []; - let inferenceContextCount = 0; - const emptyStringType = getStringLiteralType(""); - const zeroType = getNumberLiteralType(0); - const zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); - const resolutionTargets = []; - const resolutionResults = []; - const resolutionPropertyNames = []; - let suggestionCount = 0; - const maximumSuggestionCount = 10; - const mergedSymbols = []; - const symbolLinks = []; - const nodeLinks = []; - const flowLoopCaches = []; - const flowLoopNodes = []; - const flowLoopKeys = []; - const flowLoopTypes = []; - const sharedFlowNodes = []; - const sharedFlowTypes = []; - const flowNodeReachable = []; - const flowNodePostSuper = []; - const potentialThisCollisions = []; - const potentialNewTargetCollisions = []; - const potentialWeakMapSetCollisions = []; - const potentialReflectCollisions = []; - const potentialUnusedRenamedBindingElementsInTypes = []; - const awaitedTypeStack = []; - const diagnostics = createDiagnosticCollection(); - const suggestionDiagnostics = createDiagnosticCollection(); - const typeofType = createTypeofType(); - let _jsxNamespace; - let _jsxFactoryEntity; - const subtypeRelation = /* @__PURE__ */ new Map(); - const strictSubtypeRelation = /* @__PURE__ */ new Map(); - const assignableRelation = /* @__PURE__ */ new Map(); - const comparableRelation = /* @__PURE__ */ new Map(); - const identityRelation = /* @__PURE__ */ new Map(); - const enumRelation = /* @__PURE__ */ new Map(); - const builtinGlobals = createSymbolTable(); + var amalgamatedDuplicates; + var reverseMappedCache = /* @__PURE__ */ new Map(); + var inInferTypeForHomomorphicMappedType = false; + var ambientModulesCache; + var patternAmbientModules; + var patternAmbientModuleAugmentations; + var globalObjectType; + var globalFunctionType; + var globalCallableFunctionType; + var globalNewableFunctionType; + var globalArrayType; + var globalReadonlyArrayType; + var globalStringType; + var globalNumberType; + var globalBooleanType; + var globalRegExpType; + var globalThisType; + var anyArrayType; + var autoArrayType; + var anyReadonlyArrayType; + var deferredGlobalNonNullableTypeAlias; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolConstructorTypeSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseLikeType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalGeneratorType; + var deferredGlobalIteratorYieldResultType; + var deferredGlobalIteratorReturnResultType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalAsyncGeneratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredGlobalImportMetaType; + var deferredGlobalImportMetaExpressionType; + var deferredGlobalImportCallOptionsType; + var deferredGlobalExtractSymbol; + var deferredGlobalOmitSymbol; + var deferredGlobalAwaitedSymbol; + var deferredGlobalBigIntType; + var deferredGlobalNaNSymbol; + var deferredGlobalRecordSymbol; + var deferredGlobalClassDecoratorContextType; + var deferredGlobalClassMethodDecoratorContextType; + var deferredGlobalClassGetterDecoratorContextType; + var deferredGlobalClassSetterDecoratorContextType; + var deferredGlobalClassAccessorDecoratorContextType; + var deferredGlobalClassAccessorDecoratorTargetType; + var deferredGlobalClassAccessorDecoratorResultType; + var deferredGlobalClassFieldDecoratorContextType; + var allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); + var flowLoopStart = 0; + var flowLoopCount = 0; + var sharedFlowCount = 0; + var flowAnalysisDisabled = false; + var flowInvocationCount = 0; + var lastFlowNode; + var lastFlowNodeReachable; + var flowTypeCache; + var contextualTypeNodes = []; + var contextualTypes = []; + var contextualIsCache = []; + var contextualTypeCount = 0; + var inferenceContextNodes = []; + var inferenceContexts = []; + var inferenceContextCount = 0; + var emptyStringType = getStringLiteralType(""); + var zeroType = getNumberLiteralType(0); + var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); + var resolutionTargets = []; + var resolutionResults = []; + var resolutionPropertyNames = []; + var suggestionCount = 0; + var maximumSuggestionCount = 10; + var mergedSymbols = []; + var symbolLinks = []; + var nodeLinks = []; + var flowLoopCaches = []; + var flowLoopNodes = []; + var flowLoopKeys = []; + var flowLoopTypes = []; + var sharedFlowNodes = []; + var sharedFlowTypes = []; + var flowNodeReachable = []; + var flowNodePostSuper = []; + var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; + var potentialWeakMapSetCollisions = []; + var potentialReflectCollisions = []; + var potentialUnusedRenamedBindingElementsInTypes = []; + var awaitedTypeStack = []; + var diagnostics = createDiagnosticCollection(); + var suggestionDiagnostics = createDiagnosticCollection(); + var typeofType = createTypeofType(); + var _jsxNamespace; + var _jsxFactoryEntity; + var subtypeRelation = /* @__PURE__ */ new Map(); + var strictSubtypeRelation = /* @__PURE__ */ new Map(); + var assignableRelation = /* @__PURE__ */ new Map(); + var comparableRelation = /* @__PURE__ */ new Map(); + var identityRelation = /* @__PURE__ */ new Map(); + var enumRelation = /* @__PURE__ */ new Map(); + var builtinGlobals = createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); - const suggestedExtensions = [ + var suggestedExtensions = [ [".mts", ".mjs"], [".ts", ".js"], [".cts", ".cjs"], @@ -48951,7 +49373,12 @@ function createTypeChecker(host) { } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { const exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - const exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + const exportSymbol = exportValue ? getPropertyOfType( + getTypeOfSymbol(exportValue), + name, + /*skipObjectFunctionPropertyAugment*/ + true + ) : moduleSymbol.exports.get(name); const resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly( sourceNode, @@ -49986,12 +50413,9 @@ function createTypeChecker(host) { if (resolutionDiagnostic) { error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); } else { - const tsExtension = tryExtractTSExtension(moduleReference); const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); const resolutionIsNode16OrNext = moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */; - if (tsExtension) { - errorOnTSExtensionImport(tsExtension); - } else if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { + if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); @@ -50011,14 +50435,12 @@ function createTypeChecker(host) { } } return void 0; - function errorOnTSExtensionImport(tsExtension) { - const diag2 = Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead; - error(errorNode, diag2, tsExtension, getSuggestedImportSource(tsExtension)); - } function getSuggestedImportSource(tsExtension) { const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension); if (emitModuleKindIsNonNodeESM(moduleKind) || mode === 99 /* ESNext */) { - return importSourceWithoutExtension + (tsExtension === ".mts" /* Mts */ ? ".mjs" : tsExtension === ".cts" /* Cts */ ? ".cjs" : ".js"); + const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions); + const ext = tsExtension === ".mts" /* Mts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" /* Cts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js"; + return importSourceWithoutExtension + ext; } return importSourceWithoutExtension; } @@ -50205,7 +50627,7 @@ function createTypeChecker(host) { return shouldTreatPropertiesOfExternalModuleAsExports(type) ? getPropertyOfType(type, memberName) : void 0; } function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) { - return !(resolvedExternalModuleType.flags & 131068 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path + return !(resolvedExternalModuleType.flags & 134348796 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path isArrayType(resolvedExternalModuleType) || isTupleType(resolvedExternalModuleType)); } function getExportsOfSymbol(symbol) { @@ -51504,7 +51926,7 @@ function createTypeChecker(host) { return result; } function createAnonymousTypeNode(type2) { - var _a3; + var _a3, _b2; const typeId = type2.id; const symbol = type2.symbol; if (symbol) { @@ -51530,6 +51952,20 @@ function createTypeChecker(host) { return visitAndTransformType(type2, createTypeNodeFromObjectType); } } else { + const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */); + if (isInstantiationExpressionType) { + const instantiationExpressionType = type2; + if (isTypeQueryNode(instantiationExpressionType.node)) { + const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node); + if (typeNode) { + return typeNode; + } + } + if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { + return createElidedInformationPlaceholder(context); + } + return visitAndTransformType(type2, createTypeNodeFromObjectType); + } return createTypeNodeFromObjectType(type2); } function shouldWriteTypeOfFunctionSymbol() { @@ -52038,7 +52474,7 @@ function createTypeChecker(host) { ); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { - var _a2, _b, _c, _d; + var _a2, _b, _c, _d, _e; const suppressAny = context.flags & 256 /* SuppressAnyReturnType */; if (suppressAny) context.flags &= ~256 /* SuppressAnyReturnType */; @@ -52055,6 +52491,39 @@ function createTypeChecker(host) { /*skipUnionExpanding*/ true )[0]; + let cleanup; + if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) { + const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0; + Debug.assertOptionalNode(existingFakeScope, isBlock); + const locals = (_a2 = existingFakeScope == null ? void 0 : existingFakeScope.locals) != null ? _a2 : createSymbolTable(); + let newLocals; + for (const param of expandedParams) { + if (!locals.has(param.escapedName)) { + newLocals = append(newLocals, param.escapedName); + locals.set(param.escapedName, param); + } + } + if (newLocals) { + let removeNewLocals2 = function() { + forEach(newLocals, (s) => locals.delete(s)); + }; + var removeNewLocals = removeNewLocals2; + if (existingFakeScope) { + cleanup = removeNewLocals2; + } else { + const fakeScope = parseNodeFactory.createBlock(emptyArray); + getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true; + fakeScope.locals = locals; + const saveEnclosingDeclaration = context.enclosingDeclaration; + setParent(fakeScope, saveEnclosingDeclaration); + context.enclosingDeclaration = fakeScope; + cleanup = () => { + context.enclosingDeclaration = saveEnclosingDeclaration; + removeNewLocals2(); + }; + } + } + } const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports)); const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context); if (thisParameter) { @@ -52080,11 +52549,11 @@ function createTypeChecker(host) { const flags = modifiersToFlags(modifiers); modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */); } - const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration( + const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration( modifiers, /*asteriskToken*/ void 0, - (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), + (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), /*questionToken*/ void 0, typeParameters, @@ -52099,14 +52568,14 @@ function createTypeChecker(host) { void 0 ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration( modifiers, - (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), + (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ void 0 ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration( modifiers, - (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), + (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""), parameters, /*body*/ void 0 @@ -52141,13 +52610,14 @@ function createTypeChecker(host) { if (typeArguments) { node.typeArguments = factory.createNodeArray(typeArguments); } + cleanup == null ? void 0 : cleanup(); return node; } function tryGetThisParameterDeclaration(signature, context) { if (signature.thisParameter) { return symbolToParameterDeclaration(signature.thisParameter, context); } - if (signature.declaration) { + if (signature.declaration && isInJSFile(signature.declaration)) { const thisTag = getJSDocThisTag(signature.declaration); if (thisTag && thisTag.typeExpression) { return factory.createParameterDeclaration( @@ -52755,9 +53225,12 @@ function createTypeChecker(host) { function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) { return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters); } + function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) { + return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration; + } function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) { if (!isErrorType(type) && enclosingDeclaration) { - const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration); + const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration)); if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) { const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation); if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) { @@ -52789,7 +53262,8 @@ function createTypeChecker(host) { function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) { if (!isErrorType(type) && context.enclosingDeclaration) { const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); - if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) { + const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration); + if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) { const annotated = getTypeFromTypeNode(annotation); const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated; if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) { @@ -54404,8 +54878,8 @@ function createTypeChecker(host) { const t = types[i]; flags |= t.flags; if (!(t.flags & 98304 /* Nullable */)) { - if (t.flags & (512 /* BooleanLiteral */ | 1024 /* EnumLiteral */)) { - const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLiteralType(t); + if (t.flags & (512 /* BooleanLiteral */ | 1056 /* EnumLike */)) { + const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLikeType(t); if (baseType.flags & 1048576 /* Union */) { const count = baseType.types.length; if (i + count <= types.length && getRegularTypeOfLiteralType(types[i + count - 1]) === getRegularTypeOfLiteralType(baseType.types[count - 1])) { @@ -54660,7 +55134,7 @@ function createTypeChecker(host) { } function findResolutionCycleStartIndex(target, propertyName) { for (let i = resolutionTargets.length - 1; i >= 0; i--) { - if (hasType2(resolutionTargets[i], resolutionPropertyNames[i])) { + if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) { return -1; } if (resolutionTargets[i] === target && resolutionPropertyNames[i] === propertyName) { @@ -54669,7 +55143,7 @@ function createTypeChecker(host) { } return -1; } - function hasType2(target, propertyName) { + function resolutionTargetHasProperty(target, propertyName) { switch (propertyName) { case 0 /* Type */: return !!getSymbolLinks(target).type; @@ -54689,6 +55163,8 @@ function createTypeChecker(host) { return !!target.baseTypesResolved; case 8 /* WriteType */: return !!getSymbolLinks(target).writeType; + case 9 /* ParameterInitializerContainsUndefined */: + return getNodeLinks(target).parameterInitializerContainsUndefined !== void 0; } return Debug.assertNever(propertyName); } @@ -55128,7 +55604,7 @@ function createTypeChecker(host) { function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) { const container = getAssignedExpandoInitializer(symbol.valueDeclaration); if (container) { - const tag = getJSDocTypeTag(container); + const tag = isInJSFile(container) ? getJSDocTypeTag(container) : void 0; if (tag && tag.typeExpression) { return getTypeFromTypeNode(tag.typeExpression); } @@ -56280,8 +56756,8 @@ function createTypeChecker(host) { } return links.declaredType; } - function getBaseTypeOfEnumLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; + function getBaseTypeOfEnumLikeType(type) { + return type.flags & 1056 /* EnumLike */ && type.symbol.flags & 8 /* EnumMember */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; } function getDeclaredTypeOfEnum(symbol) { const links = getSymbolLinks(symbol); @@ -56294,7 +56770,7 @@ function createTypeChecker(host) { if (hasBindableName(member)) { const memberSymbol = getSymbolOfDeclaration(member); const value = getEnumMemberValue(member); - const memberType = value !== void 0 ? getFreshTypeOfLiteralType(getEnumLiteralType(value, getSymbolId(symbol), memberSymbol)) : createTypeWithSymbol(32 /* Enum */, memberSymbol); + const memberType = getFreshTypeOfLiteralType(value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol)); getSymbolLinks(memberSymbol).declaredType = memberType; memberTypeList.push(getRegularTypeOfLiteralType(memberType)); } @@ -56308,7 +56784,7 @@ function createTypeChecker(host) { symbol, /*aliasTypeArguments*/ void 0 - ) : createTypeWithSymbol(32 /* Enum */, symbol); + ) : createComputedEnumType(symbol); if (enumType.flags & 1048576 /* Union */) { enumType.flags |= 1024 /* EnumLiteral */; enumType.symbol = symbol; @@ -56317,6 +56793,15 @@ function createTypeChecker(host) { } return links.declaredType; } + function createComputedEnumType(symbol) { + const regularType = createTypeWithSymbol(32 /* Enum */, symbol); + const freshType = createTypeWithSymbol(32 /* Enum */, symbol); + regularType.regularType = regularType; + regularType.freshType = freshType; + freshType.regularType = regularType; + freshType.freshType = freshType; + return regularType; + } function getDeclaredTypeOfEnumMember(symbol) { const links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -57265,6 +57750,7 @@ function createTypeChecker(host) { const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); const nameType = getNameTypeFromMappedType(type.target || type); + const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); const templateType = getTemplateTypeFromMappedType(type.target || type); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); const templateModifiers = getMappedTypeModifiers(type); @@ -57302,7 +57788,7 @@ function createTypeChecker(host) { prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = nameType ? void 0 : modifiersProp.declarations; + prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0; } members.set(propName, prop); } @@ -58246,6 +58732,12 @@ function createTypeChecker(host) { thisParameter = getAnnotatedAccessorThisParameter(other); } } + if (isInJSFile(declaration)) { + const thisTag = getJSDocThisTag(declaration); + if (thisTag && thisTag.typeExpression) { + thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression)); + } + } const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0; const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) { @@ -58359,7 +58851,11 @@ function createTypeChecker(host) { if (node.tags) { for (const tag of node.tags) { if (isJSDocOverloadTag(tag)) { - result.push(getSignatureFromDeclaration(tag.typeExpression)); + const jsDocSignature = tag.typeExpression; + if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) { + reportImplicitAny(jsDocSignature, anyType); + } + result.push(getSignatureFromDeclaration(jsDocSignature)); hasJSDocOverloads = true; } } @@ -58468,6 +58964,12 @@ function createTypeChecker(host) { if (declaration.kind === 173 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } + if (isJSDocSignature(declaration)) { + const root = getJSDocRoot(declaration); + if (root && isConstructorDeclaration(root.parent)) { + return getDeclaredTypeOfClassOrInterface(getMergedSymbol(root.parent.parent.symbol)); + } + } if (isJSDocConstructSignature(declaration)) { return getTypeFromTypeNode(declaration.parameters[0].type); } @@ -58646,7 +59148,7 @@ function createTypeChecker(host) { const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); if (grandParent.kind === 180 /* TypeReference */ && !omitTypeReferences) { const typeReference = grandParent; - const typeParameters = getTypeParametersForTypeReference(typeReference); + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); if (typeParameters) { const index = typeReference.typeArguments.indexOf(childTypeParameter); if (index < typeParameters.length) { @@ -58996,7 +59498,7 @@ function createTypeChecker(host) { return links.resolvedJSDocType; } function getSubstitutionType(baseType, constraint) { - if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) { + if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */) { return baseType; } const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`; @@ -59939,7 +60441,7 @@ function createTypeChecker(host) { } } function removeStringLiteralsMatchedByTemplateLiterals(types) { - const templates = filter(types, isPatternLiteralType); + const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)); if (templates.length) { let i = types.length; while (i > 0) { @@ -59989,7 +60491,7 @@ function createTypeChecker(host) { orderedRemoveItemAt(typeSet, 1); } } - if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) { + if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) { removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */)); } if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { @@ -60058,7 +60560,7 @@ function createTypeChecker(host) { function typePredicateKindsMatch(a, b) { return a.kind === b.kind && a.parameterIndex === b.parameterIndex; } - function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments, origin) { + function getUnionTypeFromSortedList(types, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) { if (types.length === 0) { return neverType; } @@ -60070,7 +60572,7 @@ function createTypeChecker(host) { let type = unionTypes.get(id); if (!type) { type = createType(1048576 /* Union */); - type.objectFlags = objectFlags | getPropagatingFlagsOfTypes( + type.objectFlags = precomputedObjectFlags | getPropagatingFlagsOfTypes( types, /*excludeKinds*/ 98304 /* Nullable */ @@ -60120,7 +60622,7 @@ function createTypeChecker(host) { type = undefinedType; } if (!typeSet.has(type.id.toString())) { - if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) { + if (type.flags & 109472 /* Unit */ && includes & 109472 /* Unit */) { includes |= 67108864 /* NonPrimitive */; } typeSet.set(type.id.toString(), type); @@ -60396,7 +60898,7 @@ function createTypeChecker(host) { const typeVariable = getTypeParameterFromMappedType(mappedType); return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable); function isDistributive(type) { - return type.flags & (3 /* AnyOrUnknown */ | 131068 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; + return type.flags & (3 /* AnyOrUnknown */ | 134348796 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; } } function getLiteralTypeFromPropertyName(name) { @@ -60683,7 +61185,7 @@ function createTypeChecker(host) { } } const propType = getTypeOfSymbol(prop); - return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : propType; + return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : accessNode && isIndexedAccessTypeNode(accessNode) && containsMissingType(propType) ? getUnionType([propType, undefinedType]) : propType; } if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) { const index = +propName; @@ -61049,7 +61551,7 @@ function createTypeChecker(host) { } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.baseType; + return getActualTypeVariable(type.baseType); } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { return getIndexedAccessType(getActualTypeVariable(type.objectType), getActualTypeVariable(type.indexType)); @@ -61247,11 +61749,6 @@ function createTypeChecker(host) { var _a2; const links = getNodeLinks(node); if (!links.resolvedType) { - if (node.isTypeOf && node.typeArguments) { - error(node, Diagnostics.Type_arguments_cannot_be_used_here); - links.resolvedSymbol = unknownSymbol; - return links.resolvedType = errorType; - } if (!isLiteralImportTypeNode(node)) { error(node.argument, Diagnostics.String_literal_expected); links.resolvedSymbol = unknownSymbol; @@ -61312,15 +61809,8 @@ function createTypeChecker(host) { const resolvedSymbol = resolveSymbol(symbol); links.resolvedSymbol = resolvedSymbol; if (meaning === 111551 /* Value */) { - return getTypeOfSymbol(symbol); + return getInstantiationExpressionType(getTypeOfSymbol(symbol), node); } else { - const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol); - const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol); - if (node.typeArguments && typeParameters) { - addLazyDiagnostic(() => { - checkTypeArgumentConstraints(node, typeParameters); - }); - } return getTypeReferenceType(node, resolvedSymbol); } } @@ -61498,7 +61988,7 @@ function createTypeChecker(host) { return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 2944 /* Literal */) { + if (type.flags & 2976 /* Freshable */) { if (!type.freshType) { const freshType = createLiteralType(type.flags, type.value, type.symbol, type); freshType.freshType = freshType; @@ -61509,10 +61999,10 @@ function createTypeChecker(host) { return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 2944 /* Literal */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; + return type.flags & 2976 /* Freshable */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; } function isFreshLiteralType(type) { - return !!(type.flags & 2944 /* Literal */) && type.freshType === type; + return !!(type.flags & 2976 /* Freshable */) && type.freshType === type; } function getStringLiteralType(value) { let type; @@ -62191,13 +62681,13 @@ function createTypeChecker(host) { return type; } function getUniqueLiteralFilledInstantiation(type) { - return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); + return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); } function getPermissiveInstantiation(type) { - return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); + return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); } function getRestrictiveInstantiation(type) { - if (type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { + if (type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { return type; } if (type.restrictiveInstantiation) { @@ -62469,7 +62959,12 @@ function createTypeChecker(host) { } } function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) { - pushContextualType(next, sourcePropType); + pushContextualType( + next, + sourcePropType, + /*isCache*/ + false + ); const result = checkExpressionForMutableLocation(next, 1 /* Contextual */); popContextualType(); return result; @@ -62772,12 +63267,17 @@ function createTypeChecker(host) { } } function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (131068 /* Primitive */ | 131072 /* Never */)) + if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */)) return false; if (isTupleLikeType(source)) { return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); } - pushContextualType(node, target); + pushContextualType( + node, + target, + /*isCache*/ + false + ); const tupleizedType = checkArrayLiteral( node, 1 /* Contextual */, @@ -62816,7 +63316,7 @@ function createTypeChecker(host) { } } function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (131068 /* Primitive */ | 131072 /* Never */)) + if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */)) return false; return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); } @@ -62839,16 +63339,24 @@ function createTypeChecker(host) { void 0 ) !== 0 /* False */; } - function isAnySignature(s) { - return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s)); + function isTopSignature(s) { + if (!s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s)) { + const paramType = getTypeOfParameter(s.parameters[0]); + const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType; + return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */); + } + return false; } function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) { if (source === target) { return -1 /* True */; } - if (isAnySignature(target)) { + if (!(checkMode & 16 /* StrictTopSignature */ && isTopSignature(source)) && isTopSignature(target)) { return -1 /* True */; } + if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) { + return 0 /* False */; + } const targetCount = getParameterCount(target); const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { @@ -63066,7 +63574,9 @@ function createTypeChecker(host) { function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { const s = source.flags; const t = target.flags; - if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType) + if (t & 1 /* Any */ || s & 131072 /* Never */ || source === wildcardType) + return true; + if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */)) return true; if (t & 131072 /* Never */) return false; @@ -63193,7 +63703,6 @@ function createTypeChecker(host) { let overrideNextErrorInfo = 0; let lastSkippedInfo; let incompatibleStack; - let inPropertyCheck = false; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); const result = isRelatedTo( source, @@ -63390,7 +63899,8 @@ function createTypeChecker(host) { Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable"); generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource); } - if (target2.flags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { + const targetFlags = target2.flags & 8388608 /* IndexedAccess */ && !(source2.flags & 8388608 /* IndexedAccess */) ? target2.objectType.flags : target2.flags; + if (targetFlags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { const constraint = getBaseConstraintOfType(target2); let needsOriginalSource; if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) { @@ -63463,7 +63973,7 @@ function createTypeChecker(host) { return isRelatedTo(source2, target2, 3 /* Both */, reportErrors2); } function isRelatedTo(originalSource, originalTarget, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2, intersectionState = 0 /* None */) { - if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 131068 /* Primitive */) { + if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 134348796 /* Primitive */) { if (relation === comparableRelation && !(originalTarget.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(originalTarget, originalSource, relation) || isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors2 ? reportError : void 0)) { return -1 /* True */; } @@ -63527,7 +64037,7 @@ function createTypeChecker(host) { return 0 /* False */; } } - const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures2(source2)); + const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (134348796 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2)); const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */); if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) { if (reportErrors2) { @@ -63589,7 +64099,7 @@ function createTypeChecker(host) { maybeSuppress = !!errorInfo; } } - if (source2.flags & 524288 /* Object */ && target2.flags & 131068 /* Primitive */) { + if (source2.flags & 524288 /* Object */ && target2.flags & 134348796 /* Primitive */) { tryElaborateErrorsForPrimitivesAndObjects(source2, target2); } else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) { reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead); @@ -63735,15 +64245,15 @@ function createTypeChecker(host) { } function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) { if (source2.flags & 1048576 /* Union */) { - return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */), intersectionState); + return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState); } if (target2.flags & 1048576 /* Union */) { - return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */) && !(target2.flags & 131068 /* Primitive */)); + return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */) && !(target2.flags & 134348796 /* Primitive */)); } if (target2.flags & 2097152 /* Intersection */) { return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */); } - if (relation === comparableRelation && target2.flags & 131068 /* Primitive */) { + if (relation === comparableRelation && target2.flags & 134348796 /* Primitive */) { const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t); if (constraints !== source2.types) { source2 = getIntersectionType(constraints); @@ -64151,14 +64661,15 @@ function createTypeChecker(host) { ); } } - if (result2 && !inPropertyCheck && (target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */) || isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */)))) { - inPropertyCheck = true; + if (result2 && !(intersectionState & 2 /* Target */) && target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */)) { result2 &= propertiesRelatedTo( source2, target2, reportErrors2, /*excludedProperties*/ void 0, + /*optionalsOnly*/ + false, 0 /* None */ ); if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */) { @@ -64171,7 +64682,17 @@ function createTypeChecker(host) { 0 /* None */ ); } - inPropertyCheck = false; + } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { + result2 &= propertiesRelatedTo( + source2, + target2, + reportErrors2, + /*excludedProperties*/ + void 0, + /*optionalsOnly*/ + true, + intersectionState + ); } } if (result2) { @@ -64625,7 +65146,7 @@ function createTypeChecker(host) { } return 0 /* False */; } - const sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */); + const sourceIsPrimitive = !!(sourceFlags & 134348796 /* Primitive */); if (relation !== identityRelation) { source2 = getApparentType(source2); sourceFlags = source2.flags; @@ -64661,12 +65182,14 @@ function createTypeChecker(host) { reportStructuralErrors, /*excludedProperties*/ void 0, + /*optionalsOnly*/ + false, intersectionState ); if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors); + result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors, intersectionState); if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors); + result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors, intersectionState); if (result2) { result2 &= indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportStructuralErrors, intersectionState); } @@ -64795,6 +65318,8 @@ function createTypeChecker(host) { /*reportErrors*/ false, excludedProperties, + /*optionalsOnly*/ + false, 0 /* None */ ); if (result2) { @@ -64803,7 +65328,8 @@ function createTypeChecker(host) { type, 0 /* Call */, /*reportStructuralErrors*/ - false + false, + 0 /* None */ ); if (result2) { result2 &= signaturesRelatedTo( @@ -64811,7 +65337,8 @@ function createTypeChecker(host) { type, 1 /* Construct */, /*reportStructuralErrors*/ - false + false, + 0 /* None */ ); if (result2 && !(isTupleType(source2) && isTupleType(type))) { result2 &= indexSignaturesRelatedTo( @@ -64989,7 +65516,7 @@ function createTypeChecker(host) { } } } - function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, intersectionState) { + function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) { if (relation === identityRelation) { return propertiesIdenticalTo(source2, target2, excludedProperties); } @@ -65125,7 +65652,7 @@ function createTypeChecker(host) { const numericNamesOnly = isTupleType(source2) && isTupleType(target2); for (const targetProp of excludeProperties(properties, excludedProperties)) { const name = targetProp.escapedName; - if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) { + if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length") && (!optionalsOnly || targetProp.flags & 16777216 /* Optional */)) { const sourceProp = getPropertyOfType(source2, name); if (sourceProp && sourceProp !== targetProp) { const related = propertyRelatedTo(source2, target2, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors2, intersectionState, relation === comparableRelation); @@ -65161,7 +65688,7 @@ function createTypeChecker(host) { } return result2; } - function signaturesRelatedTo(source2, target2, kind, reportErrors2) { + function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) { var _a3, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source2, target2, kind); @@ -65198,6 +65725,7 @@ function createTypeChecker(host) { /*erase*/ true, reportErrors2, + intersectionState, incompatibleReporter(sourceSignatures[i], targetSignatures[i]) ); if (!related) { @@ -65209,7 +65737,7 @@ function createTypeChecker(host) { const eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); - result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature)); + result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature)); if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 173 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 173 /* Constructor */)) { const constructSignatureToString = (signature) => signatureToString( signature, @@ -65234,6 +65762,7 @@ function createTypeChecker(host) { /*erase*/ true, shouldElaborateErrors, + intersectionState, incompatibleReporter(s, t) ); if (related) { @@ -65286,17 +65815,29 @@ function createTypeChecker(host) { } return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); } - function signatureRelatedTo(source2, target2, erase, reportErrors2, incompatibleReporter) { + function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) { + const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */; return compareSignaturesRelated( erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, - relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, + checkMode, reportErrors2, reportError, incompatibleReporter, - isRelatedToWorker, + isRelatedToWorker2, reportUnreliableMapper ); + function isRelatedToWorker2(source3, target3, reportErrors3) { + return isRelatedTo( + source3, + target3, + 3 /* Both */, + reportErrors3, + /*headMessage*/ + void 0, + intersectionState + ); + } } function signaturesIdenticalTo(source2, target2, kind) { const sourceSignatures = getSignaturesOfType(source2, kind); @@ -65355,7 +65896,7 @@ function createTypeChecker(host) { } for (const info of getIndexInfosOfType(source2)) { if (isApplicableIndexType(info.keyType, keyType)) { - const related = indexInfoRelatedTo(info, targetInfo, reportErrors2); + const related = indexInfoRelatedTo(info, targetInfo, reportErrors2, intersectionState); if (!related) { return 0 /* False */; } @@ -65364,8 +65905,16 @@ function createTypeChecker(host) { } return result2; } - function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2) { - const related = isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */, reportErrors2); + function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState) { + const related = isRelatedTo( + sourceInfo.type, + targetInfo.type, + 3 /* Both */, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); if (!related && reportErrors2) { if (sourceInfo.keyType === targetInfo.keyType) { reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType)); @@ -65394,9 +65943,9 @@ function createTypeChecker(host) { function typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) { const sourceInfo = getApplicableIndexInfo(source2, targetInfo.keyType); if (sourceInfo) { - return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2); + return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState); } - if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) { + if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) { return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); } if (reportErrors2) { @@ -65685,12 +66234,15 @@ function createTypeChecker(host) { } function isDeeplyNestedType(type, stack, depth, maxDepth = 3) { if (depth >= maxDepth) { + if (type.flags & 2097152 /* Intersection */) { + return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth)); + } const identity2 = getRecursionIdentity(type); let count = 0; let lastTypeId = 0; for (let i = 0; i < depth; i++) { const t = stack[i]; - if (getRecursionIdentity(t) === identity2) { + if (t.flags & 2097152 /* Intersection */ ? some(t.types, (u) => getRecursionIdentity(u) === identity2) : getRecursionIdentity(t) === identity2) { if (t.id >= lastTypeId) { count++; if (count >= maxDepth) { @@ -65923,15 +66475,25 @@ function createTypeChecker(host) { return propType; } if (everyType(type, isTupleType)) { - return mapType(type, (t) => getRestTypeOfTupleType(t) || undefinedType); + return mapType(type, (t) => { + const tupleType = t; + const restType = getRestTypeOfTupleType(tupleType); + if (!restType) { + return undefinedType; + } + if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) { + return getUnionType([restType, undefinedType]); + } + return restType; + }); } return void 0; } function isNeitherUnitTypeNorNever(type) { - return !(type.flags & (109440 /* Unit */ | 131072 /* Never */)); + return !(type.flags & (109472 /* Unit */ | 131072 /* Never */)); } function isUnitType(type) { - return !!(type.flags & 109440 /* Unit */); + return !!(type.flags & 109472 /* Unit */); } function isUnitLikeType(type) { const t = getBaseConstraintOrType(type); @@ -65944,15 +66506,18 @@ function createTypeChecker(host) { return type.flags & 16 /* Boolean */ ? true : type.flags & 1048576 /* Union */ ? type.flags & 1024 /* EnumLiteral */ ? true : every(type.types, isUnitType) : isUnitType(type); } function getBaseTypeOfLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; + return type.flags & 1056 /* EnumLike */ ? getBaseTypeOfEnumLikeType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; } function getBaseTypeOfLiteralTypeUnion(type) { var _a2; const key = `B${getTypeId(type)}`; return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralType)); } + function getBaseTypeOfLiteralTypeForComparison(type) { + return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type; + } function getWidenedLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; + return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; } function getWidenedUniqueESSymbolType(type) { return type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedUniqueESSymbolType) : type; @@ -65993,7 +66558,7 @@ function createTypeChecker(host) { const restType = getRestTypeOfTupleType(type); return restType && createArrayType(restType); } - function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false) { + function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false, noReductions = false) { const length2 = getTypeReferenceArity(type) - endSkipCount; if (index < length2) { const typeArguments = getTypeArguments(type); @@ -66002,7 +66567,7 @@ function createTypeChecker(host) { const t = typeArguments[i]; elementTypes.push(type.target.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t); } - return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes); + return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes, noReductions ? 0 /* None */ : 1 /* Literal */); } return void 0; } @@ -66070,7 +66635,7 @@ function createTypeChecker(host) { } function isObjectTypeWithInferableIndex(type) { const objectFlags = getObjectFlags(type); - return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures2(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); + return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); } function createSymbolWithType(source, type) { const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */); @@ -66308,6 +66873,11 @@ function createTypeChecker(host) { case 320 /* JSDocFunctionType */: error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; + case 326 /* JSDocSignature */: + if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { + error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); + } + return; case 259 /* FunctionDeclaration */: case 171 /* MethodDeclaration */: case 170 /* MethodSignature */: @@ -66480,8 +67050,8 @@ function createTypeChecker(host) { } return false; } - function isTypeParameterAtTopLevel(type, typeParameter) { - return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + function isTypeParameterAtTopLevel(type, tp, depth = 0) { + return !!(type === tp || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, tp, depth)) || depth < 3 && type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), tp, depth + 1) || isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), tp, depth + 1))); } function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { const typePredicate = getTypePredicateOfSignature(signature); @@ -66575,7 +67145,7 @@ function createTypeChecker(host) { yield targetProp; } else if (matchDiscriminantProperties) { const targetType = getTypeOfSymbol(targetProp); - if (targetType.flags & 109440 /* Unit */) { + if (targetType.flags & 109472 /* Unit */) { const sourceType = getTypeOfSymbol(sourceProp); if (!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) { yield targetProp; @@ -66636,10 +67206,10 @@ function createTypeChecker(host) { return getBigIntLiteralType(parseValidBigInt(text)); } function isMemberOfStringMapping(source, target) { - if (target.flags & (4 /* String */ | 1 /* Any */)) { + if (target.flags & 1 /* Any */) { return true; } - if (target.flags & 134217728 /* TemplateLiteral */) { + if (target.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) { return isTypeAssignableTo(source, target); } if (target.flags & 268435456 /* StringMapping */) { @@ -67334,7 +67904,7 @@ function createTypeChecker(host) { } function hasPrimitiveConstraint(type) { const constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); } function isObjectLiteralType2(type) { return !!(getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -67816,7 +68386,7 @@ function createTypeChecker(host) { return 83886079 /* UnknownFacts */; } function getIntersectionTypeFacts(type) { - const ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */); + const ignoreObjects = maybeTypeOfKind(type, 134348796 /* Primitive */); let oredFacts = 0 /* None */; let andedFacts = 134217727 /* All */; for (const t of type.types) { @@ -68015,7 +68585,7 @@ function createTypeChecker(host) { } return true; } - if (source.flags & 1024 /* EnumLiteral */ && getBaseTypeOfEnumLiteralType(source) === target) { + if (source.flags & 1056 /* EnumLike */ && getBaseTypeOfEnumLikeType(source) === target) { return true; } return containsType(target.types, source); @@ -68053,7 +68623,7 @@ function createTypeChecker(host) { } return getUnionTypeFromSortedList( filtered, - type.objectFlags, + type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */), /*aliasSymbol*/ void 0, /*aliasTypeArguments*/ @@ -68411,10 +68981,12 @@ function createTypeChecker(host) { } function isConstantReference(node) { switch (node.kind) { - case 79 /* Identifier */: { - const symbol = getResolvedSymbol(node); - return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); - } + case 79 /* Identifier */: + if (!isThisInTypeQuery(node)) { + const symbol = getResolvedSymbol(node); + return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); + } + break; case 208 /* PropertyAccessExpression */: case 209 /* ElementAccessExpression */: return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); @@ -68560,7 +69132,7 @@ function createTypeChecker(host) { } return declaredType; } - if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))); } return void 0; @@ -69077,7 +69649,7 @@ function createTypeChecker(host) { } if (assumeTrue) { if (!doubleEquals && (type.flags & 2 /* Unknown */ || someType(type, isEmptyAnonymousObjectType))) { - if (valueType.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { + if (valueType.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { return valueType; } if (valueType.flags & 524288 /* Object */) { @@ -69110,7 +69682,7 @@ function createTypeChecker(host) { return narrowTypeByLiteralExpression(type, literal, assumeTrue); } function narrowTypeByLiteralExpression(type, literal, assumeTrue) { - return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); + return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); } function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) { const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck); @@ -69127,7 +69699,7 @@ function createTypeChecker(host) { let groundClauseTypes; for (let i = 0; i < clauseTypes.length; i += 1) { const t = clauseTypes[i]; - if (t.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */)) { + if (t.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */)) { if (groundClauseTypes !== void 0) { groundClauseTypes.push(t); } @@ -69246,52 +69818,58 @@ function createTypeChecker(host) { if (!isTypeDerivedFrom(rightType, globalFunctionType)) { return type; } - let targetType; - const prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (prototypeProperty) { - const prototypePropertyType = getTypeOfSymbol(prototypeProperty); - if (!isTypeAny(prototypePropertyType)) { - targetType = prototypePropertyType; - } - } - if (isTypeAny(type) && (targetType === globalObjectType || targetType === globalFunctionType)) { + const instanceType = mapType(rightType, getInstanceType); + if (isTypeAny(type) && (instanceType === globalObjectType || instanceType === globalFunctionType) || !assumeTrue && !(instanceType.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(instanceType))) { return type; } - if (!targetType) { - const constructSignatures = getSignaturesOfType(rightType, 1 /* Construct */); - targetType = constructSignatures.length ? getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))) : emptyObjectType; - } - if (!assumeTrue && rightType.flags & 1048576 /* Union */) { - const nonConstructorTypeInUnion = find(rightType.types, (t) => !isConstructorType(t)); - if (!nonConstructorTypeInUnion) - return type; - } return getNarrowedType( type, - targetType, + instanceType, assumeTrue, /*checkDerived*/ true ); } + function getInstanceType(constructorType) { + const prototypePropertyType = getTypeOfPropertyOfType(constructorType, "prototype"); + if (prototypePropertyType && !isTypeAny(prototypePropertyType)) { + return prototypePropertyType; + } + const constructSignatures = getSignaturesOfType(constructorType, 1 /* Construct */); + if (constructSignatures.length) { + return getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))); + } + return emptyObjectType; + } function getNarrowedType(type, candidate, assumeTrue, checkDerived) { var _a3; const key2 = type.flags & 1048576 /* Union */ ? `N${getTypeId(type)},${getTypeId(candidate)},${(assumeTrue ? 1 : 0) | (checkDerived ? 2 : 0)}` : void 0; return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived)); } function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) { - const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; if (!assumeTrue) { - return filterType(type, (t) => !isRelated(t, candidate)); + if (checkDerived) { + return filterType(type, (t) => !isTypeDerivedFrom(t, candidate)); + } + const trueType2 = getNarrowedType( + type, + candidate, + /*assumeTrue*/ + true, + /*checkDerived*/ + false + ); + return filterType(type, (t) => !isTypeSubsetOf(t, trueType2)); } if (type.flags & 3 /* AnyOrUnknown */) { return candidate; } + const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0; const narrowedType = mapType(candidate, (c) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -69395,7 +69973,7 @@ function createTypeChecker(host) { } } function getTypeOfSymbolAtLocation(symbol, location) { - symbol = symbol.exportSymbol || symbol; + symbol = getExportSymbolOfValueSymbolIfExported(symbol); if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) { if (isRightSideOfQualifiedNameOrPropertyAccess(location)) { location = location.parent; @@ -69447,15 +70025,25 @@ function createTypeChecker(host) { function isConstVariable(symbol) { return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0; } - function removeOptionalityFromDeclaredType(declaredType, declaration) { - if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { - const annotationIncludesUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */); - popTypeResolution(); - return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; - } else { - reportCircularityError(declaration.symbol); - return declaredType; + function parameterInitializerContainsUndefined(declaration) { + const links = getNodeLinks(declaration); + if (links.parameterInitializerContainsUndefined === void 0) { + if (!pushTypeResolution(declaration, 9 /* ParameterInitializerContainsUndefined */)) { + reportCircularityError(declaration.symbol); + return true; + } + const containsUndefined = !!(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */); + if (!popTypeResolution()) { + reportCircularityError(declaration.symbol); + return true; + } + links.parameterInitializerContainsUndefined = containsUndefined; } + return links.parameterInitializerContainsUndefined; + } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + const removeUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !parameterInitializerContainsUndefined(declaration); + return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; } function isConstraintPosition(type, node) { const parent2 = node.parent; @@ -70566,9 +71154,18 @@ function createTypeChecker(host) { if (prop) { return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop); } - if (isTupleType(t)) { - const restType = getRestTypeOfTupleType(t); - if (restType && isNumericLiteralName(name) && +name >= 0) { + if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) { + const restType = getElementTypeOfSliceOfTupleType( + t, + t.target.fixedLength, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ); + if (restType) { return restType; } } @@ -70615,9 +71212,18 @@ function createTypeChecker(host) { return void 0; } function getContextualTypeForElementExpression(arrayContextualType, index) { - return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType( + return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType( arrayContextualType, - (t) => getIteratedTypeOrElementType( + (t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType( + t, + 0, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ) : getIteratedTypeOrElementType( 1 /* Element */, t, undefinedType, @@ -70770,14 +71376,17 @@ function createTypeChecker(host) { return type; } function getContextualType2(node, contextFlags) { + var _a2, _b; if (node.flags & 33554432 /* InWithStatement */) { return void 0; } - const index = findContextualNode(node); + const index = findContextualNode( + node, + /*includeCaches*/ + !contextFlags + ); if (index >= 0) { - const cached = contextualTypes[index]; - if (cached || !contextFlags) - return cached; + return contextualTypes[index]; } const { parent: parent2 } = node; switch (parent2.kind) { @@ -70812,7 +71421,9 @@ function createTypeChecker(host) { case 206 /* ArrayLiteralExpression */: { const arrayLiteral = parent2; const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); - return getContextualTypeForElementExpression(type, indexOfNode(arrayLiteral.elements, node)); + const spreadIndex = (_b = (_a2 = getNodeLinks(arrayLiteral)).firstSpreadIndex) != null ? _b : _a2.firstSpreadIndex = findIndex(arrayLiteral.elements, isSpreadElement); + const elementIndex = indexOfNode(arrayLiteral.elements, node); + return getContextualTypeForElementExpression(type, spreadIndex < 0 || elementIndex < spreadIndex ? elementIndex : -1); } case 224 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); @@ -70848,17 +71459,30 @@ function createTypeChecker(host) { } return void 0; } - function pushContextualType(node, type) { + function pushCachedContextualType(node) { + pushContextualType( + node, + getContextualType2( + node, + /*contextFlags*/ + void 0 + ), + /*isCache*/ + true + ); + } + function pushContextualType(node, type, isCache) { contextualTypeNodes[contextualTypeCount] = node; contextualTypes[contextualTypeCount] = type; + contextualIsCache[contextualTypeCount] = isCache; contextualTypeCount++; } function popContextualType() { contextualTypeCount--; } - function findContextualNode(node) { + function findContextualNode(node, includeCaches) { for (let i = contextualTypeCount - 1; i >= 0; i--) { - if (node === contextualTypeNodes[i]) { + if (node === contextualTypeNodes[i] && (includeCaches || !contextualIsCache[i])) { return i; } } @@ -70881,7 +71505,11 @@ function createTypeChecker(host) { } function getContextualJsxElementAttributesType(node, contextFlags) { if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) { - const index = findContextualNode(node.parent); + const index = findContextualNode( + node.parent, + /*includeCaches*/ + !contextFlags + ); if (index >= 0) { return contextualTypes[index]; } @@ -71152,11 +71780,7 @@ function createTypeChecker(host) { const elementCount = elements.length; const elementTypes = []; const elementFlags = []; - pushContextualType(node, getContextualType2( - node, - /*contextFlags*/ - void 0 - )); + pushCachedContextualType(node); const inDestructuringPattern = isAssignmentTarget(node); const inConstContext = isConstContext(node); const contextualType = getApparentTypeOfContextualType( @@ -71319,11 +71943,7 @@ function createTypeChecker(host) { let propertiesTable = createSymbolTable(); let propertiesArray = []; let spread = emptyObjectType; - pushContextualType(node, getContextualType2( - node, - /*contextFlags*/ - void 0 - )); + pushCachedContextualType(node); const contextualType = getApparentTypeOfContextualType( node, /*contextFlags*/ @@ -72610,7 +73230,7 @@ function createTypeChecker(host) { function reportNonexistentProperty(propNode, containingType, isUncheckedJS) { let errorInfo; let relatedInfo; - if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 131068 /* Primitive */)) { + if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 134348796 /* Primitive */)) { for (const subtype of containingType.types) { if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) { errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(subtype)); @@ -72663,26 +73283,22 @@ function createTypeChecker(host) { function getSuggestedLibForNonExistentName(name) { const missingName = diagnosticName(name); const allFeatures = getScriptTargetFeatures(); - const libTargets = getOwnKeys(allFeatures); - for (const libTarget of libTargets) { - const containingTypes = getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== void 0 && contains(containingTypes, missingName)) { - return libTarget; - } - } + const typeFeatures = allFeatures.get(missingName); + return typeFeatures && firstIterator(typeFeatures.keys()); } function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { const container = getApparentType(containingType).symbol; if (!container) { return void 0; } + const containingTypeName = symbolName(container); const allFeatures = getScriptTargetFeatures(); - const libTargets = getOwnKeys(allFeatures); - for (const libTarget of libTargets) { - const featuresOfLib = allFeatures[libTarget]; - const featuresOfContainingType = featuresOfLib[symbolName(container)]; - if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) { - return libTarget; + const typeFeatures = allFeatures.get(containingTypeName); + if (typeFeatures) { + for (const [libTarget, featuresOfType] of typeFeatures) { + if (contains(featuresOfType, missingProperty)) { + return libTarget; + } } } } @@ -73211,7 +73827,7 @@ function createTypeChecker(host) { } else { const contextualType = getIndexedAccessType(restType, getNumberLiteralType(i - index), 256 /* Contextual */); const argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } @@ -73745,7 +74361,7 @@ function createTypeChecker(host) { const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */; const isDecorator2 = node.kind === 167 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); - const reportErrors2 = !candidatesOutArray; + const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; let typeArguments; if (!isDecorator2 && !isSuperCall(node)) { typeArguments = node.typeArguments; @@ -74704,7 +75320,7 @@ function createTypeChecker(host) { } } function checkCallExpression(node, checkMode) { - var _a2; + var _a2, _b, _c; checkGrammarTypeArguments(node, node.typeArguments); const signature = getResolvedSignature( node, @@ -74721,7 +75337,7 @@ function createTypeChecker(host) { } if (node.kind === 211 /* NewExpression */) { const declaration = signature.declaration; - if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a2 = getJSDocRoot(declaration)) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 173 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -74749,7 +75365,7 @@ function createTypeChecker(host) { /*allowDeclaration*/ false ); - if ((_a2 = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _a2.size) { + if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) { const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray); jsAssignmentType.objectFlags |= 4096 /* JSLiteral */; return getIntersectionType([returnType, jsAssignmentType]); @@ -75035,6 +75651,9 @@ function createTypeChecker(host) { checkGrammarExpressionWithTypeArguments(node); forEach(node.typeArguments, checkSourceElement); const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + return getInstantiationExpressionType(exprType, node); + } + function getInstantiationExpressionType(exprType, node) { const typeArguments = node.typeArguments; if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) { return exprType; @@ -76458,10 +77077,10 @@ function createTypeChecker(host) { if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 131068 /* Primitive */)) { + if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 134348796 /* Primitive */)) { error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures2(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -76983,8 +77602,8 @@ function createTypeChecker(host) { case 32 /* LessThanEqualsToken */: case 33 /* GreaterThanEqualsToken */: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); - rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); + leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right)); reportOperatorErrorUnless((left2, right2) => { if (isTypeAny(left2) || isTypeAny(right2)) { return true; @@ -77044,7 +77663,7 @@ function createTypeChecker(host) { return leftType; } else { checkAssignmentOperator(rightType); - return getRegularTypeOfObjectLiteral(rightType); + return rightType; } case 27 /* CommaToken */: if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) { @@ -77335,14 +77954,19 @@ function createTypeChecker(host) { return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */)); } function getContextNode2(node) { - if (node.kind === 289 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) { + if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) { return node.parent.parent; } return node; } function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) { const contextNode = getContextNode2(node); - pushContextualType(contextNode, contextualType); + pushContextualType( + contextNode, + contextualType, + /*isCache*/ + false + ); pushInferenceContext(contextNode, inferenceContext); const type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0)); if (inferenceContext && inferenceContext.intraExpressionInferenceSites) { @@ -77673,7 +78297,7 @@ function createTypeChecker(host) { return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) { return getTypeFromTypeNode(expr.type); - } else if (node.kind === 8 /* NumericLiteral */ || node.kind === 10 /* StringLiteral */ || node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */) { + } else if (isLiteralExpression(node) || isBooleanLiteral(node)) { return checkExpression(node); } return void 0; @@ -77683,7 +78307,12 @@ function createTypeChecker(host) { if (links.contextFreeType) { return links.contextFreeType; } - pushContextualType(node, anyType); + pushContextualType( + node, + anyType, + /*isCache*/ + false + ); const type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */); popContextualType(); return type; @@ -77898,7 +78527,7 @@ function createTypeChecker(host) { error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } - if ((node.questionToken || isJSDocOptionalParameter(node)) && isBindingPattern(node.name) && func.body) { + if (!node.initializer && isOptionalDeclaration(node) && isBindingPattern(node.name) && func.body) { error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { @@ -78420,8 +79049,8 @@ function createTypeChecker(host) { } return void 0; } - function getTypeParametersForTypeReference(node) { - const type = getTypeFromTypeReference(node); + function getTypeParametersForTypeReferenceOrImport(node) { + const type = getTypeFromTypeNode(node); if (!isErrorType(type)) { const symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { @@ -78439,11 +79068,14 @@ function createTypeChecker(host) { } } forEach(node.typeArguments, checkSourceElement); - const type = getTypeFromTypeReference(node); + checkTypeReferenceOrImport(node); + } + function checkTypeReferenceOrImport(node) { + const type = getTypeFromTypeNode(node); if (!isErrorType(type)) { if (node.typeArguments) { addLazyDiagnostic(() => { - const typeParameters = getTypeParametersForTypeReference(node); + const typeParameters = getTypeParametersForTypeReferenceOrImport(node); if (typeParameters) { checkTypeArgumentConstraints(node, typeParameters); } @@ -78465,7 +79097,7 @@ function createTypeChecker(host) { const typeReferenceNode = tryCast(node.parent, isTypeReferenceType); if (!typeReferenceNode) return void 0; - const typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReferenceNode); if (!typeParameters) return void 0; const constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); @@ -78645,7 +79277,7 @@ function createTypeChecker(host) { } } } - getTypeFromTypeNode(node); + checkTypeReferenceOrImport(node); } function checkNamedTupleMember(node) { if (node.dotDotDotToken && node.questionToken) { @@ -78810,6 +79442,17 @@ function createTypeChecker(host) { lastSeenNonAmbientDeclaration = node; } } + if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) { + for (const node2 of current.jsDoc) { + if (node2.tags) { + for (const tag of node2.tags) { + if (isJSDocOverloadTag(tag)) { + hasOverloads = true; + } + } + } + } + } } } if (multipleConstructorImplementation) { @@ -78847,8 +79490,9 @@ function createTypeChecker(host) { const bodySignature = getSignatureFromDeclaration(bodyDeclaration); for (const signature of signatures) { if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { + const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration; addRelatedInfo( - error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), + error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here) ); break; @@ -78941,6 +79585,9 @@ function createTypeChecker(host) { case 273 /* ImportSpecifier */: case 79 /* Identifier */: return 1 /* ExportValue */; + case 170 /* MethodSignature */: + case 168 /* PropertySignature */: + return 2 /* ExportType */; default: return Debug.failBadSyntaxKind(d); } @@ -78964,7 +79611,7 @@ function createTypeChecker(host) { ))) { return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* Primitive */ | 131072 /* Never */)) { + if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) { return void 0; } const thenFunction = getTypeOfPropertyOfType(type, "then"); @@ -79016,7 +79663,7 @@ function createTypeChecker(host) { return awaitedType || errorType; } function isThenableType(type) { - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* Primitive */ | 131072 /* Never */)) { + if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) { return false; } const thenFunction = getTypeOfPropertyOfType(type, "then"); @@ -79065,7 +79712,7 @@ function createTypeChecker(host) { return awaitedType; } } - Debug.assert(getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); + Debug.assert(isAwaitedTypeInstantiation(type) || getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); return type; } function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { @@ -81878,20 +82525,19 @@ function createTypeChecker(host) { } } } - function getMemberOverrideModifierStatus(node, member) { + function getMemberOverrideModifierStatus(node, member, memberSymbol) { if (!member.name) { return 0 /* Ok */; } - const symbol = getSymbolOfDeclaration(node); - const type = getDeclaredTypeOfSymbol(symbol); + const classSymbol = getSymbolOfDeclaration(node); + const type = getDeclaredTypeOfSymbol(classSymbol); const typeWithThis = getTypeWithThisArgument(type); - const staticType = getTypeOfSymbol(symbol); + const staticType = getTypeOfSymbol(classSymbol); const baseTypeNode = getEffectiveBaseTypeNode(node); const baseTypes = baseTypeNode && getBaseTypes(type); const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0; const baseStaticType = getBaseConstructorTypeOfClass(type); const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */); - const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name)); return checkMemberForOverrideModifier( node, staticType, @@ -81904,7 +82550,7 @@ function createTypeChecker(host) { isStatic(member), /* memberIsParameterProperty */ false, - memberName + symbolName(memberSymbol) ); } function getTargetSymbol(s) { @@ -82456,7 +83102,7 @@ function createTypeChecker(host) { getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */) { + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || node.parent.impliedNodeFormat === 1 /* CommonJS */)) { const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 93 /* ExportKeyword */); if (exportModifier) { error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); @@ -82787,8 +83433,6 @@ function createTypeChecker(host) { } else { if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); - } else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) { - grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); } } } @@ -82943,7 +83587,7 @@ function createTypeChecker(host) { const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; - const sym = resolveEntityName( + const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName( id, 67108863 /* All */, /*ignoreErrors*/ @@ -82951,7 +83595,7 @@ function createTypeChecker(host) { /*dontResolveAlias*/ true, node - ); + )); if (sym) { markAliasReferenced(sym, id); if (getAllSymbolFlags(sym) & 111551 /* Value */) { @@ -82995,8 +83639,6 @@ function createTypeChecker(host) { grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead); } else if (moduleKind === 4 /* System */ && !(node.flags & 16777216 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); - } else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && !(node.flags & 16777216 /* Ambient */)) { - grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead); } } } @@ -83324,6 +83966,8 @@ function createTypeChecker(host) { if (!(links.flags & 1 /* TypeChecked */)) { links.deferredNodes || (links.deferredNodes = /* @__PURE__ */ new Set()); links.deferredNodes.add(node); + } else { + Debug.assert(!links.deferredNodes, "A type-checked file should have no deferred nodes."); } } function checkDeferredNodes(context) { @@ -83331,6 +83975,7 @@ function createTypeChecker(host) { if (links.deferredNodes) { links.deferredNodes.forEach(checkDeferredNode); } + links.deferredNodes = void 0; } function checkDeferredNode(node) { var _a2, _b; @@ -83586,7 +84231,7 @@ function createTypeChecker(host) { } return node.parent.kind === 180 /* TypeReference */; } - function isHeritageClauseElementIdentifier(node) { + function isInNameOfExpressionWithTypeArguments(node) { while (node.parent.kind === 208 /* PropertyAccessExpression */) { node = node.parent; } @@ -83696,10 +84341,10 @@ function createTypeChecker(host) { while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) { name = name.parent; } - if (isHeritageClauseElementIdentifier(name)) { + if (isInNameOfExpressionWithTypeArguments(name)) { let meaning = 0 /* None */; if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) { - meaning = 788968 /* Type */; + meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */; if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551 /* Value */; } @@ -84105,8 +84750,8 @@ function createTypeChecker(host) { } return getNamedMembers(propsByName); } - function typeHasCallOrConstructSignatures2(type) { - return typeHasCallOrConstructSignatures(type, checker); + function typeHasCallOrConstructSignatures(type) { + return getSignaturesOfType(type, 0 /* Call */).length !== 0 || getSignaturesOfType(type, 1 /* Construct */).length !== 0; } function getRootSymbols(symbol) { const roots = getImmediateRootSymbols(symbol); @@ -84411,7 +85056,7 @@ function createTypeChecker(host) { return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0; } function getTypeReferenceSerializationKind(typeNameIn, location) { - var _a2, _b; + var _a2; const typeName = getParseTreeNode(typeNameIn, isEntityName); if (!typeName) return 0 /* Unknown */; @@ -84443,7 +85088,7 @@ function createTypeChecker(host) { location ); const resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol; - isTypeOnly || (isTypeOnly = !!((_b = valueSymbol == null ? void 0 : valueSymbol.declarations) == null ? void 0 : _b.every(isTypeOnlyImportOrExportDeclaration))); + isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */))); const typeSymbol = resolveEntityName( typeName, 788968 /* Type */, @@ -84594,7 +85239,7 @@ function createTypeChecker(host) { return false; } function literalTypeToNode(type, enclosing, tracker) { - const enumResult = type.flags & 1024 /* EnumLiteral */ ? nodeBuilder.symbolToExpression( + const enumResult = type.flags & 1056 /* EnumLike */ ? nodeBuilder.symbolToExpression( type.symbol, 111551 /* Value */, enclosing, @@ -85137,6 +85782,7 @@ function createTypeChecker(host) { let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; let sawExportBeforeDecorators = false; + let hasLeadingDecorators = false; for (const modifier of node.modifiers) { if (isDecorator(modifier)) { if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { @@ -85154,8 +85800,22 @@ function createTypeChecker(host) { if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } + if (hasLeadingDecorators && flags & 126975 /* Modifier */) { + Debug.assertIsDefined(firstDecorator); + const sourceFile = getSourceFileOfNode(modifier); + if (!hasParseDiagnostics(sourceFile)) { + addRelatedInfo( + error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here) + ); + return true; + } + return false; + } flags |= 131072 /* Decorator */; - if (flags & 1 /* Export */) { + if (!(flags & 126975 /* Modifier */)) { + hasLeadingDecorators = true; + } else if (flags & 1 /* Export */) { sawExportBeforeDecorators = true; } firstDecorator != null ? firstDecorator : firstDecorator = modifier; @@ -85443,7 +86103,6 @@ function createTypeChecker(host) { case 299 /* PropertyAssignment */: case 300 /* ShorthandPropertyAssignment */: case 267 /* NamespaceExportDeclaration */: - case 181 /* FunctionType */: case 279 /* MissingDeclaration */: return find(node.modifiers, isModifier); default: @@ -86140,7 +86799,7 @@ function createTypeChecker(host) { } function isSimpleLiteralEnumReference(expr) { if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { - return !!(checkExpressionCached(expr).flags & 1024 /* EnumLiteral */); + return !!(checkExpressionCached(expr).flags & 1056 /* EnumLike */); } } function checkAmbientInitializer(node) { @@ -86542,10 +87201,10 @@ function createTypeChecker(host) { } function findMostOverlappyType(source, unionTarget) { let bestMatch; - if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { + if (!(source.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { let matchingCount = 0; for (const target of unionTarget.types) { - if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { + if (!(target.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { const overlap = getIntersectionType([getIndexType(source), getIndexType(target)]); if (overlap.flags & 4194304 /* Index */) { return target; @@ -86563,7 +87222,7 @@ function createTypeChecker(host) { } function filterPrimitivesIfContainsNonPrimitive(type) { if (maybeTypeOfKind(type, 67108864 /* NonPrimitive */)) { - const result = filterType(type, (t) => !(t.flags & 131068 /* Primitive */)); + const result = filterType(type, (t) => !(t.flags & 134348796 /* Primitive */)); if (!(result.flags & 131072 /* Never */)) { return result; } @@ -87966,7 +88625,7 @@ var visitEachChildTable = { [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + nodeVisitor(node.expression, visitor, isExpression) ); }, // Clauses @@ -88053,31 +88712,31 @@ function extractSingleNode(nodes) { // src/compiler/sourcemap.ts function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) { - const { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; - const rawSources = []; - const sources = []; - const sourceToSourceIndexMap = /* @__PURE__ */ new Map(); - let sourcesContent; - const names = []; - let nameToNameIndexMap; - const mappingCharCodes = []; - let mappings = ""; - let lastGeneratedLine = 0; - let lastGeneratedCharacter = 0; - let lastSourceIndex = 0; - let lastSourceLine = 0; - let lastSourceCharacter = 0; - let lastNameIndex = 0; - let hasLast = false; - let pendingGeneratedLine = 0; - let pendingGeneratedCharacter = 0; - let pendingSourceIndex = 0; - let pendingSourceLine = 0; - let pendingSourceCharacter = 0; - let pendingNameIndex = 0; - let hasPending = false; - let hasPendingSource = false; - let hasPendingName = false; + var { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; + var rawSources = []; + var sources = []; + var sourceToSourceIndexMap = /* @__PURE__ */ new Map(); + var sourcesContent; + var names = []; + var nameToNameIndexMap; + var mappingCharCodes = []; + var mappings = ""; + var lastGeneratedLine = 0; + var lastGeneratedCharacter = 0; + var lastSourceIndex = 0; + var lastSourceLine = 0; + var lastSourceCharacter = 0; + var lastNameIndex = 0; + var hasLast = false; + var pendingGeneratedLine = 0; + var pendingGeneratedCharacter = 0; + var pendingSourceIndex = 0; + var pendingSourceLine = 0; + var pendingSourceCharacter = 0; + var pendingNameIndex = 0; + var hasPending = false; + var hasPendingSource = false; + var hasPendingName = false; return { getSources: () => rawSources, addSource, @@ -91312,7 +91971,7 @@ function transformTypeScript(context) { return node; } function tryGetConstEnumValue(node) { - if (compilerOptions.isolatedModules) { + if (getIsolatedModules(compilerOptions)) { return void 0; } return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; @@ -91861,7 +92520,16 @@ function transformClassFields(context) { visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) ); } - return visitEachChild(node, visitor, context); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); } function transformPublicFieldInitializer(node) { if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) { @@ -97194,7 +97862,7 @@ function transformES2018(context) { ); } function visitBinaryExpression(node, expressionResultIsUnused2) { - if (isDestructuringAssignment(node) && node.left.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + if (isDestructuringAssignment(node) && containsObjectRestOrSpread(node.left)) { return flattenDestructuringAssignment( node, visitor, @@ -97326,7 +97994,7 @@ function transformES2018(context) { } function visitForOfStatement(node, outermostLabeledStatement) { const ancestorFacts = enterSubtree(0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */ || isAssignmentPattern(node.initializer) && containsObjectRestOrSpread(node.initializer)) { node = transformForOfStatementWithObjectRest(node); } const result = node.awaitModifier ? transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) : factory2.restoreEnclosingLabel(visitEachChild(node, visitor, context), outermostLabeledStatement); @@ -105163,6 +105831,9 @@ function transformModule(context) { return visitEachChild(node, visitor, context); } function visitImportCallExpression(node) { + if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) { + return visitEachChild(node, visitor, context); + } const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; @@ -107639,7 +108310,7 @@ function transformECMAScriptModule(context) { if (node.isDeclarationFile) { return node; } - if (isExternalModule(node) || compilerOptions.isolatedModules) { + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { currentSourceFile = node; importRequireStatements = void 0; let result = updateExternalModule(node); @@ -107846,7 +108517,7 @@ function transformECMAScriptModule(context) { } function onEmitNode(hint, node, emitCallback) { if (isSourceFile(node)) { - if ((isExternalModule(node) || compilerOptions.isolatedModules) && compilerOptions.importHelpers) { + if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) { helperNameSubstitutions = /* @__PURE__ */ new Map(); } previousOnEmitNode(hint, node, emitCallback); @@ -108698,7 +109369,7 @@ function transformDeclarations(context) { if (elem.kind === 229 /* OmittedExpression */) { return elem; } - if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) { + if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) { return factory2.updateBindingElement( elem, elem.dotDotDotToken, @@ -110571,15 +111242,15 @@ function getFirstProjectOutput(configFile, ignoreCase) { return Debug.fail(`project ${configFile.options.configFilePath} expected to have at least one output`); } function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, declarationTransformers }, emitOnly, onlyBuildInfo, forceDtsEmit) { - const compilerOptions = host.getCompilerOptions(); - const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; - const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; - const emitterDiagnostics = createDiagnosticCollection(); - const newLine = getNewLineCharacter(compilerOptions); - const writer = createTextWriter(newLine); - const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); - let bundleBuildInfo; - let emitSkipped = false; + var compilerOptions = host.getCompilerOptions(); + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; + var emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; + var emitterDiagnostics = createDiagnosticCollection(); + var newLine = getNewLineCharacter(compilerOptions); + var writer = createTextWriter(newLine); + var { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); + var bundleBuildInfo; + var emitSkipped = false; enter(); forEachEmittedFile( host, @@ -111141,12 +111812,12 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme ); return outputFiles; } -var createPrinterWithDefaults = memoize(() => createPrinter({})); -var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); -var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); -var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); +var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({})); +var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true })); +var createPrinterWithRemoveCommentsNeverAsciiEscape = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); +var createPrinterWithRemoveCommentsOmitTrailingSemicolon = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); function createPrinter(printerOptions = {}, handlers = {}) { - const { + var { hasGlobalName, onEmitNode = noEmitNotification, isEmitNotificationEnabled, @@ -111158,57 +111829,57 @@ function createPrinter(printerOptions = {}, handlers = {}) { onBeforeEmitToken, onAfterEmitToken } = handlers; - const extendedDiagnostics = !!printerOptions.extendedDiagnostics; - const newLine = getNewLineCharacter(printerOptions); - const moduleKind = getEmitModuleKind(printerOptions); - const bundledHelpers = /* @__PURE__ */ new Map(); - let currentSourceFile; - let nodeIdToGeneratedName; - let nodeIdToGeneratedPrivateName; - let autoGeneratedIdToGeneratedName; - let generatedNames; - let formattedNameTempFlagsStack; - let formattedNameTempFlags; - let privateNameTempFlagsStack; - let privateNameTempFlags; - let tempFlagsStack; - let tempFlags; - let reservedNamesStack; - let reservedNames; - let reservedPrivateNamesStack; - let reservedPrivateNames; - let preserveSourceNewlines = printerOptions.preserveSourceNewlines; - let nextListElementPos; - let writer; - let ownWriter; - let write = writeBase; - let isOwnFileEmit; - const bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; - const relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; - const recordInternalSection = printerOptions.recordInternalSection; - let sourceFileTextPos = 0; - let sourceFileTextKind = "text" /* Text */; - let sourceMapsDisabled = true; - let sourceMapGenerator; - let sourceMapSource; - let sourceMapSourceIndex = -1; - let mostRecentlyAddedSourceMapSource; - let mostRecentlyAddedSourceMapSourceIndex = -1; - let containerPos = -1; - let containerEnd = -1; - let declarationListContainerEnd = -1; - let currentLineMap; - let detachedCommentsInfo; - let hasWrittenComment = false; - let commentsDisabled = !!printerOptions.removeComments; - let lastSubstitution; - let currentParenthesizerRule; - const { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); - const parenthesizer = factory.parenthesizer; - const typeArgumentParenthesizerRuleSelector = { + var extendedDiagnostics = !!printerOptions.extendedDiagnostics; + var newLine = getNewLineCharacter(printerOptions); + var moduleKind = getEmitModuleKind(printerOptions); + var bundledHelpers = /* @__PURE__ */ new Map(); + var currentSourceFile; + var nodeIdToGeneratedName; + var nodeIdToGeneratedPrivateName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var formattedNameTempFlagsStack; + var formattedNameTempFlags; + var privateNameTempFlagsStack; + var privateNameTempFlags; + var tempFlagsStack; + var tempFlags; + var reservedNamesStack; + var reservedNames; + var reservedPrivateNamesStack; + var reservedPrivateNames; + var preserveSourceNewlines = printerOptions.preserveSourceNewlines; + var nextListElementPos; + var writer; + var ownWriter; + var write = writeBase; + var isOwnFileEmit; + var bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; + var relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; + var recordInternalSection = printerOptions.recordInternalSection; + var sourceFileTextPos = 0; + var sourceFileTextKind = "text" /* Text */; + var sourceMapsDisabled = true; + var sourceMapGenerator; + var sourceMapSource; + var sourceMapSourceIndex = -1; + var mostRecentlyAddedSourceMapSource; + var mostRecentlyAddedSourceMapSourceIndex = -1; + var containerPos = -1; + var containerEnd = -1; + var declarationListContainerEnd = -1; + var currentLineMap; + var detachedCommentsInfo; + var hasWrittenComment = false; + var commentsDisabled = !!printerOptions.removeComments; + var lastSubstitution; + var currentParenthesizerRule; + var { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); + var parenthesizer = factory.parenthesizer; + var typeArgumentParenthesizerRuleSelector = { select: (index) => index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 }; - const emitBinaryExpression = createEmitBinaryExpression(); + var emitBinaryExpression = createEmitBinaryExpression(); reset2(); return { // public API @@ -111467,9 +112138,9 @@ function createPrinter(printerOptions = {}, handlers = {}) { formattedNameTempFlagsStack = []; formattedNameTempFlags = /* @__PURE__ */ new Map(); privateNameTempFlagsStack = []; - privateNameTempFlags = TempFlags.Auto; + privateNameTempFlags = 0 /* Auto */; tempFlagsStack = []; - tempFlags = TempFlags.Auto; + tempFlags = 0 /* Auto */; reservedNamesStack = []; reservedNames = void 0; reservedPrivateNamesStack = []; @@ -112438,7 +113109,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitTypeLiteral(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -112627,7 +113298,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitObjectLiteralExpression(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -113393,7 +114064,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitClassDeclarationOrExpression(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -113426,7 +114097,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitInterfaceDeclaration(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -114869,7 +115540,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { return; } tempFlagsStack.push(tempFlags); - tempFlags = TempFlags.Auto; + tempFlags = 0 /* Auto */; formattedNameTempFlagsStack.push(formattedNameTempFlags); formattedNameTempFlags = void 0; reservedNamesStack.push(reservedNames); @@ -115055,7 +115726,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { case "#": return privateNameTempFlags; default: - return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : TempFlags.Auto; + return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : 0 /* Auto */; } } function setTempFlags(formattedNameKey, flags) { @@ -115079,7 +115750,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { const key = formatGeneratedName(privateName, prefix, "", suffix); let tempFlags2 = getTempFlags(key); if (flags && !(tempFlags2 & flags)) { - const name = flags === TempFlags._i ? "_i" : "_n"; + const name = flags === 268435456 /* _i */ ? "_i" : "_n"; const fullName = formatGeneratedName(privateName, prefix, name, suffix); if (isUniqueName(fullName, privateName)) { tempFlags2 |= flags; @@ -115093,7 +115764,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } while (true) { - const count = tempFlags2 & TempFlags.CountMask; + const count = tempFlags2 & 268435455 /* CountMask */; tempFlags2++; if (count !== 8 && count !== 13) { const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); @@ -115237,7 +115908,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { return generateNameCached(node.name, privateName); } return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reservedInNestedScopes*/ false, privateName, @@ -115294,7 +115965,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); case 164 /* ComputedPropertyName */: return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reserveInNestedScopes*/ true, privateName, @@ -115303,7 +115974,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { ); default: return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reserveInNestedScopes*/ false, privateName, @@ -115318,11 +115989,11 @@ function createPrinter(printerOptions = {}, handlers = {}) { const suffix = formatGeneratedNamePart(autoGenerate.suffix); switch (autoGenerate.flags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + return makeTempVariableName(0 /* Auto */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); case 2 /* Loop */: Debug.assertNode(name, isIdentifier); return makeTempVariableName( - TempFlags._i, + 268435456 /* _i */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), /*privateName*/ false, @@ -115792,12 +116463,6 @@ function getOpeningBracket(format) { function getClosingBracket(format) { return brackets[format & 15360 /* BracketsMask */][1]; } -var TempFlags = /* @__PURE__ */ ((TempFlags2) => { - TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; - TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; - TempFlags2[TempFlags2["_i"] = 268435456] = "_i"; - return TempFlags2; -})(TempFlags || {}); function emitListItemNoParenthesizer(node, emit, _parenthesizerRule, _index) { emit(node); } @@ -116775,14 +117440,14 @@ var moduleResolutionNameAndModeGetter = { function createModuleResolutionLoader(containingFile, redirectedReference, options, host, cache) { return { nameAndMode: moduleResolutionNameAndModeGetter, - resolve: (moduleName, resoluionMode) => resolveModuleName( + resolve: (moduleName, resolutionMode) => resolveModuleName( moduleName, containingFile, options, host, cache, redirectedReference, - resoluionMode + resolutionMode ) }; } @@ -118321,11 +118986,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); } else if (isClassDeclaration(parent2)) { const exportIndex = findIndex(parent2.modifiers, isExportModifier); - const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); - if (exportIndex >= 0 && decoratorIndex < exportIndex) { - diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files)); - } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) { - diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + if (exportIndex >= 0) { + const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); + if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (exportIndex >= 0 && decoratorIndex < exportIndex) { + const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex); + if (trailingDecoratorIndex >= 0) { + diagnostics.push(addRelatedInfo( + createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here) + )); + } + } } } } @@ -118503,7 +119176,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config let imports; let moduleAugmentations; let ambientModules; - if ((options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { + if ((getIsolatedModules(options) || isExternalModuleFile) && !file.isDeclarationFile) { if (options.importHelpers) { imports = [createSyntheticImport(externalHelpersModuleNameText, file)]; } @@ -119224,12 +119897,12 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (options.exactOptionalPropertyTypes && !getStrictOptionValue(options, "strictNullChecks")) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks"); } - if (options.isolatedModules) { + if (options.isolatedModules || options.verbatimModuleSyntax) { if (options.out) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); } if (options.outFile) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", "isolatedModules"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); } } if (options.inlineSourceMap) { @@ -119440,10 +120113,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) { - createDiagnosticForOptionName(Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); } + const moduleKind = getEmitModuleKind(options); if (options.verbatimModuleSyntax) { - const moduleKind = getEmitModuleKind(options); if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } @@ -119462,13 +120135,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } const moduleResolution = getEmitModuleResolutionKind(options); if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("resolvePackageJsonExports", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); } if (options.resolvePackageJsonImports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("resolvePackageJsonImports", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); } if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("customConditions", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + } + if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)) { + createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "bundler"); } if (!options.noEmit && !options.suppressOutputPathCheck) { const emitHost = getEmitHost(); @@ -119623,7 +120299,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (version2 === "6.0" /* v6_0 */) { createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); } else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); } } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { @@ -120644,7 +121320,7 @@ var BuilderState; return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); } const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || outFile(compilerOptions))) { + if (compilerOptions && (getIsolatedModules(compilerOptions) || outFile(compilerOptions))) { return [sourceFileWithUpdatedShape]; } const seenFileNamesMap = /* @__PURE__ */ new Map(); @@ -121069,7 +121745,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile return; if (!isChangedSignature(state, affectedFile.resolvedPath)) return; - if (state.compilerOptions.isolatedModules) { + if (getIsolatedModules(state.compilerOptions)) { const seenFileNamesMap = /* @__PURE__ */ new Map(); seenFileNamesMap.set(affectedFile.resolvedPath, true); const queue = BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath); @@ -121162,14 +121838,17 @@ function getBuildInfo2(state, bundle) { const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0; const fileNames = []; const fileNameToFileId = /* @__PURE__ */ new Map(); + const root = []; if (outFile(state.compilerOptions)) { const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => { - toFileId(key); + const fileId = toFileId(key); + tryAddRoot(key, fileId); return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version; }); const program2 = { fileNames, fileInfos: fileInfos2, + root, options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), outSignature: state.outSignature, latestChangedDtsFile, @@ -121197,6 +121876,7 @@ function getBuildInfo2(state, bundle) { const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value]) => { var _a3, _b2; const fileId = toFileId(key); + tryAddRoot(key, fileId); Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key)); const oldSignature = (_a3 = state.oldSignatures) == null ? void 0 : _a3.get(key); const actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value.signature; @@ -121296,6 +121976,7 @@ function getBuildInfo2(state, bundle) { const program = { fileNames, fileInfos, + root, options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), fileIdsList, referencedMap, @@ -121331,6 +122012,24 @@ function getBuildInfo2(state, bundle) { } return fileIdListId; } + function tryAddRoot(path, fileId) { + const file = state.program.getSourceFile(path); + if (!state.program.getFileIncludeReasons().get(file.path).some((r) => r.kind === 0 /* RootFile */)) + return; + if (!root.length) + return root.push(fileId); + const last2 = root[root.length - 1]; + const isLastStartEnd = isArray(last2); + if (isLastStartEnd && last2[1] === fileId - 1) + return last2[1] = fileId; + if (isLastStartEnd || root.length === 1 || last2 !== fileId - 1) + return root.push(fileId); + const lastButOne = root[root.length - 2]; + if (!isNumber(lastButOne) || lastButOne !== last2 - 1) + return root.push(fileId); + root[root.length - 2] = [lastButOne, fileId]; + return root.length = root.length - 1; + } function convertToProgramBuildInfoCompilerOptions(options) { let result; const { optionsNameMap } = getOptionsNameMap(); @@ -121843,12 +122542,28 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) { const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); const fileInfos = /* @__PURE__ */ new Map(); + let rootIndex = 0; + const roots = []; program.fileInfos.forEach((fileInfo, index) => { const path = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName); const version2 = isString(fileInfo) ? fileInfo : fileInfo.version; fileInfos.set(path, version2); + if (rootIndex < program.root.length) { + const current = program.root[rootIndex]; + const fileId = index + 1; + if (isArray(current)) { + if (current[0] <= fileId && fileId <= current[1]) { + roots.push(path); + if (current[1] === fileId) + rootIndex++; + } + } else if (current === fileId) { + roots.push(path); + rootIndex++; + } + } }); - return fileInfos; + return { fileInfos, roots }; } function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) { return { @@ -122763,7 +123478,7 @@ function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) { return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine; } function getLocaleTimeString(system) { - return !system.now ? new Date().toLocaleTimeString() : ( + return !system.now ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : ( // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM. // This branch is solely for testing, so just switch it to a normal space for baseline stability. // See: @@ -124118,13 +124833,14 @@ var UpToDateStatusType = /* @__PURE__ */ ((UpToDateStatusType2) => { UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithUpstream"] = 7] = "OutOfDateWithUpstream"; UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfo"] = 8] = "OutOfDateBuildInfo"; UpToDateStatusType2[UpToDateStatusType2["OutOfDateOptions"] = 9] = "OutOfDateOptions"; - UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 10] = "UpstreamOutOfDate"; - UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 11] = "UpstreamBlocked"; - UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 12] = "ComputingUpstream"; - UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 13] = "TsVersionOutputOfDate"; - UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 14] = "UpToDateWithInputFileText"; - UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 15] = "ContainerOnly"; - UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 16] = "ForceBuild"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateRoots"] = 10] = "OutOfDateRoots"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 11] = "UpstreamOutOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 12] = "UpstreamBlocked"; + UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 13] = "ComputingUpstream"; + UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 14] = "TsVersionOutputOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 15] = "UpToDateWithInputFileText"; + UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 16] = "ContainerOnly"; + UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 17] = "ForceBuild"; return UpToDateStatusType2; })(UpToDateStatusType || {}); function resolveConfigFileProjectName(project) { @@ -124135,8 +124851,8 @@ function resolveConfigFileProjectName(project) { } // src/compiler/tsbuildPublic.ts -var minimumDate = new Date(-864e13); -var maximumDate = new Date(864e13); +var minimumDate = /* @__PURE__ */ new Date(-864e13); +var maximumDate = /* @__PURE__ */ new Date(864e13); function getOrCreateValueFromConfigFileMap(configFileMap, resolved, createT) { const existingValue = configFileMap.get(resolved); let newValue; @@ -124150,7 +124866,7 @@ function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) { return getOrCreateValueFromConfigFileMap(configFileMap, resolved, () => /* @__PURE__ */ new Map()); } function getCurrentTime(host) { - return host.now ? host.now() : new Date(); + return host.now ? host.now() : /* @__PURE__ */ new Date(); } function isCircularBuildOrder(buildOrder) { return !!buildOrder && !!buildOrder.buildOrder; @@ -125018,7 +125734,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { } continue; } - if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 14 /* UpToDateWithInputFileText */) { + if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) { reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); return { kind: 2 /* UpdateOutputFileStamps */, @@ -125030,7 +125746,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { }; } } - if (status.type === 11 /* UpstreamBlocked */) { + if (status.type === 12 /* UpstreamBlocked */) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); projectPendingBuild.delete(projectPath); @@ -125044,7 +125760,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { } continue; } - if (status.type === 15 /* ContainerOnly */) { + if (status.type === 16 /* ContainerOnly */) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); projectPendingBuild.delete(projectPath); @@ -125231,31 +125947,31 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { var _a2, _b; if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) { return { - type: 15 /* ContainerOnly */ + type: 16 /* ContainerOnly */ }; } let referenceStatuses; const force = !!state.options.force; if (project.projectReferences) { - state.projectStatus.set(resolvedPath, { type: 12 /* ComputingUpstream */ }); + state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ }); for (const ref of project.projectReferences) { const resolvedRef = resolveProjectReferencePath(ref); const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef); const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath); const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath); - if (refStatus.type === 12 /* ComputingUpstream */ || refStatus.type === 15 /* ContainerOnly */) { + if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) { continue; } - if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 11 /* UpstreamBlocked */) { + if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) { return { - type: 11 /* UpstreamBlocked */, + type: 12 /* UpstreamBlocked */, upstreamProjectName: ref.path, - upstreamProjectBlocked: refStatus.type === 11 /* UpstreamBlocked */ + upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */ }; } if (refStatus.type !== 1 /* UpToDate */) { return { - type: 10 /* UpstreamOutOfDate */, + type: 11 /* UpstreamOutOfDate */, upstreamProjectName: ref.path }; } @@ -125264,7 +125980,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { } } if (force) - return { type: 16 /* ForceBuild */ }; + return { type: 17 /* ForceBuild */ }; const { host } = state; const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options); let oldestOutputFileName; @@ -125297,7 +126013,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { } if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== version) { return { - type: 13 /* TsVersionOutputOfDate */, + type: 14 /* TsVersionOutputOfDate */, version: buildInfo.version }; } @@ -125322,6 +126038,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { let newestInputFileName = void 0; let newestInputFileTime = minimumDate; let pseudoInputUpToDate = false; + const seenRoots = /* @__PURE__ */ new Set(); for (const inputFile of project.fileNames) { const inputTime = getModifiedTime2(state, inputFile); if (inputTime === missingFileModifiedTime) { @@ -125336,7 +126053,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { if (buildInfoProgram) { if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); - version2 = buildInfoVersionMap.get(toPath2(state, inputFile)); + version2 = buildInfoVersionMap.fileInfos.get(toPath2(state, inputFile)); const text = version2 ? state.readFileWithCache(inputFile) : void 0; currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0; if (version2 && version2 === currentVersion) @@ -125354,6 +126071,21 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { newestInputFileName = inputFile; newestInputFileTime = inputTime; } + if (buildInfoProgram) + seenRoots.add(toPath2(state, inputFile)); + } + if (buildInfoProgram) { + if (!buildInfoVersionMap) + buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); + for (const existingRoot of buildInfoVersionMap.roots) { + if (!seenRoots.has(existingRoot)) { + return { + type: 10 /* OutOfDateRoots */, + buildInfoFile: buildInfoPath, + inputFile: existingRoot + }; + } + } } if (!buildInfoPath) { const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames()); @@ -125435,7 +126167,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) { }; } return { - type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 14 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, + type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, newestInputFileTime, newestInputFileName, oldestOutputFileName @@ -125554,7 +126286,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con } break; } - case 14 /* UpToDateWithInputFileText */: + case 15 /* UpToDateWithInputFileText */: case 2 /* UpToDateWithUpstreamTypes */: case 3 /* OutOfDateWithPrepend */: if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) { @@ -125565,7 +126297,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con }); } break; - case 11 /* UpstreamBlocked */: + case 12 /* UpstreamBlocked */: if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) { clearProjectStatus(state, nextProjectPath); } @@ -126016,6 +126748,14 @@ function reportUpToDateStatus(state, configFileName, status) { relName(state, configFileName), relName(state, status.buildInfoFile) ); + case 10 /* OutOfDateRoots */: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more, + relName(state, configFileName), + relName(state, status.buildInfoFile), + relName(state, status.inputFile) + ); case 1 /* UpToDate */: if (status.newestInputFileTime !== void 0) { return reportStatus( @@ -126040,20 +126780,20 @@ function reportUpToDateStatus(state, configFileName, status) { Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName) ); - case 14 /* UpToDateWithInputFileText */: + case 15 /* UpToDateWithInputFileText */: return reportStatus( state, Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files, relName(state, configFileName) ); - case 10 /* UpstreamOutOfDate */: + case 11 /* UpstreamOutOfDate */: return reportStatus( state, Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, relName(state, configFileName), relName(state, status.upstreamProjectName) ); - case 11 /* UpstreamBlocked */: + case 12 /* UpstreamBlocked */: return reportStatus( state, status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, @@ -126067,7 +126807,7 @@ function reportUpToDateStatus(state, configFileName, status) { relName(state, configFileName), status.reason ); - case 13 /* TsVersionOutputOfDate */: + case 14 /* TsVersionOutputOfDate */: return reportStatus( state, Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, @@ -126075,14 +126815,14 @@ function reportUpToDateStatus(state, configFileName, status) { status.version, version ); - case 16 /* ForceBuild */: + case 17 /* ForceBuild */: return reportStatus( state, Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName) ); - case 15 /* ContainerOnly */: - case 12 /* ComputingUpstream */: + case 16 /* ContainerOnly */: + case 13 /* ComputingUpstream */: break; default: assertType(status); @@ -126441,2655 +127181,316 @@ function findArgument(argumentName) { return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0; } function nowString() { - const d = new Date(); + const d = /* @__PURE__ */ new Date(); return `${padLeft(d.getHours().toString(), 2, "0")}:${padLeft(d.getMinutes().toString(), 2, "0")}:${padLeft(d.getSeconds().toString(), 2, "0")}.${padLeft(d.getMilliseconds().toString(), 3, "0")}`; } -// src/server/_namespaces/ts.server.ts -var ts_server_exports2 = {}; -__export(ts_server_exports2, { - ActionInvalidate: () => ActionInvalidate, - ActionPackageInstalled: () => ActionPackageInstalled, - ActionSet: () => ActionSet, - Arguments: () => Arguments, - AutoImportProviderProject: () => AutoImportProviderProject, - CharRangeSection: () => CharRangeSection, - CommandNames: () => CommandNames, - ConfigFileDiagEvent: () => ConfigFileDiagEvent, - ConfiguredProject: () => ConfiguredProject2, - Errors: () => Errors, - EventBeginInstallTypes: () => EventBeginInstallTypes, - EventEndInstallTypes: () => EventEndInstallTypes, - EventInitializationFailed: () => EventInitializationFailed, - EventTypesRegistry: () => EventTypesRegistry, - ExternalProject: () => ExternalProject2, - GcTimer: () => GcTimer, - InferredProject: () => InferredProject2, - LargeFileReferencedEvent: () => LargeFileReferencedEvent, - LineIndex: () => LineIndex, - LineLeaf: () => LineLeaf, - LineNode: () => LineNode, - LogLevel: () => LogLevel2, - Msg: () => Msg, - OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, - Project: () => Project3, - ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, - ProjectKind: () => ProjectKind, - ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, - ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, - ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, - ProjectReferenceProjectLoadKind: () => ProjectReferenceProjectLoadKind, - ProjectService: () => ProjectService3, - ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, - ScriptInfo: () => ScriptInfo, - ScriptVersionCache: () => ScriptVersionCache, - Session: () => Session3, - TextStorage: () => TextStorage, - ThrottledOperations: () => ThrottledOperations, - TypingsCache: () => TypingsCache, - allFilesAreJsOrDts: () => allFilesAreJsOrDts, - allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts, - asNormalizedPath: () => asNormalizedPath, - convertCompilerOptions: () => convertCompilerOptions, - convertFormatOptions: () => convertFormatOptions, - convertScriptKindName: () => convertScriptKindName, - convertTypeAcquisition: () => convertTypeAcquisition, - convertUserPreferences: () => convertUserPreferences, - convertWatchOptions: () => convertWatchOptions, - countEachFileTypes: () => countEachFileTypes, - createInstallTypingsRequest: () => createInstallTypingsRequest, - createModuleSpecifierCache: () => createModuleSpecifierCache, - createNormalizedPathMap: () => createNormalizedPathMap, - createPackageJsonCache: () => createPackageJsonCache, - createSortedArray: () => createSortedArray2, - emptyArray: () => emptyArray2, - findArgument: () => findArgument, - forEachResolvedProjectReferenceProject: () => forEachResolvedProjectReferenceProject, - formatMessage: () => formatMessage2, - getBaseConfigFileName: () => getBaseConfigFileName, - getLocationInNewDocument: () => getLocationInNewDocument, - hasArgument: () => hasArgument, - hasNoTypeScriptSource: () => hasNoTypeScriptSource, - indent: () => indent2, - isConfigFile: () => isConfigFile, - isConfiguredProject: () => isConfiguredProject, - isDynamicFileName: () => isDynamicFileName, - isExternalProject: () => isExternalProject, - isInferredProject: () => isInferredProject, - isInferredProjectName: () => isInferredProjectName, - makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, - makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, - makeInferredProjectName: () => makeInferredProjectName, - maxFileSize: () => maxFileSize, - maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, - normalizedPathToPath: () => normalizedPathToPath, - nowString: () => nowString, - nullCancellationToken: () => nullCancellationToken, - nullTypingsInstaller: () => nullTypingsInstaller, - projectContainsInfoDirectly: () => projectContainsInfoDirectly, - protocol: () => ts_server_protocol_exports, - removeSorted: () => removeSorted, - stringifyIndented: () => stringifyIndented, - toEvent: () => toEvent, - toNormalizedPath: () => toNormalizedPath, - tryConvertScriptKindName: () => tryConvertScriptKindName, - updateProjectIfDirty: () => updateProjectIfDirty -}); - -// src/server/_namespaces/ts.ts -var ts_exports3 = {}; -__export(ts_exports3, { - ANONYMOUS: () => ANONYMOUS, - AccessFlags: () => AccessFlags, - AssertionLevel: () => AssertionLevel, - AssignmentDeclarationKind: () => AssignmentDeclarationKind, - AssignmentKind: () => AssignmentKind, - Associativity: () => Associativity, - BreakpointResolver: () => ts_BreakpointResolver_exports, - BuilderFileEmit: () => BuilderFileEmit, - BuilderProgramKind: () => BuilderProgramKind, - BuilderState: () => BuilderState, - BundleFileSectionKind: () => BundleFileSectionKind, - CallHierarchy: () => ts_CallHierarchy_exports, - CharacterCodes: () => CharacterCodes, - CheckFlags: () => CheckFlags, - CheckMode: () => CheckMode, - ClassificationType: () => ClassificationType, - ClassificationTypeNames: () => ClassificationTypeNames, - CommentDirectiveType: () => CommentDirectiveType, - Comparison: () => Comparison, - CompletionInfoFlags: () => CompletionInfoFlags, - CompletionTriggerKind: () => CompletionTriggerKind, - Completions: () => ts_Completions_exports, - ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel, - ContextFlags: () => ContextFlags, - CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter, - Debug: () => Debug, - DeprecationVersion: () => DeprecationVersion, - DiagnosticCategory: () => DiagnosticCategory, - Diagnostics: () => Diagnostics, - DocumentHighlights: () => DocumentHighlights, - ElementFlags: () => ElementFlags, - EmitFlags: () => EmitFlags, - EmitHint: () => EmitHint, - EmitOnly: () => EmitOnly, - EndOfLineState: () => EndOfLineState, - EnumKind: () => EnumKind, - ExitStatus: () => ExitStatus, - ExportKind: () => ExportKind, - Extension: () => Extension, - ExternalEmitHelpers: () => ExternalEmitHelpers, - FileIncludeKind: () => FileIncludeKind, - FilePreprocessingDiagnosticsKind: () => FilePreprocessingDiagnosticsKind, - FileSystemEntryKind: () => FileSystemEntryKind, - FileWatcherEventKind: () => FileWatcherEventKind, - FindAllReferences: () => ts_FindAllReferences_exports, - FlattenLevel: () => FlattenLevel, - FlowFlags: () => FlowFlags, - ForegroundColorEscapeSequences: () => ForegroundColorEscapeSequences, - FunctionFlags: () => FunctionFlags, - GeneratedIdentifierFlags: () => GeneratedIdentifierFlags, - GetLiteralTextFlags: () => GetLiteralTextFlags, - GoToDefinition: () => ts_GoToDefinition_exports, - HighlightSpanKind: () => HighlightSpanKind, - ImportKind: () => ImportKind, - ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, - IndentStyle: () => IndentStyle, - IndexKind: () => IndexKind, - InferenceFlags: () => InferenceFlags, - InferencePriority: () => InferencePriority, - InlayHintKind: () => InlayHintKind, - InlayHints: () => ts_InlayHints_exports, - InternalEmitFlags: () => InternalEmitFlags, - InternalSymbolName: () => InternalSymbolName, - InvalidatedProjectKind: () => InvalidatedProjectKind, - JsDoc: () => ts_JsDoc_exports, - JsTyping: () => ts_JsTyping_exports, - JsxEmit: () => JsxEmit, - JsxFlags: () => JsxFlags, - JsxReferenceKind: () => JsxReferenceKind, - LanguageServiceMode: () => LanguageServiceMode, - LanguageServiceShimHostAdapter: () => LanguageServiceShimHostAdapter, - LanguageVariant: () => LanguageVariant, - LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, - ListFormat: () => ListFormat, - LogLevel: () => LogLevel, - MemberOverrideStatus: () => MemberOverrideStatus, - ModifierFlags: () => ModifierFlags, - ModuleDetectionKind: () => ModuleDetectionKind, - ModuleInstanceState: () => ModuleInstanceState, - ModuleKind: () => ModuleKind, - ModuleResolutionKind: () => ModuleResolutionKind, - ModuleSpecifierEnding: () => ModuleSpecifierEnding, - NavigateTo: () => ts_NavigateTo_exports, - NavigationBar: () => ts_NavigationBar_exports, - NewLineKind: () => NewLineKind, - NodeBuilderFlags: () => NodeBuilderFlags, - NodeCheckFlags: () => NodeCheckFlags, - NodeFactoryFlags: () => NodeFactoryFlags, - NodeFlags: () => NodeFlags, - NodeResolutionFeatures: () => NodeResolutionFeatures, - ObjectFlags: () => ObjectFlags, - OperationCanceledException: () => OperationCanceledException, - OperatorPrecedence: () => OperatorPrecedence, - OrganizeImports: () => ts_OrganizeImports_exports, - OrganizeImportsMode: () => OrganizeImportsMode, - OuterExpressionKinds: () => OuterExpressionKinds, - OutliningElementsCollector: () => ts_OutliningElementsCollector_exports, - OutliningSpanKind: () => OutliningSpanKind, - OutputFileType: () => OutputFileType, - PackageJsonAutoImportPreference: () => PackageJsonAutoImportPreference, - PackageJsonDependencyGroup: () => PackageJsonDependencyGroup, - PatternMatchKind: () => PatternMatchKind, - PollingInterval: () => PollingInterval, - PollingWatchKind: () => PollingWatchKind, - PragmaKindFlags: () => PragmaKindFlags, - PrivateIdentifierKind: () => PrivateIdentifierKind, - ProcessLevel: () => ProcessLevel, - QuotePreference: () => QuotePreference, - RelationComparisonResult: () => RelationComparisonResult, - Rename: () => ts_Rename_exports, - ScriptElementKind: () => ScriptElementKind, - ScriptElementKindModifier: () => ScriptElementKindModifier, - ScriptKind: () => ScriptKind, - ScriptSnapshot: () => ScriptSnapshot, - ScriptTarget: () => ScriptTarget, - SemanticClassificationFormat: () => SemanticClassificationFormat, - SemanticMeaning: () => SemanticMeaning, - SemicolonPreference: () => SemicolonPreference, - SignatureCheckMode: () => SignatureCheckMode, - SignatureFlags: () => SignatureFlags, - SignatureHelp: () => ts_SignatureHelp_exports, - SignatureKind: () => SignatureKind, - SmartSelectionRange: () => ts_SmartSelectionRange_exports, - SnippetKind: () => SnippetKind, - SortKind: () => SortKind, - StructureIsReused: () => StructureIsReused, - SymbolAccessibility: () => SymbolAccessibility, - SymbolDisplay: () => ts_SymbolDisplay_exports, - SymbolDisplayPartKind: () => SymbolDisplayPartKind, - SymbolFlags: () => SymbolFlags, - SymbolFormatFlags: () => SymbolFormatFlags, - SyntaxKind: () => SyntaxKind, - SyntheticSymbolKind: () => SyntheticSymbolKind, - Ternary: () => Ternary, - ThrottledCancellationToken: () => ThrottledCancellationToken, - TokenClass: () => TokenClass, - TokenFlags: () => TokenFlags, - TransformFlags: () => TransformFlags, - TypeFacts: () => TypeFacts, - TypeFlags: () => TypeFlags, - TypeFormatFlags: () => TypeFormatFlags, - TypeMapKind: () => TypeMapKind, - TypePredicateKind: () => TypePredicateKind, - TypeReferenceSerializationKind: () => TypeReferenceSerializationKind, - TypeScriptServicesFactory: () => TypeScriptServicesFactory, - UnionReduction: () => UnionReduction, - UpToDateStatusType: () => UpToDateStatusType, - VarianceFlags: () => VarianceFlags, - Version: () => Version, - VersionRange: () => VersionRange, - WatchDirectoryFlags: () => WatchDirectoryFlags, - WatchDirectoryKind: () => WatchDirectoryKind, - WatchFileKind: () => WatchFileKind, - WatchLogLevel: () => WatchLogLevel, - WatchType: () => WatchType, - accessPrivateIdentifier: () => accessPrivateIdentifier, - addEmitFlags: () => addEmitFlags, - addEmitHelper: () => addEmitHelper, - addEmitHelpers: () => addEmitHelpers, - addInternalEmitFlags: () => addInternalEmitFlags, - addNodeFactoryPatcher: () => addNodeFactoryPatcher, - addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, - addRange: () => addRange, - addRelatedInfo: () => addRelatedInfo, - addSyntheticLeadingComment: () => addSyntheticLeadingComment, - addSyntheticTrailingComment: () => addSyntheticTrailingComment, - addToSeen: () => addToSeen, - advancedAsyncSuperHelper: () => advancedAsyncSuperHelper, - affectsDeclarationPathOptionDeclarations: () => affectsDeclarationPathOptionDeclarations, - affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations, - allKeysStartWithDot: () => allKeysStartWithDot, - altDirectorySeparator: () => altDirectorySeparator, - and: () => and, - append: () => append, - appendIfUnique: () => appendIfUnique, - arrayFrom: () => arrayFrom, - arrayIsEqualTo: () => arrayIsEqualTo, - arrayIsHomogeneous: () => arrayIsHomogeneous, - arrayIsSorted: () => arrayIsSorted, - arrayOf: () => arrayOf, - arrayReverseIterator: () => arrayReverseIterator, - arrayToMap: () => arrayToMap, - arrayToMultiMap: () => arrayToMultiMap, - arrayToNumericMap: () => arrayToNumericMap, - arraysEqual: () => arraysEqual, - assertType: () => assertType, - assign: () => assign, - assignHelper: () => assignHelper, - asyncDelegator: () => asyncDelegator, - asyncGeneratorHelper: () => asyncGeneratorHelper, - asyncSuperHelper: () => asyncSuperHelper, - asyncValues: () => asyncValues, - attachFileToDiagnostics: () => attachFileToDiagnostics, - awaitHelper: () => awaitHelper, - awaiterHelper: () => awaiterHelper, - base64decode: () => base64decode, - base64encode: () => base64encode, - binarySearch: () => binarySearch, - binarySearchKey: () => binarySearchKey, - bindSourceFile: () => bindSourceFile, - breakIntoCharacterSpans: () => breakIntoCharacterSpans, - breakIntoWordSpans: () => breakIntoWordSpans, - buildLinkParts: () => buildLinkParts, - buildOpts: () => buildOpts, - buildOverload: () => buildOverload, - bundlerModuleNameResolver: () => bundlerModuleNameResolver, - canBeConvertedToAsync: () => canBeConvertedToAsync, - canHaveDecorators: () => canHaveDecorators, - canHaveExportModifier: () => canHaveExportModifier, - canHaveFlowNode: () => canHaveFlowNode, - canHaveIllegalDecorators: () => canHaveIllegalDecorators, - canHaveIllegalModifiers: () => canHaveIllegalModifiers, - canHaveIllegalType: () => canHaveIllegalType, - canHaveIllegalTypeParameters: () => canHaveIllegalTypeParameters, - canHaveJSDoc: () => canHaveJSDoc, - canHaveLocals: () => canHaveLocals, - canHaveModifiers: () => canHaveModifiers, - canHaveSymbol: () => canHaveSymbol, - canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, - canProduceDiagnostics: () => canProduceDiagnostics, - canUsePropertyAccess: () => canUsePropertyAccess, - canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, - cartesianProduct: () => cartesianProduct, - cast: () => cast, - chainBundle: () => chainBundle, - chainDiagnosticMessages: () => chainDiagnosticMessages, - changeAnyExtension: () => changeAnyExtension, - changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, - changeExtension: () => changeExtension, - changesAffectModuleResolution: () => changesAffectModuleResolution, - changesAffectingProgramStructure: () => changesAffectingProgramStructure, - childIsDecorated: () => childIsDecorated, - classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, - classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, - classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, - classPrivateFieldInHelper: () => classPrivateFieldInHelper, - classPrivateFieldSetHelper: () => classPrivateFieldSetHelper, - classicNameResolver: () => classicNameResolver, - classifier: () => ts_classifier_exports, - cleanExtendedConfigCache: () => cleanExtendedConfigCache, - clear: () => clear, - clearMap: () => clearMap, - clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, - climbPastPropertyAccess: () => climbPastPropertyAccess, - climbPastPropertyOrElementAccess: () => climbPastPropertyOrElementAccess, - clone: () => clone, - cloneCompilerOptions: () => cloneCompilerOptions, - closeFileWatcher: () => closeFileWatcher, - closeFileWatcherOf: () => closeFileWatcherOf, - codefix: () => ts_codefix_exports, - collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, - collectExternalModuleInfo: () => collectExternalModuleInfo, - combine: () => combine, - combinePaths: () => combinePaths, - commentPragmas: () => commentPragmas, - commonOptionsWithBuild: () => commonOptionsWithBuild, - commonPackageFolders: () => commonPackageFolders, - compact: () => compact, - compareBooleans: () => compareBooleans, - compareDataObjects: () => compareDataObjects, - compareDiagnostics: () => compareDiagnostics, - compareDiagnosticsSkipRelatedInformation: () => compareDiagnosticsSkipRelatedInformation, - compareEmitHelpers: () => compareEmitHelpers, - compareNumberOfDirectorySeparators: () => compareNumberOfDirectorySeparators, - comparePaths: () => comparePaths, - comparePathsCaseInsensitive: () => comparePathsCaseInsensitive, - comparePathsCaseSensitive: () => comparePathsCaseSensitive, - comparePatternKeys: () => comparePatternKeys, - compareProperties: () => compareProperties, - compareStringsCaseInsensitive: () => compareStringsCaseInsensitive, - compareStringsCaseInsensitiveEslintCompatible: () => compareStringsCaseInsensitiveEslintCompatible, - compareStringsCaseSensitive: () => compareStringsCaseSensitive, - compareStringsCaseSensitiveUI: () => compareStringsCaseSensitiveUI, - compareTextSpans: () => compareTextSpans, - compareValues: () => compareValues, - compileOnSaveCommandLineOption: () => compileOnSaveCommandLineOption, - compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, - compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, - compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, - compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, - compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, - compose: () => compose, - computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, - computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, - computeLineOfPosition: () => computeLineOfPosition, - computeLineStarts: () => computeLineStarts, - computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, - computeSignature: () => computeSignature, - computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics, - computeSuggestionDiagnostics: () => computeSuggestionDiagnostics, - concatenate: () => concatenate, - concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains, - consumesNodeCoreModules: () => consumesNodeCoreModules, - contains: () => contains, - containsIgnoredPath: () => containsIgnoredPath, - containsParseError: () => containsParseError, - containsPath: () => containsPath, - convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, - convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, - convertJsonOption: () => convertJsonOption, - convertToBase64: () => convertToBase64, - convertToObject: () => convertToObject, - convertToObjectWorker: () => convertToObjectWorker, - convertToOptionsWithAbsolutePaths: () => convertToOptionsWithAbsolutePaths, - convertToRelativePath: () => convertToRelativePath, - convertToTSConfig: () => convertToTSConfig, - convertTypeAcquisitionFromJson: () => convertTypeAcquisitionFromJson, - copyComments: () => copyComments, - copyEntries: () => copyEntries, - copyLeadingComments: () => copyLeadingComments, - copyProperties: () => copyProperties, - copyTrailingAsLeadingComments: () => copyTrailingAsLeadingComments, - copyTrailingComments: () => copyTrailingComments, - couldStartTrivia: () => couldStartTrivia, - countWhere: () => countWhere, - createAbstractBuilder: () => createAbstractBuilder, - createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, - createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, - createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, - createBaseNodeFactory: () => createBaseNodeFactory, - createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, - createBindingHelper: () => createBindingHelper, - createBuildInfo: () => createBuildInfo, - createBuilderProgram: () => createBuilderProgram, - createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, - createBuilderStatusReporter: () => createBuilderStatusReporter, - createCacheWithRedirects: () => createCacheWithRedirects, - createCacheableExportInfoMap: () => createCacheableExportInfoMap, - createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, - createClassifier: () => createClassifier, - createCommentDirectivesMap: () => createCommentDirectivesMap, - createCompilerDiagnostic: () => createCompilerDiagnostic, - createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, - createCompilerDiagnosticFromMessageChain: () => createCompilerDiagnosticFromMessageChain, - createCompilerHost: () => createCompilerHost, - createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, - createCompilerHostWorker: () => createCompilerHostWorker, - createDetachedDiagnostic: () => createDetachedDiagnostic, - createDiagnosticCollection: () => createDiagnosticCollection, - createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, - createDiagnosticForNode: () => createDiagnosticForNode, - createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, - createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, - createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, - createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, - createDiagnosticForRange: () => createDiagnosticForRange, - createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, - createDiagnosticReporter: () => createDiagnosticReporter, - createDocumentPositionMapper: () => createDocumentPositionMapper, - createDocumentRegistry: () => createDocumentRegistry, - createDocumentRegistryInternal: () => createDocumentRegistryInternal, - createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, - createEmitHelperFactory: () => createEmitHelperFactory, - createEmptyExports: () => createEmptyExports, - createExpressionForJsxElement: () => createExpressionForJsxElement, - createExpressionForJsxFragment: () => createExpressionForJsxFragment, - createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, - createExpressionForPropertyName: () => createExpressionForPropertyName, - createExpressionFromEntityName: () => createExpressionFromEntityName, - createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createFileDiagnostic: () => createFileDiagnostic, - createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createForOfBindingStatement: () => createForOfBindingStatement, - createGetCanonicalFileName: () => createGetCanonicalFileName, - createGetSourceFile: () => createGetSourceFile, - createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, - createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, - createGetSymbolWalker: () => createGetSymbolWalker, - createIncrementalCompilerHost: () => createIncrementalCompilerHost, - createIncrementalProgram: () => createIncrementalProgram, - createInputFiles: () => createInputFiles, - createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, - createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, - createJsxFactoryExpression: () => createJsxFactoryExpression, - createLanguageService: () => createLanguageService, - createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createModeAwareCache: () => createModeAwareCache, - createModeAwareCacheKey: () => createModeAwareCacheKey, - createModuleResolutionCache: () => createModuleResolutionCache, - createModuleResolutionLoader: () => createModuleResolutionLoader, - createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, - createMultiMap: () => createMultiMap, - createNodeConverters: () => createNodeConverters, - createNodeFactory: () => createNodeFactory, - createOptionNameMap: () => createOptionNameMap, - createOverload: () => createOverload, - createPackageJsonImportFilter: () => createPackageJsonImportFilter, - createPackageJsonInfo: () => createPackageJsonInfo, - createParenthesizerRules: () => createParenthesizerRules, - createPatternMatcher: () => createPatternMatcher, - createPrependNodes: () => createPrependNodes, - createPrinter: () => createPrinter, - createPrinterWithDefaults: () => createPrinterWithDefaults, - createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, - createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, - createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, - createProgram: () => createProgram, - createProgramHost: () => createProgramHost, - createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, - createQueue: () => createQueue, - createRange: () => createRange, - createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, - createResolutionCache: () => createResolutionCache, - createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, - createScanner: () => createScanner, - createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, - createSet: () => createSet, - createSolutionBuilder: () => createSolutionBuilder, - createSolutionBuilderHost: () => createSolutionBuilderHost, - createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, - createSolutionBuilderWithWatchHost: () => createSolutionBuilderWithWatchHost, - createSortedArray: () => createSortedArray, - createSourceFile: () => createSourceFile, - createSourceMapGenerator: () => createSourceMapGenerator, - createSourceMapSource: () => createSourceMapSource, - createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, - createSymbolTable: () => createSymbolTable, - createSymlinkCache: () => createSymlinkCache, - createSystemWatchFunctions: () => createSystemWatchFunctions, - createTextChange: () => createTextChange, - createTextChangeFromStartLength: () => createTextChangeFromStartLength, - createTextChangeRange: () => createTextChangeRange, - createTextRangeFromNode: () => createTextRangeFromNode, - createTextRangeFromSpan: () => createTextRangeFromSpan, - createTextSpan: () => createTextSpan, - createTextSpanFromBounds: () => createTextSpanFromBounds, - createTextSpanFromNode: () => createTextSpanFromNode, - createTextSpanFromRange: () => createTextSpanFromRange, - createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, - createTextWriter: () => createTextWriter, - createTokenRange: () => createTokenRange, - createTypeChecker: () => createTypeChecker, - createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, - createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, - createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap, - createUnparsedSourceFile: () => createUnparsedSourceFile, - createWatchCompilerHost: () => createWatchCompilerHost2, - createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, - createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, - createWatchFactory: () => createWatchFactory, - createWatchHost: () => createWatchHost, - createWatchProgram: () => createWatchProgram, - createWatchStatusReporter: () => createWatchStatusReporter, - createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - declarationNameToString: () => declarationNameToString, - decodeMappings: () => decodeMappings, - decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, - decorateHelper: () => decorateHelper, - deduplicate: () => deduplicate, - defaultIncludeSpec: () => defaultIncludeSpec, - defaultInitCompilerOptions: () => defaultInitCompilerOptions, - defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, - detectSortCaseSensitivity: () => detectSortCaseSensitivity, - diagnosticCategoryName: () => diagnosticCategoryName, - diagnosticToString: () => diagnosticToString, - directoryProbablyExists: () => directoryProbablyExists, - directorySeparator: () => directorySeparator, - displayPart: () => displayPart, - displayPartsToString: () => displayPartsToString, - disposeEmitNodes: () => disposeEmitNodes, - documentSpansEqual: () => documentSpansEqual, - dumpTracingLegend: () => dumpTracingLegend, - elementAt: () => elementAt, - elideNodes: () => elideNodes, - emitComments: () => emitComments, - emitDetachedComments: () => emitDetachedComments, - emitFiles: () => emitFiles, - emitFilesAndReportErrors: () => emitFilesAndReportErrors, - emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, - emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, - emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, - emitNewLineBeforeLeadingComments: () => emitNewLineBeforeLeadingComments, - emitNewLineBeforeLeadingCommentsOfPosition: () => emitNewLineBeforeLeadingCommentsOfPosition, - emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, - emitUsingBuildInfo: () => emitUsingBuildInfo, - emptyArray: () => emptyArray, - emptyFileSystemEntries: () => emptyFileSystemEntries, - emptyMap: () => emptyMap, - emptyOptions: () => emptyOptions, - emptySet: () => emptySet, - endsWith: () => endsWith, - ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, - ensureScriptKind: () => ensureScriptKind, - ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, - entityNameToString: () => entityNameToString, - enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, - equalOwnProperties: () => equalOwnProperties, - equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, - equateStringsCaseSensitive: () => equateStringsCaseSensitive, - equateValues: () => equateValues, - esDecorateHelper: () => esDecorateHelper, - escapeJsxAttributeString: () => escapeJsxAttributeString, - escapeLeadingUnderscores: () => escapeLeadingUnderscores, - escapeNonAsciiString: () => escapeNonAsciiString, - escapeSnippetText: () => escapeSnippetText, - escapeString: () => escapeString, - every: () => every, - expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, - explainFiles: () => explainFiles, - explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, - exportAssignmentIsAlias: () => exportAssignmentIsAlias, - exportStarHelper: () => exportStarHelper, - expressionResultIsUnused: () => expressionResultIsUnused, - extend: () => extend, - extendsHelper: () => extendsHelper, - extensionFromPath: () => extensionFromPath, - extensionIsTS: () => extensionIsTS, - externalHelpersModuleNameText: () => externalHelpersModuleNameText, - factory: () => factory, - fileExtensionIs: () => fileExtensionIs, - fileExtensionIsOneOf: () => fileExtensionIsOneOf, - fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics, - filter: () => filter, - filterMutate: () => filterMutate, - filterSemanticDiagnostics: () => filterSemanticDiagnostics, - find: () => find, - findAncestor: () => findAncestor, - findBestPatternMatch: () => findBestPatternMatch, - findChildOfKind: () => findChildOfKind, - findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, - findConfigFile: () => findConfigFile, - findContainingList: () => findContainingList, - findDiagnosticForNode: () => findDiagnosticForNode, - findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, - findIndex: () => findIndex, - findLast: () => findLast, - findLastIndex: () => findLastIndex, - findListItemInfo: () => findListItemInfo, - findMap: () => findMap, - findModifier: () => findModifier, - findNextToken: () => findNextToken, - findPackageJson: () => findPackageJson, - findPackageJsons: () => findPackageJsons, - findPrecedingMatchingToken: () => findPrecedingMatchingToken, - findPrecedingToken: () => findPrecedingToken, - findSuperStatementIndex: () => findSuperStatementIndex, - findTokenOnLeftOfPosition: () => findTokenOnLeftOfPosition, - findUseStrictPrologue: () => findUseStrictPrologue, - first: () => first, - firstDefined: () => firstDefined, - firstDefinedIterator: () => firstDefinedIterator, - firstIterator: () => firstIterator, - firstOrOnly: () => firstOrOnly, - firstOrUndefined: () => firstOrUndefined, - firstOrUndefinedIterator: () => firstOrUndefinedIterator, - fixupCompilerOptions: () => fixupCompilerOptions, - flatMap: () => flatMap, - flatMapIterator: () => flatMapIterator, - flatMapToMutable: () => flatMapToMutable, - flatten: () => flatten, - flattenCommaList: () => flattenCommaList, - flattenDestructuringAssignment: () => flattenDestructuringAssignment, - flattenDestructuringBinding: () => flattenDestructuringBinding, - flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, - forEach: () => forEach, - forEachAncestor: () => forEachAncestor, - forEachAncestorDirectory: () => forEachAncestorDirectory, - forEachChild: () => forEachChild, - forEachChildRecursively: () => forEachChildRecursively, - forEachEmittedFile: () => forEachEmittedFile, - forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, - forEachEntry: () => forEachEntry, - forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, - forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, - forEachKey: () => forEachKey, - forEachLeadingCommentRange: () => forEachLeadingCommentRange, - forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, - forEachResolvedProjectReference: () => forEachResolvedProjectReference, - forEachReturnStatement: () => forEachReturnStatement, - forEachRight: () => forEachRight, - forEachTrailingCommentRange: () => forEachTrailingCommentRange, - forEachUnique: () => forEachUnique, - forEachYieldExpression: () => forEachYieldExpression, - forSomeAncestorDirectory: () => forSomeAncestorDirectory, - formatColorAndReset: () => formatColorAndReset, - formatDiagnostic: () => formatDiagnostic, - formatDiagnostics: () => formatDiagnostics, - formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, - formatGeneratedName: () => formatGeneratedName, - formatGeneratedNamePart: () => formatGeneratedNamePart, - formatLocation: () => formatLocation, - formatMessage: () => formatMessage, - formatStringFromArgs: () => formatStringFromArgs, - formatting: () => ts_formatting_exports, - fullTripleSlashAMDReferencePathRegEx: () => fullTripleSlashAMDReferencePathRegEx, - fullTripleSlashReferencePathRegEx: () => fullTripleSlashReferencePathRegEx, - generateDjb2Hash: () => generateDjb2Hash, - generateTSConfig: () => generateTSConfig, - generatorHelper: () => generatorHelper, - getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, - getAdjustedRenameLocation: () => getAdjustedRenameLocation, - getAliasDeclarationFromName: () => getAliasDeclarationFromName, - getAllAccessorDeclarations: () => getAllAccessorDeclarations, - getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, - getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, - getAllJSDocTags: () => getAllJSDocTags, - getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, - getAllKeys: () => getAllKeys, - getAllProjectOutputs: () => getAllProjectOutputs, - getAllSuperTypeNodes: () => getAllSuperTypeNodes, - getAllUnscopedEmitHelpers: () => getAllUnscopedEmitHelpers, - getAllowJSCompilerOption: () => getAllowJSCompilerOption, - getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports, - getAncestor: () => getAncestor, - getAnyExtensionFromPath: () => getAnyExtensionFromPath, - getAreDeclarationMapsEnabled: () => getAreDeclarationMapsEnabled, - getAssignedExpandoInitializer: () => getAssignedExpandoInitializer, - getAssignedName: () => getAssignedName, - getAssignmentDeclarationKind: () => getAssignmentDeclarationKind, - getAssignmentDeclarationPropertyAccessKind: () => getAssignmentDeclarationPropertyAccessKind, - getAssignmentTargetKind: () => getAssignmentTargetKind, - getAutomaticTypeDirectiveNames: () => getAutomaticTypeDirectiveNames, - getBaseFileName: () => getBaseFileName, - getBinaryOperatorPrecedence: () => getBinaryOperatorPrecedence, - getBuildInfo: () => getBuildInfo, - getBuildInfoFileVersionMap: () => getBuildInfoFileVersionMap, - getBuildInfoText: () => getBuildInfoText, - getBuildOrderFromAnyBuildOrder: () => getBuildOrderFromAnyBuildOrder, - getBuilderCreationParameters: () => getBuilderCreationParameters, - getBuilderFileEmit: () => getBuilderFileEmit, - getCheckFlags: () => getCheckFlags, - getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, - getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, - getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, - getCombinedModifierFlags: () => getCombinedModifierFlags, - getCombinedNodeFlags: () => getCombinedNodeFlags, - getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, - getCommentRange: () => getCommentRange, - getCommonSourceDirectory: () => getCommonSourceDirectory, - getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, - getCompilerOptionValue: () => getCompilerOptionValue, - getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, - getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, - getConstantValue: () => getConstantValue, - getContainerNode: () => getContainerNode, - getContainingClass: () => getContainingClass, - getContainingClassStaticBlock: () => getContainingClassStaticBlock, - getContainingFunction: () => getContainingFunction, - getContainingFunctionDeclaration: () => getContainingFunctionDeclaration, - getContainingFunctionOrClassStaticBlock: () => getContainingFunctionOrClassStaticBlock, - getContainingNodeArray: () => getContainingNodeArray, - getContainingObjectLiteralElement: () => getContainingObjectLiteralElement, - getContextualTypeFromParent: () => getContextualTypeFromParent, - getContextualTypeFromParentOrAncestorTypeNode: () => getContextualTypeFromParentOrAncestorTypeNode, - getCurrentTime: () => getCurrentTime, - getDeclarationDiagnostics: () => getDeclarationDiagnostics, - getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, - getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, - getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, - getDeclarationFromName: () => getDeclarationFromName, - getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, - getDeclarationOfKind: () => getDeclarationOfKind, - getDeclarationsOfKind: () => getDeclarationsOfKind, - getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, - getDecorators: () => getDecorators, - getDefaultCompilerOptions: () => getDefaultCompilerOptions2, - getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, - getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, - getDefaultLibFileName: () => getDefaultLibFileName, - getDefaultLibFilePath: () => getDefaultLibFilePath, - getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, - getDiagnosticText: () => getDiagnosticText, - getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan, - getDirectoryPath: () => getDirectoryPath, - getDocumentPositionMapper: () => getDocumentPositionMapper, - getESModuleInterop: () => getESModuleInterop, - getEditsForFileRename: () => getEditsForFileRename, - getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode, - getEffectiveConstraintOfTypeParameter: () => getEffectiveConstraintOfTypeParameter, - getEffectiveContainerForJSDocTemplateTag: () => getEffectiveContainerForJSDocTemplateTag, - getEffectiveImplementsTypeNodes: () => getEffectiveImplementsTypeNodes, - getEffectiveInitializer: () => getEffectiveInitializer, - getEffectiveJSDocHost: () => getEffectiveJSDocHost, - getEffectiveModifierFlags: () => getEffectiveModifierFlags, - getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => getEffectiveModifierFlagsAlwaysIncludeJSDoc, - getEffectiveModifierFlagsNoCache: () => getEffectiveModifierFlagsNoCache, - getEffectiveReturnTypeNode: () => getEffectiveReturnTypeNode, - getEffectiveSetAccessorTypeAnnotationNode: () => getEffectiveSetAccessorTypeAnnotationNode, - getEffectiveTypeAnnotationNode: () => getEffectiveTypeAnnotationNode, - getEffectiveTypeParameterDeclarations: () => getEffectiveTypeParameterDeclarations, - getEffectiveTypeRoots: () => getEffectiveTypeRoots, - getElementOrPropertyAccessArgumentExpressionOrName: () => getElementOrPropertyAccessArgumentExpressionOrName, - getElementOrPropertyAccessName: () => getElementOrPropertyAccessName, - getElementsOfBindingOrAssignmentPattern: () => getElementsOfBindingOrAssignmentPattern, - getEmitDeclarations: () => getEmitDeclarations, - getEmitFlags: () => getEmitFlags, - getEmitHelpers: () => getEmitHelpers, - getEmitModuleDetectionKind: () => getEmitModuleDetectionKind, - getEmitModuleKind: () => getEmitModuleKind, - getEmitModuleResolutionKind: () => getEmitModuleResolutionKind, - getEmitScriptTarget: () => getEmitScriptTarget, - getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer, - getEncodedSemanticClassifications: () => getEncodedSemanticClassifications, - getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications, - getEndLinePosition: () => getEndLinePosition, - getEntityNameFromTypeNode: () => getEntityNameFromTypeNode, - getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo, - getErrorCountForSummary: () => getErrorCountForSummary, - getErrorSpanForNode: () => getErrorSpanForNode, - getErrorSummaryText: () => getErrorSummaryText, - getEscapedTextOfIdentifierOrLiteral: () => getEscapedTextOfIdentifierOrLiteral, - getExpandoInitializer: () => getExpandoInitializer, - getExportAssignmentExpression: () => getExportAssignmentExpression, - getExportInfoMap: () => getExportInfoMap, - getExportNeedsImportStarHelper: () => getExportNeedsImportStarHelper, - getExpressionAssociativity: () => getExpressionAssociativity, - getExpressionPrecedence: () => getExpressionPrecedence, - getExternalHelpersModuleName: () => getExternalHelpersModuleName, - getExternalModuleImportEqualsDeclarationExpression: () => getExternalModuleImportEqualsDeclarationExpression, - getExternalModuleName: () => getExternalModuleName, - getExternalModuleNameFromDeclaration: () => getExternalModuleNameFromDeclaration, - getExternalModuleNameFromPath: () => getExternalModuleNameFromPath, - getExternalModuleNameLiteral: () => getExternalModuleNameLiteral, - getExternalModuleRequireArgument: () => getExternalModuleRequireArgument, - getFallbackOptions: () => getFallbackOptions, - getFileEmitOutput: () => getFileEmitOutput, - getFileMatcherPatterns: () => getFileMatcherPatterns, - getFileNamesFromConfigSpecs: () => getFileNamesFromConfigSpecs, - getFileWatcherEventKind: () => getFileWatcherEventKind, - getFilesInErrorForSummary: () => getFilesInErrorForSummary, - getFirstConstructorWithBody: () => getFirstConstructorWithBody, - getFirstIdentifier: () => getFirstIdentifier, - getFirstNonSpaceCharacterPosition: () => getFirstNonSpaceCharacterPosition, - getFirstProjectOutput: () => getFirstProjectOutput, - getFixableErrorSpanExpression: () => getFixableErrorSpanExpression, - getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, - getFullWidth: () => getFullWidth, - getFunctionFlags: () => getFunctionFlags, - getHeritageClause: () => getHeritageClause, - getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, - getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, - getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, - getIdentifierTypeArguments: () => getIdentifierTypeArguments, - getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, - getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, - getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, - getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, - getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, - getIndentSize: () => getIndentSize, - getIndentString: () => getIndentString, - getInitializedVariables: () => getInitializedVariables, - getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, - getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, - getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, - getInternalEmitFlags: () => getInternalEmitFlags, - getInvokedExpression: () => getInvokedExpression, - getIsolatedModules: () => getIsolatedModules, - getJSDocAugmentsTag: () => getJSDocAugmentsTag, - getJSDocClassTag: () => getJSDocClassTag, - getJSDocCommentRanges: () => getJSDocCommentRanges, - getJSDocCommentsAndTags: () => getJSDocCommentsAndTags, - getJSDocDeprecatedTag: () => getJSDocDeprecatedTag, - getJSDocDeprecatedTagNoCache: () => getJSDocDeprecatedTagNoCache, - getJSDocEnumTag: () => getJSDocEnumTag, - getJSDocHost: () => getJSDocHost, - getJSDocImplementsTags: () => getJSDocImplementsTags, - getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache, - getJSDocParameterTags: () => getJSDocParameterTags, - getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache, - getJSDocPrivateTag: () => getJSDocPrivateTag, - getJSDocPrivateTagNoCache: () => getJSDocPrivateTagNoCache, - getJSDocProtectedTag: () => getJSDocProtectedTag, - getJSDocProtectedTagNoCache: () => getJSDocProtectedTagNoCache, - getJSDocPublicTag: () => getJSDocPublicTag, - getJSDocPublicTagNoCache: () => getJSDocPublicTagNoCache, - getJSDocReadonlyTag: () => getJSDocReadonlyTag, - getJSDocReadonlyTagNoCache: () => getJSDocReadonlyTagNoCache, - getJSDocReturnTag: () => getJSDocReturnTag, - getJSDocReturnType: () => getJSDocReturnType, - getJSDocRoot: () => getJSDocRoot, - getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, - getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, - getJSDocTags: () => getJSDocTags, - getJSDocTagsNoCache: () => getJSDocTagsNoCache, - getJSDocTemplateTag: () => getJSDocTemplateTag, - getJSDocThisTag: () => getJSDocThisTag, - getJSDocType: () => getJSDocType, - getJSDocTypeAliasName: () => getJSDocTypeAliasName, - getJSDocTypeAssertionType: () => getJSDocTypeAssertionType, - getJSDocTypeParameterDeclarations: () => getJSDocTypeParameterDeclarations, - getJSDocTypeParameterTags: () => getJSDocTypeParameterTags, - getJSDocTypeParameterTagsNoCache: () => getJSDocTypeParameterTagsNoCache, - getJSDocTypeTag: () => getJSDocTypeTag, - getJSXImplicitImportBase: () => getJSXImplicitImportBase, - getJSXRuntimeImport: () => getJSXRuntimeImport, - getJSXTransformEnabled: () => getJSXTransformEnabled, - getKeyForCompilerOptions: () => getKeyForCompilerOptions, - getLanguageVariant: () => getLanguageVariant, - getLastChild: () => getLastChild, - getLeadingCommentRanges: () => getLeadingCommentRanges, - getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode, - getLeftmostAccessExpression: () => getLeftmostAccessExpression, - getLeftmostExpression: () => getLeftmostExpression, - getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, - getLineInfo: () => getLineInfo, - getLineOfLocalPosition: () => getLineOfLocalPosition, - getLineOfLocalPositionFromLineMap: () => getLineOfLocalPositionFromLineMap, - getLineStartPositionForPosition: () => getLineStartPositionForPosition, - getLineStarts: () => getLineStarts, - getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => getLinesBetweenPositionAndNextNonWhitespaceCharacter, - getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter, - getLinesBetweenPositions: () => getLinesBetweenPositions, - getLinesBetweenRangeEndAndRangeStart: () => getLinesBetweenRangeEndAndRangeStart, - getLinesBetweenRangeEndPositions: () => getLinesBetweenRangeEndPositions, - getLiteralText: () => getLiteralText, - getLocalNameForExternalImport: () => getLocalNameForExternalImport, - getLocalSymbolForExportDefault: () => getLocalSymbolForExportDefault, - getLocaleSpecificMessage: () => getLocaleSpecificMessage, - getLocaleTimeString: () => getLocaleTimeString, - getMappedContextSpan: () => getMappedContextSpan, - getMappedDocumentSpan: () => getMappedDocumentSpan, - getMappedLocation: () => getMappedLocation, - getMatchedFileSpec: () => getMatchedFileSpec, - getMatchedIncludeSpec: () => getMatchedIncludeSpec, - getMeaningFromDeclaration: () => getMeaningFromDeclaration, - getMeaningFromLocation: () => getMeaningFromLocation, - getMembersOfDeclaration: () => getMembersOfDeclaration, - getModeForFileReference: () => getModeForFileReference, - getModeForResolutionAtIndex: () => getModeForResolutionAtIndex, - getModeForUsageLocation: () => getModeForUsageLocation, - getModifiedTime: () => getModifiedTime, - getModifiers: () => getModifiers, - getModuleInstanceState: () => getModuleInstanceState, - getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, - getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, - getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, - getNameForExportedSymbol: () => getNameForExportedSymbol, - getNameFromIndexInfo: () => getNameFromIndexInfo, - getNameFromPropertyName: () => getNameFromPropertyName, - getNameOfAccessExpression: () => getNameOfAccessExpression, - getNameOfCompilerOptionValue: () => getNameOfCompilerOptionValue, - getNameOfDeclaration: () => getNameOfDeclaration, - getNameOfExpando: () => getNameOfExpando, - getNameOfJSDocTypedef: () => getNameOfJSDocTypedef, - getNameOrArgument: () => getNameOrArgument, - getNameTable: () => getNameTable, - getNamesForExportedSymbol: () => getNamesForExportedSymbol, - getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, - getNewLineCharacter: () => getNewLineCharacter, - getNewLineKind: () => getNewLineKind, - getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, - getNewTargetContainer: () => getNewTargetContainer, - getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, - getNodeForGeneratedName: () => getNodeForGeneratedName, - getNodeId: () => getNodeId, - getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, - getNodeModifiers: () => getNodeModifiers, - getNodeModulePathParts: () => getNodeModulePathParts, - getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, - getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, - getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, - getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, - getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, - getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, - getNormalizedPathComponents: () => getNormalizedPathComponents, - getObjectFlags: () => getObjectFlags, - getOperator: () => getOperator, - getOperatorAssociativity: () => getOperatorAssociativity, - getOperatorPrecedence: () => getOperatorPrecedence, - getOptionFromName: () => getOptionFromName, - getOptionsNameMap: () => getOptionsNameMap, - getOrCreateEmitNode: () => getOrCreateEmitNode, - getOrCreateExternalHelpersModuleNameIfNeeded: () => getOrCreateExternalHelpersModuleNameIfNeeded, - getOrUpdate: () => getOrUpdate, - getOriginalNode: () => getOriginalNode, - getOriginalNodeId: () => getOriginalNodeId, - getOriginalSourceFile: () => getOriginalSourceFile, - getOutputDeclarationFileName: () => getOutputDeclarationFileName, - getOutputExtension: () => getOutputExtension, - getOutputFileNames: () => getOutputFileNames, - getOutputPathsFor: () => getOutputPathsFor, - getOutputPathsForBundle: () => getOutputPathsForBundle, - getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, - getOwnKeys: () => getOwnKeys, - getOwnValues: () => getOwnValues, - getPackageJsonInfo: () => getPackageJsonInfo, - getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, - getPackageJsonsVisibleToFile: () => getPackageJsonsVisibleToFile, - getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, - getPackageScopeForPath: () => getPackageScopeForPath, - getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, - getParameterTypeNode: () => getParameterTypeNode, - getParentNodeInSpan: () => getParentNodeInSpan, - getParseTreeNode: () => getParseTreeNode, - getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, - getPathComponents: () => getPathComponents, - getPathComponentsRelativeTo: () => getPathComponentsRelativeTo, - getPathFromPathComponents: () => getPathFromPathComponents, - getPathUpdater: () => getPathUpdater, - getPathsBasePath: () => getPathsBasePath, - getPatternFromSpec: () => getPatternFromSpec, - getPendingEmitKind: () => getPendingEmitKind, - getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, - getPossibleGenericSignatures: () => getPossibleGenericSignatures, - getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, - getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, - getPreEmitDiagnostics: () => getPreEmitDiagnostics, - getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, - getPrivateIdentifier: () => getPrivateIdentifier, - getProperties: () => getProperties, - getProperty: () => getProperty, - getPropertyArrayElementValue: () => getPropertyArrayElementValue, - getPropertyAssignment: () => getPropertyAssignment, - getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, - getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, - getPropertyNameForUniqueESSymbol: () => getPropertyNameForUniqueESSymbol, - getPropertyNameOfBindingOrAssignmentElement: () => getPropertyNameOfBindingOrAssignmentElement, - getPropertySymbolFromBindingElement: () => getPropertySymbolFromBindingElement, - getPropertySymbolsFromContextualType: () => getPropertySymbolsFromContextualType, - getQuoteFromPreference: () => getQuoteFromPreference, - getQuotePreference: () => getQuotePreference, - getRangesWhere: () => getRangesWhere, - getRefactorContextSpan: () => getRefactorContextSpan, - getReferencedFileLocation: () => getReferencedFileLocation, - getRegexFromPattern: () => getRegexFromPattern, - getRegularExpressionForWildcard: () => getRegularExpressionForWildcard, - getRegularExpressionsForWildcards: () => getRegularExpressionsForWildcards, - getRelativePathFromDirectory: () => getRelativePathFromDirectory, - getRelativePathFromFile: () => getRelativePathFromFile, - getRelativePathToDirectoryOrUrl: () => getRelativePathToDirectoryOrUrl, - getRenameLocation: () => getRenameLocation, - getReplacementSpanForContextToken: () => getReplacementSpanForContextToken, - getResolutionDiagnostic: () => getResolutionDiagnostic, - getResolutionModeOverrideForClause: () => getResolutionModeOverrideForClause, - getResolveJsonModule: () => getResolveJsonModule, - getResolvePackageJsonExports: () => getResolvePackageJsonExports, - getResolvePackageJsonImports: () => getResolvePackageJsonImports, - getResolvedExternalModuleName: () => getResolvedExternalModuleName, - getResolvedModule: () => getResolvedModule, - getResolvedTypeReferenceDirective: () => getResolvedTypeReferenceDirective, - getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, - getRestParameterElementType: () => getRestParameterElementType, - getRightMostAssignedExpression: () => getRightMostAssignedExpression, - getRootDeclaration: () => getRootDeclaration, - getRootLength: () => getRootLength, - getScriptKind: () => getScriptKind, - getScriptKindFromFileName: () => getScriptKindFromFileName, - getScriptTargetFeatures: () => getScriptTargetFeatures, - getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, - getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, - getSemanticClassifications: () => getSemanticClassifications, - getSemanticJsxChildren: () => getSemanticJsxChildren, - getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, - getSetAccessorValueParameter: () => getSetAccessorValueParameter, - getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, - getShebang: () => getShebang, - getSingleInitializerOfVariableStatementOrPropertyDeclaration: () => getSingleInitializerOfVariableStatementOrPropertyDeclaration, - getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, - getSnapshotText: () => getSnapshotText, - getSnippetElement: () => getSnippetElement, - getSourceFileOfModule: () => getSourceFileOfModule, - getSourceFileOfNode: () => getSourceFileOfNode, - getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, - getSourceFilePathInNewDirWorker: () => getSourceFilePathInNewDirWorker, - getSourceFileVersionAsHashFromText: () => getSourceFileVersionAsHashFromText, - getSourceFilesToEmit: () => getSourceFilesToEmit, - getSourceMapRange: () => getSourceMapRange, - getSourceMapper: () => getSourceMapper, - getSourceTextOfNodeFromSourceFile: () => getSourceTextOfNodeFromSourceFile, - getSpanOfTokenAtPosition: () => getSpanOfTokenAtPosition, - getSpellingSuggestion: () => getSpellingSuggestion, - getStartPositionOfLine: () => getStartPositionOfLine, - getStartPositionOfRange: () => getStartPositionOfRange, - getStartsOnNewLine: () => getStartsOnNewLine, - getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock, - getStrictOptionValue: () => getStrictOptionValue, - getStringComparer: () => getStringComparer, - getSuperCallFromStatement: () => getSuperCallFromStatement, - getSuperContainer: () => getSuperContainer, - getSupportedCodeFixes: () => getSupportedCodeFixes, - getSupportedExtensions: () => getSupportedExtensions, - getSupportedExtensionsWithJsonIfResolveJsonModule: () => getSupportedExtensionsWithJsonIfResolveJsonModule, - getSwitchedType: () => getSwitchedType, - getSymbolId: () => getSymbolId, - getSymbolNameForPrivateIdentifier: () => getSymbolNameForPrivateIdentifier, - getSymbolTarget: () => getSymbolTarget, - getSyntacticClassifications: () => getSyntacticClassifications, - getSyntacticModifierFlags: () => getSyntacticModifierFlags, - getSyntacticModifierFlagsNoCache: () => getSyntacticModifierFlagsNoCache, - getSynthesizedDeepClone: () => getSynthesizedDeepClone, - getSynthesizedDeepCloneWithReplacements: () => getSynthesizedDeepCloneWithReplacements, - getSynthesizedDeepClones: () => getSynthesizedDeepClones, - getSynthesizedDeepClonesWithReplacements: () => getSynthesizedDeepClonesWithReplacements, - getSyntheticLeadingComments: () => getSyntheticLeadingComments, - getSyntheticTrailingComments: () => getSyntheticTrailingComments, - getTargetLabel: () => getTargetLabel, - getTargetOfBindingOrAssignmentElement: () => getTargetOfBindingOrAssignmentElement, - getTemporaryModuleResolutionState: () => getTemporaryModuleResolutionState, - getTextOfConstantValue: () => getTextOfConstantValue, - getTextOfIdentifierOrLiteral: () => getTextOfIdentifierOrLiteral, - getTextOfJSDocComment: () => getTextOfJSDocComment, - getTextOfNode: () => getTextOfNode, - getTextOfNodeFromSourceText: () => getTextOfNodeFromSourceText, - getTextOfPropertyName: () => getTextOfPropertyName, - getThisContainer: () => getThisContainer, - getThisParameter: () => getThisParameter, - getTokenAtPosition: () => getTokenAtPosition, - getTokenPosOfNode: () => getTokenPosOfNode, - getTokenSourceMapRange: () => getTokenSourceMapRange, - getTouchingPropertyName: () => getTouchingPropertyName, - getTouchingToken: () => getTouchingToken, - getTrailingCommentRanges: () => getTrailingCommentRanges, - getTrailingSemicolonDeferringWriter: () => getTrailingSemicolonDeferringWriter, - getTransformFlagsSubtreeExclusions: () => getTransformFlagsSubtreeExclusions, - getTransformers: () => getTransformers, - getTsBuildInfoEmitOutputFilePath: () => getTsBuildInfoEmitOutputFilePath, - getTsConfigObjectLiteralExpression: () => getTsConfigObjectLiteralExpression, - getTsConfigPropArray: () => getTsConfigPropArray, - getTsConfigPropArrayElementValue: () => getTsConfigPropArrayElementValue, - getTypeAnnotationNode: () => getTypeAnnotationNode, - getTypeArgumentOrTypeParameterList: () => getTypeArgumentOrTypeParameterList, - getTypeKeywordOfTypeOnlyImport: () => getTypeKeywordOfTypeOnlyImport, - getTypeNode: () => getTypeNode, - getTypeNodeIfAccessible: () => getTypeNodeIfAccessible, - getTypeParameterFromJsDoc: () => getTypeParameterFromJsDoc, - getTypeParameterOwner: () => getTypeParameterOwner, - getTypesPackageName: () => getTypesPackageName, - getUILocale: () => getUILocale, - getUniqueName: () => getUniqueName, - getUniqueSymbolId: () => getUniqueSymbolId, - getUseDefineForClassFields: () => getUseDefineForClassFields, - getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, - getWatchFactory: () => getWatchFactory, - group: () => group, - groupBy: () => groupBy, - guessIndentation: () => guessIndentation, - handleNoEmitOptions: () => handleNoEmitOptions, - hasAbstractModifier: () => hasAbstractModifier, - hasAccessorModifier: () => hasAccessorModifier, - hasAmbientModifier: () => hasAmbientModifier, - hasChangesInResolutions: () => hasChangesInResolutions, - hasChildOfKind: () => hasChildOfKind, - hasContextSensitiveParameters: () => hasContextSensitiveParameters, - hasDecorators: () => hasDecorators, - hasDocComment: () => hasDocComment, - hasDynamicName: () => hasDynamicName, - hasEffectiveModifier: () => hasEffectiveModifier, - hasEffectiveModifiers: () => hasEffectiveModifiers, - hasEffectiveReadonlyModifier: () => hasEffectiveReadonlyModifier, - hasExtension: () => hasExtension, - hasIndexSignature: () => hasIndexSignature, - hasInitializer: () => hasInitializer, - hasInvalidEscape: () => hasInvalidEscape, - hasJSDocNodes: () => hasJSDocNodes, - hasJSDocParameterTags: () => hasJSDocParameterTags, - hasJSFileExtension: () => hasJSFileExtension, - hasJsonModuleEmitEnabled: () => hasJsonModuleEmitEnabled, - hasOnlyExpressionInitializer: () => hasOnlyExpressionInitializer, - hasOverrideModifier: () => hasOverrideModifier, - hasPossibleExternalModuleReference: () => hasPossibleExternalModuleReference, - hasProperty: () => hasProperty, - hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName, - hasQuestionToken: () => hasQuestionToken, - hasRecordedExternalHelpers: () => hasRecordedExternalHelpers, - hasRestParameter: () => hasRestParameter, - hasScopeMarker: () => hasScopeMarker, - hasStaticModifier: () => hasStaticModifier, - hasSyntacticModifier: () => hasSyntacticModifier, - hasSyntacticModifiers: () => hasSyntacticModifiers, - hasTSFileExtension: () => hasTSFileExtension, - hasTabstop: () => hasTabstop, - hasTrailingDirectorySeparator: () => hasTrailingDirectorySeparator, - hasType: () => hasType, - hasTypeArguments: () => hasTypeArguments, - hasZeroOrOneAsteriskCharacter: () => hasZeroOrOneAsteriskCharacter, - helperString: () => helperString, - hostGetCanonicalFileName: () => hostGetCanonicalFileName, - hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, - idText: () => idText, - identifierIsThisKeyword: () => identifierIsThisKeyword, - identifierToKeywordKind: () => identifierToKeywordKind, - identity: () => identity, - identitySourceMapConsumer: () => identitySourceMapConsumer, - ignoreSourceNewlines: () => ignoreSourceNewlines, - ignoredPaths: () => ignoredPaths, - importDefaultHelper: () => importDefaultHelper, - importFromModuleSpecifier: () => importFromModuleSpecifier, - importNameElisionDisabled: () => importNameElisionDisabled, - importStarHelper: () => importStarHelper, - indexOfAnyCharCode: () => indexOfAnyCharCode, - indexOfNode: () => indexOfNode, - indicesOf: () => indicesOf, - inferredTypesContainingFile: () => inferredTypesContainingFile, - insertImports: () => insertImports, - insertLeadingStatement: () => insertLeadingStatement, - insertSorted: () => insertSorted, - insertStatementAfterCustomPrologue: () => insertStatementAfterCustomPrologue, - insertStatementAfterStandardPrologue: () => insertStatementAfterStandardPrologue, - insertStatementsAfterCustomPrologue: () => insertStatementsAfterCustomPrologue, - insertStatementsAfterStandardPrologue: () => insertStatementsAfterStandardPrologue, - intersperse: () => intersperse, - introducesArgumentsExoticObject: () => introducesArgumentsExoticObject, - inverseJsxOptionMap: () => inverseJsxOptionMap, - isAbstractConstructorSymbol: () => isAbstractConstructorSymbol, - isAbstractModifier: () => isAbstractModifier, - isAccessExpression: () => isAccessExpression, - isAccessibilityModifier: () => isAccessibilityModifier, - isAccessor: () => isAccessor, - isAccessorModifier: () => isAccessorModifier, - isAliasSymbolDeclaration: () => isAliasSymbolDeclaration, - isAliasableExpression: () => isAliasableExpression, - isAmbientModule: () => isAmbientModule, - isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, - isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, - isAnyDirectorySeparator: () => isAnyDirectorySeparator, - isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, - isAnyImportOrReExport: () => isAnyImportOrReExport, - isAnyImportSyntax: () => isAnyImportSyntax, - isAnySupportedFileExtension: () => isAnySupportedFileExtension, - isApplicableVersionedTypesKey: () => isApplicableVersionedTypesKey, - isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, - isArray: () => isArray, - isArrayBindingElement: () => isArrayBindingElement, - isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, - isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, - isArrayBindingPattern: () => isArrayBindingPattern, - isArrayLiteralExpression: () => isArrayLiteralExpression, - isArrayLiteralOrObjectLiteralDestructuringPattern: () => isArrayLiteralOrObjectLiteralDestructuringPattern, - isArrayTypeNode: () => isArrayTypeNode, - isArrowFunction: () => isArrowFunction, - isAsExpression: () => isAsExpression, - isAssertClause: () => isAssertClause, - isAssertEntry: () => isAssertEntry, - isAssertionExpression: () => isAssertionExpression, - isAssertionKey: () => isAssertionKey, - isAssertsKeyword: () => isAssertsKeyword, - isAssignmentDeclaration: () => isAssignmentDeclaration, - isAssignmentExpression: () => isAssignmentExpression, - isAssignmentOperator: () => isAssignmentOperator, - isAssignmentPattern: () => isAssignmentPattern, - isAssignmentTarget: () => isAssignmentTarget, - isAsteriskToken: () => isAsteriskToken, - isAsyncFunction: () => isAsyncFunction, - isAsyncModifier: () => isAsyncModifier, - isAutoAccessorPropertyDeclaration: () => isAutoAccessorPropertyDeclaration, - isAwaitExpression: () => isAwaitExpression, - isAwaitKeyword: () => isAwaitKeyword, - isBigIntLiteral: () => isBigIntLiteral, - isBinaryExpression: () => isBinaryExpression, - isBinaryOperatorToken: () => isBinaryOperatorToken, - isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall, - isBindableStaticAccessExpression: () => isBindableStaticAccessExpression, - isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, - isBindableStaticNameExpression: () => isBindableStaticNameExpression, - isBindingElement: () => isBindingElement, - isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, - isBindingName: () => isBindingName, - isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, - isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, - isBindingPattern: () => isBindingPattern, - isBlock: () => isBlock, - isBlockOrCatchScoped: () => isBlockOrCatchScoped, - isBlockScope: () => isBlockScope, - isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel, - isBooleanLiteral: () => isBooleanLiteral, - isBreakOrContinueStatement: () => isBreakOrContinueStatement, - isBreakStatement: () => isBreakStatement, - isBuildInfoFile: () => isBuildInfoFile, - isBuilderProgram: () => isBuilderProgram2, - isBundle: () => isBundle, - isBundleFileTextLike: () => isBundleFileTextLike, - isCallChain: () => isCallChain, - isCallExpression: () => isCallExpression, - isCallExpressionTarget: () => isCallExpressionTarget, - isCallLikeExpression: () => isCallLikeExpression, - isCallOrNewExpression: () => isCallOrNewExpression, - isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget, - isCallSignatureDeclaration: () => isCallSignatureDeclaration, - isCallToHelper: () => isCallToHelper, - isCaseBlock: () => isCaseBlock, - isCaseClause: () => isCaseClause, - isCaseKeyword: () => isCaseKeyword, - isCaseOrDefaultClause: () => isCaseOrDefaultClause, - isCatchClause: () => isCatchClause, - isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration, - isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement, - isCheckJsEnabledForFile: () => isCheckJsEnabledForFile, - isChildOfNodeWithKind: () => isChildOfNodeWithKind, - isCircularBuildOrder: () => isCircularBuildOrder, - isClassDeclaration: () => isClassDeclaration, - isClassElement: () => isClassElement, - isClassExpression: () => isClassExpression, - isClassLike: () => isClassLike, - isClassMemberModifier: () => isClassMemberModifier, - isClassOrTypeElement: () => isClassOrTypeElement, - isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, - isCollapsedRange: () => isCollapsedRange, - isColonToken: () => isColonToken, - isCommaExpression: () => isCommaExpression, - isCommaListExpression: () => isCommaListExpression, - isCommaSequence: () => isCommaSequence, - isCommaToken: () => isCommaToken, - isComment: () => isComment, - isCommonJsExportPropertyAssignment: () => isCommonJsExportPropertyAssignment, - isCommonJsExportedExpression: () => isCommonJsExportedExpression, - isCompoundAssignment: () => isCompoundAssignment, - isComputedNonLiteralName: () => isComputedNonLiteralName, - isComputedPropertyName: () => isComputedPropertyName, - isConciseBody: () => isConciseBody, - isConditionalExpression: () => isConditionalExpression, - isConditionalTypeNode: () => isConditionalTypeNode, - isConstTypeReference: () => isConstTypeReference, - isConstructSignatureDeclaration: () => isConstructSignatureDeclaration, - isConstructorDeclaration: () => isConstructorDeclaration, - isConstructorTypeNode: () => isConstructorTypeNode, - isContextualKeyword: () => isContextualKeyword, - isContinueStatement: () => isContinueStatement, - isCustomPrologue: () => isCustomPrologue, - isDebuggerStatement: () => isDebuggerStatement, - isDeclaration: () => isDeclaration, - isDeclarationBindingElement: () => isDeclarationBindingElement, - isDeclarationFileName: () => isDeclarationFileName, - isDeclarationName: () => isDeclarationName, - isDeclarationNameOfEnumOrNamespace: () => isDeclarationNameOfEnumOrNamespace, - isDeclarationReadonly: () => isDeclarationReadonly, - isDeclarationStatement: () => isDeclarationStatement, - isDeclarationWithTypeParameterChildren: () => isDeclarationWithTypeParameterChildren, - isDeclarationWithTypeParameters: () => isDeclarationWithTypeParameters, - isDecorator: () => isDecorator, - isDecoratorTarget: () => isDecoratorTarget, - isDefaultClause: () => isDefaultClause, - isDefaultImport: () => isDefaultImport, - isDefaultModifier: () => isDefaultModifier, - isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, - isDeleteExpression: () => isDeleteExpression, - isDeleteTarget: () => isDeleteTarget, - isDeprecatedDeclaration: () => isDeprecatedDeclaration, - isDestructuringAssignment: () => isDestructuringAssignment, - isDiagnosticWithLocation: () => isDiagnosticWithLocation, - isDiskPathRoot: () => isDiskPathRoot, - isDoStatement: () => isDoStatement, - isDotDotDotToken: () => isDotDotDotToken, - isDottedName: () => isDottedName, - isDynamicName: () => isDynamicName, - isESSymbolIdentifier: () => isESSymbolIdentifier, - isEffectiveExternalModule: () => isEffectiveExternalModule, - isEffectiveModuleDeclaration: () => isEffectiveModuleDeclaration, - isEffectiveStrictModeSourceFile: () => isEffectiveStrictModeSourceFile, - isElementAccessChain: () => isElementAccessChain, - isElementAccessExpression: () => isElementAccessExpression, - isEmittedFileOfProgram: () => isEmittedFileOfProgram, - isEmptyArrayLiteral: () => isEmptyArrayLiteral, - isEmptyBindingElement: () => isEmptyBindingElement, - isEmptyBindingPattern: () => isEmptyBindingPattern, - isEmptyObjectLiteral: () => isEmptyObjectLiteral, - isEmptyStatement: () => isEmptyStatement, - isEmptyStringLiteral: () => isEmptyStringLiteral, - isEndOfDeclarationMarker: () => isEndOfDeclarationMarker, - isEntityName: () => isEntityName, - isEntityNameExpression: () => isEntityNameExpression, - isEnumConst: () => isEnumConst, - isEnumDeclaration: () => isEnumDeclaration, - isEnumMember: () => isEnumMember, - isEqualityOperatorKind: () => isEqualityOperatorKind, - isEqualsGreaterThanToken: () => isEqualsGreaterThanToken, - isExclamationToken: () => isExclamationToken, - isExcludedFile: () => isExcludedFile, - isExclusivelyTypeOnlyImportOrExport: () => isExclusivelyTypeOnlyImportOrExport, - isExportAssignment: () => isExportAssignment, - isExportDeclaration: () => isExportDeclaration, - isExportModifier: () => isExportModifier, - isExportName: () => isExportName, - isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, - isExportOrDefaultModifier: () => isExportOrDefaultModifier, - isExportSpecifier: () => isExportSpecifier, - isExportsIdentifier: () => isExportsIdentifier, - isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, - isExpression: () => isExpression, - isExpressionNode: () => isExpressionNode, - isExpressionOfExternalModuleImportEqualsDeclaration: () => isExpressionOfExternalModuleImportEqualsDeclaration, - isExpressionOfOptionalChainRoot: () => isExpressionOfOptionalChainRoot, - isExpressionStatement: () => isExpressionStatement, - isExpressionWithTypeArguments: () => isExpressionWithTypeArguments, - isExpressionWithTypeArgumentsInClassExtendsClause: () => isExpressionWithTypeArgumentsInClassExtendsClause, - isExternalModule: () => isExternalModule, - isExternalModuleAugmentation: () => isExternalModuleAugmentation, - isExternalModuleImportEqualsDeclaration: () => isExternalModuleImportEqualsDeclaration, - isExternalModuleIndicator: () => isExternalModuleIndicator, - isExternalModuleNameRelative: () => isExternalModuleNameRelative, - isExternalModuleReference: () => isExternalModuleReference, - isExternalModuleSymbol: () => isExternalModuleSymbol, - isExternalOrCommonJsModule: () => isExternalOrCommonJsModule, - isFileLevelUniqueName: () => isFileLevelUniqueName, - isFileProbablyExternalModule: () => isFileProbablyExternalModule, - isFirstDeclarationOfSymbolParameter: () => isFirstDeclarationOfSymbolParameter, - isFixablePromiseHandler: () => isFixablePromiseHandler, - isForInOrOfStatement: () => isForInOrOfStatement, - isForInStatement: () => isForInStatement, - isForInitializer: () => isForInitializer, - isForOfStatement: () => isForOfStatement, - isForStatement: () => isForStatement, - isFunctionBlock: () => isFunctionBlock, - isFunctionBody: () => isFunctionBody, - isFunctionDeclaration: () => isFunctionDeclaration, - isFunctionExpression: () => isFunctionExpression, - isFunctionExpressionOrArrowFunction: () => isFunctionExpressionOrArrowFunction, - isFunctionLike: () => isFunctionLike, - isFunctionLikeDeclaration: () => isFunctionLikeDeclaration, - isFunctionLikeKind: () => isFunctionLikeKind, - isFunctionLikeOrClassStaticBlockDeclaration: () => isFunctionLikeOrClassStaticBlockDeclaration, - isFunctionOrConstructorTypeNode: () => isFunctionOrConstructorTypeNode, - isFunctionOrModuleBlock: () => isFunctionOrModuleBlock, - isFunctionSymbol: () => isFunctionSymbol, - isFunctionTypeNode: () => isFunctionTypeNode, - isFutureReservedKeyword: () => isFutureReservedKeyword, - isGeneratedIdentifier: () => isGeneratedIdentifier, - isGeneratedPrivateIdentifier: () => isGeneratedPrivateIdentifier, - isGetAccessor: () => isGetAccessor, - isGetAccessorDeclaration: () => isGetAccessorDeclaration, - isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, - isGlobalDeclaration: () => isGlobalDeclaration, - isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, - isHeritageClause: () => isHeritageClause, - isHoistedFunction: () => isHoistedFunction, - isHoistedVariableStatement: () => isHoistedVariableStatement, - isIdentifier: () => isIdentifier, - isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, - isIdentifierName: () => isIdentifierName, - isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, - isIdentifierPart: () => isIdentifierPart, - isIdentifierStart: () => isIdentifierStart, - isIdentifierText: () => isIdentifierText, - isIdentifierTypePredicate: () => isIdentifierTypePredicate, - isIdentifierTypeReference: () => isIdentifierTypeReference, - isIfStatement: () => isIfStatement, - isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching, - isImplicitGlob: () => isImplicitGlob, - isImportCall: () => isImportCall, - isImportClause: () => isImportClause, - isImportDeclaration: () => isImportDeclaration, - isImportEqualsDeclaration: () => isImportEqualsDeclaration, - isImportKeyword: () => isImportKeyword, - isImportMeta: () => isImportMeta, - isImportOrExportSpecifier: () => isImportOrExportSpecifier, - isImportOrExportSpecifierName: () => isImportOrExportSpecifierName, - isImportSpecifier: () => isImportSpecifier, - isImportTypeAssertionContainer: () => isImportTypeAssertionContainer, - isImportTypeNode: () => isImportTypeNode, - isImportableFile: () => isImportableFile, - isInComment: () => isInComment, - isInExpressionContext: () => isInExpressionContext, - isInJSDoc: () => isInJSDoc, - isInJSFile: () => isInJSFile, - isInJSXText: () => isInJSXText, - isInJsonFile: () => isInJsonFile, - isInNonReferenceComment: () => isInNonReferenceComment, - isInReferenceComment: () => isInReferenceComment, - isInRightSideOfInternalImportEqualsDeclaration: () => isInRightSideOfInternalImportEqualsDeclaration, - isInString: () => isInString, - isInTemplateString: () => isInTemplateString, - isInTopLevelContext: () => isInTopLevelContext, - isIncrementalCompilation: () => isIncrementalCompilation, - isIndexSignatureDeclaration: () => isIndexSignatureDeclaration, - isIndexedAccessTypeNode: () => isIndexedAccessTypeNode, - isInferTypeNode: () => isInferTypeNode, - isInfinityOrNaNString: () => isInfinityOrNaNString, - isInitializedProperty: () => isInitializedProperty, - isInitializedVariable: () => isInitializedVariable, - isInsideJsxElement: () => isInsideJsxElement, - isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, - isInsideNodeModules: () => isInsideNodeModules, - isInsideTemplateLiteral: () => isInsideTemplateLiteral, - isInstantiatedModule: () => isInstantiatedModule, - isInterfaceDeclaration: () => isInterfaceDeclaration, - isInternalDeclaration: () => isInternalDeclaration, - isInternalModuleImportEqualsDeclaration: () => isInternalModuleImportEqualsDeclaration, - isInternalName: () => isInternalName, - isIntersectionTypeNode: () => isIntersectionTypeNode, - isIntrinsicJsxName: () => isIntrinsicJsxName, - isIterationStatement: () => isIterationStatement, - isJSDoc: () => isJSDoc, - isJSDocAllType: () => isJSDocAllType, - isJSDocAugmentsTag: () => isJSDocAugmentsTag, - isJSDocAuthorTag: () => isJSDocAuthorTag, - isJSDocCallbackTag: () => isJSDocCallbackTag, - isJSDocClassTag: () => isJSDocClassTag, - isJSDocCommentContainingNode: () => isJSDocCommentContainingNode, - isJSDocConstructSignature: () => isJSDocConstructSignature, - isJSDocDeprecatedTag: () => isJSDocDeprecatedTag, - isJSDocEnumTag: () => isJSDocEnumTag, - isJSDocFunctionType: () => isJSDocFunctionType, - isJSDocImplementsTag: () => isJSDocImplementsTag, - isJSDocIndexSignature: () => isJSDocIndexSignature, - isJSDocLikeText: () => isJSDocLikeText, - isJSDocLink: () => isJSDocLink, - isJSDocLinkCode: () => isJSDocLinkCode, - isJSDocLinkLike: () => isJSDocLinkLike, - isJSDocLinkPlain: () => isJSDocLinkPlain, - isJSDocMemberName: () => isJSDocMemberName, - isJSDocNameReference: () => isJSDocNameReference, - isJSDocNamepathType: () => isJSDocNamepathType, - isJSDocNamespaceBody: () => isJSDocNamespaceBody, - isJSDocNode: () => isJSDocNode, - isJSDocNonNullableType: () => isJSDocNonNullableType, - isJSDocNullableType: () => isJSDocNullableType, - isJSDocOptionalParameter: () => isJSDocOptionalParameter, - isJSDocOptionalType: () => isJSDocOptionalType, - isJSDocOverloadTag: () => isJSDocOverloadTag, - isJSDocOverrideTag: () => isJSDocOverrideTag, - isJSDocParameterTag: () => isJSDocParameterTag, - isJSDocPrivateTag: () => isJSDocPrivateTag, - isJSDocPropertyLikeTag: () => isJSDocPropertyLikeTag, - isJSDocPropertyTag: () => isJSDocPropertyTag, - isJSDocProtectedTag: () => isJSDocProtectedTag, - isJSDocPublicTag: () => isJSDocPublicTag, - isJSDocReadonlyTag: () => isJSDocReadonlyTag, - isJSDocReturnTag: () => isJSDocReturnTag, - isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, - isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, - isJSDocSeeTag: () => isJSDocSeeTag, - isJSDocSignature: () => isJSDocSignature, - isJSDocTag: () => isJSDocTag, - isJSDocTemplateTag: () => isJSDocTemplateTag, - isJSDocThisTag: () => isJSDocThisTag, - isJSDocThrowsTag: () => isJSDocThrowsTag, - isJSDocTypeAlias: () => isJSDocTypeAlias, - isJSDocTypeAssertion: () => isJSDocTypeAssertion, - isJSDocTypeExpression: () => isJSDocTypeExpression, - isJSDocTypeLiteral: () => isJSDocTypeLiteral, - isJSDocTypeTag: () => isJSDocTypeTag, - isJSDocTypedefTag: () => isJSDocTypedefTag, - isJSDocUnknownTag: () => isJSDocUnknownTag, - isJSDocUnknownType: () => isJSDocUnknownType, - isJSDocVariadicType: () => isJSDocVariadicType, - isJSXTagName: () => isJSXTagName, - isJsonEqual: () => isJsonEqual, - isJsonSourceFile: () => isJsonSourceFile, - isJsxAttribute: () => isJsxAttribute, - isJsxAttributeLike: () => isJsxAttributeLike, - isJsxAttributes: () => isJsxAttributes, - isJsxChild: () => isJsxChild, - isJsxClosingElement: () => isJsxClosingElement, - isJsxClosingFragment: () => isJsxClosingFragment, - isJsxElement: () => isJsxElement, - isJsxExpression: () => isJsxExpression, - isJsxFragment: () => isJsxFragment, - isJsxOpeningElement: () => isJsxOpeningElement, - isJsxOpeningFragment: () => isJsxOpeningFragment, - isJsxOpeningLikeElement: () => isJsxOpeningLikeElement, - isJsxOpeningLikeElementTagName: () => isJsxOpeningLikeElementTagName, - isJsxSelfClosingElement: () => isJsxSelfClosingElement, - isJsxSpreadAttribute: () => isJsxSpreadAttribute, - isJsxTagNameExpression: () => isJsxTagNameExpression, - isJsxText: () => isJsxText, - isJumpStatementTarget: () => isJumpStatementTarget, - isKeyword: () => isKeyword, - isKnownSymbol: () => isKnownSymbol, - isLabelName: () => isLabelName, - isLabelOfLabeledStatement: () => isLabelOfLabeledStatement, - isLabeledStatement: () => isLabeledStatement, - isLateVisibilityPaintedStatement: () => isLateVisibilityPaintedStatement, - isLeftHandSideExpression: () => isLeftHandSideExpression, - isLeftHandSideOfAssignment: () => isLeftHandSideOfAssignment, - isLet: () => isLet, - isLineBreak: () => isLineBreak, - isLiteralComputedPropertyDeclarationName: () => isLiteralComputedPropertyDeclarationName, - isLiteralExpression: () => isLiteralExpression, - isLiteralExpressionOfObject: () => isLiteralExpressionOfObject, - isLiteralImportTypeNode: () => isLiteralImportTypeNode, - isLiteralKind: () => isLiteralKind, - isLiteralLikeAccess: () => isLiteralLikeAccess, - isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, - isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, - isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, - isLiteralTypeLiteral: () => isLiteralTypeLiteral, - isLiteralTypeNode: () => isLiteralTypeNode, - isLocalName: () => isLocalName, - isLogicalOperator: () => isLogicalOperator, - isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, - isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, - isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, - isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, - isMappedTypeNode: () => isMappedTypeNode, - isMemberName: () => isMemberName, - isMergeDeclarationMarker: () => isMergeDeclarationMarker, - isMetaProperty: () => isMetaProperty, - isMethodDeclaration: () => isMethodDeclaration, - isMethodOrAccessor: () => isMethodOrAccessor, - isMethodSignature: () => isMethodSignature, - isMinusToken: () => isMinusToken, - isMissingDeclaration: () => isMissingDeclaration, - isModifier: () => isModifier, - isModifierKind: () => isModifierKind, - isModifierLike: () => isModifierLike, - isModuleAugmentationExternal: () => isModuleAugmentationExternal, - isModuleBlock: () => isModuleBlock, - isModuleBody: () => isModuleBody, - isModuleDeclaration: () => isModuleDeclaration, - isModuleExportsAccessExpression: () => isModuleExportsAccessExpression, - isModuleIdentifier: () => isModuleIdentifier, - isModuleName: () => isModuleName, - isModuleOrEnumDeclaration: () => isModuleOrEnumDeclaration, - isModuleReference: () => isModuleReference, - isModuleSpecifierLike: () => isModuleSpecifierLike, - isModuleWithStringLiteralName: () => isModuleWithStringLiteralName, - isNameOfFunctionDeclaration: () => isNameOfFunctionDeclaration, - isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, - isNamedClassElement: () => isNamedClassElement, - isNamedDeclaration: () => isNamedDeclaration, - isNamedEvaluation: () => isNamedEvaluation, - isNamedEvaluationSource: () => isNamedEvaluationSource, - isNamedExportBindings: () => isNamedExportBindings, - isNamedExports: () => isNamedExports, - isNamedImportBindings: () => isNamedImportBindings, - isNamedImports: () => isNamedImports, - isNamedImportsOrExports: () => isNamedImportsOrExports, - isNamedTupleMember: () => isNamedTupleMember, - isNamespaceBody: () => isNamespaceBody, - isNamespaceExport: () => isNamespaceExport, - isNamespaceExportDeclaration: () => isNamespaceExportDeclaration, - isNamespaceImport: () => isNamespaceImport, - isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration, - isNewExpression: () => isNewExpression, - isNewExpressionTarget: () => isNewExpressionTarget, - isNightly: () => isNightly, - isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral, - isNode: () => isNode, - isNodeArray: () => isNodeArray, - isNodeArrayMultiLine: () => isNodeArrayMultiLine, - isNodeDescendantOf: () => isNodeDescendantOf, - isNodeKind: () => isNodeKind, - isNodeLikeSystem: () => isNodeLikeSystem, - isNodeModulesDirectory: () => isNodeModulesDirectory, - isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, - isNonContextualKeyword: () => isNonContextualKeyword, - isNonExportDefaultModifier: () => isNonExportDefaultModifier, - isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, - isNonGlobalDeclaration: () => isNonGlobalDeclaration, - isNonNullAccess: () => isNonNullAccess, - isNonNullChain: () => isNonNullChain, - isNonNullExpression: () => isNonNullExpression, - isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName, - isNotEmittedOrPartiallyEmittedNode: () => isNotEmittedOrPartiallyEmittedNode, - isNotEmittedStatement: () => isNotEmittedStatement, - isNullishCoalesce: () => isNullishCoalesce, - isNumber: () => isNumber, - isNumericLiteral: () => isNumericLiteral, - isNumericLiteralName: () => isNumericLiteralName, - isObjectBindingElementWithoutPropertyName: () => isObjectBindingElementWithoutPropertyName, - isObjectBindingOrAssignmentElement: () => isObjectBindingOrAssignmentElement, - isObjectBindingOrAssignmentPattern: () => isObjectBindingOrAssignmentPattern, - isObjectBindingPattern: () => isObjectBindingPattern, - isObjectLiteralElement: () => isObjectLiteralElement, - isObjectLiteralElementLike: () => isObjectLiteralElementLike, - isObjectLiteralExpression: () => isObjectLiteralExpression, - isObjectLiteralMethod: () => isObjectLiteralMethod, - isObjectLiteralOrClassExpressionMethodOrAccessor: () => isObjectLiteralOrClassExpressionMethodOrAccessor, - isObjectTypeDeclaration: () => isObjectTypeDeclaration, - isOctalDigit: () => isOctalDigit, - isOmittedExpression: () => isOmittedExpression, - isOptionalChain: () => isOptionalChain, - isOptionalChainRoot: () => isOptionalChainRoot, - isOptionalDeclaration: () => isOptionalDeclaration, - isOptionalJSDocPropertyLikeTag: () => isOptionalJSDocPropertyLikeTag, - isOptionalTypeNode: () => isOptionalTypeNode, - isOuterExpression: () => isOuterExpression, - isOutermostOptionalChain: () => isOutermostOptionalChain, - isOverrideModifier: () => isOverrideModifier, - isPackedArrayLiteral: () => isPackedArrayLiteral, - isParameter: () => isParameter, - isParameterDeclaration: () => isParameterDeclaration, - isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable, - isParameterPropertyDeclaration: () => isParameterPropertyDeclaration, - isParameterPropertyModifier: () => isParameterPropertyModifier, - isParenthesizedExpression: () => isParenthesizedExpression, - isParenthesizedTypeNode: () => isParenthesizedTypeNode, - isParseTreeNode: () => isParseTreeNode, - isPartOfTypeNode: () => isPartOfTypeNode, - isPartOfTypeQuery: () => isPartOfTypeQuery, - isPartiallyEmittedExpression: () => isPartiallyEmittedExpression, - isPatternMatch: () => isPatternMatch, - isPinnedComment: () => isPinnedComment, - isPlainJsFile: () => isPlainJsFile, - isPlusToken: () => isPlusToken, - isPossiblyTypeArgumentPosition: () => isPossiblyTypeArgumentPosition, - isPostfixUnaryExpression: () => isPostfixUnaryExpression, - isPrefixUnaryExpression: () => isPrefixUnaryExpression, - isPrivateIdentifier: () => isPrivateIdentifier, - isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration, - isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression, - isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol, - isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo, - isProgramUptoDate: () => isProgramUptoDate, - isPrologueDirective: () => isPrologueDirective, - isPropertyAccessChain: () => isPropertyAccessChain, - isPropertyAccessEntityNameExpression: () => isPropertyAccessEntityNameExpression, - isPropertyAccessExpression: () => isPropertyAccessExpression, - isPropertyAccessOrQualifiedName: () => isPropertyAccessOrQualifiedName, - isPropertyAccessOrQualifiedNameOrImportTypeNode: () => isPropertyAccessOrQualifiedNameOrImportTypeNode, - isPropertyAssignment: () => isPropertyAssignment, - isPropertyDeclaration: () => isPropertyDeclaration, - isPropertyName: () => isPropertyName, - isPropertyNameLiteral: () => isPropertyNameLiteral, - isPropertySignature: () => isPropertySignature, - isProtoSetter: () => isProtoSetter, - isPrototypeAccess: () => isPrototypeAccess, - isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, - isPunctuation: () => isPunctuation, - isPushOrUnshiftIdentifier: () => isPushOrUnshiftIdentifier, - isQualifiedName: () => isQualifiedName, - isQuestionDotToken: () => isQuestionDotToken, - isQuestionOrExclamationToken: () => isQuestionOrExclamationToken, - isQuestionOrPlusOrMinusToken: () => isQuestionOrPlusOrMinusToken, - isQuestionToken: () => isQuestionToken, - isRawSourceMap: () => isRawSourceMap, - isReadonlyKeyword: () => isReadonlyKeyword, - isReadonlyKeywordOrPlusOrMinusToken: () => isReadonlyKeywordOrPlusOrMinusToken, - isRecognizedTripleSlashComment: () => isRecognizedTripleSlashComment, - isReferenceFileLocation: () => isReferenceFileLocation, - isReferencedFile: () => isReferencedFile, - isRegularExpressionLiteral: () => isRegularExpressionLiteral, - isRequireCall: () => isRequireCall, - isRequireVariableStatement: () => isRequireVariableStatement, - isRestParameter: () => isRestParameter, - isRestTypeNode: () => isRestTypeNode, - isReturnStatement: () => isReturnStatement, - isReturnStatementWithFixablePromiseHandler: () => isReturnStatementWithFixablePromiseHandler, - isRightSideOfAccessExpression: () => isRightSideOfAccessExpression, - isRightSideOfPropertyAccess: () => isRightSideOfPropertyAccess, - isRightSideOfQualifiedName: () => isRightSideOfQualifiedName, - isRightSideOfQualifiedNameOrPropertyAccess: () => isRightSideOfQualifiedNameOrPropertyAccess, - isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName: () => isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName, - isRootedDiskPath: () => isRootedDiskPath, - isSameEntityName: () => isSameEntityName, - isSatisfiesExpression: () => isSatisfiesExpression, - isScopeMarker: () => isScopeMarker, - isSemicolonClassElement: () => isSemicolonClassElement, - isSetAccessor: () => isSetAccessor, - isSetAccessorDeclaration: () => isSetAccessorDeclaration, - isShebangTrivia: () => isShebangTrivia, - isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol, - isShorthandPropertyAssignment: () => isShorthandPropertyAssignment, - isSignedNumericLiteral: () => isSignedNumericLiteral, - isSimpleCopiableExpression: () => isSimpleCopiableExpression, - isSimpleInlineableExpression: () => isSimpleInlineableExpression, - isSingleOrDoubleQuote: () => isSingleOrDoubleQuote, - isSourceFile: () => isSourceFile, - isSourceFileFromLibrary: () => isSourceFileFromLibrary, - isSourceFileJS: () => isSourceFileJS, - isSourceFileNotJS: () => isSourceFileNotJS, - isSourceFileNotJson: () => isSourceFileNotJson, - isSourceMapping: () => isSourceMapping, - isSpecialPropertyDeclaration: () => isSpecialPropertyDeclaration, - isSpreadAssignment: () => isSpreadAssignment, - isSpreadElement: () => isSpreadElement, - isStatement: () => isStatement, - isStatementButNotDeclaration: () => isStatementButNotDeclaration, - isStatementOrBlock: () => isStatementOrBlock, - isStatementWithLocals: () => isStatementWithLocals, - isStatic: () => isStatic, - isStaticModifier: () => isStaticModifier, - isString: () => isString, - isStringAKeyword: () => isStringAKeyword, - isStringANonContextualKeyword: () => isStringANonContextualKeyword, - isStringDoubleQuoted: () => isStringDoubleQuoted, - isStringLiteral: () => isStringLiteral, - isStringLiteralLike: () => isStringLiteralLike, - isStringLiteralOrJsxExpression: () => isStringLiteralOrJsxExpression, - isStringLiteralOrTemplate: () => isStringLiteralOrTemplate, - isStringOrNumericLiteralLike: () => isStringOrNumericLiteralLike, - isStringOrRegularExpressionOrTemplateLiteral: () => isStringOrRegularExpressionOrTemplateLiteral, - isStringTextContainingNode: () => isStringTextContainingNode, - isSuperCall: () => isSuperCall, - isSuperKeyword: () => isSuperKeyword, - isSuperOrSuperProperty: () => isSuperOrSuperProperty, - isSuperProperty: () => isSuperProperty, - isSupportedSourceFileName: () => isSupportedSourceFileName, - isSwitchStatement: () => isSwitchStatement, - isSyntaxList: () => isSyntaxList, - isSyntheticExpression: () => isSyntheticExpression, - isSyntheticReference: () => isSyntheticReference, - isTagName: () => isTagName, - isTaggedTemplateExpression: () => isTaggedTemplateExpression, - isTaggedTemplateTag: () => isTaggedTemplateTag, - isTemplateExpression: () => isTemplateExpression, - isTemplateHead: () => isTemplateHead, - isTemplateLiteral: () => isTemplateLiteral, - isTemplateLiteralKind: () => isTemplateLiteralKind, - isTemplateLiteralToken: () => isTemplateLiteralToken, - isTemplateLiteralTypeNode: () => isTemplateLiteralTypeNode, - isTemplateLiteralTypeSpan: () => isTemplateLiteralTypeSpan, - isTemplateMiddle: () => isTemplateMiddle, - isTemplateMiddleOrTemplateTail: () => isTemplateMiddleOrTemplateTail, - isTemplateSpan: () => isTemplateSpan, - isTemplateTail: () => isTemplateTail, - isTextWhiteSpaceLike: () => isTextWhiteSpaceLike, - isThis: () => isThis, - isThisContainerOrFunctionBlock: () => isThisContainerOrFunctionBlock, - isThisIdentifier: () => isThisIdentifier, - isThisInTypeQuery: () => isThisInTypeQuery, - isThisInitializedDeclaration: () => isThisInitializedDeclaration, - isThisInitializedObjectBindingExpression: () => isThisInitializedObjectBindingExpression, - isThisProperty: () => isThisProperty, - isThisTypeNode: () => isThisTypeNode, - isThisTypeParameter: () => isThisTypeParameter, - isThisTypePredicate: () => isThisTypePredicate, - isThrowStatement: () => isThrowStatement, - isToken: () => isToken, - isTokenKind: () => isTokenKind, - isTraceEnabled: () => isTraceEnabled, - isTransientSymbol: () => isTransientSymbol, - isTrivia: () => isTrivia, - isTryStatement: () => isTryStatement, - isTupleTypeNode: () => isTupleTypeNode, - isTypeAlias: () => isTypeAlias, - isTypeAliasDeclaration: () => isTypeAliasDeclaration, - isTypeAssertionExpression: () => isTypeAssertionExpression, - isTypeDeclaration: () => isTypeDeclaration, - isTypeElement: () => isTypeElement, - isTypeKeyword: () => isTypeKeyword, - isTypeKeywordToken: () => isTypeKeywordToken, - isTypeKeywordTokenOrIdentifier: () => isTypeKeywordTokenOrIdentifier, - isTypeLiteralNode: () => isTypeLiteralNode, - isTypeNode: () => isTypeNode, - isTypeNodeKind: () => isTypeNodeKind, - isTypeOfExpression: () => isTypeOfExpression, - isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, - isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, - isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, - isTypeOperatorNode: () => isTypeOperatorNode, - isTypeParameterDeclaration: () => isTypeParameterDeclaration, - isTypePredicateNode: () => isTypePredicateNode, - isTypeQueryNode: () => isTypeQueryNode, - isTypeReferenceNode: () => isTypeReferenceNode, - isTypeReferenceType: () => isTypeReferenceType, - isUMDExportSymbol: () => isUMDExportSymbol, - isUnaryExpression: () => isUnaryExpression, - isUnaryExpressionWithWrite: () => isUnaryExpressionWithWrite, - isUnicodeIdentifierStart: () => isUnicodeIdentifierStart, - isUnionTypeNode: () => isUnionTypeNode, - isUnparsedNode: () => isUnparsedNode, - isUnparsedPrepend: () => isUnparsedPrepend, - isUnparsedSource: () => isUnparsedSource, - isUnparsedTextLike: () => isUnparsedTextLike, - isUrl: () => isUrl, - isValidBigIntString: () => isValidBigIntString, - isValidESSymbolDeclaration: () => isValidESSymbolDeclaration, - isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite, - isValueSignatureDeclaration: () => isValueSignatureDeclaration, - isVarConst: () => isVarConst, - isVariableDeclaration: () => isVariableDeclaration, - isVariableDeclarationInVariableStatement: () => isVariableDeclarationInVariableStatement, - isVariableDeclarationInitializedToBareOrAccessedRequire: () => isVariableDeclarationInitializedToBareOrAccessedRequire, - isVariableDeclarationInitializedToRequire: () => isVariableDeclarationInitializedToRequire, - isVariableDeclarationList: () => isVariableDeclarationList, - isVariableLike: () => isVariableLike, - isVariableLikeOrAccessor: () => isVariableLikeOrAccessor, - isVariableStatement: () => isVariableStatement, - isVoidExpression: () => isVoidExpression, - isWatchSet: () => isWatchSet, - isWhileStatement: () => isWhileStatement, - isWhiteSpaceLike: () => isWhiteSpaceLike, - isWhiteSpaceSingleLine: () => isWhiteSpaceSingleLine, - isWithStatement: () => isWithStatement, - isWriteAccess: () => isWriteAccess, - isWriteOnlyAccess: () => isWriteOnlyAccess, - isYieldExpression: () => isYieldExpression, - jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport, - keywordPart: () => keywordPart, - last: () => last, - lastOrUndefined: () => lastOrUndefined, - length: () => length, - libMap: () => libMap, - libs: () => libs, - lineBreakPart: () => lineBreakPart, - linkNamePart: () => linkNamePart, - linkPart: () => linkPart, - linkTextPart: () => linkTextPart, - listFiles: () => listFiles, - loadModuleFromGlobalCache: () => loadModuleFromGlobalCache, - loadWithModeAwareCache: () => loadWithModeAwareCache, - makeIdentifierFromModuleName: () => makeIdentifierFromModuleName, - makeImport: () => makeImport, - makeImportIfNecessary: () => makeImportIfNecessary, - makeStringLiteral: () => makeStringLiteral, - mangleScopedPackageName: () => mangleScopedPackageName, - map: () => map, - mapAllOrFail: () => mapAllOrFail, - mapDefined: () => mapDefined, - mapDefinedEntries: () => mapDefinedEntries, - mapDefinedIterator: () => mapDefinedIterator, - mapEntries: () => mapEntries, - mapIterator: () => mapIterator, - mapOneOrMany: () => mapOneOrMany, - mapToDisplayParts: () => mapToDisplayParts, - matchFiles: () => matchFiles, - matchPatternOrExact: () => matchPatternOrExact, - matchedText: () => matchedText, - matchesExclude: () => matchesExclude, - maybeBind: () => maybeBind, - maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, - memoize: () => memoize, - memoizeCached: () => memoizeCached, - memoizeOne: () => memoizeOne, - memoizeWeak: () => memoizeWeak, - metadataHelper: () => metadataHelper, - min: () => min, - minAndMax: () => minAndMax, - missingFileModifiedTime: () => missingFileModifiedTime, - modifierToFlag: () => modifierToFlag, - modifiersToFlags: () => modifiersToFlags, - moduleOptionDeclaration: () => moduleOptionDeclaration, - moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo, - moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter, - moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations, - moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports, - moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules, - moduleSpecifiers: () => ts_moduleSpecifiers_exports, - moveEmitHelpers: () => moveEmitHelpers, - moveRangeEnd: () => moveRangeEnd, - moveRangePastDecorators: () => moveRangePastDecorators, - moveRangePastModifiers: () => moveRangePastModifiers, - moveRangePos: () => moveRangePos, - moveSyntheticComments: () => moveSyntheticComments, - mutateMap: () => mutateMap, - mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, - needsParentheses: () => needsParentheses, - needsScopeMarker: () => needsScopeMarker, - newPrivateEnvironment: () => newPrivateEnvironment, - noEmitNotification: () => noEmitNotification, - noEmitSubstitution: () => noEmitSubstitution, - noTransformers: () => noTransformers, - noTruncationMaximumTruncationLength: () => noTruncationMaximumTruncationLength, - nodeCanBeDecorated: () => nodeCanBeDecorated, - nodeHasName: () => nodeHasName, - nodeIsDecorated: () => nodeIsDecorated, - nodeIsMissing: () => nodeIsMissing, - nodeIsPresent: () => nodeIsPresent, - nodeIsSynthesized: () => nodeIsSynthesized, - nodeModuleNameResolver: () => nodeModuleNameResolver, - nodeModulesPathPart: () => nodeModulesPathPart, - nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver, - nodeOrChildIsDecorated: () => nodeOrChildIsDecorated, - nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd, - nodePosToString: () => nodePosToString, - nodeSeenTracker: () => nodeSeenTracker, - nodeStartsNewLexicalEnvironment: () => nodeStartsNewLexicalEnvironment, - nodeToDisplayParts: () => nodeToDisplayParts, - noop: () => noop, - noopFileWatcher: () => noopFileWatcher, - noopPush: () => noopPush, - normalizePath: () => normalizePath, - normalizeSlashes: () => normalizeSlashes, - not: () => not, - notImplemented: () => notImplemented, - notImplementedResolver: () => notImplementedResolver, - nullNodeConverters: () => nullNodeConverters, - nullParenthesizerRules: () => nullParenthesizerRules, - nullTransformationContext: () => nullTransformationContext, - objectAllocator: () => objectAllocator, - operatorPart: () => operatorPart, - optionDeclarations: () => optionDeclarations, - optionMapToObject: () => optionMapToObject, - optionsAffectingProgramStructure: () => optionsAffectingProgramStructure, - optionsForBuild: () => optionsForBuild, - optionsForWatch: () => optionsForWatch, - optionsHaveChanges: () => optionsHaveChanges, - optionsHaveModuleResolutionChanges: () => optionsHaveModuleResolutionChanges, - or: () => or, - orderedRemoveItem: () => orderedRemoveItem, - orderedRemoveItemAt: () => orderedRemoveItemAt, - outFile: () => outFile, - packageIdToPackageName: () => packageIdToPackageName, - packageIdToString: () => packageIdToString, - padLeft: () => padLeft, - padRight: () => padRight, - paramHelper: () => paramHelper, - parameterIsThisKeyword: () => parameterIsThisKeyword, - parameterNamePart: () => parameterNamePart, - parseBaseNodeFactory: () => parseBaseNodeFactory, - parseBigInt: () => parseBigInt, - parseBuildCommand: () => parseBuildCommand, - parseCommandLine: () => parseCommandLine, - parseCommandLineWorker: () => parseCommandLineWorker, - parseConfigFileTextToJson: () => parseConfigFileTextToJson, - parseConfigFileWithSystem: () => parseConfigFileWithSystem, - parseConfigHostFromCompilerHostLike: () => parseConfigHostFromCompilerHostLike, - parseCustomTypeOption: () => parseCustomTypeOption, - parseIsolatedEntityName: () => parseIsolatedEntityName, - parseIsolatedJSDocComment: () => parseIsolatedJSDocComment, - parseJSDocTypeExpressionForTests: () => parseJSDocTypeExpressionForTests, - parseJsonConfigFileContent: () => parseJsonConfigFileContent, - parseJsonSourceFileConfigFileContent: () => parseJsonSourceFileConfigFileContent, - parseJsonText: () => parseJsonText, - parseListTypeOption: () => parseListTypeOption, - parseNodeFactory: () => parseNodeFactory, - parseNodeModuleFromPath: () => parseNodeModuleFromPath, - parsePackageName: () => parsePackageName, - parsePseudoBigInt: () => parsePseudoBigInt, - parseValidBigInt: () => parseValidBigInt, - patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory, - pathContainsNodeModules: () => pathContainsNodeModules, - pathIsAbsolute: () => pathIsAbsolute, - pathIsBareSpecifier: () => pathIsBareSpecifier, - pathIsRelative: () => pathIsRelative, - patternText: () => patternText, - perfLogger: () => perfLogger, - performIncrementalCompilation: () => performIncrementalCompilation, - performance: () => ts_performance_exports, - plainJSErrors: () => plainJSErrors, - positionBelongsToNode: () => positionBelongsToNode, - positionIsASICandidate: () => positionIsASICandidate, - positionIsSynthesized: () => positionIsSynthesized, - positionsAreOnSameLine: () => positionsAreOnSameLine, - preProcessFile: () => preProcessFile, - probablyUsesSemicolons: () => probablyUsesSemicolons, - processCommentPragmas: () => processCommentPragmas, - processPragmasIntoFields: () => processPragmasIntoFields, - processTaggedTemplateExpression: () => processTaggedTemplateExpression, - programContainsEsModules: () => programContainsEsModules, - programContainsModules: () => programContainsModules, - projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, - propKeyHelper: () => propKeyHelper, - propertyNamePart: () => propertyNamePart, - pseudoBigIntToString: () => pseudoBigIntToString, - punctuationPart: () => punctuationPart, - pushIfUnique: () => pushIfUnique, - quote: () => quote, - quotePreferenceFromString: () => quotePreferenceFromString, - rangeContainsPosition: () => rangeContainsPosition, - rangeContainsPositionExclusive: () => rangeContainsPositionExclusive, - rangeContainsRange: () => rangeContainsRange, - rangeContainsRangeExclusive: () => rangeContainsRangeExclusive, - rangeContainsStartEnd: () => rangeContainsStartEnd, - rangeEndIsOnSameLineAsRangeStart: () => rangeEndIsOnSameLineAsRangeStart, - rangeEndPositionsAreOnSameLine: () => rangeEndPositionsAreOnSameLine, - rangeEquals: () => rangeEquals, - rangeIsOnSingleLine: () => rangeIsOnSingleLine, - rangeOfNode: () => rangeOfNode, - rangeOfTypeParameters: () => rangeOfTypeParameters, - rangeOverlapsWithStartEnd: () => rangeOverlapsWithStartEnd, - rangeStartIsOnSameLineAsRangeEnd: () => rangeStartIsOnSameLineAsRangeEnd, - rangeStartPositionsAreOnSameLine: () => rangeStartPositionsAreOnSameLine, - readBuilderProgram: () => readBuilderProgram, - readConfigFile: () => readConfigFile, - readHelper: () => readHelper, - readJson: () => readJson, - readJsonConfigFile: () => readJsonConfigFile, - readJsonOrUndefined: () => readJsonOrUndefined, - realizeDiagnostics: () => realizeDiagnostics, - reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange, - reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange, - reduceLeft: () => reduceLeft, - reduceLeftIterator: () => reduceLeftIterator, - reducePathComponents: () => reducePathComponents, - refactor: () => ts_refactor_exports, - regExpEscape: () => regExpEscape, - relativeComplement: () => relativeComplement, - removeAllComments: () => removeAllComments, - removeEmitHelper: () => removeEmitHelper, - removeExtension: () => removeExtension, - removeFileExtension: () => removeFileExtension, - removeIgnoredPath: () => removeIgnoredPath, - removeMinAndVersionNumbers: () => removeMinAndVersionNumbers, - removeOptionality: () => removeOptionality, - removePrefix: () => removePrefix, - removeSuffix: () => removeSuffix, - removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator, - repeatString: () => repeatString, - replaceElement: () => replaceElement, - resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson, - resolveConfigFileProjectName: () => resolveConfigFileProjectName, - resolveJSModule: () => resolveJSModule, - resolveModuleName: () => resolveModuleName, - resolveModuleNameFromCache: () => resolveModuleNameFromCache, - resolvePackageNameToPackageJson: () => resolvePackageNameToPackageJson, - resolvePath: () => resolvePath, - resolveProjectReferencePath: () => resolveProjectReferencePath, - resolveTripleslashReference: () => resolveTripleslashReference, - resolveTypeReferenceDirective: () => resolveTypeReferenceDirective, - resolvingEmptyArray: () => resolvingEmptyArray, - restHelper: () => restHelper, - returnFalse: () => returnFalse, - returnNoopFileWatcher: () => returnNoopFileWatcher, - returnTrue: () => returnTrue, - returnUndefined: () => returnUndefined, - returnsPromise: () => returnsPromise, - runInitializersHelper: () => runInitializersHelper, - sameFlatMap: () => sameFlatMap, - sameMap: () => sameMap, - sameMapping: () => sameMapping, - scanShebangTrivia: () => scanShebangTrivia, - scanTokenAtPosition: () => scanTokenAtPosition, - scanner: () => scanner, - screenStartingMessageCodes: () => screenStartingMessageCodes, - semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, - serializeCompilerOptions: () => serializeCompilerOptions, - server: () => ts_server_exports2, - servicesVersion: () => servicesVersion, - setCommentRange: () => setCommentRange, - setConfigFileInOptions: () => setConfigFileInOptions, - setConstantValue: () => setConstantValue, - setEachParent: () => setEachParent, - setEmitFlags: () => setEmitFlags, - setFunctionNameHelper: () => setFunctionNameHelper, - setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, - setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, - setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, - setIdentifierTypeArguments: () => setIdentifierTypeArguments, - setInternalEmitFlags: () => setInternalEmitFlags, - setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, - setModuleDefaultHelper: () => setModuleDefaultHelper, - setNodeFlags: () => setNodeFlags, - setObjectAllocator: () => setObjectAllocator, - setOriginalNode: () => setOriginalNode, - setParent: () => setParent, - setParentRecursive: () => setParentRecursive, - setPrivateIdentifier: () => setPrivateIdentifier, - setResolvedModule: () => setResolvedModule, - setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective, - setSnippetElement: () => setSnippetElement, - setSourceMapRange: () => setSourceMapRange, - setStackTraceLimit: () => setStackTraceLimit, - setStartsOnNewLine: () => setStartsOnNewLine, - setSyntheticLeadingComments: () => setSyntheticLeadingComments, - setSyntheticTrailingComments: () => setSyntheticTrailingComments, - setSys: () => setSys, - setSysLog: () => setSysLog, - setTextRange: () => setTextRange, - setTextRangeEnd: () => setTextRangeEnd, - setTextRangePos: () => setTextRangePos, - setTextRangePosEnd: () => setTextRangePosEnd, - setTextRangePosWidth: () => setTextRangePosWidth, - setTokenSourceMapRange: () => setTokenSourceMapRange, - setTypeNode: () => setTypeNode, - setUILocale: () => setUILocale, - setValueDeclaration: () => setValueDeclaration, - shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, - shouldPreserveConstEnums: () => shouldPreserveConstEnums, - shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, - showModuleSpecifier: () => showModuleSpecifier, - signatureHasLiteralTypes: () => signatureHasLiteralTypes, - signatureHasRestParameter: () => signatureHasRestParameter, - signatureToDisplayParts: () => signatureToDisplayParts, - single: () => single, - singleElementArray: () => singleElementArray, - singleIterator: () => singleIterator, - singleOrMany: () => singleOrMany, - singleOrUndefined: () => singleOrUndefined, - skipAlias: () => skipAlias, - skipAssertions: () => skipAssertions, - skipConstraint: () => skipConstraint, - skipOuterExpressions: () => skipOuterExpressions, - skipParentheses: () => skipParentheses, - skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions, - skipTrivia: () => skipTrivia, - skipTypeChecking: () => skipTypeChecking, - skipTypeParentheses: () => skipTypeParentheses, - skipWhile: () => skipWhile, - sliceAfter: () => sliceAfter, - some: () => some, - sort: () => sort, - sortAndDeduplicate: () => sortAndDeduplicate, - sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics, - sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions, - sourceFileMayBeEmitted: () => sourceFileMayBeEmitted, - sourceMapCommentRegExp: () => sourceMapCommentRegExp, - sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart, - spacePart: () => spacePart, - spanMap: () => spanMap, - spreadArrayHelper: () => spreadArrayHelper, - stableSort: () => stableSort, - startEndContainsRange: () => startEndContainsRange, - startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd, - startOnNewLine: () => startOnNewLine, - startTracing: () => startTracing, - startsWith: () => startsWith, - startsWithDirectory: () => startsWithDirectory, - startsWithUnderscore: () => startsWithUnderscore, - startsWithUseStrict: () => startsWithUseStrict, - stringContains: () => stringContains, - stringContainsAt: () => stringContainsAt, - stringToToken: () => stringToToken, - stripQuotes: () => stripQuotes, - supportedDeclarationExtensions: () => supportedDeclarationExtensions, - supportedJSExtensions: () => supportedJSExtensions, - supportedJSExtensionsFlat: () => supportedJSExtensionsFlat, - supportedLocaleDirectories: () => supportedLocaleDirectories, - supportedTSExtensions: () => supportedTSExtensions, - supportedTSExtensionsFlat: () => supportedTSExtensionsFlat, - supportedTSImplementationExtensions: () => supportedTSImplementationExtensions, - suppressLeadingAndTrailingTrivia: () => suppressLeadingAndTrailingTrivia, - suppressLeadingTrivia: () => suppressLeadingTrivia, - suppressTrailingTrivia: () => suppressTrailingTrivia, - symbolEscapedNameNoDefault: () => symbolEscapedNameNoDefault, - symbolName: () => symbolName, - symbolNameNoDefault: () => symbolNameNoDefault, - symbolPart: () => symbolPart, - symbolToDisplayParts: () => symbolToDisplayParts, - syntaxMayBeASICandidate: () => syntaxMayBeASICandidate, - syntaxRequiresTrailingSemicolonOrASI: () => syntaxRequiresTrailingSemicolonOrASI, - sys: () => sys, - sysLog: () => sysLog, - tagNamesAreEquivalent: () => tagNamesAreEquivalent, - takeWhile: () => takeWhile, - targetOptionDeclaration: () => targetOptionDeclaration, - templateObjectHelper: () => templateObjectHelper, - testFormatSettings: () => testFormatSettings, - textChangeRangeIsUnchanged: () => textChangeRangeIsUnchanged, - textChangeRangeNewSpan: () => textChangeRangeNewSpan, - textChanges: () => ts_textChanges_exports, - textOrKeywordPart: () => textOrKeywordPart, - textPart: () => textPart, - textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive, - textSpanContainsPosition: () => textSpanContainsPosition, - textSpanContainsTextSpan: () => textSpanContainsTextSpan, - textSpanEnd: () => textSpanEnd, - textSpanIntersection: () => textSpanIntersection, - textSpanIntersectsWith: () => textSpanIntersectsWith, - textSpanIntersectsWithPosition: () => textSpanIntersectsWithPosition, - textSpanIntersectsWithTextSpan: () => textSpanIntersectsWithTextSpan, - textSpanIsEmpty: () => textSpanIsEmpty, - textSpanOverlap: () => textSpanOverlap, - textSpanOverlapsWith: () => textSpanOverlapsWith, - textSpansEqual: () => textSpansEqual, - textToKeywordObj: () => textToKeywordObj, - timestamp: () => timestamp, - toArray: () => toArray, - toBuilderFileEmit: () => toBuilderFileEmit, - toBuilderStateFileInfoForMultiEmit: () => toBuilderStateFileInfoForMultiEmit, - toEditorSettings: () => toEditorSettings, - toFileNameLowerCase: () => toFileNameLowerCase, - toLowerCase: () => toLowerCase, - toPath: () => toPath, - toProgramEmitPending: () => toProgramEmitPending, - tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword, - tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan, - tokenToString: () => tokenToString, - trace: () => trace, - tracing: () => tracing, - tracingEnabled: () => tracingEnabled, - transform: () => transform, - transformClassFields: () => transformClassFields, - transformDeclarations: () => transformDeclarations, - transformECMAScriptModule: () => transformECMAScriptModule, - transformES2015: () => transformES2015, - transformES2016: () => transformES2016, - transformES2017: () => transformES2017, - transformES2018: () => transformES2018, - transformES2019: () => transformES2019, - transformES2020: () => transformES2020, - transformES2021: () => transformES2021, - transformES5: () => transformES5, - transformESDecorators: () => transformESDecorators, - transformESNext: () => transformESNext, - transformGenerators: () => transformGenerators, - transformJsx: () => transformJsx, - transformLegacyDecorators: () => transformLegacyDecorators, - transformModule: () => transformModule, - transformNodeModule: () => transformNodeModule, - transformNodes: () => transformNodes, - transformSystemModule: () => transformSystemModule, - transformTypeScript: () => transformTypeScript, - transpile: () => transpile, - transpileModule: () => transpileModule, - transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions, - trimString: () => trimString, - trimStringEnd: () => trimStringEnd, - trimStringStart: () => trimStringStart, - tryAddToSet: () => tryAddToSet, - tryAndIgnoreErrors: () => tryAndIgnoreErrors, - tryCast: () => tryCast, - tryDirectoryExists: () => tryDirectoryExists, - tryExtractTSExtension: () => tryExtractTSExtension, - tryFileExists: () => tryFileExists, - tryGetClassExtendingExpressionWithTypeArguments: () => tryGetClassExtendingExpressionWithTypeArguments, - tryGetClassImplementingOrExtendingExpressionWithTypeArguments: () => tryGetClassImplementingOrExtendingExpressionWithTypeArguments, - tryGetDirectories: () => tryGetDirectories, - tryGetExtensionFromPath: () => tryGetExtensionFromPath2, - tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, - tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, - tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, - tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, - tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, - tryGetPropertyAccessOrIdentifierToString: () => tryGetPropertyAccessOrIdentifierToString, - tryGetPropertyNameOfBindingOrAssignmentElement: () => tryGetPropertyNameOfBindingOrAssignmentElement, - tryGetSourceMappingURL: () => tryGetSourceMappingURL, - tryGetTextOfPropertyName: () => tryGetTextOfPropertyName, - tryIOAndConsumeErrors: () => tryIOAndConsumeErrors, - tryParsePattern: () => tryParsePattern, - tryParsePatterns: () => tryParsePatterns, - tryParseRawSourceMap: () => tryParseRawSourceMap, - tryReadDirectory: () => tryReadDirectory, - tryReadFile: () => tryReadFile, - tryRemoveDirectoryPrefix: () => tryRemoveDirectoryPrefix, - tryRemoveExtension: () => tryRemoveExtension, - tryRemovePrefix: () => tryRemovePrefix, - tryRemoveSuffix: () => tryRemoveSuffix, - typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, - typeAliasNamePart: () => typeAliasNamePart, - typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, - typeHasCallOrConstructSignatures: () => typeHasCallOrConstructSignatures, - typeKeywords: () => typeKeywords, - typeParameterNamePart: () => typeParameterNamePart, - typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter, - typeToDisplayParts: () => typeToDisplayParts, - unchangedPollThresholds: () => unchangedPollThresholds, - unchangedTextChangeRange: () => unchangedTextChangeRange, - unescapeLeadingUnderscores: () => unescapeLeadingUnderscores, - unmangleScopedPackageName: () => unmangleScopedPackageName, - unorderedRemoveItem: () => unorderedRemoveItem, - unorderedRemoveItemAt: () => unorderedRemoveItemAt, - unreachableCodeIsError: () => unreachableCodeIsError, - unusedLabelIsError: () => unusedLabelIsError, - unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, - updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, - updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, - updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updatePackageJsonWatch: () => updatePackageJsonWatch, - updateResolutionField: () => updateResolutionField, - updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, - updateSourceFile: () => updateSourceFile, - updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, - usesExtensionsOnImports: () => usesExtensionsOnImports, - usingSingleLineStringWriter: () => usingSingleLineStringWriter, - utf16EncodeAsString: () => utf16EncodeAsString, - validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage, - valuesHelper: () => valuesHelper, - version: () => version, - versionMajorMinor: () => versionMajorMinor, - visitArray: () => visitArray, - visitCommaListElements: () => visitCommaListElements, - visitEachChild: () => visitEachChild, - visitFunctionBody: () => visitFunctionBody, - visitIterationBody: () => visitIterationBody, - visitLexicalEnvironment: () => visitLexicalEnvironment, - visitNode: () => visitNode, - visitNodes: () => visitNodes2, - visitParameterList: () => visitParameterList, - walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, - walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, - walkUpOuterExpressions: () => walkUpOuterExpressions, - walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, - walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, - walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, - whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp, - writeCommentRange: () => writeCommentRange, - writeFile: () => writeFile, - writeFileEnsuringDirectories: () => writeFileEnsuringDirectories, - zipToModeAwareCache: () => zipToModeAwareCache, - zipWith: () => zipWith -}); - -// src/services/types.ts -var ScriptSnapshot; -((ScriptSnapshot2) => { - class StringScriptSnapshot { - constructor(text) { - this.text = text; - } - getText(start2, end) { - return start2 === 0 && end === this.text.length ? this.text : this.text.substring(start2, end); - } - getLength() { - return this.text.length; - } - getChangeRange() { - return void 0; - } - } - function fromString(text) { - return new StringScriptSnapshot(text); - } - ScriptSnapshot2.fromString = fromString; -})(ScriptSnapshot || (ScriptSnapshot = {})); -var PackageJsonDependencyGroup = /* @__PURE__ */ ((PackageJsonDependencyGroup2) => { - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["Dependencies"] = 1] = "Dependencies"; - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["DevDependencies"] = 2] = "DevDependencies"; - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["PeerDependencies"] = 4] = "PeerDependencies"; - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["OptionalDependencies"] = 8] = "OptionalDependencies"; - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["All"] = 15] = "All"; - return PackageJsonDependencyGroup2; -})(PackageJsonDependencyGroup || {}); -var PackageJsonAutoImportPreference = /* @__PURE__ */ ((PackageJsonAutoImportPreference2) => { - PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Off"] = 0] = "Off"; - PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["On"] = 1] = "On"; - PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Auto"] = 2] = "Auto"; - return PackageJsonAutoImportPreference2; -})(PackageJsonAutoImportPreference || {}); -var LanguageServiceMode = /* @__PURE__ */ ((LanguageServiceMode2) => { - LanguageServiceMode2[LanguageServiceMode2["Semantic"] = 0] = "Semantic"; - LanguageServiceMode2[LanguageServiceMode2["PartialSemantic"] = 1] = "PartialSemantic"; - LanguageServiceMode2[LanguageServiceMode2["Syntactic"] = 2] = "Syntactic"; - return LanguageServiceMode2; -})(LanguageServiceMode || {}); -var emptyOptions = {}; -var SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat3) => { - SemanticClassificationFormat3["Original"] = "original"; - SemanticClassificationFormat3["TwentyTwenty"] = "2020"; - return SemanticClassificationFormat3; -})(SemanticClassificationFormat || {}); -var OrganizeImportsMode = /* @__PURE__ */ ((OrganizeImportsMode3) => { - OrganizeImportsMode3["All"] = "All"; - OrganizeImportsMode3["SortAndCombine"] = "SortAndCombine"; - OrganizeImportsMode3["RemoveUnused"] = "RemoveUnused"; - return OrganizeImportsMode3; -})(OrganizeImportsMode || {}); -var CompletionTriggerKind = /* @__PURE__ */ ((CompletionTriggerKind4) => { - CompletionTriggerKind4[CompletionTriggerKind4["Invoked"] = 1] = "Invoked"; - CompletionTriggerKind4[CompletionTriggerKind4["TriggerCharacter"] = 2] = "TriggerCharacter"; - CompletionTriggerKind4[CompletionTriggerKind4["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; - return CompletionTriggerKind4; -})(CompletionTriggerKind || {}); -var InlayHintKind = /* @__PURE__ */ ((InlayHintKind2) => { - InlayHintKind2["Type"] = "Type"; - InlayHintKind2["Parameter"] = "Parameter"; - InlayHintKind2["Enum"] = "Enum"; - return InlayHintKind2; -})(InlayHintKind || {}); -var HighlightSpanKind = /* @__PURE__ */ ((HighlightSpanKind2) => { - HighlightSpanKind2["none"] = "none"; - HighlightSpanKind2["definition"] = "definition"; - HighlightSpanKind2["reference"] = "reference"; - HighlightSpanKind2["writtenReference"] = "writtenReference"; - return HighlightSpanKind2; -})(HighlightSpanKind || {}); -var IndentStyle = /* @__PURE__ */ ((IndentStyle3) => { - IndentStyle3[IndentStyle3["None"] = 0] = "None"; - IndentStyle3[IndentStyle3["Block"] = 1] = "Block"; - IndentStyle3[IndentStyle3["Smart"] = 2] = "Smart"; - return IndentStyle3; -})(IndentStyle || {}); -var SemicolonPreference = /* @__PURE__ */ ((SemicolonPreference3) => { - SemicolonPreference3["Ignore"] = "ignore"; - SemicolonPreference3["Insert"] = "insert"; - SemicolonPreference3["Remove"] = "remove"; - return SemicolonPreference3; -})(SemicolonPreference || {}); -function getDefaultFormatCodeSettings(newLineCharacter) { - return { - indentSize: 4, - tabSize: 4, - newLineCharacter: newLineCharacter || "\n", - convertTabsToSpaces: true, - indentStyle: 2 /* Smart */, - insertSpaceAfterConstructor: false, - insertSpaceAfterCommaDelimiter: true, - insertSpaceAfterSemicolonInForStatements: true, - insertSpaceBeforeAndAfterBinaryOperators: true, - insertSpaceAfterKeywordsInControlFlowStatements: true, - insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, - insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, - insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, - insertSpaceBeforeFunctionParenthesis: false, - placeOpenBraceOnNewLineForFunctions: false, - placeOpenBraceOnNewLineForControlBlocks: false, - semicolons: "ignore" /* Ignore */, - trimTrailingWhitespace: true - }; -} -var testFormatSettings = getDefaultFormatCodeSettings("\n"); -var SymbolDisplayPartKind = /* @__PURE__ */ ((SymbolDisplayPartKind2) => { - SymbolDisplayPartKind2[SymbolDisplayPartKind2["aliasName"] = 0] = "aliasName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["className"] = 1] = "className"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumName"] = 2] = "enumName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["fieldName"] = 3] = "fieldName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["interfaceName"] = 4] = "interfaceName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["keyword"] = 5] = "keyword"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["lineBreak"] = 6] = "lineBreak"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["numericLiteral"] = 7] = "numericLiteral"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["stringLiteral"] = 8] = "stringLiteral"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["localName"] = 9] = "localName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["methodName"] = 10] = "methodName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["moduleName"] = 11] = "moduleName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["operator"] = 12] = "operator"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["parameterName"] = 13] = "parameterName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["propertyName"] = 14] = "propertyName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["punctuation"] = 15] = "punctuation"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["space"] = 16] = "space"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["text"] = 17] = "text"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["typeParameterName"] = 18] = "typeParameterName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumMemberName"] = 19] = "enumMemberName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["functionName"] = 20] = "functionName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["link"] = 22] = "link"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkName"] = 23] = "linkName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkText"] = 24] = "linkText"; - return SymbolDisplayPartKind2; -})(SymbolDisplayPartKind || {}); -var CompletionInfoFlags = /* @__PURE__ */ ((CompletionInfoFlags2) => { - CompletionInfoFlags2[CompletionInfoFlags2["None"] = 0] = "None"; - CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeAutoImports"] = 1] = "MayIncludeAutoImports"; - CompletionInfoFlags2[CompletionInfoFlags2["IsImportStatementCompletion"] = 2] = "IsImportStatementCompletion"; - CompletionInfoFlags2[CompletionInfoFlags2["IsContinuation"] = 4] = "IsContinuation"; - CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiers"] = 8] = "ResolvedModuleSpecifiers"; - CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiersBeyondLimit"] = 16] = "ResolvedModuleSpecifiersBeyondLimit"; - CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeMethodSnippets"] = 32] = "MayIncludeMethodSnippets"; - return CompletionInfoFlags2; -})(CompletionInfoFlags || {}); -var OutliningSpanKind = /* @__PURE__ */ ((OutliningSpanKind2) => { - OutliningSpanKind2["Comment"] = "comment"; - OutliningSpanKind2["Region"] = "region"; - OutliningSpanKind2["Code"] = "code"; - OutliningSpanKind2["Imports"] = "imports"; - return OutliningSpanKind2; -})(OutliningSpanKind || {}); -var OutputFileType = /* @__PURE__ */ ((OutputFileType2) => { - OutputFileType2[OutputFileType2["JavaScript"] = 0] = "JavaScript"; - OutputFileType2[OutputFileType2["SourceMap"] = 1] = "SourceMap"; - OutputFileType2[OutputFileType2["Declaration"] = 2] = "Declaration"; - return OutputFileType2; -})(OutputFileType || {}); -var EndOfLineState = /* @__PURE__ */ ((EndOfLineState3) => { - EndOfLineState3[EndOfLineState3["None"] = 0] = "None"; - EndOfLineState3[EndOfLineState3["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; - EndOfLineState3[EndOfLineState3["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; - EndOfLineState3[EndOfLineState3["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; - EndOfLineState3[EndOfLineState3["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; - EndOfLineState3[EndOfLineState3["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; - EndOfLineState3[EndOfLineState3["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; - return EndOfLineState3; -})(EndOfLineState || {}); -var TokenClass = /* @__PURE__ */ ((TokenClass2) => { - TokenClass2[TokenClass2["Punctuation"] = 0] = "Punctuation"; - TokenClass2[TokenClass2["Keyword"] = 1] = "Keyword"; - TokenClass2[TokenClass2["Operator"] = 2] = "Operator"; - TokenClass2[TokenClass2["Comment"] = 3] = "Comment"; - TokenClass2[TokenClass2["Whitespace"] = 4] = "Whitespace"; - TokenClass2[TokenClass2["Identifier"] = 5] = "Identifier"; - TokenClass2[TokenClass2["NumberLiteral"] = 6] = "NumberLiteral"; - TokenClass2[TokenClass2["BigIntLiteral"] = 7] = "BigIntLiteral"; - TokenClass2[TokenClass2["StringLiteral"] = 8] = "StringLiteral"; - TokenClass2[TokenClass2["RegExpLiteral"] = 9] = "RegExpLiteral"; - return TokenClass2; -})(TokenClass || {}); -var ScriptElementKind = /* @__PURE__ */ ((ScriptElementKind2) => { - ScriptElementKind2["unknown"] = ""; - ScriptElementKind2["warning"] = "warning"; - ScriptElementKind2["keyword"] = "keyword"; - ScriptElementKind2["scriptElement"] = "script"; - ScriptElementKind2["moduleElement"] = "module"; - ScriptElementKind2["classElement"] = "class"; - ScriptElementKind2["localClassElement"] = "local class"; - ScriptElementKind2["interfaceElement"] = "interface"; - ScriptElementKind2["typeElement"] = "type"; - ScriptElementKind2["enumElement"] = "enum"; - ScriptElementKind2["enumMemberElement"] = "enum member"; - ScriptElementKind2["variableElement"] = "var"; - ScriptElementKind2["localVariableElement"] = "local var"; - ScriptElementKind2["functionElement"] = "function"; - ScriptElementKind2["localFunctionElement"] = "local function"; - ScriptElementKind2["memberFunctionElement"] = "method"; - ScriptElementKind2["memberGetAccessorElement"] = "getter"; - ScriptElementKind2["memberSetAccessorElement"] = "setter"; - ScriptElementKind2["memberVariableElement"] = "property"; - ScriptElementKind2["memberAccessorVariableElement"] = "accessor"; - ScriptElementKind2["constructorImplementationElement"] = "constructor"; - ScriptElementKind2["callSignatureElement"] = "call"; - ScriptElementKind2["indexSignatureElement"] = "index"; - ScriptElementKind2["constructSignatureElement"] = "construct"; - ScriptElementKind2["parameterElement"] = "parameter"; - ScriptElementKind2["typeParameterElement"] = "type parameter"; - ScriptElementKind2["primitiveType"] = "primitive type"; - ScriptElementKind2["label"] = "label"; - ScriptElementKind2["alias"] = "alias"; - ScriptElementKind2["constElement"] = "const"; - ScriptElementKind2["letElement"] = "let"; - ScriptElementKind2["directory"] = "directory"; - ScriptElementKind2["externalModuleName"] = "external module name"; - ScriptElementKind2["jsxAttribute"] = "JSX attribute"; - ScriptElementKind2["string"] = "string"; - ScriptElementKind2["link"] = "link"; - ScriptElementKind2["linkName"] = "link name"; - ScriptElementKind2["linkText"] = "link text"; - return ScriptElementKind2; -})(ScriptElementKind || {}); -var ScriptElementKindModifier = /* @__PURE__ */ ((ScriptElementKindModifier2) => { - ScriptElementKindModifier2["none"] = ""; - ScriptElementKindModifier2["publicMemberModifier"] = "public"; - ScriptElementKindModifier2["privateMemberModifier"] = "private"; - ScriptElementKindModifier2["protectedMemberModifier"] = "protected"; - ScriptElementKindModifier2["exportedModifier"] = "export"; - ScriptElementKindModifier2["ambientModifier"] = "declare"; - ScriptElementKindModifier2["staticModifier"] = "static"; - ScriptElementKindModifier2["abstractModifier"] = "abstract"; - ScriptElementKindModifier2["optionalModifier"] = "optional"; - ScriptElementKindModifier2["deprecatedModifier"] = "deprecated"; - ScriptElementKindModifier2["dtsModifier"] = ".d.ts"; - ScriptElementKindModifier2["tsModifier"] = ".ts"; - ScriptElementKindModifier2["tsxModifier"] = ".tsx"; - ScriptElementKindModifier2["jsModifier"] = ".js"; - ScriptElementKindModifier2["jsxModifier"] = ".jsx"; - ScriptElementKindModifier2["jsonModifier"] = ".json"; - ScriptElementKindModifier2["dmtsModifier"] = ".d.mts"; - ScriptElementKindModifier2["mtsModifier"] = ".mts"; - ScriptElementKindModifier2["mjsModifier"] = ".mjs"; - ScriptElementKindModifier2["dctsModifier"] = ".d.cts"; - ScriptElementKindModifier2["ctsModifier"] = ".cts"; - ScriptElementKindModifier2["cjsModifier"] = ".cjs"; - return ScriptElementKindModifier2; -})(ScriptElementKindModifier || {}); -var ClassificationTypeNames = /* @__PURE__ */ ((ClassificationTypeNames2) => { - ClassificationTypeNames2["comment"] = "comment"; - ClassificationTypeNames2["identifier"] = "identifier"; - ClassificationTypeNames2["keyword"] = "keyword"; - ClassificationTypeNames2["numericLiteral"] = "number"; - ClassificationTypeNames2["bigintLiteral"] = "bigint"; - ClassificationTypeNames2["operator"] = "operator"; - ClassificationTypeNames2["stringLiteral"] = "string"; - ClassificationTypeNames2["whiteSpace"] = "whitespace"; - ClassificationTypeNames2["text"] = "text"; - ClassificationTypeNames2["punctuation"] = "punctuation"; - ClassificationTypeNames2["className"] = "class name"; - ClassificationTypeNames2["enumName"] = "enum name"; - ClassificationTypeNames2["interfaceName"] = "interface name"; - ClassificationTypeNames2["moduleName"] = "module name"; - ClassificationTypeNames2["typeParameterName"] = "type parameter name"; - ClassificationTypeNames2["typeAliasName"] = "type alias name"; - ClassificationTypeNames2["parameterName"] = "parameter name"; - ClassificationTypeNames2["docCommentTagName"] = "doc comment tag name"; - ClassificationTypeNames2["jsxOpenTagName"] = "jsx open tag name"; - ClassificationTypeNames2["jsxCloseTagName"] = "jsx close tag name"; - ClassificationTypeNames2["jsxSelfClosingTagName"] = "jsx self closing tag name"; - ClassificationTypeNames2["jsxAttribute"] = "jsx attribute"; - ClassificationTypeNames2["jsxText"] = "jsx text"; - ClassificationTypeNames2["jsxAttributeStringLiteralValue"] = "jsx attribute string literal value"; - return ClassificationTypeNames2; -})(ClassificationTypeNames || {}); -var ClassificationType = /* @__PURE__ */ ((ClassificationType3) => { - ClassificationType3[ClassificationType3["comment"] = 1] = "comment"; - ClassificationType3[ClassificationType3["identifier"] = 2] = "identifier"; - ClassificationType3[ClassificationType3["keyword"] = 3] = "keyword"; - ClassificationType3[ClassificationType3["numericLiteral"] = 4] = "numericLiteral"; - ClassificationType3[ClassificationType3["operator"] = 5] = "operator"; - ClassificationType3[ClassificationType3["stringLiteral"] = 6] = "stringLiteral"; - ClassificationType3[ClassificationType3["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; - ClassificationType3[ClassificationType3["whiteSpace"] = 8] = "whiteSpace"; - ClassificationType3[ClassificationType3["text"] = 9] = "text"; - ClassificationType3[ClassificationType3["punctuation"] = 10] = "punctuation"; - ClassificationType3[ClassificationType3["className"] = 11] = "className"; - ClassificationType3[ClassificationType3["enumName"] = 12] = "enumName"; - ClassificationType3[ClassificationType3["interfaceName"] = 13] = "interfaceName"; - ClassificationType3[ClassificationType3["moduleName"] = 14] = "moduleName"; - ClassificationType3[ClassificationType3["typeParameterName"] = 15] = "typeParameterName"; - ClassificationType3[ClassificationType3["typeAliasName"] = 16] = "typeAliasName"; - ClassificationType3[ClassificationType3["parameterName"] = 17] = "parameterName"; - ClassificationType3[ClassificationType3["docCommentTagName"] = 18] = "docCommentTagName"; - ClassificationType3[ClassificationType3["jsxOpenTagName"] = 19] = "jsxOpenTagName"; - ClassificationType3[ClassificationType3["jsxCloseTagName"] = 20] = "jsxCloseTagName"; - ClassificationType3[ClassificationType3["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; - ClassificationType3[ClassificationType3["jsxAttribute"] = 22] = "jsxAttribute"; - ClassificationType3[ClassificationType3["jsxText"] = 23] = "jsxText"; - ClassificationType3[ClassificationType3["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; - ClassificationType3[ClassificationType3["bigintLiteral"] = 25] = "bigintLiteral"; - return ClassificationType3; -})(ClassificationType || {}); +// src/services/types.ts +var ScriptSnapshot; +((ScriptSnapshot2) => { + class StringScriptSnapshot { + constructor(text) { + this.text = text; + } + getText(start2, end) { + return start2 === 0 && end === this.text.length ? this.text : this.text.substring(start2, end); + } + getLength() { + return this.text.length; + } + getChangeRange() { + return void 0; + } + } + function fromString(text) { + return new StringScriptSnapshot(text); + } + ScriptSnapshot2.fromString = fromString; +})(ScriptSnapshot || (ScriptSnapshot = {})); +var PackageJsonDependencyGroup = /* @__PURE__ */ ((PackageJsonDependencyGroup2) => { + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["Dependencies"] = 1] = "Dependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["DevDependencies"] = 2] = "DevDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["PeerDependencies"] = 4] = "PeerDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["OptionalDependencies"] = 8] = "OptionalDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["All"] = 15] = "All"; + return PackageJsonDependencyGroup2; +})(PackageJsonDependencyGroup || {}); +var PackageJsonAutoImportPreference = /* @__PURE__ */ ((PackageJsonAutoImportPreference2) => { + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Off"] = 0] = "Off"; + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["On"] = 1] = "On"; + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Auto"] = 2] = "Auto"; + return PackageJsonAutoImportPreference2; +})(PackageJsonAutoImportPreference || {}); +var LanguageServiceMode = /* @__PURE__ */ ((LanguageServiceMode2) => { + LanguageServiceMode2[LanguageServiceMode2["Semantic"] = 0] = "Semantic"; + LanguageServiceMode2[LanguageServiceMode2["PartialSemantic"] = 1] = "PartialSemantic"; + LanguageServiceMode2[LanguageServiceMode2["Syntactic"] = 2] = "Syntactic"; + return LanguageServiceMode2; +})(LanguageServiceMode || {}); +var emptyOptions = {}; +var SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat3) => { + SemanticClassificationFormat3["Original"] = "original"; + SemanticClassificationFormat3["TwentyTwenty"] = "2020"; + return SemanticClassificationFormat3; +})(SemanticClassificationFormat || {}); +var OrganizeImportsMode = /* @__PURE__ */ ((OrganizeImportsMode3) => { + OrganizeImportsMode3["All"] = "All"; + OrganizeImportsMode3["SortAndCombine"] = "SortAndCombine"; + OrganizeImportsMode3["RemoveUnused"] = "RemoveUnused"; + return OrganizeImportsMode3; +})(OrganizeImportsMode || {}); +var CompletionTriggerKind = /* @__PURE__ */ ((CompletionTriggerKind4) => { + CompletionTriggerKind4[CompletionTriggerKind4["Invoked"] = 1] = "Invoked"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerCharacter"] = 2] = "TriggerCharacter"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; + return CompletionTriggerKind4; +})(CompletionTriggerKind || {}); +var InlayHintKind = /* @__PURE__ */ ((InlayHintKind2) => { + InlayHintKind2["Type"] = "Type"; + InlayHintKind2["Parameter"] = "Parameter"; + InlayHintKind2["Enum"] = "Enum"; + return InlayHintKind2; +})(InlayHintKind || {}); +var HighlightSpanKind = /* @__PURE__ */ ((HighlightSpanKind2) => { + HighlightSpanKind2["none"] = "none"; + HighlightSpanKind2["definition"] = "definition"; + HighlightSpanKind2["reference"] = "reference"; + HighlightSpanKind2["writtenReference"] = "writtenReference"; + return HighlightSpanKind2; +})(HighlightSpanKind || {}); +var IndentStyle = /* @__PURE__ */ ((IndentStyle3) => { + IndentStyle3[IndentStyle3["None"] = 0] = "None"; + IndentStyle3[IndentStyle3["Block"] = 1] = "Block"; + IndentStyle3[IndentStyle3["Smart"] = 2] = "Smart"; + return IndentStyle3; +})(IndentStyle || {}); +var SemicolonPreference = /* @__PURE__ */ ((SemicolonPreference3) => { + SemicolonPreference3["Ignore"] = "ignore"; + SemicolonPreference3["Insert"] = "insert"; + SemicolonPreference3["Remove"] = "remove"; + return SemicolonPreference3; +})(SemicolonPreference || {}); +function getDefaultFormatCodeSettings(newLineCharacter) { + return { + indentSize: 4, + tabSize: 4, + newLineCharacter: newLineCharacter || "\n", + convertTabsToSpaces: true, + indentStyle: 2 /* Smart */, + insertSpaceAfterConstructor: false, + insertSpaceAfterCommaDelimiter: true, + insertSpaceAfterSemicolonInForStatements: true, + insertSpaceBeforeAndAfterBinaryOperators: true, + insertSpaceAfterKeywordsInControlFlowStatements: true, + insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, + insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + insertSpaceBeforeFunctionParenthesis: false, + placeOpenBraceOnNewLineForFunctions: false, + placeOpenBraceOnNewLineForControlBlocks: false, + semicolons: "ignore" /* Ignore */, + trimTrailingWhitespace: true + }; +} +var testFormatSettings = getDefaultFormatCodeSettings("\n"); +var SymbolDisplayPartKind = /* @__PURE__ */ ((SymbolDisplayPartKind2) => { + SymbolDisplayPartKind2[SymbolDisplayPartKind2["aliasName"] = 0] = "aliasName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["className"] = 1] = "className"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumName"] = 2] = "enumName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["fieldName"] = 3] = "fieldName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["interfaceName"] = 4] = "interfaceName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["keyword"] = 5] = "keyword"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["lineBreak"] = 6] = "lineBreak"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["numericLiteral"] = 7] = "numericLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["stringLiteral"] = 8] = "stringLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["localName"] = 9] = "localName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["methodName"] = 10] = "methodName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["moduleName"] = 11] = "moduleName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["operator"] = 12] = "operator"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["parameterName"] = 13] = "parameterName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["propertyName"] = 14] = "propertyName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["punctuation"] = 15] = "punctuation"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["space"] = 16] = "space"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["text"] = 17] = "text"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["typeParameterName"] = 18] = "typeParameterName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumMemberName"] = 19] = "enumMemberName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["functionName"] = 20] = "functionName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["link"] = 22] = "link"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkName"] = 23] = "linkName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkText"] = 24] = "linkText"; + return SymbolDisplayPartKind2; +})(SymbolDisplayPartKind || {}); +var CompletionInfoFlags = /* @__PURE__ */ ((CompletionInfoFlags2) => { + CompletionInfoFlags2[CompletionInfoFlags2["None"] = 0] = "None"; + CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeAutoImports"] = 1] = "MayIncludeAutoImports"; + CompletionInfoFlags2[CompletionInfoFlags2["IsImportStatementCompletion"] = 2] = "IsImportStatementCompletion"; + CompletionInfoFlags2[CompletionInfoFlags2["IsContinuation"] = 4] = "IsContinuation"; + CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiers"] = 8] = "ResolvedModuleSpecifiers"; + CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiersBeyondLimit"] = 16] = "ResolvedModuleSpecifiersBeyondLimit"; + CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeMethodSnippets"] = 32] = "MayIncludeMethodSnippets"; + return CompletionInfoFlags2; +})(CompletionInfoFlags || {}); +var OutliningSpanKind = /* @__PURE__ */ ((OutliningSpanKind2) => { + OutliningSpanKind2["Comment"] = "comment"; + OutliningSpanKind2["Region"] = "region"; + OutliningSpanKind2["Code"] = "code"; + OutliningSpanKind2["Imports"] = "imports"; + return OutliningSpanKind2; +})(OutliningSpanKind || {}); +var OutputFileType = /* @__PURE__ */ ((OutputFileType2) => { + OutputFileType2[OutputFileType2["JavaScript"] = 0] = "JavaScript"; + OutputFileType2[OutputFileType2["SourceMap"] = 1] = "SourceMap"; + OutputFileType2[OutputFileType2["Declaration"] = 2] = "Declaration"; + return OutputFileType2; +})(OutputFileType || {}); +var EndOfLineState = /* @__PURE__ */ ((EndOfLineState3) => { + EndOfLineState3[EndOfLineState3["None"] = 0] = "None"; + EndOfLineState3[EndOfLineState3["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; + EndOfLineState3[EndOfLineState3["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; + EndOfLineState3[EndOfLineState3["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; + EndOfLineState3[EndOfLineState3["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; + EndOfLineState3[EndOfLineState3["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; + EndOfLineState3[EndOfLineState3["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; + return EndOfLineState3; +})(EndOfLineState || {}); +var TokenClass = /* @__PURE__ */ ((TokenClass2) => { + TokenClass2[TokenClass2["Punctuation"] = 0] = "Punctuation"; + TokenClass2[TokenClass2["Keyword"] = 1] = "Keyword"; + TokenClass2[TokenClass2["Operator"] = 2] = "Operator"; + TokenClass2[TokenClass2["Comment"] = 3] = "Comment"; + TokenClass2[TokenClass2["Whitespace"] = 4] = "Whitespace"; + TokenClass2[TokenClass2["Identifier"] = 5] = "Identifier"; + TokenClass2[TokenClass2["NumberLiteral"] = 6] = "NumberLiteral"; + TokenClass2[TokenClass2["BigIntLiteral"] = 7] = "BigIntLiteral"; + TokenClass2[TokenClass2["StringLiteral"] = 8] = "StringLiteral"; + TokenClass2[TokenClass2["RegExpLiteral"] = 9] = "RegExpLiteral"; + return TokenClass2; +})(TokenClass || {}); +var ScriptElementKind = /* @__PURE__ */ ((ScriptElementKind2) => { + ScriptElementKind2["unknown"] = ""; + ScriptElementKind2["warning"] = "warning"; + ScriptElementKind2["keyword"] = "keyword"; + ScriptElementKind2["scriptElement"] = "script"; + ScriptElementKind2["moduleElement"] = "module"; + ScriptElementKind2["classElement"] = "class"; + ScriptElementKind2["localClassElement"] = "local class"; + ScriptElementKind2["interfaceElement"] = "interface"; + ScriptElementKind2["typeElement"] = "type"; + ScriptElementKind2["enumElement"] = "enum"; + ScriptElementKind2["enumMemberElement"] = "enum member"; + ScriptElementKind2["variableElement"] = "var"; + ScriptElementKind2["localVariableElement"] = "local var"; + ScriptElementKind2["functionElement"] = "function"; + ScriptElementKind2["localFunctionElement"] = "local function"; + ScriptElementKind2["memberFunctionElement"] = "method"; + ScriptElementKind2["memberGetAccessorElement"] = "getter"; + ScriptElementKind2["memberSetAccessorElement"] = "setter"; + ScriptElementKind2["memberVariableElement"] = "property"; + ScriptElementKind2["memberAccessorVariableElement"] = "accessor"; + ScriptElementKind2["constructorImplementationElement"] = "constructor"; + ScriptElementKind2["callSignatureElement"] = "call"; + ScriptElementKind2["indexSignatureElement"] = "index"; + ScriptElementKind2["constructSignatureElement"] = "construct"; + ScriptElementKind2["parameterElement"] = "parameter"; + ScriptElementKind2["typeParameterElement"] = "type parameter"; + ScriptElementKind2["primitiveType"] = "primitive type"; + ScriptElementKind2["label"] = "label"; + ScriptElementKind2["alias"] = "alias"; + ScriptElementKind2["constElement"] = "const"; + ScriptElementKind2["letElement"] = "let"; + ScriptElementKind2["directory"] = "directory"; + ScriptElementKind2["externalModuleName"] = "external module name"; + ScriptElementKind2["jsxAttribute"] = "JSX attribute"; + ScriptElementKind2["string"] = "string"; + ScriptElementKind2["link"] = "link"; + ScriptElementKind2["linkName"] = "link name"; + ScriptElementKind2["linkText"] = "link text"; + return ScriptElementKind2; +})(ScriptElementKind || {}); +var ScriptElementKindModifier = /* @__PURE__ */ ((ScriptElementKindModifier2) => { + ScriptElementKindModifier2["none"] = ""; + ScriptElementKindModifier2["publicMemberModifier"] = "public"; + ScriptElementKindModifier2["privateMemberModifier"] = "private"; + ScriptElementKindModifier2["protectedMemberModifier"] = "protected"; + ScriptElementKindModifier2["exportedModifier"] = "export"; + ScriptElementKindModifier2["ambientModifier"] = "declare"; + ScriptElementKindModifier2["staticModifier"] = "static"; + ScriptElementKindModifier2["abstractModifier"] = "abstract"; + ScriptElementKindModifier2["optionalModifier"] = "optional"; + ScriptElementKindModifier2["deprecatedModifier"] = "deprecated"; + ScriptElementKindModifier2["dtsModifier"] = ".d.ts"; + ScriptElementKindModifier2["tsModifier"] = ".ts"; + ScriptElementKindModifier2["tsxModifier"] = ".tsx"; + ScriptElementKindModifier2["jsModifier"] = ".js"; + ScriptElementKindModifier2["jsxModifier"] = ".jsx"; + ScriptElementKindModifier2["jsonModifier"] = ".json"; + ScriptElementKindModifier2["dmtsModifier"] = ".d.mts"; + ScriptElementKindModifier2["mtsModifier"] = ".mts"; + ScriptElementKindModifier2["mjsModifier"] = ".mjs"; + ScriptElementKindModifier2["dctsModifier"] = ".d.cts"; + ScriptElementKindModifier2["ctsModifier"] = ".cts"; + ScriptElementKindModifier2["cjsModifier"] = ".cjs"; + return ScriptElementKindModifier2; +})(ScriptElementKindModifier || {}); +var ClassificationTypeNames = /* @__PURE__ */ ((ClassificationTypeNames2) => { + ClassificationTypeNames2["comment"] = "comment"; + ClassificationTypeNames2["identifier"] = "identifier"; + ClassificationTypeNames2["keyword"] = "keyword"; + ClassificationTypeNames2["numericLiteral"] = "number"; + ClassificationTypeNames2["bigintLiteral"] = "bigint"; + ClassificationTypeNames2["operator"] = "operator"; + ClassificationTypeNames2["stringLiteral"] = "string"; + ClassificationTypeNames2["whiteSpace"] = "whitespace"; + ClassificationTypeNames2["text"] = "text"; + ClassificationTypeNames2["punctuation"] = "punctuation"; + ClassificationTypeNames2["className"] = "class name"; + ClassificationTypeNames2["enumName"] = "enum name"; + ClassificationTypeNames2["interfaceName"] = "interface name"; + ClassificationTypeNames2["moduleName"] = "module name"; + ClassificationTypeNames2["typeParameterName"] = "type parameter name"; + ClassificationTypeNames2["typeAliasName"] = "type alias name"; + ClassificationTypeNames2["parameterName"] = "parameter name"; + ClassificationTypeNames2["docCommentTagName"] = "doc comment tag name"; + ClassificationTypeNames2["jsxOpenTagName"] = "jsx open tag name"; + ClassificationTypeNames2["jsxCloseTagName"] = "jsx close tag name"; + ClassificationTypeNames2["jsxSelfClosingTagName"] = "jsx self closing tag name"; + ClassificationTypeNames2["jsxAttribute"] = "jsx attribute"; + ClassificationTypeNames2["jsxText"] = "jsx text"; + ClassificationTypeNames2["jsxAttributeStringLiteralValue"] = "jsx attribute string literal value"; + return ClassificationTypeNames2; +})(ClassificationTypeNames || {}); +var ClassificationType = /* @__PURE__ */ ((ClassificationType3) => { + ClassificationType3[ClassificationType3["comment"] = 1] = "comment"; + ClassificationType3[ClassificationType3["identifier"] = 2] = "identifier"; + ClassificationType3[ClassificationType3["keyword"] = 3] = "keyword"; + ClassificationType3[ClassificationType3["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType3[ClassificationType3["operator"] = 5] = "operator"; + ClassificationType3[ClassificationType3["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType3[ClassificationType3["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType3[ClassificationType3["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType3[ClassificationType3["text"] = 9] = "text"; + ClassificationType3[ClassificationType3["punctuation"] = 10] = "punctuation"; + ClassificationType3[ClassificationType3["className"] = 11] = "className"; + ClassificationType3[ClassificationType3["enumName"] = 12] = "enumName"; + ClassificationType3[ClassificationType3["interfaceName"] = 13] = "interfaceName"; + ClassificationType3[ClassificationType3["moduleName"] = 14] = "moduleName"; + ClassificationType3[ClassificationType3["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType3[ClassificationType3["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType3[ClassificationType3["parameterName"] = 17] = "parameterName"; + ClassificationType3[ClassificationType3["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType3[ClassificationType3["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType3[ClassificationType3["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType3[ClassificationType3["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType3[ClassificationType3["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType3[ClassificationType3["jsxText"] = 23] = "jsxText"; + ClassificationType3[ClassificationType3["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; + ClassificationType3[ClassificationType3["bigintLiteral"] = 25] = "bigintLiteral"; + return ClassificationType3; +})(ClassificationType || {}); // src/services/utilities.ts var scanner = createScanner( @@ -130372,6 +128773,13 @@ function isStringOrRegularExpressionOrTemplateLiteral(kind) { } return false; } +function isStringAndEmptyAnonymousObjectIntersection(type) { + if (!type.isIntersection()) { + return false; + } + const { types, checker } = type; + return types.length === 2 && types[0].flags & 4 /* String */ && checker.isEmptyAnonymousObjectType(types[1]); +} function isPunctuation(kind) { return 18 /* FirstPunctuation */ <= kind && kind <= 78 /* LastPunctuation */; } @@ -130557,7 +128965,7 @@ function getModuleSpecifierResolverHost(program, host) { }; } function moduleResolutionUsesNodeModules(moduleResolution) { - return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */; + return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) { return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0; @@ -130573,7 +128981,7 @@ function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreferenc ); } function makeStringLiteral(text, quotePreference) { - return factory.createStringLiteral(text, quotePreference === QuotePreference.Single); + return factory.createStringLiteral(text, quotePreference === 0 /* Single */); } var QuotePreference = /* @__PURE__ */ ((QuotePreference5) => { QuotePreference5[QuotePreference5["Single"] = 0] = "Single"; @@ -131211,7 +129619,7 @@ function needsParentheses(expression) { return isBinaryExpression(expression) && expression.operatorToken.kind === 27 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression); } function getContextualTypeFromParent(node, checker, contextFlags) { - const { parent: parent2 } = node; + const parent2 = walkUpParenthesizedExpressions(node.parent); switch (parent2.kind) { case 211 /* NewExpression */: return checker.getContextualType(parent2, contextFlags); @@ -131220,7 +129628,7 @@ function getContextualTypeFromParent(node, checker, contextFlags) { return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags); } case 292 /* CaseClause */: - return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0; + return getSwitchedType(parent2, checker); default: return checker.getContextualType(node, contextFlags); } @@ -131489,7 +129897,13 @@ function createPackageJsonInfo(fileName, host) { function createPackageJsonImportFilter(fromFile, preferences, host) { const packageJsons = (host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || getPackageJsonsVisibleToFile(fromFile.fileName, host)).filter((p) => p.parseable); let usesNodeCoreModules; - return { allowsImportingAmbientModule, allowsImportingSourceFile, allowsImportingSpecifier }; + let ambientModuleCache; + let sourceFileCache; + return { + allowsImportingAmbientModule, + allowsImportingSourceFile, + allowsImportingSpecifier + }; function moduleSpecifierIsCoveredByPackageJson(specifier) { const packageName = getNodeModuleRootSpecifier(specifier); for (const packageJson of packageJsons) { @@ -131503,26 +129917,49 @@ function createPackageJsonImportFilter(fromFile, preferences, host) { if (!packageJsons.length || !moduleSymbol.valueDeclaration) { return true; } - const declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); - const declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); - if (typeof declaringNodeModuleName === "undefined") { - return true; + if (!ambientModuleCache) { + ambientModuleCache = /* @__PURE__ */ new Map(); + } else { + const cached = ambientModuleCache.get(moduleSymbol); + if (cached !== void 0) { + return cached; + } } const declaredModuleSpecifier = stripQuotes(moduleSymbol.getName()); if (isAllowedCoreNodeModulesImport(declaredModuleSpecifier)) { + ambientModuleCache.set(moduleSymbol, true); + return true; + } + const declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); + const declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); + if (typeof declaringNodeModuleName === "undefined") { + ambientModuleCache.set(moduleSymbol, true); return true; } - return moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); + const result = moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); + ambientModuleCache.set(moduleSymbol, result); + return result; } function allowsImportingSourceFile(sourceFile, moduleSpecifierResolutionHost) { if (!packageJsons.length) { return true; } + if (!sourceFileCache) { + sourceFileCache = /* @__PURE__ */ new Map(); + } else { + const cached = sourceFileCache.get(sourceFile); + if (cached !== void 0) { + return cached; + } + } const moduleSpecifier = getNodeModulesPackageNameFromFileName(sourceFile.fileName, moduleSpecifierResolutionHost); if (!moduleSpecifier) { + sourceFileCache.set(sourceFile, true); return true; } - return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + const result = moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + sourceFileCache.set(sourceFile, result); + return result; } function allowsImportingSpecifier(moduleSpecifier) { if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) { @@ -131670,10 +130107,13 @@ function needsNameFromDeclaration(symbol) { return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */); } function getDefaultLikeExportNameFromDeclaration(symbol) { - return firstDefined(symbol.declarations, (d) => { - var _a2; - return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : void 0; - }); + return firstDefined( + symbol.declarations, + (d) => { + var _a2, _b; + return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text; + } + ); } function getSymbolParentOrFail(symbol) { var _a2; @@ -131742,6 +130182,64 @@ function jsxModeNeedsExplicitImport(jsx) { function isSourceFileFromLibrary(program, node) { return program.isSourceFileFromExternalLibrary(node) || program.isSourceFileDefaultLibrary(node); } +function newCaseClauseTracker(checker, clauses) { + const existingStrings = /* @__PURE__ */ new Set(); + const existingNumbers = /* @__PURE__ */ new Set(); + const existingBigInts = /* @__PURE__ */ new Set(); + for (const clause of clauses) { + if (!isDefaultClause(clause)) { + const expression = skipParentheses(clause.expression); + if (isLiteralExpression(expression)) { + switch (expression.kind) { + case 14 /* NoSubstitutionTemplateLiteral */: + case 10 /* StringLiteral */: + existingStrings.add(expression.text); + break; + case 8 /* NumericLiteral */: + existingNumbers.add(parseInt(expression.text)); + break; + case 9 /* BigIntLiteral */: + const parsedBigInt = parseBigInt(endsWith(expression.text, "n") ? expression.text.slice(0, -1) : expression.text); + if (parsedBigInt) { + existingBigInts.add(pseudoBigIntToString(parsedBigInt)); + } + break; + } + } else { + const symbol = checker.getSymbolAtLocation(clause.expression); + if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { + const enumValue = checker.getConstantValue(symbol.valueDeclaration); + if (enumValue !== void 0) { + addValue(enumValue); + } + } + } + } + } + return { + addValue, + hasValue + }; + function addValue(value) { + switch (typeof value) { + case "string": + existingStrings.add(value); + break; + case "number": + existingNumbers.add(value); + } + } + function hasValue(value) { + switch (typeof value) { + case "string": + return existingStrings.has(value); + case "number": + return existingNumbers.has(value); + case "object": + return existingBigInts.has(pseudoBigIntToString(value)); + } + } +} // src/services/exportInfoMap.ts var ImportKind = /* @__PURE__ */ ((ImportKind2) => { @@ -131996,13 +130494,25 @@ function forEachExternalModuleToImportFrom(program, host, preferences, useAutoIm const autoImportProvider = useAutoImportProvider && ((_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host)); if (autoImportProvider) { const start2 = timestamp(); - forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => cb( - module2, - file, - autoImportProvider, - /*isFromPackageJson*/ - true - )); + const checker = program.getTypeChecker(); + forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => { + if (file && !program.getSourceFile(file.fileName) || !file && !checker.resolveName( + module2.name, + /*location*/ + void 0, + 1536 /* Module */, + /*excludeGlobals*/ + false + )) { + cb( + module2, + file, + autoImportProvider, + /*isFromPackageJson*/ + true + ); + } + }); (_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start2}`); } } @@ -137069,7 +135579,8 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h options.triggerCharacter, options.triggerKind, cancellationToken, - formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host) + formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host), + options.includeSymbol ); } function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) { @@ -142962,6 +141473,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre sourceFile, symbol, symbolName2, + moduleSymbol, /*isJsxTagName*/ false, program, @@ -142973,7 +141485,6 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre const fix = getImportFixForSymbol( sourceFile, Debug.checkDefined(exportInfo), - moduleSymbol, program, /*position*/ void 0, @@ -142990,13 +141501,13 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre var _a2, _b; const { fix, symbolName: symbolName2 } = info; switch (fix.kind) { - case ImportFixKind.UseNamespace: + case 0 /* UseNamespace */: addToNamespace.push(fix); break; - case ImportFixKind.JsdocTypeImport: + case 1 /* JsdocTypeImport */: importType.push(fix); break; - case ImportFixKind.AddToExisting: { + case 2 /* AddToExisting */: { const { importClauseOrBindingPattern, importKind, addAsTypeOnly } = fix; const key = String(getNodeId(importClauseOrBindingPattern)); let entry = addToExisting.get(key); @@ -143015,7 +141526,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre } break; } - case ImportFixKind.AddNew: { + case 3 /* AddNew */: { const { moduleSpecifier, importKind, useRequire, addAsTypeOnly } = fix; const entry = getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly); Debug.assert(entry.useRequire === useRequire, "(Add new) Tried to add an `import` and a `require` for the same module"); @@ -143036,7 +141547,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre } break; } - case ImportFixKind.PromoteTypeOnly: + case 4 /* PromoteTypeOnly */: break; default: Debug.assertNever(fix, `fix wasn't never - got kind ${fix.kind}`); @@ -143063,13 +141574,13 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre namespaceLikeImport: void 0, useRequire }; - if (importKind === 1 /* Default */ && addAsTypeOnly === AddAsTypeOnly.Required) { + if (importKind === 1 /* Default */ && addAsTypeOnly === 2 /* Required */) { if (typeOnlyEntry) return typeOnlyEntry; newImports.set(typeOnlyKey, newEntry); return newEntry; } - if (addAsTypeOnly === AddAsTypeOnly.Allowed && (typeOnlyEntry || nonTypeOnlyEntry)) { + if (addAsTypeOnly === 1 /* Allowed */ && (typeOnlyEntry || nonTypeOnlyEntry)) { return typeOnlyEntry || nonTypeOnlyEntry; } if (nonTypeOnlyEntry) { @@ -143110,7 +141621,8 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre quotePreference, defaultImport, namedImports && arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })), - namespaceLikeImport + namespaceLikeImport, + compilerOptions ); newDeclarations = combine(newDeclarations, declarations); }); @@ -143151,27 +141663,19 @@ function createImportSpecifierResolver(importingFile, program, host, preferences return result && { ...result, computedWithoutCacheCount }; } } -var ImportFixKind = /* @__PURE__ */ ((ImportFixKind2) => { - ImportFixKind2[ImportFixKind2["UseNamespace"] = 0] = "UseNamespace"; - ImportFixKind2[ImportFixKind2["JsdocTypeImport"] = 1] = "JsdocTypeImport"; - ImportFixKind2[ImportFixKind2["AddToExisting"] = 2] = "AddToExisting"; - ImportFixKind2[ImportFixKind2["AddNew"] = 3] = "AddNew"; - ImportFixKind2[ImportFixKind2["PromoteTypeOnly"] = 4] = "PromoteTypeOnly"; - return ImportFixKind2; -})(ImportFixKind || {}); -var AddAsTypeOnly = /* @__PURE__ */ ((AddAsTypeOnly2) => { - AddAsTypeOnly2[AddAsTypeOnly2["Allowed"] = 1] = "Allowed"; - AddAsTypeOnly2[AddAsTypeOnly2["Required"] = 2] = "Required"; - AddAsTypeOnly2[AddAsTypeOnly2["NotAllowed"] = 4] = "NotAllowed"; - return AddAsTypeOnly2; -})(AddAsTypeOnly || {}); -function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { +function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { const compilerOptions = program.getCompilerOptions(); - const exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, isJsxTagName, program, host, preferences, cancellationToken); - Debug.assertIsDefined(exportInfos); + let exportInfos; + if (exportMapKey) { + exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey); + Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified exportMapKey"); + } else { + exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, symbolName2, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, moduleSymbol, isJsxTagName, program, host, preferences, cancellationToken); + Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified symbol / moduleSymbol"); + } const useRequire = shouldUseRequire(sourceFile, program); const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); - const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); + const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); return { moduleSpecifier: fix.moduleSpecifier, codeAction: codeFixActionToCodeAction(codeActionForFix( @@ -143193,23 +141697,22 @@ function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, ho const includeSymbolNameInDescription = symbolName2 !== symbolToken.text; return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences)); } -function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { - Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol"); +function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); } function codeFixActionToCodeAction({ description: description2, changes, commands }) { return { description: description2, changes, commands }; } -function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, preferCapitalized, program, host, preferences, cancellationToken) { +function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSymbol, preferCapitalized, program, host, preferences, cancellationToken) { const getChecker = createGetChecker(program, host); return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => { - if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol) { + if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol && info.some((i) => i.moduleSymbol === moduleSymbol || i.symbol.parent === moduleSymbol)) { return info; } }); } -function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) { +function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program, host) { var _a2, _b; const compilerOptions = program.getCompilerOptions(); const mainProgramInfo = getInfoWithChecker( @@ -143231,7 +141734,7 @@ function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) { if (defaultInfo && skipAlias(defaultInfo.symbol, checker) === symbol) { return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; } - const named = checker.tryGetMemberInModuleExportsAndProperties(symbol.name, moduleSymbol); + const named = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); if (named && skipAlias(named, checker) === symbol) { return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0 /* Named */, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; } @@ -143297,7 +141800,7 @@ function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, sym if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2 /* Error */) { return 2 /* Required */; } - if ((compilerOptions.isolatedModules && compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { + if (importNameElisionDisabled(compilerOptions) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { return 2 /* Required */; } return 1 /* Allowed */; @@ -143781,7 +142284,14 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy insertImports( changes, sourceFile, - getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport), + getDeclarations( + moduleSpecifier, + quotePreference, + defaultImport, + namedImports, + namespaceLikeImport, + compilerOptions + ), /*blankLineBetween*/ true, preferences @@ -143805,7 +142315,7 @@ function getModuleSpecifierText(promotedDeclaration) { return promotedDeclaration.kind === 268 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) { - const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax; + const convertExistingToTypeOnly = importNameElisionDisabled(compilerOptions); switch (aliasDeclaration.kind) { case 273 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { @@ -143879,7 +142389,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor } const promoteFromTypeOnly2 = clause.isTypeOnly && some([defaultImport, ...namedImports], (i) => (i == null ? void 0 : i.addAsTypeOnly) === 4 /* NotAllowed */); const existingSpecifiers = clause.namedBindings && ((_a2 = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a2.elements); - const convertExistingToTypeOnly = promoteFromTypeOnly2 && (compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax); + const convertExistingToTypeOnly = promoteFromTypeOnly2 && importNameElisionDisabled(compilerOptions); if (defaultImport) { Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " }); @@ -143963,11 +142473,11 @@ function getImportTypePrefix(moduleSpecifier, quotePreference) { function needsTypeOnly({ addAsTypeOnly }) { return addAsTypeOnly === 2 /* Required */; } -function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport) { +function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions) { const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference); let statements; if (defaultImport !== void 0 || (namedImports == null ? void 0 : namedImports.length)) { - const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly); + const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || compilerOptions.verbatimModuleSyntax && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */); statements = combine(statements, makeImport( defaultImport && factory.createIdentifier(defaultImport.name), namedImports == null ? void 0 : namedImports.map(({ addAsTypeOnly, name }) => factory.createImportSpecifier( @@ -144564,7 +143074,7 @@ function tryGetExportDeclaration(sourceFile, isTypeOnly) { } function updateExport(changes, program, sourceFile, node, names) { const namedExports = node.exportClause && isNamedExports(node.exportClause) ? node.exportClause.elements : factory.createNodeArray([]); - const allowTypeModifier = !node.isTypeOnly && !!(program.getCompilerOptions().isolatedModules || find(namedExports, (e) => e.isTypeOnly)); + const allowTypeModifier = !node.isTypeOnly && !!(getIsolatedModules(program.getCompilerOptions()) || find(namedExports, (e) => e.isTypeOnly)); changes.replaceNode( sourceFile, node, @@ -144596,7 +143106,7 @@ function createExport(changes, program, sourceFile, names) { factory.createNamedExports(createExportSpecifiers( names, /*allowTypeModifier*/ - !!program.getCompilerOptions().isolatedModules + getIsolatedModules(program.getCompilerOptions()) )), /*moduleSpecifier*/ void 0, @@ -145565,7 +144075,7 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ } if (isObjectLiteralType(type)) { const props = map(checker.getPropertiesOfType(type), (prop) => { - const initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration), enclosingDeclaration) : createUndefined(); + const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), enclosingDeclaration); return factory.createPropertyAssignment(prop.name, initializer); }); return factory.createObjectLiteralExpression( @@ -148599,13 +147109,7 @@ function createMethodImplementingSignatures(checker, context, enclosingDeclarati function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) { if (length(signatures)) { const type = checker.getUnionType(map(signatures, checker.getReturnTypeOfSignature)); - return checker.typeToTypeNode( - type, - enclosingDeclaration, - /*flags*/ - void 0, - getNoopSymbolTrackerWithResolver(context) - ); + return checker.typeToTypeNode(type, enclosingDeclaration, 1 /* NoTruncation */, getNoopSymbolTrackerWithResolver(context)); } } function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType, quotePreference, body) { @@ -148884,7 +147388,14 @@ function updatePropertyDeclaration(changeTracker, file, declaration, type, field changeTracker.replaceNode(file, declaration, property); } function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { - const assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); + let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); + if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) { + if (assignment === declaration) + assignment = factory.cloneNode(assignment); + assignment.modifiers = void 0; + assignment.questionToken = void 0; + assignment.exclamationToken = void 0; + } changeTracker.replacePropertyAssignment(file, declaration, assignment); } function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { @@ -149825,6 +148336,7 @@ var SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => { SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport"; return SymbolOriginInfoKind2; @@ -149842,7 +148354,7 @@ function originIsResolvedExport(origin) { return !!(origin && origin.kind === 32 /* ResolvedExport */); } function originIncludesSymbolName(origin) { - return originIsExport(origin) || originIsResolvedExport(origin); + return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin); } function originIsPackageJsonImport(origin) { return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson; @@ -149862,6 +148374,9 @@ function originIsObjectLiteralMethod(origin) { function originIsIgnore(origin) { return !!(origin && origin.kind & 256 /* Ignore */); } +function originIsComputedPropertyName(origin) { + return !!(origin && origin.kind & 512 /* ComputedPropertyName */); +} function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) { var _a2, _b, _c; const start2 = timestamp(); @@ -149904,7 +148419,7 @@ function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, return result2 || (needsFullResolution ? "failed" : "skipped"); } } -function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) { +function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) { var _a2; const { previousToken } = getRelevantTokens(position, sourceFile); if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) { @@ -149926,7 +148441,7 @@ function getCompletionsAtPosition(host, program, log, sourceFile, position, pref } else { incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear(); } - const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences); + const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol); if (stringCompletions) { return stringCompletions; } @@ -149950,19 +148465,19 @@ function getCompletionsAtPosition(host, program, log, sourceFile, position, pref return void 0; } switch (completionData.kind) { - case CompletionDataKind.Data: - const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position); + case 0 /* Data */: + const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol); if (response == null ? void 0 : response.isIncomplete) { incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response); } return response; - case CompletionDataKind.JsDocTagName: + case 1 /* JsDocTagName */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocTagNameCompletions()); - case CompletionDataKind.JsDocTag: + case 2 /* JsDocTag */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocTagCompletions()); - case CompletionDataKind.JsDocParameterName: + case 3 /* JsDocParameterName */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocParameterNameCompletions(completionData.tag)); - case CompletionDataKind.Keywords: + case 4 /* Keywords */: return specificKeywordCompletionInfo(completionData.keywordCompletions, completionData.isNewIdentifierLocation); default: return Debug.assertNever(completionData); @@ -150065,7 +148580,7 @@ function specificKeywordCompletionInfo(entries, isNewIdentifierLocation) { } function keywordCompletionData(keywordFilters, filterOutTsOnlyKeywords, isNewIdentifierLocation) { return { - kind: CompletionDataKind.Keywords, + kind: 4 /* Keywords */, keywordCompletions: getKeywordCompletions(keywordFilters, filterOutTsOnlyKeywords), isNewIdentifierLocation }; @@ -150081,7 +148596,7 @@ function keywordFiltersFromSyntaxKind(keywordCompletion) { function getOptionalReplacementSpan(location) { return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0; } -function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) { +function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) { const { symbols, contextToken, @@ -150155,7 +148670,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, - isRightOfOpenTag + isRightOfOpenTag, + includeSymbol ); if (keywordFilters !== 0 /* None */) { for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) { @@ -150295,64 +148811,6 @@ function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options, } return void 0; } -function newCaseClauseTracker(checker, clauses) { - const existingStrings = /* @__PURE__ */ new Set(); - const existingNumbers = /* @__PURE__ */ new Set(); - const existingBigInts = /* @__PURE__ */ new Set(); - for (const clause of clauses) { - if (!isDefaultClause(clause)) { - if (isLiteralExpression(clause.expression)) { - const expression = clause.expression; - switch (expression.kind) { - case 14 /* NoSubstitutionTemplateLiteral */: - case 10 /* StringLiteral */: - existingStrings.add(expression.text); - break; - case 8 /* NumericLiteral */: - existingNumbers.add(parseInt(expression.text)); - break; - case 9 /* BigIntLiteral */: - const parsedBigInt = parseBigInt(endsWith(expression.text, "n") ? expression.text.slice(0, -1) : expression.text); - if (parsedBigInt) { - existingBigInts.add(pseudoBigIntToString(parsedBigInt)); - } - break; - } - } else { - const symbol = checker.getSymbolAtLocation(clause.expression); - if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { - const enumValue = checker.getConstantValue(symbol.valueDeclaration); - if (enumValue !== void 0) { - addValue(enumValue); - } - } - } - } - } - return { - addValue, - hasValue - }; - function addValue(value) { - switch (typeof value) { - case "string": - existingStrings.add(value); - break; - case "number": - existingNumbers.add(value); - } - } - function hasValue(value) { - switch (typeof value) { - case "string": - return existingStrings.has(value); - case "number": - return existingNumbers.has(value); - case "object": - return existingBigInts.has(pseudoBigIntToString(value)); - } - } -} function typeNodeToExpression(typeNode, languageVersion, quotePreference) { switch (typeNode.kind) { case 180 /* TypeReference */: @@ -150400,9 +148858,9 @@ function entityNameToExpression(entityName, languageVersion, quotePreference) { } function isMemberCompletionKind(kind) { switch (kind) { - case CompletionKind.ObjectPropertyDeclaration: - case CompletionKind.MemberLike: - case CompletionKind.PropertyAccess: + case 0 /* ObjectPropertyDeclaration */: + case 3 /* MemberLike */: + case 2 /* PropertyAccess */: return true; default: return false; @@ -150462,7 +148920,7 @@ function completionNameForLiteral(sourceFile, preferences, literal) { function createCompletionEntryForLiteral(sourceFile, preferences, literal) { return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } -function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { +function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) { let insertText; let replacementSpan = getReplacementSpanForContextToken(replacementToken); let data; @@ -150506,7 +148964,9 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, } awaitText += `(await ${propertyAccessToConvert.expression.getText()})`; insertText = needsConvertPropertyAccess ? `${awaitText}${insertText}` : `${awaitText}${insertQuestionDot ? "?." : "."}${insertText}`; - replacementSpan = createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end); + const isInAwaitExpression = tryCast(propertyAccessToConvert.parent, isAwaitExpression); + const wrapNode = isInAwaitExpression ? propertyAccessToConvert.parent : propertyAccessToConvert.expression; + replacementSpan = createTextSpanFromBounds(wrapNode.getStart(sourceFile), propertyAccessToConvert.end); } if (originIsResolvedExport(origin)) { sourceDisplay = [textPart(origin.moduleSpecifier)]; @@ -150518,7 +148978,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) { hasAction = true; } - if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) { + if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) { let importAdder; ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext)); sortText = SortText.ClassMemberSnippets; @@ -150540,7 +149000,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces"; const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) { - if (type.flags & 402653316 /* StringLike */ || type.flags & 1048576 /* Union */ && every(type.types, (type2) => !!(type2.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)))) { + if (type.flags & 402653316 /* StringLike */ || type.flags & 1048576 /* Union */ && every(type.types, (type2) => !!(type2.flags & (402653316 /* StringLike */ | 32768 /* Undefined */) || isStringAndEmptyAnonymousObjectIntersection(type2)))) { insertText = `${escapeSnippetText(name)}=${quote(sourceFile, preferences, "$1")}`; isSnippet = true; } else { @@ -150574,7 +149034,8 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, isSnippet, isPackageJsonImport: originIsPackageJsonImport(origin) || void 0, isImportStatementCompletion: !!importStatementCompletion || void 0, - data + data, + ...includeSymbol ? { symbol } : void 0 }; } function isClassLikeMemberCompletion(symbol, location, sourceFile) { @@ -150642,7 +149103,7 @@ function getEntryForMemberCompletion(host, program, options, preferences, name, if (isAbstract) { requiredModifiers |= 256 /* Abstract */; } - if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) { + if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) { requiredModifiers |= 16384 /* Override */; } if (!completionNodes.length) { @@ -150948,6 +149409,7 @@ function originToCompletionEntryData(origin) { if (originIsResolvedExport(origin)) { const resolvedData = { exportName: origin.exportName, + exportMapKey: origin.exportMapKey, moduleSpecifier: origin.moduleSpecifier, ambientModuleName, fileName: origin.fileName, @@ -150971,6 +149433,7 @@ function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbo const resolvedOrigin = { kind: 32 /* ResolvedExport */, exportName: data.exportName, + exportMapKey: data.exportMapKey, moduleSpecifier: data.moduleSpecifier, symbolName: completionName, fileName: data.fileName, @@ -150994,7 +149457,7 @@ function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbo } function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) { const replacementSpan = importStatementCompletion.replacementSpan; - const quotedModuleSpecifier = quote(sourceFile, preferences, origin.moduleSpecifier); + const quotedModuleSpecifier = quote(sourceFile, preferences, escapeSnippetText(origin.moduleSpecifier)); const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */; const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : ""; const importKind = ts_codefix_exports.getImportKind( @@ -151042,7 +149505,7 @@ function getSourceFromOrigin(origin) { return "TypeOnlyAlias/" /* TypeOnlyAlias */; } } -function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { +function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) { var _a2; const start2 = timestamp(); const variableDeclaration = getVariableDeclaration(location); @@ -151053,7 +149516,7 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con const symbol = symbols[i]; const origin = symbolToOriginInfoMap == null ? void 0 : symbolToOriginInfoMap[i]; const info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected); - if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === CompletionKind.Global && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) { + if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 /* Global */ && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) { continue; } const { name, needsConvertPropertyAccess } = info; @@ -151082,7 +149545,8 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con kind, formatContext, isJsxIdentifierExpected, - isRightOfOpenTag + isRightOfOpenTag, + includeSymbol ); if (!entry) { continue; @@ -151192,7 +149656,7 @@ function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entr if (!completionData) { return { type: "none" }; } - if (completionData.kind !== CompletionDataKind.Data) { + if (completionData.kind !== 0 /* Data */) { return { type: "request", request: completionData }; } const { symbols, literals, location, completionKind, symbolToOriginInfoMap, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } = completionData; @@ -151218,13 +149682,13 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId, case "request": { const { request } = symbolCompletion; switch (request.kind) { - case CompletionDataKind.JsDocTagName: + case 1 /* JsDocTagName */: return ts_JsDoc_exports.getJSDocTagNameCompletionDetails(name); - case CompletionDataKind.JsDocTag: + case 2 /* JsDocTag */: return ts_JsDoc_exports.getJSDocTagCompletionDetails(name); - case CompletionDataKind.JsDocParameterName: + case 3 /* JsDocParameterName */: return ts_JsDoc_exports.getJSDocParameterNameCompletionDetails(name); - case CompletionDataKind.Keywords: + case 4 /* Keywords */: return some(request.keywordCompletions, (c) => c.name === name) ? createSimpleDetails(name, "keyword" /* keyword */, 5 /* keyword */) : void 0; default: return Debug.assertNever(request); @@ -151233,7 +149697,8 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId, case "symbol": { const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion; const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken); - return createCompletionDetailsForSymbol(symbol, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay); + const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name; + return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay); } case "literal": { const { literal } = symbolCompletion; @@ -151284,12 +149749,12 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId, function createSimpleDetails(name, kind, kind2) { return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]); } -function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) { +function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) { const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken( cancellationToken, (checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */) ); - return createCompletionDetails(symbol.name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay); + return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay); } function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) { return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source }; @@ -151349,6 +149814,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo const { moduleSpecifier, codeAction } = ts_codefix_exports.getImportCompletionAction( targetSymbol, moduleSymbol, + data == null ? void 0 : data.exportMapKey, sourceFile, name, isJsxOpeningTagName, @@ -151366,14 +149832,6 @@ function getCompletionEntrySymbol(program, log, sourceFile, position, entryId, h const completion = getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences); return completion.type === "symbol" ? completion.symbol : void 0; } -var CompletionDataKind = /* @__PURE__ */ ((CompletionDataKind2) => { - CompletionDataKind2[CompletionDataKind2["Data"] = 0] = "Data"; - CompletionDataKind2[CompletionDataKind2["JsDocTagName"] = 1] = "JsDocTagName"; - CompletionDataKind2[CompletionDataKind2["JsDocTag"] = 2] = "JsDocTag"; - CompletionDataKind2[CompletionDataKind2["JsDocParameterName"] = 3] = "JsDocParameterName"; - CompletionDataKind2[CompletionDataKind2["Keywords"] = 4] = "Keywords"; - return CompletionDataKind2; -})(CompletionDataKind || {}); var CompletionKind = /* @__PURE__ */ ((CompletionKind2) => { CompletionKind2[CompletionKind2["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; CompletionKind2[CompletionKind2["Global"] = 1] = "Global"; @@ -151593,7 +150051,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, break; case 291 /* JsxExpression */: case 290 /* JsxSpreadAttribute */: - if (previousToken.kind === 19 /* CloseBraceToken */ || (previousToken.kind === 79 /* Identifier */ || previousToken.parent.kind === 288 /* JsxAttribute */)) { + if (previousToken.kind === 19 /* CloseBraceToken */ || previousToken.kind === 79 /* Identifier */ && previousToken.parent.kind === 288 /* JsxAttribute */) { isJsxIdentifierExpected = true; } break; @@ -152055,16 +150513,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) { return; } - const firstImportableExportInfo = find(info, isImportableExportInfo); - if (!firstImportableExportInfo) { + info = filter(info, isImportableExportInfo); + if (!info.length) { return; } const result = context.tryResolve(info, isFromAmbientModule) || {}; if (result === "failed") return; - let exportInfo2 = firstImportableExportInfo, moduleSpecifier; + let exportInfo2 = info[0], moduleSpecifier; if (result !== "skipped") { - ({ exportInfo: exportInfo2 = firstImportableExportInfo, moduleSpecifier } = result); + ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result); } const isDefaultExport = exportInfo2.exportKind === 1 /* Default */; const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo2.symbol) || exportInfo2.symbol; @@ -152228,7 +150686,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return false; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) { - return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken2)), position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2))); + return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2))); } function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() { const typeLiteralNode = tryGetTypeLiteralNode(contextToken); @@ -152403,6 +150861,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type); }); symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags)); + forEach(symbols, (symbol, index) => { + const declaration = symbol == null ? void 0 : symbol.valueDeclaration; + if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) { + const origin = { + kind: 512 /* ComputedPropertyName */, + symbolName: typeChecker.symbolToString(symbol) + }; + symbolToOriginInfoMap[index] = origin; + } + }); } return 1 /* Success */; } @@ -152787,7 +151255,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js } switch (kind) { case 3 /* MemberLike */: - return void 0; + return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0; case 0 /* ObjectPropertyDeclaration */: return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; case 2 /* PropertyAccess */: @@ -152940,7 +151408,7 @@ function getPropertiesForObjectExpression(contextualType, completionsType, obj, function getApparentProperties(type, node, checker) { if (!type.isUnion()) return type.getApparentProperties(); - return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 131068 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || typeHasCallOrConstructSignatures(memberType, checker) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())))); + return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 134348796 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())))); } function containsNonPublicProperties(props) { return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 24 /* NonPublicAccessibilityModifier */)); @@ -153288,7 +151756,7 @@ function createNameAndKindSet() { values: map2.values.bind(map2) }; } -function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) { +function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) { if (isInReferenceComment(sourceFile, position)) { const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host); return entries && convertPathCompletions(entries); @@ -153297,18 +151765,18 @@ function getStringLiteralCompletions(sourceFile, position, contextToken, options if (!contextToken || !isStringLiteralLike(contextToken)) return void 0; const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences); - return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position); + return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol); } } -function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) { +function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) { if (completion === void 0) { return void 0; } const optionalReplacementSpan = createTextSpanFromStringLiteralLikeContent(contextToken); switch (completion.kind) { - case StringLiteralCompletionKind.Paths: + case 0 /* Paths */: return convertPathCompletions(completion.paths); - case StringLiteralCompletionKind.Properties: { + case 1 /* Properties */: { const entries = createSortedArray(); getCompletionEntriesFromSymbols( completion.symbols, @@ -153326,11 +151794,32 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h preferences, options, /*formatContext*/ - void 0 + void 0, + /*isTypeOnlyLocation */ + void 0, + /*propertyAccessToConvert*/ + void 0, + /*jsxIdentifierExpected*/ + void 0, + /*isJsxInitializer*/ + void 0, + /*importStatementCompletion*/ + void 0, + /*recommendedCompletion*/ + void 0, + /*symbolToOriginInfoMap*/ + void 0, + /*symbolToSortTextMap*/ + void 0, + /*isJsxIdentifierExpected*/ + void 0, + /*isRightOfOpenTag*/ + void 0, + includeSymbol ); return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries }; } - case StringLiteralCompletionKind.Types: { + case 2 /* Types */: { const entries = completion.types.map((type) => ({ name: type.value, kindModifiers: "" /* none */, @@ -153352,16 +151841,16 @@ function getStringLiteralCompletionDetails(name, sourceFile, position, contextTo } function stringLiteralCompletionDetails(name, location, completion, sourceFile, checker, cancellationToken) { switch (completion.kind) { - case StringLiteralCompletionKind.Paths: { + case 0 /* Paths */: { const match = find(completion.paths, (p) => p.name === name); return match && createCompletionDetails(name, kindModifiersFromExtension(match.extension), match.kind, [textPart(name)]); } - case StringLiteralCompletionKind.Properties: { + case 1 /* Properties */: { const match = find(completion.symbols, (s) => s.name === name); - return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken); + return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken); } - case StringLiteralCompletionKind.Types: - return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "type" /* typeElement */, [textPart(name)]) : void 0; + case 2 /* Types */: + return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0; default: return Debug.assertNever(completion); } @@ -153406,12 +151895,6 @@ function kindModifiersFromExtension(extension) { return Debug.assertNever(extension); } } -var StringLiteralCompletionKind = /* @__PURE__ */ ((StringLiteralCompletionKind2) => { - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Paths"] = 0] = "Paths"; - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Properties"] = 1] = "Properties"; - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Types"] = 2] = "Types"; - return StringLiteralCompletionKind2; -})(StringLiteralCompletionKind || {}); function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host, preferences) { const parent2 = walkUpParentheses(node.parent); switch (parent2.kind) { @@ -153450,7 +151933,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) { return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent); } - return fromContextualType(); + return fromContextualType() || fromContextualType(0 /* None */); case 209 /* ElementAccessExpression */: { const { expression, argumentExpression } = parent2; if (node === skipParentheses(argumentExpression)) { @@ -153469,11 +151952,23 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck case 275 /* ExportDeclaration */: case 280 /* ExternalModuleReference */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) }; + case 292 /* CaseClause */: + const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses); + const contextualTypes = fromContextualType(); + if (!contextualTypes) { + return; + } + const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); + return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; default: return fromContextualType(); } - function fromContextualType() { - return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, 4 /* Completions */)), isNewIdentifier: false }; + function fromContextualType(contextFlags = 4 /* Completions */) { + const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); + if (!types.length) { + return; + } + return { kind: 2 /* Types */, types, isNewIdentifier: false }; } } function walkUpParentheses(node) { @@ -153564,12 +152059,12 @@ function getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, comp const mode = isStringLiteralLike(node) ? getModeForUsageLocation(sourceFile, node) : void 0; const scriptPath = sourceFile.path; const scriptDirectory = getDirectoryPath(scriptPath); - const extensionOptions = getExtensionOptions(compilerOptions, ReferenceKind.ModuleSpecifier, sourceFile, preferences, mode); + const extensionOptions = getExtensionOptions(compilerOptions, 1 /* ModuleSpecifier */, sourceFile, typeChecker, preferences, mode); return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, compilerOptions, host, extensionOptions, typeChecker); } -function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, preferences, resolutionMode) { +function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, typeChecker, preferences, resolutionMode) { return { - extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions)), + extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker)), referenceKind, importingSourceFile, endingPreference: preferences == null ? void 0 : preferences.importModuleSpecifierEnding, @@ -153599,8 +152094,17 @@ function getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, c ).values()); } } -function getSupportedExtensionsForModuleResolution(compilerOptions) { - const extensions = getSupportedExtensions(compilerOptions); +function getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker) { + const ambientModulesExtensions = !typeChecker ? [] : mapDefined( + typeChecker.getAmbientModules(), + (module2) => { + const name = module2.name.slice(1, -1); + if (!name.startsWith("*.") || name.includes("/")) + return; + return name.slice(1); + } + ); + const extensions = [...getSupportedExtensions(compilerOptions), ambientModulesExtensions]; const moduleResolution = getEmitModuleResolutionKind(compilerOptions); return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) : extensions; } @@ -153627,11 +152131,6 @@ function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment exclude ).values())); } -var ReferenceKind = /* @__PURE__ */ ((ReferenceKind2) => { - ReferenceKind2[ReferenceKind2["Filename"] = 0] = "Filename"; - ReferenceKind2[ReferenceKind2["ModuleSpecifier"] = 1] = "ModuleSpecifier"; - return ReferenceKind2; -})(ReferenceKind || {}); function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, extensionOptions, host, moduleSpecifierIsRelative, exclude, result = createNameAndKindSet()) { var _a2; if (fragment === void 0) { @@ -155401,7 +153900,7 @@ var Core; ) || originalSymbol; const searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; const result = []; - const state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : SpecialSearchKind.None, checker, cancellationToken, searchMeaning, options, result); + const state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); const exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) || !symbol.declarations ? void 0 : find(symbol.declarations, isExportSpecifier); if (exportSpecifier) { getReferencesAtExportSpecifier( @@ -155457,14 +153956,14 @@ var Core; switch (node.kind) { case 173 /* Constructor */: case 135 /* ConstructorKeyword */: - return SpecialSearchKind.Constructor; + return 1 /* Constructor */; case 79 /* Identifier */: if (isClassLike(node.parent)) { Debug.assert(node.parent.name === node); - return SpecialSearchKind.Class; + return 2 /* Class */; } default: - return SpecialSearchKind.None; + return 0 /* None */; } } function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, useLocalSymbolForExportSpecifier) { @@ -157361,6 +155860,7 @@ var jsDocTagNames = [ "module", "name", "namespace", + "overload", "override", "package", "param", @@ -160076,12 +158576,7 @@ function filterImport(i, moduleSpecifier, keep) { return defaultImport || namedBindings ? factory.createImportDeclaration( /*modifiers*/ void 0, - factory.createImportClause( - /*isTypeOnly*/ - false, - defaultImport, - namedBindings - ), + factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings), moduleSpecifier, /*assertClause*/ void 0 @@ -160787,6 +159282,7 @@ function convertToBlock(body) { if (isExpression(body)) { const returnStatement = factory.createReturnStatement(body); const file = body.getSourceFile(); + setTextRange(returnStatement, body); suppressLeadingAndTrailingTrivia(returnStatement); copyTrailingAsLeadingComments( body, @@ -162392,10 +160888,10 @@ function getPossibleExtractions(targetRange, context) { const scopeDescription = isFunctionLikeDeclaration(scope) ? getDescriptionForFunctionLikeDeclaration(scope) : isClassLike(scope) ? getDescriptionForClassLikeDeclaration(scope) : getDescriptionForModuleLikeDeclaration(scope); let functionDescription; let constantDescription; - if (scopeDescription === SpecialScope.Global) { + if (scopeDescription === 1 /* Global */) { functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "global"]); constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "global"]); - } else if (scopeDescription === SpecialScope.Module) { + } else if (scopeDescription === 0 /* Module */) { functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "module"]); constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "module"]); } else { @@ -162461,13 +160957,8 @@ function getDescriptionForClassLikeDeclaration(scope) { return scope.kind === 260 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 265 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global; + return scope.kind === 265 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } -var SpecialScope = /* @__PURE__ */ ((SpecialScope2) => { - SpecialScope2[SpecialScope2["Module"] = 0] = "Module"; - SpecialScope2[SpecialScope2["Global"] = 1] = "Global"; - return SpecialScope2; -})(SpecialScope || {}); function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations, range, context) { const checker = context.program.getTypeChecker(); const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); @@ -162499,7 +160990,7 @@ function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParame typeNode ); parameters.push(paramDecl); - if (usage.usage === Usage.Write) { + if (usage.usage === 2 /* Write */) { (writes || (writes = [])).push(usage); } callArguments.push(factory.createIdentifier(name)); @@ -163151,11 +161642,6 @@ function isReadonlyArray(v) { function getEnclosingTextRange(targetRange, sourceFile) { return isReadonlyArray(targetRange.range) ? { pos: first(targetRange.range).getStart(sourceFile), end: last(targetRange.range).getEnd() } : targetRange.range; } -var Usage = /* @__PURE__ */ ((Usage2) => { - Usage2[Usage2["Read"] = 1] = "Read"; - Usage2[Usage2["Write"] = 2] = "Write"; - return Usage2; -})(Usage || {}); function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker, cancellationToken) { const allTypeParameterUsages = /* @__PURE__ */ new Map(); const usagesPerScope = []; @@ -163804,13 +162290,8 @@ function getSignatureHelpItems(program, sourceFile, position, triggerReason, can if (!candidateInfo) { return isSourceFileJS(sourceFile) ? createJSSignatureHelpItems(argumentInfo, program, cancellationToken) : void 0; } - return typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => candidateInfo.kind === CandidateOrTypeKind.Candidate ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2)); + return typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => candidateInfo.kind === 0 /* Candidate */ ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2)); } -var CandidateOrTypeKind = /* @__PURE__ */ ((CandidateOrTypeKind2) => { - CandidateOrTypeKind2[CandidateOrTypeKind2["Candidate"] = 0] = "Candidate"; - CandidateOrTypeKind2[CandidateOrTypeKind2["Type"] = 1] = "Type"; - return CandidateOrTypeKind2; -})(CandidateOrTypeKind || {}); function getCandidateOrTypeInfo({ invocation, argumentCount }, checker, sourceFile, startingToken, onlyUseSyntacticOwners) { switch (invocation.kind) { case 0 /* Call */: { @@ -168088,7 +166569,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt } function processChildNode(child, inheritedIndentation, parent2, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { Debug.assert(!nodeIsSynthesized(child)); - if (nodeIsMissing(child)) { + if (nodeIsMissing(child) || isGrammarError(parent2, child)) { return inheritedIndentation; } const childStartPos = child.getStart(sourceFile); @@ -168221,7 +166702,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt if (currentTokenInfo.leadingTrivia) { processTrivia(currentTokenInfo.leadingTrivia, parent2, childContextNode, dynamicIndentation); } - let lineAction = LineAction.None; + let lineAction = 0 /* None */; const isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); const tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); if (isTokenInRange) { @@ -168229,11 +166710,11 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt const savePreviousRange = previousRange; lineAction = processRange(currentTokenInfo.token, tokenStart, parent2, childContextNode, dynamicIndentation); if (!rangeHasError) { - if (lineAction === LineAction.None) { + if (lineAction === 0 /* None */) { const prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line; indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine; } else { - indentToken = lineAction === LineAction.LineAdded; + indentToken = lineAction === 1 /* LineAdded */; } } } @@ -168259,7 +166740,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt ); } if (tokenIndentation !== -1 /* Unknown */ && indentNextTokenOrTrivia) { - insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === LineAction.LineAdded); + insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === 1 /* LineAdded */); lastIndentedLine = tokenStart.line; indentationOnLastIndentedLine = tokenIndentation; } @@ -168306,7 +166787,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt } function processRange(range, rangeStart, parent2, contextNode, dynamicIndentation) { const rangeHasError = rangeContainsError(range); - let lineAction = LineAction.None; + let lineAction = 0 /* None */; if (!rangeHasError) { if (!previousRange) { const originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); @@ -168325,13 +166806,13 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt formattingContext.updateContext(previousItem, previousParent2, currentItem, currentParent, contextNode); const rules = getRules(formattingContext); let trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; - let lineAction = LineAction.None; + let lineAction = 0 /* None */; if (rules) { forEachRight(rules, (rule2) => { lineAction = applyRuleEdits(rule2, previousItem, previousStartLine, currentItem, currentStartLine); if (dynamicIndentation) { switch (lineAction) { - case LineAction.LineRemoved: + case 2 /* LineRemoved */: if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation( /*lineAddedByFormatting*/ @@ -168340,7 +166821,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt ); } break; - case LineAction.LineAdded: + case 1 /* LineAdded */: if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation( /*lineAddedByFormatting*/ @@ -168350,7 +166831,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt } break; default: - Debug.assert(lineAction === LineAction.None); + Debug.assert(lineAction === 0 /* None */); } } trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule2.action & 16 /* DeleteSpace */) && rule2.flags !== 1 /* CanDeleteNewLines */; @@ -168497,11 +166978,11 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt const onLaterLine = currentStartLine !== previousStartLine; switch (rule2.action) { case 1 /* StopProcessingSpaceActions */: - return LineAction.None; + return 0 /* None */; case 16 /* DeleteSpace */: if (previousRange2.end !== currentRange.pos) { recordDelete(previousRange2.end, currentRange.pos - previousRange2.end); - return onLaterLine ? LineAction.LineRemoved : LineAction.None; + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 32 /* DeleteToken */: @@ -168509,36 +166990,30 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt break; case 8 /* InsertNewLine */: if (rule2.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return LineAction.None; + return 0 /* None */; } const lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, getNewLineOrDefaultFromHost(host, options)); - return onLaterLine ? LineAction.None : LineAction.LineAdded; + return onLaterLine ? 0 /* None */ : 1 /* LineAdded */; } break; case 4 /* InsertSpace */: if (rule2.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return LineAction.None; + return 0 /* None */; } const posDelta = currentRange.pos - previousRange2.end; if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange2.end) !== 32 /* space */) { recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, " "); - return onLaterLine ? LineAction.LineRemoved : LineAction.None; + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 64 /* InsertTrailingSemicolon */: recordInsert(previousRange2.end, ";"); } - return LineAction.None; + return 0 /* None */; } } -var LineAction = /* @__PURE__ */ ((LineAction2) => { - LineAction2[LineAction2["None"] = 0] = "None"; - LineAction2[LineAction2["LineAdded"] = 1] = "LineAdded"; - LineAction2[LineAction2["LineRemoved"] = 2] = "LineRemoved"; - return LineAction2; -})(LineAction || {}); function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenAtPosition = getTokenAtPosition(sourceFile, position)) { const jsdoc = findAncestor(tokenAtPosition, isJSDoc); if (jsdoc) @@ -168761,7 +167236,7 @@ var SmartIndenter; )) { const currentStart = getStartLineAndCharacterForNode(current, sourceFile); const nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); - const indentationDelta = nextTokenKind !== NextTokenKind.Unknown ? assumeNewLineBeforeCloseBrace && nextTokenKind === NextTokenKind.CloseBrace ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; + const indentationDelta = nextTokenKind !== 0 /* Unknown */ ? assumeNewLineBeforeCloseBrace && nextTokenKind === 2 /* CloseBrace */ ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; return getIndentationForNodeWorker( current, currentStart, @@ -169189,6 +167664,2258 @@ var SmartIndenter; } })(SmartIndenter || (SmartIndenter = {})); +// src/server/_namespaces/ts.ts +var ts_exports3 = {}; +__export(ts_exports3, { + ANONYMOUS: () => ANONYMOUS, + AccessFlags: () => AccessFlags, + AssertionLevel: () => AssertionLevel, + AssignmentDeclarationKind: () => AssignmentDeclarationKind, + AssignmentKind: () => AssignmentKind, + Associativity: () => Associativity, + BreakpointResolver: () => ts_BreakpointResolver_exports, + BuilderFileEmit: () => BuilderFileEmit, + BuilderProgramKind: () => BuilderProgramKind, + BuilderState: () => BuilderState, + BundleFileSectionKind: () => BundleFileSectionKind, + CallHierarchy: () => ts_CallHierarchy_exports, + CharacterCodes: () => CharacterCodes, + CheckFlags: () => CheckFlags, + CheckMode: () => CheckMode, + ClassificationType: () => ClassificationType, + ClassificationTypeNames: () => ClassificationTypeNames, + CommentDirectiveType: () => CommentDirectiveType, + Comparison: () => Comparison, + CompletionInfoFlags: () => CompletionInfoFlags, + CompletionTriggerKind: () => CompletionTriggerKind, + Completions: () => ts_Completions_exports, + ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel, + ContextFlags: () => ContextFlags, + CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter, + Debug: () => Debug, + DeprecationVersion: () => DeprecationVersion, + DiagnosticCategory: () => DiagnosticCategory, + Diagnostics: () => Diagnostics, + DocumentHighlights: () => DocumentHighlights, + ElementFlags: () => ElementFlags, + EmitFlags: () => EmitFlags, + EmitHint: () => EmitHint, + EmitOnly: () => EmitOnly, + EndOfLineState: () => EndOfLineState, + EnumKind: () => EnumKind, + ExitStatus: () => ExitStatus, + ExportKind: () => ExportKind, + Extension: () => Extension, + ExternalEmitHelpers: () => ExternalEmitHelpers, + FileIncludeKind: () => FileIncludeKind, + FilePreprocessingDiagnosticsKind: () => FilePreprocessingDiagnosticsKind, + FileSystemEntryKind: () => FileSystemEntryKind, + FileWatcherEventKind: () => FileWatcherEventKind, + FindAllReferences: () => ts_FindAllReferences_exports, + FlattenLevel: () => FlattenLevel, + FlowFlags: () => FlowFlags, + ForegroundColorEscapeSequences: () => ForegroundColorEscapeSequences, + FunctionFlags: () => FunctionFlags, + GeneratedIdentifierFlags: () => GeneratedIdentifierFlags, + GetLiteralTextFlags: () => GetLiteralTextFlags, + GoToDefinition: () => ts_GoToDefinition_exports, + HighlightSpanKind: () => HighlightSpanKind, + ImportKind: () => ImportKind, + ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, + IndentStyle: () => IndentStyle, + IndexKind: () => IndexKind, + InferenceFlags: () => InferenceFlags, + InferencePriority: () => InferencePriority, + InlayHintKind: () => InlayHintKind, + InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, + InternalSymbolName: () => InternalSymbolName, + InvalidatedProjectKind: () => InvalidatedProjectKind, + JsDoc: () => ts_JsDoc_exports, + JsTyping: () => ts_JsTyping_exports, + JsxEmit: () => JsxEmit, + JsxFlags: () => JsxFlags, + JsxReferenceKind: () => JsxReferenceKind, + LanguageServiceMode: () => LanguageServiceMode, + LanguageServiceShimHostAdapter: () => LanguageServiceShimHostAdapter, + LanguageVariant: () => LanguageVariant, + LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, + ListFormat: () => ListFormat, + LogLevel: () => LogLevel, + MemberOverrideStatus: () => MemberOverrideStatus, + ModifierFlags: () => ModifierFlags, + ModuleDetectionKind: () => ModuleDetectionKind, + ModuleInstanceState: () => ModuleInstanceState, + ModuleKind: () => ModuleKind, + ModuleResolutionKind: () => ModuleResolutionKind, + ModuleSpecifierEnding: () => ModuleSpecifierEnding, + NavigateTo: () => ts_NavigateTo_exports, + NavigationBar: () => ts_NavigationBar_exports, + NewLineKind: () => NewLineKind, + NodeBuilderFlags: () => NodeBuilderFlags, + NodeCheckFlags: () => NodeCheckFlags, + NodeFactoryFlags: () => NodeFactoryFlags, + NodeFlags: () => NodeFlags, + NodeResolutionFeatures: () => NodeResolutionFeatures, + ObjectFlags: () => ObjectFlags, + OperationCanceledException: () => OperationCanceledException, + OperatorPrecedence: () => OperatorPrecedence, + OrganizeImports: () => ts_OrganizeImports_exports, + OrganizeImportsMode: () => OrganizeImportsMode, + OuterExpressionKinds: () => OuterExpressionKinds, + OutliningElementsCollector: () => ts_OutliningElementsCollector_exports, + OutliningSpanKind: () => OutliningSpanKind, + OutputFileType: () => OutputFileType, + PackageJsonAutoImportPreference: () => PackageJsonAutoImportPreference, + PackageJsonDependencyGroup: () => PackageJsonDependencyGroup, + PatternMatchKind: () => PatternMatchKind, + PollingInterval: () => PollingInterval, + PollingWatchKind: () => PollingWatchKind, + PragmaKindFlags: () => PragmaKindFlags, + PrivateIdentifierKind: () => PrivateIdentifierKind, + ProcessLevel: () => ProcessLevel, + QuotePreference: () => QuotePreference, + RelationComparisonResult: () => RelationComparisonResult, + Rename: () => ts_Rename_exports, + ScriptElementKind: () => ScriptElementKind, + ScriptElementKindModifier: () => ScriptElementKindModifier, + ScriptKind: () => ScriptKind, + ScriptSnapshot: () => ScriptSnapshot, + ScriptTarget: () => ScriptTarget, + SemanticClassificationFormat: () => SemanticClassificationFormat, + SemanticMeaning: () => SemanticMeaning, + SemicolonPreference: () => SemicolonPreference, + SignatureCheckMode: () => SignatureCheckMode, + SignatureFlags: () => SignatureFlags, + SignatureHelp: () => ts_SignatureHelp_exports, + SignatureKind: () => SignatureKind, + SmartSelectionRange: () => ts_SmartSelectionRange_exports, + SnippetKind: () => SnippetKind, + SortKind: () => SortKind, + StructureIsReused: () => StructureIsReused, + SymbolAccessibility: () => SymbolAccessibility, + SymbolDisplay: () => ts_SymbolDisplay_exports, + SymbolDisplayPartKind: () => SymbolDisplayPartKind, + SymbolFlags: () => SymbolFlags, + SymbolFormatFlags: () => SymbolFormatFlags, + SyntaxKind: () => SyntaxKind, + SyntheticSymbolKind: () => SyntheticSymbolKind, + Ternary: () => Ternary, + ThrottledCancellationToken: () => ThrottledCancellationToken, + TokenClass: () => TokenClass, + TokenFlags: () => TokenFlags, + TransformFlags: () => TransformFlags, + TypeFacts: () => TypeFacts, + TypeFlags: () => TypeFlags, + TypeFormatFlags: () => TypeFormatFlags, + TypeMapKind: () => TypeMapKind, + TypePredicateKind: () => TypePredicateKind, + TypeReferenceSerializationKind: () => TypeReferenceSerializationKind, + TypeScriptServicesFactory: () => TypeScriptServicesFactory, + UnionReduction: () => UnionReduction, + UpToDateStatusType: () => UpToDateStatusType, + VarianceFlags: () => VarianceFlags, + Version: () => Version, + VersionRange: () => VersionRange, + WatchDirectoryFlags: () => WatchDirectoryFlags, + WatchDirectoryKind: () => WatchDirectoryKind, + WatchFileKind: () => WatchFileKind, + WatchLogLevel: () => WatchLogLevel, + WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, + addEmitFlags: () => addEmitFlags, + addEmitHelper: () => addEmitHelper, + addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, + addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, + addRange: () => addRange, + addRelatedInfo: () => addRelatedInfo, + addSyntheticLeadingComment: () => addSyntheticLeadingComment, + addSyntheticTrailingComment: () => addSyntheticTrailingComment, + addToSeen: () => addToSeen, + advancedAsyncSuperHelper: () => advancedAsyncSuperHelper, + affectsDeclarationPathOptionDeclarations: () => affectsDeclarationPathOptionDeclarations, + affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations, + allKeysStartWithDot: () => allKeysStartWithDot, + altDirectorySeparator: () => altDirectorySeparator, + and: () => and, + append: () => append, + appendIfUnique: () => appendIfUnique, + arrayFrom: () => arrayFrom, + arrayIsEqualTo: () => arrayIsEqualTo, + arrayIsHomogeneous: () => arrayIsHomogeneous, + arrayIsSorted: () => arrayIsSorted, + arrayOf: () => arrayOf, + arrayReverseIterator: () => arrayReverseIterator, + arrayToMap: () => arrayToMap, + arrayToMultiMap: () => arrayToMultiMap, + arrayToNumericMap: () => arrayToNumericMap, + arraysEqual: () => arraysEqual, + assertType: () => assertType, + assign: () => assign, + assignHelper: () => assignHelper, + asyncDelegator: () => asyncDelegator, + asyncGeneratorHelper: () => asyncGeneratorHelper, + asyncSuperHelper: () => asyncSuperHelper, + asyncValues: () => asyncValues, + attachFileToDiagnostics: () => attachFileToDiagnostics, + awaitHelper: () => awaitHelper, + awaiterHelper: () => awaiterHelper, + base64decode: () => base64decode, + base64encode: () => base64encode, + binarySearch: () => binarySearch, + binarySearchKey: () => binarySearchKey, + bindSourceFile: () => bindSourceFile, + breakIntoCharacterSpans: () => breakIntoCharacterSpans, + breakIntoWordSpans: () => breakIntoWordSpans, + buildLinkParts: () => buildLinkParts, + buildOpts: () => buildOpts, + buildOverload: () => buildOverload, + bundlerModuleNameResolver: () => bundlerModuleNameResolver, + canBeConvertedToAsync: () => canBeConvertedToAsync, + canHaveDecorators: () => canHaveDecorators, + canHaveExportModifier: () => canHaveExportModifier, + canHaveFlowNode: () => canHaveFlowNode, + canHaveIllegalDecorators: () => canHaveIllegalDecorators, + canHaveIllegalModifiers: () => canHaveIllegalModifiers, + canHaveIllegalType: () => canHaveIllegalType, + canHaveIllegalTypeParameters: () => canHaveIllegalTypeParameters, + canHaveJSDoc: () => canHaveJSDoc, + canHaveLocals: () => canHaveLocals, + canHaveModifiers: () => canHaveModifiers, + canHaveSymbol: () => canHaveSymbol, + canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, + canProduceDiagnostics: () => canProduceDiagnostics, + canUsePropertyAccess: () => canUsePropertyAccess, + canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, + cartesianProduct: () => cartesianProduct, + cast: () => cast, + chainBundle: () => chainBundle, + chainDiagnosticMessages: () => chainDiagnosticMessages, + changeAnyExtension: () => changeAnyExtension, + changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, + changeExtension: () => changeExtension, + changesAffectModuleResolution: () => changesAffectModuleResolution, + changesAffectingProgramStructure: () => changesAffectingProgramStructure, + childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, + classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, + classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, + classPrivateFieldInHelper: () => classPrivateFieldInHelper, + classPrivateFieldSetHelper: () => classPrivateFieldSetHelper, + classicNameResolver: () => classicNameResolver, + classifier: () => ts_classifier_exports, + cleanExtendedConfigCache: () => cleanExtendedConfigCache, + clear: () => clear, + clearMap: () => clearMap, + clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, + climbPastPropertyAccess: () => climbPastPropertyAccess, + climbPastPropertyOrElementAccess: () => climbPastPropertyOrElementAccess, + clone: () => clone, + cloneCompilerOptions: () => cloneCompilerOptions, + closeFileWatcher: () => closeFileWatcher, + closeFileWatcherOf: () => closeFileWatcherOf, + codefix: () => ts_codefix_exports, + collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, + collectExternalModuleInfo: () => collectExternalModuleInfo, + combine: () => combine, + combinePaths: () => combinePaths, + commentPragmas: () => commentPragmas, + commonOptionsWithBuild: () => commonOptionsWithBuild, + commonPackageFolders: () => commonPackageFolders, + compact: () => compact, + compareBooleans: () => compareBooleans, + compareDataObjects: () => compareDataObjects, + compareDiagnostics: () => compareDiagnostics, + compareDiagnosticsSkipRelatedInformation: () => compareDiagnosticsSkipRelatedInformation, + compareEmitHelpers: () => compareEmitHelpers, + compareNumberOfDirectorySeparators: () => compareNumberOfDirectorySeparators, + comparePaths: () => comparePaths, + comparePathsCaseInsensitive: () => comparePathsCaseInsensitive, + comparePathsCaseSensitive: () => comparePathsCaseSensitive, + comparePatternKeys: () => comparePatternKeys, + compareProperties: () => compareProperties, + compareStringsCaseInsensitive: () => compareStringsCaseInsensitive, + compareStringsCaseInsensitiveEslintCompatible: () => compareStringsCaseInsensitiveEslintCompatible, + compareStringsCaseSensitive: () => compareStringsCaseSensitive, + compareStringsCaseSensitiveUI: () => compareStringsCaseSensitiveUI, + compareTextSpans: () => compareTextSpans, + compareValues: () => compareValues, + compileOnSaveCommandLineOption: () => compileOnSaveCommandLineOption, + compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, + compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, + compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, + compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, + compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, + computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, + computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, + computeLineOfPosition: () => computeLineOfPosition, + computeLineStarts: () => computeLineStarts, + computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, + computeSignature: () => computeSignature, + computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics, + computeSuggestionDiagnostics: () => computeSuggestionDiagnostics, + concatenate: () => concatenate, + concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains, + consumesNodeCoreModules: () => consumesNodeCoreModules, + contains: () => contains, + containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, + containsParseError: () => containsParseError, + containsPath: () => containsPath, + convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, + convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, + convertJsonOption: () => convertJsonOption, + convertToBase64: () => convertToBase64, + convertToObject: () => convertToObject, + convertToObjectWorker: () => convertToObjectWorker, + convertToOptionsWithAbsolutePaths: () => convertToOptionsWithAbsolutePaths, + convertToRelativePath: () => convertToRelativePath, + convertToTSConfig: () => convertToTSConfig, + convertTypeAcquisitionFromJson: () => convertTypeAcquisitionFromJson, + copyComments: () => copyComments, + copyEntries: () => copyEntries, + copyLeadingComments: () => copyLeadingComments, + copyProperties: () => copyProperties, + copyTrailingAsLeadingComments: () => copyTrailingAsLeadingComments, + copyTrailingComments: () => copyTrailingComments, + couldStartTrivia: () => couldStartTrivia, + countWhere: () => countWhere, + createAbstractBuilder: () => createAbstractBuilder, + createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, + createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, + createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, + createBaseNodeFactory: () => createBaseNodeFactory, + createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, + createBindingHelper: () => createBindingHelper, + createBuildInfo: () => createBuildInfo, + createBuilderProgram: () => createBuilderProgram, + createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, + createBuilderStatusReporter: () => createBuilderStatusReporter, + createCacheWithRedirects: () => createCacheWithRedirects, + createCacheableExportInfoMap: () => createCacheableExportInfoMap, + createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, + createClassifier: () => createClassifier, + createCommentDirectivesMap: () => createCommentDirectivesMap, + createCompilerDiagnostic: () => createCompilerDiagnostic, + createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, + createCompilerDiagnosticFromMessageChain: () => createCompilerDiagnosticFromMessageChain, + createCompilerHost: () => createCompilerHost, + createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, + createCompilerHostWorker: () => createCompilerHostWorker, + createDetachedDiagnostic: () => createDetachedDiagnostic, + createDiagnosticCollection: () => createDiagnosticCollection, + createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, + createDiagnosticForNode: () => createDiagnosticForNode, + createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, + createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, + createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, + createDiagnosticForRange: () => createDiagnosticForRange, + createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, + createDiagnosticReporter: () => createDiagnosticReporter, + createDocumentPositionMapper: () => createDocumentPositionMapper, + createDocumentRegistry: () => createDocumentRegistry, + createDocumentRegistryInternal: () => createDocumentRegistryInternal, + createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, + createEmitHelperFactory: () => createEmitHelperFactory, + createEmptyExports: () => createEmptyExports, + createExpressionForJsxElement: () => createExpressionForJsxElement, + createExpressionForJsxFragment: () => createExpressionForJsxFragment, + createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, + createExpressionForPropertyName: () => createExpressionForPropertyName, + createExpressionFromEntityName: () => createExpressionFromEntityName, + createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, + createFileDiagnostic: () => createFileDiagnostic, + createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, + createForOfBindingStatement: () => createForOfBindingStatement, + createGetCanonicalFileName: () => createGetCanonicalFileName, + createGetSourceFile: () => createGetSourceFile, + createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, + createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, + createGetSymbolWalker: () => createGetSymbolWalker, + createIncrementalCompilerHost: () => createIncrementalCompilerHost, + createIncrementalProgram: () => createIncrementalProgram, + createInputFiles: () => createInputFiles, + createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, + createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, + createJsxFactoryExpression: () => createJsxFactoryExpression, + createLanguageService: () => createLanguageService, + createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, + createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, + createModeAwareCache: () => createModeAwareCache, + createModeAwareCacheKey: () => createModeAwareCacheKey, + createModuleResolutionCache: () => createModuleResolutionCache, + createModuleResolutionLoader: () => createModuleResolutionLoader, + createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, + createMultiMap: () => createMultiMap, + createNodeConverters: () => createNodeConverters, + createNodeFactory: () => createNodeFactory, + createOptionNameMap: () => createOptionNameMap, + createOverload: () => createOverload, + createPackageJsonImportFilter: () => createPackageJsonImportFilter, + createPackageJsonInfo: () => createPackageJsonInfo, + createParenthesizerRules: () => createParenthesizerRules, + createPatternMatcher: () => createPatternMatcher, + createPrependNodes: () => createPrependNodes, + createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, + createProgram: () => createProgram, + createProgramHost: () => createProgramHost, + createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, + createQueue: () => createQueue, + createRange: () => createRange, + createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, + createResolutionCache: () => createResolutionCache, + createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, + createScanner: () => createScanner, + createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, + createSet: () => createSet, + createSolutionBuilder: () => createSolutionBuilder, + createSolutionBuilderHost: () => createSolutionBuilderHost, + createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, + createSolutionBuilderWithWatchHost: () => createSolutionBuilderWithWatchHost, + createSortedArray: () => createSortedArray, + createSourceFile: () => createSourceFile, + createSourceMapGenerator: () => createSourceMapGenerator, + createSourceMapSource: () => createSourceMapSource, + createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, + createSymbolTable: () => createSymbolTable, + createSymlinkCache: () => createSymlinkCache, + createSystemWatchFunctions: () => createSystemWatchFunctions, + createTextChange: () => createTextChange, + createTextChangeFromStartLength: () => createTextChangeFromStartLength, + createTextChangeRange: () => createTextChangeRange, + createTextRangeFromNode: () => createTextRangeFromNode, + createTextRangeFromSpan: () => createTextRangeFromSpan, + createTextSpan: () => createTextSpan, + createTextSpanFromBounds: () => createTextSpanFromBounds, + createTextSpanFromNode: () => createTextSpanFromNode, + createTextSpanFromRange: () => createTextSpanFromRange, + createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, + createTextWriter: () => createTextWriter, + createTokenRange: () => createTokenRange, + createTypeChecker: () => createTypeChecker, + createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, + createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, + createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap, + createUnparsedSourceFile: () => createUnparsedSourceFile, + createWatchCompilerHost: () => createWatchCompilerHost2, + createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, + createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, + createWatchFactory: () => createWatchFactory, + createWatchHost: () => createWatchHost, + createWatchProgram: () => createWatchProgram, + createWatchStatusReporter: () => createWatchStatusReporter, + createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, + declarationNameToString: () => declarationNameToString, + decodeMappings: () => decodeMappings, + decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, + decorateHelper: () => decorateHelper, + deduplicate: () => deduplicate, + defaultIncludeSpec: () => defaultIncludeSpec, + defaultInitCompilerOptions: () => defaultInitCompilerOptions, + defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, + detectSortCaseSensitivity: () => detectSortCaseSensitivity, + diagnosticCategoryName: () => diagnosticCategoryName, + diagnosticToString: () => diagnosticToString, + directoryProbablyExists: () => directoryProbablyExists, + directorySeparator: () => directorySeparator, + displayPart: () => displayPart, + displayPartsToString: () => displayPartsToString, + disposeEmitNodes: () => disposeEmitNodes, + documentSpansEqual: () => documentSpansEqual, + dumpTracingLegend: () => dumpTracingLegend, + elementAt: () => elementAt, + elideNodes: () => elideNodes, + emitComments: () => emitComments, + emitDetachedComments: () => emitDetachedComments, + emitFiles: () => emitFiles, + emitFilesAndReportErrors: () => emitFilesAndReportErrors, + emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, + emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, + emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, + emitNewLineBeforeLeadingComments: () => emitNewLineBeforeLeadingComments, + emitNewLineBeforeLeadingCommentsOfPosition: () => emitNewLineBeforeLeadingCommentsOfPosition, + emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, + emitUsingBuildInfo: () => emitUsingBuildInfo, + emptyArray: () => emptyArray, + emptyFileSystemEntries: () => emptyFileSystemEntries, + emptyMap: () => emptyMap, + emptyOptions: () => emptyOptions, + emptySet: () => emptySet, + endsWith: () => endsWith, + ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, + ensureScriptKind: () => ensureScriptKind, + ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, + entityNameToString: () => entityNameToString, + enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, + equalOwnProperties: () => equalOwnProperties, + equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, + equateStringsCaseSensitive: () => equateStringsCaseSensitive, + equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, + escapeJsxAttributeString: () => escapeJsxAttributeString, + escapeLeadingUnderscores: () => escapeLeadingUnderscores, + escapeNonAsciiString: () => escapeNonAsciiString, + escapeSnippetText: () => escapeSnippetText, + escapeString: () => escapeString, + every: () => every, + expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, + explainFiles: () => explainFiles, + explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, + exportAssignmentIsAlias: () => exportAssignmentIsAlias, + exportStarHelper: () => exportStarHelper, + expressionResultIsUnused: () => expressionResultIsUnused, + extend: () => extend, + extendsHelper: () => extendsHelper, + extensionFromPath: () => extensionFromPath, + extensionIsTS: () => extensionIsTS, + externalHelpersModuleNameText: () => externalHelpersModuleNameText, + factory: () => factory, + fileExtensionIs: () => fileExtensionIs, + fileExtensionIsOneOf: () => fileExtensionIsOneOf, + fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics, + filter: () => filter, + filterMutate: () => filterMutate, + filterSemanticDiagnostics: () => filterSemanticDiagnostics, + find: () => find, + findAncestor: () => findAncestor, + findBestPatternMatch: () => findBestPatternMatch, + findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, + findConfigFile: () => findConfigFile, + findContainingList: () => findContainingList, + findDiagnosticForNode: () => findDiagnosticForNode, + findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, + findIndex: () => findIndex, + findLast: () => findLast, + findLastIndex: () => findLastIndex, + findListItemInfo: () => findListItemInfo, + findMap: () => findMap, + findModifier: () => findModifier, + findNextToken: () => findNextToken, + findPackageJson: () => findPackageJson, + findPackageJsons: () => findPackageJsons, + findPrecedingMatchingToken: () => findPrecedingMatchingToken, + findPrecedingToken: () => findPrecedingToken, + findSuperStatementIndex: () => findSuperStatementIndex, + findTokenOnLeftOfPosition: () => findTokenOnLeftOfPosition, + findUseStrictPrologue: () => findUseStrictPrologue, + first: () => first, + firstDefined: () => firstDefined, + firstDefinedIterator: () => firstDefinedIterator, + firstIterator: () => firstIterator, + firstOrOnly: () => firstOrOnly, + firstOrUndefined: () => firstOrUndefined, + firstOrUndefinedIterator: () => firstOrUndefinedIterator, + fixupCompilerOptions: () => fixupCompilerOptions, + flatMap: () => flatMap, + flatMapIterator: () => flatMapIterator, + flatMapToMutable: () => flatMapToMutable, + flatten: () => flatten, + flattenCommaList: () => flattenCommaList, + flattenDestructuringAssignment: () => flattenDestructuringAssignment, + flattenDestructuringBinding: () => flattenDestructuringBinding, + flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, + forEach: () => forEach, + forEachAncestor: () => forEachAncestor, + forEachAncestorDirectory: () => forEachAncestorDirectory, + forEachChild: () => forEachChild, + forEachChildRecursively: () => forEachChildRecursively, + forEachEmittedFile: () => forEachEmittedFile, + forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, + forEachEntry: () => forEachEntry, + forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, + forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, + forEachKey: () => forEachKey, + forEachLeadingCommentRange: () => forEachLeadingCommentRange, + forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, + forEachResolvedProjectReference: () => forEachResolvedProjectReference, + forEachReturnStatement: () => forEachReturnStatement, + forEachRight: () => forEachRight, + forEachTrailingCommentRange: () => forEachTrailingCommentRange, + forEachUnique: () => forEachUnique, + forEachYieldExpression: () => forEachYieldExpression, + forSomeAncestorDirectory: () => forSomeAncestorDirectory, + formatColorAndReset: () => formatColorAndReset, + formatDiagnostic: () => formatDiagnostic, + formatDiagnostics: () => formatDiagnostics, + formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, + formatGeneratedName: () => formatGeneratedName, + formatGeneratedNamePart: () => formatGeneratedNamePart, + formatLocation: () => formatLocation, + formatMessage: () => formatMessage, + formatStringFromArgs: () => formatStringFromArgs, + formatting: () => ts_formatting_exports, + fullTripleSlashAMDReferencePathRegEx: () => fullTripleSlashAMDReferencePathRegEx, + fullTripleSlashReferencePathRegEx: () => fullTripleSlashReferencePathRegEx, + generateDjb2Hash: () => generateDjb2Hash, + generateTSConfig: () => generateTSConfig, + generatorHelper: () => generatorHelper, + getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, + getAdjustedRenameLocation: () => getAdjustedRenameLocation, + getAliasDeclarationFromName: () => getAliasDeclarationFromName, + getAllAccessorDeclarations: () => getAllAccessorDeclarations, + getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, + getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, + getAllJSDocTags: () => getAllJSDocTags, + getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, + getAllKeys: () => getAllKeys, + getAllProjectOutputs: () => getAllProjectOutputs, + getAllSuperTypeNodes: () => getAllSuperTypeNodes, + getAllUnscopedEmitHelpers: () => getAllUnscopedEmitHelpers, + getAllowJSCompilerOption: () => getAllowJSCompilerOption, + getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports, + getAncestor: () => getAncestor, + getAnyExtensionFromPath: () => getAnyExtensionFromPath, + getAreDeclarationMapsEnabled: () => getAreDeclarationMapsEnabled, + getAssignedExpandoInitializer: () => getAssignedExpandoInitializer, + getAssignedName: () => getAssignedName, + getAssignmentDeclarationKind: () => getAssignmentDeclarationKind, + getAssignmentDeclarationPropertyAccessKind: () => getAssignmentDeclarationPropertyAccessKind, + getAssignmentTargetKind: () => getAssignmentTargetKind, + getAutomaticTypeDirectiveNames: () => getAutomaticTypeDirectiveNames, + getBaseFileName: () => getBaseFileName, + getBinaryOperatorPrecedence: () => getBinaryOperatorPrecedence, + getBuildInfo: () => getBuildInfo, + getBuildInfoFileVersionMap: () => getBuildInfoFileVersionMap, + getBuildInfoText: () => getBuildInfoText, + getBuildOrderFromAnyBuildOrder: () => getBuildOrderFromAnyBuildOrder, + getBuilderCreationParameters: () => getBuilderCreationParameters, + getBuilderFileEmit: () => getBuilderFileEmit, + getCheckFlags: () => getCheckFlags, + getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, + getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, + getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, + getCombinedModifierFlags: () => getCombinedModifierFlags, + getCombinedNodeFlags: () => getCombinedNodeFlags, + getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, + getCommentRange: () => getCommentRange, + getCommonSourceDirectory: () => getCommonSourceDirectory, + getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, + getCompilerOptionValue: () => getCompilerOptionValue, + getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, + getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, + getConstantValue: () => getConstantValue, + getContainerNode: () => getContainerNode, + getContainingClass: () => getContainingClass, + getContainingClassStaticBlock: () => getContainingClassStaticBlock, + getContainingFunction: () => getContainingFunction, + getContainingFunctionDeclaration: () => getContainingFunctionDeclaration, + getContainingFunctionOrClassStaticBlock: () => getContainingFunctionOrClassStaticBlock, + getContainingNodeArray: () => getContainingNodeArray, + getContainingObjectLiteralElement: () => getContainingObjectLiteralElement, + getContextualTypeFromParent: () => getContextualTypeFromParent, + getContextualTypeFromParentOrAncestorTypeNode: () => getContextualTypeFromParentOrAncestorTypeNode, + getCurrentTime: () => getCurrentTime, + getDeclarationDiagnostics: () => getDeclarationDiagnostics, + getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, + getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, + getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, + getDeclarationFromName: () => getDeclarationFromName, + getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, + getDeclarationOfKind: () => getDeclarationOfKind, + getDeclarationsOfKind: () => getDeclarationsOfKind, + getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, + getDecorators: () => getDecorators, + getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, + getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, + getDefaultLibFileName: () => getDefaultLibFileName, + getDefaultLibFilePath: () => getDefaultLibFilePath, + getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, + getDiagnosticText: () => getDiagnosticText, + getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan, + getDirectoryPath: () => getDirectoryPath, + getDocumentPositionMapper: () => getDocumentPositionMapper, + getESModuleInterop: () => getESModuleInterop, + getEditsForFileRename: () => getEditsForFileRename, + getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode, + getEffectiveConstraintOfTypeParameter: () => getEffectiveConstraintOfTypeParameter, + getEffectiveContainerForJSDocTemplateTag: () => getEffectiveContainerForJSDocTemplateTag, + getEffectiveImplementsTypeNodes: () => getEffectiveImplementsTypeNodes, + getEffectiveInitializer: () => getEffectiveInitializer, + getEffectiveJSDocHost: () => getEffectiveJSDocHost, + getEffectiveModifierFlags: () => getEffectiveModifierFlags, + getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => getEffectiveModifierFlagsAlwaysIncludeJSDoc, + getEffectiveModifierFlagsNoCache: () => getEffectiveModifierFlagsNoCache, + getEffectiveReturnTypeNode: () => getEffectiveReturnTypeNode, + getEffectiveSetAccessorTypeAnnotationNode: () => getEffectiveSetAccessorTypeAnnotationNode, + getEffectiveTypeAnnotationNode: () => getEffectiveTypeAnnotationNode, + getEffectiveTypeParameterDeclarations: () => getEffectiveTypeParameterDeclarations, + getEffectiveTypeRoots: () => getEffectiveTypeRoots, + getElementOrPropertyAccessArgumentExpressionOrName: () => getElementOrPropertyAccessArgumentExpressionOrName, + getElementOrPropertyAccessName: () => getElementOrPropertyAccessName, + getElementsOfBindingOrAssignmentPattern: () => getElementsOfBindingOrAssignmentPattern, + getEmitDeclarations: () => getEmitDeclarations, + getEmitFlags: () => getEmitFlags, + getEmitHelpers: () => getEmitHelpers, + getEmitModuleDetectionKind: () => getEmitModuleDetectionKind, + getEmitModuleKind: () => getEmitModuleKind, + getEmitModuleResolutionKind: () => getEmitModuleResolutionKind, + getEmitScriptTarget: () => getEmitScriptTarget, + getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer, + getEncodedSemanticClassifications: () => getEncodedSemanticClassifications, + getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications, + getEndLinePosition: () => getEndLinePosition, + getEntityNameFromTypeNode: () => getEntityNameFromTypeNode, + getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo, + getErrorCountForSummary: () => getErrorCountForSummary, + getErrorSpanForNode: () => getErrorSpanForNode, + getErrorSummaryText: () => getErrorSummaryText, + getEscapedTextOfIdentifierOrLiteral: () => getEscapedTextOfIdentifierOrLiteral, + getExpandoInitializer: () => getExpandoInitializer, + getExportAssignmentExpression: () => getExportAssignmentExpression, + getExportInfoMap: () => getExportInfoMap, + getExportNeedsImportStarHelper: () => getExportNeedsImportStarHelper, + getExpressionAssociativity: () => getExpressionAssociativity, + getExpressionPrecedence: () => getExpressionPrecedence, + getExternalHelpersModuleName: () => getExternalHelpersModuleName, + getExternalModuleImportEqualsDeclarationExpression: () => getExternalModuleImportEqualsDeclarationExpression, + getExternalModuleName: () => getExternalModuleName, + getExternalModuleNameFromDeclaration: () => getExternalModuleNameFromDeclaration, + getExternalModuleNameFromPath: () => getExternalModuleNameFromPath, + getExternalModuleNameLiteral: () => getExternalModuleNameLiteral, + getExternalModuleRequireArgument: () => getExternalModuleRequireArgument, + getFallbackOptions: () => getFallbackOptions, + getFileEmitOutput: () => getFileEmitOutput, + getFileMatcherPatterns: () => getFileMatcherPatterns, + getFileNamesFromConfigSpecs: () => getFileNamesFromConfigSpecs, + getFileWatcherEventKind: () => getFileWatcherEventKind, + getFilesInErrorForSummary: () => getFilesInErrorForSummary, + getFirstConstructorWithBody: () => getFirstConstructorWithBody, + getFirstIdentifier: () => getFirstIdentifier, + getFirstNonSpaceCharacterPosition: () => getFirstNonSpaceCharacterPosition, + getFirstProjectOutput: () => getFirstProjectOutput, + getFixableErrorSpanExpression: () => getFixableErrorSpanExpression, + getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, + getFullWidth: () => getFullWidth, + getFunctionFlags: () => getFunctionFlags, + getHeritageClause: () => getHeritageClause, + getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, + getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, + getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, + getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, + getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, + getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, + getIndentSize: () => getIndentSize, + getIndentString: () => getIndentString, + getInitializedVariables: () => getInitializedVariables, + getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, + getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, + getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, + getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, + getJSDocAugmentsTag: () => getJSDocAugmentsTag, + getJSDocClassTag: () => getJSDocClassTag, + getJSDocCommentRanges: () => getJSDocCommentRanges, + getJSDocCommentsAndTags: () => getJSDocCommentsAndTags, + getJSDocDeprecatedTag: () => getJSDocDeprecatedTag, + getJSDocDeprecatedTagNoCache: () => getJSDocDeprecatedTagNoCache, + getJSDocEnumTag: () => getJSDocEnumTag, + getJSDocHost: () => getJSDocHost, + getJSDocImplementsTags: () => getJSDocImplementsTags, + getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache, + getJSDocParameterTags: () => getJSDocParameterTags, + getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache, + getJSDocPrivateTag: () => getJSDocPrivateTag, + getJSDocPrivateTagNoCache: () => getJSDocPrivateTagNoCache, + getJSDocProtectedTag: () => getJSDocProtectedTag, + getJSDocProtectedTagNoCache: () => getJSDocProtectedTagNoCache, + getJSDocPublicTag: () => getJSDocPublicTag, + getJSDocPublicTagNoCache: () => getJSDocPublicTagNoCache, + getJSDocReadonlyTag: () => getJSDocReadonlyTag, + getJSDocReadonlyTagNoCache: () => getJSDocReadonlyTagNoCache, + getJSDocReturnTag: () => getJSDocReturnTag, + getJSDocReturnType: () => getJSDocReturnType, + getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, + getJSDocTags: () => getJSDocTags, + getJSDocTagsNoCache: () => getJSDocTagsNoCache, + getJSDocTemplateTag: () => getJSDocTemplateTag, + getJSDocThisTag: () => getJSDocThisTag, + getJSDocType: () => getJSDocType, + getJSDocTypeAliasName: () => getJSDocTypeAliasName, + getJSDocTypeAssertionType: () => getJSDocTypeAssertionType, + getJSDocTypeParameterDeclarations: () => getJSDocTypeParameterDeclarations, + getJSDocTypeParameterTags: () => getJSDocTypeParameterTags, + getJSDocTypeParameterTagsNoCache: () => getJSDocTypeParameterTagsNoCache, + getJSDocTypeTag: () => getJSDocTypeTag, + getJSXImplicitImportBase: () => getJSXImplicitImportBase, + getJSXRuntimeImport: () => getJSXRuntimeImport, + getJSXTransformEnabled: () => getJSXTransformEnabled, + getKeyForCompilerOptions: () => getKeyForCompilerOptions, + getLanguageVariant: () => getLanguageVariant, + getLastChild: () => getLastChild, + getLeadingCommentRanges: () => getLeadingCommentRanges, + getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode, + getLeftmostAccessExpression: () => getLeftmostAccessExpression, + getLeftmostExpression: () => getLeftmostExpression, + getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, + getLineInfo: () => getLineInfo, + getLineOfLocalPosition: () => getLineOfLocalPosition, + getLineOfLocalPositionFromLineMap: () => getLineOfLocalPositionFromLineMap, + getLineStartPositionForPosition: () => getLineStartPositionForPosition, + getLineStarts: () => getLineStarts, + getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => getLinesBetweenPositionAndNextNonWhitespaceCharacter, + getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter, + getLinesBetweenPositions: () => getLinesBetweenPositions, + getLinesBetweenRangeEndAndRangeStart: () => getLinesBetweenRangeEndAndRangeStart, + getLinesBetweenRangeEndPositions: () => getLinesBetweenRangeEndPositions, + getLiteralText: () => getLiteralText, + getLocalNameForExternalImport: () => getLocalNameForExternalImport, + getLocalSymbolForExportDefault: () => getLocalSymbolForExportDefault, + getLocaleSpecificMessage: () => getLocaleSpecificMessage, + getLocaleTimeString: () => getLocaleTimeString, + getMappedContextSpan: () => getMappedContextSpan, + getMappedDocumentSpan: () => getMappedDocumentSpan, + getMappedLocation: () => getMappedLocation, + getMatchedFileSpec: () => getMatchedFileSpec, + getMatchedIncludeSpec: () => getMatchedIncludeSpec, + getMeaningFromDeclaration: () => getMeaningFromDeclaration, + getMeaningFromLocation: () => getMeaningFromLocation, + getMembersOfDeclaration: () => getMembersOfDeclaration, + getModeForFileReference: () => getModeForFileReference, + getModeForResolutionAtIndex: () => getModeForResolutionAtIndex, + getModeForUsageLocation: () => getModeForUsageLocation, + getModifiedTime: () => getModifiedTime, + getModifiers: () => getModifiers, + getModuleInstanceState: () => getModuleInstanceState, + getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, + getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, + getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, + getNameForExportedSymbol: () => getNameForExportedSymbol, + getNameFromIndexInfo: () => getNameFromIndexInfo, + getNameFromPropertyName: () => getNameFromPropertyName, + getNameOfAccessExpression: () => getNameOfAccessExpression, + getNameOfCompilerOptionValue: () => getNameOfCompilerOptionValue, + getNameOfDeclaration: () => getNameOfDeclaration, + getNameOfExpando: () => getNameOfExpando, + getNameOfJSDocTypedef: () => getNameOfJSDocTypedef, + getNameOrArgument: () => getNameOrArgument, + getNameTable: () => getNameTable, + getNamesForExportedSymbol: () => getNamesForExportedSymbol, + getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, + getNewLineCharacter: () => getNewLineCharacter, + getNewLineKind: () => getNewLineKind, + getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, + getNewTargetContainer: () => getNewTargetContainer, + getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, + getNodeForGeneratedName: () => getNodeForGeneratedName, + getNodeId: () => getNodeId, + getNodeKind: () => getNodeKind, + getNodeMajorVersion: () => getNodeMajorVersion, + getNodeModifiers: () => getNodeModifiers, + getNodeModulePathParts: () => getNodeModulePathParts, + getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, + getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, + getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, + getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, + getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, + getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, + getNormalizedPathComponents: () => getNormalizedPathComponents, + getObjectFlags: () => getObjectFlags, + getOperator: () => getOperator, + getOperatorAssociativity: () => getOperatorAssociativity, + getOperatorPrecedence: () => getOperatorPrecedence, + getOptionFromName: () => getOptionFromName, + getOptionsNameMap: () => getOptionsNameMap, + getOrCreateEmitNode: () => getOrCreateEmitNode, + getOrCreateExternalHelpersModuleNameIfNeeded: () => getOrCreateExternalHelpersModuleNameIfNeeded, + getOrUpdate: () => getOrUpdate, + getOriginalNode: () => getOriginalNode, + getOriginalNodeId: () => getOriginalNodeId, + getOriginalSourceFile: () => getOriginalSourceFile, + getOutputDeclarationFileName: () => getOutputDeclarationFileName, + getOutputExtension: () => getOutputExtension, + getOutputFileNames: () => getOutputFileNames, + getOutputPathsFor: () => getOutputPathsFor, + getOutputPathsForBundle: () => getOutputPathsForBundle, + getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, + getOwnKeys: () => getOwnKeys, + getOwnValues: () => getOwnValues, + getPackageJsonInfo: () => getPackageJsonInfo, + getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, + getPackageJsonsVisibleToFile: () => getPackageJsonsVisibleToFile, + getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, + getPackageScopeForPath: () => getPackageScopeForPath, + getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, + getParameterTypeNode: () => getParameterTypeNode, + getParentNodeInSpan: () => getParentNodeInSpan, + getParseTreeNode: () => getParseTreeNode, + getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, + getPathComponents: () => getPathComponents, + getPathComponentsRelativeTo: () => getPathComponentsRelativeTo, + getPathFromPathComponents: () => getPathFromPathComponents, + getPathUpdater: () => getPathUpdater, + getPathsBasePath: () => getPathsBasePath, + getPatternFromSpec: () => getPatternFromSpec, + getPendingEmitKind: () => getPendingEmitKind, + getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, + getPossibleGenericSignatures: () => getPossibleGenericSignatures, + getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, + getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, + getPreEmitDiagnostics: () => getPreEmitDiagnostics, + getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, + getProperties: () => getProperties, + getProperty: () => getProperty, + getPropertyArrayElementValue: () => getPropertyArrayElementValue, + getPropertyAssignment: () => getPropertyAssignment, + getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, + getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, + getPropertyNameForUniqueESSymbol: () => getPropertyNameForUniqueESSymbol, + getPropertyNameOfBindingOrAssignmentElement: () => getPropertyNameOfBindingOrAssignmentElement, + getPropertySymbolFromBindingElement: () => getPropertySymbolFromBindingElement, + getPropertySymbolsFromContextualType: () => getPropertySymbolsFromContextualType, + getQuoteFromPreference: () => getQuoteFromPreference, + getQuotePreference: () => getQuotePreference, + getRangesWhere: () => getRangesWhere, + getRefactorContextSpan: () => getRefactorContextSpan, + getReferencedFileLocation: () => getReferencedFileLocation, + getRegexFromPattern: () => getRegexFromPattern, + getRegularExpressionForWildcard: () => getRegularExpressionForWildcard, + getRegularExpressionsForWildcards: () => getRegularExpressionsForWildcards, + getRelativePathFromDirectory: () => getRelativePathFromDirectory, + getRelativePathFromFile: () => getRelativePathFromFile, + getRelativePathToDirectoryOrUrl: () => getRelativePathToDirectoryOrUrl, + getRenameLocation: () => getRenameLocation, + getReplacementSpanForContextToken: () => getReplacementSpanForContextToken, + getResolutionDiagnostic: () => getResolutionDiagnostic, + getResolutionModeOverrideForClause: () => getResolutionModeOverrideForClause, + getResolveJsonModule: () => getResolveJsonModule, + getResolvePackageJsonExports: () => getResolvePackageJsonExports, + getResolvePackageJsonImports: () => getResolvePackageJsonImports, + getResolvedExternalModuleName: () => getResolvedExternalModuleName, + getResolvedModule: () => getResolvedModule, + getResolvedTypeReferenceDirective: () => getResolvedTypeReferenceDirective, + getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, + getRestParameterElementType: () => getRestParameterElementType, + getRightMostAssignedExpression: () => getRightMostAssignedExpression, + getRootDeclaration: () => getRootDeclaration, + getRootLength: () => getRootLength, + getScriptKind: () => getScriptKind, + getScriptKindFromFileName: () => getScriptKindFromFileName, + getScriptTargetFeatures: () => getScriptTargetFeatures, + getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, + getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, + getSemanticClassifications: () => getSemanticClassifications, + getSemanticJsxChildren: () => getSemanticJsxChildren, + getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, + getSetAccessorValueParameter: () => getSetAccessorValueParameter, + getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, + getShebang: () => getShebang, + getSingleInitializerOfVariableStatementOrPropertyDeclaration: () => getSingleInitializerOfVariableStatementOrPropertyDeclaration, + getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, + getSnapshotText: () => getSnapshotText, + getSnippetElement: () => getSnippetElement, + getSourceFileOfModule: () => getSourceFileOfModule, + getSourceFileOfNode: () => getSourceFileOfNode, + getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, + getSourceFilePathInNewDirWorker: () => getSourceFilePathInNewDirWorker, + getSourceFileVersionAsHashFromText: () => getSourceFileVersionAsHashFromText, + getSourceFilesToEmit: () => getSourceFilesToEmit, + getSourceMapRange: () => getSourceMapRange, + getSourceMapper: () => getSourceMapper, + getSourceTextOfNodeFromSourceFile: () => getSourceTextOfNodeFromSourceFile, + getSpanOfTokenAtPosition: () => getSpanOfTokenAtPosition, + getSpellingSuggestion: () => getSpellingSuggestion, + getStartPositionOfLine: () => getStartPositionOfLine, + getStartPositionOfRange: () => getStartPositionOfRange, + getStartsOnNewLine: () => getStartsOnNewLine, + getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock, + getStrictOptionValue: () => getStrictOptionValue, + getStringComparer: () => getStringComparer, + getSuperCallFromStatement: () => getSuperCallFromStatement, + getSuperContainer: () => getSuperContainer, + getSupportedCodeFixes: () => getSupportedCodeFixes, + getSupportedExtensions: () => getSupportedExtensions, + getSupportedExtensionsWithJsonIfResolveJsonModule: () => getSupportedExtensionsWithJsonIfResolveJsonModule, + getSwitchedType: () => getSwitchedType, + getSymbolId: () => getSymbolId, + getSymbolNameForPrivateIdentifier: () => getSymbolNameForPrivateIdentifier, + getSymbolTarget: () => getSymbolTarget, + getSyntacticClassifications: () => getSyntacticClassifications, + getSyntacticModifierFlags: () => getSyntacticModifierFlags, + getSyntacticModifierFlagsNoCache: () => getSyntacticModifierFlagsNoCache, + getSynthesizedDeepClone: () => getSynthesizedDeepClone, + getSynthesizedDeepCloneWithReplacements: () => getSynthesizedDeepCloneWithReplacements, + getSynthesizedDeepClones: () => getSynthesizedDeepClones, + getSynthesizedDeepClonesWithReplacements: () => getSynthesizedDeepClonesWithReplacements, + getSyntheticLeadingComments: () => getSyntheticLeadingComments, + getSyntheticTrailingComments: () => getSyntheticTrailingComments, + getTargetLabel: () => getTargetLabel, + getTargetOfBindingOrAssignmentElement: () => getTargetOfBindingOrAssignmentElement, + getTemporaryModuleResolutionState: () => getTemporaryModuleResolutionState, + getTextOfConstantValue: () => getTextOfConstantValue, + getTextOfIdentifierOrLiteral: () => getTextOfIdentifierOrLiteral, + getTextOfJSDocComment: () => getTextOfJSDocComment, + getTextOfNode: () => getTextOfNode, + getTextOfNodeFromSourceText: () => getTextOfNodeFromSourceText, + getTextOfPropertyName: () => getTextOfPropertyName, + getThisContainer: () => getThisContainer, + getThisParameter: () => getThisParameter, + getTokenAtPosition: () => getTokenAtPosition, + getTokenPosOfNode: () => getTokenPosOfNode, + getTokenSourceMapRange: () => getTokenSourceMapRange, + getTouchingPropertyName: () => getTouchingPropertyName, + getTouchingToken: () => getTouchingToken, + getTrailingCommentRanges: () => getTrailingCommentRanges, + getTrailingSemicolonDeferringWriter: () => getTrailingSemicolonDeferringWriter, + getTransformFlagsSubtreeExclusions: () => getTransformFlagsSubtreeExclusions, + getTransformers: () => getTransformers, + getTsBuildInfoEmitOutputFilePath: () => getTsBuildInfoEmitOutputFilePath, + getTsConfigObjectLiteralExpression: () => getTsConfigObjectLiteralExpression, + getTsConfigPropArray: () => getTsConfigPropArray, + getTsConfigPropArrayElementValue: () => getTsConfigPropArrayElementValue, + getTypeAnnotationNode: () => getTypeAnnotationNode, + getTypeArgumentOrTypeParameterList: () => getTypeArgumentOrTypeParameterList, + getTypeKeywordOfTypeOnlyImport: () => getTypeKeywordOfTypeOnlyImport, + getTypeNode: () => getTypeNode, + getTypeNodeIfAccessible: () => getTypeNodeIfAccessible, + getTypeParameterFromJsDoc: () => getTypeParameterFromJsDoc, + getTypeParameterOwner: () => getTypeParameterOwner, + getTypesPackageName: () => getTypesPackageName, + getUILocale: () => getUILocale, + getUniqueName: () => getUniqueName, + getUniqueSymbolId: () => getUniqueSymbolId, + getUseDefineForClassFields: () => getUseDefineForClassFields, + getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, + getWatchFactory: () => getWatchFactory, + group: () => group, + groupBy: () => groupBy, + guessIndentation: () => guessIndentation, + handleNoEmitOptions: () => handleNoEmitOptions, + hasAbstractModifier: () => hasAbstractModifier, + hasAccessorModifier: () => hasAccessorModifier, + hasAmbientModifier: () => hasAmbientModifier, + hasChangesInResolutions: () => hasChangesInResolutions, + hasChildOfKind: () => hasChildOfKind, + hasContextSensitiveParameters: () => hasContextSensitiveParameters, + hasDecorators: () => hasDecorators, + hasDocComment: () => hasDocComment, + hasDynamicName: () => hasDynamicName, + hasEffectiveModifier: () => hasEffectiveModifier, + hasEffectiveModifiers: () => hasEffectiveModifiers, + hasEffectiveReadonlyModifier: () => hasEffectiveReadonlyModifier, + hasExtension: () => hasExtension, + hasIndexSignature: () => hasIndexSignature, + hasInitializer: () => hasInitializer, + hasInvalidEscape: () => hasInvalidEscape, + hasJSDocNodes: () => hasJSDocNodes, + hasJSDocParameterTags: () => hasJSDocParameterTags, + hasJSFileExtension: () => hasJSFileExtension, + hasJsonModuleEmitEnabled: () => hasJsonModuleEmitEnabled, + hasOnlyExpressionInitializer: () => hasOnlyExpressionInitializer, + hasOverrideModifier: () => hasOverrideModifier, + hasPossibleExternalModuleReference: () => hasPossibleExternalModuleReference, + hasProperty: () => hasProperty, + hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName, + hasQuestionToken: () => hasQuestionToken, + hasRecordedExternalHelpers: () => hasRecordedExternalHelpers, + hasRestParameter: () => hasRestParameter, + hasScopeMarker: () => hasScopeMarker, + hasStaticModifier: () => hasStaticModifier, + hasSyntacticModifier: () => hasSyntacticModifier, + hasSyntacticModifiers: () => hasSyntacticModifiers, + hasTSFileExtension: () => hasTSFileExtension, + hasTabstop: () => hasTabstop, + hasTrailingDirectorySeparator: () => hasTrailingDirectorySeparator, + hasType: () => hasType, + hasTypeArguments: () => hasTypeArguments, + hasZeroOrOneAsteriskCharacter: () => hasZeroOrOneAsteriskCharacter, + helperString: () => helperString, + hostGetCanonicalFileName: () => hostGetCanonicalFileName, + hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, + idText: () => idText, + identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, + identity: () => identity, + identitySourceMapConsumer: () => identitySourceMapConsumer, + ignoreSourceNewlines: () => ignoreSourceNewlines, + ignoredPaths: () => ignoredPaths, + importDefaultHelper: () => importDefaultHelper, + importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, + importStarHelper: () => importStarHelper, + indexOfAnyCharCode: () => indexOfAnyCharCode, + indexOfNode: () => indexOfNode, + indicesOf: () => indicesOf, + inferredTypesContainingFile: () => inferredTypesContainingFile, + insertImports: () => insertImports, + insertLeadingStatement: () => insertLeadingStatement, + insertSorted: () => insertSorted, + insertStatementAfterCustomPrologue: () => insertStatementAfterCustomPrologue, + insertStatementAfterStandardPrologue: () => insertStatementAfterStandardPrologue, + insertStatementsAfterCustomPrologue: () => insertStatementsAfterCustomPrologue, + insertStatementsAfterStandardPrologue: () => insertStatementsAfterStandardPrologue, + intersperse: () => intersperse, + introducesArgumentsExoticObject: () => introducesArgumentsExoticObject, + inverseJsxOptionMap: () => inverseJsxOptionMap, + isAbstractConstructorSymbol: () => isAbstractConstructorSymbol, + isAbstractModifier: () => isAbstractModifier, + isAccessExpression: () => isAccessExpression, + isAccessibilityModifier: () => isAccessibilityModifier, + isAccessor: () => isAccessor, + isAccessorModifier: () => isAccessorModifier, + isAliasSymbolDeclaration: () => isAliasSymbolDeclaration, + isAliasableExpression: () => isAliasableExpression, + isAmbientModule: () => isAmbientModule, + isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, + isAnyDirectorySeparator: () => isAnyDirectorySeparator, + isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, + isAnyImportOrReExport: () => isAnyImportOrReExport, + isAnyImportSyntax: () => isAnyImportSyntax, + isAnySupportedFileExtension: () => isAnySupportedFileExtension, + isApplicableVersionedTypesKey: () => isApplicableVersionedTypesKey, + isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, + isArray: () => isArray, + isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, + isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, + isArrayBindingPattern: () => isArrayBindingPattern, + isArrayLiteralExpression: () => isArrayLiteralExpression, + isArrayLiteralOrObjectLiteralDestructuringPattern: () => isArrayLiteralOrObjectLiteralDestructuringPattern, + isArrayTypeNode: () => isArrayTypeNode, + isArrowFunction: () => isArrowFunction, + isAsExpression: () => isAsExpression, + isAssertClause: () => isAssertClause, + isAssertEntry: () => isAssertEntry, + isAssertionExpression: () => isAssertionExpression, + isAssertionKey: () => isAssertionKey, + isAssertsKeyword: () => isAssertsKeyword, + isAssignmentDeclaration: () => isAssignmentDeclaration, + isAssignmentExpression: () => isAssignmentExpression, + isAssignmentOperator: () => isAssignmentOperator, + isAssignmentPattern: () => isAssignmentPattern, + isAssignmentTarget: () => isAssignmentTarget, + isAsteriskToken: () => isAsteriskToken, + isAsyncFunction: () => isAsyncFunction, + isAsyncModifier: () => isAsyncModifier, + isAutoAccessorPropertyDeclaration: () => isAutoAccessorPropertyDeclaration, + isAwaitExpression: () => isAwaitExpression, + isAwaitKeyword: () => isAwaitKeyword, + isBigIntLiteral: () => isBigIntLiteral, + isBinaryExpression: () => isBinaryExpression, + isBinaryOperatorToken: () => isBinaryOperatorToken, + isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall, + isBindableStaticAccessExpression: () => isBindableStaticAccessExpression, + isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, + isBindableStaticNameExpression: () => isBindableStaticNameExpression, + isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, + isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, + isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, + isBindingPattern: () => isBindingPattern, + isBlock: () => isBlock, + isBlockOrCatchScoped: () => isBlockOrCatchScoped, + isBlockScope: () => isBlockScope, + isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel, + isBooleanLiteral: () => isBooleanLiteral, + isBreakOrContinueStatement: () => isBreakOrContinueStatement, + isBreakStatement: () => isBreakStatement, + isBuildInfoFile: () => isBuildInfoFile, + isBuilderProgram: () => isBuilderProgram2, + isBundle: () => isBundle, + isBundleFileTextLike: () => isBundleFileTextLike, + isCallChain: () => isCallChain, + isCallExpression: () => isCallExpression, + isCallExpressionTarget: () => isCallExpressionTarget, + isCallLikeExpression: () => isCallLikeExpression, + isCallOrNewExpression: () => isCallOrNewExpression, + isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget, + isCallSignatureDeclaration: () => isCallSignatureDeclaration, + isCallToHelper: () => isCallToHelper, + isCaseBlock: () => isCaseBlock, + isCaseClause: () => isCaseClause, + isCaseKeyword: () => isCaseKeyword, + isCaseOrDefaultClause: () => isCaseOrDefaultClause, + isCatchClause: () => isCatchClause, + isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration, + isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement, + isCheckJsEnabledForFile: () => isCheckJsEnabledForFile, + isChildOfNodeWithKind: () => isChildOfNodeWithKind, + isCircularBuildOrder: () => isCircularBuildOrder, + isClassDeclaration: () => isClassDeclaration, + isClassElement: () => isClassElement, + isClassExpression: () => isClassExpression, + isClassLike: () => isClassLike, + isClassMemberModifier: () => isClassMemberModifier, + isClassOrTypeElement: () => isClassOrTypeElement, + isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, + isCollapsedRange: () => isCollapsedRange, + isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, + isCommaListExpression: () => isCommaListExpression, + isCommaSequence: () => isCommaSequence, + isCommaToken: () => isCommaToken, + isComment: () => isComment, + isCommonJsExportPropertyAssignment: () => isCommonJsExportPropertyAssignment, + isCommonJsExportedExpression: () => isCommonJsExportedExpression, + isCompoundAssignment: () => isCompoundAssignment, + isComputedNonLiteralName: () => isComputedNonLiteralName, + isComputedPropertyName: () => isComputedPropertyName, + isConciseBody: () => isConciseBody, + isConditionalExpression: () => isConditionalExpression, + isConditionalTypeNode: () => isConditionalTypeNode, + isConstTypeReference: () => isConstTypeReference, + isConstructSignatureDeclaration: () => isConstructSignatureDeclaration, + isConstructorDeclaration: () => isConstructorDeclaration, + isConstructorTypeNode: () => isConstructorTypeNode, + isContextualKeyword: () => isContextualKeyword, + isContinueStatement: () => isContinueStatement, + isCustomPrologue: () => isCustomPrologue, + isDebuggerStatement: () => isDebuggerStatement, + isDeclaration: () => isDeclaration, + isDeclarationBindingElement: () => isDeclarationBindingElement, + isDeclarationFileName: () => isDeclarationFileName, + isDeclarationName: () => isDeclarationName, + isDeclarationNameOfEnumOrNamespace: () => isDeclarationNameOfEnumOrNamespace, + isDeclarationReadonly: () => isDeclarationReadonly, + isDeclarationStatement: () => isDeclarationStatement, + isDeclarationWithTypeParameterChildren: () => isDeclarationWithTypeParameterChildren, + isDeclarationWithTypeParameters: () => isDeclarationWithTypeParameters, + isDecorator: () => isDecorator, + isDecoratorTarget: () => isDecoratorTarget, + isDefaultClause: () => isDefaultClause, + isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, + isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, + isDeleteExpression: () => isDeleteExpression, + isDeleteTarget: () => isDeleteTarget, + isDeprecatedDeclaration: () => isDeprecatedDeclaration, + isDestructuringAssignment: () => isDestructuringAssignment, + isDiagnosticWithLocation: () => isDiagnosticWithLocation, + isDiskPathRoot: () => isDiskPathRoot, + isDoStatement: () => isDoStatement, + isDotDotDotToken: () => isDotDotDotToken, + isDottedName: () => isDottedName, + isDynamicName: () => isDynamicName, + isESSymbolIdentifier: () => isESSymbolIdentifier, + isEffectiveExternalModule: () => isEffectiveExternalModule, + isEffectiveModuleDeclaration: () => isEffectiveModuleDeclaration, + isEffectiveStrictModeSourceFile: () => isEffectiveStrictModeSourceFile, + isElementAccessChain: () => isElementAccessChain, + isElementAccessExpression: () => isElementAccessExpression, + isEmittedFileOfProgram: () => isEmittedFileOfProgram, + isEmptyArrayLiteral: () => isEmptyArrayLiteral, + isEmptyBindingElement: () => isEmptyBindingElement, + isEmptyBindingPattern: () => isEmptyBindingPattern, + isEmptyObjectLiteral: () => isEmptyObjectLiteral, + isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, + isEndOfDeclarationMarker: () => isEndOfDeclarationMarker, + isEntityName: () => isEntityName, + isEntityNameExpression: () => isEntityNameExpression, + isEnumConst: () => isEnumConst, + isEnumDeclaration: () => isEnumDeclaration, + isEnumMember: () => isEnumMember, + isEqualityOperatorKind: () => isEqualityOperatorKind, + isEqualsGreaterThanToken: () => isEqualsGreaterThanToken, + isExclamationToken: () => isExclamationToken, + isExcludedFile: () => isExcludedFile, + isExclusivelyTypeOnlyImportOrExport: () => isExclusivelyTypeOnlyImportOrExport, + isExportAssignment: () => isExportAssignment, + isExportDeclaration: () => isExportDeclaration, + isExportModifier: () => isExportModifier, + isExportName: () => isExportName, + isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, + isExportSpecifier: () => isExportSpecifier, + isExportsIdentifier: () => isExportsIdentifier, + isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, + isExpression: () => isExpression, + isExpressionNode: () => isExpressionNode, + isExpressionOfExternalModuleImportEqualsDeclaration: () => isExpressionOfExternalModuleImportEqualsDeclaration, + isExpressionOfOptionalChainRoot: () => isExpressionOfOptionalChainRoot, + isExpressionStatement: () => isExpressionStatement, + isExpressionWithTypeArguments: () => isExpressionWithTypeArguments, + isExpressionWithTypeArgumentsInClassExtendsClause: () => isExpressionWithTypeArgumentsInClassExtendsClause, + isExternalModule: () => isExternalModule, + isExternalModuleAugmentation: () => isExternalModuleAugmentation, + isExternalModuleImportEqualsDeclaration: () => isExternalModuleImportEqualsDeclaration, + isExternalModuleIndicator: () => isExternalModuleIndicator, + isExternalModuleNameRelative: () => isExternalModuleNameRelative, + isExternalModuleReference: () => isExternalModuleReference, + isExternalModuleSymbol: () => isExternalModuleSymbol, + isExternalOrCommonJsModule: () => isExternalOrCommonJsModule, + isFileLevelUniqueName: () => isFileLevelUniqueName, + isFileProbablyExternalModule: () => isFileProbablyExternalModule, + isFirstDeclarationOfSymbolParameter: () => isFirstDeclarationOfSymbolParameter, + isFixablePromiseHandler: () => isFixablePromiseHandler, + isForInOrOfStatement: () => isForInOrOfStatement, + isForInStatement: () => isForInStatement, + isForInitializer: () => isForInitializer, + isForOfStatement: () => isForOfStatement, + isForStatement: () => isForStatement, + isFunctionBlock: () => isFunctionBlock, + isFunctionBody: () => isFunctionBody, + isFunctionDeclaration: () => isFunctionDeclaration, + isFunctionExpression: () => isFunctionExpression, + isFunctionExpressionOrArrowFunction: () => isFunctionExpressionOrArrowFunction, + isFunctionLike: () => isFunctionLike, + isFunctionLikeDeclaration: () => isFunctionLikeDeclaration, + isFunctionLikeKind: () => isFunctionLikeKind, + isFunctionLikeOrClassStaticBlockDeclaration: () => isFunctionLikeOrClassStaticBlockDeclaration, + isFunctionOrConstructorTypeNode: () => isFunctionOrConstructorTypeNode, + isFunctionOrModuleBlock: () => isFunctionOrModuleBlock, + isFunctionSymbol: () => isFunctionSymbol, + isFunctionTypeNode: () => isFunctionTypeNode, + isFutureReservedKeyword: () => isFutureReservedKeyword, + isGeneratedIdentifier: () => isGeneratedIdentifier, + isGeneratedPrivateIdentifier: () => isGeneratedPrivateIdentifier, + isGetAccessor: () => isGetAccessor, + isGetAccessorDeclaration: () => isGetAccessorDeclaration, + isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, + isGlobalDeclaration: () => isGlobalDeclaration, + isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, + isGrammarError: () => isGrammarError, + isHeritageClause: () => isHeritageClause, + isHoistedFunction: () => isHoistedFunction, + isHoistedVariableStatement: () => isHoistedVariableStatement, + isIdentifier: () => isIdentifier, + isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, + isIdentifierName: () => isIdentifierName, + isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, + isIdentifierPart: () => isIdentifierPart, + isIdentifierStart: () => isIdentifierStart, + isIdentifierText: () => isIdentifierText, + isIdentifierTypePredicate: () => isIdentifierTypePredicate, + isIdentifierTypeReference: () => isIdentifierTypeReference, + isIfStatement: () => isIfStatement, + isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching, + isImplicitGlob: () => isImplicitGlob, + isImportCall: () => isImportCall, + isImportClause: () => isImportClause, + isImportDeclaration: () => isImportDeclaration, + isImportEqualsDeclaration: () => isImportEqualsDeclaration, + isImportKeyword: () => isImportKeyword, + isImportMeta: () => isImportMeta, + isImportOrExportSpecifier: () => isImportOrExportSpecifier, + isImportOrExportSpecifierName: () => isImportOrExportSpecifierName, + isImportSpecifier: () => isImportSpecifier, + isImportTypeAssertionContainer: () => isImportTypeAssertionContainer, + isImportTypeNode: () => isImportTypeNode, + isImportableFile: () => isImportableFile, + isInComment: () => isInComment, + isInExpressionContext: () => isInExpressionContext, + isInJSDoc: () => isInJSDoc, + isInJSFile: () => isInJSFile, + isInJSXText: () => isInJSXText, + isInJsonFile: () => isInJsonFile, + isInNonReferenceComment: () => isInNonReferenceComment, + isInReferenceComment: () => isInReferenceComment, + isInRightSideOfInternalImportEqualsDeclaration: () => isInRightSideOfInternalImportEqualsDeclaration, + isInString: () => isInString, + isInTemplateString: () => isInTemplateString, + isInTopLevelContext: () => isInTopLevelContext, + isIncrementalCompilation: () => isIncrementalCompilation, + isIndexSignatureDeclaration: () => isIndexSignatureDeclaration, + isIndexedAccessTypeNode: () => isIndexedAccessTypeNode, + isInferTypeNode: () => isInferTypeNode, + isInfinityOrNaNString: () => isInfinityOrNaNString, + isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, + isInsideJsxElement: () => isInsideJsxElement, + isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, + isInsideNodeModules: () => isInsideNodeModules, + isInsideTemplateLiteral: () => isInsideTemplateLiteral, + isInstantiatedModule: () => isInstantiatedModule, + isInterfaceDeclaration: () => isInterfaceDeclaration, + isInternalDeclaration: () => isInternalDeclaration, + isInternalModuleImportEqualsDeclaration: () => isInternalModuleImportEqualsDeclaration, + isInternalName: () => isInternalName, + isIntersectionTypeNode: () => isIntersectionTypeNode, + isIntrinsicJsxName: () => isIntrinsicJsxName, + isIterationStatement: () => isIterationStatement, + isJSDoc: () => isJSDoc, + isJSDocAllType: () => isJSDocAllType, + isJSDocAugmentsTag: () => isJSDocAugmentsTag, + isJSDocAuthorTag: () => isJSDocAuthorTag, + isJSDocCallbackTag: () => isJSDocCallbackTag, + isJSDocClassTag: () => isJSDocClassTag, + isJSDocCommentContainingNode: () => isJSDocCommentContainingNode, + isJSDocConstructSignature: () => isJSDocConstructSignature, + isJSDocDeprecatedTag: () => isJSDocDeprecatedTag, + isJSDocEnumTag: () => isJSDocEnumTag, + isJSDocFunctionType: () => isJSDocFunctionType, + isJSDocImplementsTag: () => isJSDocImplementsTag, + isJSDocIndexSignature: () => isJSDocIndexSignature, + isJSDocLikeText: () => isJSDocLikeText, + isJSDocLink: () => isJSDocLink, + isJSDocLinkCode: () => isJSDocLinkCode, + isJSDocLinkLike: () => isJSDocLinkLike, + isJSDocLinkPlain: () => isJSDocLinkPlain, + isJSDocMemberName: () => isJSDocMemberName, + isJSDocNameReference: () => isJSDocNameReference, + isJSDocNamepathType: () => isJSDocNamepathType, + isJSDocNamespaceBody: () => isJSDocNamespaceBody, + isJSDocNode: () => isJSDocNode, + isJSDocNonNullableType: () => isJSDocNonNullableType, + isJSDocNullableType: () => isJSDocNullableType, + isJSDocOptionalParameter: () => isJSDocOptionalParameter, + isJSDocOptionalType: () => isJSDocOptionalType, + isJSDocOverloadTag: () => isJSDocOverloadTag, + isJSDocOverrideTag: () => isJSDocOverrideTag, + isJSDocParameterTag: () => isJSDocParameterTag, + isJSDocPrivateTag: () => isJSDocPrivateTag, + isJSDocPropertyLikeTag: () => isJSDocPropertyLikeTag, + isJSDocPropertyTag: () => isJSDocPropertyTag, + isJSDocProtectedTag: () => isJSDocProtectedTag, + isJSDocPublicTag: () => isJSDocPublicTag, + isJSDocReadonlyTag: () => isJSDocReadonlyTag, + isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, + isJSDocSeeTag: () => isJSDocSeeTag, + isJSDocSignature: () => isJSDocSignature, + isJSDocTag: () => isJSDocTag, + isJSDocTemplateTag: () => isJSDocTemplateTag, + isJSDocThisTag: () => isJSDocThisTag, + isJSDocThrowsTag: () => isJSDocThrowsTag, + isJSDocTypeAlias: () => isJSDocTypeAlias, + isJSDocTypeAssertion: () => isJSDocTypeAssertion, + isJSDocTypeExpression: () => isJSDocTypeExpression, + isJSDocTypeLiteral: () => isJSDocTypeLiteral, + isJSDocTypeTag: () => isJSDocTypeTag, + isJSDocTypedefTag: () => isJSDocTypedefTag, + isJSDocUnknownTag: () => isJSDocUnknownTag, + isJSDocUnknownType: () => isJSDocUnknownType, + isJSDocVariadicType: () => isJSDocVariadicType, + isJSXTagName: () => isJSXTagName, + isJsonEqual: () => isJsonEqual, + isJsonSourceFile: () => isJsonSourceFile, + isJsxAttribute: () => isJsxAttribute, + isJsxAttributeLike: () => isJsxAttributeLike, + isJsxAttributes: () => isJsxAttributes, + isJsxChild: () => isJsxChild, + isJsxClosingElement: () => isJsxClosingElement, + isJsxClosingFragment: () => isJsxClosingFragment, + isJsxElement: () => isJsxElement, + isJsxExpression: () => isJsxExpression, + isJsxFragment: () => isJsxFragment, + isJsxOpeningElement: () => isJsxOpeningElement, + isJsxOpeningFragment: () => isJsxOpeningFragment, + isJsxOpeningLikeElement: () => isJsxOpeningLikeElement, + isJsxOpeningLikeElementTagName: () => isJsxOpeningLikeElementTagName, + isJsxSelfClosingElement: () => isJsxSelfClosingElement, + isJsxSpreadAttribute: () => isJsxSpreadAttribute, + isJsxTagNameExpression: () => isJsxTagNameExpression, + isJsxText: () => isJsxText, + isJumpStatementTarget: () => isJumpStatementTarget, + isKeyword: () => isKeyword, + isKnownSymbol: () => isKnownSymbol, + isLabelName: () => isLabelName, + isLabelOfLabeledStatement: () => isLabelOfLabeledStatement, + isLabeledStatement: () => isLabeledStatement, + isLateVisibilityPaintedStatement: () => isLateVisibilityPaintedStatement, + isLeftHandSideExpression: () => isLeftHandSideExpression, + isLeftHandSideOfAssignment: () => isLeftHandSideOfAssignment, + isLet: () => isLet, + isLineBreak: () => isLineBreak, + isLiteralComputedPropertyDeclarationName: () => isLiteralComputedPropertyDeclarationName, + isLiteralExpression: () => isLiteralExpression, + isLiteralExpressionOfObject: () => isLiteralExpressionOfObject, + isLiteralImportTypeNode: () => isLiteralImportTypeNode, + isLiteralKind: () => isLiteralKind, + isLiteralLikeAccess: () => isLiteralLikeAccess, + isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, + isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, + isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, + isLiteralTypeNode: () => isLiteralTypeNode, + isLocalName: () => isLocalName, + isLogicalOperator: () => isLogicalOperator, + isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, + isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, + isMappedTypeNode: () => isMappedTypeNode, + isMemberName: () => isMemberName, + isMergeDeclarationMarker: () => isMergeDeclarationMarker, + isMetaProperty: () => isMetaProperty, + isMethodDeclaration: () => isMethodDeclaration, + isMethodOrAccessor: () => isMethodOrAccessor, + isMethodSignature: () => isMethodSignature, + isMinusToken: () => isMinusToken, + isMissingDeclaration: () => isMissingDeclaration, + isModifier: () => isModifier, + isModifierKind: () => isModifierKind, + isModifierLike: () => isModifierLike, + isModuleAugmentationExternal: () => isModuleAugmentationExternal, + isModuleBlock: () => isModuleBlock, + isModuleBody: () => isModuleBody, + isModuleDeclaration: () => isModuleDeclaration, + isModuleExportsAccessExpression: () => isModuleExportsAccessExpression, + isModuleIdentifier: () => isModuleIdentifier, + isModuleName: () => isModuleName, + isModuleOrEnumDeclaration: () => isModuleOrEnumDeclaration, + isModuleReference: () => isModuleReference, + isModuleSpecifierLike: () => isModuleSpecifierLike, + isModuleWithStringLiteralName: () => isModuleWithStringLiteralName, + isNameOfFunctionDeclaration: () => isNameOfFunctionDeclaration, + isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, + isNamedClassElement: () => isNamedClassElement, + isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, + isNamedExportBindings: () => isNamedExportBindings, + isNamedExports: () => isNamedExports, + isNamedImportBindings: () => isNamedImportBindings, + isNamedImports: () => isNamedImports, + isNamedImportsOrExports: () => isNamedImportsOrExports, + isNamedTupleMember: () => isNamedTupleMember, + isNamespaceBody: () => isNamespaceBody, + isNamespaceExport: () => isNamespaceExport, + isNamespaceExportDeclaration: () => isNamespaceExportDeclaration, + isNamespaceImport: () => isNamespaceImport, + isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration, + isNewExpression: () => isNewExpression, + isNewExpressionTarget: () => isNewExpressionTarget, + isNightly: () => isNightly, + isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral, + isNode: () => isNode, + isNodeArray: () => isNodeArray, + isNodeArrayMultiLine: () => isNodeArrayMultiLine, + isNodeDescendantOf: () => isNodeDescendantOf, + isNodeKind: () => isNodeKind, + isNodeLikeSystem: () => isNodeLikeSystem, + isNodeModulesDirectory: () => isNodeModulesDirectory, + isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, + isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, + isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, + isNonGlobalDeclaration: () => isNonGlobalDeclaration, + isNonNullAccess: () => isNonNullAccess, + isNonNullChain: () => isNonNullChain, + isNonNullExpression: () => isNonNullExpression, + isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName, + isNotEmittedOrPartiallyEmittedNode: () => isNotEmittedOrPartiallyEmittedNode, + isNotEmittedStatement: () => isNotEmittedStatement, + isNullishCoalesce: () => isNullishCoalesce, + isNumber: () => isNumber, + isNumericLiteral: () => isNumericLiteral, + isNumericLiteralName: () => isNumericLiteralName, + isObjectBindingElementWithoutPropertyName: () => isObjectBindingElementWithoutPropertyName, + isObjectBindingOrAssignmentElement: () => isObjectBindingOrAssignmentElement, + isObjectBindingOrAssignmentPattern: () => isObjectBindingOrAssignmentPattern, + isObjectBindingPattern: () => isObjectBindingPattern, + isObjectLiteralElement: () => isObjectLiteralElement, + isObjectLiteralElementLike: () => isObjectLiteralElementLike, + isObjectLiteralExpression: () => isObjectLiteralExpression, + isObjectLiteralMethod: () => isObjectLiteralMethod, + isObjectLiteralOrClassExpressionMethodOrAccessor: () => isObjectLiteralOrClassExpressionMethodOrAccessor, + isObjectTypeDeclaration: () => isObjectTypeDeclaration, + isOctalDigit: () => isOctalDigit, + isOmittedExpression: () => isOmittedExpression, + isOptionalChain: () => isOptionalChain, + isOptionalChainRoot: () => isOptionalChainRoot, + isOptionalDeclaration: () => isOptionalDeclaration, + isOptionalJSDocPropertyLikeTag: () => isOptionalJSDocPropertyLikeTag, + isOptionalTypeNode: () => isOptionalTypeNode, + isOuterExpression: () => isOuterExpression, + isOutermostOptionalChain: () => isOutermostOptionalChain, + isOverrideModifier: () => isOverrideModifier, + isPackedArrayLiteral: () => isPackedArrayLiteral, + isParameter: () => isParameter, + isParameterDeclaration: () => isParameterDeclaration, + isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable, + isParameterPropertyDeclaration: () => isParameterPropertyDeclaration, + isParameterPropertyModifier: () => isParameterPropertyModifier, + isParenthesizedExpression: () => isParenthesizedExpression, + isParenthesizedTypeNode: () => isParenthesizedTypeNode, + isParseTreeNode: () => isParseTreeNode, + isPartOfTypeNode: () => isPartOfTypeNode, + isPartOfTypeQuery: () => isPartOfTypeQuery, + isPartiallyEmittedExpression: () => isPartiallyEmittedExpression, + isPatternMatch: () => isPatternMatch, + isPinnedComment: () => isPinnedComment, + isPlainJsFile: () => isPlainJsFile, + isPlusToken: () => isPlusToken, + isPossiblyTypeArgumentPosition: () => isPossiblyTypeArgumentPosition, + isPostfixUnaryExpression: () => isPostfixUnaryExpression, + isPrefixUnaryExpression: () => isPrefixUnaryExpression, + isPrivateIdentifier: () => isPrivateIdentifier, + isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration, + isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression, + isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol, + isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo, + isProgramUptoDate: () => isProgramUptoDate, + isPrologueDirective: () => isPrologueDirective, + isPropertyAccessChain: () => isPropertyAccessChain, + isPropertyAccessEntityNameExpression: () => isPropertyAccessEntityNameExpression, + isPropertyAccessExpression: () => isPropertyAccessExpression, + isPropertyAccessOrQualifiedName: () => isPropertyAccessOrQualifiedName, + isPropertyAccessOrQualifiedNameOrImportTypeNode: () => isPropertyAccessOrQualifiedNameOrImportTypeNode, + isPropertyAssignment: () => isPropertyAssignment, + isPropertyDeclaration: () => isPropertyDeclaration, + isPropertyName: () => isPropertyName, + isPropertyNameLiteral: () => isPropertyNameLiteral, + isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, + isPrototypeAccess: () => isPrototypeAccess, + isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, + isPunctuation: () => isPunctuation, + isPushOrUnshiftIdentifier: () => isPushOrUnshiftIdentifier, + isQualifiedName: () => isQualifiedName, + isQuestionDotToken: () => isQuestionDotToken, + isQuestionOrExclamationToken: () => isQuestionOrExclamationToken, + isQuestionOrPlusOrMinusToken: () => isQuestionOrPlusOrMinusToken, + isQuestionToken: () => isQuestionToken, + isRawSourceMap: () => isRawSourceMap, + isReadonlyKeyword: () => isReadonlyKeyword, + isReadonlyKeywordOrPlusOrMinusToken: () => isReadonlyKeywordOrPlusOrMinusToken, + isRecognizedTripleSlashComment: () => isRecognizedTripleSlashComment, + isReferenceFileLocation: () => isReferenceFileLocation, + isReferencedFile: () => isReferencedFile, + isRegularExpressionLiteral: () => isRegularExpressionLiteral, + isRequireCall: () => isRequireCall, + isRequireVariableStatement: () => isRequireVariableStatement, + isRestParameter: () => isRestParameter, + isRestTypeNode: () => isRestTypeNode, + isReturnStatement: () => isReturnStatement, + isReturnStatementWithFixablePromiseHandler: () => isReturnStatementWithFixablePromiseHandler, + isRightSideOfAccessExpression: () => isRightSideOfAccessExpression, + isRightSideOfPropertyAccess: () => isRightSideOfPropertyAccess, + isRightSideOfQualifiedName: () => isRightSideOfQualifiedName, + isRightSideOfQualifiedNameOrPropertyAccess: () => isRightSideOfQualifiedNameOrPropertyAccess, + isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName: () => isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName, + isRootedDiskPath: () => isRootedDiskPath, + isSameEntityName: () => isSameEntityName, + isSatisfiesExpression: () => isSatisfiesExpression, + isScopeMarker: () => isScopeMarker, + isSemicolonClassElement: () => isSemicolonClassElement, + isSetAccessor: () => isSetAccessor, + isSetAccessorDeclaration: () => isSetAccessorDeclaration, + isShebangTrivia: () => isShebangTrivia, + isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol, + isShorthandPropertyAssignment: () => isShorthandPropertyAssignment, + isSignedNumericLiteral: () => isSignedNumericLiteral, + isSimpleCopiableExpression: () => isSimpleCopiableExpression, + isSimpleInlineableExpression: () => isSimpleInlineableExpression, + isSingleOrDoubleQuote: () => isSingleOrDoubleQuote, + isSourceFile: () => isSourceFile, + isSourceFileFromLibrary: () => isSourceFileFromLibrary, + isSourceFileJS: () => isSourceFileJS, + isSourceFileNotJS: () => isSourceFileNotJS, + isSourceFileNotJson: () => isSourceFileNotJson, + isSourceMapping: () => isSourceMapping, + isSpecialPropertyDeclaration: () => isSpecialPropertyDeclaration, + isSpreadAssignment: () => isSpreadAssignment, + isSpreadElement: () => isSpreadElement, + isStatement: () => isStatement, + isStatementButNotDeclaration: () => isStatementButNotDeclaration, + isStatementOrBlock: () => isStatementOrBlock, + isStatementWithLocals: () => isStatementWithLocals, + isStatic: () => isStatic, + isStaticModifier: () => isStaticModifier, + isString: () => isString, + isStringAKeyword: () => isStringAKeyword, + isStringANonContextualKeyword: () => isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, + isStringDoubleQuoted: () => isStringDoubleQuoted, + isStringLiteral: () => isStringLiteral, + isStringLiteralLike: () => isStringLiteralLike, + isStringLiteralOrJsxExpression: () => isStringLiteralOrJsxExpression, + isStringLiteralOrTemplate: () => isStringLiteralOrTemplate, + isStringOrNumericLiteralLike: () => isStringOrNumericLiteralLike, + isStringOrRegularExpressionOrTemplateLiteral: () => isStringOrRegularExpressionOrTemplateLiteral, + isStringTextContainingNode: () => isStringTextContainingNode, + isSuperCall: () => isSuperCall, + isSuperKeyword: () => isSuperKeyword, + isSuperOrSuperProperty: () => isSuperOrSuperProperty, + isSuperProperty: () => isSuperProperty, + isSupportedSourceFileName: () => isSupportedSourceFileName, + isSwitchStatement: () => isSwitchStatement, + isSyntaxList: () => isSyntaxList, + isSyntheticExpression: () => isSyntheticExpression, + isSyntheticReference: () => isSyntheticReference, + isTagName: () => isTagName, + isTaggedTemplateExpression: () => isTaggedTemplateExpression, + isTaggedTemplateTag: () => isTaggedTemplateTag, + isTemplateExpression: () => isTemplateExpression, + isTemplateHead: () => isTemplateHead, + isTemplateLiteral: () => isTemplateLiteral, + isTemplateLiteralKind: () => isTemplateLiteralKind, + isTemplateLiteralToken: () => isTemplateLiteralToken, + isTemplateLiteralTypeNode: () => isTemplateLiteralTypeNode, + isTemplateLiteralTypeSpan: () => isTemplateLiteralTypeSpan, + isTemplateMiddle: () => isTemplateMiddle, + isTemplateMiddleOrTemplateTail: () => isTemplateMiddleOrTemplateTail, + isTemplateSpan: () => isTemplateSpan, + isTemplateTail: () => isTemplateTail, + isTextWhiteSpaceLike: () => isTextWhiteSpaceLike, + isThis: () => isThis, + isThisContainerOrFunctionBlock: () => isThisContainerOrFunctionBlock, + isThisIdentifier: () => isThisIdentifier, + isThisInTypeQuery: () => isThisInTypeQuery, + isThisInitializedDeclaration: () => isThisInitializedDeclaration, + isThisInitializedObjectBindingExpression: () => isThisInitializedObjectBindingExpression, + isThisProperty: () => isThisProperty, + isThisTypeNode: () => isThisTypeNode, + isThisTypeParameter: () => isThisTypeParameter, + isThisTypePredicate: () => isThisTypePredicate, + isThrowStatement: () => isThrowStatement, + isToken: () => isToken, + isTokenKind: () => isTokenKind, + isTraceEnabled: () => isTraceEnabled, + isTransientSymbol: () => isTransientSymbol, + isTrivia: () => isTrivia, + isTryStatement: () => isTryStatement, + isTupleTypeNode: () => isTupleTypeNode, + isTypeAlias: () => isTypeAlias, + isTypeAliasDeclaration: () => isTypeAliasDeclaration, + isTypeAssertionExpression: () => isTypeAssertionExpression, + isTypeDeclaration: () => isTypeDeclaration, + isTypeElement: () => isTypeElement, + isTypeKeyword: () => isTypeKeyword, + isTypeKeywordToken: () => isTypeKeywordToken, + isTypeKeywordTokenOrIdentifier: () => isTypeKeywordTokenOrIdentifier, + isTypeLiteralNode: () => isTypeLiteralNode, + isTypeNode: () => isTypeNode, + isTypeNodeKind: () => isTypeNodeKind, + isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, + isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, + isTypeOperatorNode: () => isTypeOperatorNode, + isTypeParameterDeclaration: () => isTypeParameterDeclaration, + isTypePredicateNode: () => isTypePredicateNode, + isTypeQueryNode: () => isTypeQueryNode, + isTypeReferenceNode: () => isTypeReferenceNode, + isTypeReferenceType: () => isTypeReferenceType, + isUMDExportSymbol: () => isUMDExportSymbol, + isUnaryExpression: () => isUnaryExpression, + isUnaryExpressionWithWrite: () => isUnaryExpressionWithWrite, + isUnicodeIdentifierStart: () => isUnicodeIdentifierStart, + isUnionTypeNode: () => isUnionTypeNode, + isUnparsedNode: () => isUnparsedNode, + isUnparsedPrepend: () => isUnparsedPrepend, + isUnparsedSource: () => isUnparsedSource, + isUnparsedTextLike: () => isUnparsedTextLike, + isUrl: () => isUrl, + isValidBigIntString: () => isValidBigIntString, + isValidESSymbolDeclaration: () => isValidESSymbolDeclaration, + isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite, + isValueSignatureDeclaration: () => isValueSignatureDeclaration, + isVarConst: () => isVarConst, + isVariableDeclaration: () => isVariableDeclaration, + isVariableDeclarationInVariableStatement: () => isVariableDeclarationInVariableStatement, + isVariableDeclarationInitializedToBareOrAccessedRequire: () => isVariableDeclarationInitializedToBareOrAccessedRequire, + isVariableDeclarationInitializedToRequire: () => isVariableDeclarationInitializedToRequire, + isVariableDeclarationList: () => isVariableDeclarationList, + isVariableLike: () => isVariableLike, + isVariableLikeOrAccessor: () => isVariableLikeOrAccessor, + isVariableStatement: () => isVariableStatement, + isVoidExpression: () => isVoidExpression, + isWatchSet: () => isWatchSet, + isWhileStatement: () => isWhileStatement, + isWhiteSpaceLike: () => isWhiteSpaceLike, + isWhiteSpaceSingleLine: () => isWhiteSpaceSingleLine, + isWithStatement: () => isWithStatement, + isWriteAccess: () => isWriteAccess, + isWriteOnlyAccess: () => isWriteOnlyAccess, + isYieldExpression: () => isYieldExpression, + jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport, + keywordPart: () => keywordPart, + last: () => last, + lastOrUndefined: () => lastOrUndefined, + length: () => length, + libMap: () => libMap, + libs: () => libs, + lineBreakPart: () => lineBreakPart, + linkNamePart: () => linkNamePart, + linkPart: () => linkPart, + linkTextPart: () => linkTextPart, + listFiles: () => listFiles, + loadModuleFromGlobalCache: () => loadModuleFromGlobalCache, + loadWithModeAwareCache: () => loadWithModeAwareCache, + makeIdentifierFromModuleName: () => makeIdentifierFromModuleName, + makeImport: () => makeImport, + makeImportIfNecessary: () => makeImportIfNecessary, + makeStringLiteral: () => makeStringLiteral, + mangleScopedPackageName: () => mangleScopedPackageName, + map: () => map, + mapAllOrFail: () => mapAllOrFail, + mapDefined: () => mapDefined, + mapDefinedEntries: () => mapDefinedEntries, + mapDefinedIterator: () => mapDefinedIterator, + mapEntries: () => mapEntries, + mapIterator: () => mapIterator, + mapOneOrMany: () => mapOneOrMany, + mapToDisplayParts: () => mapToDisplayParts, + matchFiles: () => matchFiles, + matchPatternOrExact: () => matchPatternOrExact, + matchedText: () => matchedText, + matchesExclude: () => matchesExclude, + maybeBind: () => maybeBind, + maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, + memoize: () => memoize, + memoizeCached: () => memoizeCached, + memoizeOne: () => memoizeOne, + memoizeWeak: () => memoizeWeak, + metadataHelper: () => metadataHelper, + min: () => min, + minAndMax: () => minAndMax, + missingFileModifiedTime: () => missingFileModifiedTime, + modifierToFlag: () => modifierToFlag, + modifiersToFlags: () => modifiersToFlags, + moduleOptionDeclaration: () => moduleOptionDeclaration, + moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo, + moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter, + moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations, + moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports, + moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules, + moduleSpecifiers: () => ts_moduleSpecifiers_exports, + moveEmitHelpers: () => moveEmitHelpers, + moveRangeEnd: () => moveRangeEnd, + moveRangePastDecorators: () => moveRangePastDecorators, + moveRangePastModifiers: () => moveRangePastModifiers, + moveRangePos: () => moveRangePos, + moveSyntheticComments: () => moveSyntheticComments, + mutateMap: () => mutateMap, + mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, + needsParentheses: () => needsParentheses, + needsScopeMarker: () => needsScopeMarker, + newCaseClauseTracker: () => newCaseClauseTracker, + newPrivateEnvironment: () => newPrivateEnvironment, + noEmitNotification: () => noEmitNotification, + noEmitSubstitution: () => noEmitSubstitution, + noTransformers: () => noTransformers, + noTruncationMaximumTruncationLength: () => noTruncationMaximumTruncationLength, + nodeCanBeDecorated: () => nodeCanBeDecorated, + nodeHasName: () => nodeHasName, + nodeIsDecorated: () => nodeIsDecorated, + nodeIsMissing: () => nodeIsMissing, + nodeIsPresent: () => nodeIsPresent, + nodeIsSynthesized: () => nodeIsSynthesized, + nodeModuleNameResolver: () => nodeModuleNameResolver, + nodeModulesPathPart: () => nodeModulesPathPart, + nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver, + nodeOrChildIsDecorated: () => nodeOrChildIsDecorated, + nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd, + nodePosToString: () => nodePosToString, + nodeSeenTracker: () => nodeSeenTracker, + nodeStartsNewLexicalEnvironment: () => nodeStartsNewLexicalEnvironment, + nodeToDisplayParts: () => nodeToDisplayParts, + noop: () => noop, + noopFileWatcher: () => noopFileWatcher, + noopPush: () => noopPush, + normalizePath: () => normalizePath, + normalizeSlashes: () => normalizeSlashes, + not: () => not, + notImplemented: () => notImplemented, + notImplementedResolver: () => notImplementedResolver, + nullNodeConverters: () => nullNodeConverters, + nullParenthesizerRules: () => nullParenthesizerRules, + nullTransformationContext: () => nullTransformationContext, + objectAllocator: () => objectAllocator, + operatorPart: () => operatorPart, + optionDeclarations: () => optionDeclarations, + optionMapToObject: () => optionMapToObject, + optionsAffectingProgramStructure: () => optionsAffectingProgramStructure, + optionsForBuild: () => optionsForBuild, + optionsForWatch: () => optionsForWatch, + optionsHaveChanges: () => optionsHaveChanges, + optionsHaveModuleResolutionChanges: () => optionsHaveModuleResolutionChanges, + or: () => or, + orderedRemoveItem: () => orderedRemoveItem, + orderedRemoveItemAt: () => orderedRemoveItemAt, + outFile: () => outFile, + packageIdToPackageName: () => packageIdToPackageName, + packageIdToString: () => packageIdToString, + padLeft: () => padLeft, + padRight: () => padRight, + paramHelper: () => paramHelper, + parameterIsThisKeyword: () => parameterIsThisKeyword, + parameterNamePart: () => parameterNamePart, + parseBaseNodeFactory: () => parseBaseNodeFactory, + parseBigInt: () => parseBigInt, + parseBuildCommand: () => parseBuildCommand, + parseCommandLine: () => parseCommandLine, + parseCommandLineWorker: () => parseCommandLineWorker, + parseConfigFileTextToJson: () => parseConfigFileTextToJson, + parseConfigFileWithSystem: () => parseConfigFileWithSystem, + parseConfigHostFromCompilerHostLike: () => parseConfigHostFromCompilerHostLike, + parseCustomTypeOption: () => parseCustomTypeOption, + parseIsolatedEntityName: () => parseIsolatedEntityName, + parseIsolatedJSDocComment: () => parseIsolatedJSDocComment, + parseJSDocTypeExpressionForTests: () => parseJSDocTypeExpressionForTests, + parseJsonConfigFileContent: () => parseJsonConfigFileContent, + parseJsonSourceFileConfigFileContent: () => parseJsonSourceFileConfigFileContent, + parseJsonText: () => parseJsonText, + parseListTypeOption: () => parseListTypeOption, + parseNodeFactory: () => parseNodeFactory, + parseNodeModuleFromPath: () => parseNodeModuleFromPath, + parsePackageName: () => parsePackageName, + parsePseudoBigInt: () => parsePseudoBigInt, + parseValidBigInt: () => parseValidBigInt, + patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory, + pathContainsNodeModules: () => pathContainsNodeModules, + pathIsAbsolute: () => pathIsAbsolute, + pathIsBareSpecifier: () => pathIsBareSpecifier, + pathIsRelative: () => pathIsRelative, + patternText: () => patternText, + perfLogger: () => perfLogger, + performIncrementalCompilation: () => performIncrementalCompilation, + performance: () => ts_performance_exports, + plainJSErrors: () => plainJSErrors, + positionBelongsToNode: () => positionBelongsToNode, + positionIsASICandidate: () => positionIsASICandidate, + positionIsSynthesized: () => positionIsSynthesized, + positionsAreOnSameLine: () => positionsAreOnSameLine, + preProcessFile: () => preProcessFile, + probablyUsesSemicolons: () => probablyUsesSemicolons, + processCommentPragmas: () => processCommentPragmas, + processPragmasIntoFields: () => processPragmasIntoFields, + processTaggedTemplateExpression: () => processTaggedTemplateExpression, + programContainsEsModules: () => programContainsEsModules, + programContainsModules: () => programContainsModules, + projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, + propertyNamePart: () => propertyNamePart, + pseudoBigIntToString: () => pseudoBigIntToString, + punctuationPart: () => punctuationPart, + pushIfUnique: () => pushIfUnique, + quote: () => quote, + quotePreferenceFromString: () => quotePreferenceFromString, + rangeContainsPosition: () => rangeContainsPosition, + rangeContainsPositionExclusive: () => rangeContainsPositionExclusive, + rangeContainsRange: () => rangeContainsRange, + rangeContainsRangeExclusive: () => rangeContainsRangeExclusive, + rangeContainsStartEnd: () => rangeContainsStartEnd, + rangeEndIsOnSameLineAsRangeStart: () => rangeEndIsOnSameLineAsRangeStart, + rangeEndPositionsAreOnSameLine: () => rangeEndPositionsAreOnSameLine, + rangeEquals: () => rangeEquals, + rangeIsOnSingleLine: () => rangeIsOnSingleLine, + rangeOfNode: () => rangeOfNode, + rangeOfTypeParameters: () => rangeOfTypeParameters, + rangeOverlapsWithStartEnd: () => rangeOverlapsWithStartEnd, + rangeStartIsOnSameLineAsRangeEnd: () => rangeStartIsOnSameLineAsRangeEnd, + rangeStartPositionsAreOnSameLine: () => rangeStartPositionsAreOnSameLine, + readBuilderProgram: () => readBuilderProgram, + readConfigFile: () => readConfigFile, + readHelper: () => readHelper, + readJson: () => readJson, + readJsonConfigFile: () => readJsonConfigFile, + readJsonOrUndefined: () => readJsonOrUndefined, + realizeDiagnostics: () => realizeDiagnostics, + reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange, + reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange, + reduceLeft: () => reduceLeft, + reduceLeftIterator: () => reduceLeftIterator, + reducePathComponents: () => reducePathComponents, + refactor: () => ts_refactor_exports, + regExpEscape: () => regExpEscape, + relativeComplement: () => relativeComplement, + removeAllComments: () => removeAllComments, + removeEmitHelper: () => removeEmitHelper, + removeExtension: () => removeExtension, + removeFileExtension: () => removeFileExtension, + removeIgnoredPath: () => removeIgnoredPath, + removeMinAndVersionNumbers: () => removeMinAndVersionNumbers, + removeOptionality: () => removeOptionality, + removePrefix: () => removePrefix, + removeSuffix: () => removeSuffix, + removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator, + repeatString: () => repeatString, + replaceElement: () => replaceElement, + resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson, + resolveConfigFileProjectName: () => resolveConfigFileProjectName, + resolveJSModule: () => resolveJSModule, + resolveModuleName: () => resolveModuleName, + resolveModuleNameFromCache: () => resolveModuleNameFromCache, + resolvePackageNameToPackageJson: () => resolvePackageNameToPackageJson, + resolvePath: () => resolvePath, + resolveProjectReferencePath: () => resolveProjectReferencePath, + resolveTripleslashReference: () => resolveTripleslashReference, + resolveTypeReferenceDirective: () => resolveTypeReferenceDirective, + resolvingEmptyArray: () => resolvingEmptyArray, + restHelper: () => restHelper, + returnFalse: () => returnFalse, + returnNoopFileWatcher: () => returnNoopFileWatcher, + returnTrue: () => returnTrue, + returnUndefined: () => returnUndefined, + returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, + sameFlatMap: () => sameFlatMap, + sameMap: () => sameMap, + sameMapping: () => sameMapping, + scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, + scanner: () => scanner, + screenStartingMessageCodes: () => screenStartingMessageCodes, + semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, + serializeCompilerOptions: () => serializeCompilerOptions, + server: () => ts_server_exports2, + servicesVersion: () => servicesVersion, + setCommentRange: () => setCommentRange, + setConfigFileInOptions: () => setConfigFileInOptions, + setConstantValue: () => setConstantValue, + setEachParent: () => setEachParent, + setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, + setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, + setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, + setModuleDefaultHelper: () => setModuleDefaultHelper, + setNodeFlags: () => setNodeFlags, + setObjectAllocator: () => setObjectAllocator, + setOriginalNode: () => setOriginalNode, + setParent: () => setParent, + setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, + setResolvedModule: () => setResolvedModule, + setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective, + setSnippetElement: () => setSnippetElement, + setSourceMapRange: () => setSourceMapRange, + setStackTraceLimit: () => setStackTraceLimit, + setStartsOnNewLine: () => setStartsOnNewLine, + setSyntheticLeadingComments: () => setSyntheticLeadingComments, + setSyntheticTrailingComments: () => setSyntheticTrailingComments, + setSys: () => setSys, + setSysLog: () => setSysLog, + setTextRange: () => setTextRange, + setTextRangeEnd: () => setTextRangeEnd, + setTextRangePos: () => setTextRangePos, + setTextRangePosEnd: () => setTextRangePosEnd, + setTextRangePosWidth: () => setTextRangePosWidth, + setTokenSourceMapRange: () => setTokenSourceMapRange, + setTypeNode: () => setTypeNode, + setUILocale: () => setUILocale, + setValueDeclaration: () => setValueDeclaration, + shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, + shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, + showModuleSpecifier: () => showModuleSpecifier, + signatureHasLiteralTypes: () => signatureHasLiteralTypes, + signatureHasRestParameter: () => signatureHasRestParameter, + signatureToDisplayParts: () => signatureToDisplayParts, + single: () => single, + singleElementArray: () => singleElementArray, + singleIterator: () => singleIterator, + singleOrMany: () => singleOrMany, + singleOrUndefined: () => singleOrUndefined, + skipAlias: () => skipAlias, + skipAssertions: () => skipAssertions, + skipConstraint: () => skipConstraint, + skipOuterExpressions: () => skipOuterExpressions, + skipParentheses: () => skipParentheses, + skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions, + skipTrivia: () => skipTrivia, + skipTypeChecking: () => skipTypeChecking, + skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, + sliceAfter: () => sliceAfter, + some: () => some, + sort: () => sort, + sortAndDeduplicate: () => sortAndDeduplicate, + sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics, + sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions, + sourceFileMayBeEmitted: () => sourceFileMayBeEmitted, + sourceMapCommentRegExp: () => sourceMapCommentRegExp, + sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart, + spacePart: () => spacePart, + spanMap: () => spanMap, + spreadArrayHelper: () => spreadArrayHelper, + stableSort: () => stableSort, + startEndContainsRange: () => startEndContainsRange, + startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd, + startOnNewLine: () => startOnNewLine, + startTracing: () => startTracing, + startsWith: () => startsWith, + startsWithDirectory: () => startsWithDirectory, + startsWithUnderscore: () => startsWithUnderscore, + startsWithUseStrict: () => startsWithUseStrict, + stringContains: () => stringContains, + stringContainsAt: () => stringContainsAt, + stringToToken: () => stringToToken, + stripQuotes: () => stripQuotes, + supportedDeclarationExtensions: () => supportedDeclarationExtensions, + supportedJSExtensions: () => supportedJSExtensions, + supportedJSExtensionsFlat: () => supportedJSExtensionsFlat, + supportedLocaleDirectories: () => supportedLocaleDirectories, + supportedTSExtensions: () => supportedTSExtensions, + supportedTSExtensionsFlat: () => supportedTSExtensionsFlat, + supportedTSImplementationExtensions: () => supportedTSImplementationExtensions, + suppressLeadingAndTrailingTrivia: () => suppressLeadingAndTrailingTrivia, + suppressLeadingTrivia: () => suppressLeadingTrivia, + suppressTrailingTrivia: () => suppressTrailingTrivia, + symbolEscapedNameNoDefault: () => symbolEscapedNameNoDefault, + symbolName: () => symbolName, + symbolNameNoDefault: () => symbolNameNoDefault, + symbolPart: () => symbolPart, + symbolToDisplayParts: () => symbolToDisplayParts, + syntaxMayBeASICandidate: () => syntaxMayBeASICandidate, + syntaxRequiresTrailingSemicolonOrASI: () => syntaxRequiresTrailingSemicolonOrASI, + sys: () => sys, + sysLog: () => sysLog, + tagNamesAreEquivalent: () => tagNamesAreEquivalent, + takeWhile: () => takeWhile, + targetOptionDeclaration: () => targetOptionDeclaration, + templateObjectHelper: () => templateObjectHelper, + testFormatSettings: () => testFormatSettings, + textChangeRangeIsUnchanged: () => textChangeRangeIsUnchanged, + textChangeRangeNewSpan: () => textChangeRangeNewSpan, + textChanges: () => ts_textChanges_exports, + textOrKeywordPart: () => textOrKeywordPart, + textPart: () => textPart, + textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive, + textSpanContainsPosition: () => textSpanContainsPosition, + textSpanContainsTextSpan: () => textSpanContainsTextSpan, + textSpanEnd: () => textSpanEnd, + textSpanIntersection: () => textSpanIntersection, + textSpanIntersectsWith: () => textSpanIntersectsWith, + textSpanIntersectsWithPosition: () => textSpanIntersectsWithPosition, + textSpanIntersectsWithTextSpan: () => textSpanIntersectsWithTextSpan, + textSpanIsEmpty: () => textSpanIsEmpty, + textSpanOverlap: () => textSpanOverlap, + textSpanOverlapsWith: () => textSpanOverlapsWith, + textSpansEqual: () => textSpansEqual, + textToKeywordObj: () => textToKeywordObj, + timestamp: () => timestamp, + toArray: () => toArray, + toBuilderFileEmit: () => toBuilderFileEmit, + toBuilderStateFileInfoForMultiEmit: () => toBuilderStateFileInfoForMultiEmit, + toEditorSettings: () => toEditorSettings, + toFileNameLowerCase: () => toFileNameLowerCase, + toLowerCase: () => toLowerCase, + toPath: () => toPath, + toProgramEmitPending: () => toProgramEmitPending, + tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword, + tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan, + tokenToString: () => tokenToString, + trace: () => trace, + tracing: () => tracing, + tracingEnabled: () => tracingEnabled, + transform: () => transform, + transformClassFields: () => transformClassFields, + transformDeclarations: () => transformDeclarations, + transformECMAScriptModule: () => transformECMAScriptModule, + transformES2015: () => transformES2015, + transformES2016: () => transformES2016, + transformES2017: () => transformES2017, + transformES2018: () => transformES2018, + transformES2019: () => transformES2019, + transformES2020: () => transformES2020, + transformES2021: () => transformES2021, + transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, + transformESNext: () => transformESNext, + transformGenerators: () => transformGenerators, + transformJsx: () => transformJsx, + transformLegacyDecorators: () => transformLegacyDecorators, + transformModule: () => transformModule, + transformNodeModule: () => transformNodeModule, + transformNodes: () => transformNodes, + transformSystemModule: () => transformSystemModule, + transformTypeScript: () => transformTypeScript, + transpile: () => transpile, + transpileModule: () => transpileModule, + transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions, + trimString: () => trimString, + trimStringEnd: () => trimStringEnd, + trimStringStart: () => trimStringStart, + tryAddToSet: () => tryAddToSet, + tryAndIgnoreErrors: () => tryAndIgnoreErrors, + tryCast: () => tryCast, + tryDirectoryExists: () => tryDirectoryExists, + tryExtractTSExtension: () => tryExtractTSExtension, + tryFileExists: () => tryFileExists, + tryGetClassExtendingExpressionWithTypeArguments: () => tryGetClassExtendingExpressionWithTypeArguments, + tryGetClassImplementingOrExtendingExpressionWithTypeArguments: () => tryGetClassImplementingOrExtendingExpressionWithTypeArguments, + tryGetDirectories: () => tryGetDirectories, + tryGetExtensionFromPath: () => tryGetExtensionFromPath2, + tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, + tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, + tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, + tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, + tryGetPropertyAccessOrIdentifierToString: () => tryGetPropertyAccessOrIdentifierToString, + tryGetPropertyNameOfBindingOrAssignmentElement: () => tryGetPropertyNameOfBindingOrAssignmentElement, + tryGetSourceMappingURL: () => tryGetSourceMappingURL, + tryGetTextOfPropertyName: () => tryGetTextOfPropertyName, + tryIOAndConsumeErrors: () => tryIOAndConsumeErrors, + tryParsePattern: () => tryParsePattern, + tryParsePatterns: () => tryParsePatterns, + tryParseRawSourceMap: () => tryParseRawSourceMap, + tryReadDirectory: () => tryReadDirectory, + tryReadFile: () => tryReadFile, + tryRemoveDirectoryPrefix: () => tryRemoveDirectoryPrefix, + tryRemoveExtension: () => tryRemoveExtension, + tryRemovePrefix: () => tryRemovePrefix, + tryRemoveSuffix: () => tryRemoveSuffix, + typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, + typeAliasNamePart: () => typeAliasNamePart, + typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, + typeKeywords: () => typeKeywords, + typeParameterNamePart: () => typeParameterNamePart, + typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter, + typeToDisplayParts: () => typeToDisplayParts, + unchangedPollThresholds: () => unchangedPollThresholds, + unchangedTextChangeRange: () => unchangedTextChangeRange, + unescapeLeadingUnderscores: () => unescapeLeadingUnderscores, + unmangleScopedPackageName: () => unmangleScopedPackageName, + unorderedRemoveItem: () => unorderedRemoveItem, + unorderedRemoveItemAt: () => unorderedRemoveItemAt, + unreachableCodeIsError: () => unreachableCodeIsError, + unusedLabelIsError: () => unusedLabelIsError, + unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, + updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, + updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, + updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, + updatePackageJsonWatch: () => updatePackageJsonWatch, + updateResolutionField: () => updateResolutionField, + updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, + updateSourceFile: () => updateSourceFile, + updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, + usesExtensionsOnImports: () => usesExtensionsOnImports, + usingSingleLineStringWriter: () => usingSingleLineStringWriter, + utf16EncodeAsString: () => utf16EncodeAsString, + validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage, + valuesHelper: () => valuesHelper, + version: () => version, + versionMajorMinor: () => versionMajorMinor, + visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, + visitEachChild: () => visitEachChild, + visitFunctionBody: () => visitFunctionBody, + visitIterationBody: () => visitIterationBody, + visitLexicalEnvironment: () => visitLexicalEnvironment, + visitNode: () => visitNode, + visitNodes: () => visitNodes2, + visitParameterList: () => visitParameterList, + walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, + walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, + walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, + walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, + whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp, + writeCommentRange: () => writeCommentRange, + writeFile: () => writeFile, + writeFileEnsuringDirectories: () => writeFileEnsuringDirectories, + zipToModeAwareCache: () => zipToModeAwareCache, + zipWith: () => zipWith +}); + // src/deprecatedCompat/deprecate.ts var enableDeprecationWarnings = true; var typeScriptVersion2; @@ -169330,6 +170057,97 @@ addObjectAllocatorPatcher((objectAllocator2) => { } }); +// src/server/_namespaces/ts.server.ts +var ts_server_exports2 = {}; +__export(ts_server_exports2, { + ActionInvalidate: () => ActionInvalidate, + ActionPackageInstalled: () => ActionPackageInstalled, + ActionSet: () => ActionSet, + Arguments: () => Arguments, + AutoImportProviderProject: () => AutoImportProviderProject, + CharRangeSection: () => CharRangeSection, + CommandNames: () => CommandNames, + ConfigFileDiagEvent: () => ConfigFileDiagEvent, + ConfiguredProject: () => ConfiguredProject2, + Errors: () => Errors, + EventBeginInstallTypes: () => EventBeginInstallTypes, + EventEndInstallTypes: () => EventEndInstallTypes, + EventInitializationFailed: () => EventInitializationFailed, + EventTypesRegistry: () => EventTypesRegistry, + ExternalProject: () => ExternalProject2, + GcTimer: () => GcTimer, + InferredProject: () => InferredProject2, + LargeFileReferencedEvent: () => LargeFileReferencedEvent, + LineIndex: () => LineIndex, + LineLeaf: () => LineLeaf, + LineNode: () => LineNode, + LogLevel: () => LogLevel2, + Msg: () => Msg, + OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, + Project: () => Project3, + ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, + ProjectKind: () => ProjectKind, + ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, + ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, + ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, + ProjectReferenceProjectLoadKind: () => ProjectReferenceProjectLoadKind, + ProjectService: () => ProjectService3, + ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, + ScriptInfo: () => ScriptInfo, + ScriptVersionCache: () => ScriptVersionCache, + Session: () => Session3, + TextStorage: () => TextStorage, + ThrottledOperations: () => ThrottledOperations, + TypingsCache: () => TypingsCache, + allFilesAreJsOrDts: () => allFilesAreJsOrDts, + allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts, + asNormalizedPath: () => asNormalizedPath, + convertCompilerOptions: () => convertCompilerOptions, + convertFormatOptions: () => convertFormatOptions, + convertScriptKindName: () => convertScriptKindName, + convertTypeAcquisition: () => convertTypeAcquisition, + convertUserPreferences: () => convertUserPreferences, + convertWatchOptions: () => convertWatchOptions, + countEachFileTypes: () => countEachFileTypes, + createInstallTypingsRequest: () => createInstallTypingsRequest, + createModuleSpecifierCache: () => createModuleSpecifierCache, + createNormalizedPathMap: () => createNormalizedPathMap, + createPackageJsonCache: () => createPackageJsonCache, + createSortedArray: () => createSortedArray2, + emptyArray: () => emptyArray2, + findArgument: () => findArgument, + forEachResolvedProjectReferenceProject: () => forEachResolvedProjectReferenceProject, + formatMessage: () => formatMessage2, + getBaseConfigFileName: () => getBaseConfigFileName, + getLocationInNewDocument: () => getLocationInNewDocument, + hasArgument: () => hasArgument, + hasNoTypeScriptSource: () => hasNoTypeScriptSource, + indent: () => indent2, + isConfigFile: () => isConfigFile, + isConfiguredProject: () => isConfiguredProject, + isDynamicFileName: () => isDynamicFileName, + isExternalProject: () => isExternalProject, + isInferredProject: () => isInferredProject, + isInferredProjectName: () => isInferredProjectName, + makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, + makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, + makeInferredProjectName: () => makeInferredProjectName, + maxFileSize: () => maxFileSize, + maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, + normalizedPathToPath: () => normalizedPathToPath, + nowString: () => nowString, + nullCancellationToken: () => nullCancellationToken, + nullTypingsInstaller: () => nullTypingsInstaller, + projectContainsInfoDirectly: () => projectContainsInfoDirectly, + protocol: () => ts_server_protocol_exports, + removeSorted: () => removeSorted, + stringifyIndented: () => stringifyIndented, + toEvent: () => toEvent, + toNormalizedPath: () => toNormalizedPath, + tryConvertScriptKindName: () => tryConvertScriptKindName, + updateProjectIfDirty: () => updateProjectIfDirty +}); + // src/server/utilitiesPublic.ts var LogLevel2 = /* @__PURE__ */ ((LogLevel3) => { LogLevel3[LogLevel3["terse"] = 0] = "terse"; @@ -176305,6 +177123,10 @@ function getPerProjectReferences(projects, defaultProject, initialLocation, isFo continue; if (isLocationProjectReferenceRedirect(project, location)) continue; + updateProjectIfDirty(project); + if (!project.containsFile(toNormalizedPath(location.fileName))) { + continue; + } const projectResults = searchPosition(project, location); resultsMap.set(project, projectResults != null ? projectResults : emptyArray2); searchedProjectKeys.add(getProjectKey(project)); @@ -179955,6 +180777,99 @@ var LineLeaf = class { } }; +// src/tsserver/_namespaces/ts.server.ts +var ts_server_exports3 = {}; +__export(ts_server_exports3, { + ActionInvalidate: () => ActionInvalidate, + ActionPackageInstalled: () => ActionPackageInstalled, + ActionSet: () => ActionSet, + Arguments: () => Arguments, + AutoImportProviderProject: () => AutoImportProviderProject, + CharRangeSection: () => CharRangeSection, + CommandNames: () => CommandNames, + ConfigFileDiagEvent: () => ConfigFileDiagEvent, + ConfiguredProject: () => ConfiguredProject2, + Errors: () => Errors, + EventBeginInstallTypes: () => EventBeginInstallTypes, + EventEndInstallTypes: () => EventEndInstallTypes, + EventInitializationFailed: () => EventInitializationFailed, + EventTypesRegistry: () => EventTypesRegistry, + ExternalProject: () => ExternalProject2, + GcTimer: () => GcTimer, + InferredProject: () => InferredProject2, + LargeFileReferencedEvent: () => LargeFileReferencedEvent, + LineIndex: () => LineIndex, + LineLeaf: () => LineLeaf, + LineNode: () => LineNode, + LogLevel: () => LogLevel2, + Msg: () => Msg, + OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, + Project: () => Project3, + ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, + ProjectKind: () => ProjectKind, + ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, + ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, + ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, + ProjectReferenceProjectLoadKind: () => ProjectReferenceProjectLoadKind, + ProjectService: () => ProjectService3, + ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, + ScriptInfo: () => ScriptInfo, + ScriptVersionCache: () => ScriptVersionCache, + Session: () => Session3, + TextStorage: () => TextStorage, + ThrottledOperations: () => ThrottledOperations, + TypingsCache: () => TypingsCache, + allFilesAreJsOrDts: () => allFilesAreJsOrDts, + allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts, + asNormalizedPath: () => asNormalizedPath, + convertCompilerOptions: () => convertCompilerOptions, + convertFormatOptions: () => convertFormatOptions, + convertScriptKindName: () => convertScriptKindName, + convertTypeAcquisition: () => convertTypeAcquisition, + convertUserPreferences: () => convertUserPreferences, + convertWatchOptions: () => convertWatchOptions, + countEachFileTypes: () => countEachFileTypes, + createInstallTypingsRequest: () => createInstallTypingsRequest, + createModuleSpecifierCache: () => createModuleSpecifierCache, + createNormalizedPathMap: () => createNormalizedPathMap, + createPackageJsonCache: () => createPackageJsonCache, + createSortedArray: () => createSortedArray2, + emptyArray: () => emptyArray2, + findArgument: () => findArgument, + forEachResolvedProjectReferenceProject: () => forEachResolvedProjectReferenceProject, + formatMessage: () => formatMessage2, + getBaseConfigFileName: () => getBaseConfigFileName, + getLocationInNewDocument: () => getLocationInNewDocument, + getLogLevel: () => getLogLevel, + hasArgument: () => hasArgument, + hasNoTypeScriptSource: () => hasNoTypeScriptSource, + indent: () => indent2, + initializeNodeSystem: () => initializeNodeSystem, + isConfigFile: () => isConfigFile, + isConfiguredProject: () => isConfiguredProject, + isDynamicFileName: () => isDynamicFileName, + isExternalProject: () => isExternalProject, + isInferredProject: () => isInferredProject, + isInferredProjectName: () => isInferredProjectName, + makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, + makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, + makeInferredProjectName: () => makeInferredProjectName, + maxFileSize: () => maxFileSize, + maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, + normalizedPathToPath: () => normalizedPathToPath, + nowString: () => nowString, + nullCancellationToken: () => nullCancellationToken, + nullTypingsInstaller: () => nullTypingsInstaller, + projectContainsInfoDirectly: () => projectContainsInfoDirectly, + protocol: () => ts_server_protocol_exports, + removeSorted: () => removeSorted, + stringifyIndented: () => stringifyIndented, + toEvent: () => toEvent, + toNormalizedPath: () => toNormalizedPath, + tryConvertScriptKindName: () => tryConvertScriptKindName, + updateProjectIfDirty: () => updateProjectIfDirty +}); + // src/tsserver/nodeServer.ts function parseLoggingEnvironmentString(logEnvStr) { if (!logEnvStr) { @@ -180997,6 +181912,7 @@ start(initializeNodeSystem(), require("os").platform()); consumesNodeCoreModules, contains, containsIgnoredPath, + containsObjectRestOrSpread, containsParseError, containsPath, convertCompilerOptionsForTelemetry, @@ -181335,6 +182251,7 @@ start(initializeNodeSystem(), require("os").platform()); getCommonSourceDirectoryOfConfig, getCompilerOptionValue, getCompilerOptionsDiffValue, + getConditions, getConfigFileParsingDiagnostics, getConstantValue, getContainerNode, @@ -182016,6 +182933,7 @@ start(initializeNodeSystem(), require("os").platform()); isGetOrSetAccessorDeclaration, isGlobalDeclaration, isGlobalScopeAugmentation, + isGrammarError, isHeritageClause, isHoistedFunction, isHoistedVariableStatement, @@ -182358,6 +183276,7 @@ start(initializeNodeSystem(), require("os").platform()); isString, isStringAKeyword, isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection, isStringDoubleQuoted, isStringLiteral, isStringLiteralLike, @@ -182522,6 +183441,7 @@ start(initializeNodeSystem(), require("os").platform()); mutateMapSkippingNewValues, needsParentheses, needsScopeMarker, + newCaseClauseTracker, newPrivateEnvironment, noEmitNotification, noEmitSubstitution, @@ -182895,7 +183815,6 @@ start(initializeNodeSystem(), require("os").platform()); typeAcquisitionDeclarations, typeAliasNamePart, typeDirectiveIsEqualTo, - typeHasCallOrConstructSignatures, typeKeywords, typeParameterNamePart, typeReferenceResolutionNameAndModeGetter, diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 65f9a35b41dc6..34006d63b2ea5 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -6310,6 +6310,7 @@ declare namespace ts { } interface TypeChecker { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; + getTypeOfSymbol(symbol: Symbol): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; @@ -6400,6 +6401,21 @@ declare namespace ts { getApparentType(type: Type): Type; getBaseConstraintOfType(type: Type): Type | undefined; getDefaultFromTypeParameter(type: Type): Type | undefined; + /** + * True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts. + * This function will _not_ return true if passed a type which + * extends `Array` (for example, the TypeScript AST's `NodeArray` type). + */ + isArrayType(type: Type): boolean; + /** + * True if this type is a tuple type. This function will _not_ return true if + * passed a type which extends from a tuple. + */ + isTupleType(type: Type): boolean; + /** + * True if this type is assignable to `ReadonlyArray`. + */ + isArrayLikeType(type: Type): boolean; getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined; /** * Depending on the operation performed, it may be appropriate to throw away the checker @@ -6659,7 +6675,8 @@ declare namespace ts { TemplateLiteral = 134217728, StringMapping = 268435456, Literal = 2944, - Unit = 109440, + Unit = 109472, + Freshable = 2976, StringOrNumberLiteral = 384, PossiblyFalsy = 117724, StringLike = 402653316, @@ -6711,10 +6728,12 @@ declare namespace ts { isClass(): this is InterfaceType; isIndexType(): this is IndexType; } - interface LiteralType extends Type { + interface FreshableType extends Type { + freshType: FreshableType; + regularType: FreshableType; + } + interface LiteralType extends FreshableType { value: string | number | PseudoBigInt; - freshType: LiteralType; - regularType: LiteralType; } interface UniqueESSymbolType extends Type { symbol: Symbol; @@ -6729,7 +6748,7 @@ declare namespace ts { interface BigIntLiteralType extends LiteralType { value: PseudoBigInt; } - interface EnumType extends Type { + interface EnumType extends FreshableType { } enum ObjectFlags { None = 0, @@ -8673,7 +8692,6 @@ declare namespace ts { parent: ConstructorDeclaration; name: Identifier; }; - function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean; /** @deprecated */ function createUnparsedSourceFile(text: string): UnparsedSource; /** @deprecated */ @@ -9128,7 +9146,6 @@ declare namespace ts { function bundlerModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; - function shouldAllowImportingTsExtension(compilerOptions: CompilerOptions, fromFileName?: string): boolean | "" | undefined; interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache, NonRelativeNameResolutionCache, PackageJsonInfoCache { } interface ModeAwareCache { @@ -10056,6 +10073,13 @@ declare namespace ts { */ triggerCharacter?: CompletionsTriggerCharacter; triggerKind?: CompletionTriggerKind; + /** + * Include a `symbol` property on each completion entry object. + * Symbols reference cyclic data structures and sometimes an entire TypeChecker instance, + * so use caution when serializing or retaining completion entries retrieved with this option. + * @default false + */ + includeSymbol?: boolean; /** @deprecated Use includeCompletionsForModuleExports */ includeExternalModuleExports?: boolean; /** @deprecated Use includeCompletionsWithInsertText */ @@ -10576,6 +10600,7 @@ declare namespace ts { * in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default. */ exportName: string; + exportMapKey?: string; moduleSpecifier?: string; /** The file name declaring the export's module symbol, if it was an external module */ fileName?: string; @@ -10585,7 +10610,6 @@ declare namespace ts { isPackageJsonImport?: true; } interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport { - /** The key in the `ExportMapCache` where the completion entry's `SymbolExportInfo[]` is found */ exportMapKey: string; } interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport { @@ -10613,6 +10637,12 @@ declare namespace ts { isFromUncheckedFile?: true; isPackageJsonImport?: true; isImportStatementCompletion?: true; + /** + * For API purposes. + * Included for non-string completions only when `includeSymbol: true` option is passed to `getCompletionsAtPosition`. + * @example Get declaration of completion: `symbol.valueDeclaration` + */ + symbol?: Symbol; /** * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`, * that allows TS Server to look up the symbol represented by the completion item, disambiguating diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index f16c5a06498a0..a69e846e71fc5 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -18,17 +18,10 @@ and limitations under the License. var ts = (() => { var __defProp = Object.defineProperty; var __getOwnPropNames = Object.getOwnPropertyNames; - var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { - get: (a, b) => (typeof require !== "undefined" ? require : a)[b] - }) : x)(function(x) { - if (typeof require !== "undefined") - return require.apply(this, arguments); - throw new Error('Dynamic require of "' + x + '" is not supported'); - }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; - var __commonJS = (cb, mod) => function __require2() { + var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { @@ -42,7 +35,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = `${versionMajorMinor}.0-beta`; + version = `${versionMajorMinor}.1-rc`; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -3123,7 +3116,7 @@ ${lanes.join("\n")} init_ts2(); nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performance; - timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +new Date(); + timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date(); } }); @@ -3196,6 +3189,9 @@ ${lanes.join("\n")} counts.set(markName, count + 1); marks.set(markName, timestamp()); performanceImpl == null ? void 0 : performanceImpl.mark(markName); + if (typeof onProfilerEvent === "function") { + onProfilerEvent(markName); + } } } function measure(measureName, startMarkName, endMarkName) { @@ -4481,13 +4477,14 @@ ${lanes.join("\n")} TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; - TypeFlags2[TypeFlags2["Unit"] = 109440] = "Unit"; + TypeFlags2[TypeFlags2["Unit"] = 109472] = "Unit"; + TypeFlags2[TypeFlags2["Freshable"] = 2976] = "Freshable"; TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; - TypeFlags2[TypeFlags2["Primitive"] = 131068] = "Primitive"; + TypeFlags2[TypeFlags2["Primitive"] = 134348796] = "Primitive"; TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; @@ -5496,7 +5493,7 @@ ${lanes.join("\n")} function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { const watcher = fsWatch( dirName, - FileSystemEntryKind.Directory, + 1 /* Directory */, (_eventName, relativeFileName, modifiedTime) => { if (!isString(relativeFileName)) return; @@ -5694,7 +5691,7 @@ ${lanes.join("\n")} } function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { const parentWatcher = cache.get(dirPath); - if (parentWatcher && fileSystemEntryExists(dirName, FileSystemEntryKind.Directory)) { + if (parentWatcher && fileSystemEntryExists(dirName, 1 /* Directory */)) { scheduleUpdateChildWatches(dirName, dirPath, fileName, options); return; } @@ -5759,7 +5756,7 @@ ${lanes.join("\n")} return false; let newChildWatches; const hasChanges = enumerateInsertsAndDeletes( - fileSystemEntryExists(parentDir, FileSystemEntryKind.Directory) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { + fileSystemEntryExists(parentDir, 1 /* Directory */) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { const childFullName = getNormalizedAbsolutePath(child, parentDir); return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath(childFullName))) === 0 /* EqualTo */ ? childFullName : void 0; }) : emptyArray, @@ -6179,7 +6176,7 @@ ${lanes.join("\n")} PollingInterval3[PollingInterval3["Low"] = 250] = "Low"; return PollingInterval3; })(PollingInterval || {}); - missingFileModifiedTime = new Date(0); + missingFileModifiedTime = /* @__PURE__ */ new Date(0); defaultChunkLevels = { Low: 32, Medium: 64, High: 256 }; pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels); unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels); @@ -6390,7 +6387,7 @@ ${lanes.join("\n")} if (!err) { try { if ((_a2 = statSync(profilePath)) == null ? void 0 : _a2.isDirectory()) { - profilePath = _path.join(profilePath, `${new Date().toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); + profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); } } catch (e) { } @@ -7342,7 +7339,6 @@ ${lanes.join("\n")} Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), - Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."), A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), @@ -7471,6 +7467,7 @@ ${lanes.join("\n")} To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -7864,7 +7861,6 @@ ${lanes.join("\n")} Cannot_find_type_definition_file_for_0: diag(2688, 1 /* Error */, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), - An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, 1 /* Error */, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), @@ -7988,7 +7984,7 @@ ${lanes.join("\n")} Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."), A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), - Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."), + Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."), Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), @@ -8180,13 +8176,11 @@ ${lanes.join("\n")} The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), - Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), + Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."), Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), - Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), + Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), @@ -8274,7 +8268,7 @@ ${lanes.join("\n")} Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."), File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."), - File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."), + File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."), Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."), Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), @@ -8564,6 +8558,11 @@ ${lanes.join("\n")} Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."), Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."), true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."), + Entering_conditional_exports: diag(6413, 3 /* Message */, "Entering_conditional_exports_6413", "Entering conditional exports."), + Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."), + Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."), + Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), @@ -8725,6 +8724,7 @@ ${lanes.join("\n")} new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), + This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."), Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), @@ -8822,7 +8822,7 @@ ${lanes.join("\n")} You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), - Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), + Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -9614,18 +9614,18 @@ ${lanes.join("\n")} return true; } function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start, length2) { - let text = textInitial; - let pos; - let end; - let startPos; - let tokenPos; - let token; - let tokenValue; - let tokenFlags; - let commentDirectives; - let inJSDocType = 0; + var text = textInitial; + var pos; + var end; + var startPos; + var tokenPos; + var token; + var tokenValue; + var tokenFlags; + var commentDirectives; + var inJSDocType = 0; setText(text, start, length2); - const scanner2 = { + var scanner2 = { getStartPos: () => startPos, getTextPos: () => pos, getToken: () => token, @@ -12804,7 +12804,7 @@ ${lanes.join("\n")} return (symbol.flags & 33554432 /* Transient */) !== 0; } function createSingleLineStringWriter() { - let str = ""; + var str = ""; const writeText = (text) => str += text; return { getText: () => str, @@ -13025,6 +13025,36 @@ ${lanes.join("\n")} function nodeIsPresent(node) { return !nodeIsMissing(node); } + function isGrammarError(parent2, child) { + if (isTypeParameterDeclaration(parent2)) + return child === parent2.expression; + if (isClassStaticBlockDeclaration(parent2)) + return child === parent2.modifiers; + if (isPropertySignature(parent2)) + return child === parent2.initializer; + if (isPropertyDeclaration(parent2)) + return child === parent2.questionToken && isAutoAccessorPropertyDeclaration(parent2); + if (isPropertyAssignment(parent2)) + return child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + if (isShorthandPropertyAssignment(parent2)) + return child === parent2.equalsToken || child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + if (isMethodDeclaration(parent2)) + return child === parent2.exclamationToken; + if (isConstructorDeclaration(parent2)) + return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isGetAccessorDeclaration(parent2)) + return child === parent2.typeParameters || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isSetAccessorDeclaration(parent2)) + return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isNamespaceExportDeclaration(parent2)) + return child === parent2.modifiers || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + return false; + } + function isGrammarErrorElement(nodeArray, child, isElement) { + if (!nodeArray || isArray(child) || !isElement(child)) + return false; + return contains(nodeArray, child); + } function insertStatementsAfterPrologue(to, from, isPrologueDirective2) { if (from === void 0 || from.length === 0) return to; @@ -13168,101 +13198,400 @@ ${lanes.join("\n")} return emitNode && emitNode.internalFlags || 0; } function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: emptyArray, - AsyncIterator: emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: emptyArray, - SharedArrayBuffer: emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: emptyArray, - AsyncIterableIterator: emptyArray, - AsyncGenerator: emptyArray, - AsyncGeneratorFunction: emptyArray, - NumberFormat: ["formatToParts"] - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: emptyArray, - BigInt64Array: emptyArray, - BigUint64Array: emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - es2021: { - PromiseConstructor: ["any"], - String: ["replaceAll"] - }, - es2022: { - Array: ["at"], - String: ["at"], - Int8Array: ["at"], - Uint8Array: ["at"], - Uint8ClampedArray: ["at"], - Int16Array: ["at"], - Uint16Array: ["at"], - Int32Array: ["at"], - Uint32Array: ["at"], - Float32Array: ["at"], - Float64Array: ["at"], - BigInt64Array: ["at"], - BigUint64Array: ["at"], - ObjectConstructor: ["hasOwn"], - Error: ["cause"] - }, - es2023: { - Array: ["findLastIndex", "findLast"], - Int8Array: ["findLastIndex", "findLast"], - Uint8Array: ["findLastIndex", "findLast"], - Uint8ClampedArray: ["findLastIndex", "findLast"], - Int16Array: ["findLastIndex", "findLast"], - Uint16Array: ["findLastIndex", "findLast"], - Int32Array: ["findLastIndex", "findLast"], - Uint32Array: ["findLastIndex", "findLast"], - Float32Array: ["findLastIndex", "findLast"], - Float64Array: ["findLastIndex", "findLast"], - BigInt64Array: ["findLastIndex", "findLast"], - BigUint64Array: ["findLastIndex", "findLast"] - } - }; + return new Map(Object.entries({ + Array: new Map(Object.entries({ + es2015: [ + "find", + "findIndex", + "fill", + "copyWithin", + "entries", + "keys", + "values" + ], + es2016: [ + "includes" + ], + es2019: [ + "flat", + "flatMap" + ], + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Iterator: new Map(Object.entries({ + es2015: emptyArray + })), + AsyncIterator: new Map(Object.entries({ + es2015: emptyArray + })), + Atomics: new Map(Object.entries({ + es2017: emptyArray + })), + SharedArrayBuffer: new Map(Object.entries({ + es2017: emptyArray + })), + AsyncIterable: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncIterableIterator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGenerator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGeneratorFunction: new Map(Object.entries({ + es2018: emptyArray + })), + RegExp: new Map(Object.entries({ + es2015: [ + "flags", + "sticky", + "unicode" + ], + es2018: [ + "dotAll" + ] + })), + Reflect: new Map(Object.entries({ + es2015: [ + "apply", + "construct", + "defineProperty", + "deleteProperty", + "get", + " getOwnPropertyDescriptor", + "getPrototypeOf", + "has", + "isExtensible", + "ownKeys", + "preventExtensions", + "set", + "setPrototypeOf" + ] + })), + ArrayConstructor: new Map(Object.entries({ + es2015: [ + "from", + "of" + ] + })), + ObjectConstructor: new Map(Object.entries({ + es2015: [ + "assign", + "getOwnPropertySymbols", + "keys", + "is", + "setPrototypeOf" + ], + es2017: [ + "values", + "entries", + "getOwnPropertyDescriptors" + ], + es2019: [ + "fromEntries" + ], + es2022: [ + "hasOwn" + ] + })), + NumberConstructor: new Map(Object.entries({ + es2015: [ + "isFinite", + "isInteger", + "isNaN", + "isSafeInteger", + "parseFloat", + "parseInt" + ] + })), + Math: new Map(Object.entries({ + es2015: [ + "clz32", + "imul", + "sign", + "log10", + "log2", + "log1p", + "expm1", + "cosh", + "sinh", + "tanh", + "acosh", + "asinh", + "atanh", + "hypot", + "trunc", + "fround", + "cbrt" + ] + })), + Map: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + Set: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + PromiseConstructor: new Map(Object.entries({ + es2015: [ + "all", + "race", + "reject", + "resolve" + ], + es2020: [ + "allSettled" + ], + es2021: [ + "any" + ] + })), + Symbol: new Map(Object.entries({ + es2015: [ + "for", + "keyFor" + ], + es2019: [ + "description" + ] + })), + WeakMap: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + WeakSet: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + String: new Map(Object.entries({ + es2015: [ + "codePointAt", + "includes", + "endsWith", + "normalize", + "repeat", + "startsWith", + "anchor", + "big", + "blink", + "bold", + "fixed", + "fontcolor", + "fontsize", + "italics", + "link", + "small", + "strike", + "sub", + "sup" + ], + es2017: [ + "padStart", + "padEnd" + ], + es2019: [ + "trimStart", + "trimEnd", + "trimLeft", + "trimRight" + ], + es2020: [ + "matchAll" + ], + es2021: [ + "replaceAll" + ], + es2022: [ + "at" + ] + })), + StringConstructor: new Map(Object.entries({ + es2015: [ + "fromCodePoint", + "raw" + ] + })), + DateTimeFormat: new Map(Object.entries({ + es2017: [ + "formatToParts" + ] + })), + Promise: new Map(Object.entries({ + es2015: emptyArray, + es2018: [ + "finally" + ] + })), + RegExpMatchArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + RegExpExecArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + Intl: new Map(Object.entries({ + es2018: [ + "PluralRules" + ] + })), + NumberFormat: new Map(Object.entries({ + es2018: [ + "formatToParts" + ] + })), + SymbolConstructor: new Map(Object.entries({ + es2020: [ + "matchAll" + ] + })), + DataView: new Map(Object.entries({ + es2020: [ + "setBigInt64", + "setBigUint64", + "getBigInt64", + "getBigUint64" + ] + })), + BigInt: new Map(Object.entries({ + es2020: emptyArray + })), + RelativeTimeFormat: new Map(Object.entries({ + es2020: [ + "format", + "formatToParts", + "resolvedOptions" + ] + })), + Int8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8ClampedArray: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float64Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigInt64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigUint64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Error: new Map(Object.entries({ + es2022: [ + "cause" + ] + })) + })); } function getLiteralText(node, sourceFile, flags) { var _a2; @@ -13373,7 +13702,7 @@ ${lanes.join("\n")} return kind === 1 /* CommonJS */ || kind === 100 /* Node16 */ || kind === 199 /* NodeNext */; } function isEffectiveExternalModule(node, compilerOptions) { - return isExternalModule(node) || compilerOptions.isolatedModules || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; + return isExternalModule(node) || getIsolatedModules(compilerOptions) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; } function isEffectiveStrictModeSourceFile(node, compilerOptions) { switch (node.scriptKind) { @@ -13394,7 +13723,7 @@ ${lanes.join("\n")} if (startsWithUseStrict(node.statements)) { return true; } - if (isExternalModule(node) || compilerOptions.isolatedModules) { + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { if (getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */) { return true; } @@ -15927,12 +16256,12 @@ ${lanes.join("\n")} return stringContains(version, "-dev") || stringContains(version, "-insiders"); } function createTextWriter(newLine) { - let output; - let indent3; - let lineStart; - let lineCount; - let linePos; - let hasTrailingComment = false; + var output; + var indent3; + var lineStart; + var lineCount; + var linePos; + var hasTrailingComment = false; function updateLineCountAndPosFor(s) { const lineStartsOfS = computeLineStarts(s); if (lineStartsOfS.length > 1) { @@ -17055,10 +17384,10 @@ ${lanes.join("\n")} return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags; } function isWriteOnlyAccess(node) { - return accessKind(node) === AccessKind.Write; + return accessKind(node) === 1 /* Write */; } function isWriteAccess(node) { - return accessKind(node) !== AccessKind.Read; + return accessKind(node) !== 0 /* Read */; } function accessKind(node) { const { parent: parent2 } = node; @@ -17159,9 +17488,6 @@ ${lanes.join("\n")} function getObjectFlags(type) { return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0; } - function typeHasCallOrConstructSignatures(type, checker) { - return checker.getSignaturesOfType(type, 0 /* Call */).length !== 0 || checker.getSignaturesOfType(type, 1 /* Construct */).length !== 0; - } function forSomeAncestorDirectory(directory, callback) { return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0); } @@ -17726,7 +18052,7 @@ ${lanes.join("\n")} return !!(compilerOptions.declaration || compilerOptions.composite); } function shouldPreserveConstEnums(compilerOptions) { - return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); + return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions)); } function isIncrementalCompilation(options) { return !!(options.incremental || options.composite); @@ -18254,7 +18580,7 @@ ${lanes.join("\n")} } function rangeOfTypeParameters(sourceFile, typeParameters) { const pos = typeParameters.pos - 1; - const end = skipTrivia(sourceFile.text, typeParameters.end) + 1; + const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1); return { pos, end }; } function skipTypeChecking(sourceFile, options, host) { @@ -18725,7 +19051,7 @@ ${lanes.join("\n")} const tag = getJSDocSatisfiesTag(node); return tag && tag.typeExpression && tag.typeExpression.type; } - var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries; + var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries; var init_utilities = __esm({ "src/compiler/utilities.ts"() { "use strict"; @@ -18829,12 +19155,6 @@ ${lanes.join("\n")} base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; carriageReturnLineFeed = "\r\n"; lineFeed = "\n"; - AccessKind = /* @__PURE__ */ ((AccessKind2) => { - AccessKind2[AccessKind2["Read"] = 0] = "Read"; - AccessKind2[AccessKind2["Write"] = 1] = "Write"; - AccessKind2[AccessKind2["ReadWrite"] = 2] = "ReadWrite"; - return AccessKind2; - })(AccessKind || {}); objectAllocator = { getNodeConstructor: () => Node4, getTokenConstructor: () => Token, @@ -21518,24 +21838,7 @@ ${lanes.join("\n")} return node; } function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) - return 65536 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 128 /* ContainsES2018 */) { - for (const element of getElementsOfBindingOrAssignmentPattern(node)) { - const target = getTargetOfBindingOrAssignmentElement(element); - if (target && isAssignmentPattern(target)) { - if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - return 65536 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 128 /* ContainsES2018 */) { - const flags2 = propagateAssignmentPatternFlags(target); - if (flags2) - return flags2; - } - } - } - } - return 0 /* None */; + return containsObjectRestOrSpread(node) ? 65536 /* ContainsObjectRestOrSpread */ : 0 /* None */; } function updateBinaryExpression(node, left, operator, right) { return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; @@ -24558,14 +24861,114 @@ ${lanes.join("\n")} factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) ]); } + function createESDecorateClassElementAccessGetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "get", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + accessor + ) + ); + } + function createESDecorateClassElementAccessSetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "set", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("value") + ) + ], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + accessor, + factory2.createIdentifier("value") + ) + ) + ]) + ) + ); + } + function createESDecorateClassElementAccessHasMethod(elementName) { + const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name; + return factory2.createPropertyAssignment( + "has", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBinaryExpression( + propertyName, + 101 /* InKeyword */, + factory2.createIdentifier("obj") + ) + ) + ); + } + function createESDecorateClassElementAccessObject(name, access) { + const properties = []; + properties.push(createESDecorateClassElementAccessHasMethod(name)); + if (access.get) + properties.push(createESDecorateClassElementAccessGetMethod(name)); + if (access.set) + properties.push(createESDecorateClassElementAccessSetMethod(name)); + return factory2.createObjectLiteralExpression(properties); + } function createESDecorateClassElementContextObject(contextIn) { return factory2.createObjectLiteralExpression([ factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), - factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()) - // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494 - // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) ]); } function createESDecorateContextObject(contextIn) { @@ -26773,7 +27176,7 @@ ${lanes.join("\n")} } function canHaveIllegalModifiers(node) { const kind = node.kind; - return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; + return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; } function isQuestionOrExclamationToken(node) { return isQuestionToken(node) || isExclamationToken(node); @@ -27035,6 +27438,25 @@ ${lanes.join("\n")} flattenCommaListWorker(node, expressions); return expressions; } + function containsObjectRestOrSpread(node) { + if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) + return true; + if (node.transformFlags & 128 /* ContainsES2018 */) { + for (const element of getElementsOfBindingOrAssignmentPattern(node)) { + const target = getTargetOfBindingOrAssignmentElement(element); + if (target && isAssignmentPattern(target)) { + if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + return true; + } + if (target.transformFlags & 128 /* ContainsES2018 */) { + if (containsObjectRestOrSpread(target)) + return true; + } + } + } + } + return false; + } var BinaryExpressionState, BinaryExpressionStateMachine; var init_utilities2 = __esm({ "src/compiler/factory/utilities.ts"() { @@ -28039,22 +28461,22 @@ ${lanes.join("\n")} [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; ((Parser2) => { - const scanner2 = createScanner( + var scanner2 = createScanner( 99 /* Latest */, /*skipTrivia*/ true ); - const disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; - let NodeConstructor2; - let TokenConstructor2; - let IdentifierConstructor2; - let PrivateIdentifierConstructor2; - let SourceFileConstructor2; + var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; + var NodeConstructor2; + var TokenConstructor2; + var IdentifierConstructor2; + var PrivateIdentifierConstructor2; + var SourceFileConstructor2; function countNode(node) { nodeCount++; return node; } - const baseNodeFactory = { + var baseNodeFactory = { createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2( kind, /*pos*/ @@ -28091,25 +28513,53 @@ ${lanes.join("\n")} 0 )) }; - const factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); - let fileName; - let sourceFlags; - let sourceText; - let languageVersion; - let scriptKind; - let languageVariant; - let parseDiagnostics; - let jsDocDiagnostics; - let syntaxCursor; - let currentToken; - let nodeCount; - let identifiers; - let identifierCount; - let parsingContext; - let notParenthesizedArrow; - let contextFlags; - let topLevel = true; - let parseErrorBeforeNextFinishedNode = false; + var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); + var { + createNodeArray: factoryCreateNodeArray, + createNumericLiteral: factoryCreateNumericLiteral, + createStringLiteral: factoryCreateStringLiteral, + createLiteralLikeNode: factoryCreateLiteralLikeNode, + createIdentifier: factoryCreateIdentifier, + createPrivateIdentifier: factoryCreatePrivateIdentifier, + createToken: factoryCreateToken, + createArrayLiteralExpression: factoryCreateArrayLiteralExpression, + createObjectLiteralExpression: factoryCreateObjectLiteralExpression, + createPropertyAccessExpression: factoryCreatePropertyAccessExpression, + createPropertyAccessChain: factoryCreatePropertyAccessChain, + createElementAccessExpression: factoryCreateElementAccessExpression, + createElementAccessChain: factoryCreateElementAccessChain, + createCallExpression: factoryCreateCallExpression, + createCallChain: factoryCreateCallChain, + createNewExpression: factoryCreateNewExpression, + createParenthesizedExpression: factoryCreateParenthesizedExpression, + createBlock: factoryCreateBlock, + createVariableStatement: factoryCreateVariableStatement, + createExpressionStatement: factoryCreateExpressionStatement, + createIfStatement: factoryCreateIfStatement, + createWhileStatement: factoryCreateWhileStatement, + createForStatement: factoryCreateForStatement, + createForOfStatement: factoryCreateForOfStatement, + createVariableDeclaration: factoryCreateVariableDeclaration, + createVariableDeclarationList: factoryCreateVariableDeclarationList + } = factory2; + var fileName; + var sourceFlags; + var sourceText; + var languageVersion; + var scriptKind; + var languageVariant; + var parseDiagnostics; + var jsDocDiagnostics; + var syntaxCursor; + var currentToken; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; + var notParenthesizedArrow; + var contextFlags; + var topLevel = true; + var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) { var _a2; scriptKind2 = ensureScriptKind(fileName2, scriptKind2); @@ -28209,8 +28659,8 @@ ${lanes.join("\n")} } } } - const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); - const statement = factory2.createExpressionStatement(expression); + const expression = isArray(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); + const statement = factoryCreateExpressionStatement(expression); finishNode(statement, pos); statements = createNodeArray([statement], pos); endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); @@ -28302,7 +28752,7 @@ ${lanes.join("\n")} } sourceFlags = contextFlags; nextToken(); - const statements = parseList(ParsingContext.SourceElements, parseStatement); + const statements = parseList(0 /* SourceElements */, parseStatement); Debug.assert(token() === 1 /* EndOfFileToken */); const endOfFileToken = addJSDocComment(parseTokenNode()); const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); @@ -28365,7 +28815,7 @@ ${lanes.join("\n")} nextToken(); while (token() !== 1 /* EndOfFileToken */) { const startPos = scanner2.getStartPos(); - const statement = parseListElement(ParsingContext.SourceElements, parseStatement); + const statement = parseListElement(0 /* SourceElements */, parseStatement); statements.push(statement); if (startPos === scanner2.getStartPos()) { nextToken(); @@ -28393,7 +28843,7 @@ ${lanes.join("\n")} } } syntaxCursor = savedSyntaxCursor; - return factory2.updateSourceFile(sourceFile, setTextRange(factory2.createNodeArray(statements), sourceFile.statements)); + return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements)); function containsPossibleTopLevelAwait(node) { return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); } @@ -28834,13 +29284,13 @@ ${lanes.join("\n")} const pos = getNodePos(); const kind = token(); nextToken(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseTokenNodeJSDoc() { const pos = getNodePos(); const kind = token(); nextTokenJSDoc(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function canParseSemicolon() { if (token() === 26 /* SemicolonToken */) { @@ -28861,7 +29311,7 @@ ${lanes.join("\n")} return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); } function createNodeArray(elements, pos, end, hasTrailingComma) { - const array = factory2.createNodeArray(elements, hasTrailingComma); + const array = factoryCreateNodeArray(elements, hasTrailingComma); setTextRangePosEnd(array, pos, end != null ? end : scanner2.getStartPos()); return array; } @@ -28883,7 +29333,7 @@ ${lanes.join("\n")} parseErrorAtCurrentToken(diagnosticMessage, arg0); } const pos = getNodePos(); - const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( + const result = kind === 79 /* Identifier */ ? factoryCreateIdentifier( "", /*originalKeywordKind*/ void 0 @@ -28893,15 +29343,15 @@ ${lanes.join("\n")} "", /*templateFlags*/ void 0 - ) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral( + ) : kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral( "", /*numericLiteralFlags*/ void 0 - ) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + ) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( "", /*isSingleQuote*/ void 0 - ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind); + ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); return finishNode(result, pos); } function internIdentifier(text) { @@ -28919,7 +29369,7 @@ ${lanes.join("\n")} const text = internIdentifier(scanner2.getTokenValue()); const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); + return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); @@ -28990,7 +29440,7 @@ ${lanes.join("\n")} } function parsePrivateIdentifier() { const pos = getNodePos(); - const node = factory2.createPrivateIdentifier(internIdentifier(scanner2.getTokenValue())); + const node = factoryCreatePrivateIdentifier(internIdentifier(scanner2.getTokenValue())); nextToken(); return finishNode(node, pos); } @@ -29019,7 +29469,6 @@ ${lanes.join("\n")} return canFollowExportModifier(); case 88 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); - case 127 /* AccessorKeyword */: case 124 /* StaticKeyword */: case 137 /* GetKeyword */: case 151 /* SetKeyword */: @@ -29052,19 +29501,19 @@ ${lanes.join("\n")} return true; } switch (parsingContext2) { - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return lookAhead(isTypeMemberStart); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return lookAhead(isClassMemberStart) || token() === 26 /* SemicolonToken */ && !inErrorRecovery; - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return token() === 22 /* OpenBracketToken */ || isLiteralPropertyName(); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: switch (token()) { case 22 /* OpenBracketToken */: case 41 /* AsteriskToken */: @@ -29074,13 +29523,13 @@ ${lanes.join("\n")} default: return isLiteralPropertyName(); } - case ParsingContext.RestProperties: + case 18 /* RestProperties */: return isLiteralPropertyName(); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName(); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return isAssertionKey2(); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: if (token() === 18 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); } @@ -29089,40 +29538,40 @@ ${lanes.join("\n")} } else { return isIdentifier2() && !isHeritageClauseExtendsOrImplementsKeyword(); } - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 101 /* InKeyword */ || token() === 85 /* ConstKeyword */ || isIdentifier2(); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: switch (token()) { case 27 /* CommaToken */: case 24 /* DotToken */: return true; } - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 25 /* DotDotDotToken */ || isStartOfExpression(); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isStartOfParameter( /*isJSDocParameter*/ false ); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return isStartOfParameter( /*isJSDocParameter*/ true ); - case ParsingContext.TypeArguments: - case ParsingContext.TupleElementTypes: + case 20 /* TypeArguments */: + case 21 /* TupleElementTypes */: return token() === 27 /* CommaToken */ || isStartOfType(); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return isHeritageClause2(); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return tokenIsIdentifierOrKeyword(token()); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return true; } return Debug.fail("Non-exhaustive case in 'isListElement'."); @@ -29166,41 +29615,41 @@ ${lanes.join("\n")} return true; } switch (kind) { - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauses: - case ParsingContext.TypeMembers: - case ParsingContext.ClassMembers: - case ParsingContext.EnumMembers: - case ParsingContext.ObjectLiteralMembers: - case ParsingContext.ObjectBindingElements: - case ParsingContext.ImportOrExportSpecifiers: - case ParsingContext.AssertEntries: + case 1 /* BlockStatements */: + case 2 /* SwitchClauses */: + case 4 /* TypeMembers */: + case 5 /* ClassMembers */: + case 6 /* EnumMembers */: + case 12 /* ObjectLiteralMembers */: + case 9 /* ObjectBindingElements */: + case 23 /* ImportOrExportSpecifiers */: + case 24 /* AssertEntries */: return token() === 19 /* CloseBraceToken */; - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return token() === 19 /* CloseBraceToken */ || token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */; - case ParsingContext.ArrayLiteralMembers: - case ParsingContext.TupleElementTypes: - case ParsingContext.ArrayBindingElements: + case 15 /* ArrayLiteralMembers */: + case 21 /* TupleElementTypes */: + case 10 /* ArrayBindingElements */: return token() === 23 /* CloseBracketToken */; - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: - case ParsingContext.RestProperties: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: + case 18 /* RestProperties */: return token() === 21 /* CloseParenToken */ || token() === 23 /* CloseBracketToken */; - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return token() !== 27 /* CommaToken */; - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return token() === 18 /* OpenBraceToken */ || token() === 19 /* CloseBraceToken */; - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return token() === 31 /* GreaterThanToken */ || token() === 43 /* SlashToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsSlash); default: return false; @@ -29219,7 +29668,7 @@ ${lanes.join("\n")} return false; } function isInSomeParsingContext() { - for (let kind = 0; kind < ParsingContext.Count; kind++) { + for (let kind = 0; kind < 25 /* Count */; kind++) { if (parsingContext & 1 << kind) { if (isListElement2( kind, @@ -29288,38 +29737,38 @@ ${lanes.join("\n")} } function isReusableParsingContext(parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: - case ParsingContext.SwitchClauses: - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: - case ParsingContext.EnumMembers: - case ParsingContext.TypeMembers: - case ParsingContext.VariableDeclarations: - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 5 /* ClassMembers */: + case 2 /* SwitchClauses */: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: + case 6 /* EnumMembers */: + case 4 /* TypeMembers */: + case 8 /* VariableDeclarations */: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return true; } return false; } function canReuseNode(node, parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return isReusableClassMember(node); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return isReusableSwitchClause(node); - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return isReusableStatement(node); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return isReusableEnumMember(node); - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return isReusableTypeMember(node); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isReusableVariableDeclaration(node); - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return isReusableParameter(node); } return false; @@ -29429,56 +29878,56 @@ ${lanes.join("\n")} } function parsingContextErrors(context) { switch (context) { - case ParsingContext.SourceElements: + case 0 /* SourceElements */: return token() === 88 /* DefaultKeyword */ ? parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(93 /* ExportKeyword */)) : parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.BlockStatements: + case 1 /* BlockStatements */: return parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(Diagnostics.case_or_default_expected); - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(Diagnostics.Statement_expected); - case ParsingContext.RestProperties: - case ParsingContext.TypeMembers: + case 18 /* RestProperties */: + case 4 /* TypeMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return parseErrorAtCurrentToken(Diagnostics.Enum_member_expected); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(Diagnostics.Expression_expected); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Variable_declaration_expected); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Property_destructuring_pattern_expected); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Array_element_destructuring_pattern_expected); - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(Diagnostics.Argument_expression_expected); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_assignment_expected); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Expression_or_comma_expected); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_parameter_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return parseErrorAtCurrentToken(Diagnostics.Type_parameter_declaration_expected); - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return parseErrorAtCurrentToken(Diagnostics.Type_argument_expected); - case ParsingContext.TupleElementTypes: + case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(Diagnostics.Type_expected); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); - case ParsingContext.Count: + case 25 /* Count */: return Debug.fail("ParsingContext.Count used as a context"); default: Debug.assertNever(context); @@ -29537,7 +29986,7 @@ ${lanes.join("\n")} ); } function getExpectedCommaDiagnostic(kind) { - return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; + return kind === 6 /* EnumMembers */ ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; } function createMissingList() { const list = createNodeArray([], getNodePos()); @@ -29706,12 +30155,12 @@ ${lanes.join("\n")} // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( scanner2.getTokenValue(), /*isSingleQuote*/ void 0, scanner2.hasExtendedUnicodeEscape() - ) : isLiteralKind(kind) ? factory2.createLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail() + ) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail() ); if (scanner2.hasExtendedUnicodeEscape()) { node.hasExtendedUnicodeEscape = true; @@ -29731,7 +30180,7 @@ ${lanes.join("\n")} } function parseTypeArgumentsOfTypeReference() { if (!scanner2.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function parseTypeReference() { @@ -29913,7 +30362,7 @@ ${lanes.join("\n")} } function parseTypeParameters() { if (token() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function isStartOfParameter(isJSDocParameter) { @@ -30019,7 +30468,7 @@ ${lanes.join("\n")} const savedAwaitContext = inAwaitContext(); setYieldContext(!!(flags & 1 /* Yield */)); setAwaitContext(!!(flags & 2 /* Await */)); - const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(ParsingContext.JSDocParameters, parseJSDocParameter) : parseDelimitedList(ParsingContext.Parameters, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); + const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(17 /* JSDocParameters */, parseJSDocParameter) : parseDelimitedList(16 /* Parameters */, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); setYieldContext(savedYieldContext); setAwaitContext(savedAwaitContext); return parameters; @@ -30087,7 +30536,7 @@ ${lanes.join("\n")} return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { - const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( + const parameters = parseBracketedList(16 /* Parameters */, () => parseParameter( /*inOuterAwaitContext*/ false ), 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); @@ -30186,7 +30635,7 @@ ${lanes.join("\n")} function parseObjectTypeMembers() { let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = parseList(ParsingContext.TypeMembers, parseTypeMember); + members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -30240,7 +30689,7 @@ ${lanes.join("\n")} } const type = parseTypeAnnotation(); parseSemicolon(); - const members = parseList(ParsingContext.TypeMembers, parseTypeMember); + const members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), pos); } @@ -30285,7 +30734,7 @@ ${lanes.join("\n")} const pos = getNodePos(); return finishNode( factory2.createTupleTypeNode( - parseBracketedList(ParsingContext.TupleElementTypes, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) + parseBracketedList(21 /* TupleElementTypes */, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) ), pos ); @@ -30302,7 +30751,7 @@ ${lanes.join("\n")} if (token() === 126 /* AbstractKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(126 /* AbstractKeyword */), pos); + const modifier = finishNode(factoryCreateToken(126 /* AbstractKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -30312,6 +30761,7 @@ ${lanes.join("\n")} const hasJSDoc = hasPrecedingJSDocComment(); const modifiers = parseModifiersForConstructorType(); const isConstructorType = parseOptional(103 /* NewKeyword */); + Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers."); const typeParameters = parseTypeParameters(); const parameters = parseParameters(4 /* Type */); const type = parseReturnType( @@ -30320,8 +30770,6 @@ ${lanes.join("\n")} false ); const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type); - if (!isConstructorType) - node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseKeywordAndNoDot() { @@ -30913,10 +31361,10 @@ ${lanes.join("\n")} } function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { const triState = isParenthesizedArrowFunctionExpression(); - if (triState === Tristate.False) { + if (triState === 0 /* False */) { return void 0; } - return triState === Tristate.True ? parseParenthesizedArrowFunctionExpression( + return triState === 1 /* True */ ? parseParenthesizedArrowFunctionExpression( /*allowAmbiguity*/ true, /*allowReturnTypeInArrowFunction*/ @@ -30928,18 +31376,18 @@ ${lanes.join("\n")} return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } if (token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner2.hasPrecedingLineBreak()) { - return Tristate.False; + return 0 /* False */; } if (token() !== 20 /* OpenParenToken */ && token() !== 29 /* LessThanToken */) { - return Tristate.False; + return 0 /* False */; } } const first2 = token(); @@ -30951,45 +31399,45 @@ ${lanes.join("\n")} case 38 /* EqualsGreaterThanToken */: case 58 /* ColonToken */: case 18 /* OpenBraceToken */: - return Tristate.True; + return 1 /* True */; default: - return Tristate.False; + return 0 /* False */; } } if (second === 22 /* OpenBracketToken */ || second === 18 /* OpenBraceToken */) { - return Tristate.Unknown; + return 2 /* Unknown */; } if (second === 25 /* DotDotDotToken */) { - return Tristate.True; + return 1 /* True */; } if (isModifierKind(second) && second !== 132 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { if (nextToken() === 128 /* AsKeyword */) { - return Tristate.False; + return 0 /* False */; } - return Tristate.True; + return 1 /* True */; } if (!isIdentifier2() && second !== 108 /* ThisKeyword */) { - return Tristate.False; + return 0 /* False */; } switch (nextToken()) { case 58 /* ColonToken */: - return Tristate.True; + return 1 /* True */; case 57 /* QuestionToken */: nextToken(); if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 63 /* EqualsToken */ || token() === 21 /* CloseParenToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; case 27 /* CommaToken */: case 63 /* EqualsToken */: case 21 /* CloseParenToken */: - return Tristate.Unknown; + return 2 /* Unknown */; } - return Tristate.False; + return 0 /* False */; } else { Debug.assert(first2 === 29 /* LessThanToken */); if (!isIdentifier2() && token() !== 85 /* ConstKeyword */) { - return Tristate.False; + return 0 /* False */; } if (languageVariant === 1 /* JSX */) { const isArrowFunctionInJsx = lookAhead(() => { @@ -31000,6 +31448,7 @@ ${lanes.join("\n")} switch (fourth) { case 63 /* EqualsToken */: case 31 /* GreaterThanToken */: + case 43 /* SlashToken */: return false; default: return true; @@ -31010,11 +31459,11 @@ ${lanes.join("\n")} return false; }); if (isArrowFunctionInJsx) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } - return Tristate.Unknown; + return 2 /* Unknown */; } } function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { @@ -31034,7 +31483,7 @@ ${lanes.join("\n")} } function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { if (token() === 132 /* AsyncKeyword */) { - if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === Tristate.True) { + if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) { const pos = getNodePos(); const asyncModifier = parseModifiersForArrowFunction(); const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); @@ -31047,14 +31496,14 @@ ${lanes.join("\n")} if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner2.hasPrecedingLineBreak() || token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.False; + return 0 /* False */; } const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); if (!scanner2.hasPrecedingLineBreak() && expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } } - return Tristate.False; + return 0 /* False */; } function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { const pos = getNodePos(); @@ -31259,6 +31708,12 @@ ${lanes.join("\n")} case 114 /* VoidKeyword */: return parseVoidExpression(); case 29 /* LessThanToken */: + if (languageVariant === 1 /* JSX */) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } return parseTypeAssertion(); case 133 /* AwaitKeyword */: if (isAwaitExpression2()) { @@ -31353,7 +31808,7 @@ ${lanes.join("\n")} return expression; } parseExpectedToken(24 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - return finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -31374,7 +31829,7 @@ ${lanes.join("\n")} factory2.createJsxElement( lastChild.openingElement, lastChild.children, - finishNode(factory2.createJsxClosingElement(finishNode(factory2.createIdentifier(""), end, end)), end, end) + finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end) ), lastChild.openingElement.pos, end @@ -31462,7 +31917,7 @@ ${lanes.join("\n")} const list = []; const listPos = getNodePos(); const saveParsingContext = parsingContext; - parsingContext |= 1 << ParsingContext.JsxChildren; + parsingContext |= 1 << 14 /* JsxChildren */; while (true) { const child = parseJsxChild(openingTag, currentToken = scanner2.reScanJsxToken()); if (!child) @@ -31477,7 +31932,7 @@ ${lanes.join("\n")} } function parseJsxAttributes() { const pos = getNodePos(); - return finishNode(factory2.createJsxAttributes(parseList(ParsingContext.JsxAttributes, parseJsxAttribute)), pos); + return finishNode(factory2.createJsxAttributes(parseList(13 /* JsxAttributes */, parseJsxAttribute)), pos); } function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { const pos = getNodePos(); @@ -31517,7 +31972,7 @@ ${lanes.join("\n")} scanJsxIdentifier(); let expression = token() === 108 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - expression = finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -31611,13 +32066,9 @@ ${lanes.join("\n")} function parseJsxClosingFragment(inExpressionContext) { const pos = getNodePos(); parseExpected(30 /* LessThanSlashToken */); - if (tokenIsIdentifierOrKeyword(token())) { - parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); - } if (parseExpected( 31 /* GreaterThanToken */, - /*diagnostic*/ - void 0, + Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment, /*shouldAdvance*/ false )) { @@ -31630,6 +32081,7 @@ ${lanes.join("\n")} return finishNode(factory2.createJsxJsxClosingFragment(), pos); } function parseTypeAssertion() { + Debug.assert(languageVariant !== 1 /* JSX */, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments."); const pos = getNodePos(); parseExpected(29 /* LessThanToken */); const type = parseType(); @@ -31671,7 +32123,7 @@ ${lanes.join("\n")} true ); const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); - const propertyAccess = isOptionalChain2 ? factory2.createPropertyAccessChain(expression, questionDotToken, name) : factory2.createPropertyAccessExpression(expression, name); + const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name) : factoryCreatePropertyAccessExpression(expression, name); if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers); } @@ -31699,7 +32151,7 @@ ${lanes.join("\n")} argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createElementAccessChain(expression, questionDotToken, argumentExpression) : factory2.createElementAccessExpression(expression, argumentExpression); + const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression); return finishNode(indexedAccess, pos); } function parseMemberExpressionRest(pos, expression, allowOptionalChain) { @@ -31786,7 +32238,7 @@ ${lanes.join("\n")} expression = expression.expression; } const argumentList = parseArgumentList(); - const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList); + const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList); expression = finishNode(callExpr, pos); continue; } @@ -31797,7 +32249,7 @@ ${lanes.join("\n")} false, Diagnostics.Identifier_expected ); - expression = finishNode(factory2.createPropertyAccessChain(expression, questionDotToken, name), pos); + expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name), pos); } break; } @@ -31805,7 +32257,7 @@ ${lanes.join("\n")} } function parseArgumentList() { parseExpected(20 /* OpenParenToken */); - const result = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); + const result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(21 /* CloseParenToken */); return result; } @@ -31817,7 +32269,7 @@ ${lanes.join("\n")} return void 0; } nextToken(); - const typeArguments = parseDelimitedList(ParsingContext.TypeArguments, parseType); + const typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType); if (reScanGreaterToken() !== 31 /* GreaterThanToken */) { return void 0; } @@ -31892,7 +32344,7 @@ ${lanes.join("\n")} parseExpected(20 /* OpenParenToken */); const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - return withJSDoc(finishNode(factory2.createParenthesizedExpression(expression), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc); } function parseSpreadElement() { const pos = getNodePos(); @@ -31917,9 +32369,9 @@ ${lanes.join("\n")} const openBracketPosition = scanner2.getTokenPos(); const openBracketParsed = parseExpected(22 /* OpenBracketToken */); const multiLine = scanner2.hasPrecedingLineBreak(); - const elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArgumentOrArrayLiteralElement); + const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketParsed, openBracketPosition); - return finishNode(factory2.createArrayLiteralExpression(elements, multiLine), pos); + return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos); } function parseObjectLiteralElement() { const pos = getNodePos(); @@ -31978,13 +32430,13 @@ ${lanes.join("\n")} const openBraceParsed = parseExpected(18 /* OpenBraceToken */); const multiLine = scanner2.hasPrecedingLineBreak(); const properties = parseDelimitedList( - ParsingContext.ObjectLiteralMembers, + 12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true ); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - return finishNode(factory2.createObjectLiteralExpression(properties, multiLine), pos); + return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos); } function parseFunctionExpression() { const savedDecoratorContext = inDecoratorContext(); @@ -32041,7 +32493,7 @@ ${lanes.join("\n")} parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression)); } const argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : void 0; - return finishNode(factory2.createNewExpression(expression, typeArguments, argumentList), pos); + return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { const pos = getNodePos(); @@ -32050,17 +32502,17 @@ ${lanes.join("\n")} const openBraceParsed = parseExpected(18 /* OpenBraceToken */, diagnosticMessage); if (openBraceParsed || ignoreMissingOpenBrace) { const multiLine = scanner2.hasPrecedingLineBreak(); - const statements = parseList(ParsingContext.BlockStatements, parseStatement); + const statements = parseList(1 /* BlockStatements */, parseStatement); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc); + const result = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc); if (token() === 63 /* EqualsToken */) { - parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); + parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses); nextToken(); } return result; } else { const statements = createMissingList(); - return withJSDoc(finishNode(factory2.createBlock( + return withJSDoc(finishNode(factoryCreateBlock( statements, /*multiLine*/ void 0 @@ -32109,7 +32561,7 @@ ${lanes.join("\n")} parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const thenStatement = parseStatement(); const elseStatement = parseOptional(91 /* ElseKeyword */) ? parseStatement() : void 0; - return withJSDoc(finishNode(factory2.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); } function parseDoStatement() { const pos = getNodePos(); @@ -32133,7 +32585,7 @@ ${lanes.join("\n")} const expression = allowInAnd(parseExpression); parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const statement = parseStatement(); - return withJSDoc(finishNode(factory2.createWhileStatement(expression, statement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc); } function parseForOrForInOrForOfStatement() { const pos = getNodePos(); @@ -32159,7 +32611,7 @@ ${lanes.join("\n")} true )); parseExpected(21 /* CloseParenToken */); - node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement()); + node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement()); } else if (parseOptional(101 /* InKeyword */)) { const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); @@ -32170,7 +32622,7 @@ ${lanes.join("\n")} parseExpected(26 /* SemicolonToken */); const incrementor = token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; parseExpected(21 /* CloseParenToken */); - node = factory2.createForStatement(initializer, condition, incrementor, parseStatement()); + node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement()); } return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -32208,14 +32660,14 @@ ${lanes.join("\n")} parseExpected(82 /* CaseKeyword */); const expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return withJSDoc(finishNode(factory2.createCaseClause(expression, statements), pos), hasJSDoc); } function parseDefaultClause() { const pos = getNodePos(); parseExpected(88 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(factory2.createDefaultClause(statements), pos); } function parseCaseOrDefaultClause() { @@ -32224,7 +32676,7 @@ ${lanes.join("\n")} function parseCaseBlock() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const clauses = parseList(ParsingContext.SwitchClauses, parseCaseOrDefaultClause); + const clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createCaseBlock(clauses), pos); } @@ -32245,7 +32697,7 @@ ${lanes.join("\n")} let expression = scanner2.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); if (expression === void 0) { identifierCount++; - expression = finishNode(factory2.createIdentifier(""), getNodePos()); + expression = finishNode(factoryCreateIdentifier(""), getNodePos()); } if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); @@ -32306,7 +32758,7 @@ ${lanes.join("\n")} if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); } - node = factory2.createExpressionStatement(expression); + node = factoryCreateExpressionStatement(expression); if (hasParen) { hasJSDoc = false; } @@ -32665,14 +33117,14 @@ ${lanes.join("\n")} function parseObjectBindingPattern() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const elements = parseDelimitedList(ParsingContext.ObjectBindingElements, parseObjectBindingElement); + const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createObjectBindingPattern(elements), pos); } function parseArrayBindingPattern() { const pos = getNodePos(); parseExpected(22 /* OpenBracketToken */); - const elements = parseDelimitedList(ParsingContext.ArrayBindingElements, parseArrayBindingElement); + const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); return finishNode(factory2.createArrayBindingPattern(elements), pos); } @@ -32704,7 +33156,7 @@ ${lanes.join("\n")} } const type = parseTypeAnnotation(); const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); - const node = factory2.createVariableDeclaration(name, exclamationToken, type, initializer); + const node = factoryCreateVariableDeclaration(name, exclamationToken, type, initializer); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseVariableDeclarationList(inForStatementInitializer) { @@ -32730,12 +33182,12 @@ ${lanes.join("\n")} const savedDisallowIn = inDisallowInContext(); setDisallowInContext(inForStatementInitializer); declarations = parseDelimitedList( - ParsingContext.VariableDeclarations, + 8 /* VariableDeclarations */, inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation ); setDisallowInContext(savedDisallowIn); } - return finishNode(factory2.createVariableDeclarationList(declarations, flags), pos); + return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos); } function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; @@ -32746,7 +33198,7 @@ ${lanes.join("\n")} false ); parseSemicolon(); - const node = factory2.createVariableStatement(modifiers, declarationList); + const node = factoryCreateVariableStatement(modifiers, declarationList); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { @@ -32975,22 +33427,30 @@ ${lanes.join("\n")} return void 0; } } - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); let list; - let modifier, hasSeenStaticModifier = false; + let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false; + if (allowDecorators && token() === 59 /* AtToken */) { + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + } while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; list = append(list, modifier); + hasLeadingModifier = true; } - if (allowDecorators && token() === 59 /* AtToken */) { - let decorator; + if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) { while (decorator = tryParseDecorator()) { list = append(list, decorator); + hasTrailingDecorator = true; } + } + if (hasTrailingDecorator) { while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; @@ -33004,7 +33464,7 @@ ${lanes.join("\n")} if (token() === 132 /* AsyncKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(132 /* AsyncKeyword */), pos); + const modifier = finishNode(factoryCreateToken(132 /* AsyncKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -33133,7 +33593,7 @@ ${lanes.join("\n")} } function parseHeritageClauses() { if (isHeritageClause2()) { - return parseList(ParsingContext.HeritageClauses, parseHeritageClause); + return parseList(22 /* HeritageClauses */, parseHeritageClause); } return void 0; } @@ -33142,7 +33602,7 @@ ${lanes.join("\n")} const tok = token(); Debug.assert(tok === 94 /* ExtendsKeyword */ || tok === 117 /* ImplementsKeyword */); nextToken(); - const types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseExpressionWithTypeArguments); + const types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(factory2.createHeritageClause(tok, types), pos); } function parseExpressionWithTypeArguments() { @@ -33155,13 +33615,13 @@ ${lanes.join("\n")} return finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); } function tryParseTypeArguments() { - return token() === 29 /* LessThanToken */ ? parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; + return token() === 29 /* LessThanToken */ ? parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; } function isHeritageClause2() { return token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; } function parseClassMembers() { - return parseList(ParsingContext.ClassMembers, parseClassElement); + return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); @@ -33194,7 +33654,7 @@ ${lanes.join("\n")} const name = parseIdentifier(); let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(ParsingContext.EnumMembers, parseEnumMember)); + members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(6 /* EnumMembers */, parseEnumMember)); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -33206,7 +33666,7 @@ ${lanes.join("\n")} const pos = getNodePos(); let statements; if (parseExpected(18 /* OpenBraceToken */)) { - statements = parseList(ParsingContext.BlockStatements, parseStatement); + statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); } else { statements = createMissingList(); @@ -33331,7 +33791,7 @@ ${lanes.join("\n")} if (parseExpected(18 /* OpenBraceToken */)) { const multiLine = scanner2.hasPrecedingLineBreak(); const elements = parseDelimitedList( - ParsingContext.AssertEntries, + 24 /* AssertEntries */, parseAssertEntry, /*considerSemicolonAsDelimiter*/ true @@ -33415,7 +33875,7 @@ ${lanes.join("\n")} } function parseNamedImportsOrExports(kind) { const pos = getNodePos(); - const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); + const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { @@ -33591,7 +34051,7 @@ ${lanes.join("\n")} /*isDeclarationFile*/ false, [], - factory2.createToken(1 /* EndOfFileToken */), + factoryCreateToken(1 /* EndOfFileToken */), 0 /* None */, noop ); @@ -34252,7 +34712,7 @@ ${lanes.join("\n")} let node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { const name = parseJSDocIdentifierName(); - node = finishNode(factory2.createPropertyAccessExpression(node, name), pos); + node = finishNode(factoryCreatePropertyAccessExpression(node, name), pos); } return node; } @@ -34543,7 +35003,7 @@ ${lanes.join("\n")} const end2 = scanner2.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner2.getTokenValue()); - const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); + const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -34864,7 +35324,7 @@ ${lanes.join("\n")} let currentArrayIndex = 0; Debug.assert(currentArrayIndex < currentArray.length); let current = currentArray[currentArrayIndex]; - let lastQueriedPosition = InvalidPosition.Value; + let lastQueriedPosition = -1 /* Value */; return { currentNode(position) { if (position !== lastQueriedPosition) { @@ -34883,7 +35343,7 @@ ${lanes.join("\n")} }; function findHighestListElementThatStartsAtPosition(position) { currentArray = void 0; - currentArrayIndex = InvalidPosition.Value; + currentArrayIndex = -1 /* Value */; current = void 0; forEachChild(sourceFile, visitNode3, visitArray2); return; @@ -37740,7 +38200,7 @@ ${lanes.join("\n")} { name: "allowArbitraryExtensions", type: "boolean", - affectsModuleResolution: true, + affectsProgramStructure: true, category: Diagnostics.Modules, description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present, defaultValueDescription: false @@ -38243,6 +38703,22 @@ ${lanes.join("\n")} Debug.assert(extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } + function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) { + if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) { + const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled); + if (originalPath) + resolved = { ...resolved, path: resolvedFileName, originalPath }; + } + return createResolvedModuleWithFailedLookupLocations( + resolved, + isExternalLibraryImport, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache, + legacyResult + ); + } function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); @@ -38401,6 +38877,15 @@ ${lanes.join("\n")} const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */; } + function getOriginalAndResolvedFileName(fileName, host, traceEnabled) { + const resolvedFileName = realPath(fileName, host, traceEnabled); + const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + return { + // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames + resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, + originalPath: pathsAreEqual ? void 0 : fileName + }; + } function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) { Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself."); const traceEnabled = isTraceEnabled(options, host); @@ -38445,9 +38930,9 @@ ${lanes.join("\n")} const affectingLocations = []; let features = getNodeResolutionFeatures(options); if (resolutionMode === 99 /* ESNext */ && (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */)) { - features |= NodeResolutionFeatures.EsmMode; + features |= 32 /* EsmMode */; } - const conditions = features & NodeResolutionFeatures.Exports ? getConditions(options, !!(features & NodeResolutionFeatures.EsmMode)) : []; + const conditions = features & 8 /* Exports */ ? getConditions(options, !!(features & 32 /* EsmMode */)) : []; const diagnostics = []; const moduleResolutionState = { compilerOptions: options, @@ -38472,13 +38957,13 @@ ${lanes.join("\n")} let resolvedTypeReferenceDirective; if (resolved) { const { fileName, packageId } = resolved; - const resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled); - const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + let resolvedFileName = fileName, originalPath; + if (!options.preserveSymlinks) + ({ resolvedFileName, originalPath } = getOriginalAndResolvedFileName(fileName, host, traceEnabled)); resolvedTypeReferenceDirective = { primary, - // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames - resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, - originalPath: pathsAreEqual ? void 0 : fileName, + resolvedFileName, + originalPath, packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) }; @@ -38580,35 +39065,38 @@ ${lanes.join("\n")} } } function getNodeResolutionFeatures(options) { - let features = NodeResolutionFeatures.None; + let features = 0 /* None */; switch (getEmitModuleResolutionKind(options)) { case 3 /* Node16 */: - features = NodeResolutionFeatures.Node16Default; + features = 30 /* Node16Default */; break; case 99 /* NodeNext */: - features = NodeResolutionFeatures.NodeNextDefault; + features = 30 /* NodeNextDefault */; break; case 100 /* Bundler */: - features = NodeResolutionFeatures.BundlerDefault; + features = 30 /* BundlerDefault */; break; } if (options.resolvePackageJsonExports) { - features |= NodeResolutionFeatures.Exports; + features |= 8 /* Exports */; } else if (options.resolvePackageJsonExports === false) { - features &= ~NodeResolutionFeatures.Exports; + features &= ~8 /* Exports */; } if (options.resolvePackageJsonImports) { - features |= NodeResolutionFeatures.Imports; + features |= 2 /* Imports */; } else if (options.resolvePackageJsonImports === false) { - features &= ~NodeResolutionFeatures.Imports; + features &= ~2 /* Imports */; } return features; } function getConditions(options, esmMode) { - const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["node", "import"] : ["node", "require"]; + const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["import"] : ["require"]; if (!options.noDtsResolution) { conditions.push("types"); } + if (getEmitModuleResolutionKind(options) !== 100 /* Bundler */) { + conditions.push("node"); + } return concatenate(conditions, options.customConditions); } function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) { @@ -39322,7 +39810,7 @@ ${lanes.join("\n")} isConfigLookup, candidateIsFromPackageJsonField: false }; - if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) { + if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(compilerOptions))) { trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", ")); } let result; @@ -39348,13 +39836,14 @@ ${lanes.join("\n")} legacyResult = diagnosticResult.value.resolved.path; } } - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache, + state, legacyResult ); function tryResolve(extensions2, state2) { @@ -39384,16 +39873,7 @@ ${lanes.join("\n")} } resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } - if (!resolved2) - return void 0; - let resolvedValue = resolved2.value; - if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) { - const path = realPath(resolvedValue.path, host, traceEnabled); - const pathsAreEqual = arePathsEqual(path, resolvedValue.path, host); - const originalPath = pathsAreEqual ? void 0 : resolvedValue.path; - resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path, originalPath }; - } - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } }; } else { const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName); const resolved2 = nodeLoadModuleByRelativeName( @@ -39575,7 +40055,7 @@ ${lanes.join("\n")} if (!onlyRecordFailures) { if (state.host.fileExists(fileName)) { if (state.traceEnabled) { - trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); + trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName); } return fileName; } else { @@ -40170,18 +40650,24 @@ ${lanes.join("\n")} ))); } else if (typeof target === "object" && target !== null) { if (!Array.isArray(target)) { + traceIfEnabled(state, Diagnostics.Entering_conditional_exports); for (const condition of getOwnKeys(target)) { if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) { traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); const subTarget = target[condition]; const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key); if (result) { + traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition); + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return result; + } else { + traceIfEnabled(state, Diagnostics.Failed_to_resolve_under_condition_0, condition); } } else { traceIfEnabled(state, Diagnostics.Saw_non_matching_condition_0, condition); } } + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return void 0; } else { if (!length(target)) { @@ -40547,13 +41033,14 @@ ${lanes.join("\n")} candidateIsFromPackageJsonField: false }; const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0)); - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, resolved && resolved.value, (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path), failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state ); function tryResolve(extensions) { const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); @@ -40809,35 +41296,36 @@ ${lanes.join("\n")} measure("Bind", "beforeBind", "afterBind"); } function createBinder() { - let file; - let options; - let languageVersion; - let parent2; - let container; - let thisParentContainer; - let blockScopeContainer; - let lastContainer; - let delayedTypeAliases; - let seenThisKeyword; - let currentFlow; - let currentBreakTarget; - let currentContinueTarget; - let currentReturnTarget; - let currentTrueTarget; - let currentFalseTarget; - let currentExceptionTarget; - let preSwitchCaseFlow; - let activeLabelList; - let hasExplicitReturn; - let emitFlags; - let inStrictMode; - let inAssignmentPattern = false; - let symbolCount = 0; - let Symbol46; - let classifiableNames; - const unreachableFlow = { flags: 1 /* Unreachable */ }; - const reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; - const bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + var file; + var options; + var languageVersion; + var parent2; + var container; + var thisParentContainer; + var blockScopeContainer; + var lastContainer; + var delayedTypeAliases; + var seenThisKeyword; + var currentFlow; + var currentBreakTarget; + var currentContinueTarget; + var currentReturnTarget; + var currentTrueTarget; + var currentFalseTarget; + var currentExceptionTarget; + var preSwitchCaseFlow; + var activeLabelList; + var hasExplicitReturn; + var emitFlags; + var inStrictMode; + var inAssignmentPattern = false; + var symbolCount = 0; + var Symbol46; + var classifiableNames; + var unreachableFlow = { flags: 1 /* Unreachable */ }; + var reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; + var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + return bindSourceFile2; function createDiagnosticForNode2(node, message, arg0, arg1, arg2) { return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2); } @@ -40888,7 +41376,6 @@ ${lanes.join("\n")} inAssignmentPattern = false; emitFlags = 0 /* None */; } - return bindSourceFile2; function bindInStrictMode(file2, opts) { if (getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { return true; @@ -43885,7 +44372,7 @@ ${lanes.join("\n")} let redirectPathsSpecifiers; let relativeSpecifiers; for (const modulePath of modulePaths) { - const specifier = tryGetModuleNameAsNodeModule( + const specifier = modulePath.isInNodeModules ? tryGetModuleNameAsNodeModule( modulePath, info, importingSourceFile, @@ -43895,7 +44382,7 @@ ${lanes.join("\n")} /*packageNameOnly*/ void 0, options.overrideImportMode - ); + ) : void 0; nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier); if (specifier && modulePath.isRedirect) { return nodeModulesSpecifiers; @@ -44307,9 +44794,11 @@ ${lanes.join("\n")} if (typeof cachedPackageJson === "object" || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) { const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath)); const importMode = overrideMode || importingSourceFile.impliedNodeFormat; - if (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */) { - const conditions = ["node", importMode === 99 /* ESNext */ ? "import" : "require", "types"]; - const fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions) : void 0; + if (getResolvePackageJsonExports(options)) { + const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1); + const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2); + const conditions = getConditions(options, importMode === 99 /* ESNext */); + const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0; if (fromExports) { const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) }; return { ...withJsExtension, verbatimFromExports: true }; @@ -44503,8 +44992,8 @@ ${lanes.join("\n")} return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */; } function createTypeChecker(host) { - const getPackagesMap = memoize(() => { - const map2 = /* @__PURE__ */ new Map(); + var getPackagesMap = memoize(() => { + var map2 = /* @__PURE__ */ new Map(); host.getSourceFiles().forEach((sf) => { if (!sf.resolvedModules) return; @@ -44515,57 +45004,58 @@ ${lanes.join("\n")} }); return map2; }); - let deferredDiagnosticsCallbacks = []; - let addLazyDiagnostic = (arg) => { + var deferredDiagnosticsCallbacks = []; + var addLazyDiagnostic = (arg) => { deferredDiagnosticsCallbacks.push(arg); }; - let cancellationToken; - const requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); - let requestedExternalEmitHelpers; - let externalHelpersModule; - const Symbol46 = objectAllocator.getSymbolConstructor(); - const Type27 = objectAllocator.getTypeConstructor(); - const Signature15 = objectAllocator.getSignatureConstructor(); - let typeCount = 0; - let symbolCount = 0; - let totalInstantiationCount = 0; - let instantiationCount = 0; - let instantiationDepth = 0; - let inlineLevel = 0; - let currentNode; - let varianceTypeParameter; - const emptySymbols = createSymbolTable(); - const arrayVariances = [1 /* Covariant */]; - const compilerOptions = host.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const moduleKind = getEmitModuleKind(compilerOptions); - const legacyDecorators = !!compilerOptions.experimentalDecorators; - const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); - const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); - const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); - const strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); - const strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); - const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); - const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); - const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); - const useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); - const keyofStringsOnly = !!compilerOptions.keyofStringsOnly; - const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */; - const exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; - const checkBinaryExpression = createCheckBinaryExpression(); - const emitResolver = createResolver(); - const nodeBuilder = createNodeBuilder(); - const globals = createSymbolTable(); - const undefinedSymbol = createSymbol(4 /* Property */, "undefined"); + var cancellationToken; + var requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); + var requestedExternalEmitHelpers; + var externalHelpersModule; + var Symbol46 = objectAllocator.getSymbolConstructor(); + var Type27 = objectAllocator.getTypeConstructor(); + var Signature15 = objectAllocator.getSignatureConstructor(); + var typeCount = 0; + var symbolCount = 0; + var totalInstantiationCount = 0; + var instantiationCount = 0; + var instantiationDepth = 0; + var inlineLevel = 0; + var currentNode; + var varianceTypeParameter; + var isInferencePartiallyBlocked = false; + var emptySymbols = createSymbolTable(); + var arrayVariances = [1 /* Covariant */]; + var compilerOptions = host.getCompilerOptions(); + var languageVersion = getEmitScriptTarget(compilerOptions); + var moduleKind = getEmitModuleKind(compilerOptions); + var legacyDecorators = !!compilerOptions.experimentalDecorators; + var useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); + var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); + var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); + var strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); + var strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); + var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); + var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); + var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); + var keyofStringsOnly = !!compilerOptions.keyofStringsOnly; + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */; + var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; + var checkBinaryExpression = createCheckBinaryExpression(); + var emitResolver = createResolver(); + var nodeBuilder = createNodeBuilder(); + var globals = createSymbolTable(); + var undefinedSymbol = createSymbol(4 /* Property */, "undefined"); undefinedSymbol.declarations = []; - const globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); + var globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); globalThisSymbol.exports = globals; globalThisSymbol.declarations = []; globals.set(globalThisSymbol.escapedName, globalThisSymbol); - const argumentsSymbol = createSymbol(4 /* Property */, "arguments"); - const requireSymbol = createSymbol(4 /* Property */, "require"); - const isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; - let apparentArgumentCount; + var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); + var requireSymbol = createSymbol(4 /* Property */, "require"); + var isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; + var apparentArgumentCount; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0), @@ -44743,15 +45233,14 @@ ${lanes.join("\n")} getTypeOfPropertyOfContextualType, getFullyQualifiedName, getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */), - getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => getResolvedSignatureWorker( + getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker( call, candidatesOutArray, /*argumentCount*/ void 0, - 32 /* IsForStringLiteralArgumentCompletions */, - editingArgument - ), - getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */), + 32 /* IsForStringLiteralArgumentCompletions */ + )), + getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)), getExpandedParameters, hasEffectiveRestParameter, containsArgumentsReference, @@ -44856,6 +45345,7 @@ ${lanes.join("\n")} isArrayType, isTupleType, isArrayLikeType, + isEmptyAnonymousObjectType, isTypeInvalidDueToUnionDiscriminant, getExactOptionalProperties, getAllPossiblePropertiesOfTypes, @@ -44942,81 +45432,93 @@ ${lanes.join("\n")} isPropertyAccessible, getTypeOnlyAliasDeclaration, getMemberOverrideModifierStatus, - isTypeParameterPossiblyReferenced + isTypeParameterPossiblyReferenced, + typeHasCallOrConstructSignatures }; - function runWithInferenceBlockedFromSourceNode(node, fn) { + function runWithoutResolvedSignatureCaching(node, fn) { const containingCall = findAncestor(node, isCallLikeExpression); const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature; + if (containingCall) { + getNodeLinks(containingCall).resolvedSignature = void 0; + } + const result = fn(); + if (containingCall) { + getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; + } + return result; + } + function runWithInferenceBlockedFromSourceNode(node, fn) { + const containingCall = findAncestor(node, isCallLikeExpression); if (containingCall) { let toMarkSkip = node; do { getNodeLinks(toMarkSkip).skipDirectInference = true; toMarkSkip = toMarkSkip.parent; } while (toMarkSkip && toMarkSkip !== containingCall); - getNodeLinks(containingCall).resolvedSignature = void 0; } - const result = fn(); + isInferencePartiallyBlocked = true; + const result = runWithoutResolvedSignatureCaching(node, fn); + isInferencePartiallyBlocked = false; if (containingCall) { let toMarkSkip = node; do { getNodeLinks(toMarkSkip).skipDirectInference = void 0; toMarkSkip = toMarkSkip.parent; } while (toMarkSkip && toMarkSkip !== containingCall); - getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; } return result; } - function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode, editingArgument) { + function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) { const node = getParseTreeNode(nodeIn, isCallLikeExpression); apparentArgumentCount = argumentCount; - const res = !node ? void 0 : editingArgument ? runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignature(node, candidatesOutArray, checkMode)) : getResolvedSignature(node, candidatesOutArray, checkMode); + const res = !node ? void 0 : getResolvedSignature(node, candidatesOutArray, checkMode); apparentArgumentCount = void 0; return res; } - const tupleTypes = /* @__PURE__ */ new Map(); - const unionTypes = /* @__PURE__ */ new Map(); - const intersectionTypes = /* @__PURE__ */ new Map(); - const stringLiteralTypes = /* @__PURE__ */ new Map(); - const numberLiteralTypes = /* @__PURE__ */ new Map(); - const bigIntLiteralTypes = /* @__PURE__ */ new Map(); - const enumLiteralTypes = /* @__PURE__ */ new Map(); - const indexedAccessTypes = /* @__PURE__ */ new Map(); - const templateLiteralTypes = /* @__PURE__ */ new Map(); - const stringMappingTypes = /* @__PURE__ */ new Map(); - const substitutionTypes = /* @__PURE__ */ new Map(); - const subtypeReductionCache = /* @__PURE__ */ new Map(); - const decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); - const cachedTypes = /* @__PURE__ */ new Map(); - const evolvingArrayTypes = []; - const undefinedProperties = /* @__PURE__ */ new Map(); - const markerTypes = /* @__PURE__ */ new Set(); - const unknownSymbol = createSymbol(4 /* Property */, "unknown"); - const resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); - const unresolvedSymbols = /* @__PURE__ */ new Map(); - const errorTypes = /* @__PURE__ */ new Map(); - const anyType = createIntrinsicType(1 /* Any */, "any"); - const autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); - const wildcardType = createIntrinsicType(1 /* Any */, "any"); - const errorType = createIntrinsicType(1 /* Any */, "error"); - const unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); - const nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); - const intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); - const unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - const nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - const undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); - const missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; - const optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const nullType = createIntrinsicType(65536 /* Null */, "null"); - const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); - const stringType = createIntrinsicType(4 /* String */, "string"); - const numberType = createIntrinsicType(8 /* Number */, "number"); - const bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); - const falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - const regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - const trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); - const regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var tupleTypes = /* @__PURE__ */ new Map(); + var unionTypes = /* @__PURE__ */ new Map(); + var intersectionTypes = /* @__PURE__ */ new Map(); + var stringLiteralTypes = /* @__PURE__ */ new Map(); + var numberLiteralTypes = /* @__PURE__ */ new Map(); + var bigIntLiteralTypes = /* @__PURE__ */ new Map(); + var enumLiteralTypes = /* @__PURE__ */ new Map(); + var indexedAccessTypes = /* @__PURE__ */ new Map(); + var templateLiteralTypes = /* @__PURE__ */ new Map(); + var stringMappingTypes = /* @__PURE__ */ new Map(); + var substitutionTypes = /* @__PURE__ */ new Map(); + var subtypeReductionCache = /* @__PURE__ */ new Map(); + var decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); + var cachedTypes = /* @__PURE__ */ new Map(); + var evolvingArrayTypes = []; + var undefinedProperties = /* @__PURE__ */ new Map(); + var markerTypes = /* @__PURE__ */ new Set(); + var unknownSymbol = createSymbol(4 /* Property */, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); + var unresolvedSymbols = /* @__PURE__ */ new Map(); + var errorTypes = /* @__PURE__ */ new Map(); + var anyType = createIntrinsicType(1 /* Any */, "any"); + var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); + var errorType = createIntrinsicType(1 /* Any */, "error"); + var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); + var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); + var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); + var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); + var missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; + var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var nullType = createIntrinsicType(65536 /* Null */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); + var stringType = createIntrinsicType(4 /* String */, "string"); + var numberType = createIntrinsicType(8 /* Number */, "number"); + var bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); + var falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); trueType.regularType = regularTrueType; trueType.freshType = trueType; regularTrueType.regularType = regularTrueType; @@ -45025,26 +45527,26 @@ ${lanes.join("\n")} falseType.freshType = falseType; regularFalseType.regularType = regularFalseType; regularFalseType.freshType = falseType; - const booleanType = getUnionType([regularFalseType, regularTrueType]); - const esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); - const voidType = createIntrinsicType(16384 /* Void */, "void"); - const neverType = createIntrinsicType(131072 /* Never */, "never"); - const silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); - const implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); - const unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); - const nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); - const stringOrNumberType = getUnionType([stringType, numberType]); - const stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); - const keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; - const numberOrBigIntType = getUnionType([numberType, bigintType]); - const templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); - const numericStringType = getTemplateLiteralType(["", ""], [numberType]); - const restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); - const permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); - const uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); - const uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); - let outofbandVarianceMarkerHandler; - const reportUnreliableMapper = makeFunctionTypeMapper((t) => { + var booleanType = getUnionType([regularFalseType, regularTrueType]); + var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); + var voidType = createIntrinsicType(16384 /* Void */, "void"); + var neverType = createIntrinsicType(131072 /* Never */, "never"); + var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); + var implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); + var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); + var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); + var stringOrNumberType = getUnionType([stringType, numberType]); + var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); + var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; + var numberOrBigIntType = getUnionType([numberType, bigintType]); + var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); + var numericStringType = getTemplateLiteralType(["", ""], [numberType]); + var restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); + var permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); + var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); + var uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); + var outofbandVarianceMarkerHandler; + var reportUnreliableMapper = makeFunctionTypeMapper((t) => { if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { outofbandVarianceMarkerHandler( /*onlyUnreliable*/ @@ -45053,7 +45555,7 @@ ${lanes.join("\n")} } return t; }, () => "(unmeasurable reporter)"); - const reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { + var reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { outofbandVarianceMarkerHandler( /*onlyUnreliable*/ @@ -45062,30 +45564,30 @@ ${lanes.join("\n")} } return t; }, () => "(unreliable reporter)"); - const emptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */; - const emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); + var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = createSymbolTable(); - const emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); - const unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; - const emptyGenericType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; + var emptyGenericType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); emptyGenericType.instantiations = /* @__PURE__ */ new Map(); - const anyFunctionType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var anyFunctionType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); anyFunctionType.objectFlags |= 262144 /* NonInferrableType */; - const noConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const circularConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const resolvingDefaultType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const markerSuperType = createTypeParameter(); - const markerSubType = createTypeParameter(); + var noConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var circularConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var resolvingDefaultType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var markerSuperType = createTypeParameter(); + var markerSubType = createTypeParameter(); markerSubType.constraint = markerSuperType; - const markerOtherType = createTypeParameter(); - const markerSuperTypeForCheck = createTypeParameter(); - const markerSubTypeForCheck = createTypeParameter(); + var markerOtherType = createTypeParameter(); + var markerSuperTypeForCheck = createTypeParameter(); + var markerSubTypeForCheck = createTypeParameter(); markerSubTypeForCheck.constraint = markerSuperTypeForCheck; - const noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); - const anySignature = createSignature( + var noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); + var anySignature = createSignature( void 0, void 0, void 0, @@ -45096,7 +45598,7 @@ ${lanes.join("\n")} 0, 0 /* None */ ); - const unknownSignature = createSignature( + var unknownSignature = createSignature( void 0, void 0, void 0, @@ -45107,7 +45609,7 @@ ${lanes.join("\n")} 0, 0 /* None */ ); - const resolvingSignature = createSignature( + var resolvingSignature = createSignature( void 0, void 0, void 0, @@ -45118,7 +45620,7 @@ ${lanes.join("\n")} 0, 0 /* None */ ); - const silentNeverSignature = createSignature( + var silentNeverSignature = createSignature( void 0, void 0, void 0, @@ -45129,14 +45631,14 @@ ${lanes.join("\n")} 0, 0 /* None */ ); - const enumNumberIndexInfo = createIndexInfo( + var enumNumberIndexInfo = createIndexInfo( numberType, stringType, /*isReadonly*/ true ); - const iterationTypesCache = /* @__PURE__ */ new Map(); - const noIterationTypes = { + var iterationTypesCache = /* @__PURE__ */ new Map(); + var noIterationTypes = { get yieldType() { return Debug.fail("Not supported"); }, @@ -45147,10 +45649,10 @@ ${lanes.join("\n")} return Debug.fail("Not supported"); } }; - const anyIterationTypes = createIterationTypes(anyType, anyType, anyType); - const anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); - const defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); - const asyncIterationTypesResolver = { + var anyIterationTypes = createIterationTypes(anyType, anyType, anyType); + var anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); + var defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); + var asyncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfAsyncIterable", iteratorCacheKey: "iterationTypesOfAsyncIterator", iteratorSymbolName: "asyncIterator", @@ -45163,7 +45665,7 @@ ${lanes.join("\n")} mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method, mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property }; - const syncIterationTypesResolver = { + var syncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfIterable", iteratorCacheKey: "iterationTypesOfIterator", iteratorSymbolName: "iterator", @@ -45176,117 +45678,118 @@ ${lanes.join("\n")} mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_iterator_must_be_a_method, mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property }; - let amalgamatedDuplicates; - const reverseMappedCache = /* @__PURE__ */ new Map(); - let inInferTypeForHomomorphicMappedType = false; - let ambientModulesCache; - let patternAmbientModules; - let patternAmbientModuleAugmentations; - let globalObjectType; - let globalFunctionType; - let globalCallableFunctionType; - let globalNewableFunctionType; - let globalArrayType; - let globalReadonlyArrayType; - let globalStringType; - let globalNumberType; - let globalBooleanType; - let globalRegExpType; - let globalThisType; - let anyArrayType; - let autoArrayType; - let anyReadonlyArrayType; - let deferredGlobalNonNullableTypeAlias; - let deferredGlobalESSymbolConstructorSymbol; - let deferredGlobalESSymbolConstructorTypeSymbol; - let deferredGlobalESSymbolType; - let deferredGlobalTypedPropertyDescriptorType; - let deferredGlobalPromiseType; - let deferredGlobalPromiseLikeType; - let deferredGlobalPromiseConstructorSymbol; - let deferredGlobalPromiseConstructorLikeType; - let deferredGlobalIterableType; - let deferredGlobalIteratorType; - let deferredGlobalIterableIteratorType; - let deferredGlobalGeneratorType; - let deferredGlobalIteratorYieldResultType; - let deferredGlobalIteratorReturnResultType; - let deferredGlobalAsyncIterableType; - let deferredGlobalAsyncIteratorType; - let deferredGlobalAsyncIterableIteratorType; - let deferredGlobalAsyncGeneratorType; - let deferredGlobalTemplateStringsArrayType; - let deferredGlobalImportMetaType; - let deferredGlobalImportMetaExpressionType; - let deferredGlobalImportCallOptionsType; - let deferredGlobalExtractSymbol; - let deferredGlobalOmitSymbol; - let deferredGlobalAwaitedSymbol; - let deferredGlobalBigIntType; - let deferredGlobalNaNSymbol; - let deferredGlobalRecordSymbol; - let deferredGlobalClassDecoratorContextType; - let deferredGlobalClassMethodDecoratorContextType; - let deferredGlobalClassGetterDecoratorContextType; - let deferredGlobalClassSetterDecoratorContextType; - let deferredGlobalClassAccessorDecoratorContextType; - let deferredGlobalClassAccessorDecoratorTargetType; - let deferredGlobalClassAccessorDecoratorResultType; - let deferredGlobalClassFieldDecoratorContextType; - const allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); - let flowLoopStart = 0; - let flowLoopCount = 0; - let sharedFlowCount = 0; - let flowAnalysisDisabled = false; - let flowInvocationCount = 0; - let lastFlowNode; - let lastFlowNodeReachable; - let flowTypeCache; - const contextualTypeNodes = []; - const contextualTypes = []; - let contextualTypeCount = 0; - const inferenceContextNodes = []; - const inferenceContexts = []; - let inferenceContextCount = 0; - const emptyStringType = getStringLiteralType(""); - const zeroType = getNumberLiteralType(0); - const zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); - const resolutionTargets = []; - const resolutionResults = []; - const resolutionPropertyNames = []; - let suggestionCount = 0; - const maximumSuggestionCount = 10; - const mergedSymbols = []; - const symbolLinks = []; - const nodeLinks = []; - const flowLoopCaches = []; - const flowLoopNodes = []; - const flowLoopKeys = []; - const flowLoopTypes = []; - const sharedFlowNodes = []; - const sharedFlowTypes = []; - const flowNodeReachable = []; - const flowNodePostSuper = []; - const potentialThisCollisions = []; - const potentialNewTargetCollisions = []; - const potentialWeakMapSetCollisions = []; - const potentialReflectCollisions = []; - const potentialUnusedRenamedBindingElementsInTypes = []; - const awaitedTypeStack = []; - const diagnostics = createDiagnosticCollection(); - const suggestionDiagnostics = createDiagnosticCollection(); - const typeofType = createTypeofType(); - let _jsxNamespace; - let _jsxFactoryEntity; - const subtypeRelation = /* @__PURE__ */ new Map(); - const strictSubtypeRelation = /* @__PURE__ */ new Map(); - const assignableRelation = /* @__PURE__ */ new Map(); - const comparableRelation = /* @__PURE__ */ new Map(); - const identityRelation = /* @__PURE__ */ new Map(); - const enumRelation = /* @__PURE__ */ new Map(); - const builtinGlobals = createSymbolTable(); + var amalgamatedDuplicates; + var reverseMappedCache = /* @__PURE__ */ new Map(); + var inInferTypeForHomomorphicMappedType = false; + var ambientModulesCache; + var patternAmbientModules; + var patternAmbientModuleAugmentations; + var globalObjectType; + var globalFunctionType; + var globalCallableFunctionType; + var globalNewableFunctionType; + var globalArrayType; + var globalReadonlyArrayType; + var globalStringType; + var globalNumberType; + var globalBooleanType; + var globalRegExpType; + var globalThisType; + var anyArrayType; + var autoArrayType; + var anyReadonlyArrayType; + var deferredGlobalNonNullableTypeAlias; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolConstructorTypeSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseLikeType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalGeneratorType; + var deferredGlobalIteratorYieldResultType; + var deferredGlobalIteratorReturnResultType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalAsyncGeneratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredGlobalImportMetaType; + var deferredGlobalImportMetaExpressionType; + var deferredGlobalImportCallOptionsType; + var deferredGlobalExtractSymbol; + var deferredGlobalOmitSymbol; + var deferredGlobalAwaitedSymbol; + var deferredGlobalBigIntType; + var deferredGlobalNaNSymbol; + var deferredGlobalRecordSymbol; + var deferredGlobalClassDecoratorContextType; + var deferredGlobalClassMethodDecoratorContextType; + var deferredGlobalClassGetterDecoratorContextType; + var deferredGlobalClassSetterDecoratorContextType; + var deferredGlobalClassAccessorDecoratorContextType; + var deferredGlobalClassAccessorDecoratorTargetType; + var deferredGlobalClassAccessorDecoratorResultType; + var deferredGlobalClassFieldDecoratorContextType; + var allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); + var flowLoopStart = 0; + var flowLoopCount = 0; + var sharedFlowCount = 0; + var flowAnalysisDisabled = false; + var flowInvocationCount = 0; + var lastFlowNode; + var lastFlowNodeReachable; + var flowTypeCache; + var contextualTypeNodes = []; + var contextualTypes = []; + var contextualIsCache = []; + var contextualTypeCount = 0; + var inferenceContextNodes = []; + var inferenceContexts = []; + var inferenceContextCount = 0; + var emptyStringType = getStringLiteralType(""); + var zeroType = getNumberLiteralType(0); + var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); + var resolutionTargets = []; + var resolutionResults = []; + var resolutionPropertyNames = []; + var suggestionCount = 0; + var maximumSuggestionCount = 10; + var mergedSymbols = []; + var symbolLinks = []; + var nodeLinks = []; + var flowLoopCaches = []; + var flowLoopNodes = []; + var flowLoopKeys = []; + var flowLoopTypes = []; + var sharedFlowNodes = []; + var sharedFlowTypes = []; + var flowNodeReachable = []; + var flowNodePostSuper = []; + var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; + var potentialWeakMapSetCollisions = []; + var potentialReflectCollisions = []; + var potentialUnusedRenamedBindingElementsInTypes = []; + var awaitedTypeStack = []; + var diagnostics = createDiagnosticCollection(); + var suggestionDiagnostics = createDiagnosticCollection(); + var typeofType = createTypeofType(); + var _jsxNamespace; + var _jsxFactoryEntity; + var subtypeRelation = /* @__PURE__ */ new Map(); + var strictSubtypeRelation = /* @__PURE__ */ new Map(); + var assignableRelation = /* @__PURE__ */ new Map(); + var comparableRelation = /* @__PURE__ */ new Map(); + var identityRelation = /* @__PURE__ */ new Map(); + var enumRelation = /* @__PURE__ */ new Map(); + var builtinGlobals = createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); - const suggestedExtensions = [ + var suggestedExtensions = [ [".mts", ".mjs"], [".ts", ".js"], [".cts", ".cjs"], @@ -46678,7 +47181,12 @@ ${lanes.join("\n")} } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { const exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - const exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + const exportSymbol = exportValue ? getPropertyOfType( + getTypeOfSymbol(exportValue), + name, + /*skipObjectFunctionPropertyAugment*/ + true + ) : moduleSymbol.exports.get(name); const resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly( sourceNode, @@ -47713,12 +48221,9 @@ ${lanes.join("\n")} if (resolutionDiagnostic) { error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); } else { - const tsExtension = tryExtractTSExtension(moduleReference); const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); const resolutionIsNode16OrNext = moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */; - if (tsExtension) { - errorOnTSExtensionImport(tsExtension); - } else if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { + if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); @@ -47738,14 +48243,12 @@ ${lanes.join("\n")} } } return void 0; - function errorOnTSExtensionImport(tsExtension) { - const diag2 = Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead; - error(errorNode, diag2, tsExtension, getSuggestedImportSource(tsExtension)); - } function getSuggestedImportSource(tsExtension) { const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension); if (emitModuleKindIsNonNodeESM(moduleKind) || mode === 99 /* ESNext */) { - return importSourceWithoutExtension + (tsExtension === ".mts" /* Mts */ ? ".mjs" : tsExtension === ".cts" /* Cts */ ? ".cjs" : ".js"); + const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions); + const ext = tsExtension === ".mts" /* Mts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" /* Cts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js"; + return importSourceWithoutExtension + ext; } return importSourceWithoutExtension; } @@ -47932,7 +48435,7 @@ ${lanes.join("\n")} return shouldTreatPropertiesOfExternalModuleAsExports(type) ? getPropertyOfType(type, memberName) : void 0; } function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) { - return !(resolvedExternalModuleType.flags & 131068 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path + return !(resolvedExternalModuleType.flags & 134348796 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path isArrayType(resolvedExternalModuleType) || isTupleType(resolvedExternalModuleType)); } function getExportsOfSymbol(symbol) { @@ -49231,7 +49734,7 @@ ${lanes.join("\n")} return result; } function createAnonymousTypeNode(type2) { - var _a3; + var _a3, _b2; const typeId = type2.id; const symbol = type2.symbol; if (symbol) { @@ -49257,6 +49760,20 @@ ${lanes.join("\n")} return visitAndTransformType(type2, createTypeNodeFromObjectType); } } else { + const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */); + if (isInstantiationExpressionType) { + const instantiationExpressionType = type2; + if (isTypeQueryNode(instantiationExpressionType.node)) { + const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node); + if (typeNode) { + return typeNode; + } + } + if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { + return createElidedInformationPlaceholder(context); + } + return visitAndTransformType(type2, createTypeNodeFromObjectType); + } return createTypeNodeFromObjectType(type2); } function shouldWriteTypeOfFunctionSymbol() { @@ -49765,7 +50282,7 @@ ${lanes.join("\n")} ); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { - var _a2, _b, _c, _d; + var _a2, _b, _c, _d, _e; const suppressAny = context.flags & 256 /* SuppressAnyReturnType */; if (suppressAny) context.flags &= ~256 /* SuppressAnyReturnType */; @@ -49782,6 +50299,39 @@ ${lanes.join("\n")} /*skipUnionExpanding*/ true )[0]; + let cleanup; + if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) { + const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0; + Debug.assertOptionalNode(existingFakeScope, isBlock); + const locals = (_a2 = existingFakeScope == null ? void 0 : existingFakeScope.locals) != null ? _a2 : createSymbolTable(); + let newLocals; + for (const param of expandedParams) { + if (!locals.has(param.escapedName)) { + newLocals = append(newLocals, param.escapedName); + locals.set(param.escapedName, param); + } + } + if (newLocals) { + let removeNewLocals2 = function() { + forEach(newLocals, (s) => locals.delete(s)); + }; + var removeNewLocals = removeNewLocals2; + if (existingFakeScope) { + cleanup = removeNewLocals2; + } else { + const fakeScope = parseNodeFactory.createBlock(emptyArray); + getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true; + fakeScope.locals = locals; + const saveEnclosingDeclaration = context.enclosingDeclaration; + setParent(fakeScope, saveEnclosingDeclaration); + context.enclosingDeclaration = fakeScope; + cleanup = () => { + context.enclosingDeclaration = saveEnclosingDeclaration; + removeNewLocals2(); + }; + } + } + } const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports)); const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context); if (thisParameter) { @@ -49807,11 +50357,11 @@ ${lanes.join("\n")} const flags = modifiersToFlags(modifiers); modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */); } - const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration( + const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration( modifiers, /*asteriskToken*/ void 0, - (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), + (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), /*questionToken*/ void 0, typeParameters, @@ -49826,14 +50376,14 @@ ${lanes.join("\n")} void 0 ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration( modifiers, - (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), + (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ void 0 ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration( modifiers, - (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), + (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""), parameters, /*body*/ void 0 @@ -49868,13 +50418,14 @@ ${lanes.join("\n")} if (typeArguments) { node.typeArguments = factory.createNodeArray(typeArguments); } + cleanup == null ? void 0 : cleanup(); return node; } function tryGetThisParameterDeclaration(signature, context) { if (signature.thisParameter) { return symbolToParameterDeclaration(signature.thisParameter, context); } - if (signature.declaration) { + if (signature.declaration && isInJSFile(signature.declaration)) { const thisTag = getJSDocThisTag(signature.declaration); if (thisTag && thisTag.typeExpression) { return factory.createParameterDeclaration( @@ -50482,9 +51033,12 @@ ${lanes.join("\n")} function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) { return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters); } + function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) { + return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration; + } function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) { if (!isErrorType(type) && enclosingDeclaration) { - const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration); + const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration)); if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) { const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation); if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) { @@ -50516,7 +51070,8 @@ ${lanes.join("\n")} function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) { if (!isErrorType(type) && context.enclosingDeclaration) { const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); - if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) { + const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration); + if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) { const annotated = getTypeFromTypeNode(annotation); const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated; if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) { @@ -52131,8 +52686,8 @@ ${lanes.join("\n")} const t = types[i]; flags |= t.flags; if (!(t.flags & 98304 /* Nullable */)) { - if (t.flags & (512 /* BooleanLiteral */ | 1024 /* EnumLiteral */)) { - const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLiteralType(t); + if (t.flags & (512 /* BooleanLiteral */ | 1056 /* EnumLike */)) { + const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLikeType(t); if (baseType.flags & 1048576 /* Union */) { const count = baseType.types.length; if (i + count <= types.length && getRegularTypeOfLiteralType(types[i + count - 1]) === getRegularTypeOfLiteralType(baseType.types[count - 1])) { @@ -52387,7 +52942,7 @@ ${lanes.join("\n")} } function findResolutionCycleStartIndex(target, propertyName) { for (let i = resolutionTargets.length - 1; i >= 0; i--) { - if (hasType2(resolutionTargets[i], resolutionPropertyNames[i])) { + if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) { return -1; } if (resolutionTargets[i] === target && resolutionPropertyNames[i] === propertyName) { @@ -52396,7 +52951,7 @@ ${lanes.join("\n")} } return -1; } - function hasType2(target, propertyName) { + function resolutionTargetHasProperty(target, propertyName) { switch (propertyName) { case 0 /* Type */: return !!getSymbolLinks(target).type; @@ -52416,6 +52971,8 @@ ${lanes.join("\n")} return !!target.baseTypesResolved; case 8 /* WriteType */: return !!getSymbolLinks(target).writeType; + case 9 /* ParameterInitializerContainsUndefined */: + return getNodeLinks(target).parameterInitializerContainsUndefined !== void 0; } return Debug.assertNever(propertyName); } @@ -52855,7 +53412,7 @@ ${lanes.join("\n")} function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) { const container = getAssignedExpandoInitializer(symbol.valueDeclaration); if (container) { - const tag = getJSDocTypeTag(container); + const tag = isInJSFile(container) ? getJSDocTypeTag(container) : void 0; if (tag && tag.typeExpression) { return getTypeFromTypeNode(tag.typeExpression); } @@ -54007,8 +54564,8 @@ ${lanes.join("\n")} } return links.declaredType; } - function getBaseTypeOfEnumLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; + function getBaseTypeOfEnumLikeType(type) { + return type.flags & 1056 /* EnumLike */ && type.symbol.flags & 8 /* EnumMember */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; } function getDeclaredTypeOfEnum(symbol) { const links = getSymbolLinks(symbol); @@ -54021,7 +54578,7 @@ ${lanes.join("\n")} if (hasBindableName(member)) { const memberSymbol = getSymbolOfDeclaration(member); const value = getEnumMemberValue(member); - const memberType = value !== void 0 ? getFreshTypeOfLiteralType(getEnumLiteralType(value, getSymbolId(symbol), memberSymbol)) : createTypeWithSymbol(32 /* Enum */, memberSymbol); + const memberType = getFreshTypeOfLiteralType(value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol)); getSymbolLinks(memberSymbol).declaredType = memberType; memberTypeList.push(getRegularTypeOfLiteralType(memberType)); } @@ -54035,7 +54592,7 @@ ${lanes.join("\n")} symbol, /*aliasTypeArguments*/ void 0 - ) : createTypeWithSymbol(32 /* Enum */, symbol); + ) : createComputedEnumType(symbol); if (enumType.flags & 1048576 /* Union */) { enumType.flags |= 1024 /* EnumLiteral */; enumType.symbol = symbol; @@ -54044,6 +54601,15 @@ ${lanes.join("\n")} } return links.declaredType; } + function createComputedEnumType(symbol) { + const regularType = createTypeWithSymbol(32 /* Enum */, symbol); + const freshType = createTypeWithSymbol(32 /* Enum */, symbol); + regularType.regularType = regularType; + regularType.freshType = freshType; + freshType.regularType = regularType; + freshType.freshType = freshType; + return regularType; + } function getDeclaredTypeOfEnumMember(symbol) { const links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -54992,6 +55558,7 @@ ${lanes.join("\n")} const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); const nameType = getNameTypeFromMappedType(type.target || type); + const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); const templateType = getTemplateTypeFromMappedType(type.target || type); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); const templateModifiers = getMappedTypeModifiers(type); @@ -55029,7 +55596,7 @@ ${lanes.join("\n")} prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = nameType ? void 0 : modifiersProp.declarations; + prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0; } members.set(propName, prop); } @@ -55973,6 +56540,12 @@ ${lanes.join("\n")} thisParameter = getAnnotatedAccessorThisParameter(other); } } + if (isInJSFile(declaration)) { + const thisTag = getJSDocThisTag(declaration); + if (thisTag && thisTag.typeExpression) { + thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression)); + } + } const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0; const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) { @@ -56086,7 +56659,11 @@ ${lanes.join("\n")} if (node.tags) { for (const tag of node.tags) { if (isJSDocOverloadTag(tag)) { - result.push(getSignatureFromDeclaration(tag.typeExpression)); + const jsDocSignature = tag.typeExpression; + if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) { + reportImplicitAny(jsDocSignature, anyType); + } + result.push(getSignatureFromDeclaration(jsDocSignature)); hasJSDocOverloads = true; } } @@ -56195,6 +56772,12 @@ ${lanes.join("\n")} if (declaration.kind === 173 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } + if (isJSDocSignature(declaration)) { + const root = getJSDocRoot(declaration); + if (root && isConstructorDeclaration(root.parent)) { + return getDeclaredTypeOfClassOrInterface(getMergedSymbol(root.parent.parent.symbol)); + } + } if (isJSDocConstructSignature(declaration)) { return getTypeFromTypeNode(declaration.parameters[0].type); } @@ -56373,7 +56956,7 @@ ${lanes.join("\n")} const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); if (grandParent.kind === 180 /* TypeReference */ && !omitTypeReferences) { const typeReference = grandParent; - const typeParameters = getTypeParametersForTypeReference(typeReference); + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); if (typeParameters) { const index = typeReference.typeArguments.indexOf(childTypeParameter); if (index < typeParameters.length) { @@ -56723,7 +57306,7 @@ ${lanes.join("\n")} return links.resolvedJSDocType; } function getSubstitutionType(baseType, constraint) { - if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) { + if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */) { return baseType; } const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`; @@ -57666,7 +58249,7 @@ ${lanes.join("\n")} } } function removeStringLiteralsMatchedByTemplateLiterals(types) { - const templates = filter(types, isPatternLiteralType); + const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)); if (templates.length) { let i = types.length; while (i > 0) { @@ -57716,7 +58299,7 @@ ${lanes.join("\n")} orderedRemoveItemAt(typeSet, 1); } } - if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) { + if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) { removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */)); } if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { @@ -57785,7 +58368,7 @@ ${lanes.join("\n")} function typePredicateKindsMatch(a, b) { return a.kind === b.kind && a.parameterIndex === b.parameterIndex; } - function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments, origin) { + function getUnionTypeFromSortedList(types, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) { if (types.length === 0) { return neverType; } @@ -57797,7 +58380,7 @@ ${lanes.join("\n")} let type = unionTypes.get(id); if (!type) { type = createType(1048576 /* Union */); - type.objectFlags = objectFlags | getPropagatingFlagsOfTypes( + type.objectFlags = precomputedObjectFlags | getPropagatingFlagsOfTypes( types, /*excludeKinds*/ 98304 /* Nullable */ @@ -57847,7 +58430,7 @@ ${lanes.join("\n")} type = undefinedType; } if (!typeSet.has(type.id.toString())) { - if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) { + if (type.flags & 109472 /* Unit */ && includes & 109472 /* Unit */) { includes |= 67108864 /* NonPrimitive */; } typeSet.set(type.id.toString(), type); @@ -58123,7 +58706,7 @@ ${lanes.join("\n")} const typeVariable = getTypeParameterFromMappedType(mappedType); return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable); function isDistributive(type) { - return type.flags & (3 /* AnyOrUnknown */ | 131068 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; + return type.flags & (3 /* AnyOrUnknown */ | 134348796 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; } } function getLiteralTypeFromPropertyName(name) { @@ -58410,7 +58993,7 @@ ${lanes.join("\n")} } } const propType = getTypeOfSymbol(prop); - return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : propType; + return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : accessNode && isIndexedAccessTypeNode(accessNode) && containsMissingType(propType) ? getUnionType([propType, undefinedType]) : propType; } if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) { const index = +propName; @@ -58776,7 +59359,7 @@ ${lanes.join("\n")} } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.baseType; + return getActualTypeVariable(type.baseType); } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { return getIndexedAccessType(getActualTypeVariable(type.objectType), getActualTypeVariable(type.indexType)); @@ -58974,11 +59557,6 @@ ${lanes.join("\n")} var _a2; const links = getNodeLinks(node); if (!links.resolvedType) { - if (node.isTypeOf && node.typeArguments) { - error(node, Diagnostics.Type_arguments_cannot_be_used_here); - links.resolvedSymbol = unknownSymbol; - return links.resolvedType = errorType; - } if (!isLiteralImportTypeNode(node)) { error(node.argument, Diagnostics.String_literal_expected); links.resolvedSymbol = unknownSymbol; @@ -59039,15 +59617,8 @@ ${lanes.join("\n")} const resolvedSymbol = resolveSymbol(symbol); links.resolvedSymbol = resolvedSymbol; if (meaning === 111551 /* Value */) { - return getTypeOfSymbol(symbol); + return getInstantiationExpressionType(getTypeOfSymbol(symbol), node); } else { - const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol); - const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol); - if (node.typeArguments && typeParameters) { - addLazyDiagnostic(() => { - checkTypeArgumentConstraints(node, typeParameters); - }); - } return getTypeReferenceType(node, resolvedSymbol); } } @@ -59225,7 +59796,7 @@ ${lanes.join("\n")} return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 2944 /* Literal */) { + if (type.flags & 2976 /* Freshable */) { if (!type.freshType) { const freshType = createLiteralType(type.flags, type.value, type.symbol, type); freshType.freshType = freshType; @@ -59236,10 +59807,10 @@ ${lanes.join("\n")} return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 2944 /* Literal */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; + return type.flags & 2976 /* Freshable */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; } function isFreshLiteralType(type) { - return !!(type.flags & 2944 /* Literal */) && type.freshType === type; + return !!(type.flags & 2976 /* Freshable */) && type.freshType === type; } function getStringLiteralType(value) { let type; @@ -59918,13 +60489,13 @@ ${lanes.join("\n")} return type; } function getUniqueLiteralFilledInstantiation(type) { - return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); + return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); } function getPermissiveInstantiation(type) { - return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); + return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); } function getRestrictiveInstantiation(type) { - if (type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { + if (type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { return type; } if (type.restrictiveInstantiation) { @@ -60196,7 +60767,12 @@ ${lanes.join("\n")} } } function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) { - pushContextualType(next, sourcePropType); + pushContextualType( + next, + sourcePropType, + /*isCache*/ + false + ); const result = checkExpressionForMutableLocation(next, 1 /* Contextual */); popContextualType(); return result; @@ -60499,12 +61075,17 @@ ${lanes.join("\n")} } } function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (131068 /* Primitive */ | 131072 /* Never */)) + if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */)) return false; if (isTupleLikeType(source)) { return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); } - pushContextualType(node, target); + pushContextualType( + node, + target, + /*isCache*/ + false + ); const tupleizedType = checkArrayLiteral( node, 1 /* Contextual */, @@ -60543,7 +61124,7 @@ ${lanes.join("\n")} } } function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (131068 /* Primitive */ | 131072 /* Never */)) + if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */)) return false; return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); } @@ -60566,16 +61147,24 @@ ${lanes.join("\n")} void 0 ) !== 0 /* False */; } - function isAnySignature(s) { - return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s)); + function isTopSignature(s) { + if (!s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s)) { + const paramType = getTypeOfParameter(s.parameters[0]); + const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType; + return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */); + } + return false; } function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) { if (source === target) { return -1 /* True */; } - if (isAnySignature(target)) { + if (!(checkMode & 16 /* StrictTopSignature */ && isTopSignature(source)) && isTopSignature(target)) { return -1 /* True */; } + if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) { + return 0 /* False */; + } const targetCount = getParameterCount(target); const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { @@ -60793,7 +61382,9 @@ ${lanes.join("\n")} function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { const s = source.flags; const t = target.flags; - if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType) + if (t & 1 /* Any */ || s & 131072 /* Never */ || source === wildcardType) + return true; + if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */)) return true; if (t & 131072 /* Never */) return false; @@ -60920,7 +61511,6 @@ ${lanes.join("\n")} let overrideNextErrorInfo = 0; let lastSkippedInfo; let incompatibleStack; - let inPropertyCheck = false; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); const result = isRelatedTo( source, @@ -61117,7 +61707,8 @@ ${lanes.join("\n")} Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable"); generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource); } - if (target2.flags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { + const targetFlags = target2.flags & 8388608 /* IndexedAccess */ && !(source2.flags & 8388608 /* IndexedAccess */) ? target2.objectType.flags : target2.flags; + if (targetFlags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { const constraint = getBaseConstraintOfType(target2); let needsOriginalSource; if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) { @@ -61190,7 +61781,7 @@ ${lanes.join("\n")} return isRelatedTo(source2, target2, 3 /* Both */, reportErrors2); } function isRelatedTo(originalSource, originalTarget, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2, intersectionState = 0 /* None */) { - if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 131068 /* Primitive */) { + if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 134348796 /* Primitive */) { if (relation === comparableRelation && !(originalTarget.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(originalTarget, originalSource, relation) || isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors2 ? reportError : void 0)) { return -1 /* True */; } @@ -61254,7 +61845,7 @@ ${lanes.join("\n")} return 0 /* False */; } } - const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures2(source2)); + const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (134348796 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2)); const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */); if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) { if (reportErrors2) { @@ -61316,7 +61907,7 @@ ${lanes.join("\n")} maybeSuppress = !!errorInfo; } } - if (source2.flags & 524288 /* Object */ && target2.flags & 131068 /* Primitive */) { + if (source2.flags & 524288 /* Object */ && target2.flags & 134348796 /* Primitive */) { tryElaborateErrorsForPrimitivesAndObjects(source2, target2); } else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) { reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead); @@ -61462,15 +62053,15 @@ ${lanes.join("\n")} } function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) { if (source2.flags & 1048576 /* Union */) { - return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */), intersectionState); + return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState); } if (target2.flags & 1048576 /* Union */) { - return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */) && !(target2.flags & 131068 /* Primitive */)); + return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */) && !(target2.flags & 134348796 /* Primitive */)); } if (target2.flags & 2097152 /* Intersection */) { return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */); } - if (relation === comparableRelation && target2.flags & 131068 /* Primitive */) { + if (relation === comparableRelation && target2.flags & 134348796 /* Primitive */) { const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t); if (constraints !== source2.types) { source2 = getIntersectionType(constraints); @@ -61878,14 +62469,15 @@ ${lanes.join("\n")} ); } } - if (result2 && !inPropertyCheck && (target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */) || isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */)))) { - inPropertyCheck = true; + if (result2 && !(intersectionState & 2 /* Target */) && target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */)) { result2 &= propertiesRelatedTo( source2, target2, reportErrors2, /*excludedProperties*/ void 0, + /*optionalsOnly*/ + false, 0 /* None */ ); if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */) { @@ -61898,7 +62490,17 @@ ${lanes.join("\n")} 0 /* None */ ); } - inPropertyCheck = false; + } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { + result2 &= propertiesRelatedTo( + source2, + target2, + reportErrors2, + /*excludedProperties*/ + void 0, + /*optionalsOnly*/ + true, + intersectionState + ); } } if (result2) { @@ -62352,7 +62954,7 @@ ${lanes.join("\n")} } return 0 /* False */; } - const sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */); + const sourceIsPrimitive = !!(sourceFlags & 134348796 /* Primitive */); if (relation !== identityRelation) { source2 = getApparentType(source2); sourceFlags = source2.flags; @@ -62388,12 +62990,14 @@ ${lanes.join("\n")} reportStructuralErrors, /*excludedProperties*/ void 0, + /*optionalsOnly*/ + false, intersectionState ); if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors); + result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors, intersectionState); if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors); + result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors, intersectionState); if (result2) { result2 &= indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportStructuralErrors, intersectionState); } @@ -62522,6 +63126,8 @@ ${lanes.join("\n")} /*reportErrors*/ false, excludedProperties, + /*optionalsOnly*/ + false, 0 /* None */ ); if (result2) { @@ -62530,7 +63136,8 @@ ${lanes.join("\n")} type, 0 /* Call */, /*reportStructuralErrors*/ - false + false, + 0 /* None */ ); if (result2) { result2 &= signaturesRelatedTo( @@ -62538,7 +63145,8 @@ ${lanes.join("\n")} type, 1 /* Construct */, /*reportStructuralErrors*/ - false + false, + 0 /* None */ ); if (result2 && !(isTupleType(source2) && isTupleType(type))) { result2 &= indexSignaturesRelatedTo( @@ -62716,7 +63324,7 @@ ${lanes.join("\n")} } } } - function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, intersectionState) { + function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) { if (relation === identityRelation) { return propertiesIdenticalTo(source2, target2, excludedProperties); } @@ -62852,7 +63460,7 @@ ${lanes.join("\n")} const numericNamesOnly = isTupleType(source2) && isTupleType(target2); for (const targetProp of excludeProperties(properties, excludedProperties)) { const name = targetProp.escapedName; - if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) { + if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length") && (!optionalsOnly || targetProp.flags & 16777216 /* Optional */)) { const sourceProp = getPropertyOfType(source2, name); if (sourceProp && sourceProp !== targetProp) { const related = propertyRelatedTo(source2, target2, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors2, intersectionState, relation === comparableRelation); @@ -62888,7 +63496,7 @@ ${lanes.join("\n")} } return result2; } - function signaturesRelatedTo(source2, target2, kind, reportErrors2) { + function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) { var _a3, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source2, target2, kind); @@ -62925,6 +63533,7 @@ ${lanes.join("\n")} /*erase*/ true, reportErrors2, + intersectionState, incompatibleReporter(sourceSignatures[i], targetSignatures[i]) ); if (!related) { @@ -62936,7 +63545,7 @@ ${lanes.join("\n")} const eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); - result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature)); + result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature)); if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 173 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 173 /* Constructor */)) { const constructSignatureToString = (signature) => signatureToString( signature, @@ -62961,6 +63570,7 @@ ${lanes.join("\n")} /*erase*/ true, shouldElaborateErrors, + intersectionState, incompatibleReporter(s, t) ); if (related) { @@ -63013,17 +63623,29 @@ ${lanes.join("\n")} } return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); } - function signatureRelatedTo(source2, target2, erase, reportErrors2, incompatibleReporter) { + function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) { + const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */; return compareSignaturesRelated( erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, - relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, + checkMode, reportErrors2, reportError, incompatibleReporter, - isRelatedToWorker, + isRelatedToWorker2, reportUnreliableMapper ); + function isRelatedToWorker2(source3, target3, reportErrors3) { + return isRelatedTo( + source3, + target3, + 3 /* Both */, + reportErrors3, + /*headMessage*/ + void 0, + intersectionState + ); + } } function signaturesIdenticalTo(source2, target2, kind) { const sourceSignatures = getSignaturesOfType(source2, kind); @@ -63082,7 +63704,7 @@ ${lanes.join("\n")} } for (const info of getIndexInfosOfType(source2)) { if (isApplicableIndexType(info.keyType, keyType)) { - const related = indexInfoRelatedTo(info, targetInfo, reportErrors2); + const related = indexInfoRelatedTo(info, targetInfo, reportErrors2, intersectionState); if (!related) { return 0 /* False */; } @@ -63091,8 +63713,16 @@ ${lanes.join("\n")} } return result2; } - function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2) { - const related = isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */, reportErrors2); + function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState) { + const related = isRelatedTo( + sourceInfo.type, + targetInfo.type, + 3 /* Both */, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); if (!related && reportErrors2) { if (sourceInfo.keyType === targetInfo.keyType) { reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType)); @@ -63121,9 +63751,9 @@ ${lanes.join("\n")} function typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) { const sourceInfo = getApplicableIndexInfo(source2, targetInfo.keyType); if (sourceInfo) { - return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2); + return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState); } - if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) { + if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) { return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); } if (reportErrors2) { @@ -63412,12 +64042,15 @@ ${lanes.join("\n")} } function isDeeplyNestedType(type, stack, depth, maxDepth = 3) { if (depth >= maxDepth) { + if (type.flags & 2097152 /* Intersection */) { + return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth)); + } const identity2 = getRecursionIdentity(type); let count = 0; let lastTypeId = 0; for (let i = 0; i < depth; i++) { const t = stack[i]; - if (getRecursionIdentity(t) === identity2) { + if (t.flags & 2097152 /* Intersection */ ? some(t.types, (u) => getRecursionIdentity(u) === identity2) : getRecursionIdentity(t) === identity2) { if (t.id >= lastTypeId) { count++; if (count >= maxDepth) { @@ -63650,15 +64283,25 @@ ${lanes.join("\n")} return propType; } if (everyType(type, isTupleType)) { - return mapType(type, (t) => getRestTypeOfTupleType(t) || undefinedType); + return mapType(type, (t) => { + const tupleType = t; + const restType = getRestTypeOfTupleType(tupleType); + if (!restType) { + return undefinedType; + } + if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) { + return getUnionType([restType, undefinedType]); + } + return restType; + }); } return void 0; } function isNeitherUnitTypeNorNever(type) { - return !(type.flags & (109440 /* Unit */ | 131072 /* Never */)); + return !(type.flags & (109472 /* Unit */ | 131072 /* Never */)); } function isUnitType(type) { - return !!(type.flags & 109440 /* Unit */); + return !!(type.flags & 109472 /* Unit */); } function isUnitLikeType(type) { const t = getBaseConstraintOrType(type); @@ -63671,15 +64314,18 @@ ${lanes.join("\n")} return type.flags & 16 /* Boolean */ ? true : type.flags & 1048576 /* Union */ ? type.flags & 1024 /* EnumLiteral */ ? true : every(type.types, isUnitType) : isUnitType(type); } function getBaseTypeOfLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; + return type.flags & 1056 /* EnumLike */ ? getBaseTypeOfEnumLikeType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; } function getBaseTypeOfLiteralTypeUnion(type) { var _a2; const key = `B${getTypeId(type)}`; return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralType)); } + function getBaseTypeOfLiteralTypeForComparison(type) { + return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type; + } function getWidenedLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; + return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; } function getWidenedUniqueESSymbolType(type) { return type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedUniqueESSymbolType) : type; @@ -63720,7 +64366,7 @@ ${lanes.join("\n")} const restType = getRestTypeOfTupleType(type); return restType && createArrayType(restType); } - function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false) { + function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false, noReductions = false) { const length2 = getTypeReferenceArity(type) - endSkipCount; if (index < length2) { const typeArguments = getTypeArguments(type); @@ -63729,7 +64375,7 @@ ${lanes.join("\n")} const t = typeArguments[i]; elementTypes.push(type.target.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t); } - return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes); + return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes, noReductions ? 0 /* None */ : 1 /* Literal */); } return void 0; } @@ -63797,7 +64443,7 @@ ${lanes.join("\n")} } function isObjectTypeWithInferableIndex(type) { const objectFlags = getObjectFlags(type); - return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures2(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); + return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); } function createSymbolWithType(source, type) { const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */); @@ -64035,6 +64681,11 @@ ${lanes.join("\n")} case 320 /* JSDocFunctionType */: error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; + case 326 /* JSDocSignature */: + if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { + error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); + } + return; case 259 /* FunctionDeclaration */: case 171 /* MethodDeclaration */: case 170 /* MethodSignature */: @@ -64207,8 +64858,8 @@ ${lanes.join("\n")} } return false; } - function isTypeParameterAtTopLevel(type, typeParameter) { - return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + function isTypeParameterAtTopLevel(type, tp, depth = 0) { + return !!(type === tp || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, tp, depth)) || depth < 3 && type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), tp, depth + 1) || isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), tp, depth + 1))); } function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { const typePredicate = getTypePredicateOfSignature(signature); @@ -64302,7 +64953,7 @@ ${lanes.join("\n")} yield targetProp; } else if (matchDiscriminantProperties) { const targetType = getTypeOfSymbol(targetProp); - if (targetType.flags & 109440 /* Unit */) { + if (targetType.flags & 109472 /* Unit */) { const sourceType = getTypeOfSymbol(sourceProp); if (!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) { yield targetProp; @@ -64363,10 +65014,10 @@ ${lanes.join("\n")} return getBigIntLiteralType(parseValidBigInt(text)); } function isMemberOfStringMapping(source, target) { - if (target.flags & (4 /* String */ | 1 /* Any */)) { + if (target.flags & 1 /* Any */) { return true; } - if (target.flags & 134217728 /* TemplateLiteral */) { + if (target.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) { return isTypeAssignableTo(source, target); } if (target.flags & 268435456 /* StringMapping */) { @@ -65061,7 +65712,7 @@ ${lanes.join("\n")} } function hasPrimitiveConstraint(type) { const constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); } function isObjectLiteralType2(type) { return !!(getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -65543,7 +66194,7 @@ ${lanes.join("\n")} return 83886079 /* UnknownFacts */; } function getIntersectionTypeFacts(type) { - const ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */); + const ignoreObjects = maybeTypeOfKind(type, 134348796 /* Primitive */); let oredFacts = 0 /* None */; let andedFacts = 134217727 /* All */; for (const t of type.types) { @@ -65742,7 +66393,7 @@ ${lanes.join("\n")} } return true; } - if (source.flags & 1024 /* EnumLiteral */ && getBaseTypeOfEnumLiteralType(source) === target) { + if (source.flags & 1056 /* EnumLike */ && getBaseTypeOfEnumLikeType(source) === target) { return true; } return containsType(target.types, source); @@ -65780,7 +66431,7 @@ ${lanes.join("\n")} } return getUnionTypeFromSortedList( filtered, - type.objectFlags, + type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */), /*aliasSymbol*/ void 0, /*aliasTypeArguments*/ @@ -66138,10 +66789,12 @@ ${lanes.join("\n")} } function isConstantReference(node) { switch (node.kind) { - case 79 /* Identifier */: { - const symbol = getResolvedSymbol(node); - return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); - } + case 79 /* Identifier */: + if (!isThisInTypeQuery(node)) { + const symbol = getResolvedSymbol(node); + return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); + } + break; case 208 /* PropertyAccessExpression */: case 209 /* ElementAccessExpression */: return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); @@ -66287,7 +66940,7 @@ ${lanes.join("\n")} } return declaredType; } - if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))); } return void 0; @@ -66804,7 +67457,7 @@ ${lanes.join("\n")} } if (assumeTrue) { if (!doubleEquals && (type.flags & 2 /* Unknown */ || someType(type, isEmptyAnonymousObjectType))) { - if (valueType.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { + if (valueType.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { return valueType; } if (valueType.flags & 524288 /* Object */) { @@ -66837,7 +67490,7 @@ ${lanes.join("\n")} return narrowTypeByLiteralExpression(type, literal, assumeTrue); } function narrowTypeByLiteralExpression(type, literal, assumeTrue) { - return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); + return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); } function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) { const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck); @@ -66854,7 +67507,7 @@ ${lanes.join("\n")} let groundClauseTypes; for (let i = 0; i < clauseTypes.length; i += 1) { const t = clauseTypes[i]; - if (t.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */)) { + if (t.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */)) { if (groundClauseTypes !== void 0) { groundClauseTypes.push(t); } @@ -66973,52 +67626,58 @@ ${lanes.join("\n")} if (!isTypeDerivedFrom(rightType, globalFunctionType)) { return type; } - let targetType; - const prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (prototypeProperty) { - const prototypePropertyType = getTypeOfSymbol(prototypeProperty); - if (!isTypeAny(prototypePropertyType)) { - targetType = prototypePropertyType; - } - } - if (isTypeAny(type) && (targetType === globalObjectType || targetType === globalFunctionType)) { + const instanceType = mapType(rightType, getInstanceType); + if (isTypeAny(type) && (instanceType === globalObjectType || instanceType === globalFunctionType) || !assumeTrue && !(instanceType.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(instanceType))) { return type; } - if (!targetType) { - const constructSignatures = getSignaturesOfType(rightType, 1 /* Construct */); - targetType = constructSignatures.length ? getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))) : emptyObjectType; - } - if (!assumeTrue && rightType.flags & 1048576 /* Union */) { - const nonConstructorTypeInUnion = find(rightType.types, (t) => !isConstructorType(t)); - if (!nonConstructorTypeInUnion) - return type; - } return getNarrowedType( type, - targetType, + instanceType, assumeTrue, /*checkDerived*/ true ); } + function getInstanceType(constructorType) { + const prototypePropertyType = getTypeOfPropertyOfType(constructorType, "prototype"); + if (prototypePropertyType && !isTypeAny(prototypePropertyType)) { + return prototypePropertyType; + } + const constructSignatures = getSignaturesOfType(constructorType, 1 /* Construct */); + if (constructSignatures.length) { + return getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))); + } + return emptyObjectType; + } function getNarrowedType(type, candidate, assumeTrue, checkDerived) { var _a3; const key2 = type.flags & 1048576 /* Union */ ? `N${getTypeId(type)},${getTypeId(candidate)},${(assumeTrue ? 1 : 0) | (checkDerived ? 2 : 0)}` : void 0; return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived)); } function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) { - const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; if (!assumeTrue) { - return filterType(type, (t) => !isRelated(t, candidate)); + if (checkDerived) { + return filterType(type, (t) => !isTypeDerivedFrom(t, candidate)); + } + const trueType2 = getNarrowedType( + type, + candidate, + /*assumeTrue*/ + true, + /*checkDerived*/ + false + ); + return filterType(type, (t) => !isTypeSubsetOf(t, trueType2)); } if (type.flags & 3 /* AnyOrUnknown */) { return candidate; } + const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0; const narrowedType = mapType(candidate, (c) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -67122,7 +67781,7 @@ ${lanes.join("\n")} } } function getTypeOfSymbolAtLocation(symbol, location) { - symbol = symbol.exportSymbol || symbol; + symbol = getExportSymbolOfValueSymbolIfExported(symbol); if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) { if (isRightSideOfQualifiedNameOrPropertyAccess(location)) { location = location.parent; @@ -67174,15 +67833,25 @@ ${lanes.join("\n")} function isConstVariable(symbol) { return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0; } - function removeOptionalityFromDeclaredType(declaredType, declaration) { - if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { - const annotationIncludesUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */); - popTypeResolution(); - return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; - } else { - reportCircularityError(declaration.symbol); - return declaredType; + function parameterInitializerContainsUndefined(declaration) { + const links = getNodeLinks(declaration); + if (links.parameterInitializerContainsUndefined === void 0) { + if (!pushTypeResolution(declaration, 9 /* ParameterInitializerContainsUndefined */)) { + reportCircularityError(declaration.symbol); + return true; + } + const containsUndefined = !!(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */); + if (!popTypeResolution()) { + reportCircularityError(declaration.symbol); + return true; + } + links.parameterInitializerContainsUndefined = containsUndefined; } + return links.parameterInitializerContainsUndefined; + } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + const removeUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !parameterInitializerContainsUndefined(declaration); + return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; } function isConstraintPosition(type, node) { const parent2 = node.parent; @@ -68293,9 +68962,18 @@ ${lanes.join("\n")} if (prop) { return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop); } - if (isTupleType(t)) { - const restType = getRestTypeOfTupleType(t); - if (restType && isNumericLiteralName(name) && +name >= 0) { + if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) { + const restType = getElementTypeOfSliceOfTupleType( + t, + t.target.fixedLength, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ); + if (restType) { return restType; } } @@ -68342,9 +69020,18 @@ ${lanes.join("\n")} return void 0; } function getContextualTypeForElementExpression(arrayContextualType, index) { - return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType( + return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType( arrayContextualType, - (t) => getIteratedTypeOrElementType( + (t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType( + t, + 0, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ) : getIteratedTypeOrElementType( 1 /* Element */, t, undefinedType, @@ -68497,14 +69184,17 @@ ${lanes.join("\n")} return type; } function getContextualType2(node, contextFlags) { + var _a2, _b; if (node.flags & 33554432 /* InWithStatement */) { return void 0; } - const index = findContextualNode(node); + const index = findContextualNode( + node, + /*includeCaches*/ + !contextFlags + ); if (index >= 0) { - const cached = contextualTypes[index]; - if (cached || !contextFlags) - return cached; + return contextualTypes[index]; } const { parent: parent2 } = node; switch (parent2.kind) { @@ -68539,7 +69229,9 @@ ${lanes.join("\n")} case 206 /* ArrayLiteralExpression */: { const arrayLiteral = parent2; const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); - return getContextualTypeForElementExpression(type, indexOfNode(arrayLiteral.elements, node)); + const spreadIndex = (_b = (_a2 = getNodeLinks(arrayLiteral)).firstSpreadIndex) != null ? _b : _a2.firstSpreadIndex = findIndex(arrayLiteral.elements, isSpreadElement); + const elementIndex = indexOfNode(arrayLiteral.elements, node); + return getContextualTypeForElementExpression(type, spreadIndex < 0 || elementIndex < spreadIndex ? elementIndex : -1); } case 224 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); @@ -68575,17 +69267,30 @@ ${lanes.join("\n")} } return void 0; } - function pushContextualType(node, type) { + function pushCachedContextualType(node) { + pushContextualType( + node, + getContextualType2( + node, + /*contextFlags*/ + void 0 + ), + /*isCache*/ + true + ); + } + function pushContextualType(node, type, isCache) { contextualTypeNodes[contextualTypeCount] = node; contextualTypes[contextualTypeCount] = type; + contextualIsCache[contextualTypeCount] = isCache; contextualTypeCount++; } function popContextualType() { contextualTypeCount--; } - function findContextualNode(node) { + function findContextualNode(node, includeCaches) { for (let i = contextualTypeCount - 1; i >= 0; i--) { - if (node === contextualTypeNodes[i]) { + if (node === contextualTypeNodes[i] && (includeCaches || !contextualIsCache[i])) { return i; } } @@ -68608,7 +69313,11 @@ ${lanes.join("\n")} } function getContextualJsxElementAttributesType(node, contextFlags) { if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) { - const index = findContextualNode(node.parent); + const index = findContextualNode( + node.parent, + /*includeCaches*/ + !contextFlags + ); if (index >= 0) { return contextualTypes[index]; } @@ -68879,11 +69588,7 @@ ${lanes.join("\n")} const elementCount = elements.length; const elementTypes = []; const elementFlags = []; - pushContextualType(node, getContextualType2( - node, - /*contextFlags*/ - void 0 - )); + pushCachedContextualType(node); const inDestructuringPattern = isAssignmentTarget(node); const inConstContext = isConstContext(node); const contextualType = getApparentTypeOfContextualType( @@ -69046,11 +69751,7 @@ ${lanes.join("\n")} let propertiesTable = createSymbolTable(); let propertiesArray = []; let spread = emptyObjectType; - pushContextualType(node, getContextualType2( - node, - /*contextFlags*/ - void 0 - )); + pushCachedContextualType(node); const contextualType = getApparentTypeOfContextualType( node, /*contextFlags*/ @@ -70337,7 +71038,7 @@ ${lanes.join("\n")} function reportNonexistentProperty(propNode, containingType, isUncheckedJS) { let errorInfo; let relatedInfo; - if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 131068 /* Primitive */)) { + if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 134348796 /* Primitive */)) { for (const subtype of containingType.types) { if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) { errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(subtype)); @@ -70390,26 +71091,22 @@ ${lanes.join("\n")} function getSuggestedLibForNonExistentName(name) { const missingName = diagnosticName(name); const allFeatures = getScriptTargetFeatures(); - const libTargets = getOwnKeys(allFeatures); - for (const libTarget of libTargets) { - const containingTypes = getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== void 0 && contains(containingTypes, missingName)) { - return libTarget; - } - } + const typeFeatures = allFeatures.get(missingName); + return typeFeatures && firstIterator(typeFeatures.keys()); } function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { const container = getApparentType(containingType).symbol; if (!container) { return void 0; } + const containingTypeName = symbolName(container); const allFeatures = getScriptTargetFeatures(); - const libTargets = getOwnKeys(allFeatures); - for (const libTarget of libTargets) { - const featuresOfLib = allFeatures[libTarget]; - const featuresOfContainingType = featuresOfLib[symbolName(container)]; - if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) { - return libTarget; + const typeFeatures = allFeatures.get(containingTypeName); + if (typeFeatures) { + for (const [libTarget, featuresOfType] of typeFeatures) { + if (contains(featuresOfType, missingProperty)) { + return libTarget; + } } } } @@ -70938,7 +71635,7 @@ ${lanes.join("\n")} } else { const contextualType = getIndexedAccessType(restType, getNumberLiteralType(i - index), 256 /* Contextual */); const argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } @@ -71472,7 +72169,7 @@ ${lanes.join("\n")} const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */; const isDecorator2 = node.kind === 167 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); - const reportErrors2 = !candidatesOutArray; + const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; let typeArguments; if (!isDecorator2 && !isSuperCall(node)) { typeArguments = node.typeArguments; @@ -72431,7 +73128,7 @@ ${lanes.join("\n")} } } function checkCallExpression(node, checkMode) { - var _a2; + var _a2, _b, _c; checkGrammarTypeArguments(node, node.typeArguments); const signature = getResolvedSignature( node, @@ -72448,7 +73145,7 @@ ${lanes.join("\n")} } if (node.kind === 211 /* NewExpression */) { const declaration = signature.declaration; - if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a2 = getJSDocRoot(declaration)) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 173 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -72476,7 +73173,7 @@ ${lanes.join("\n")} /*allowDeclaration*/ false ); - if ((_a2 = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _a2.size) { + if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) { const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray); jsAssignmentType.objectFlags |= 4096 /* JSLiteral */; return getIntersectionType([returnType, jsAssignmentType]); @@ -72762,6 +73459,9 @@ ${lanes.join("\n")} checkGrammarExpressionWithTypeArguments(node); forEach(node.typeArguments, checkSourceElement); const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + return getInstantiationExpressionType(exprType, node); + } + function getInstantiationExpressionType(exprType, node) { const typeArguments = node.typeArguments; if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) { return exprType; @@ -74185,10 +74885,10 @@ ${lanes.join("\n")} if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 131068 /* Primitive */)) { + if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 134348796 /* Primitive */)) { error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures2(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -74710,8 +75410,8 @@ ${lanes.join("\n")} case 32 /* LessThanEqualsToken */: case 33 /* GreaterThanEqualsToken */: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); - rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); + leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right)); reportOperatorErrorUnless((left2, right2) => { if (isTypeAny(left2) || isTypeAny(right2)) { return true; @@ -74771,7 +75471,7 @@ ${lanes.join("\n")} return leftType; } else { checkAssignmentOperator(rightType); - return getRegularTypeOfObjectLiteral(rightType); + return rightType; } case 27 /* CommaToken */: if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) { @@ -75062,14 +75762,19 @@ ${lanes.join("\n")} return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */)); } function getContextNode2(node) { - if (node.kind === 289 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) { + if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) { return node.parent.parent; } return node; } function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) { const contextNode = getContextNode2(node); - pushContextualType(contextNode, contextualType); + pushContextualType( + contextNode, + contextualType, + /*isCache*/ + false + ); pushInferenceContext(contextNode, inferenceContext); const type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0)); if (inferenceContext && inferenceContext.intraExpressionInferenceSites) { @@ -75400,7 +76105,7 @@ ${lanes.join("\n")} return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) { return getTypeFromTypeNode(expr.type); - } else if (node.kind === 8 /* NumericLiteral */ || node.kind === 10 /* StringLiteral */ || node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */) { + } else if (isLiteralExpression(node) || isBooleanLiteral(node)) { return checkExpression(node); } return void 0; @@ -75410,7 +76115,12 @@ ${lanes.join("\n")} if (links.contextFreeType) { return links.contextFreeType; } - pushContextualType(node, anyType); + pushContextualType( + node, + anyType, + /*isCache*/ + false + ); const type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */); popContextualType(); return type; @@ -75625,7 +76335,7 @@ ${lanes.join("\n")} error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } - if ((node.questionToken || isJSDocOptionalParameter(node)) && isBindingPattern(node.name) && func.body) { + if (!node.initializer && isOptionalDeclaration(node) && isBindingPattern(node.name) && func.body) { error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { @@ -76147,8 +76857,8 @@ ${lanes.join("\n")} } return void 0; } - function getTypeParametersForTypeReference(node) { - const type = getTypeFromTypeReference(node); + function getTypeParametersForTypeReferenceOrImport(node) { + const type = getTypeFromTypeNode(node); if (!isErrorType(type)) { const symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { @@ -76166,11 +76876,14 @@ ${lanes.join("\n")} } } forEach(node.typeArguments, checkSourceElement); - const type = getTypeFromTypeReference(node); + checkTypeReferenceOrImport(node); + } + function checkTypeReferenceOrImport(node) { + const type = getTypeFromTypeNode(node); if (!isErrorType(type)) { if (node.typeArguments) { addLazyDiagnostic(() => { - const typeParameters = getTypeParametersForTypeReference(node); + const typeParameters = getTypeParametersForTypeReferenceOrImport(node); if (typeParameters) { checkTypeArgumentConstraints(node, typeParameters); } @@ -76192,7 +76905,7 @@ ${lanes.join("\n")} const typeReferenceNode = tryCast(node.parent, isTypeReferenceType); if (!typeReferenceNode) return void 0; - const typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReferenceNode); if (!typeParameters) return void 0; const constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); @@ -76372,7 +77085,7 @@ ${lanes.join("\n")} } } } - getTypeFromTypeNode(node); + checkTypeReferenceOrImport(node); } function checkNamedTupleMember(node) { if (node.dotDotDotToken && node.questionToken) { @@ -76537,6 +77250,17 @@ ${lanes.join("\n")} lastSeenNonAmbientDeclaration = node; } } + if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) { + for (const node2 of current.jsDoc) { + if (node2.tags) { + for (const tag of node2.tags) { + if (isJSDocOverloadTag(tag)) { + hasOverloads = true; + } + } + } + } + } } } if (multipleConstructorImplementation) { @@ -76574,8 +77298,9 @@ ${lanes.join("\n")} const bodySignature = getSignatureFromDeclaration(bodyDeclaration); for (const signature of signatures) { if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { + const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration; addRelatedInfo( - error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), + error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here) ); break; @@ -76668,6 +77393,9 @@ ${lanes.join("\n")} case 273 /* ImportSpecifier */: case 79 /* Identifier */: return 1 /* ExportValue */; + case 170 /* MethodSignature */: + case 168 /* PropertySignature */: + return 2 /* ExportType */; default: return Debug.failBadSyntaxKind(d); } @@ -76691,7 +77419,7 @@ ${lanes.join("\n")} ))) { return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* Primitive */ | 131072 /* Never */)) { + if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) { return void 0; } const thenFunction = getTypeOfPropertyOfType(type, "then"); @@ -76743,7 +77471,7 @@ ${lanes.join("\n")} return awaitedType || errorType; } function isThenableType(type) { - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* Primitive */ | 131072 /* Never */)) { + if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) { return false; } const thenFunction = getTypeOfPropertyOfType(type, "then"); @@ -76792,7 +77520,7 @@ ${lanes.join("\n")} return awaitedType; } } - Debug.assert(getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); + Debug.assert(isAwaitedTypeInstantiation(type) || getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); return type; } function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { @@ -79605,20 +80333,19 @@ ${lanes.join("\n")} } } } - function getMemberOverrideModifierStatus(node, member) { + function getMemberOverrideModifierStatus(node, member, memberSymbol) { if (!member.name) { return 0 /* Ok */; } - const symbol = getSymbolOfDeclaration(node); - const type = getDeclaredTypeOfSymbol(symbol); + const classSymbol = getSymbolOfDeclaration(node); + const type = getDeclaredTypeOfSymbol(classSymbol); const typeWithThis = getTypeWithThisArgument(type); - const staticType = getTypeOfSymbol(symbol); + const staticType = getTypeOfSymbol(classSymbol); const baseTypeNode = getEffectiveBaseTypeNode(node); const baseTypes = baseTypeNode && getBaseTypes(type); const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0; const baseStaticType = getBaseConstructorTypeOfClass(type); const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */); - const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name)); return checkMemberForOverrideModifier( node, staticType, @@ -79631,7 +80358,7 @@ ${lanes.join("\n")} isStatic(member), /* memberIsParameterProperty */ false, - memberName + symbolName(memberSymbol) ); } function getTargetSymbol(s) { @@ -80183,7 +80910,7 @@ ${lanes.join("\n")} getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */) { + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || node.parent.impliedNodeFormat === 1 /* CommonJS */)) { const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 93 /* ExportKeyword */); if (exportModifier) { error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); @@ -80514,8 +81241,6 @@ ${lanes.join("\n")} } else { if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); - } else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) { - grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); } } } @@ -80670,7 +81395,7 @@ ${lanes.join("\n")} const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; - const sym = resolveEntityName( + const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName( id, 67108863 /* All */, /*ignoreErrors*/ @@ -80678,7 +81403,7 @@ ${lanes.join("\n")} /*dontResolveAlias*/ true, node - ); + )); if (sym) { markAliasReferenced(sym, id); if (getAllSymbolFlags(sym) & 111551 /* Value */) { @@ -80722,8 +81447,6 @@ ${lanes.join("\n")} grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead); } else if (moduleKind === 4 /* System */ && !(node.flags & 16777216 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); - } else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && !(node.flags & 16777216 /* Ambient */)) { - grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead); } } } @@ -81051,6 +81774,8 @@ ${lanes.join("\n")} if (!(links.flags & 1 /* TypeChecked */)) { links.deferredNodes || (links.deferredNodes = /* @__PURE__ */ new Set()); links.deferredNodes.add(node); + } else { + Debug.assert(!links.deferredNodes, "A type-checked file should have no deferred nodes."); } } function checkDeferredNodes(context) { @@ -81058,6 +81783,7 @@ ${lanes.join("\n")} if (links.deferredNodes) { links.deferredNodes.forEach(checkDeferredNode); } + links.deferredNodes = void 0; } function checkDeferredNode(node) { var _a2, _b; @@ -81313,7 +82039,7 @@ ${lanes.join("\n")} } return node.parent.kind === 180 /* TypeReference */; } - function isHeritageClauseElementIdentifier(node) { + function isInNameOfExpressionWithTypeArguments(node) { while (node.parent.kind === 208 /* PropertyAccessExpression */) { node = node.parent; } @@ -81423,10 +82149,10 @@ ${lanes.join("\n")} while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) { name = name.parent; } - if (isHeritageClauseElementIdentifier(name)) { + if (isInNameOfExpressionWithTypeArguments(name)) { let meaning = 0 /* None */; if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) { - meaning = 788968 /* Type */; + meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */; if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551 /* Value */; } @@ -81832,8 +82558,8 @@ ${lanes.join("\n")} } return getNamedMembers(propsByName); } - function typeHasCallOrConstructSignatures2(type) { - return typeHasCallOrConstructSignatures(type, checker); + function typeHasCallOrConstructSignatures(type) { + return getSignaturesOfType(type, 0 /* Call */).length !== 0 || getSignaturesOfType(type, 1 /* Construct */).length !== 0; } function getRootSymbols(symbol) { const roots = getImmediateRootSymbols(symbol); @@ -82138,7 +82864,7 @@ ${lanes.join("\n")} return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0; } function getTypeReferenceSerializationKind(typeNameIn, location) { - var _a2, _b; + var _a2; const typeName = getParseTreeNode(typeNameIn, isEntityName); if (!typeName) return 0 /* Unknown */; @@ -82170,7 +82896,7 @@ ${lanes.join("\n")} location ); const resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol; - isTypeOnly || (isTypeOnly = !!((_b = valueSymbol == null ? void 0 : valueSymbol.declarations) == null ? void 0 : _b.every(isTypeOnlyImportOrExportDeclaration))); + isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */))); const typeSymbol = resolveEntityName( typeName, 788968 /* Type */, @@ -82321,7 +83047,7 @@ ${lanes.join("\n")} return false; } function literalTypeToNode(type, enclosing, tracker) { - const enumResult = type.flags & 1024 /* EnumLiteral */ ? nodeBuilder.symbolToExpression( + const enumResult = type.flags & 1056 /* EnumLike */ ? nodeBuilder.symbolToExpression( type.symbol, 111551 /* Value */, enclosing, @@ -82864,6 +83590,7 @@ ${lanes.join("\n")} let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; let sawExportBeforeDecorators = false; + let hasLeadingDecorators = false; for (const modifier of node.modifiers) { if (isDecorator(modifier)) { if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { @@ -82881,8 +83608,22 @@ ${lanes.join("\n")} if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } + if (hasLeadingDecorators && flags & 126975 /* Modifier */) { + Debug.assertIsDefined(firstDecorator); + const sourceFile = getSourceFileOfNode(modifier); + if (!hasParseDiagnostics(sourceFile)) { + addRelatedInfo( + error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here) + ); + return true; + } + return false; + } flags |= 131072 /* Decorator */; - if (flags & 1 /* Export */) { + if (!(flags & 126975 /* Modifier */)) { + hasLeadingDecorators = true; + } else if (flags & 1 /* Export */) { sawExportBeforeDecorators = true; } firstDecorator != null ? firstDecorator : firstDecorator = modifier; @@ -83170,7 +83911,6 @@ ${lanes.join("\n")} case 299 /* PropertyAssignment */: case 300 /* ShorthandPropertyAssignment */: case 267 /* NamespaceExportDeclaration */: - case 181 /* FunctionType */: case 279 /* MissingDeclaration */: return find(node.modifiers, isModifier); default: @@ -83867,7 +84607,7 @@ ${lanes.join("\n")} } function isSimpleLiteralEnumReference(expr) { if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { - return !!(checkExpressionCached(expr).flags & 1024 /* EnumLiteral */); + return !!(checkExpressionCached(expr).flags & 1056 /* EnumLike */); } } function checkAmbientInitializer(node) { @@ -84269,10 +85009,10 @@ ${lanes.join("\n")} } function findMostOverlappyType(source, unionTarget) { let bestMatch; - if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { + if (!(source.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { let matchingCount = 0; for (const target of unionTarget.types) { - if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { + if (!(target.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { const overlap = getIntersectionType([getIndexType(source), getIndexType(target)]); if (overlap.flags & 4194304 /* Index */) { return target; @@ -84290,7 +85030,7 @@ ${lanes.join("\n")} } function filterPrimitivesIfContainsNonPrimitive(type) { if (maybeTypeOfKind(type, 67108864 /* NonPrimitive */)) { - const result = filterType(type, (t) => !(t.flags & 131068 /* Primitive */)); + const result = filterType(type, (t) => !(t.flags & 134348796 /* Primitive */)); if (!(result.flags & 131072 /* Never */)) { return result; } @@ -84375,9 +85115,8 @@ ${lanes.join("\n")} "src/compiler/checker.ts"() { "use strict"; init_ts2(); - init_ts2(); - init_ts_performance(); init_ts_moduleSpecifiers(); + init_ts_performance(); ambientModuleSymbolRegex = /^".+"$/; anon = "(anonymous)"; nextSymbolId = 1; @@ -84490,6 +85229,7 @@ ${lanes.join("\n")} SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback"; SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity"; + SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature"; SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback"; return SignatureCheckMode3; })(SignatureCheckMode || {}); @@ -85835,7 +86575,7 @@ ${lanes.join("\n")} [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + nodeVisitor(node.expression, visitor, isExpression) ); }, // Clauses @@ -85920,31 +86660,31 @@ ${lanes.join("\n")} // src/compiler/sourcemap.ts function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) { - const { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; - const rawSources = []; - const sources = []; - const sourceToSourceIndexMap = /* @__PURE__ */ new Map(); - let sourcesContent; - const names = []; - let nameToNameIndexMap; - const mappingCharCodes = []; - let mappings = ""; - let lastGeneratedLine = 0; - let lastGeneratedCharacter = 0; - let lastSourceIndex = 0; - let lastSourceLine = 0; - let lastSourceCharacter = 0; - let lastNameIndex = 0; - let hasLast = false; - let pendingGeneratedLine = 0; - let pendingGeneratedCharacter = 0; - let pendingSourceIndex = 0; - let pendingSourceLine = 0; - let pendingSourceCharacter = 0; - let pendingNameIndex = 0; - let hasPending = false; - let hasPendingSource = false; - let hasPendingName = false; + var { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; + var rawSources = []; + var sources = []; + var sourceToSourceIndexMap = /* @__PURE__ */ new Map(); + var sourcesContent; + var names = []; + var nameToNameIndexMap; + var mappingCharCodes = []; + var mappings = ""; + var lastGeneratedLine = 0; + var lastGeneratedCharacter = 0; + var lastSourceIndex = 0; + var lastSourceLine = 0; + var lastSourceCharacter = 0; + var lastNameIndex = 0; + var hasLast = false; + var pendingGeneratedLine = 0; + var pendingGeneratedCharacter = 0; + var pendingSourceIndex = 0; + var pendingSourceLine = 0; + var pendingSourceCharacter = 0; + var pendingNameIndex = 0; + var hasPending = false; + var hasPendingSource = false; + var hasPendingName = false; return { getSources: () => rawSources, addSource, @@ -89206,7 +89946,7 @@ ${lanes.join("\n")} return node; } function tryGetConstEnumValue(node) { - if (compilerOptions.isolatedModules) { + if (getIsolatedModules(compilerOptions)) { return void 0; } return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; @@ -89763,7 +90503,16 @@ ${lanes.join("\n")} visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) ); } - return visitEachChild(node, visitor, context); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); } function transformPublicFieldInitializer(node) { if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) { @@ -95126,7 +95875,7 @@ ${lanes.join("\n")} ); } function visitBinaryExpression(node, expressionResultIsUnused2) { - if (isDestructuringAssignment(node) && node.left.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + if (isDestructuringAssignment(node) && containsObjectRestOrSpread(node.left)) { return flattenDestructuringAssignment( node, visitor, @@ -95258,7 +96007,7 @@ ${lanes.join("\n")} } function visitForOfStatement(node, outermostLabeledStatement) { const ancestorFacts = enterSubtree(0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */ || isAssignmentPattern(node.initializer) && containsObjectRestOrSpread(node.initializer)) { node = transformForOfStatementWithObjectRest(node); } const result = node.awaitModifier ? transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) : factory2.restoreEnclosingLabel(visitEachChild(node, visitor, context), outermostLabeledStatement); @@ -103156,6 +103905,9 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitImportCallExpression(node) { + if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) { + return visitEachChild(node, visitor, context); + } const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; @@ -105645,7 +106397,7 @@ ${lanes.join("\n")} if (node.isDeclarationFile) { return node; } - if (isExternalModule(node) || compilerOptions.isolatedModules) { + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { currentSourceFile = node; importRequireStatements = void 0; let result = updateExternalModule(node); @@ -105852,7 +106604,7 @@ ${lanes.join("\n")} } function onEmitNode(hint, node, emitCallback) { if (isSourceFile(node)) { - if ((isExternalModule(node) || compilerOptions.isolatedModules) && compilerOptions.importHelpers) { + if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) { helperNameSubstitutions = /* @__PURE__ */ new Map(); } previousOnEmitNode(hint, node, emitCallback); @@ -106721,7 +107473,7 @@ ${lanes.join("\n")} if (elem.kind === 229 /* OmittedExpression */) { return elem; } - if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) { + if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) { return factory2.updateBindingElement( elem, elem.dotDotDotToken, @@ -108610,15 +109362,15 @@ ${lanes.join("\n")} return Debug.fail(`project ${configFile.options.configFilePath} expected to have at least one output`); } function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, declarationTransformers }, emitOnly, onlyBuildInfo, forceDtsEmit) { - const compilerOptions = host.getCompilerOptions(); - const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; - const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; - const emitterDiagnostics = createDiagnosticCollection(); - const newLine = getNewLineCharacter(compilerOptions); - const writer = createTextWriter(newLine); - const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); - let bundleBuildInfo; - let emitSkipped = false; + var compilerOptions = host.getCompilerOptions(); + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; + var emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; + var emitterDiagnostics = createDiagnosticCollection(); + var newLine = getNewLineCharacter(compilerOptions); + var writer = createTextWriter(newLine); + var { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); + var bundleBuildInfo; + var emitSkipped = false; enter(); forEachEmittedFile( host, @@ -109138,7 +109890,7 @@ ${lanes.join("\n")} return outputFiles; } function createPrinter(printerOptions = {}, handlers = {}) { - const { + var { hasGlobalName, onEmitNode = noEmitNotification, isEmitNotificationEnabled, @@ -109150,57 +109902,57 @@ ${lanes.join("\n")} onBeforeEmitToken, onAfterEmitToken } = handlers; - const extendedDiagnostics = !!printerOptions.extendedDiagnostics; - const newLine = getNewLineCharacter(printerOptions); - const moduleKind = getEmitModuleKind(printerOptions); - const bundledHelpers = /* @__PURE__ */ new Map(); - let currentSourceFile; - let nodeIdToGeneratedName; - let nodeIdToGeneratedPrivateName; - let autoGeneratedIdToGeneratedName; - let generatedNames; - let formattedNameTempFlagsStack; - let formattedNameTempFlags; - let privateNameTempFlagsStack; - let privateNameTempFlags; - let tempFlagsStack; - let tempFlags; - let reservedNamesStack; - let reservedNames; - let reservedPrivateNamesStack; - let reservedPrivateNames; - let preserveSourceNewlines = printerOptions.preserveSourceNewlines; - let nextListElementPos; - let writer; - let ownWriter; - let write = writeBase; - let isOwnFileEmit; - const bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; - const relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; - const recordInternalSection = printerOptions.recordInternalSection; - let sourceFileTextPos = 0; - let sourceFileTextKind = "text" /* Text */; - let sourceMapsDisabled = true; - let sourceMapGenerator; - let sourceMapSource; - let sourceMapSourceIndex = -1; - let mostRecentlyAddedSourceMapSource; - let mostRecentlyAddedSourceMapSourceIndex = -1; - let containerPos = -1; - let containerEnd = -1; - let declarationListContainerEnd = -1; - let currentLineMap; - let detachedCommentsInfo; - let hasWrittenComment = false; - let commentsDisabled = !!printerOptions.removeComments; - let lastSubstitution; - let currentParenthesizerRule; - const { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); - const parenthesizer = factory.parenthesizer; - const typeArgumentParenthesizerRuleSelector = { + var extendedDiagnostics = !!printerOptions.extendedDiagnostics; + var newLine = getNewLineCharacter(printerOptions); + var moduleKind = getEmitModuleKind(printerOptions); + var bundledHelpers = /* @__PURE__ */ new Map(); + var currentSourceFile; + var nodeIdToGeneratedName; + var nodeIdToGeneratedPrivateName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var formattedNameTempFlagsStack; + var formattedNameTempFlags; + var privateNameTempFlagsStack; + var privateNameTempFlags; + var tempFlagsStack; + var tempFlags; + var reservedNamesStack; + var reservedNames; + var reservedPrivateNamesStack; + var reservedPrivateNames; + var preserveSourceNewlines = printerOptions.preserveSourceNewlines; + var nextListElementPos; + var writer; + var ownWriter; + var write = writeBase; + var isOwnFileEmit; + var bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; + var relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; + var recordInternalSection = printerOptions.recordInternalSection; + var sourceFileTextPos = 0; + var sourceFileTextKind = "text" /* Text */; + var sourceMapsDisabled = true; + var sourceMapGenerator; + var sourceMapSource; + var sourceMapSourceIndex = -1; + var mostRecentlyAddedSourceMapSource; + var mostRecentlyAddedSourceMapSourceIndex = -1; + var containerPos = -1; + var containerEnd = -1; + var declarationListContainerEnd = -1; + var currentLineMap; + var detachedCommentsInfo; + var hasWrittenComment = false; + var commentsDisabled = !!printerOptions.removeComments; + var lastSubstitution; + var currentParenthesizerRule; + var { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); + var parenthesizer = factory.parenthesizer; + var typeArgumentParenthesizerRuleSelector = { select: (index) => index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 }; - const emitBinaryExpression = createEmitBinaryExpression(); + var emitBinaryExpression = createEmitBinaryExpression(); reset2(); return { // public API @@ -109459,9 +110211,9 @@ ${lanes.join("\n")} formattedNameTempFlagsStack = []; formattedNameTempFlags = /* @__PURE__ */ new Map(); privateNameTempFlagsStack = []; - privateNameTempFlags = TempFlags.Auto; + privateNameTempFlags = 0 /* Auto */; tempFlagsStack = []; - tempFlags = TempFlags.Auto; + tempFlags = 0 /* Auto */; reservedNamesStack = []; reservedNames = void 0; reservedPrivateNamesStack = []; @@ -110430,7 +111182,7 @@ ${lanes.join("\n")} } function emitTypeLiteral(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -110619,7 +111371,7 @@ ${lanes.join("\n")} } function emitObjectLiteralExpression(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -111385,7 +112137,7 @@ ${lanes.join("\n")} } function emitClassDeclarationOrExpression(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -111418,7 +112170,7 @@ ${lanes.join("\n")} } function emitInterfaceDeclaration(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -112861,7 +113613,7 @@ ${lanes.join("\n")} return; } tempFlagsStack.push(tempFlags); - tempFlags = TempFlags.Auto; + tempFlags = 0 /* Auto */; formattedNameTempFlagsStack.push(formattedNameTempFlags); formattedNameTempFlags = void 0; reservedNamesStack.push(reservedNames); @@ -113047,7 +113799,7 @@ ${lanes.join("\n")} case "#": return privateNameTempFlags; default: - return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : TempFlags.Auto; + return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : 0 /* Auto */; } } function setTempFlags(formattedNameKey, flags) { @@ -113071,7 +113823,7 @@ ${lanes.join("\n")} const key = formatGeneratedName(privateName, prefix, "", suffix); let tempFlags2 = getTempFlags(key); if (flags && !(tempFlags2 & flags)) { - const name = flags === TempFlags._i ? "_i" : "_n"; + const name = flags === 268435456 /* _i */ ? "_i" : "_n"; const fullName = formatGeneratedName(privateName, prefix, name, suffix); if (isUniqueName(fullName, privateName)) { tempFlags2 |= flags; @@ -113085,7 +113837,7 @@ ${lanes.join("\n")} } } while (true) { - const count = tempFlags2 & TempFlags.CountMask; + const count = tempFlags2 & 268435455 /* CountMask */; tempFlags2++; if (count !== 8 && count !== 13) { const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); @@ -113229,7 +113981,7 @@ ${lanes.join("\n")} return generateNameCached(node.name, privateName); } return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reservedInNestedScopes*/ false, privateName, @@ -113286,7 +114038,7 @@ ${lanes.join("\n")} return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); case 164 /* ComputedPropertyName */: return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reserveInNestedScopes*/ true, privateName, @@ -113295,7 +114047,7 @@ ${lanes.join("\n")} ); default: return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reserveInNestedScopes*/ false, privateName, @@ -113310,11 +114062,11 @@ ${lanes.join("\n")} const suffix = formatGeneratedNamePart(autoGenerate.suffix); switch (autoGenerate.flags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + return makeTempVariableName(0 /* Auto */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); case 2 /* Loop */: Debug.assertNode(name, isIdentifier); return makeTempVariableName( - TempFlags._i, + 268435456 /* _i */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), /*privateName*/ false, @@ -113796,7 +114548,7 @@ ${lanes.join("\n")} function getEmitListItem(emit, parenthesizerRule) { return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; } - var brackets, notImplementedResolver, createPrinterWithDefaults, createPrinterWithRemoveComments, createPrinterWithRemoveCommentsNeverAsciiEscape, createPrinterWithRemoveCommentsOmitTrailingSemicolon, TempFlags; + var brackets, notImplementedResolver, createPrinterWithDefaults, createPrinterWithRemoveComments, createPrinterWithRemoveCommentsNeverAsciiEscape, createPrinterWithRemoveCommentsOmitTrailingSemicolon; var init_emitter = __esm({ "src/compiler/emitter.ts"() { "use strict"; @@ -113847,16 +114599,10 @@ ${lanes.join("\n")} getDeclarationStatementsForSourceFile: notImplemented, isImportRequiredByAugmentation: notImplemented }; - createPrinterWithDefaults = memoize(() => createPrinter({})); - createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); - createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); - createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); - TempFlags = /* @__PURE__ */ ((TempFlags2) => { - TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; - TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; - TempFlags2[TempFlags2["_i"] = 268435456] = "_i"; - return TempFlags2; - })(TempFlags || {}); + createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({})); + createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true })); + createPrinterWithRemoveCommentsNeverAsciiEscape = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); + createPrinterWithRemoveCommentsOmitTrailingSemicolon = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); } }); @@ -114810,14 +115556,14 @@ ${lanes.join("\n")} function createModuleResolutionLoader(containingFile, redirectedReference, options, host, cache) { return { nameAndMode: moduleResolutionNameAndModeGetter, - resolve: (moduleName, resoluionMode) => resolveModuleName( + resolve: (moduleName, resolutionMode) => resolveModuleName( moduleName, containingFile, options, host, cache, redirectedReference, - resoluionMode + resolutionMode ) }; } @@ -116256,11 +117002,19 @@ ${lanes.join("\n")} diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); } else if (isClassDeclaration(parent2)) { const exportIndex = findIndex(parent2.modifiers, isExportModifier); - const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); - if (exportIndex >= 0 && decoratorIndex < exportIndex) { - diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files)); - } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) { - diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + if (exportIndex >= 0) { + const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); + if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (exportIndex >= 0 && decoratorIndex < exportIndex) { + const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex); + if (trailingDecoratorIndex >= 0) { + diagnostics.push(addRelatedInfo( + createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here) + )); + } + } } } } @@ -116438,7 +117192,7 @@ ${lanes.join("\n")} let imports; let moduleAugmentations; let ambientModules; - if ((options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { + if ((getIsolatedModules(options) || isExternalModuleFile) && !file.isDeclarationFile) { if (options.importHelpers) { imports = [createSyntheticImport(externalHelpersModuleNameText, file)]; } @@ -117159,12 +117913,12 @@ ${lanes.join("\n")} if (options.exactOptionalPropertyTypes && !getStrictOptionValue(options, "strictNullChecks")) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks"); } - if (options.isolatedModules) { + if (options.isolatedModules || options.verbatimModuleSyntax) { if (options.out) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); } if (options.outFile) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", "isolatedModules"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); } } if (options.inlineSourceMap) { @@ -117375,10 +118129,10 @@ ${lanes.join("\n")} } } if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) { - createDiagnosticForOptionName(Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); } + const moduleKind = getEmitModuleKind(options); if (options.verbatimModuleSyntax) { - const moduleKind = getEmitModuleKind(options); if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } @@ -117397,13 +118151,16 @@ ${lanes.join("\n")} } const moduleResolution = getEmitModuleResolutionKind(options); if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("resolvePackageJsonExports", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); } if (options.resolvePackageJsonImports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("resolvePackageJsonImports", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); } if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("customConditions", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + } + if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)) { + createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "bundler"); } if (!options.noEmit && !options.suppressOutputPathCheck) { const emitHost = getEmitHost(); @@ -117558,7 +118315,7 @@ ${lanes.join("\n")} if (version2 === "6.0" /* v6_0 */) { createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); } else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); } } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { @@ -118721,7 +119478,7 @@ ${lanes.join("\n")} return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); } const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || outFile(compilerOptions))) { + if (compilerOptions && (getIsolatedModules(compilerOptions) || outFile(compilerOptions))) { return [sourceFileWithUpdatedShape]; } const seenFileNamesMap = /* @__PURE__ */ new Map(); @@ -119136,7 +119893,7 @@ ${lanes.join("\n")} return; if (!isChangedSignature(state, affectedFile.resolvedPath)) return; - if (state.compilerOptions.isolatedModules) { + if (getIsolatedModules(state.compilerOptions)) { const seenFileNamesMap = /* @__PURE__ */ new Map(); seenFileNamesMap.set(affectedFile.resolvedPath, true); const queue = BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath); @@ -119229,14 +119986,17 @@ ${lanes.join("\n")} const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0; const fileNames = []; const fileNameToFileId = /* @__PURE__ */ new Map(); + const root = []; if (outFile(state.compilerOptions)) { const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => { - toFileId(key); + const fileId = toFileId(key); + tryAddRoot(key, fileId); return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version; }); const program2 = { fileNames, fileInfos: fileInfos2, + root, options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), outSignature: state.outSignature, latestChangedDtsFile, @@ -119264,6 +120024,7 @@ ${lanes.join("\n")} const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value]) => { var _a3, _b2; const fileId = toFileId(key); + tryAddRoot(key, fileId); Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key)); const oldSignature = (_a3 = state.oldSignatures) == null ? void 0 : _a3.get(key); const actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value.signature; @@ -119363,6 +120124,7 @@ ${lanes.join("\n")} const program = { fileNames, fileInfos, + root, options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), fileIdsList, referencedMap, @@ -119398,6 +120160,24 @@ ${lanes.join("\n")} } return fileIdListId; } + function tryAddRoot(path, fileId) { + const file = state.program.getSourceFile(path); + if (!state.program.getFileIncludeReasons().get(file.path).some((r) => r.kind === 0 /* RootFile */)) + return; + if (!root.length) + return root.push(fileId); + const last2 = root[root.length - 1]; + const isLastStartEnd = isArray(last2); + if (isLastStartEnd && last2[1] === fileId - 1) + return last2[1] = fileId; + if (isLastStartEnd || root.length === 1 || last2 !== fileId - 1) + return root.push(fileId); + const lastButOne = root[root.length - 2]; + if (!isNumber(lastButOne) || lastButOne !== last2 - 1) + return root.push(fileId); + root[root.length - 2] = [lastButOne, fileId]; + return root.length = root.length - 1; + } function convertToProgramBuildInfoCompilerOptions(options) { let result; const { optionsNameMap } = getOptionsNameMap(); @@ -119905,12 +120685,28 @@ ${lanes.join("\n")} const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); const fileInfos = /* @__PURE__ */ new Map(); + let rootIndex = 0; + const roots = []; program.fileInfos.forEach((fileInfo, index) => { const path = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName); const version2 = isString(fileInfo) ? fileInfo : fileInfo.version; fileInfos.set(path, version2); + if (rootIndex < program.root.length) { + const current = program.root[rootIndex]; + const fileId = index + 1; + if (isArray(current)) { + if (current[0] <= fileId && fileId <= current[1]) { + roots.push(path); + if (current[1] === fileId) + rootIndex++; + } + } else if (current === fileId) { + roots.push(path); + rootIndex++; + } + } }); - return fileInfos; + return { fileInfos, roots }; } function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) { return { @@ -120854,7 +121650,7 @@ ${lanes.join("\n")} return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine; } function getLocaleTimeString(system) { - return !system.now ? new Date().toLocaleTimeString() : ( + return !system.now ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : ( // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM. // This branch is solely for testing, so just switch it to a normal space for baseline stability. // See: @@ -122243,13 +123039,14 @@ ${lanes.join("\n")} UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithUpstream"] = 7] = "OutOfDateWithUpstream"; UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfo"] = 8] = "OutOfDateBuildInfo"; UpToDateStatusType2[UpToDateStatusType2["OutOfDateOptions"] = 9] = "OutOfDateOptions"; - UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 10] = "UpstreamOutOfDate"; - UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 11] = "UpstreamBlocked"; - UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 12] = "ComputingUpstream"; - UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 13] = "TsVersionOutputOfDate"; - UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 14] = "UpToDateWithInputFileText"; - UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 15] = "ContainerOnly"; - UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 16] = "ForceBuild"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateRoots"] = 10] = "OutOfDateRoots"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 11] = "UpstreamOutOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 12] = "UpstreamBlocked"; + UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 13] = "ComputingUpstream"; + UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 14] = "TsVersionOutputOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 15] = "UpToDateWithInputFileText"; + UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 16] = "ContainerOnly"; + UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 17] = "ForceBuild"; return UpToDateStatusType2; })(UpToDateStatusType || {}); } @@ -122269,7 +123066,7 @@ ${lanes.join("\n")} return getOrCreateValueFromConfigFileMap(configFileMap, resolved, () => /* @__PURE__ */ new Map()); } function getCurrentTime(host) { - return host.now ? host.now() : new Date(); + return host.now ? host.now() : /* @__PURE__ */ new Date(); } function isCircularBuildOrder(buildOrder) { return !!buildOrder && !!buildOrder.buildOrder; @@ -123131,7 +123928,7 @@ ${lanes.join("\n")} } continue; } - if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 14 /* UpToDateWithInputFileText */) { + if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) { reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); return { kind: 2 /* UpdateOutputFileStamps */, @@ -123143,7 +123940,7 @@ ${lanes.join("\n")} }; } } - if (status.type === 11 /* UpstreamBlocked */) { + if (status.type === 12 /* UpstreamBlocked */) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); projectPendingBuild.delete(projectPath); @@ -123157,7 +123954,7 @@ ${lanes.join("\n")} } continue; } - if (status.type === 15 /* ContainerOnly */) { + if (status.type === 16 /* ContainerOnly */) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); projectPendingBuild.delete(projectPath); @@ -123344,31 +124141,31 @@ ${lanes.join("\n")} var _a2, _b; if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) { return { - type: 15 /* ContainerOnly */ + type: 16 /* ContainerOnly */ }; } let referenceStatuses; const force = !!state.options.force; if (project.projectReferences) { - state.projectStatus.set(resolvedPath, { type: 12 /* ComputingUpstream */ }); + state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ }); for (const ref of project.projectReferences) { const resolvedRef = resolveProjectReferencePath(ref); const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef); const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath); const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath); - if (refStatus.type === 12 /* ComputingUpstream */ || refStatus.type === 15 /* ContainerOnly */) { + if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) { continue; } - if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 11 /* UpstreamBlocked */) { + if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) { return { - type: 11 /* UpstreamBlocked */, + type: 12 /* UpstreamBlocked */, upstreamProjectName: ref.path, - upstreamProjectBlocked: refStatus.type === 11 /* UpstreamBlocked */ + upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */ }; } if (refStatus.type !== 1 /* UpToDate */) { return { - type: 10 /* UpstreamOutOfDate */, + type: 11 /* UpstreamOutOfDate */, upstreamProjectName: ref.path }; } @@ -123377,7 +124174,7 @@ ${lanes.join("\n")} } } if (force) - return { type: 16 /* ForceBuild */ }; + return { type: 17 /* ForceBuild */ }; const { host } = state; const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options); let oldestOutputFileName; @@ -123410,7 +124207,7 @@ ${lanes.join("\n")} } if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== version) { return { - type: 13 /* TsVersionOutputOfDate */, + type: 14 /* TsVersionOutputOfDate */, version: buildInfo.version }; } @@ -123435,6 +124232,7 @@ ${lanes.join("\n")} let newestInputFileName = void 0; let newestInputFileTime = minimumDate; let pseudoInputUpToDate = false; + const seenRoots = /* @__PURE__ */ new Set(); for (const inputFile of project.fileNames) { const inputTime = getModifiedTime2(state, inputFile); if (inputTime === missingFileModifiedTime) { @@ -123449,7 +124247,7 @@ ${lanes.join("\n")} if (buildInfoProgram) { if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); - version2 = buildInfoVersionMap.get(toPath2(state, inputFile)); + version2 = buildInfoVersionMap.fileInfos.get(toPath2(state, inputFile)); const text = version2 ? state.readFileWithCache(inputFile) : void 0; currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0; if (version2 && version2 === currentVersion) @@ -123467,6 +124265,21 @@ ${lanes.join("\n")} newestInputFileName = inputFile; newestInputFileTime = inputTime; } + if (buildInfoProgram) + seenRoots.add(toPath2(state, inputFile)); + } + if (buildInfoProgram) { + if (!buildInfoVersionMap) + buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); + for (const existingRoot of buildInfoVersionMap.roots) { + if (!seenRoots.has(existingRoot)) { + return { + type: 10 /* OutOfDateRoots */, + buildInfoFile: buildInfoPath, + inputFile: existingRoot + }; + } + } } if (!buildInfoPath) { const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames()); @@ -123548,7 +124361,7 @@ ${lanes.join("\n")} }; } return { - type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 14 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, + type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, newestInputFileTime, newestInputFileName, oldestOutputFileName @@ -123667,7 +124480,7 @@ ${lanes.join("\n")} } break; } - case 14 /* UpToDateWithInputFileText */: + case 15 /* UpToDateWithInputFileText */: case 2 /* UpToDateWithUpstreamTypes */: case 3 /* OutOfDateWithPrepend */: if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) { @@ -123678,7 +124491,7 @@ ${lanes.join("\n")} }); } break; - case 11 /* UpstreamBlocked */: + case 12 /* UpstreamBlocked */: if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) { clearProjectStatus(state, nextProjectPath); } @@ -124129,6 +124942,14 @@ ${lanes.join("\n")} relName(state, configFileName), relName(state, status.buildInfoFile) ); + case 10 /* OutOfDateRoots */: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more, + relName(state, configFileName), + relName(state, status.buildInfoFile), + relName(state, status.inputFile) + ); case 1 /* UpToDate */: if (status.newestInputFileTime !== void 0) { return reportStatus( @@ -124153,20 +124974,20 @@ ${lanes.join("\n")} Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName) ); - case 14 /* UpToDateWithInputFileText */: + case 15 /* UpToDateWithInputFileText */: return reportStatus( state, Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files, relName(state, configFileName) ); - case 10 /* UpstreamOutOfDate */: + case 11 /* UpstreamOutOfDate */: return reportStatus( state, Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, relName(state, configFileName), relName(state, status.upstreamProjectName) ); - case 11 /* UpstreamBlocked */: + case 12 /* UpstreamBlocked */: return reportStatus( state, status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, @@ -124180,7 +125001,7 @@ ${lanes.join("\n")} relName(state, configFileName), status.reason ); - case 13 /* TsVersionOutputOfDate */: + case 14 /* TsVersionOutputOfDate */: return reportStatus( state, Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, @@ -124188,14 +125009,14 @@ ${lanes.join("\n")} status.version, version ); - case 16 /* ForceBuild */: + case 17 /* ForceBuild */: return reportStatus( state, Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName) ); - case 15 /* ContainerOnly */: - case 12 /* ComputingUpstream */: + case 16 /* ContainerOnly */: + case 13 /* ComputingUpstream */: break; default: assertType(status); @@ -124213,8 +125034,8 @@ ${lanes.join("\n")} init_ts2(); init_ts2(); init_ts_performance(); - minimumDate = new Date(-864e13); - maximumDate = new Date(864e13); + minimumDate = /* @__PURE__ */ new Date(-864e13); + maximumDate = /* @__PURE__ */ new Date(864e13); InvalidatedProjectKind = /* @__PURE__ */ ((InvalidatedProjectKind2) => { InvalidatedProjectKind2[InvalidatedProjectKind2["Build"] = 0] = "Build"; InvalidatedProjectKind2[InvalidatedProjectKind2["UpdateBundle"] = 1] = "UpdateBundle"; @@ -124645,7 +125466,7 @@ ${lanes.join("\n")} return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0; } function nowString() { - const d = new Date(); + const d = /* @__PURE__ */ new Date(); return `${padLeft(d.getHours().toString(), 2, "0")}:${padLeft(d.getMinutes().toString(), 2, "0")}:${padLeft(d.getSeconds().toString(), 2, "0")}.${padLeft(d.getMilliseconds().toString(), 3, "0")}`; } var ActionSet, ActionInvalidate, ActionPackageInstalled, EventTypesRegistry, EventBeginInstallTypes, EventEndInstallTypes, EventInitializationFailed, Arguments; @@ -126277,6 +127098,13 @@ ${lanes.join("\n")} } return false; } + function isStringAndEmptyAnonymousObjectIntersection(type) { + if (!type.isIntersection()) { + return false; + } + const { types, checker } = type; + return types.length === 2 && types[0].flags & 4 /* String */ && checker.isEmptyAnonymousObjectType(types[1]); + } function isPunctuation(kind) { return 18 /* FirstPunctuation */ <= kind && kind <= 78 /* LastPunctuation */; } @@ -126441,7 +127269,7 @@ ${lanes.join("\n")} }; } function moduleResolutionUsesNodeModules(moduleResolution) { - return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */; + return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) { return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0; @@ -126457,7 +127285,7 @@ ${lanes.join("\n")} ); } function makeStringLiteral(text, quotePreference) { - return factory.createStringLiteral(text, quotePreference === QuotePreference.Single); + return factory.createStringLiteral(text, quotePreference === 0 /* Single */); } function quotePreferenceFromString(str, sourceFile) { return isStringDoubleQuoted(str, sourceFile) ? 1 /* Double */ : 0 /* Single */; @@ -127088,7 +127916,7 @@ ${lanes.join("\n")} return isBinaryExpression(expression) && expression.operatorToken.kind === 27 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression); } function getContextualTypeFromParent(node, checker, contextFlags) { - const { parent: parent2 } = node; + const parent2 = walkUpParenthesizedExpressions(node.parent); switch (parent2.kind) { case 211 /* NewExpression */: return checker.getContextualType(parent2, contextFlags); @@ -127097,7 +127925,7 @@ ${lanes.join("\n")} return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags); } case 292 /* CaseClause */: - return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0; + return getSwitchedType(parent2, checker); default: return checker.getContextualType(node, contextFlags); } @@ -127359,7 +128187,13 @@ ${lanes.join("\n")} function createPackageJsonImportFilter(fromFile, preferences, host) { const packageJsons = (host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || getPackageJsonsVisibleToFile(fromFile.fileName, host)).filter((p) => p.parseable); let usesNodeCoreModules; - return { allowsImportingAmbientModule, allowsImportingSourceFile, allowsImportingSpecifier }; + let ambientModuleCache; + let sourceFileCache; + return { + allowsImportingAmbientModule, + allowsImportingSourceFile, + allowsImportingSpecifier + }; function moduleSpecifierIsCoveredByPackageJson(specifier) { const packageName = getNodeModuleRootSpecifier(specifier); for (const packageJson of packageJsons) { @@ -127373,26 +128207,49 @@ ${lanes.join("\n")} if (!packageJsons.length || !moduleSymbol.valueDeclaration) { return true; } - const declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); - const declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); - if (typeof declaringNodeModuleName === "undefined") { - return true; + if (!ambientModuleCache) { + ambientModuleCache = /* @__PURE__ */ new Map(); + } else { + const cached = ambientModuleCache.get(moduleSymbol); + if (cached !== void 0) { + return cached; + } } const declaredModuleSpecifier = stripQuotes(moduleSymbol.getName()); if (isAllowedCoreNodeModulesImport(declaredModuleSpecifier)) { + ambientModuleCache.set(moduleSymbol, true); return true; } - return moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); + const declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); + const declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); + if (typeof declaringNodeModuleName === "undefined") { + ambientModuleCache.set(moduleSymbol, true); + return true; + } + const result = moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); + ambientModuleCache.set(moduleSymbol, result); + return result; } function allowsImportingSourceFile(sourceFile, moduleSpecifierResolutionHost) { if (!packageJsons.length) { return true; } + if (!sourceFileCache) { + sourceFileCache = /* @__PURE__ */ new Map(); + } else { + const cached = sourceFileCache.get(sourceFile); + if (cached !== void 0) { + return cached; + } + } const moduleSpecifier = getNodeModulesPackageNameFromFileName(sourceFile.fileName, moduleSpecifierResolutionHost); if (!moduleSpecifier) { + sourceFileCache.set(sourceFile, true); return true; } - return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + const result = moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + sourceFileCache.set(sourceFile, result); + return result; } function allowsImportingSpecifier(moduleSpecifier) { if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) { @@ -127540,10 +128397,13 @@ ${lanes.join("\n")} return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */); } function getDefaultLikeExportNameFromDeclaration(symbol) { - return firstDefined(symbol.declarations, (d) => { - var _a2; - return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : void 0; - }); + return firstDefined( + symbol.declarations, + (d) => { + var _a2, _b; + return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text; + } + ); } function getSymbolParentOrFail(symbol) { var _a2; @@ -127612,6 +128472,64 @@ ${lanes.join("\n")} function isSourceFileFromLibrary(program, node) { return program.isSourceFileFromExternalLibrary(node) || program.isSourceFileDefaultLibrary(node); } + function newCaseClauseTracker(checker, clauses) { + const existingStrings = /* @__PURE__ */ new Set(); + const existingNumbers = /* @__PURE__ */ new Set(); + const existingBigInts = /* @__PURE__ */ new Set(); + for (const clause of clauses) { + if (!isDefaultClause(clause)) { + const expression = skipParentheses(clause.expression); + if (isLiteralExpression(expression)) { + switch (expression.kind) { + case 14 /* NoSubstitutionTemplateLiteral */: + case 10 /* StringLiteral */: + existingStrings.add(expression.text); + break; + case 8 /* NumericLiteral */: + existingNumbers.add(parseInt(expression.text)); + break; + case 9 /* BigIntLiteral */: + const parsedBigInt = parseBigInt(endsWith(expression.text, "n") ? expression.text.slice(0, -1) : expression.text); + if (parsedBigInt) { + existingBigInts.add(pseudoBigIntToString(parsedBigInt)); + } + break; + } + } else { + const symbol = checker.getSymbolAtLocation(clause.expression); + if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { + const enumValue = checker.getConstantValue(symbol.valueDeclaration); + if (enumValue !== void 0) { + addValue(enumValue); + } + } + } + } + } + return { + addValue, + hasValue + }; + function addValue(value) { + switch (typeof value) { + case "string": + existingStrings.add(value); + break; + case "number": + existingNumbers.add(value); + } + } + function hasValue(value) { + switch (typeof value) { + case "string": + return existingStrings.has(value); + case "number": + return existingNumbers.has(value); + case "object": + return existingBigInts.has(pseudoBigIntToString(value)); + } + } + } var scanner, SemanticMeaning, tripleSlashDirectivePrefixRegex, typeKeywords, QuotePreference, displayPartWriter, lineFeed2, ANONYMOUS, syntaxMayBeASICandidate; var init_utilities4 = __esm({ "src/services/utilities.ts"() { @@ -127908,13 +128826,25 @@ ${lanes.join("\n")} const autoImportProvider = useAutoImportProvider && ((_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host)); if (autoImportProvider) { const start = timestamp(); - forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => cb( - module2, - file, - autoImportProvider, - /*isFromPackageJson*/ - true - )); + const checker = program.getTypeChecker(); + forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => { + if (file && !program.getSourceFile(file.fileName) || !file && !checker.resolveName( + module2.name, + /*location*/ + void 0, + 1536 /* Module */, + /*excludeGlobals*/ + false + )) { + cb( + module2, + file, + autoImportProvider, + /*isFromPackageJson*/ + true + ); + } + }); (_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start}`); } } @@ -132415,7 +133345,8 @@ ${lanes.join("\n")} options.triggerCharacter, options.triggerKind, cancellationToken, - formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host) + formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host), + options.includeSymbol ); } function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) { @@ -133321,9 +134252,9 @@ ${lanes.join("\n")} "src/services/services.ts"() { "use strict"; init_ts4(); + init_ts4(); init_ts_NavigateTo(); init_ts_NavigationBar(); - init_ts4(); servicesVersion = "0.8"; NodeObject = class { constructor(kind, pos, end) { @@ -136329,8 +137260,8 @@ ${lanes.join("\n")} var init_addEmptyExportDeclaration = __esm({ "src/services/codefixes/addEmptyExportDeclaration.ts"() { "use strict"; - init_ts_codefix(); init_ts4(); + init_ts_codefix(); registerCodeFix({ errorCodes: [ Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code, @@ -138694,8 +139625,8 @@ ${lanes.join("\n")} var init_convertToEsModule = __esm({ "src/services/codefixes/convertToEsModule.ts"() { "use strict"; - init_ts_codefix(); init_ts4(); + init_ts_codefix(); registerCodeFix({ errorCodes: [Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code], getCodeActions(context) { @@ -139093,6 +140024,7 @@ ${lanes.join("\n")} sourceFile, symbol, symbolName2, + moduleSymbol, /*isJsxTagName*/ false, program, @@ -139104,7 +140036,6 @@ ${lanes.join("\n")} const fix = getImportFixForSymbol( sourceFile, Debug.checkDefined(exportInfo), - moduleSymbol, program, /*position*/ void 0, @@ -139121,13 +140052,13 @@ ${lanes.join("\n")} var _a2, _b; const { fix, symbolName: symbolName2 } = info; switch (fix.kind) { - case ImportFixKind.UseNamespace: + case 0 /* UseNamespace */: addToNamespace.push(fix); break; - case ImportFixKind.JsdocTypeImport: + case 1 /* JsdocTypeImport */: importType.push(fix); break; - case ImportFixKind.AddToExisting: { + case 2 /* AddToExisting */: { const { importClauseOrBindingPattern, importKind, addAsTypeOnly } = fix; const key = String(getNodeId(importClauseOrBindingPattern)); let entry = addToExisting.get(key); @@ -139146,7 +140077,7 @@ ${lanes.join("\n")} } break; } - case ImportFixKind.AddNew: { + case 3 /* AddNew */: { const { moduleSpecifier, importKind, useRequire, addAsTypeOnly } = fix; const entry = getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly); Debug.assert(entry.useRequire === useRequire, "(Add new) Tried to add an `import` and a `require` for the same module"); @@ -139167,7 +140098,7 @@ ${lanes.join("\n")} } break; } - case ImportFixKind.PromoteTypeOnly: + case 4 /* PromoteTypeOnly */: break; default: Debug.assertNever(fix, `fix wasn't never - got kind ${fix.kind}`); @@ -139194,13 +140125,13 @@ ${lanes.join("\n")} namespaceLikeImport: void 0, useRequire }; - if (importKind === 1 /* Default */ && addAsTypeOnly === AddAsTypeOnly.Required) { + if (importKind === 1 /* Default */ && addAsTypeOnly === 2 /* Required */) { if (typeOnlyEntry) return typeOnlyEntry; newImports.set(typeOnlyKey, newEntry); return newEntry; } - if (addAsTypeOnly === AddAsTypeOnly.Allowed && (typeOnlyEntry || nonTypeOnlyEntry)) { + if (addAsTypeOnly === 1 /* Allowed */ && (typeOnlyEntry || nonTypeOnlyEntry)) { return typeOnlyEntry || nonTypeOnlyEntry; } if (nonTypeOnlyEntry) { @@ -139241,7 +140172,8 @@ ${lanes.join("\n")} quotePreference, defaultImport, namedImports && arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })), - namespaceLikeImport + namespaceLikeImport, + compilerOptions ); newDeclarations = combine(newDeclarations, declarations); }); @@ -139282,13 +140214,19 @@ ${lanes.join("\n")} return result && { ...result, computedWithoutCacheCount }; } } - function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { + function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { const compilerOptions = program.getCompilerOptions(); - const exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, isJsxTagName, program, host, preferences, cancellationToken); - Debug.assertIsDefined(exportInfos); + let exportInfos; + if (exportMapKey) { + exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey); + Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified exportMapKey"); + } else { + exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, symbolName2, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, moduleSymbol, isJsxTagName, program, host, preferences, cancellationToken); + Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified symbol / moduleSymbol"); + } const useRequire = shouldUseRequire(sourceFile, program); const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); - const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); + const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); return { moduleSpecifier: fix.moduleSpecifier, codeAction: codeFixActionToCodeAction(codeActionForFix( @@ -139310,23 +140248,22 @@ ${lanes.join("\n")} const includeSymbolNameInDescription = symbolName2 !== symbolToken.text; return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences)); } - function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { - Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol"); + function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); } function codeFixActionToCodeAction({ description: description2, changes, commands }) { return { description: description2, changes, commands }; } - function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, preferCapitalized, program, host, preferences, cancellationToken) { + function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSymbol, preferCapitalized, program, host, preferences, cancellationToken) { const getChecker = createGetChecker(program, host); return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => { - if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol) { + if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol && info.some((i) => i.moduleSymbol === moduleSymbol || i.symbol.parent === moduleSymbol)) { return info; } }); } - function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) { + function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program, host) { var _a2, _b; const compilerOptions = program.getCompilerOptions(); const mainProgramInfo = getInfoWithChecker( @@ -139348,7 +140285,7 @@ ${lanes.join("\n")} if (defaultInfo && skipAlias(defaultInfo.symbol, checker) === symbol) { return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; } - const named = checker.tryGetMemberInModuleExportsAndProperties(symbol.name, moduleSymbol); + const named = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); if (named && skipAlias(named, checker) === symbol) { return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0 /* Named */, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; } @@ -139414,7 +140351,7 @@ ${lanes.join("\n")} if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2 /* Error */) { return 2 /* Required */; } - if ((compilerOptions.isolatedModules && compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { + if (importNameElisionDisabled(compilerOptions) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { return 2 /* Required */; } return 1 /* Allowed */; @@ -139898,7 +140835,14 @@ ${lanes.join("\n")} insertImports( changes, sourceFile, - getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport), + getDeclarations( + moduleSpecifier, + quotePreference, + defaultImport, + namedImports, + namespaceLikeImport, + compilerOptions + ), /*blankLineBetween*/ true, preferences @@ -139922,7 +140866,7 @@ ${lanes.join("\n")} return promotedDeclaration.kind === 268 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) { - const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax; + const convertExistingToTypeOnly = importNameElisionDisabled(compilerOptions); switch (aliasDeclaration.kind) { case 273 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { @@ -139996,7 +140940,7 @@ ${lanes.join("\n")} } const promoteFromTypeOnly2 = clause.isTypeOnly && some([defaultImport, ...namedImports], (i) => (i == null ? void 0 : i.addAsTypeOnly) === 4 /* NotAllowed */); const existingSpecifiers = clause.namedBindings && ((_a2 = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a2.elements); - const convertExistingToTypeOnly = promoteFromTypeOnly2 && (compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax); + const convertExistingToTypeOnly = promoteFromTypeOnly2 && importNameElisionDisabled(compilerOptions); if (defaultImport) { Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " }); @@ -140080,11 +141024,11 @@ ${lanes.join("\n")} function needsTypeOnly({ addAsTypeOnly }) { return addAsTypeOnly === 2 /* Required */; } - function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport) { + function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions) { const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference); let statements; if (defaultImport !== void 0 || (namedImports == null ? void 0 : namedImports.length)) { - const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly); + const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || compilerOptions.verbatimModuleSyntax && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */); statements = combine(statements, makeImport( defaultImport && factory.createIdentifier(defaultImport.name), namedImports == null ? void 0 : namedImports.map(({ addAsTypeOnly, name }) => factory.createImportSpecifier( @@ -140207,7 +141151,7 @@ ${lanes.join("\n")} } return !isStringANonContextualKeyword(res) ? res || "_" : `_${res}`; } - var importFixName, importFixId, errorCodes17, ImportFixKind, AddAsTypeOnly; + var importFixName, importFixId, errorCodes17; var init_importFixes = __esm({ "src/services/codefixes/importFixes.ts"() { "use strict"; @@ -140266,20 +141210,6 @@ ${lanes.join("\n")} return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, importAdder.writeFixes)); } }); - ImportFixKind = /* @__PURE__ */ ((ImportFixKind2) => { - ImportFixKind2[ImportFixKind2["UseNamespace"] = 0] = "UseNamespace"; - ImportFixKind2[ImportFixKind2["JsdocTypeImport"] = 1] = "JsdocTypeImport"; - ImportFixKind2[ImportFixKind2["AddToExisting"] = 2] = "AddToExisting"; - ImportFixKind2[ImportFixKind2["AddNew"] = 3] = "AddNew"; - ImportFixKind2[ImportFixKind2["PromoteTypeOnly"] = 4] = "PromoteTypeOnly"; - return ImportFixKind2; - })(ImportFixKind || {}); - AddAsTypeOnly = /* @__PURE__ */ ((AddAsTypeOnly2) => { - AddAsTypeOnly2[AddAsTypeOnly2["Allowed"] = 1] = "Allowed"; - AddAsTypeOnly2[AddAsTypeOnly2["Required"] = 2] = "Required"; - AddAsTypeOnly2[AddAsTypeOnly2["NotAllowed"] = 4] = "NotAllowed"; - return AddAsTypeOnly2; - })(AddAsTypeOnly || {}); } }); @@ -140732,7 +141662,7 @@ ${lanes.join("\n")} } function updateExport(changes, program, sourceFile, node, names) { const namedExports = node.exportClause && isNamedExports(node.exportClause) ? node.exportClause.elements : factory.createNodeArray([]); - const allowTypeModifier = !node.isTypeOnly && !!(program.getCompilerOptions().isolatedModules || find(namedExports, (e) => e.isTypeOnly)); + const allowTypeModifier = !node.isTypeOnly && !!(getIsolatedModules(program.getCompilerOptions()) || find(namedExports, (e) => e.isTypeOnly)); changes.replaceNode( sourceFile, node, @@ -140764,7 +141694,7 @@ ${lanes.join("\n")} factory.createNamedExports(createExportSpecifiers( names, /*allowTypeModifier*/ - !!program.getCompilerOptions().isolatedModules + getIsolatedModules(program.getCompilerOptions()) )), /*moduleSpecifier*/ void 0, @@ -141727,7 +142657,7 @@ ${lanes.join("\n")} } if (isObjectLiteralType(type)) { const props = map(checker.getPropertiesOfType(type), (prop) => { - const initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration), enclosingDeclaration) : createUndefined(); + const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), enclosingDeclaration); return factory.createPropertyAssignment(prop.name, initializer); }); return factory.createObjectLiteralExpression( @@ -142294,8 +143224,8 @@ ${lanes.join("\n")} var init_fixModuleAndTargetOptions = __esm({ "src/services/codefixes/fixModuleAndTargetOptions.ts"() { "use strict"; - init_ts_codefix(); init_ts4(); + init_ts_codefix(); registerCodeFix({ errorCodes: [ Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code, @@ -145048,13 +145978,7 @@ ${lanes.join("\n")} function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) { if (length(signatures)) { const type = checker.getUnionType(map(signatures, checker.getReturnTypeOfSignature)); - return checker.typeToTypeNode( - type, - enclosingDeclaration, - /*flags*/ - void 0, - getNoopSymbolTrackerWithResolver(context) - ); + return checker.typeToTypeNode(type, enclosingDeclaration, 1 /* NoTruncation */, getNoopSymbolTrackerWithResolver(context)); } } function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType, quotePreference, body) { @@ -145346,7 +146270,14 @@ ${lanes.join("\n")} changeTracker.replaceNode(file, declaration, property); } function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { - const assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); + let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); + if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) { + if (assignment === declaration) + assignment = factory.cloneNode(assignment); + assignment.modifiers = void 0; + assignment.questionToken = void 0; + assignment.exclamationToken = void 0; + } changeTracker.replacePropertyAssignment(file, declaration, assignment); } function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { @@ -146475,7 +147406,7 @@ ${lanes.join("\n")} return !!(origin && origin.kind === 32 /* ResolvedExport */); } function originIncludesSymbolName(origin) { - return originIsExport(origin) || originIsResolvedExport(origin); + return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin); } function originIsPackageJsonImport(origin) { return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson; @@ -146495,6 +147426,9 @@ ${lanes.join("\n")} function originIsIgnore(origin) { return !!(origin && origin.kind & 256 /* Ignore */); } + function originIsComputedPropertyName(origin) { + return !!(origin && origin.kind & 512 /* ComputedPropertyName */); + } function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) { var _a2, _b, _c; const start = timestamp(); @@ -146537,7 +147471,7 @@ ${lanes.join("\n")} return result2 || (needsFullResolution ? "failed" : "skipped"); } } - function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) { + function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) { var _a2; const { previousToken } = getRelevantTokens(position, sourceFile); if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) { @@ -146559,7 +147493,7 @@ ${lanes.join("\n")} } else { incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear(); } - const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences); + const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol); if (stringCompletions) { return stringCompletions; } @@ -146583,19 +147517,19 @@ ${lanes.join("\n")} return void 0; } switch (completionData.kind) { - case CompletionDataKind.Data: - const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position); + case 0 /* Data */: + const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol); if (response == null ? void 0 : response.isIncomplete) { incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response); } return response; - case CompletionDataKind.JsDocTagName: + case 1 /* JsDocTagName */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocTagNameCompletions()); - case CompletionDataKind.JsDocTag: + case 2 /* JsDocTag */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocTagCompletions()); - case CompletionDataKind.JsDocParameterName: + case 3 /* JsDocParameterName */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocParameterNameCompletions(completionData.tag)); - case CompletionDataKind.Keywords: + case 4 /* Keywords */: return specificKeywordCompletionInfo(completionData.keywordCompletions, completionData.isNewIdentifierLocation); default: return Debug.assertNever(completionData); @@ -146698,7 +147632,7 @@ ${lanes.join("\n")} } function keywordCompletionData(keywordFilters, filterOutTsOnlyKeywords, isNewIdentifierLocation) { return { - kind: CompletionDataKind.Keywords, + kind: 4 /* Keywords */, keywordCompletions: getKeywordCompletions(keywordFilters, filterOutTsOnlyKeywords), isNewIdentifierLocation }; @@ -146714,7 +147648,7 @@ ${lanes.join("\n")} function getOptionalReplacementSpan(location) { return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0; } - function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) { + function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) { const { symbols, contextToken, @@ -146788,7 +147722,8 @@ ${lanes.join("\n")} symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, - isRightOfOpenTag + isRightOfOpenTag, + includeSymbol ); if (keywordFilters !== 0 /* None */) { for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) { @@ -146928,64 +147863,6 @@ ${lanes.join("\n")} } return void 0; } - function newCaseClauseTracker(checker, clauses) { - const existingStrings = /* @__PURE__ */ new Set(); - const existingNumbers = /* @__PURE__ */ new Set(); - const existingBigInts = /* @__PURE__ */ new Set(); - for (const clause of clauses) { - if (!isDefaultClause(clause)) { - if (isLiteralExpression(clause.expression)) { - const expression = clause.expression; - switch (expression.kind) { - case 14 /* NoSubstitutionTemplateLiteral */: - case 10 /* StringLiteral */: - existingStrings.add(expression.text); - break; - case 8 /* NumericLiteral */: - existingNumbers.add(parseInt(expression.text)); - break; - case 9 /* BigIntLiteral */: - const parsedBigInt = parseBigInt(endsWith(expression.text, "n") ? expression.text.slice(0, -1) : expression.text); - if (parsedBigInt) { - existingBigInts.add(pseudoBigIntToString(parsedBigInt)); - } - break; - } - } else { - const symbol = checker.getSymbolAtLocation(clause.expression); - if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { - const enumValue = checker.getConstantValue(symbol.valueDeclaration); - if (enumValue !== void 0) { - addValue(enumValue); - } - } - } - } - } - return { - addValue, - hasValue - }; - function addValue(value) { - switch (typeof value) { - case "string": - existingStrings.add(value); - break; - case "number": - existingNumbers.add(value); - } - } - function hasValue(value) { - switch (typeof value) { - case "string": - return existingStrings.has(value); - case "number": - return existingNumbers.has(value); - case "object": - return existingBigInts.has(pseudoBigIntToString(value)); - } - } - } function typeNodeToExpression(typeNode, languageVersion, quotePreference) { switch (typeNode.kind) { case 180 /* TypeReference */: @@ -147033,9 +147910,9 @@ ${lanes.join("\n")} } function isMemberCompletionKind(kind) { switch (kind) { - case CompletionKind.ObjectPropertyDeclaration: - case CompletionKind.MemberLike: - case CompletionKind.PropertyAccess: + case 0 /* ObjectPropertyDeclaration */: + case 3 /* MemberLike */: + case 2 /* PropertyAccess */: return true; default: return false; @@ -147095,7 +147972,7 @@ ${lanes.join("\n")} function createCompletionEntryForLiteral(sourceFile, preferences, literal) { return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } - function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { + function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) { let insertText; let replacementSpan = getReplacementSpanForContextToken(replacementToken); let data; @@ -147139,7 +148016,9 @@ ${lanes.join("\n")} } awaitText += `(await ${propertyAccessToConvert.expression.getText()})`; insertText = needsConvertPropertyAccess ? `${awaitText}${insertText}` : `${awaitText}${insertQuestionDot ? "?." : "."}${insertText}`; - replacementSpan = createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end); + const isInAwaitExpression = tryCast(propertyAccessToConvert.parent, isAwaitExpression); + const wrapNode = isInAwaitExpression ? propertyAccessToConvert.parent : propertyAccessToConvert.expression; + replacementSpan = createTextSpanFromBounds(wrapNode.getStart(sourceFile), propertyAccessToConvert.end); } if (originIsResolvedExport(origin)) { sourceDisplay = [textPart(origin.moduleSpecifier)]; @@ -147151,7 +148030,7 @@ ${lanes.join("\n")} if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) { hasAction = true; } - if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) { + if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) { let importAdder; ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext)); sortText = SortText.ClassMemberSnippets; @@ -147173,7 +148052,7 @@ ${lanes.join("\n")} let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces"; const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) { - if (type.flags & 402653316 /* StringLike */ || type.flags & 1048576 /* Union */ && every(type.types, (type2) => !!(type2.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)))) { + if (type.flags & 402653316 /* StringLike */ || type.flags & 1048576 /* Union */ && every(type.types, (type2) => !!(type2.flags & (402653316 /* StringLike */ | 32768 /* Undefined */) || isStringAndEmptyAnonymousObjectIntersection(type2)))) { insertText = `${escapeSnippetText(name)}=${quote(sourceFile, preferences, "$1")}`; isSnippet = true; } else { @@ -147207,7 +148086,8 @@ ${lanes.join("\n")} isSnippet, isPackageJsonImport: originIsPackageJsonImport(origin) || void 0, isImportStatementCompletion: !!importStatementCompletion || void 0, - data + data, + ...includeSymbol ? { symbol } : void 0 }; } function isClassLikeMemberCompletion(symbol, location, sourceFile) { @@ -147275,7 +148155,7 @@ ${lanes.join("\n")} if (isAbstract) { requiredModifiers |= 256 /* Abstract */; } - if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) { + if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) { requiredModifiers |= 16384 /* Override */; } if (!completionNodes.length) { @@ -147581,6 +148461,7 @@ ${lanes.join("\n")} if (originIsResolvedExport(origin)) { const resolvedData = { exportName: origin.exportName, + exportMapKey: origin.exportMapKey, moduleSpecifier: origin.moduleSpecifier, ambientModuleName, fileName: origin.fileName, @@ -147604,6 +148485,7 @@ ${lanes.join("\n")} const resolvedOrigin = { kind: 32 /* ResolvedExport */, exportName: data.exportName, + exportMapKey: data.exportMapKey, moduleSpecifier: data.moduleSpecifier, symbolName: completionName, fileName: data.fileName, @@ -147627,7 +148509,7 @@ ${lanes.join("\n")} } function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) { const replacementSpan = importStatementCompletion.replacementSpan; - const quotedModuleSpecifier = quote(sourceFile, preferences, origin.moduleSpecifier); + const quotedModuleSpecifier = quote(sourceFile, preferences, escapeSnippetText(origin.moduleSpecifier)); const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */; const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : ""; const importKind = ts_codefix_exports.getImportKind( @@ -147675,7 +148557,7 @@ ${lanes.join("\n")} return "TypeOnlyAlias/" /* TypeOnlyAlias */; } } - function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { + function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) { var _a2; const start = timestamp(); const variableDeclaration = getVariableDeclaration(location); @@ -147686,7 +148568,7 @@ ${lanes.join("\n")} const symbol = symbols[i]; const origin = symbolToOriginInfoMap == null ? void 0 : symbolToOriginInfoMap[i]; const info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected); - if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === CompletionKind.Global && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) { + if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 /* Global */ && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) { continue; } const { name, needsConvertPropertyAccess } = info; @@ -147715,7 +148597,8 @@ ${lanes.join("\n")} kind, formatContext, isJsxIdentifierExpected, - isRightOfOpenTag + isRightOfOpenTag, + includeSymbol ); if (!entry) { continue; @@ -147825,7 +148708,7 @@ ${lanes.join("\n")} if (!completionData) { return { type: "none" }; } - if (completionData.kind !== CompletionDataKind.Data) { + if (completionData.kind !== 0 /* Data */) { return { type: "request", request: completionData }; } const { symbols, literals, location, completionKind, symbolToOriginInfoMap, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } = completionData; @@ -147851,13 +148734,13 @@ ${lanes.join("\n")} case "request": { const { request } = symbolCompletion; switch (request.kind) { - case CompletionDataKind.JsDocTagName: + case 1 /* JsDocTagName */: return ts_JsDoc_exports.getJSDocTagNameCompletionDetails(name); - case CompletionDataKind.JsDocTag: + case 2 /* JsDocTag */: return ts_JsDoc_exports.getJSDocTagCompletionDetails(name); - case CompletionDataKind.JsDocParameterName: + case 3 /* JsDocParameterName */: return ts_JsDoc_exports.getJSDocParameterNameCompletionDetails(name); - case CompletionDataKind.Keywords: + case 4 /* Keywords */: return some(request.keywordCompletions, (c) => c.name === name) ? createSimpleDetails(name, "keyword" /* keyword */, 5 /* keyword */) : void 0; default: return Debug.assertNever(request); @@ -147866,7 +148749,8 @@ ${lanes.join("\n")} case "symbol": { const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion; const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken); - return createCompletionDetailsForSymbol(symbol, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay); + const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name; + return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay); } case "literal": { const { literal } = symbolCompletion; @@ -147917,12 +148801,12 @@ ${lanes.join("\n")} function createSimpleDetails(name, kind, kind2) { return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]); } - function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) { + function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) { const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken( cancellationToken, (checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */) ); - return createCompletionDetails(symbol.name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay); + return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay); } function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) { return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source }; @@ -147982,6 +148866,7 @@ ${lanes.join("\n")} const { moduleSpecifier, codeAction } = ts_codefix_exports.getImportCompletionAction( targetSymbol, moduleSymbol, + data == null ? void 0 : data.exportMapKey, sourceFile, name, isJsxOpeningTagName, @@ -148209,7 +149094,7 @@ ${lanes.join("\n")} break; case 291 /* JsxExpression */: case 290 /* JsxSpreadAttribute */: - if (previousToken.kind === 19 /* CloseBraceToken */ || (previousToken.kind === 79 /* Identifier */ || previousToken.parent.kind === 288 /* JsxAttribute */)) { + if (previousToken.kind === 19 /* CloseBraceToken */ || previousToken.kind === 79 /* Identifier */ && previousToken.parent.kind === 288 /* JsxAttribute */) { isJsxIdentifierExpected = true; } break; @@ -148671,16 +149556,16 @@ ${lanes.join("\n")} if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) { return; } - const firstImportableExportInfo = find(info, isImportableExportInfo); - if (!firstImportableExportInfo) { + info = filter(info, isImportableExportInfo); + if (!info.length) { return; } const result = context.tryResolve(info, isFromAmbientModule) || {}; if (result === "failed") return; - let exportInfo2 = firstImportableExportInfo, moduleSpecifier; + let exportInfo2 = info[0], moduleSpecifier; if (result !== "skipped") { - ({ exportInfo: exportInfo2 = firstImportableExportInfo, moduleSpecifier } = result); + ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result); } const isDefaultExport = exportInfo2.exportKind === 1 /* Default */; const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo2.symbol) || exportInfo2.symbol; @@ -148844,7 +149729,7 @@ ${lanes.join("\n")} return false; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) { - return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken2)), position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2))); + return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2))); } function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() { const typeLiteralNode = tryGetTypeLiteralNode(contextToken); @@ -149019,6 +149904,16 @@ ${lanes.join("\n")} return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type); }); symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags)); + forEach(symbols, (symbol, index) => { + const declaration = symbol == null ? void 0 : symbol.valueDeclaration; + if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) { + const origin = { + kind: 512 /* ComputedPropertyName */, + symbolName: typeChecker.symbolToString(symbol) + }; + symbolToOriginInfoMap[index] = origin; + } + }); } return 1 /* Success */; } @@ -149403,7 +150298,7 @@ ${lanes.join("\n")} } switch (kind) { case 3 /* MemberLike */: - return void 0; + return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0; case 0 /* ObjectPropertyDeclaration */: return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; case 2 /* PropertyAccess */: @@ -149543,7 +150438,7 @@ ${lanes.join("\n")} function getApparentProperties(type, node, checker) { if (!type.isUnion()) return type.getApparentProperties(); - return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 131068 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || typeHasCallOrConstructSignatures(memberType, checker) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())))); + return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 134348796 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())))); } function containsNonPublicProperties(props) { return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 24 /* NonPublicAccessibilityModifier */)); @@ -149863,7 +150758,7 @@ ${lanes.join("\n")} } return charCode; } - var moduleSpecifierResolutionLimit, moduleSpecifierResolutionCacheAttemptLimit, SortText, CompletionSource, SymbolOriginInfoKind, CompletionDataKind, CompletionKind, _keywordCompletions, allKeywordsCompletions; + var moduleSpecifierResolutionLimit, moduleSpecifierResolutionCacheAttemptLimit, SortText, CompletionSource, SymbolOriginInfoKind, CompletionKind, _keywordCompletions, allKeywordsCompletions; var init_completions = __esm({ "src/services/completions.ts"() { "use strict"; @@ -149911,18 +150806,11 @@ ${lanes.join("\n")} SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport"; return SymbolOriginInfoKind2; })(SymbolOriginInfoKind || {}); - CompletionDataKind = /* @__PURE__ */ ((CompletionDataKind2) => { - CompletionDataKind2[CompletionDataKind2["Data"] = 0] = "Data"; - CompletionDataKind2[CompletionDataKind2["JsDocTagName"] = 1] = "JsDocTagName"; - CompletionDataKind2[CompletionDataKind2["JsDocTag"] = 2] = "JsDocTag"; - CompletionDataKind2[CompletionDataKind2["JsDocParameterName"] = 3] = "JsDocParameterName"; - CompletionDataKind2[CompletionDataKind2["Keywords"] = 4] = "Keywords"; - return CompletionDataKind2; - })(CompletionDataKind || {}); CompletionKind = /* @__PURE__ */ ((CompletionKind2) => { CompletionKind2[CompletionKind2["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; CompletionKind2[CompletionKind2["Global"] = 1] = "Global"; @@ -149963,7 +150851,7 @@ ${lanes.join("\n")} values: map2.values.bind(map2) }; } - function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) { + function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) { if (isInReferenceComment(sourceFile, position)) { const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host); return entries && convertPathCompletions(entries); @@ -149972,18 +150860,18 @@ ${lanes.join("\n")} if (!contextToken || !isStringLiteralLike(contextToken)) return void 0; const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences); - return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position); + return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol); } } - function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) { + function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) { if (completion === void 0) { return void 0; } const optionalReplacementSpan = createTextSpanFromStringLiteralLikeContent(contextToken); switch (completion.kind) { - case StringLiteralCompletionKind.Paths: + case 0 /* Paths */: return convertPathCompletions(completion.paths); - case StringLiteralCompletionKind.Properties: { + case 1 /* Properties */: { const entries = createSortedArray(); getCompletionEntriesFromSymbols( completion.symbols, @@ -150001,11 +150889,32 @@ ${lanes.join("\n")} preferences, options, /*formatContext*/ - void 0 + void 0, + /*isTypeOnlyLocation */ + void 0, + /*propertyAccessToConvert*/ + void 0, + /*jsxIdentifierExpected*/ + void 0, + /*isJsxInitializer*/ + void 0, + /*importStatementCompletion*/ + void 0, + /*recommendedCompletion*/ + void 0, + /*symbolToOriginInfoMap*/ + void 0, + /*symbolToSortTextMap*/ + void 0, + /*isJsxIdentifierExpected*/ + void 0, + /*isRightOfOpenTag*/ + void 0, + includeSymbol ); return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries }; } - case StringLiteralCompletionKind.Types: { + case 2 /* Types */: { const entries = completion.types.map((type) => ({ name: type.value, kindModifiers: "" /* none */, @@ -150027,16 +150936,16 @@ ${lanes.join("\n")} } function stringLiteralCompletionDetails(name, location, completion, sourceFile, checker, cancellationToken) { switch (completion.kind) { - case StringLiteralCompletionKind.Paths: { + case 0 /* Paths */: { const match = find(completion.paths, (p) => p.name === name); return match && createCompletionDetails(name, kindModifiersFromExtension(match.extension), match.kind, [textPart(name)]); } - case StringLiteralCompletionKind.Properties: { + case 1 /* Properties */: { const match = find(completion.symbols, (s) => s.name === name); - return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken); + return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken); } - case StringLiteralCompletionKind.Types: - return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "type" /* typeElement */, [textPart(name)]) : void 0; + case 2 /* Types */: + return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0; default: return Debug.assertNever(completion); } @@ -150119,7 +151028,7 @@ ${lanes.join("\n")} if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) { return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent); } - return fromContextualType(); + return fromContextualType() || fromContextualType(0 /* None */); case 209 /* ElementAccessExpression */: { const { expression, argumentExpression } = parent2; if (node === skipParentheses(argumentExpression)) { @@ -150138,11 +151047,23 @@ ${lanes.join("\n")} case 275 /* ExportDeclaration */: case 280 /* ExternalModuleReference */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) }; + case 292 /* CaseClause */: + const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses); + const contextualTypes = fromContextualType(); + if (!contextualTypes) { + return; + } + const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); + return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; default: return fromContextualType(); } - function fromContextualType() { - return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, 4 /* Completions */)), isNewIdentifier: false }; + function fromContextualType(contextFlags = 4 /* Completions */) { + const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); + if (!types.length) { + return; + } + return { kind: 2 /* Types */, types, isNewIdentifier: false }; } } function walkUpParentheses(node) { @@ -150233,12 +151154,12 @@ ${lanes.join("\n")} const mode = isStringLiteralLike(node) ? getModeForUsageLocation(sourceFile, node) : void 0; const scriptPath = sourceFile.path; const scriptDirectory = getDirectoryPath(scriptPath); - const extensionOptions = getExtensionOptions(compilerOptions, ReferenceKind.ModuleSpecifier, sourceFile, preferences, mode); + const extensionOptions = getExtensionOptions(compilerOptions, 1 /* ModuleSpecifier */, sourceFile, typeChecker, preferences, mode); return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, compilerOptions, host, extensionOptions, typeChecker); } - function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, preferences, resolutionMode) { + function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, typeChecker, preferences, resolutionMode) { return { - extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions)), + extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker)), referenceKind, importingSourceFile, endingPreference: preferences == null ? void 0 : preferences.importModuleSpecifierEnding, @@ -150268,8 +151189,17 @@ ${lanes.join("\n")} ).values()); } } - function getSupportedExtensionsForModuleResolution(compilerOptions) { - const extensions = getSupportedExtensions(compilerOptions); + function getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker) { + const ambientModulesExtensions = !typeChecker ? [] : mapDefined( + typeChecker.getAmbientModules(), + (module2) => { + const name = module2.name.slice(1, -1); + if (!name.startsWith("*.") || name.includes("/")) + return; + return name.slice(1); + } + ); + const extensions = [...getSupportedExtensions(compilerOptions), ambientModulesExtensions]; const moduleResolution = getEmitModuleResolutionKind(compilerOptions); return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) : extensions; } @@ -150740,7 +151670,7 @@ ${lanes.join("\n")} function isRequireCallArgument(node) { return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require"; } - var kindPrecedence, StringLiteralCompletionKind, ReferenceKind, tripleSlashDirectiveFragmentRegex, nodeModulesDependencyKeys; + var kindPrecedence, tripleSlashDirectiveFragmentRegex, nodeModulesDependencyKeys; var init_stringCompletions = __esm({ "src/services/stringCompletions.ts"() { "use strict"; @@ -150751,17 +151681,6 @@ ${lanes.join("\n")} ["script" /* scriptElement */]: 1, ["external module name" /* externalModuleName */]: 2 }; - StringLiteralCompletionKind = /* @__PURE__ */ ((StringLiteralCompletionKind2) => { - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Paths"] = 0] = "Paths"; - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Properties"] = 1] = "Properties"; - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Types"] = 2] = "Types"; - return StringLiteralCompletionKind2; - })(StringLiteralCompletionKind || {}); - ReferenceKind = /* @__PURE__ */ ((ReferenceKind2) => { - ReferenceKind2[ReferenceKind2["Filename"] = 0] = "Filename"; - ReferenceKind2[ReferenceKind2["ModuleSpecifier"] = 1] = "ModuleSpecifier"; - return ReferenceKind2; - })(ReferenceKind || {}); tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* ` * ${c}`).join("\n")} if (isExpression(body)) { const returnStatement = factory.createReturnStatement(body); const file = body.getSourceFile(); + setTextRange(returnStatement, body); suppressLeadingAndTrailingTrivia(returnStatement); copyTrailingAsLeadingComments( body, @@ -159240,10 +160156,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const scopeDescription = isFunctionLikeDeclaration(scope) ? getDescriptionForFunctionLikeDeclaration(scope) : isClassLike(scope) ? getDescriptionForClassLikeDeclaration(scope) : getDescriptionForModuleLikeDeclaration(scope); let functionDescription; let constantDescription; - if (scopeDescription === SpecialScope.Global) { + if (scopeDescription === 1 /* Global */) { functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "global"]); constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "global"]); - } else if (scopeDescription === SpecialScope.Module) { + } else if (scopeDescription === 0 /* Module */) { functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "module"]); constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "module"]); } else { @@ -159309,7 +160225,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return scope.kind === 260 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 265 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global; + return scope.kind === 265 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations, range, context) { const checker = context.program.getTypeChecker(); @@ -159342,7 +160258,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} typeNode ); parameters.push(paramDecl); - if (usage.usage === Usage.Write) { + if (usage.usage === 2 /* Write */) { (writes || (writes = [])).push(usage); } callArguments.push(factory.createIdentifier(name)); @@ -160300,7 +161216,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isStringLiteralJsxAttribute(node) { return isStringLiteral(node) && node.parent && isJsxAttribute(node.parent); } - var refactorName11, extractConstantAction, extractFunctionAction, Messages, RangeFacts, SpecialScope, Usage; + var refactorName11, extractConstantAction, extractFunctionAction, Messages, RangeFacts; var init_extractSymbol = __esm({ "src/services/refactors/extractSymbol.ts"() { "use strict"; @@ -160363,16 +161279,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} RangeFacts2[RangeFacts2["InStaticRegion"] = 32] = "InStaticRegion"; return RangeFacts2; })(RangeFacts || {}); - SpecialScope = /* @__PURE__ */ ((SpecialScope2) => { - SpecialScope2[SpecialScope2["Module"] = 0] = "Module"; - SpecialScope2[SpecialScope2["Global"] = 1] = "Global"; - return SpecialScope2; - })(SpecialScope || {}); - Usage = /* @__PURE__ */ ((Usage2) => { - Usage2[Usage2["Read"] = 1] = "Read"; - Usage2[Usage2["Write"] = 2] = "Write"; - return Usage2; - })(Usage || {}); } }); @@ -160804,7 +161710,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!candidateInfo) { return isSourceFileJS(sourceFile) ? createJSSignatureHelpItems(argumentInfo, program, cancellationToken) : void 0; } - return typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => candidateInfo.kind === CandidateOrTypeKind.Candidate ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2)); + return typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => candidateInfo.kind === 0 /* Candidate */ ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2)); } function getCandidateOrTypeInfo({ invocation, argumentCount }, checker, sourceFile, startingToken, onlyUseSyntacticOwners) { switch (invocation.kind) { @@ -161276,16 +162182,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }); return { name: typeParameter.symbol.name, documentation: typeParameter.symbol.getDocumentationComment(checker), displayParts, isOptional: false, isRest: false }; } - var CandidateOrTypeKind, signatureHelpNodeBuilderFlags, separatorDisplayParts; + var signatureHelpNodeBuilderFlags, separatorDisplayParts; var init_signatureHelp = __esm({ "src/services/signatureHelp.ts"() { "use strict"; init_ts4(); - CandidateOrTypeKind = /* @__PURE__ */ ((CandidateOrTypeKind2) => { - CandidateOrTypeKind2[CandidateOrTypeKind2["Candidate"] = 0] = "Candidate"; - CandidateOrTypeKind2[CandidateOrTypeKind2["Type"] = 1] = "Type"; - return CandidateOrTypeKind2; - })(CandidateOrTypeKind || {}); signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; separatorDisplayParts = [punctuationPart(27 /* CommaToken */), spacePart()]; } @@ -164596,8 +165497,8 @@ ${options.prefix}` : "\n" : options.prefix var init_rules = __esm({ "src/services/formatting/rules.ts"() { "use strict"; - init_ts_formatting(); init_ts4(); + init_ts_formatting(); } }); @@ -165157,7 +166058,7 @@ ${options.prefix}` : "\n" : options.prefix } function processChildNode(child, inheritedIndentation, parent2, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { Debug.assert(!nodeIsSynthesized(child)); - if (nodeIsMissing(child)) { + if (nodeIsMissing(child) || isGrammarError(parent2, child)) { return inheritedIndentation; } const childStartPos = child.getStart(sourceFile); @@ -165290,7 +166191,7 @@ ${options.prefix}` : "\n" : options.prefix if (currentTokenInfo.leadingTrivia) { processTrivia(currentTokenInfo.leadingTrivia, parent2, childContextNode, dynamicIndentation); } - let lineAction = LineAction.None; + let lineAction = 0 /* None */; const isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); const tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); if (isTokenInRange) { @@ -165298,11 +166199,11 @@ ${options.prefix}` : "\n" : options.prefix const savePreviousRange = previousRange; lineAction = processRange(currentTokenInfo.token, tokenStart, parent2, childContextNode, dynamicIndentation); if (!rangeHasError) { - if (lineAction === LineAction.None) { + if (lineAction === 0 /* None */) { const prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line; indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine; } else { - indentToken = lineAction === LineAction.LineAdded; + indentToken = lineAction === 1 /* LineAdded */; } } } @@ -165328,7 +166229,7 @@ ${options.prefix}` : "\n" : options.prefix ); } if (tokenIndentation !== -1 /* Unknown */ && indentNextTokenOrTrivia) { - insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === LineAction.LineAdded); + insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === 1 /* LineAdded */); lastIndentedLine = tokenStart.line; indentationOnLastIndentedLine = tokenIndentation; } @@ -165375,7 +166276,7 @@ ${options.prefix}` : "\n" : options.prefix } function processRange(range, rangeStart, parent2, contextNode, dynamicIndentation) { const rangeHasError = rangeContainsError(range); - let lineAction = LineAction.None; + let lineAction = 0 /* None */; if (!rangeHasError) { if (!previousRange) { const originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); @@ -165394,13 +166295,13 @@ ${options.prefix}` : "\n" : options.prefix formattingContext.updateContext(previousItem, previousParent2, currentItem, currentParent, contextNode); const rules = getRules(formattingContext); let trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; - let lineAction = LineAction.None; + let lineAction = 0 /* None */; if (rules) { forEachRight(rules, (rule2) => { lineAction = applyRuleEdits(rule2, previousItem, previousStartLine, currentItem, currentStartLine); if (dynamicIndentation) { switch (lineAction) { - case LineAction.LineRemoved: + case 2 /* LineRemoved */: if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation( /*lineAddedByFormatting*/ @@ -165409,7 +166310,7 @@ ${options.prefix}` : "\n" : options.prefix ); } break; - case LineAction.LineAdded: + case 1 /* LineAdded */: if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation( /*lineAddedByFormatting*/ @@ -165419,7 +166320,7 @@ ${options.prefix}` : "\n" : options.prefix } break; default: - Debug.assert(lineAction === LineAction.None); + Debug.assert(lineAction === 0 /* None */); } } trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule2.action & 16 /* DeleteSpace */) && rule2.flags !== 1 /* CanDeleteNewLines */; @@ -165566,11 +166467,11 @@ ${options.prefix}` : "\n" : options.prefix const onLaterLine = currentStartLine !== previousStartLine; switch (rule2.action) { case 1 /* StopProcessingSpaceActions */: - return LineAction.None; + return 0 /* None */; case 16 /* DeleteSpace */: if (previousRange2.end !== currentRange.pos) { recordDelete(previousRange2.end, currentRange.pos - previousRange2.end); - return onLaterLine ? LineAction.LineRemoved : LineAction.None; + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 32 /* DeleteToken */: @@ -165578,28 +166479,28 @@ ${options.prefix}` : "\n" : options.prefix break; case 8 /* InsertNewLine */: if (rule2.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return LineAction.None; + return 0 /* None */; } const lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, getNewLineOrDefaultFromHost(host, options)); - return onLaterLine ? LineAction.None : LineAction.LineAdded; + return onLaterLine ? 0 /* None */ : 1 /* LineAdded */; } break; case 4 /* InsertSpace */: if (rule2.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return LineAction.None; + return 0 /* None */; } const posDelta = currentRange.pos - previousRange2.end; if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange2.end) !== 32 /* space */) { recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, " "); - return onLaterLine ? LineAction.LineRemoved : LineAction.None; + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 64 /* InsertTrailingSemicolon */: recordInsert(previousRange2.end, ";"); } - return LineAction.None; + return 0 /* None */; } } function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenAtPosition = getTokenAtPosition(sourceFile, position)) { @@ -165725,18 +166626,12 @@ ${options.prefix}` : "\n" : options.prefix return remainder ? spacesString + repeatString(" ", remainder) : spacesString; } } - var LineAction, internedSizes, internedTabsIndentation, internedSpacesIndentation; + var internedSizes, internedTabsIndentation, internedSpacesIndentation; var init_formatting = __esm({ "src/services/formatting/formatting.ts"() { "use strict"; init_ts4(); init_ts_formatting(); - LineAction = /* @__PURE__ */ ((LineAction2) => { - LineAction2[LineAction2["None"] = 0] = "None"; - LineAction2[LineAction2["LineAdded"] = 1] = "LineAdded"; - LineAction2[LineAction2["LineRemoved"] = 2] = "LineRemoved"; - return LineAction2; - })(LineAction || {}); } }); @@ -165840,7 +166735,7 @@ ${options.prefix}` : "\n" : options.prefix )) { const currentStart = getStartLineAndCharacterForNode(current, sourceFile); const nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); - const indentationDelta = nextTokenKind !== NextTokenKind.Unknown ? assumeNewLineBeforeCloseBrace && nextTokenKind === NextTokenKind.CloseBrace ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; + const indentationDelta = nextTokenKind !== 0 /* Unknown */ ? assumeNewLineBeforeCloseBrace && nextTokenKind === 2 /* CloseBrace */ ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; return getIndentationForNodeWorker( current, currentStart, @@ -167009,8 +167904,8 @@ ${options.prefix}` : "\n" : options.prefix var init_scriptInfo = __esm({ "src/server/scriptInfo.ts"() { "use strict"; - init_ts_server2(); init_ts6(); + init_ts_server2(); TextStorage = class { constructor(host, info, initialVersion) { this.host = host; @@ -167700,8 +168595,8 @@ ${options.prefix}` : "\n" : options.prefix "src/server/project.ts"() { "use strict"; init_ts6(); - init_ts_server2(); init_ts6(); + init_ts_server2(); ProjectKind = /* @__PURE__ */ ((ProjectKind2) => { ProjectKind2[ProjectKind2["Inferred"] = 0] = "Inferred"; ProjectKind2[ProjectKind2["Configured"] = 1] = "Configured"; @@ -170041,8 +170936,8 @@ ${options.prefix}` : "\n" : options.prefix var init_editorServices = __esm({ "src/server/editorServices.ts"() { "use strict"; - init_ts_server2(); init_ts6(); + init_ts_server2(); maxProgramSizeForNonTsFiles = 20 * 1024 * 1024; maxFileSize = 4 * 1024 * 1024; ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground"; @@ -173493,6 +174388,10 @@ ${json}${newLine}`; continue; if (isLocationProjectReferenceRedirect(project, location)) continue; + updateProjectIfDirty(project); + if (!project.containsFile(toNormalizedPath(location.fileName))) { + continue; + } const projectResults = searchPosition(project, location); resultsMap.set(project, projectResults != null ? projectResults : emptyArray2); searchedProjectKeys.add(getProjectKey(project)); @@ -177648,6 +178547,7 @@ ${e.message}`; consumesNodeCoreModules: () => consumesNodeCoreModules, contains: () => contains, containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, containsParseError: () => containsParseError, containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, @@ -177986,6 +178886,7 @@ ${e.message}`; getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, getCompilerOptionValue: () => getCompilerOptionValue, getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, getConstantValue: () => getConstantValue, getContainerNode: () => getContainerNode, @@ -178667,6 +179568,7 @@ ${e.message}`; isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, isGlobalDeclaration: () => isGlobalDeclaration, isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, + isGrammarError: () => isGrammarError, isHeritageClause: () => isHeritageClause, isHoistedFunction: () => isHoistedFunction, isHoistedVariableStatement: () => isHoistedVariableStatement, @@ -179009,6 +179911,7 @@ ${e.message}`; isString: () => isString, isStringAKeyword: () => isStringAKeyword, isStringANonContextualKeyword: () => isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, isStringDoubleQuoted: () => isStringDoubleQuoted, isStringLiteral: () => isStringLiteral, isStringLiteralLike: () => isStringLiteralLike, @@ -179173,6 +180076,7 @@ ${e.message}`; mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newCaseClauseTracker: () => newCaseClauseTracker, newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, @@ -179546,7 +180450,6 @@ ${e.message}`; typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, typeAliasNamePart: () => typeAliasNamePart, typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, - typeHasCallOrConstructSignatures: () => typeHasCallOrConstructSignatures, typeKeywords: () => typeKeywords, typeParameterNamePart: () => typeParameterNamePart, typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter, @@ -180004,6 +180907,7 @@ ${e.message}`; consumesNodeCoreModules: () => consumesNodeCoreModules, contains: () => contains, containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, containsParseError: () => containsParseError, containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, @@ -180342,6 +181246,7 @@ ${e.message}`; getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, getCompilerOptionValue: () => getCompilerOptionValue, getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, getConstantValue: () => getConstantValue, getContainerNode: () => getContainerNode, @@ -181023,6 +181928,7 @@ ${e.message}`; isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, isGlobalDeclaration: () => isGlobalDeclaration, isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, + isGrammarError: () => isGrammarError, isHeritageClause: () => isHeritageClause, isHoistedFunction: () => isHoistedFunction, isHoistedVariableStatement: () => isHoistedVariableStatement, @@ -181365,6 +182271,7 @@ ${e.message}`; isString: () => isString, isStringAKeyword: () => isStringAKeyword, isStringANonContextualKeyword: () => isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, isStringDoubleQuoted: () => isStringDoubleQuoted, isStringLiteral: () => isStringLiteral, isStringLiteralLike: () => isStringLiteralLike, @@ -181529,6 +182436,7 @@ ${e.message}`; mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newCaseClauseTracker: () => newCaseClauseTracker, newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, @@ -181902,7 +182810,6 @@ ${e.message}`; typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, typeAliasNamePart: () => typeAliasNamePart, typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, - typeHasCallOrConstructSignatures: () => typeHasCallOrConstructSignatures, typeKeywords: () => typeKeywords, typeParameterNamePart: () => typeParameterNamePart, typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter, diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index e973a18179380..2201712f7c4eb 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -2335,6 +2335,7 @@ declare namespace ts { } interface TypeChecker { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; + getTypeOfSymbol(symbol: Symbol): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; @@ -2425,6 +2426,21 @@ declare namespace ts { getApparentType(type: Type): Type; getBaseConstraintOfType(type: Type): Type | undefined; getDefaultFromTypeParameter(type: Type): Type | undefined; + /** + * True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts. + * This function will _not_ return true if passed a type which + * extends `Array` (for example, the TypeScript AST's `NodeArray` type). + */ + isArrayType(type: Type): boolean; + /** + * True if this type is a tuple type. This function will _not_ return true if + * passed a type which extends from a tuple. + */ + isTupleType(type: Type): boolean; + /** + * True if this type is assignable to `ReadonlyArray`. + */ + isArrayLikeType(type: Type): boolean; getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined; /** * Depending on the operation performed, it may be appropriate to throw away the checker @@ -2684,7 +2700,8 @@ declare namespace ts { TemplateLiteral = 134217728, StringMapping = 268435456, Literal = 2944, - Unit = 109440, + Unit = 109472, + Freshable = 2976, StringOrNumberLiteral = 384, PossiblyFalsy = 117724, StringLike = 402653316, @@ -2736,10 +2753,12 @@ declare namespace ts { isClass(): this is InterfaceType; isIndexType(): this is IndexType; } - interface LiteralType extends Type { + interface FreshableType extends Type { + freshType: FreshableType; + regularType: FreshableType; + } + interface LiteralType extends FreshableType { value: string | number | PseudoBigInt; - freshType: LiteralType; - regularType: LiteralType; } interface UniqueESSymbolType extends Type { symbol: Symbol; @@ -2754,7 +2773,7 @@ declare namespace ts { interface BigIntLiteralType extends LiteralType { value: PseudoBigInt; } - interface EnumType extends Type { + interface EnumType extends FreshableType { } enum ObjectFlags { None = 0, @@ -4698,7 +4717,6 @@ declare namespace ts { parent: ConstructorDeclaration; name: Identifier; }; - function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean; /** @deprecated */ function createUnparsedSourceFile(text: string): UnparsedSource; /** @deprecated */ @@ -5153,7 +5171,6 @@ declare namespace ts { function bundlerModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; - function shouldAllowImportingTsExtension(compilerOptions: CompilerOptions, fromFileName?: string): boolean | "" | undefined; interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache, NonRelativeNameResolutionCache, PackageJsonInfoCache { } interface ModeAwareCache { @@ -6154,6 +6171,13 @@ declare namespace ts { */ triggerCharacter?: CompletionsTriggerCharacter; triggerKind?: CompletionTriggerKind; + /** + * Include a `symbol` property on each completion entry object. + * Symbols reference cyclic data structures and sometimes an entire TypeChecker instance, + * so use caution when serializing or retaining completion entries retrieved with this option. + * @default false + */ + includeSymbol?: boolean; /** @deprecated Use includeCompletionsForModuleExports */ includeExternalModuleExports?: boolean; /** @deprecated Use includeCompletionsWithInsertText */ @@ -6674,6 +6698,7 @@ declare namespace ts { * in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default. */ exportName: string; + exportMapKey?: string; moduleSpecifier?: string; /** The file name declaring the export's module symbol, if it was an external module */ fileName?: string; @@ -6683,7 +6708,6 @@ declare namespace ts { isPackageJsonImport?: true; } interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport { - /** The key in the `ExportMapCache` where the completion entry's `SymbolExportInfo[]` is found */ exportMapKey: string; } interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport { @@ -6711,6 +6735,12 @@ declare namespace ts { isFromUncheckedFile?: true; isPackageJsonImport?: true; isImportStatementCompletion?: true; + /** + * For API purposes. + * Included for non-string completions only when `includeSymbol: true` option is passed to `getCompletionsAtPosition`. + * @example Get declaration of completion: `symbol.valueDeclaration` + */ + symbol?: Symbol; /** * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`, * that allows TS Server to look up the symbol represented by the completion item, disambiguating diff --git a/lib/typescript.js b/lib/typescript.js index cdd6065a75b05..4b53c156ee249 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -18,17 +18,10 @@ and limitations under the License. var ts = (() => { var __defProp = Object.defineProperty; var __getOwnPropNames = Object.getOwnPropertyNames; - var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { - get: (a, b) => (typeof require !== "undefined" ? require : a)[b] - }) : x)(function(x) { - if (typeof require !== "undefined") - return require.apply(this, arguments); - throw new Error('Dynamic require of "' + x + '" is not supported'); - }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; - var __commonJS = (cb, mod) => function __require2() { + var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { @@ -42,7 +35,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = `${versionMajorMinor}.0-beta`; + version = `${versionMajorMinor}.1-rc`; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -3123,7 +3116,7 @@ ${lanes.join("\n")} init_ts2(); nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performance; - timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +new Date(); + timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date(); } }); @@ -3196,6 +3189,9 @@ ${lanes.join("\n")} counts.set(markName, count + 1); marks.set(markName, timestamp()); performanceImpl == null ? void 0 : performanceImpl.mark(markName); + if (typeof onProfilerEvent === "function") { + onProfilerEvent(markName); + } } } function measure(measureName, startMarkName, endMarkName) { @@ -4481,13 +4477,14 @@ ${lanes.join("\n")} TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; - TypeFlags2[TypeFlags2["Unit"] = 109440] = "Unit"; + TypeFlags2[TypeFlags2["Unit"] = 109472] = "Unit"; + TypeFlags2[TypeFlags2["Freshable"] = 2976] = "Freshable"; TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; - TypeFlags2[TypeFlags2["Primitive"] = 131068] = "Primitive"; + TypeFlags2[TypeFlags2["Primitive"] = 134348796] = "Primitive"; TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; @@ -5496,7 +5493,7 @@ ${lanes.join("\n")} function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { const watcher = fsWatch( dirName, - FileSystemEntryKind.Directory, + 1 /* Directory */, (_eventName, relativeFileName, modifiedTime) => { if (!isString(relativeFileName)) return; @@ -5694,7 +5691,7 @@ ${lanes.join("\n")} } function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { const parentWatcher = cache.get(dirPath); - if (parentWatcher && fileSystemEntryExists(dirName, FileSystemEntryKind.Directory)) { + if (parentWatcher && fileSystemEntryExists(dirName, 1 /* Directory */)) { scheduleUpdateChildWatches(dirName, dirPath, fileName, options); return; } @@ -5759,7 +5756,7 @@ ${lanes.join("\n")} return false; let newChildWatches; const hasChanges = enumerateInsertsAndDeletes( - fileSystemEntryExists(parentDir, FileSystemEntryKind.Directory) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { + fileSystemEntryExists(parentDir, 1 /* Directory */) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { const childFullName = getNormalizedAbsolutePath(child, parentDir); return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath(childFullName))) === 0 /* EqualTo */ ? childFullName : void 0; }) : emptyArray, @@ -6179,7 +6176,7 @@ ${lanes.join("\n")} PollingInterval3[PollingInterval3["Low"] = 250] = "Low"; return PollingInterval3; })(PollingInterval || {}); - missingFileModifiedTime = new Date(0); + missingFileModifiedTime = /* @__PURE__ */ new Date(0); defaultChunkLevels = { Low: 32, Medium: 64, High: 256 }; pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels); unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels); @@ -6390,7 +6387,7 @@ ${lanes.join("\n")} if (!err) { try { if ((_a2 = statSync(profilePath)) == null ? void 0 : _a2.isDirectory()) { - profilePath = _path.join(profilePath, `${new Date().toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); + profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); } } catch (e) { } @@ -7342,7 +7339,6 @@ ${lanes.join("\n")} Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), - Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."), A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), @@ -7471,6 +7467,7 @@ ${lanes.join("\n")} To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -7864,7 +7861,6 @@ ${lanes.join("\n")} Cannot_find_type_definition_file_for_0: diag(2688, 1 /* Error */, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), - An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, 1 /* Error */, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), @@ -7988,7 +7984,7 @@ ${lanes.join("\n")} Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."), A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), - Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."), + Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."), Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), @@ -8180,13 +8176,11 @@ ${lanes.join("\n")} The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), - Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), + Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."), Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), - Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), + Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), @@ -8274,7 +8268,7 @@ ${lanes.join("\n")} Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."), File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."), - File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."), + File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."), Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."), Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), @@ -8564,6 +8558,11 @@ ${lanes.join("\n")} Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."), Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."), true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."), + Entering_conditional_exports: diag(6413, 3 /* Message */, "Entering_conditional_exports_6413", "Entering conditional exports."), + Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."), + Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."), + Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), @@ -8725,6 +8724,7 @@ ${lanes.join("\n")} new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), + This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."), Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), @@ -8822,7 +8822,7 @@ ${lanes.join("\n")} You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), - Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), + Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -9614,18 +9614,18 @@ ${lanes.join("\n")} return true; } function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start, length2) { - let text = textInitial; - let pos; - let end; - let startPos; - let tokenPos; - let token; - let tokenValue; - let tokenFlags; - let commentDirectives; - let inJSDocType = 0; + var text = textInitial; + var pos; + var end; + var startPos; + var tokenPos; + var token; + var tokenValue; + var tokenFlags; + var commentDirectives; + var inJSDocType = 0; setText(text, start, length2); - const scanner2 = { + var scanner2 = { getStartPos: () => startPos, getTextPos: () => pos, getToken: () => token, @@ -12804,7 +12804,7 @@ ${lanes.join("\n")} return (symbol.flags & 33554432 /* Transient */) !== 0; } function createSingleLineStringWriter() { - let str = ""; + var str = ""; const writeText = (text) => str += text; return { getText: () => str, @@ -13025,6 +13025,36 @@ ${lanes.join("\n")} function nodeIsPresent(node) { return !nodeIsMissing(node); } + function isGrammarError(parent2, child) { + if (isTypeParameterDeclaration(parent2)) + return child === parent2.expression; + if (isClassStaticBlockDeclaration(parent2)) + return child === parent2.modifiers; + if (isPropertySignature(parent2)) + return child === parent2.initializer; + if (isPropertyDeclaration(parent2)) + return child === parent2.questionToken && isAutoAccessorPropertyDeclaration(parent2); + if (isPropertyAssignment(parent2)) + return child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + if (isShorthandPropertyAssignment(parent2)) + return child === parent2.equalsToken || child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + if (isMethodDeclaration(parent2)) + return child === parent2.exclamationToken; + if (isConstructorDeclaration(parent2)) + return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isGetAccessorDeclaration(parent2)) + return child === parent2.typeParameters || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isSetAccessorDeclaration(parent2)) + return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); + if (isNamespaceExportDeclaration(parent2)) + return child === parent2.modifiers || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); + return false; + } + function isGrammarErrorElement(nodeArray, child, isElement) { + if (!nodeArray || isArray(child) || !isElement(child)) + return false; + return contains(nodeArray, child); + } function insertStatementsAfterPrologue(to, from, isPrologueDirective2) { if (from === void 0 || from.length === 0) return to; @@ -13168,101 +13198,400 @@ ${lanes.join("\n")} return emitNode && emitNode.internalFlags || 0; } function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: emptyArray, - AsyncIterator: emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: emptyArray, - SharedArrayBuffer: emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: emptyArray, - AsyncIterableIterator: emptyArray, - AsyncGenerator: emptyArray, - AsyncGeneratorFunction: emptyArray, - NumberFormat: ["formatToParts"] - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: emptyArray, - BigInt64Array: emptyArray, - BigUint64Array: emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - es2021: { - PromiseConstructor: ["any"], - String: ["replaceAll"] - }, - es2022: { - Array: ["at"], - String: ["at"], - Int8Array: ["at"], - Uint8Array: ["at"], - Uint8ClampedArray: ["at"], - Int16Array: ["at"], - Uint16Array: ["at"], - Int32Array: ["at"], - Uint32Array: ["at"], - Float32Array: ["at"], - Float64Array: ["at"], - BigInt64Array: ["at"], - BigUint64Array: ["at"], - ObjectConstructor: ["hasOwn"], - Error: ["cause"] - }, - es2023: { - Array: ["findLastIndex", "findLast"], - Int8Array: ["findLastIndex", "findLast"], - Uint8Array: ["findLastIndex", "findLast"], - Uint8ClampedArray: ["findLastIndex", "findLast"], - Int16Array: ["findLastIndex", "findLast"], - Uint16Array: ["findLastIndex", "findLast"], - Int32Array: ["findLastIndex", "findLast"], - Uint32Array: ["findLastIndex", "findLast"], - Float32Array: ["findLastIndex", "findLast"], - Float64Array: ["findLastIndex", "findLast"], - BigInt64Array: ["findLastIndex", "findLast"], - BigUint64Array: ["findLastIndex", "findLast"] - } - }; + return new Map(Object.entries({ + Array: new Map(Object.entries({ + es2015: [ + "find", + "findIndex", + "fill", + "copyWithin", + "entries", + "keys", + "values" + ], + es2016: [ + "includes" + ], + es2019: [ + "flat", + "flatMap" + ], + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Iterator: new Map(Object.entries({ + es2015: emptyArray + })), + AsyncIterator: new Map(Object.entries({ + es2015: emptyArray + })), + Atomics: new Map(Object.entries({ + es2017: emptyArray + })), + SharedArrayBuffer: new Map(Object.entries({ + es2017: emptyArray + })), + AsyncIterable: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncIterableIterator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGenerator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGeneratorFunction: new Map(Object.entries({ + es2018: emptyArray + })), + RegExp: new Map(Object.entries({ + es2015: [ + "flags", + "sticky", + "unicode" + ], + es2018: [ + "dotAll" + ] + })), + Reflect: new Map(Object.entries({ + es2015: [ + "apply", + "construct", + "defineProperty", + "deleteProperty", + "get", + " getOwnPropertyDescriptor", + "getPrototypeOf", + "has", + "isExtensible", + "ownKeys", + "preventExtensions", + "set", + "setPrototypeOf" + ] + })), + ArrayConstructor: new Map(Object.entries({ + es2015: [ + "from", + "of" + ] + })), + ObjectConstructor: new Map(Object.entries({ + es2015: [ + "assign", + "getOwnPropertySymbols", + "keys", + "is", + "setPrototypeOf" + ], + es2017: [ + "values", + "entries", + "getOwnPropertyDescriptors" + ], + es2019: [ + "fromEntries" + ], + es2022: [ + "hasOwn" + ] + })), + NumberConstructor: new Map(Object.entries({ + es2015: [ + "isFinite", + "isInteger", + "isNaN", + "isSafeInteger", + "parseFloat", + "parseInt" + ] + })), + Math: new Map(Object.entries({ + es2015: [ + "clz32", + "imul", + "sign", + "log10", + "log2", + "log1p", + "expm1", + "cosh", + "sinh", + "tanh", + "acosh", + "asinh", + "atanh", + "hypot", + "trunc", + "fround", + "cbrt" + ] + })), + Map: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + Set: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + PromiseConstructor: new Map(Object.entries({ + es2015: [ + "all", + "race", + "reject", + "resolve" + ], + es2020: [ + "allSettled" + ], + es2021: [ + "any" + ] + })), + Symbol: new Map(Object.entries({ + es2015: [ + "for", + "keyFor" + ], + es2019: [ + "description" + ] + })), + WeakMap: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + WeakSet: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + String: new Map(Object.entries({ + es2015: [ + "codePointAt", + "includes", + "endsWith", + "normalize", + "repeat", + "startsWith", + "anchor", + "big", + "blink", + "bold", + "fixed", + "fontcolor", + "fontsize", + "italics", + "link", + "small", + "strike", + "sub", + "sup" + ], + es2017: [ + "padStart", + "padEnd" + ], + es2019: [ + "trimStart", + "trimEnd", + "trimLeft", + "trimRight" + ], + es2020: [ + "matchAll" + ], + es2021: [ + "replaceAll" + ], + es2022: [ + "at" + ] + })), + StringConstructor: new Map(Object.entries({ + es2015: [ + "fromCodePoint", + "raw" + ] + })), + DateTimeFormat: new Map(Object.entries({ + es2017: [ + "formatToParts" + ] + })), + Promise: new Map(Object.entries({ + es2015: emptyArray, + es2018: [ + "finally" + ] + })), + RegExpMatchArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + RegExpExecArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + Intl: new Map(Object.entries({ + es2018: [ + "PluralRules" + ] + })), + NumberFormat: new Map(Object.entries({ + es2018: [ + "formatToParts" + ] + })), + SymbolConstructor: new Map(Object.entries({ + es2020: [ + "matchAll" + ] + })), + DataView: new Map(Object.entries({ + es2020: [ + "setBigInt64", + "setBigUint64", + "getBigInt64", + "getBigUint64" + ] + })), + BigInt: new Map(Object.entries({ + es2020: emptyArray + })), + RelativeTimeFormat: new Map(Object.entries({ + es2020: [ + "format", + "formatToParts", + "resolvedOptions" + ] + })), + Int8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8ClampedArray: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float64Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigInt64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigUint64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Error: new Map(Object.entries({ + es2022: [ + "cause" + ] + })) + })); } function getLiteralText(node, sourceFile, flags) { var _a2; @@ -13373,7 +13702,7 @@ ${lanes.join("\n")} return kind === 1 /* CommonJS */ || kind === 100 /* Node16 */ || kind === 199 /* NodeNext */; } function isEffectiveExternalModule(node, compilerOptions) { - return isExternalModule(node) || compilerOptions.isolatedModules || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; + return isExternalModule(node) || getIsolatedModules(compilerOptions) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; } function isEffectiveStrictModeSourceFile(node, compilerOptions) { switch (node.scriptKind) { @@ -13394,7 +13723,7 @@ ${lanes.join("\n")} if (startsWithUseStrict(node.statements)) { return true; } - if (isExternalModule(node) || compilerOptions.isolatedModules) { + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { if (getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */) { return true; } @@ -15927,12 +16256,12 @@ ${lanes.join("\n")} return stringContains(version, "-dev") || stringContains(version, "-insiders"); } function createTextWriter(newLine) { - let output; - let indent2; - let lineStart; - let lineCount; - let linePos; - let hasTrailingComment = false; + var output; + var indent2; + var lineStart; + var lineCount; + var linePos; + var hasTrailingComment = false; function updateLineCountAndPosFor(s) { const lineStartsOfS = computeLineStarts(s); if (lineStartsOfS.length > 1) { @@ -17055,10 +17384,10 @@ ${lanes.join("\n")} return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags; } function isWriteOnlyAccess(node) { - return accessKind(node) === AccessKind.Write; + return accessKind(node) === 1 /* Write */; } function isWriteAccess(node) { - return accessKind(node) !== AccessKind.Read; + return accessKind(node) !== 0 /* Read */; } function accessKind(node) { const { parent: parent2 } = node; @@ -17159,9 +17488,6 @@ ${lanes.join("\n")} function getObjectFlags(type) { return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0; } - function typeHasCallOrConstructSignatures(type, checker) { - return checker.getSignaturesOfType(type, 0 /* Call */).length !== 0 || checker.getSignaturesOfType(type, 1 /* Construct */).length !== 0; - } function forSomeAncestorDirectory(directory, callback) { return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0); } @@ -17726,7 +18052,7 @@ ${lanes.join("\n")} return !!(compilerOptions.declaration || compilerOptions.composite); } function shouldPreserveConstEnums(compilerOptions) { - return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); + return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions)); } function isIncrementalCompilation(options) { return !!(options.incremental || options.composite); @@ -18254,7 +18580,7 @@ ${lanes.join("\n")} } function rangeOfTypeParameters(sourceFile, typeParameters) { const pos = typeParameters.pos - 1; - const end = skipTrivia(sourceFile.text, typeParameters.end) + 1; + const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1); return { pos, end }; } function skipTypeChecking(sourceFile, options, host) { @@ -18725,7 +19051,7 @@ ${lanes.join("\n")} const tag = getJSDocSatisfiesTag(node); return tag && tag.typeExpression && tag.typeExpression.type; } - var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries; + var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries; var init_utilities = __esm({ "src/compiler/utilities.ts"() { "use strict"; @@ -18829,12 +19155,6 @@ ${lanes.join("\n")} base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; carriageReturnLineFeed = "\r\n"; lineFeed = "\n"; - AccessKind = /* @__PURE__ */ ((AccessKind2) => { - AccessKind2[AccessKind2["Read"] = 0] = "Read"; - AccessKind2[AccessKind2["Write"] = 1] = "Write"; - AccessKind2[AccessKind2["ReadWrite"] = 2] = "ReadWrite"; - return AccessKind2; - })(AccessKind || {}); objectAllocator = { getNodeConstructor: () => Node4, getTokenConstructor: () => Token, @@ -21518,24 +21838,7 @@ ${lanes.join("\n")} return node; } function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) - return 65536 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 128 /* ContainsES2018 */) { - for (const element of getElementsOfBindingOrAssignmentPattern(node)) { - const target = getTargetOfBindingOrAssignmentElement(element); - if (target && isAssignmentPattern(target)) { - if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - return 65536 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 128 /* ContainsES2018 */) { - const flags2 = propagateAssignmentPatternFlags(target); - if (flags2) - return flags2; - } - } - } - } - return 0 /* None */; + return containsObjectRestOrSpread(node) ? 65536 /* ContainsObjectRestOrSpread */ : 0 /* None */; } function updateBinaryExpression(node, left, operator, right) { return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; @@ -24558,14 +24861,114 @@ ${lanes.join("\n")} factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) ]); } + function createESDecorateClassElementAccessGetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "get", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + accessor + ) + ); + } + function createESDecorateClassElementAccessSetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "set", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("value") + ) + ], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + accessor, + factory2.createIdentifier("value") + ) + ) + ]) + ) + ); + } + function createESDecorateClassElementAccessHasMethod(elementName) { + const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name; + return factory2.createPropertyAssignment( + "has", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBinaryExpression( + propertyName, + 101 /* InKeyword */, + factory2.createIdentifier("obj") + ) + ) + ); + } + function createESDecorateClassElementAccessObject(name, access) { + const properties = []; + properties.push(createESDecorateClassElementAccessHasMethod(name)); + if (access.get) + properties.push(createESDecorateClassElementAccessGetMethod(name)); + if (access.set) + properties.push(createESDecorateClassElementAccessSetMethod(name)); + return factory2.createObjectLiteralExpression(properties); + } function createESDecorateClassElementContextObject(contextIn) { return factory2.createObjectLiteralExpression([ factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), - factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()) - // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494 - // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) ]); } function createESDecorateContextObject(contextIn) { @@ -26773,7 +27176,7 @@ ${lanes.join("\n")} } function canHaveIllegalModifiers(node) { const kind = node.kind; - return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; + return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */; } function isQuestionOrExclamationToken(node) { return isQuestionToken(node) || isExclamationToken(node); @@ -27035,6 +27438,25 @@ ${lanes.join("\n")} flattenCommaListWorker(node, expressions); return expressions; } + function containsObjectRestOrSpread(node) { + if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) + return true; + if (node.transformFlags & 128 /* ContainsES2018 */) { + for (const element of getElementsOfBindingOrAssignmentPattern(node)) { + const target = getTargetOfBindingOrAssignmentElement(element); + if (target && isAssignmentPattern(target)) { + if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + return true; + } + if (target.transformFlags & 128 /* ContainsES2018 */) { + if (containsObjectRestOrSpread(target)) + return true; + } + } + } + } + return false; + } var BinaryExpressionState, BinaryExpressionStateMachine; var init_utilities2 = __esm({ "src/compiler/factory/utilities.ts"() { @@ -28039,22 +28461,22 @@ ${lanes.join("\n")} [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; ((Parser2) => { - const scanner2 = createScanner( + var scanner2 = createScanner( 99 /* Latest */, /*skipTrivia*/ true ); - const disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; - let NodeConstructor2; - let TokenConstructor2; - let IdentifierConstructor2; - let PrivateIdentifierConstructor2; - let SourceFileConstructor2; + var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; + var NodeConstructor2; + var TokenConstructor2; + var IdentifierConstructor2; + var PrivateIdentifierConstructor2; + var SourceFileConstructor2; function countNode(node) { nodeCount++; return node; } - const baseNodeFactory = { + var baseNodeFactory = { createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2( kind, /*pos*/ @@ -28091,25 +28513,53 @@ ${lanes.join("\n")} 0 )) }; - const factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); - let fileName; - let sourceFlags; - let sourceText; - let languageVersion; - let scriptKind; - let languageVariant; - let parseDiagnostics; - let jsDocDiagnostics; - let syntaxCursor; - let currentToken; - let nodeCount; - let identifiers; - let identifierCount; - let parsingContext; - let notParenthesizedArrow; - let contextFlags; - let topLevel = true; - let parseErrorBeforeNextFinishedNode = false; + var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); + var { + createNodeArray: factoryCreateNodeArray, + createNumericLiteral: factoryCreateNumericLiteral, + createStringLiteral: factoryCreateStringLiteral, + createLiteralLikeNode: factoryCreateLiteralLikeNode, + createIdentifier: factoryCreateIdentifier, + createPrivateIdentifier: factoryCreatePrivateIdentifier, + createToken: factoryCreateToken, + createArrayLiteralExpression: factoryCreateArrayLiteralExpression, + createObjectLiteralExpression: factoryCreateObjectLiteralExpression, + createPropertyAccessExpression: factoryCreatePropertyAccessExpression, + createPropertyAccessChain: factoryCreatePropertyAccessChain, + createElementAccessExpression: factoryCreateElementAccessExpression, + createElementAccessChain: factoryCreateElementAccessChain, + createCallExpression: factoryCreateCallExpression, + createCallChain: factoryCreateCallChain, + createNewExpression: factoryCreateNewExpression, + createParenthesizedExpression: factoryCreateParenthesizedExpression, + createBlock: factoryCreateBlock, + createVariableStatement: factoryCreateVariableStatement, + createExpressionStatement: factoryCreateExpressionStatement, + createIfStatement: factoryCreateIfStatement, + createWhileStatement: factoryCreateWhileStatement, + createForStatement: factoryCreateForStatement, + createForOfStatement: factoryCreateForOfStatement, + createVariableDeclaration: factoryCreateVariableDeclaration, + createVariableDeclarationList: factoryCreateVariableDeclarationList + } = factory2; + var fileName; + var sourceFlags; + var sourceText; + var languageVersion; + var scriptKind; + var languageVariant; + var parseDiagnostics; + var jsDocDiagnostics; + var syntaxCursor; + var currentToken; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; + var notParenthesizedArrow; + var contextFlags; + var topLevel = true; + var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) { var _a2; scriptKind2 = ensureScriptKind(fileName2, scriptKind2); @@ -28209,8 +28659,8 @@ ${lanes.join("\n")} } } } - const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); - const statement = factory2.createExpressionStatement(expression); + const expression = isArray(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); + const statement = factoryCreateExpressionStatement(expression); finishNode(statement, pos); statements = createNodeArray([statement], pos); endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); @@ -28302,7 +28752,7 @@ ${lanes.join("\n")} } sourceFlags = contextFlags; nextToken(); - const statements = parseList(ParsingContext.SourceElements, parseStatement); + const statements = parseList(0 /* SourceElements */, parseStatement); Debug.assert(token() === 1 /* EndOfFileToken */); const endOfFileToken = addJSDocComment(parseTokenNode()); const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); @@ -28365,7 +28815,7 @@ ${lanes.join("\n")} nextToken(); while (token() !== 1 /* EndOfFileToken */) { const startPos = scanner2.getStartPos(); - const statement = parseListElement(ParsingContext.SourceElements, parseStatement); + const statement = parseListElement(0 /* SourceElements */, parseStatement); statements.push(statement); if (startPos === scanner2.getStartPos()) { nextToken(); @@ -28393,7 +28843,7 @@ ${lanes.join("\n")} } } syntaxCursor = savedSyntaxCursor; - return factory2.updateSourceFile(sourceFile, setTextRange(factory2.createNodeArray(statements), sourceFile.statements)); + return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements)); function containsPossibleTopLevelAwait(node) { return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); } @@ -28834,13 +29284,13 @@ ${lanes.join("\n")} const pos = getNodePos(); const kind = token(); nextToken(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseTokenNodeJSDoc() { const pos = getNodePos(); const kind = token(); nextTokenJSDoc(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function canParseSemicolon() { if (token() === 26 /* SemicolonToken */) { @@ -28861,7 +29311,7 @@ ${lanes.join("\n")} return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); } function createNodeArray(elements, pos, end, hasTrailingComma) { - const array = factory2.createNodeArray(elements, hasTrailingComma); + const array = factoryCreateNodeArray(elements, hasTrailingComma); setTextRangePosEnd(array, pos, end != null ? end : scanner2.getStartPos()); return array; } @@ -28883,7 +29333,7 @@ ${lanes.join("\n")} parseErrorAtCurrentToken(diagnosticMessage, arg0); } const pos = getNodePos(); - const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( + const result = kind === 79 /* Identifier */ ? factoryCreateIdentifier( "", /*originalKeywordKind*/ void 0 @@ -28893,15 +29343,15 @@ ${lanes.join("\n")} "", /*templateFlags*/ void 0 - ) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral( + ) : kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral( "", /*numericLiteralFlags*/ void 0 - ) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + ) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( "", /*isSingleQuote*/ void 0 - ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind); + ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); return finishNode(result, pos); } function internIdentifier(text) { @@ -28919,7 +29369,7 @@ ${lanes.join("\n")} const text = internIdentifier(scanner2.getTokenValue()); const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); + return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); @@ -28990,7 +29440,7 @@ ${lanes.join("\n")} } function parsePrivateIdentifier() { const pos = getNodePos(); - const node = factory2.createPrivateIdentifier(internIdentifier(scanner2.getTokenValue())); + const node = factoryCreatePrivateIdentifier(internIdentifier(scanner2.getTokenValue())); nextToken(); return finishNode(node, pos); } @@ -29019,7 +29469,6 @@ ${lanes.join("\n")} return canFollowExportModifier(); case 88 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); - case 127 /* AccessorKeyword */: case 124 /* StaticKeyword */: case 137 /* GetKeyword */: case 151 /* SetKeyword */: @@ -29052,19 +29501,19 @@ ${lanes.join("\n")} return true; } switch (parsingContext2) { - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return lookAhead(isTypeMemberStart); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return lookAhead(isClassMemberStart) || token() === 26 /* SemicolonToken */ && !inErrorRecovery; - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return token() === 22 /* OpenBracketToken */ || isLiteralPropertyName(); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: switch (token()) { case 22 /* OpenBracketToken */: case 41 /* AsteriskToken */: @@ -29074,13 +29523,13 @@ ${lanes.join("\n")} default: return isLiteralPropertyName(); } - case ParsingContext.RestProperties: + case 18 /* RestProperties */: return isLiteralPropertyName(); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName(); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return isAssertionKey2(); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: if (token() === 18 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); } @@ -29089,40 +29538,40 @@ ${lanes.join("\n")} } else { return isIdentifier2() && !isHeritageClauseExtendsOrImplementsKeyword(); } - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 101 /* InKeyword */ || token() === 85 /* ConstKeyword */ || isIdentifier2(); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: switch (token()) { case 27 /* CommaToken */: case 24 /* DotToken */: return true; } - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 25 /* DotDotDotToken */ || isStartOfExpression(); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isStartOfParameter( /*isJSDocParameter*/ false ); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return isStartOfParameter( /*isJSDocParameter*/ true ); - case ParsingContext.TypeArguments: - case ParsingContext.TupleElementTypes: + case 20 /* TypeArguments */: + case 21 /* TupleElementTypes */: return token() === 27 /* CommaToken */ || isStartOfType(); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return isHeritageClause2(); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return tokenIsIdentifierOrKeyword(token()); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return true; } return Debug.fail("Non-exhaustive case in 'isListElement'."); @@ -29166,41 +29615,41 @@ ${lanes.join("\n")} return true; } switch (kind) { - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauses: - case ParsingContext.TypeMembers: - case ParsingContext.ClassMembers: - case ParsingContext.EnumMembers: - case ParsingContext.ObjectLiteralMembers: - case ParsingContext.ObjectBindingElements: - case ParsingContext.ImportOrExportSpecifiers: - case ParsingContext.AssertEntries: + case 1 /* BlockStatements */: + case 2 /* SwitchClauses */: + case 4 /* TypeMembers */: + case 5 /* ClassMembers */: + case 6 /* EnumMembers */: + case 12 /* ObjectLiteralMembers */: + case 9 /* ObjectBindingElements */: + case 23 /* ImportOrExportSpecifiers */: + case 24 /* AssertEntries */: return token() === 19 /* CloseBraceToken */; - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return token() === 19 /* CloseBraceToken */ || token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */; - case ParsingContext.ArrayLiteralMembers: - case ParsingContext.TupleElementTypes: - case ParsingContext.ArrayBindingElements: + case 15 /* ArrayLiteralMembers */: + case 21 /* TupleElementTypes */: + case 10 /* ArrayBindingElements */: return token() === 23 /* CloseBracketToken */; - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: - case ParsingContext.RestProperties: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: + case 18 /* RestProperties */: return token() === 21 /* CloseParenToken */ || token() === 23 /* CloseBracketToken */; - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return token() !== 27 /* CommaToken */; - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return token() === 18 /* OpenBraceToken */ || token() === 19 /* CloseBraceToken */; - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return token() === 31 /* GreaterThanToken */ || token() === 43 /* SlashToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsSlash); default: return false; @@ -29219,7 +29668,7 @@ ${lanes.join("\n")} return false; } function isInSomeParsingContext() { - for (let kind = 0; kind < ParsingContext.Count; kind++) { + for (let kind = 0; kind < 25 /* Count */; kind++) { if (parsingContext & 1 << kind) { if (isListElement2( kind, @@ -29288,38 +29737,38 @@ ${lanes.join("\n")} } function isReusableParsingContext(parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: - case ParsingContext.SwitchClauses: - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: - case ParsingContext.EnumMembers: - case ParsingContext.TypeMembers: - case ParsingContext.VariableDeclarations: - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 5 /* ClassMembers */: + case 2 /* SwitchClauses */: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: + case 6 /* EnumMembers */: + case 4 /* TypeMembers */: + case 8 /* VariableDeclarations */: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return true; } return false; } function canReuseNode(node, parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return isReusableClassMember(node); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return isReusableSwitchClause(node); - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return isReusableStatement(node); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return isReusableEnumMember(node); - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return isReusableTypeMember(node); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isReusableVariableDeclaration(node); - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return isReusableParameter(node); } return false; @@ -29429,56 +29878,56 @@ ${lanes.join("\n")} } function parsingContextErrors(context) { switch (context) { - case ParsingContext.SourceElements: + case 0 /* SourceElements */: return token() === 88 /* DefaultKeyword */ ? parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(93 /* ExportKeyword */)) : parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.BlockStatements: + case 1 /* BlockStatements */: return parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(Diagnostics.case_or_default_expected); - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(Diagnostics.Statement_expected); - case ParsingContext.RestProperties: - case ParsingContext.TypeMembers: + case 18 /* RestProperties */: + case 4 /* TypeMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return parseErrorAtCurrentToken(Diagnostics.Enum_member_expected); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(Diagnostics.Expression_expected); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Variable_declaration_expected); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Property_destructuring_pattern_expected); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Array_element_destructuring_pattern_expected); - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(Diagnostics.Argument_expression_expected); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_assignment_expected); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Expression_or_comma_expected); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_parameter_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return parseErrorAtCurrentToken(Diagnostics.Type_parameter_declaration_expected); - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return parseErrorAtCurrentToken(Diagnostics.Type_argument_expected); - case ParsingContext.TupleElementTypes: + case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(Diagnostics.Type_expected); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); - case ParsingContext.Count: + case 25 /* Count */: return Debug.fail("ParsingContext.Count used as a context"); default: Debug.assertNever(context); @@ -29537,7 +29986,7 @@ ${lanes.join("\n")} ); } function getExpectedCommaDiagnostic(kind) { - return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; + return kind === 6 /* EnumMembers */ ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; } function createMissingList() { const list = createNodeArray([], getNodePos()); @@ -29706,12 +30155,12 @@ ${lanes.join("\n")} // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( scanner2.getTokenValue(), /*isSingleQuote*/ void 0, scanner2.hasExtendedUnicodeEscape() - ) : isLiteralKind(kind) ? factory2.createLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail() + ) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail() ); if (scanner2.hasExtendedUnicodeEscape()) { node.hasExtendedUnicodeEscape = true; @@ -29731,7 +30180,7 @@ ${lanes.join("\n")} } function parseTypeArgumentsOfTypeReference() { if (!scanner2.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function parseTypeReference() { @@ -29913,7 +30362,7 @@ ${lanes.join("\n")} } function parseTypeParameters() { if (token() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function isStartOfParameter(isJSDocParameter) { @@ -30019,7 +30468,7 @@ ${lanes.join("\n")} const savedAwaitContext = inAwaitContext(); setYieldContext(!!(flags & 1 /* Yield */)); setAwaitContext(!!(flags & 2 /* Await */)); - const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(ParsingContext.JSDocParameters, parseJSDocParameter) : parseDelimitedList(ParsingContext.Parameters, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); + const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(17 /* JSDocParameters */, parseJSDocParameter) : parseDelimitedList(16 /* Parameters */, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); setYieldContext(savedYieldContext); setAwaitContext(savedAwaitContext); return parameters; @@ -30087,7 +30536,7 @@ ${lanes.join("\n")} return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { - const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( + const parameters = parseBracketedList(16 /* Parameters */, () => parseParameter( /*inOuterAwaitContext*/ false ), 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); @@ -30186,7 +30635,7 @@ ${lanes.join("\n")} function parseObjectTypeMembers() { let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = parseList(ParsingContext.TypeMembers, parseTypeMember); + members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -30240,7 +30689,7 @@ ${lanes.join("\n")} } const type = parseTypeAnnotation(); parseSemicolon(); - const members = parseList(ParsingContext.TypeMembers, parseTypeMember); + const members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), pos); } @@ -30285,7 +30734,7 @@ ${lanes.join("\n")} const pos = getNodePos(); return finishNode( factory2.createTupleTypeNode( - parseBracketedList(ParsingContext.TupleElementTypes, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) + parseBracketedList(21 /* TupleElementTypes */, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) ), pos ); @@ -30302,7 +30751,7 @@ ${lanes.join("\n")} if (token() === 126 /* AbstractKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(126 /* AbstractKeyword */), pos); + const modifier = finishNode(factoryCreateToken(126 /* AbstractKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -30312,6 +30761,7 @@ ${lanes.join("\n")} const hasJSDoc = hasPrecedingJSDocComment(); const modifiers = parseModifiersForConstructorType(); const isConstructorType = parseOptional(103 /* NewKeyword */); + Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers."); const typeParameters = parseTypeParameters(); const parameters = parseParameters(4 /* Type */); const type = parseReturnType( @@ -30320,8 +30770,6 @@ ${lanes.join("\n")} false ); const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type); - if (!isConstructorType) - node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseKeywordAndNoDot() { @@ -30913,10 +31361,10 @@ ${lanes.join("\n")} } function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { const triState = isParenthesizedArrowFunctionExpression(); - if (triState === Tristate.False) { + if (triState === 0 /* False */) { return void 0; } - return triState === Tristate.True ? parseParenthesizedArrowFunctionExpression( + return triState === 1 /* True */ ? parseParenthesizedArrowFunctionExpression( /*allowAmbiguity*/ true, /*allowReturnTypeInArrowFunction*/ @@ -30928,18 +31376,18 @@ ${lanes.join("\n")} return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } if (token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner2.hasPrecedingLineBreak()) { - return Tristate.False; + return 0 /* False */; } if (token() !== 20 /* OpenParenToken */ && token() !== 29 /* LessThanToken */) { - return Tristate.False; + return 0 /* False */; } } const first2 = token(); @@ -30951,45 +31399,45 @@ ${lanes.join("\n")} case 38 /* EqualsGreaterThanToken */: case 58 /* ColonToken */: case 18 /* OpenBraceToken */: - return Tristate.True; + return 1 /* True */; default: - return Tristate.False; + return 0 /* False */; } } if (second === 22 /* OpenBracketToken */ || second === 18 /* OpenBraceToken */) { - return Tristate.Unknown; + return 2 /* Unknown */; } if (second === 25 /* DotDotDotToken */) { - return Tristate.True; + return 1 /* True */; } if (isModifierKind(second) && second !== 132 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { if (nextToken() === 128 /* AsKeyword */) { - return Tristate.False; + return 0 /* False */; } - return Tristate.True; + return 1 /* True */; } if (!isIdentifier2() && second !== 108 /* ThisKeyword */) { - return Tristate.False; + return 0 /* False */; } switch (nextToken()) { case 58 /* ColonToken */: - return Tristate.True; + return 1 /* True */; case 57 /* QuestionToken */: nextToken(); if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 63 /* EqualsToken */ || token() === 21 /* CloseParenToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; case 27 /* CommaToken */: case 63 /* EqualsToken */: case 21 /* CloseParenToken */: - return Tristate.Unknown; + return 2 /* Unknown */; } - return Tristate.False; + return 0 /* False */; } else { Debug.assert(first2 === 29 /* LessThanToken */); if (!isIdentifier2() && token() !== 85 /* ConstKeyword */) { - return Tristate.False; + return 0 /* False */; } if (languageVariant === 1 /* JSX */) { const isArrowFunctionInJsx = lookAhead(() => { @@ -31000,6 +31448,7 @@ ${lanes.join("\n")} switch (fourth) { case 63 /* EqualsToken */: case 31 /* GreaterThanToken */: + case 43 /* SlashToken */: return false; default: return true; @@ -31010,11 +31459,11 @@ ${lanes.join("\n")} return false; }); if (isArrowFunctionInJsx) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } - return Tristate.Unknown; + return 2 /* Unknown */; } } function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { @@ -31034,7 +31483,7 @@ ${lanes.join("\n")} } function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { if (token() === 132 /* AsyncKeyword */) { - if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === Tristate.True) { + if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) { const pos = getNodePos(); const asyncModifier = parseModifiersForArrowFunction(); const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); @@ -31047,14 +31496,14 @@ ${lanes.join("\n")} if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner2.hasPrecedingLineBreak() || token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.False; + return 0 /* False */; } const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); if (!scanner2.hasPrecedingLineBreak() && expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } } - return Tristate.False; + return 0 /* False */; } function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { const pos = getNodePos(); @@ -31259,6 +31708,12 @@ ${lanes.join("\n")} case 114 /* VoidKeyword */: return parseVoidExpression(); case 29 /* LessThanToken */: + if (languageVariant === 1 /* JSX */) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } return parseTypeAssertion(); case 133 /* AwaitKeyword */: if (isAwaitExpression2()) { @@ -31353,7 +31808,7 @@ ${lanes.join("\n")} return expression; } parseExpectedToken(24 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - return finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -31374,7 +31829,7 @@ ${lanes.join("\n")} factory2.createJsxElement( lastChild.openingElement, lastChild.children, - finishNode(factory2.createJsxClosingElement(finishNode(factory2.createIdentifier(""), end, end)), end, end) + finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end) ), lastChild.openingElement.pos, end @@ -31462,7 +31917,7 @@ ${lanes.join("\n")} const list = []; const listPos = getNodePos(); const saveParsingContext = parsingContext; - parsingContext |= 1 << ParsingContext.JsxChildren; + parsingContext |= 1 << 14 /* JsxChildren */; while (true) { const child = parseJsxChild(openingTag, currentToken = scanner2.reScanJsxToken()); if (!child) @@ -31477,7 +31932,7 @@ ${lanes.join("\n")} } function parseJsxAttributes() { const pos = getNodePos(); - return finishNode(factory2.createJsxAttributes(parseList(ParsingContext.JsxAttributes, parseJsxAttribute)), pos); + return finishNode(factory2.createJsxAttributes(parseList(13 /* JsxAttributes */, parseJsxAttribute)), pos); } function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { const pos = getNodePos(); @@ -31517,7 +31972,7 @@ ${lanes.join("\n")} scanJsxIdentifier(); let expression = token() === 108 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - expression = finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -31611,13 +32066,9 @@ ${lanes.join("\n")} function parseJsxClosingFragment(inExpressionContext) { const pos = getNodePos(); parseExpected(30 /* LessThanSlashToken */); - if (tokenIsIdentifierOrKeyword(token())) { - parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); - } if (parseExpected( 31 /* GreaterThanToken */, - /*diagnostic*/ - void 0, + Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment, /*shouldAdvance*/ false )) { @@ -31630,6 +32081,7 @@ ${lanes.join("\n")} return finishNode(factory2.createJsxJsxClosingFragment(), pos); } function parseTypeAssertion() { + Debug.assert(languageVariant !== 1 /* JSX */, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments."); const pos = getNodePos(); parseExpected(29 /* LessThanToken */); const type = parseType(); @@ -31671,7 +32123,7 @@ ${lanes.join("\n")} true ); const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); - const propertyAccess = isOptionalChain2 ? factory2.createPropertyAccessChain(expression, questionDotToken, name) : factory2.createPropertyAccessExpression(expression, name); + const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name) : factoryCreatePropertyAccessExpression(expression, name); if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers); } @@ -31699,7 +32151,7 @@ ${lanes.join("\n")} argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createElementAccessChain(expression, questionDotToken, argumentExpression) : factory2.createElementAccessExpression(expression, argumentExpression); + const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression); return finishNode(indexedAccess, pos); } function parseMemberExpressionRest(pos, expression, allowOptionalChain) { @@ -31786,7 +32238,7 @@ ${lanes.join("\n")} expression = expression.expression; } const argumentList = parseArgumentList(); - const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList); + const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList); expression = finishNode(callExpr, pos); continue; } @@ -31797,7 +32249,7 @@ ${lanes.join("\n")} false, Diagnostics.Identifier_expected ); - expression = finishNode(factory2.createPropertyAccessChain(expression, questionDotToken, name), pos); + expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name), pos); } break; } @@ -31805,7 +32257,7 @@ ${lanes.join("\n")} } function parseArgumentList() { parseExpected(20 /* OpenParenToken */); - const result = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); + const result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(21 /* CloseParenToken */); return result; } @@ -31817,7 +32269,7 @@ ${lanes.join("\n")} return void 0; } nextToken(); - const typeArguments = parseDelimitedList(ParsingContext.TypeArguments, parseType); + const typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType); if (reScanGreaterToken() !== 31 /* GreaterThanToken */) { return void 0; } @@ -31892,7 +32344,7 @@ ${lanes.join("\n")} parseExpected(20 /* OpenParenToken */); const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - return withJSDoc(finishNode(factory2.createParenthesizedExpression(expression), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc); } function parseSpreadElement() { const pos = getNodePos(); @@ -31917,9 +32369,9 @@ ${lanes.join("\n")} const openBracketPosition = scanner2.getTokenPos(); const openBracketParsed = parseExpected(22 /* OpenBracketToken */); const multiLine = scanner2.hasPrecedingLineBreak(); - const elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArgumentOrArrayLiteralElement); + const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketParsed, openBracketPosition); - return finishNode(factory2.createArrayLiteralExpression(elements, multiLine), pos); + return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos); } function parseObjectLiteralElement() { const pos = getNodePos(); @@ -31978,13 +32430,13 @@ ${lanes.join("\n")} const openBraceParsed = parseExpected(18 /* OpenBraceToken */); const multiLine = scanner2.hasPrecedingLineBreak(); const properties = parseDelimitedList( - ParsingContext.ObjectLiteralMembers, + 12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true ); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - return finishNode(factory2.createObjectLiteralExpression(properties, multiLine), pos); + return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos); } function parseFunctionExpression() { const savedDecoratorContext = inDecoratorContext(); @@ -32041,7 +32493,7 @@ ${lanes.join("\n")} parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression)); } const argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : void 0; - return finishNode(factory2.createNewExpression(expression, typeArguments, argumentList), pos); + return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { const pos = getNodePos(); @@ -32050,17 +32502,17 @@ ${lanes.join("\n")} const openBraceParsed = parseExpected(18 /* OpenBraceToken */, diagnosticMessage); if (openBraceParsed || ignoreMissingOpenBrace) { const multiLine = scanner2.hasPrecedingLineBreak(); - const statements = parseList(ParsingContext.BlockStatements, parseStatement); + const statements = parseList(1 /* BlockStatements */, parseStatement); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc); + const result = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc); if (token() === 63 /* EqualsToken */) { - parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); + parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses); nextToken(); } return result; } else { const statements = createMissingList(); - return withJSDoc(finishNode(factory2.createBlock( + return withJSDoc(finishNode(factoryCreateBlock( statements, /*multiLine*/ void 0 @@ -32109,7 +32561,7 @@ ${lanes.join("\n")} parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const thenStatement = parseStatement(); const elseStatement = parseOptional(91 /* ElseKeyword */) ? parseStatement() : void 0; - return withJSDoc(finishNode(factory2.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); } function parseDoStatement() { const pos = getNodePos(); @@ -32133,7 +32585,7 @@ ${lanes.join("\n")} const expression = allowInAnd(parseExpression); parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const statement = parseStatement(); - return withJSDoc(finishNode(factory2.createWhileStatement(expression, statement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc); } function parseForOrForInOrForOfStatement() { const pos = getNodePos(); @@ -32159,7 +32611,7 @@ ${lanes.join("\n")} true )); parseExpected(21 /* CloseParenToken */); - node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement()); + node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement()); } else if (parseOptional(101 /* InKeyword */)) { const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); @@ -32170,7 +32622,7 @@ ${lanes.join("\n")} parseExpected(26 /* SemicolonToken */); const incrementor = token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; parseExpected(21 /* CloseParenToken */); - node = factory2.createForStatement(initializer, condition, incrementor, parseStatement()); + node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement()); } return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -32208,14 +32660,14 @@ ${lanes.join("\n")} parseExpected(82 /* CaseKeyword */); const expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return withJSDoc(finishNode(factory2.createCaseClause(expression, statements), pos), hasJSDoc); } function parseDefaultClause() { const pos = getNodePos(); parseExpected(88 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(factory2.createDefaultClause(statements), pos); } function parseCaseOrDefaultClause() { @@ -32224,7 +32676,7 @@ ${lanes.join("\n")} function parseCaseBlock() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const clauses = parseList(ParsingContext.SwitchClauses, parseCaseOrDefaultClause); + const clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createCaseBlock(clauses), pos); } @@ -32245,7 +32697,7 @@ ${lanes.join("\n")} let expression = scanner2.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); if (expression === void 0) { identifierCount++; - expression = finishNode(factory2.createIdentifier(""), getNodePos()); + expression = finishNode(factoryCreateIdentifier(""), getNodePos()); } if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); @@ -32306,7 +32758,7 @@ ${lanes.join("\n")} if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); } - node = factory2.createExpressionStatement(expression); + node = factoryCreateExpressionStatement(expression); if (hasParen) { hasJSDoc = false; } @@ -32665,14 +33117,14 @@ ${lanes.join("\n")} function parseObjectBindingPattern() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const elements = parseDelimitedList(ParsingContext.ObjectBindingElements, parseObjectBindingElement); + const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createObjectBindingPattern(elements), pos); } function parseArrayBindingPattern() { const pos = getNodePos(); parseExpected(22 /* OpenBracketToken */); - const elements = parseDelimitedList(ParsingContext.ArrayBindingElements, parseArrayBindingElement); + const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); return finishNode(factory2.createArrayBindingPattern(elements), pos); } @@ -32704,7 +33156,7 @@ ${lanes.join("\n")} } const type = parseTypeAnnotation(); const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); - const node = factory2.createVariableDeclaration(name, exclamationToken, type, initializer); + const node = factoryCreateVariableDeclaration(name, exclamationToken, type, initializer); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseVariableDeclarationList(inForStatementInitializer) { @@ -32730,12 +33182,12 @@ ${lanes.join("\n")} const savedDisallowIn = inDisallowInContext(); setDisallowInContext(inForStatementInitializer); declarations = parseDelimitedList( - ParsingContext.VariableDeclarations, + 8 /* VariableDeclarations */, inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation ); setDisallowInContext(savedDisallowIn); } - return finishNode(factory2.createVariableDeclarationList(declarations, flags), pos); + return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos); } function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; @@ -32746,7 +33198,7 @@ ${lanes.join("\n")} false ); parseSemicolon(); - const node = factory2.createVariableStatement(modifiers, declarationList); + const node = factoryCreateVariableStatement(modifiers, declarationList); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { @@ -32975,22 +33427,30 @@ ${lanes.join("\n")} return void 0; } } - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); let list; - let modifier, hasSeenStaticModifier = false; + let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false; + if (allowDecorators && token() === 59 /* AtToken */) { + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + } while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; list = append(list, modifier); + hasLeadingModifier = true; } - if (allowDecorators && token() === 59 /* AtToken */) { - let decorator; + if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) { while (decorator = tryParseDecorator()) { list = append(list, decorator); + hasTrailingDecorator = true; } + } + if (hasTrailingDecorator) { while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; @@ -33004,7 +33464,7 @@ ${lanes.join("\n")} if (token() === 132 /* AsyncKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(132 /* AsyncKeyword */), pos); + const modifier = finishNode(factoryCreateToken(132 /* AsyncKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -33133,7 +33593,7 @@ ${lanes.join("\n")} } function parseHeritageClauses() { if (isHeritageClause2()) { - return parseList(ParsingContext.HeritageClauses, parseHeritageClause); + return parseList(22 /* HeritageClauses */, parseHeritageClause); } return void 0; } @@ -33142,7 +33602,7 @@ ${lanes.join("\n")} const tok = token(); Debug.assert(tok === 94 /* ExtendsKeyword */ || tok === 117 /* ImplementsKeyword */); nextToken(); - const types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseExpressionWithTypeArguments); + const types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(factory2.createHeritageClause(tok, types), pos); } function parseExpressionWithTypeArguments() { @@ -33155,13 +33615,13 @@ ${lanes.join("\n")} return finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); } function tryParseTypeArguments() { - return token() === 29 /* LessThanToken */ ? parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; + return token() === 29 /* LessThanToken */ ? parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; } function isHeritageClause2() { return token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; } function parseClassMembers() { - return parseList(ParsingContext.ClassMembers, parseClassElement); + return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); @@ -33194,7 +33654,7 @@ ${lanes.join("\n")} const name = parseIdentifier(); let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(ParsingContext.EnumMembers, parseEnumMember)); + members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(6 /* EnumMembers */, parseEnumMember)); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -33206,7 +33666,7 @@ ${lanes.join("\n")} const pos = getNodePos(); let statements; if (parseExpected(18 /* OpenBraceToken */)) { - statements = parseList(ParsingContext.BlockStatements, parseStatement); + statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); } else { statements = createMissingList(); @@ -33331,7 +33791,7 @@ ${lanes.join("\n")} if (parseExpected(18 /* OpenBraceToken */)) { const multiLine = scanner2.hasPrecedingLineBreak(); const elements = parseDelimitedList( - ParsingContext.AssertEntries, + 24 /* AssertEntries */, parseAssertEntry, /*considerSemicolonAsDelimiter*/ true @@ -33415,7 +33875,7 @@ ${lanes.join("\n")} } function parseNamedImportsOrExports(kind) { const pos = getNodePos(); - const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); + const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { @@ -33591,7 +34051,7 @@ ${lanes.join("\n")} /*isDeclarationFile*/ false, [], - factory2.createToken(1 /* EndOfFileToken */), + factoryCreateToken(1 /* EndOfFileToken */), 0 /* None */, noop ); @@ -34252,7 +34712,7 @@ ${lanes.join("\n")} let node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { const name = parseJSDocIdentifierName(); - node = finishNode(factory2.createPropertyAccessExpression(node, name), pos); + node = finishNode(factoryCreatePropertyAccessExpression(node, name), pos); } return node; } @@ -34543,7 +35003,7 @@ ${lanes.join("\n")} const end2 = scanner2.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner2.getTokenValue()); - const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); + const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -34864,7 +35324,7 @@ ${lanes.join("\n")} let currentArrayIndex = 0; Debug.assert(currentArrayIndex < currentArray.length); let current = currentArray[currentArrayIndex]; - let lastQueriedPosition = InvalidPosition.Value; + let lastQueriedPosition = -1 /* Value */; return { currentNode(position) { if (position !== lastQueriedPosition) { @@ -34883,7 +35343,7 @@ ${lanes.join("\n")} }; function findHighestListElementThatStartsAtPosition(position) { currentArray = void 0; - currentArrayIndex = InvalidPosition.Value; + currentArrayIndex = -1 /* Value */; current = void 0; forEachChild(sourceFile, visitNode3, visitArray2); return; @@ -37740,7 +38200,7 @@ ${lanes.join("\n")} { name: "allowArbitraryExtensions", type: "boolean", - affectsModuleResolution: true, + affectsProgramStructure: true, category: Diagnostics.Modules, description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present, defaultValueDescription: false @@ -38243,6 +38703,22 @@ ${lanes.join("\n")} Debug.assert(extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } + function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) { + if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) { + const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled); + if (originalPath) + resolved = { ...resolved, path: resolvedFileName, originalPath }; + } + return createResolvedModuleWithFailedLookupLocations( + resolved, + isExternalLibraryImport, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache, + legacyResult + ); + } function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); @@ -38401,6 +38877,15 @@ ${lanes.join("\n")} const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */; } + function getOriginalAndResolvedFileName(fileName, host, traceEnabled) { + const resolvedFileName = realPath(fileName, host, traceEnabled); + const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + return { + // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames + resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, + originalPath: pathsAreEqual ? void 0 : fileName + }; + } function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) { Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself."); const traceEnabled = isTraceEnabled(options, host); @@ -38445,9 +38930,9 @@ ${lanes.join("\n")} const affectingLocations = []; let features = getNodeResolutionFeatures(options); if (resolutionMode === 99 /* ESNext */ && (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */)) { - features |= NodeResolutionFeatures.EsmMode; + features |= 32 /* EsmMode */; } - const conditions = features & NodeResolutionFeatures.Exports ? getConditions(options, !!(features & NodeResolutionFeatures.EsmMode)) : []; + const conditions = features & 8 /* Exports */ ? getConditions(options, !!(features & 32 /* EsmMode */)) : []; const diagnostics = []; const moduleResolutionState = { compilerOptions: options, @@ -38472,13 +38957,13 @@ ${lanes.join("\n")} let resolvedTypeReferenceDirective; if (resolved) { const { fileName, packageId } = resolved; - const resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled); - const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + let resolvedFileName = fileName, originalPath; + if (!options.preserveSymlinks) + ({ resolvedFileName, originalPath } = getOriginalAndResolvedFileName(fileName, host, traceEnabled)); resolvedTypeReferenceDirective = { primary, - // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames - resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, - originalPath: pathsAreEqual ? void 0 : fileName, + resolvedFileName, + originalPath, packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) }; @@ -38580,35 +39065,38 @@ ${lanes.join("\n")} } } function getNodeResolutionFeatures(options) { - let features = NodeResolutionFeatures.None; + let features = 0 /* None */; switch (getEmitModuleResolutionKind(options)) { case 3 /* Node16 */: - features = NodeResolutionFeatures.Node16Default; + features = 30 /* Node16Default */; break; case 99 /* NodeNext */: - features = NodeResolutionFeatures.NodeNextDefault; + features = 30 /* NodeNextDefault */; break; case 100 /* Bundler */: - features = NodeResolutionFeatures.BundlerDefault; + features = 30 /* BundlerDefault */; break; } if (options.resolvePackageJsonExports) { - features |= NodeResolutionFeatures.Exports; + features |= 8 /* Exports */; } else if (options.resolvePackageJsonExports === false) { - features &= ~NodeResolutionFeatures.Exports; + features &= ~8 /* Exports */; } if (options.resolvePackageJsonImports) { - features |= NodeResolutionFeatures.Imports; + features |= 2 /* Imports */; } else if (options.resolvePackageJsonImports === false) { - features &= ~NodeResolutionFeatures.Imports; + features &= ~2 /* Imports */; } return features; } function getConditions(options, esmMode) { - const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["node", "import"] : ["node", "require"]; + const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["import"] : ["require"]; if (!options.noDtsResolution) { conditions.push("types"); } + if (getEmitModuleResolutionKind(options) !== 100 /* Bundler */) { + conditions.push("node"); + } return concatenate(conditions, options.customConditions); } function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) { @@ -39322,7 +39810,7 @@ ${lanes.join("\n")} isConfigLookup, candidateIsFromPackageJsonField: false }; - if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) { + if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(compilerOptions))) { trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", ")); } let result; @@ -39348,13 +39836,14 @@ ${lanes.join("\n")} legacyResult = diagnosticResult.value.resolved.path; } } - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache, + state, legacyResult ); function tryResolve(extensions2, state2) { @@ -39384,16 +39873,7 @@ ${lanes.join("\n")} } resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } - if (!resolved2) - return void 0; - let resolvedValue = resolved2.value; - if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) { - const path = realPath(resolvedValue.path, host, traceEnabled); - const pathsAreEqual = arePathsEqual(path, resolvedValue.path, host); - const originalPath = pathsAreEqual ? void 0 : resolvedValue.path; - resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path, originalPath }; - } - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } }; } else { const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName); const resolved2 = nodeLoadModuleByRelativeName( @@ -39575,7 +40055,7 @@ ${lanes.join("\n")} if (!onlyRecordFailures) { if (state.host.fileExists(fileName)) { if (state.traceEnabled) { - trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); + trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName); } return fileName; } else { @@ -40170,18 +40650,24 @@ ${lanes.join("\n")} ))); } else if (typeof target === "object" && target !== null) { if (!Array.isArray(target)) { + traceIfEnabled(state, Diagnostics.Entering_conditional_exports); for (const condition of getOwnKeys(target)) { if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) { traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); const subTarget = target[condition]; const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key); if (result) { + traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition); + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return result; + } else { + traceIfEnabled(state, Diagnostics.Failed_to_resolve_under_condition_0, condition); } } else { traceIfEnabled(state, Diagnostics.Saw_non_matching_condition_0, condition); } } + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return void 0; } else { if (!length(target)) { @@ -40547,13 +41033,14 @@ ${lanes.join("\n")} candidateIsFromPackageJsonField: false }; const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0)); - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, resolved && resolved.value, (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path), failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state ); function tryResolve(extensions) { const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); @@ -40809,35 +41296,36 @@ ${lanes.join("\n")} measure("Bind", "beforeBind", "afterBind"); } function createBinder() { - let file; - let options; - let languageVersion; - let parent2; - let container; - let thisParentContainer; - let blockScopeContainer; - let lastContainer; - let delayedTypeAliases; - let seenThisKeyword; - let currentFlow; - let currentBreakTarget; - let currentContinueTarget; - let currentReturnTarget; - let currentTrueTarget; - let currentFalseTarget; - let currentExceptionTarget; - let preSwitchCaseFlow; - let activeLabelList; - let hasExplicitReturn; - let emitFlags; - let inStrictMode; - let inAssignmentPattern = false; - let symbolCount = 0; - let Symbol46; - let classifiableNames; - const unreachableFlow = { flags: 1 /* Unreachable */ }; - const reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; - const bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + var file; + var options; + var languageVersion; + var parent2; + var container; + var thisParentContainer; + var blockScopeContainer; + var lastContainer; + var delayedTypeAliases; + var seenThisKeyword; + var currentFlow; + var currentBreakTarget; + var currentContinueTarget; + var currentReturnTarget; + var currentTrueTarget; + var currentFalseTarget; + var currentExceptionTarget; + var preSwitchCaseFlow; + var activeLabelList; + var hasExplicitReturn; + var emitFlags; + var inStrictMode; + var inAssignmentPattern = false; + var symbolCount = 0; + var Symbol46; + var classifiableNames; + var unreachableFlow = { flags: 1 /* Unreachable */ }; + var reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; + var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + return bindSourceFile2; function createDiagnosticForNode2(node, message, arg0, arg1, arg2) { return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2); } @@ -40888,7 +41376,6 @@ ${lanes.join("\n")} inAssignmentPattern = false; emitFlags = 0 /* None */; } - return bindSourceFile2; function bindInStrictMode(file2, opts) { if (getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { return true; @@ -43885,7 +44372,7 @@ ${lanes.join("\n")} let redirectPathsSpecifiers; let relativeSpecifiers; for (const modulePath of modulePaths) { - const specifier = tryGetModuleNameAsNodeModule( + const specifier = modulePath.isInNodeModules ? tryGetModuleNameAsNodeModule( modulePath, info, importingSourceFile, @@ -43895,7 +44382,7 @@ ${lanes.join("\n")} /*packageNameOnly*/ void 0, options.overrideImportMode - ); + ) : void 0; nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier); if (specifier && modulePath.isRedirect) { return nodeModulesSpecifiers; @@ -44307,9 +44794,11 @@ ${lanes.join("\n")} if (typeof cachedPackageJson === "object" || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) { const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath)); const importMode = overrideMode || importingSourceFile.impliedNodeFormat; - if (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */) { - const conditions = ["node", importMode === 99 /* ESNext */ ? "import" : "require", "types"]; - const fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions) : void 0; + if (getResolvePackageJsonExports(options)) { + const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1); + const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2); + const conditions = getConditions(options, importMode === 99 /* ESNext */); + const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0; if (fromExports) { const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) }; return { ...withJsExtension, verbatimFromExports: true }; @@ -44503,8 +44992,8 @@ ${lanes.join("\n")} return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */; } function createTypeChecker(host) { - const getPackagesMap = memoize(() => { - const map2 = /* @__PURE__ */ new Map(); + var getPackagesMap = memoize(() => { + var map2 = /* @__PURE__ */ new Map(); host.getSourceFiles().forEach((sf) => { if (!sf.resolvedModules) return; @@ -44515,57 +45004,58 @@ ${lanes.join("\n")} }); return map2; }); - let deferredDiagnosticsCallbacks = []; - let addLazyDiagnostic = (arg) => { + var deferredDiagnosticsCallbacks = []; + var addLazyDiagnostic = (arg) => { deferredDiagnosticsCallbacks.push(arg); }; - let cancellationToken; - const requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); - let requestedExternalEmitHelpers; - let externalHelpersModule; - const Symbol46 = objectAllocator.getSymbolConstructor(); - const Type27 = objectAllocator.getTypeConstructor(); - const Signature15 = objectAllocator.getSignatureConstructor(); - let typeCount = 0; - let symbolCount = 0; - let totalInstantiationCount = 0; - let instantiationCount = 0; - let instantiationDepth = 0; - let inlineLevel = 0; - let currentNode; - let varianceTypeParameter; - const emptySymbols = createSymbolTable(); - const arrayVariances = [1 /* Covariant */]; - const compilerOptions = host.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const moduleKind = getEmitModuleKind(compilerOptions); - const legacyDecorators = !!compilerOptions.experimentalDecorators; - const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); - const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); - const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); - const strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); - const strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); - const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); - const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); - const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); - const useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); - const keyofStringsOnly = !!compilerOptions.keyofStringsOnly; - const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */; - const exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; - const checkBinaryExpression = createCheckBinaryExpression(); - const emitResolver = createResolver(); - const nodeBuilder = createNodeBuilder(); - const globals = createSymbolTable(); - const undefinedSymbol = createSymbol(4 /* Property */, "undefined"); + var cancellationToken; + var requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); + var requestedExternalEmitHelpers; + var externalHelpersModule; + var Symbol46 = objectAllocator.getSymbolConstructor(); + var Type27 = objectAllocator.getTypeConstructor(); + var Signature15 = objectAllocator.getSignatureConstructor(); + var typeCount = 0; + var symbolCount = 0; + var totalInstantiationCount = 0; + var instantiationCount = 0; + var instantiationDepth = 0; + var inlineLevel = 0; + var currentNode; + var varianceTypeParameter; + var isInferencePartiallyBlocked = false; + var emptySymbols = createSymbolTable(); + var arrayVariances = [1 /* Covariant */]; + var compilerOptions = host.getCompilerOptions(); + var languageVersion = getEmitScriptTarget(compilerOptions); + var moduleKind = getEmitModuleKind(compilerOptions); + var legacyDecorators = !!compilerOptions.experimentalDecorators; + var useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); + var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); + var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); + var strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); + var strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); + var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); + var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); + var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); + var keyofStringsOnly = !!compilerOptions.keyofStringsOnly; + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */; + var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; + var checkBinaryExpression = createCheckBinaryExpression(); + var emitResolver = createResolver(); + var nodeBuilder = createNodeBuilder(); + var globals = createSymbolTable(); + var undefinedSymbol = createSymbol(4 /* Property */, "undefined"); undefinedSymbol.declarations = []; - const globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); + var globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); globalThisSymbol.exports = globals; globalThisSymbol.declarations = []; globals.set(globalThisSymbol.escapedName, globalThisSymbol); - const argumentsSymbol = createSymbol(4 /* Property */, "arguments"); - const requireSymbol = createSymbol(4 /* Property */, "require"); - const isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; - let apparentArgumentCount; + var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); + var requireSymbol = createSymbol(4 /* Property */, "require"); + var isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; + var apparentArgumentCount; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0), @@ -44743,15 +45233,14 @@ ${lanes.join("\n")} getTypeOfPropertyOfContextualType, getFullyQualifiedName, getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */), - getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => getResolvedSignatureWorker( + getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker( call, candidatesOutArray, /*argumentCount*/ void 0, - 32 /* IsForStringLiteralArgumentCompletions */, - editingArgument - ), - getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */), + 32 /* IsForStringLiteralArgumentCompletions */ + )), + getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)), getExpandedParameters, hasEffectiveRestParameter, containsArgumentsReference, @@ -44856,6 +45345,7 @@ ${lanes.join("\n")} isArrayType, isTupleType, isArrayLikeType, + isEmptyAnonymousObjectType, isTypeInvalidDueToUnionDiscriminant, getExactOptionalProperties, getAllPossiblePropertiesOfTypes, @@ -44942,81 +45432,93 @@ ${lanes.join("\n")} isPropertyAccessible, getTypeOnlyAliasDeclaration, getMemberOverrideModifierStatus, - isTypeParameterPossiblyReferenced + isTypeParameterPossiblyReferenced, + typeHasCallOrConstructSignatures }; - function runWithInferenceBlockedFromSourceNode(node, fn) { + function runWithoutResolvedSignatureCaching(node, fn) { const containingCall = findAncestor(node, isCallLikeExpression); const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature; + if (containingCall) { + getNodeLinks(containingCall).resolvedSignature = void 0; + } + const result = fn(); + if (containingCall) { + getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; + } + return result; + } + function runWithInferenceBlockedFromSourceNode(node, fn) { + const containingCall = findAncestor(node, isCallLikeExpression); if (containingCall) { let toMarkSkip = node; do { getNodeLinks(toMarkSkip).skipDirectInference = true; toMarkSkip = toMarkSkip.parent; } while (toMarkSkip && toMarkSkip !== containingCall); - getNodeLinks(containingCall).resolvedSignature = void 0; } - const result = fn(); + isInferencePartiallyBlocked = true; + const result = runWithoutResolvedSignatureCaching(node, fn); + isInferencePartiallyBlocked = false; if (containingCall) { let toMarkSkip = node; do { getNodeLinks(toMarkSkip).skipDirectInference = void 0; toMarkSkip = toMarkSkip.parent; } while (toMarkSkip && toMarkSkip !== containingCall); - getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; } return result; } - function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode, editingArgument) { + function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) { const node = getParseTreeNode(nodeIn, isCallLikeExpression); apparentArgumentCount = argumentCount; - const res = !node ? void 0 : editingArgument ? runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignature(node, candidatesOutArray, checkMode)) : getResolvedSignature(node, candidatesOutArray, checkMode); + const res = !node ? void 0 : getResolvedSignature(node, candidatesOutArray, checkMode); apparentArgumentCount = void 0; return res; } - const tupleTypes = /* @__PURE__ */ new Map(); - const unionTypes = /* @__PURE__ */ new Map(); - const intersectionTypes = /* @__PURE__ */ new Map(); - const stringLiteralTypes = /* @__PURE__ */ new Map(); - const numberLiteralTypes = /* @__PURE__ */ new Map(); - const bigIntLiteralTypes = /* @__PURE__ */ new Map(); - const enumLiteralTypes = /* @__PURE__ */ new Map(); - const indexedAccessTypes = /* @__PURE__ */ new Map(); - const templateLiteralTypes = /* @__PURE__ */ new Map(); - const stringMappingTypes = /* @__PURE__ */ new Map(); - const substitutionTypes = /* @__PURE__ */ new Map(); - const subtypeReductionCache = /* @__PURE__ */ new Map(); - const decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); - const cachedTypes = /* @__PURE__ */ new Map(); - const evolvingArrayTypes = []; - const undefinedProperties = /* @__PURE__ */ new Map(); - const markerTypes = /* @__PURE__ */ new Set(); - const unknownSymbol = createSymbol(4 /* Property */, "unknown"); - const resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); - const unresolvedSymbols = /* @__PURE__ */ new Map(); - const errorTypes = /* @__PURE__ */ new Map(); - const anyType = createIntrinsicType(1 /* Any */, "any"); - const autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); - const wildcardType = createIntrinsicType(1 /* Any */, "any"); - const errorType = createIntrinsicType(1 /* Any */, "error"); - const unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); - const nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); - const intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); - const unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - const nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - const undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); - const missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; - const optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); - const nullType = createIntrinsicType(65536 /* Null */, "null"); - const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); - const stringType = createIntrinsicType(4 /* String */, "string"); - const numberType = createIntrinsicType(8 /* Number */, "number"); - const bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); - const falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - const regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - const trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); - const regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var tupleTypes = /* @__PURE__ */ new Map(); + var unionTypes = /* @__PURE__ */ new Map(); + var intersectionTypes = /* @__PURE__ */ new Map(); + var stringLiteralTypes = /* @__PURE__ */ new Map(); + var numberLiteralTypes = /* @__PURE__ */ new Map(); + var bigIntLiteralTypes = /* @__PURE__ */ new Map(); + var enumLiteralTypes = /* @__PURE__ */ new Map(); + var indexedAccessTypes = /* @__PURE__ */ new Map(); + var templateLiteralTypes = /* @__PURE__ */ new Map(); + var stringMappingTypes = /* @__PURE__ */ new Map(); + var substitutionTypes = /* @__PURE__ */ new Map(); + var subtypeReductionCache = /* @__PURE__ */ new Map(); + var decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); + var cachedTypes = /* @__PURE__ */ new Map(); + var evolvingArrayTypes = []; + var undefinedProperties = /* @__PURE__ */ new Map(); + var markerTypes = /* @__PURE__ */ new Set(); + var unknownSymbol = createSymbol(4 /* Property */, "unknown"); + var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); + var unresolvedSymbols = /* @__PURE__ */ new Map(); + var errorTypes = /* @__PURE__ */ new Map(); + var anyType = createIntrinsicType(1 /* Any */, "any"); + var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); + var errorType = createIntrinsicType(1 /* Any */, "error"); + var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); + var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); + var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); + var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); + var missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; + var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var nullType = createIntrinsicType(65536 /* Null */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); + var stringType = createIntrinsicType(4 /* String */, "string"); + var numberType = createIntrinsicType(8 /* Number */, "number"); + var bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); + var falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); trueType.regularType = regularTrueType; trueType.freshType = trueType; regularTrueType.regularType = regularTrueType; @@ -45025,26 +45527,26 @@ ${lanes.join("\n")} falseType.freshType = falseType; regularFalseType.regularType = regularFalseType; regularFalseType.freshType = falseType; - const booleanType = getUnionType([regularFalseType, regularTrueType]); - const esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); - const voidType = createIntrinsicType(16384 /* Void */, "void"); - const neverType = createIntrinsicType(131072 /* Never */, "never"); - const silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); - const implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); - const unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); - const nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); - const stringOrNumberType = getUnionType([stringType, numberType]); - const stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); - const keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; - const numberOrBigIntType = getUnionType([numberType, bigintType]); - const templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); - const numericStringType = getTemplateLiteralType(["", ""], [numberType]); - const restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); - const permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); - const uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); - const uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); - let outofbandVarianceMarkerHandler; - const reportUnreliableMapper = makeFunctionTypeMapper((t) => { + var booleanType = getUnionType([regularFalseType, regularTrueType]); + var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); + var voidType = createIntrinsicType(16384 /* Void */, "void"); + var neverType = createIntrinsicType(131072 /* Never */, "never"); + var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); + var implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); + var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); + var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); + var stringOrNumberType = getUnionType([stringType, numberType]); + var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); + var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; + var numberOrBigIntType = getUnionType([numberType, bigintType]); + var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); + var numericStringType = getTemplateLiteralType(["", ""], [numberType]); + var restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); + var permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); + var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); + var uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); + var outofbandVarianceMarkerHandler; + var reportUnreliableMapper = makeFunctionTypeMapper((t) => { if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { outofbandVarianceMarkerHandler( /*onlyUnreliable*/ @@ -45053,7 +45555,7 @@ ${lanes.join("\n")} } return t; }, () => "(unmeasurable reporter)"); - const reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { + var reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { outofbandVarianceMarkerHandler( /*onlyUnreliable*/ @@ -45062,30 +45564,30 @@ ${lanes.join("\n")} } return t; }, () => "(unreliable reporter)"); - const emptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */; - const emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); + var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = createSymbolTable(); - const emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); - const unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; - const emptyGenericType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; + var emptyGenericType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); emptyGenericType.instantiations = /* @__PURE__ */ new Map(); - const anyFunctionType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var anyFunctionType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); anyFunctionType.objectFlags |= 262144 /* NonInferrableType */; - const noConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const circularConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const resolvingDefaultType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); - const markerSuperType = createTypeParameter(); - const markerSubType = createTypeParameter(); + var noConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var circularConstraintType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var resolvingDefaultType = createAnonymousType(void 0, emptySymbols, emptyArray, emptyArray, emptyArray); + var markerSuperType = createTypeParameter(); + var markerSubType = createTypeParameter(); markerSubType.constraint = markerSuperType; - const markerOtherType = createTypeParameter(); - const markerSuperTypeForCheck = createTypeParameter(); - const markerSubTypeForCheck = createTypeParameter(); + var markerOtherType = createTypeParameter(); + var markerSuperTypeForCheck = createTypeParameter(); + var markerSubTypeForCheck = createTypeParameter(); markerSubTypeForCheck.constraint = markerSuperTypeForCheck; - const noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); - const anySignature = createSignature( + var noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); + var anySignature = createSignature( void 0, void 0, void 0, @@ -45096,7 +45598,7 @@ ${lanes.join("\n")} 0, 0 /* None */ ); - const unknownSignature = createSignature( + var unknownSignature = createSignature( void 0, void 0, void 0, @@ -45107,7 +45609,7 @@ ${lanes.join("\n")} 0, 0 /* None */ ); - const resolvingSignature = createSignature( + var resolvingSignature = createSignature( void 0, void 0, void 0, @@ -45118,7 +45620,7 @@ ${lanes.join("\n")} 0, 0 /* None */ ); - const silentNeverSignature = createSignature( + var silentNeverSignature = createSignature( void 0, void 0, void 0, @@ -45129,14 +45631,14 @@ ${lanes.join("\n")} 0, 0 /* None */ ); - const enumNumberIndexInfo = createIndexInfo( + var enumNumberIndexInfo = createIndexInfo( numberType, stringType, /*isReadonly*/ true ); - const iterationTypesCache = /* @__PURE__ */ new Map(); - const noIterationTypes = { + var iterationTypesCache = /* @__PURE__ */ new Map(); + var noIterationTypes = { get yieldType() { return Debug.fail("Not supported"); }, @@ -45147,10 +45649,10 @@ ${lanes.join("\n")} return Debug.fail("Not supported"); } }; - const anyIterationTypes = createIterationTypes(anyType, anyType, anyType); - const anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); - const defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); - const asyncIterationTypesResolver = { + var anyIterationTypes = createIterationTypes(anyType, anyType, anyType); + var anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); + var defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); + var asyncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfAsyncIterable", iteratorCacheKey: "iterationTypesOfAsyncIterator", iteratorSymbolName: "asyncIterator", @@ -45163,7 +45665,7 @@ ${lanes.join("\n")} mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method, mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property }; - const syncIterationTypesResolver = { + var syncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfIterable", iteratorCacheKey: "iterationTypesOfIterator", iteratorSymbolName: "iterator", @@ -45176,117 +45678,118 @@ ${lanes.join("\n")} mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_iterator_must_be_a_method, mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property }; - let amalgamatedDuplicates; - const reverseMappedCache = /* @__PURE__ */ new Map(); - let inInferTypeForHomomorphicMappedType = false; - let ambientModulesCache; - let patternAmbientModules; - let patternAmbientModuleAugmentations; - let globalObjectType; - let globalFunctionType; - let globalCallableFunctionType; - let globalNewableFunctionType; - let globalArrayType; - let globalReadonlyArrayType; - let globalStringType; - let globalNumberType; - let globalBooleanType; - let globalRegExpType; - let globalThisType; - let anyArrayType; - let autoArrayType; - let anyReadonlyArrayType; - let deferredGlobalNonNullableTypeAlias; - let deferredGlobalESSymbolConstructorSymbol; - let deferredGlobalESSymbolConstructorTypeSymbol; - let deferredGlobalESSymbolType; - let deferredGlobalTypedPropertyDescriptorType; - let deferredGlobalPromiseType; - let deferredGlobalPromiseLikeType; - let deferredGlobalPromiseConstructorSymbol; - let deferredGlobalPromiseConstructorLikeType; - let deferredGlobalIterableType; - let deferredGlobalIteratorType; - let deferredGlobalIterableIteratorType; - let deferredGlobalGeneratorType; - let deferredGlobalIteratorYieldResultType; - let deferredGlobalIteratorReturnResultType; - let deferredGlobalAsyncIterableType; - let deferredGlobalAsyncIteratorType; - let deferredGlobalAsyncIterableIteratorType; - let deferredGlobalAsyncGeneratorType; - let deferredGlobalTemplateStringsArrayType; - let deferredGlobalImportMetaType; - let deferredGlobalImportMetaExpressionType; - let deferredGlobalImportCallOptionsType; - let deferredGlobalExtractSymbol; - let deferredGlobalOmitSymbol; - let deferredGlobalAwaitedSymbol; - let deferredGlobalBigIntType; - let deferredGlobalNaNSymbol; - let deferredGlobalRecordSymbol; - let deferredGlobalClassDecoratorContextType; - let deferredGlobalClassMethodDecoratorContextType; - let deferredGlobalClassGetterDecoratorContextType; - let deferredGlobalClassSetterDecoratorContextType; - let deferredGlobalClassAccessorDecoratorContextType; - let deferredGlobalClassAccessorDecoratorTargetType; - let deferredGlobalClassAccessorDecoratorResultType; - let deferredGlobalClassFieldDecoratorContextType; - const allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); - let flowLoopStart = 0; - let flowLoopCount = 0; - let sharedFlowCount = 0; - let flowAnalysisDisabled = false; - let flowInvocationCount = 0; - let lastFlowNode; - let lastFlowNodeReachable; - let flowTypeCache; - const contextualTypeNodes = []; - const contextualTypes = []; - let contextualTypeCount = 0; - const inferenceContextNodes = []; - const inferenceContexts = []; - let inferenceContextCount = 0; - const emptyStringType = getStringLiteralType(""); - const zeroType = getNumberLiteralType(0); - const zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); - const resolutionTargets = []; - const resolutionResults = []; - const resolutionPropertyNames = []; - let suggestionCount = 0; - const maximumSuggestionCount = 10; - const mergedSymbols = []; - const symbolLinks = []; - const nodeLinks = []; - const flowLoopCaches = []; - const flowLoopNodes = []; - const flowLoopKeys = []; - const flowLoopTypes = []; - const sharedFlowNodes = []; - const sharedFlowTypes = []; - const flowNodeReachable = []; - const flowNodePostSuper = []; - const potentialThisCollisions = []; - const potentialNewTargetCollisions = []; - const potentialWeakMapSetCollisions = []; - const potentialReflectCollisions = []; - const potentialUnusedRenamedBindingElementsInTypes = []; - const awaitedTypeStack = []; - const diagnostics = createDiagnosticCollection(); - const suggestionDiagnostics = createDiagnosticCollection(); - const typeofType = createTypeofType(); - let _jsxNamespace; - let _jsxFactoryEntity; - const subtypeRelation = /* @__PURE__ */ new Map(); - const strictSubtypeRelation = /* @__PURE__ */ new Map(); - const assignableRelation = /* @__PURE__ */ new Map(); - const comparableRelation = /* @__PURE__ */ new Map(); - const identityRelation = /* @__PURE__ */ new Map(); - const enumRelation = /* @__PURE__ */ new Map(); - const builtinGlobals = createSymbolTable(); + var amalgamatedDuplicates; + var reverseMappedCache = /* @__PURE__ */ new Map(); + var inInferTypeForHomomorphicMappedType = false; + var ambientModulesCache; + var patternAmbientModules; + var patternAmbientModuleAugmentations; + var globalObjectType; + var globalFunctionType; + var globalCallableFunctionType; + var globalNewableFunctionType; + var globalArrayType; + var globalReadonlyArrayType; + var globalStringType; + var globalNumberType; + var globalBooleanType; + var globalRegExpType; + var globalThisType; + var anyArrayType; + var autoArrayType; + var anyReadonlyArrayType; + var deferredGlobalNonNullableTypeAlias; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolConstructorTypeSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseLikeType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalGeneratorType; + var deferredGlobalIteratorYieldResultType; + var deferredGlobalIteratorReturnResultType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalAsyncGeneratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredGlobalImportMetaType; + var deferredGlobalImportMetaExpressionType; + var deferredGlobalImportCallOptionsType; + var deferredGlobalExtractSymbol; + var deferredGlobalOmitSymbol; + var deferredGlobalAwaitedSymbol; + var deferredGlobalBigIntType; + var deferredGlobalNaNSymbol; + var deferredGlobalRecordSymbol; + var deferredGlobalClassDecoratorContextType; + var deferredGlobalClassMethodDecoratorContextType; + var deferredGlobalClassGetterDecoratorContextType; + var deferredGlobalClassSetterDecoratorContextType; + var deferredGlobalClassAccessorDecoratorContextType; + var deferredGlobalClassAccessorDecoratorTargetType; + var deferredGlobalClassAccessorDecoratorResultType; + var deferredGlobalClassFieldDecoratorContextType; + var allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); + var flowLoopStart = 0; + var flowLoopCount = 0; + var sharedFlowCount = 0; + var flowAnalysisDisabled = false; + var flowInvocationCount = 0; + var lastFlowNode; + var lastFlowNodeReachable; + var flowTypeCache; + var contextualTypeNodes = []; + var contextualTypes = []; + var contextualIsCache = []; + var contextualTypeCount = 0; + var inferenceContextNodes = []; + var inferenceContexts = []; + var inferenceContextCount = 0; + var emptyStringType = getStringLiteralType(""); + var zeroType = getNumberLiteralType(0); + var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); + var resolutionTargets = []; + var resolutionResults = []; + var resolutionPropertyNames = []; + var suggestionCount = 0; + var maximumSuggestionCount = 10; + var mergedSymbols = []; + var symbolLinks = []; + var nodeLinks = []; + var flowLoopCaches = []; + var flowLoopNodes = []; + var flowLoopKeys = []; + var flowLoopTypes = []; + var sharedFlowNodes = []; + var sharedFlowTypes = []; + var flowNodeReachable = []; + var flowNodePostSuper = []; + var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; + var potentialWeakMapSetCollisions = []; + var potentialReflectCollisions = []; + var potentialUnusedRenamedBindingElementsInTypes = []; + var awaitedTypeStack = []; + var diagnostics = createDiagnosticCollection(); + var suggestionDiagnostics = createDiagnosticCollection(); + var typeofType = createTypeofType(); + var _jsxNamespace; + var _jsxFactoryEntity; + var subtypeRelation = /* @__PURE__ */ new Map(); + var strictSubtypeRelation = /* @__PURE__ */ new Map(); + var assignableRelation = /* @__PURE__ */ new Map(); + var comparableRelation = /* @__PURE__ */ new Map(); + var identityRelation = /* @__PURE__ */ new Map(); + var enumRelation = /* @__PURE__ */ new Map(); + var builtinGlobals = createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); - const suggestedExtensions = [ + var suggestedExtensions = [ [".mts", ".mjs"], [".ts", ".js"], [".cts", ".cjs"], @@ -46678,7 +47181,12 @@ ${lanes.join("\n")} } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { const exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - const exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + const exportSymbol = exportValue ? getPropertyOfType( + getTypeOfSymbol(exportValue), + name, + /*skipObjectFunctionPropertyAugment*/ + true + ) : moduleSymbol.exports.get(name); const resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly( sourceNode, @@ -47713,12 +48221,9 @@ ${lanes.join("\n")} if (resolutionDiagnostic) { error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); } else { - const tsExtension = tryExtractTSExtension(moduleReference); const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); const resolutionIsNode16OrNext = moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */; - if (tsExtension) { - errorOnTSExtensionImport(tsExtension); - } else if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { + if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); @@ -47738,14 +48243,12 @@ ${lanes.join("\n")} } } return void 0; - function errorOnTSExtensionImport(tsExtension) { - const diag2 = Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead; - error(errorNode, diag2, tsExtension, getSuggestedImportSource(tsExtension)); - } function getSuggestedImportSource(tsExtension) { const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension); if (emitModuleKindIsNonNodeESM(moduleKind) || mode === 99 /* ESNext */) { - return importSourceWithoutExtension + (tsExtension === ".mts" /* Mts */ ? ".mjs" : tsExtension === ".cts" /* Cts */ ? ".cjs" : ".js"); + const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions); + const ext = tsExtension === ".mts" /* Mts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" /* Cts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js"; + return importSourceWithoutExtension + ext; } return importSourceWithoutExtension; } @@ -47932,7 +48435,7 @@ ${lanes.join("\n")} return shouldTreatPropertiesOfExternalModuleAsExports(type) ? getPropertyOfType(type, memberName) : void 0; } function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) { - return !(resolvedExternalModuleType.flags & 131068 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path + return !(resolvedExternalModuleType.flags & 134348796 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path isArrayType(resolvedExternalModuleType) || isTupleType(resolvedExternalModuleType)); } function getExportsOfSymbol(symbol) { @@ -49231,7 +49734,7 @@ ${lanes.join("\n")} return result; } function createAnonymousTypeNode(type2) { - var _a3; + var _a3, _b2; const typeId = type2.id; const symbol = type2.symbol; if (symbol) { @@ -49257,6 +49760,20 @@ ${lanes.join("\n")} return visitAndTransformType(type2, createTypeNodeFromObjectType); } } else { + const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */); + if (isInstantiationExpressionType) { + const instantiationExpressionType = type2; + if (isTypeQueryNode(instantiationExpressionType.node)) { + const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node); + if (typeNode) { + return typeNode; + } + } + if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { + return createElidedInformationPlaceholder(context); + } + return visitAndTransformType(type2, createTypeNodeFromObjectType); + } return createTypeNodeFromObjectType(type2); } function shouldWriteTypeOfFunctionSymbol() { @@ -49765,7 +50282,7 @@ ${lanes.join("\n")} ); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { - var _a2, _b, _c, _d; + var _a2, _b, _c, _d, _e; const suppressAny = context.flags & 256 /* SuppressAnyReturnType */; if (suppressAny) context.flags &= ~256 /* SuppressAnyReturnType */; @@ -49782,6 +50299,39 @@ ${lanes.join("\n")} /*skipUnionExpanding*/ true )[0]; + let cleanup; + if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) { + const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0; + Debug.assertOptionalNode(existingFakeScope, isBlock); + const locals = (_a2 = existingFakeScope == null ? void 0 : existingFakeScope.locals) != null ? _a2 : createSymbolTable(); + let newLocals; + for (const param of expandedParams) { + if (!locals.has(param.escapedName)) { + newLocals = append(newLocals, param.escapedName); + locals.set(param.escapedName, param); + } + } + if (newLocals) { + let removeNewLocals2 = function() { + forEach(newLocals, (s) => locals.delete(s)); + }; + var removeNewLocals = removeNewLocals2; + if (existingFakeScope) { + cleanup = removeNewLocals2; + } else { + const fakeScope = parseNodeFactory.createBlock(emptyArray); + getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true; + fakeScope.locals = locals; + const saveEnclosingDeclaration = context.enclosingDeclaration; + setParent(fakeScope, saveEnclosingDeclaration); + context.enclosingDeclaration = fakeScope; + cleanup = () => { + context.enclosingDeclaration = saveEnclosingDeclaration; + removeNewLocals2(); + }; + } + } + } const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports)); const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context); if (thisParameter) { @@ -49807,11 +50357,11 @@ ${lanes.join("\n")} const flags = modifiersToFlags(modifiers); modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */); } - const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration( + const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration( modifiers, /*asteriskToken*/ void 0, - (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), + (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), /*questionToken*/ void 0, typeParameters, @@ -49826,14 +50376,14 @@ ${lanes.join("\n")} void 0 ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration( modifiers, - (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), + (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ void 0 ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration( modifiers, - (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), + (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""), parameters, /*body*/ void 0 @@ -49868,13 +50418,14 @@ ${lanes.join("\n")} if (typeArguments) { node.typeArguments = factory.createNodeArray(typeArguments); } + cleanup == null ? void 0 : cleanup(); return node; } function tryGetThisParameterDeclaration(signature, context) { if (signature.thisParameter) { return symbolToParameterDeclaration(signature.thisParameter, context); } - if (signature.declaration) { + if (signature.declaration && isInJSFile(signature.declaration)) { const thisTag = getJSDocThisTag(signature.declaration); if (thisTag && thisTag.typeExpression) { return factory.createParameterDeclaration( @@ -50482,9 +51033,12 @@ ${lanes.join("\n")} function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) { return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters); } + function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) { + return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration; + } function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) { if (!isErrorType(type) && enclosingDeclaration) { - const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration); + const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration)); if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) { const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation); if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) { @@ -50516,7 +51070,8 @@ ${lanes.join("\n")} function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) { if (!isErrorType(type) && context.enclosingDeclaration) { const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); - if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) { + const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration); + if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) { const annotated = getTypeFromTypeNode(annotation); const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated; if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) { @@ -52131,8 +52686,8 @@ ${lanes.join("\n")} const t = types[i]; flags |= t.flags; if (!(t.flags & 98304 /* Nullable */)) { - if (t.flags & (512 /* BooleanLiteral */ | 1024 /* EnumLiteral */)) { - const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLiteralType(t); + if (t.flags & (512 /* BooleanLiteral */ | 1056 /* EnumLike */)) { + const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLikeType(t); if (baseType.flags & 1048576 /* Union */) { const count = baseType.types.length; if (i + count <= types.length && getRegularTypeOfLiteralType(types[i + count - 1]) === getRegularTypeOfLiteralType(baseType.types[count - 1])) { @@ -52387,7 +52942,7 @@ ${lanes.join("\n")} } function findResolutionCycleStartIndex(target, propertyName) { for (let i = resolutionTargets.length - 1; i >= 0; i--) { - if (hasType2(resolutionTargets[i], resolutionPropertyNames[i])) { + if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) { return -1; } if (resolutionTargets[i] === target && resolutionPropertyNames[i] === propertyName) { @@ -52396,7 +52951,7 @@ ${lanes.join("\n")} } return -1; } - function hasType2(target, propertyName) { + function resolutionTargetHasProperty(target, propertyName) { switch (propertyName) { case 0 /* Type */: return !!getSymbolLinks(target).type; @@ -52416,6 +52971,8 @@ ${lanes.join("\n")} return !!target.baseTypesResolved; case 8 /* WriteType */: return !!getSymbolLinks(target).writeType; + case 9 /* ParameterInitializerContainsUndefined */: + return getNodeLinks(target).parameterInitializerContainsUndefined !== void 0; } return Debug.assertNever(propertyName); } @@ -52855,7 +53412,7 @@ ${lanes.join("\n")} function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) { const container = getAssignedExpandoInitializer(symbol.valueDeclaration); if (container) { - const tag = getJSDocTypeTag(container); + const tag = isInJSFile(container) ? getJSDocTypeTag(container) : void 0; if (tag && tag.typeExpression) { return getTypeFromTypeNode(tag.typeExpression); } @@ -54007,8 +54564,8 @@ ${lanes.join("\n")} } return links.declaredType; } - function getBaseTypeOfEnumLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; + function getBaseTypeOfEnumLikeType(type) { + return type.flags & 1056 /* EnumLike */ && type.symbol.flags & 8 /* EnumMember */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; } function getDeclaredTypeOfEnum(symbol) { const links = getSymbolLinks(symbol); @@ -54021,7 +54578,7 @@ ${lanes.join("\n")} if (hasBindableName(member)) { const memberSymbol = getSymbolOfDeclaration(member); const value = getEnumMemberValue(member); - const memberType = value !== void 0 ? getFreshTypeOfLiteralType(getEnumLiteralType(value, getSymbolId(symbol), memberSymbol)) : createTypeWithSymbol(32 /* Enum */, memberSymbol); + const memberType = getFreshTypeOfLiteralType(value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol)); getSymbolLinks(memberSymbol).declaredType = memberType; memberTypeList.push(getRegularTypeOfLiteralType(memberType)); } @@ -54035,7 +54592,7 @@ ${lanes.join("\n")} symbol, /*aliasTypeArguments*/ void 0 - ) : createTypeWithSymbol(32 /* Enum */, symbol); + ) : createComputedEnumType(symbol); if (enumType.flags & 1048576 /* Union */) { enumType.flags |= 1024 /* EnumLiteral */; enumType.symbol = symbol; @@ -54044,6 +54601,15 @@ ${lanes.join("\n")} } return links.declaredType; } + function createComputedEnumType(symbol) { + const regularType = createTypeWithSymbol(32 /* Enum */, symbol); + const freshType = createTypeWithSymbol(32 /* Enum */, symbol); + regularType.regularType = regularType; + regularType.freshType = freshType; + freshType.regularType = regularType; + freshType.freshType = freshType; + return regularType; + } function getDeclaredTypeOfEnumMember(symbol) { const links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -54992,6 +55558,7 @@ ${lanes.join("\n")} const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); const nameType = getNameTypeFromMappedType(type.target || type); + const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); const templateType = getTemplateTypeFromMappedType(type.target || type); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); const templateModifiers = getMappedTypeModifiers(type); @@ -55029,7 +55596,7 @@ ${lanes.join("\n")} prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = nameType ? void 0 : modifiersProp.declarations; + prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0; } members.set(propName, prop); } @@ -55973,6 +56540,12 @@ ${lanes.join("\n")} thisParameter = getAnnotatedAccessorThisParameter(other); } } + if (isInJSFile(declaration)) { + const thisTag = getJSDocThisTag(declaration); + if (thisTag && thisTag.typeExpression) { + thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression)); + } + } const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0; const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) { @@ -56086,7 +56659,11 @@ ${lanes.join("\n")} if (node.tags) { for (const tag of node.tags) { if (isJSDocOverloadTag(tag)) { - result.push(getSignatureFromDeclaration(tag.typeExpression)); + const jsDocSignature = tag.typeExpression; + if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) { + reportImplicitAny(jsDocSignature, anyType); + } + result.push(getSignatureFromDeclaration(jsDocSignature)); hasJSDocOverloads = true; } } @@ -56195,6 +56772,12 @@ ${lanes.join("\n")} if (declaration.kind === 173 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } + if (isJSDocSignature(declaration)) { + const root = getJSDocRoot(declaration); + if (root && isConstructorDeclaration(root.parent)) { + return getDeclaredTypeOfClassOrInterface(getMergedSymbol(root.parent.parent.symbol)); + } + } if (isJSDocConstructSignature(declaration)) { return getTypeFromTypeNode(declaration.parameters[0].type); } @@ -56373,7 +56956,7 @@ ${lanes.join("\n")} const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); if (grandParent.kind === 180 /* TypeReference */ && !omitTypeReferences) { const typeReference = grandParent; - const typeParameters = getTypeParametersForTypeReference(typeReference); + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); if (typeParameters) { const index = typeReference.typeArguments.indexOf(childTypeParameter); if (index < typeParameters.length) { @@ -56723,7 +57306,7 @@ ${lanes.join("\n")} return links.resolvedJSDocType; } function getSubstitutionType(baseType, constraint) { - if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) { + if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */) { return baseType; } const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`; @@ -57666,7 +58249,7 @@ ${lanes.join("\n")} } } function removeStringLiteralsMatchedByTemplateLiterals(types) { - const templates = filter(types, isPatternLiteralType); + const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)); if (templates.length) { let i = types.length; while (i > 0) { @@ -57716,7 +58299,7 @@ ${lanes.join("\n")} orderedRemoveItemAt(typeSet, 1); } } - if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) { + if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) { removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */)); } if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { @@ -57785,7 +58368,7 @@ ${lanes.join("\n")} function typePredicateKindsMatch(a, b) { return a.kind === b.kind && a.parameterIndex === b.parameterIndex; } - function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments, origin) { + function getUnionTypeFromSortedList(types, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) { if (types.length === 0) { return neverType; } @@ -57797,7 +58380,7 @@ ${lanes.join("\n")} let type = unionTypes.get(id); if (!type) { type = createType(1048576 /* Union */); - type.objectFlags = objectFlags | getPropagatingFlagsOfTypes( + type.objectFlags = precomputedObjectFlags | getPropagatingFlagsOfTypes( types, /*excludeKinds*/ 98304 /* Nullable */ @@ -57847,7 +58430,7 @@ ${lanes.join("\n")} type = undefinedType; } if (!typeSet.has(type.id.toString())) { - if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) { + if (type.flags & 109472 /* Unit */ && includes & 109472 /* Unit */) { includes |= 67108864 /* NonPrimitive */; } typeSet.set(type.id.toString(), type); @@ -58123,7 +58706,7 @@ ${lanes.join("\n")} const typeVariable = getTypeParameterFromMappedType(mappedType); return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable); function isDistributive(type) { - return type.flags & (3 /* AnyOrUnknown */ | 131068 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; + return type.flags & (3 /* AnyOrUnknown */ | 134348796 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; } } function getLiteralTypeFromPropertyName(name) { @@ -58410,7 +58993,7 @@ ${lanes.join("\n")} } } const propType = getTypeOfSymbol(prop); - return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : propType; + return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : accessNode && isIndexedAccessTypeNode(accessNode) && containsMissingType(propType) ? getUnionType([propType, undefinedType]) : propType; } if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) { const index = +propName; @@ -58776,7 +59359,7 @@ ${lanes.join("\n")} } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.baseType; + return getActualTypeVariable(type.baseType); } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { return getIndexedAccessType(getActualTypeVariable(type.objectType), getActualTypeVariable(type.indexType)); @@ -58974,11 +59557,6 @@ ${lanes.join("\n")} var _a2; const links = getNodeLinks(node); if (!links.resolvedType) { - if (node.isTypeOf && node.typeArguments) { - error(node, Diagnostics.Type_arguments_cannot_be_used_here); - links.resolvedSymbol = unknownSymbol; - return links.resolvedType = errorType; - } if (!isLiteralImportTypeNode(node)) { error(node.argument, Diagnostics.String_literal_expected); links.resolvedSymbol = unknownSymbol; @@ -59039,15 +59617,8 @@ ${lanes.join("\n")} const resolvedSymbol = resolveSymbol(symbol); links.resolvedSymbol = resolvedSymbol; if (meaning === 111551 /* Value */) { - return getTypeOfSymbol(symbol); + return getInstantiationExpressionType(getTypeOfSymbol(symbol), node); } else { - const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol); - const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol); - if (node.typeArguments && typeParameters) { - addLazyDiagnostic(() => { - checkTypeArgumentConstraints(node, typeParameters); - }); - } return getTypeReferenceType(node, resolvedSymbol); } } @@ -59225,7 +59796,7 @@ ${lanes.join("\n")} return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 2944 /* Literal */) { + if (type.flags & 2976 /* Freshable */) { if (!type.freshType) { const freshType = createLiteralType(type.flags, type.value, type.symbol, type); freshType.freshType = freshType; @@ -59236,10 +59807,10 @@ ${lanes.join("\n")} return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 2944 /* Literal */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; + return type.flags & 2976 /* Freshable */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; } function isFreshLiteralType(type) { - return !!(type.flags & 2944 /* Literal */) && type.freshType === type; + return !!(type.flags & 2976 /* Freshable */) && type.freshType === type; } function getStringLiteralType(value) { let type; @@ -59918,13 +60489,13 @@ ${lanes.join("\n")} return type; } function getUniqueLiteralFilledInstantiation(type) { - return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); + return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); } function getPermissiveInstantiation(type) { - return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); + return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); } function getRestrictiveInstantiation(type) { - if (type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { + if (type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { return type; } if (type.restrictiveInstantiation) { @@ -60196,7 +60767,12 @@ ${lanes.join("\n")} } } function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) { - pushContextualType(next, sourcePropType); + pushContextualType( + next, + sourcePropType, + /*isCache*/ + false + ); const result = checkExpressionForMutableLocation(next, 1 /* Contextual */); popContextualType(); return result; @@ -60499,12 +61075,17 @@ ${lanes.join("\n")} } } function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (131068 /* Primitive */ | 131072 /* Never */)) + if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */)) return false; if (isTupleLikeType(source)) { return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); } - pushContextualType(node, target); + pushContextualType( + node, + target, + /*isCache*/ + false + ); const tupleizedType = checkArrayLiteral( node, 1 /* Contextual */, @@ -60543,7 +61124,7 @@ ${lanes.join("\n")} } } function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (131068 /* Primitive */ | 131072 /* Never */)) + if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */)) return false; return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); } @@ -60566,16 +61147,24 @@ ${lanes.join("\n")} void 0 ) !== 0 /* False */; } - function isAnySignature(s) { - return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s)); + function isTopSignature(s) { + if (!s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s)) { + const paramType = getTypeOfParameter(s.parameters[0]); + const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType; + return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */); + } + return false; } function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) { if (source === target) { return -1 /* True */; } - if (isAnySignature(target)) { + if (!(checkMode & 16 /* StrictTopSignature */ && isTopSignature(source)) && isTopSignature(target)) { return -1 /* True */; } + if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) { + return 0 /* False */; + } const targetCount = getParameterCount(target); const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { @@ -60793,7 +61382,9 @@ ${lanes.join("\n")} function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { const s = source.flags; const t = target.flags; - if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType) + if (t & 1 /* Any */ || s & 131072 /* Never */ || source === wildcardType) + return true; + if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */)) return true; if (t & 131072 /* Never */) return false; @@ -60920,7 +61511,6 @@ ${lanes.join("\n")} let overrideNextErrorInfo = 0; let lastSkippedInfo; let incompatibleStack; - let inPropertyCheck = false; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); const result = isRelatedTo( source, @@ -61117,7 +61707,8 @@ ${lanes.join("\n")} Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable"); generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource); } - if (target2.flags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { + const targetFlags = target2.flags & 8388608 /* IndexedAccess */ && !(source2.flags & 8388608 /* IndexedAccess */) ? target2.objectType.flags : target2.flags; + if (targetFlags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { const constraint = getBaseConstraintOfType(target2); let needsOriginalSource; if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) { @@ -61190,7 +61781,7 @@ ${lanes.join("\n")} return isRelatedTo(source2, target2, 3 /* Both */, reportErrors2); } function isRelatedTo(originalSource, originalTarget, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2, intersectionState = 0 /* None */) { - if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 131068 /* Primitive */) { + if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 134348796 /* Primitive */) { if (relation === comparableRelation && !(originalTarget.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(originalTarget, originalSource, relation) || isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors2 ? reportError : void 0)) { return -1 /* True */; } @@ -61254,7 +61845,7 @@ ${lanes.join("\n")} return 0 /* False */; } } - const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures2(source2)); + const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (134348796 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2)); const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */); if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) { if (reportErrors2) { @@ -61316,7 +61907,7 @@ ${lanes.join("\n")} maybeSuppress = !!errorInfo; } } - if (source2.flags & 524288 /* Object */ && target2.flags & 131068 /* Primitive */) { + if (source2.flags & 524288 /* Object */ && target2.flags & 134348796 /* Primitive */) { tryElaborateErrorsForPrimitivesAndObjects(source2, target2); } else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) { reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead); @@ -61462,15 +62053,15 @@ ${lanes.join("\n")} } function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) { if (source2.flags & 1048576 /* Union */) { - return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */), intersectionState); + return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState); } if (target2.flags & 1048576 /* Union */) { - return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 131068 /* Primitive */) && !(target2.flags & 131068 /* Primitive */)); + return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */) && !(target2.flags & 134348796 /* Primitive */)); } if (target2.flags & 2097152 /* Intersection */) { return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */); } - if (relation === comparableRelation && target2.flags & 131068 /* Primitive */) { + if (relation === comparableRelation && target2.flags & 134348796 /* Primitive */) { const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t); if (constraints !== source2.types) { source2 = getIntersectionType(constraints); @@ -61878,14 +62469,15 @@ ${lanes.join("\n")} ); } } - if (result2 && !inPropertyCheck && (target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */) || isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */)))) { - inPropertyCheck = true; + if (result2 && !(intersectionState & 2 /* Target */) && target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */)) { result2 &= propertiesRelatedTo( source2, target2, reportErrors2, /*excludedProperties*/ void 0, + /*optionalsOnly*/ + false, 0 /* None */ ); if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */) { @@ -61898,7 +62490,17 @@ ${lanes.join("\n")} 0 /* None */ ); } - inPropertyCheck = false; + } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { + result2 &= propertiesRelatedTo( + source2, + target2, + reportErrors2, + /*excludedProperties*/ + void 0, + /*optionalsOnly*/ + true, + intersectionState + ); } } if (result2) { @@ -62352,7 +62954,7 @@ ${lanes.join("\n")} } return 0 /* False */; } - const sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */); + const sourceIsPrimitive = !!(sourceFlags & 134348796 /* Primitive */); if (relation !== identityRelation) { source2 = getApparentType(source2); sourceFlags = source2.flags; @@ -62388,12 +62990,14 @@ ${lanes.join("\n")} reportStructuralErrors, /*excludedProperties*/ void 0, + /*optionalsOnly*/ + false, intersectionState ); if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors); + result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors, intersectionState); if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors); + result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors, intersectionState); if (result2) { result2 &= indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportStructuralErrors, intersectionState); } @@ -62522,6 +63126,8 @@ ${lanes.join("\n")} /*reportErrors*/ false, excludedProperties, + /*optionalsOnly*/ + false, 0 /* None */ ); if (result2) { @@ -62530,7 +63136,8 @@ ${lanes.join("\n")} type, 0 /* Call */, /*reportStructuralErrors*/ - false + false, + 0 /* None */ ); if (result2) { result2 &= signaturesRelatedTo( @@ -62538,7 +63145,8 @@ ${lanes.join("\n")} type, 1 /* Construct */, /*reportStructuralErrors*/ - false + false, + 0 /* None */ ); if (result2 && !(isTupleType(source2) && isTupleType(type))) { result2 &= indexSignaturesRelatedTo( @@ -62716,7 +63324,7 @@ ${lanes.join("\n")} } } } - function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, intersectionState) { + function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) { if (relation === identityRelation) { return propertiesIdenticalTo(source2, target2, excludedProperties); } @@ -62852,7 +63460,7 @@ ${lanes.join("\n")} const numericNamesOnly = isTupleType(source2) && isTupleType(target2); for (const targetProp of excludeProperties(properties, excludedProperties)) { const name = targetProp.escapedName; - if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) { + if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length") && (!optionalsOnly || targetProp.flags & 16777216 /* Optional */)) { const sourceProp = getPropertyOfType(source2, name); if (sourceProp && sourceProp !== targetProp) { const related = propertyRelatedTo(source2, target2, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors2, intersectionState, relation === comparableRelation); @@ -62888,7 +63496,7 @@ ${lanes.join("\n")} } return result2; } - function signaturesRelatedTo(source2, target2, kind, reportErrors2) { + function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) { var _a3, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source2, target2, kind); @@ -62925,6 +63533,7 @@ ${lanes.join("\n")} /*erase*/ true, reportErrors2, + intersectionState, incompatibleReporter(sourceSignatures[i], targetSignatures[i]) ); if (!related) { @@ -62936,7 +63545,7 @@ ${lanes.join("\n")} const eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); - result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature)); + result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature)); if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 173 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 173 /* Constructor */)) { const constructSignatureToString = (signature) => signatureToString( signature, @@ -62961,6 +63570,7 @@ ${lanes.join("\n")} /*erase*/ true, shouldElaborateErrors, + intersectionState, incompatibleReporter(s, t) ); if (related) { @@ -63013,17 +63623,29 @@ ${lanes.join("\n")} } return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); } - function signatureRelatedTo(source2, target2, erase, reportErrors2, incompatibleReporter) { + function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) { + const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */; return compareSignaturesRelated( erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, - relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, + checkMode, reportErrors2, reportError, incompatibleReporter, - isRelatedToWorker, + isRelatedToWorker2, reportUnreliableMapper ); + function isRelatedToWorker2(source3, target3, reportErrors3) { + return isRelatedTo( + source3, + target3, + 3 /* Both */, + reportErrors3, + /*headMessage*/ + void 0, + intersectionState + ); + } } function signaturesIdenticalTo(source2, target2, kind) { const sourceSignatures = getSignaturesOfType(source2, kind); @@ -63082,7 +63704,7 @@ ${lanes.join("\n")} } for (const info of getIndexInfosOfType(source2)) { if (isApplicableIndexType(info.keyType, keyType)) { - const related = indexInfoRelatedTo(info, targetInfo, reportErrors2); + const related = indexInfoRelatedTo(info, targetInfo, reportErrors2, intersectionState); if (!related) { return 0 /* False */; } @@ -63091,8 +63713,16 @@ ${lanes.join("\n")} } return result2; } - function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2) { - const related = isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */, reportErrors2); + function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState) { + const related = isRelatedTo( + sourceInfo.type, + targetInfo.type, + 3 /* Both */, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); if (!related && reportErrors2) { if (sourceInfo.keyType === targetInfo.keyType) { reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType)); @@ -63121,9 +63751,9 @@ ${lanes.join("\n")} function typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) { const sourceInfo = getApplicableIndexInfo(source2, targetInfo.keyType); if (sourceInfo) { - return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2); + return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState); } - if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) { + if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) { return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); } if (reportErrors2) { @@ -63412,12 +64042,15 @@ ${lanes.join("\n")} } function isDeeplyNestedType(type, stack, depth, maxDepth = 3) { if (depth >= maxDepth) { + if (type.flags & 2097152 /* Intersection */) { + return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth)); + } const identity2 = getRecursionIdentity(type); let count = 0; let lastTypeId = 0; for (let i = 0; i < depth; i++) { const t = stack[i]; - if (getRecursionIdentity(t) === identity2) { + if (t.flags & 2097152 /* Intersection */ ? some(t.types, (u) => getRecursionIdentity(u) === identity2) : getRecursionIdentity(t) === identity2) { if (t.id >= lastTypeId) { count++; if (count >= maxDepth) { @@ -63650,15 +64283,25 @@ ${lanes.join("\n")} return propType; } if (everyType(type, isTupleType)) { - return mapType(type, (t) => getRestTypeOfTupleType(t) || undefinedType); + return mapType(type, (t) => { + const tupleType = t; + const restType = getRestTypeOfTupleType(tupleType); + if (!restType) { + return undefinedType; + } + if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) { + return getUnionType([restType, undefinedType]); + } + return restType; + }); } return void 0; } function isNeitherUnitTypeNorNever(type) { - return !(type.flags & (109440 /* Unit */ | 131072 /* Never */)); + return !(type.flags & (109472 /* Unit */ | 131072 /* Never */)); } function isUnitType(type) { - return !!(type.flags & 109440 /* Unit */); + return !!(type.flags & 109472 /* Unit */); } function isUnitLikeType(type) { const t = getBaseConstraintOrType(type); @@ -63671,15 +64314,18 @@ ${lanes.join("\n")} return type.flags & 16 /* Boolean */ ? true : type.flags & 1048576 /* Union */ ? type.flags & 1024 /* EnumLiteral */ ? true : every(type.types, isUnitType) : isUnitType(type); } function getBaseTypeOfLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; + return type.flags & 1056 /* EnumLike */ ? getBaseTypeOfEnumLikeType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; } function getBaseTypeOfLiteralTypeUnion(type) { var _a2; const key = `B${getTypeId(type)}`; return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralType)); } + function getBaseTypeOfLiteralTypeForComparison(type) { + return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type; + } function getWidenedLiteralType(type) { - return type.flags & 1024 /* EnumLiteral */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; + return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; } function getWidenedUniqueESSymbolType(type) { return type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedUniqueESSymbolType) : type; @@ -63720,7 +64366,7 @@ ${lanes.join("\n")} const restType = getRestTypeOfTupleType(type); return restType && createArrayType(restType); } - function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false) { + function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false, noReductions = false) { const length2 = getTypeReferenceArity(type) - endSkipCount; if (index < length2) { const typeArguments = getTypeArguments(type); @@ -63729,7 +64375,7 @@ ${lanes.join("\n")} const t = typeArguments[i]; elementTypes.push(type.target.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t); } - return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes); + return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes, noReductions ? 0 /* None */ : 1 /* Literal */); } return void 0; } @@ -63797,7 +64443,7 @@ ${lanes.join("\n")} } function isObjectTypeWithInferableIndex(type) { const objectFlags = getObjectFlags(type); - return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures2(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); + return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); } function createSymbolWithType(source, type) { const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */); @@ -64035,6 +64681,11 @@ ${lanes.join("\n")} case 320 /* JSDocFunctionType */: error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; + case 326 /* JSDocSignature */: + if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { + error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); + } + return; case 259 /* FunctionDeclaration */: case 171 /* MethodDeclaration */: case 170 /* MethodSignature */: @@ -64207,8 +64858,8 @@ ${lanes.join("\n")} } return false; } - function isTypeParameterAtTopLevel(type, typeParameter) { - return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + function isTypeParameterAtTopLevel(type, tp, depth = 0) { + return !!(type === tp || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, tp, depth)) || depth < 3 && type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), tp, depth + 1) || isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), tp, depth + 1))); } function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { const typePredicate = getTypePredicateOfSignature(signature); @@ -64302,7 +64953,7 @@ ${lanes.join("\n")} yield targetProp; } else if (matchDiscriminantProperties) { const targetType = getTypeOfSymbol(targetProp); - if (targetType.flags & 109440 /* Unit */) { + if (targetType.flags & 109472 /* Unit */) { const sourceType = getTypeOfSymbol(sourceProp); if (!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) { yield targetProp; @@ -64363,10 +65014,10 @@ ${lanes.join("\n")} return getBigIntLiteralType(parseValidBigInt(text)); } function isMemberOfStringMapping(source, target) { - if (target.flags & (4 /* String */ | 1 /* Any */)) { + if (target.flags & 1 /* Any */) { return true; } - if (target.flags & 134217728 /* TemplateLiteral */) { + if (target.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) { return isTypeAssignableTo(source, target); } if (target.flags & 268435456 /* StringMapping */) { @@ -65061,7 +65712,7 @@ ${lanes.join("\n")} } function hasPrimitiveConstraint(type) { const constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); } function isObjectLiteralType2(type) { return !!(getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -65543,7 +66194,7 @@ ${lanes.join("\n")} return 83886079 /* UnknownFacts */; } function getIntersectionTypeFacts(type) { - const ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */); + const ignoreObjects = maybeTypeOfKind(type, 134348796 /* Primitive */); let oredFacts = 0 /* None */; let andedFacts = 134217727 /* All */; for (const t of type.types) { @@ -65742,7 +66393,7 @@ ${lanes.join("\n")} } return true; } - if (source.flags & 1024 /* EnumLiteral */ && getBaseTypeOfEnumLiteralType(source) === target) { + if (source.flags & 1056 /* EnumLike */ && getBaseTypeOfEnumLikeType(source) === target) { return true; } return containsType(target.types, source); @@ -65780,7 +66431,7 @@ ${lanes.join("\n")} } return getUnionTypeFromSortedList( filtered, - type.objectFlags, + type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */), /*aliasSymbol*/ void 0, /*aliasTypeArguments*/ @@ -66138,10 +66789,12 @@ ${lanes.join("\n")} } function isConstantReference(node) { switch (node.kind) { - case 79 /* Identifier */: { - const symbol = getResolvedSymbol(node); - return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); - } + case 79 /* Identifier */: + if (!isThisInTypeQuery(node)) { + const symbol = getResolvedSymbol(node); + return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); + } + break; case 208 /* PropertyAccessExpression */: case 209 /* ElementAccessExpression */: return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); @@ -66287,7 +66940,7 @@ ${lanes.join("\n")} } return declaredType; } - if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))); } return void 0; @@ -66804,7 +67457,7 @@ ${lanes.join("\n")} } if (assumeTrue) { if (!doubleEquals && (type.flags & 2 /* Unknown */ || someType(type, isEmptyAnonymousObjectType))) { - if (valueType.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { + if (valueType.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { return valueType; } if (valueType.flags & 524288 /* Object */) { @@ -66837,7 +67490,7 @@ ${lanes.join("\n")} return narrowTypeByLiteralExpression(type, literal, assumeTrue); } function narrowTypeByLiteralExpression(type, literal, assumeTrue) { - return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); + return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); } function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) { const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck); @@ -66854,7 +67507,7 @@ ${lanes.join("\n")} let groundClauseTypes; for (let i = 0; i < clauseTypes.length; i += 1) { const t = clauseTypes[i]; - if (t.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */)) { + if (t.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */)) { if (groundClauseTypes !== void 0) { groundClauseTypes.push(t); } @@ -66973,52 +67626,58 @@ ${lanes.join("\n")} if (!isTypeDerivedFrom(rightType, globalFunctionType)) { return type; } - let targetType; - const prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (prototypeProperty) { - const prototypePropertyType = getTypeOfSymbol(prototypeProperty); - if (!isTypeAny(prototypePropertyType)) { - targetType = prototypePropertyType; - } - } - if (isTypeAny(type) && (targetType === globalObjectType || targetType === globalFunctionType)) { + const instanceType = mapType(rightType, getInstanceType); + if (isTypeAny(type) && (instanceType === globalObjectType || instanceType === globalFunctionType) || !assumeTrue && !(instanceType.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(instanceType))) { return type; } - if (!targetType) { - const constructSignatures = getSignaturesOfType(rightType, 1 /* Construct */); - targetType = constructSignatures.length ? getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))) : emptyObjectType; - } - if (!assumeTrue && rightType.flags & 1048576 /* Union */) { - const nonConstructorTypeInUnion = find(rightType.types, (t) => !isConstructorType(t)); - if (!nonConstructorTypeInUnion) - return type; - } return getNarrowedType( type, - targetType, + instanceType, assumeTrue, /*checkDerived*/ true ); } + function getInstanceType(constructorType) { + const prototypePropertyType = getTypeOfPropertyOfType(constructorType, "prototype"); + if (prototypePropertyType && !isTypeAny(prototypePropertyType)) { + return prototypePropertyType; + } + const constructSignatures = getSignaturesOfType(constructorType, 1 /* Construct */); + if (constructSignatures.length) { + return getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))); + } + return emptyObjectType; + } function getNarrowedType(type, candidate, assumeTrue, checkDerived) { var _a3; const key2 = type.flags & 1048576 /* Union */ ? `N${getTypeId(type)},${getTypeId(candidate)},${(assumeTrue ? 1 : 0) | (checkDerived ? 2 : 0)}` : void 0; return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived)); } function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) { - const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; if (!assumeTrue) { - return filterType(type, (t) => !isRelated(t, candidate)); + if (checkDerived) { + return filterType(type, (t) => !isTypeDerivedFrom(t, candidate)); + } + const trueType2 = getNarrowedType( + type, + candidate, + /*assumeTrue*/ + true, + /*checkDerived*/ + false + ); + return filterType(type, (t) => !isTypeSubsetOf(t, trueType2)); } if (type.flags & 3 /* AnyOrUnknown */) { return candidate; } + const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0; const narrowedType = mapType(candidate, (c) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -67122,7 +67781,7 @@ ${lanes.join("\n")} } } function getTypeOfSymbolAtLocation(symbol, location) { - symbol = symbol.exportSymbol || symbol; + symbol = getExportSymbolOfValueSymbolIfExported(symbol); if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) { if (isRightSideOfQualifiedNameOrPropertyAccess(location)) { location = location.parent; @@ -67174,15 +67833,25 @@ ${lanes.join("\n")} function isConstVariable(symbol) { return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0; } - function removeOptionalityFromDeclaredType(declaredType, declaration) { - if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { - const annotationIncludesUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */); - popTypeResolution(); - return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; - } else { - reportCircularityError(declaration.symbol); - return declaredType; + function parameterInitializerContainsUndefined(declaration) { + const links = getNodeLinks(declaration); + if (links.parameterInitializerContainsUndefined === void 0) { + if (!pushTypeResolution(declaration, 9 /* ParameterInitializerContainsUndefined */)) { + reportCircularityError(declaration.symbol); + return true; + } + const containsUndefined = !!(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */); + if (!popTypeResolution()) { + reportCircularityError(declaration.symbol); + return true; + } + links.parameterInitializerContainsUndefined = containsUndefined; } + return links.parameterInitializerContainsUndefined; + } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + const removeUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !parameterInitializerContainsUndefined(declaration); + return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; } function isConstraintPosition(type, node) { const parent2 = node.parent; @@ -68293,9 +68962,18 @@ ${lanes.join("\n")} if (prop) { return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop); } - if (isTupleType(t)) { - const restType = getRestTypeOfTupleType(t); - if (restType && isNumericLiteralName(name) && +name >= 0) { + if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) { + const restType = getElementTypeOfSliceOfTupleType( + t, + t.target.fixedLength, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ); + if (restType) { return restType; } } @@ -68342,9 +69020,18 @@ ${lanes.join("\n")} return void 0; } function getContextualTypeForElementExpression(arrayContextualType, index) { - return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType( + return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType( arrayContextualType, - (t) => getIteratedTypeOrElementType( + (t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType( + t, + 0, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ) : getIteratedTypeOrElementType( 1 /* Element */, t, undefinedType, @@ -68497,14 +69184,17 @@ ${lanes.join("\n")} return type; } function getContextualType2(node, contextFlags) { + var _a2, _b; if (node.flags & 33554432 /* InWithStatement */) { return void 0; } - const index = findContextualNode(node); + const index = findContextualNode( + node, + /*includeCaches*/ + !contextFlags + ); if (index >= 0) { - const cached = contextualTypes[index]; - if (cached || !contextFlags) - return cached; + return contextualTypes[index]; } const { parent: parent2 } = node; switch (parent2.kind) { @@ -68539,7 +69229,9 @@ ${lanes.join("\n")} case 206 /* ArrayLiteralExpression */: { const arrayLiteral = parent2; const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); - return getContextualTypeForElementExpression(type, indexOfNode(arrayLiteral.elements, node)); + const spreadIndex = (_b = (_a2 = getNodeLinks(arrayLiteral)).firstSpreadIndex) != null ? _b : _a2.firstSpreadIndex = findIndex(arrayLiteral.elements, isSpreadElement); + const elementIndex = indexOfNode(arrayLiteral.elements, node); + return getContextualTypeForElementExpression(type, spreadIndex < 0 || elementIndex < spreadIndex ? elementIndex : -1); } case 224 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); @@ -68575,17 +69267,30 @@ ${lanes.join("\n")} } return void 0; } - function pushContextualType(node, type) { + function pushCachedContextualType(node) { + pushContextualType( + node, + getContextualType2( + node, + /*contextFlags*/ + void 0 + ), + /*isCache*/ + true + ); + } + function pushContextualType(node, type, isCache) { contextualTypeNodes[contextualTypeCount] = node; contextualTypes[contextualTypeCount] = type; + contextualIsCache[contextualTypeCount] = isCache; contextualTypeCount++; } function popContextualType() { contextualTypeCount--; } - function findContextualNode(node) { + function findContextualNode(node, includeCaches) { for (let i = contextualTypeCount - 1; i >= 0; i--) { - if (node === contextualTypeNodes[i]) { + if (node === contextualTypeNodes[i] && (includeCaches || !contextualIsCache[i])) { return i; } } @@ -68608,7 +69313,11 @@ ${lanes.join("\n")} } function getContextualJsxElementAttributesType(node, contextFlags) { if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) { - const index = findContextualNode(node.parent); + const index = findContextualNode( + node.parent, + /*includeCaches*/ + !contextFlags + ); if (index >= 0) { return contextualTypes[index]; } @@ -68879,11 +69588,7 @@ ${lanes.join("\n")} const elementCount = elements.length; const elementTypes = []; const elementFlags = []; - pushContextualType(node, getContextualType2( - node, - /*contextFlags*/ - void 0 - )); + pushCachedContextualType(node); const inDestructuringPattern = isAssignmentTarget(node); const inConstContext = isConstContext(node); const contextualType = getApparentTypeOfContextualType( @@ -69046,11 +69751,7 @@ ${lanes.join("\n")} let propertiesTable = createSymbolTable(); let propertiesArray = []; let spread = emptyObjectType; - pushContextualType(node, getContextualType2( - node, - /*contextFlags*/ - void 0 - )); + pushCachedContextualType(node); const contextualType = getApparentTypeOfContextualType( node, /*contextFlags*/ @@ -70337,7 +71038,7 @@ ${lanes.join("\n")} function reportNonexistentProperty(propNode, containingType, isUncheckedJS) { let errorInfo; let relatedInfo; - if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 131068 /* Primitive */)) { + if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 134348796 /* Primitive */)) { for (const subtype of containingType.types) { if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) { errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(subtype)); @@ -70390,26 +71091,22 @@ ${lanes.join("\n")} function getSuggestedLibForNonExistentName(name) { const missingName = diagnosticName(name); const allFeatures = getScriptTargetFeatures(); - const libTargets = getOwnKeys(allFeatures); - for (const libTarget of libTargets) { - const containingTypes = getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== void 0 && contains(containingTypes, missingName)) { - return libTarget; - } - } + const typeFeatures = allFeatures.get(missingName); + return typeFeatures && firstIterator(typeFeatures.keys()); } function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { const container = getApparentType(containingType).symbol; if (!container) { return void 0; } + const containingTypeName = symbolName(container); const allFeatures = getScriptTargetFeatures(); - const libTargets = getOwnKeys(allFeatures); - for (const libTarget of libTargets) { - const featuresOfLib = allFeatures[libTarget]; - const featuresOfContainingType = featuresOfLib[symbolName(container)]; - if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) { - return libTarget; + const typeFeatures = allFeatures.get(containingTypeName); + if (typeFeatures) { + for (const [libTarget, featuresOfType] of typeFeatures) { + if (contains(featuresOfType, missingProperty)) { + return libTarget; + } } } } @@ -70938,7 +71635,7 @@ ${lanes.join("\n")} } else { const contextualType = getIndexedAccessType(restType, getNumberLiteralType(i - index), 256 /* Contextual */); const argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } @@ -71472,7 +72169,7 @@ ${lanes.join("\n")} const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */; const isDecorator2 = node.kind === 167 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); - const reportErrors2 = !candidatesOutArray; + const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; let typeArguments; if (!isDecorator2 && !isSuperCall(node)) { typeArguments = node.typeArguments; @@ -72431,7 +73128,7 @@ ${lanes.join("\n")} } } function checkCallExpression(node, checkMode) { - var _a2; + var _a2, _b, _c; checkGrammarTypeArguments(node, node.typeArguments); const signature = getResolvedSignature( node, @@ -72448,7 +73145,7 @@ ${lanes.join("\n")} } if (node.kind === 211 /* NewExpression */) { const declaration = signature.declaration; - if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a2 = getJSDocRoot(declaration)) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 173 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -72476,7 +73173,7 @@ ${lanes.join("\n")} /*allowDeclaration*/ false ); - if ((_a2 = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _a2.size) { + if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) { const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray); jsAssignmentType.objectFlags |= 4096 /* JSLiteral */; return getIntersectionType([returnType, jsAssignmentType]); @@ -72762,6 +73459,9 @@ ${lanes.join("\n")} checkGrammarExpressionWithTypeArguments(node); forEach(node.typeArguments, checkSourceElement); const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + return getInstantiationExpressionType(exprType, node); + } + function getInstantiationExpressionType(exprType, node) { const typeArguments = node.typeArguments; if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) { return exprType; @@ -74185,10 +74885,10 @@ ${lanes.join("\n")} if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 131068 /* Primitive */)) { + if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 134348796 /* Primitive */)) { error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures2(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -74710,8 +75410,8 @@ ${lanes.join("\n")} case 32 /* LessThanEqualsToken */: case 33 /* GreaterThanEqualsToken */: if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); - rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); + leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right)); reportOperatorErrorUnless((left2, right2) => { if (isTypeAny(left2) || isTypeAny(right2)) { return true; @@ -74771,7 +75471,7 @@ ${lanes.join("\n")} return leftType; } else { checkAssignmentOperator(rightType); - return getRegularTypeOfObjectLiteral(rightType); + return rightType; } case 27 /* CommaToken */: if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) { @@ -75062,14 +75762,19 @@ ${lanes.join("\n")} return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */)); } function getContextNode2(node) { - if (node.kind === 289 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) { + if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) { return node.parent.parent; } return node; } function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) { const contextNode = getContextNode2(node); - pushContextualType(contextNode, contextualType); + pushContextualType( + contextNode, + contextualType, + /*isCache*/ + false + ); pushInferenceContext(contextNode, inferenceContext); const type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0)); if (inferenceContext && inferenceContext.intraExpressionInferenceSites) { @@ -75400,7 +76105,7 @@ ${lanes.join("\n")} return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) { return getTypeFromTypeNode(expr.type); - } else if (node.kind === 8 /* NumericLiteral */ || node.kind === 10 /* StringLiteral */ || node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */) { + } else if (isLiteralExpression(node) || isBooleanLiteral(node)) { return checkExpression(node); } return void 0; @@ -75410,7 +76115,12 @@ ${lanes.join("\n")} if (links.contextFreeType) { return links.contextFreeType; } - pushContextualType(node, anyType); + pushContextualType( + node, + anyType, + /*isCache*/ + false + ); const type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */); popContextualType(); return type; @@ -75625,7 +76335,7 @@ ${lanes.join("\n")} error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } - if ((node.questionToken || isJSDocOptionalParameter(node)) && isBindingPattern(node.name) && func.body) { + if (!node.initializer && isOptionalDeclaration(node) && isBindingPattern(node.name) && func.body) { error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { @@ -76147,8 +76857,8 @@ ${lanes.join("\n")} } return void 0; } - function getTypeParametersForTypeReference(node) { - const type = getTypeFromTypeReference(node); + function getTypeParametersForTypeReferenceOrImport(node) { + const type = getTypeFromTypeNode(node); if (!isErrorType(type)) { const symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { @@ -76166,11 +76876,14 @@ ${lanes.join("\n")} } } forEach(node.typeArguments, checkSourceElement); - const type = getTypeFromTypeReference(node); + checkTypeReferenceOrImport(node); + } + function checkTypeReferenceOrImport(node) { + const type = getTypeFromTypeNode(node); if (!isErrorType(type)) { if (node.typeArguments) { addLazyDiagnostic(() => { - const typeParameters = getTypeParametersForTypeReference(node); + const typeParameters = getTypeParametersForTypeReferenceOrImport(node); if (typeParameters) { checkTypeArgumentConstraints(node, typeParameters); } @@ -76192,7 +76905,7 @@ ${lanes.join("\n")} const typeReferenceNode = tryCast(node.parent, isTypeReferenceType); if (!typeReferenceNode) return void 0; - const typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReferenceNode); if (!typeParameters) return void 0; const constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); @@ -76372,7 +77085,7 @@ ${lanes.join("\n")} } } } - getTypeFromTypeNode(node); + checkTypeReferenceOrImport(node); } function checkNamedTupleMember(node) { if (node.dotDotDotToken && node.questionToken) { @@ -76537,6 +77250,17 @@ ${lanes.join("\n")} lastSeenNonAmbientDeclaration = node; } } + if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) { + for (const node2 of current.jsDoc) { + if (node2.tags) { + for (const tag of node2.tags) { + if (isJSDocOverloadTag(tag)) { + hasOverloads = true; + } + } + } + } + } } } if (multipleConstructorImplementation) { @@ -76574,8 +77298,9 @@ ${lanes.join("\n")} const bodySignature = getSignatureFromDeclaration(bodyDeclaration); for (const signature of signatures) { if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { + const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration; addRelatedInfo( - error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), + error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here) ); break; @@ -76668,6 +77393,9 @@ ${lanes.join("\n")} case 273 /* ImportSpecifier */: case 79 /* Identifier */: return 1 /* ExportValue */; + case 170 /* MethodSignature */: + case 168 /* PropertySignature */: + return 2 /* ExportType */; default: return Debug.failBadSyntaxKind(d); } @@ -76691,7 +77419,7 @@ ${lanes.join("\n")} ))) { return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* Primitive */ | 131072 /* Never */)) { + if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) { return void 0; } const thenFunction = getTypeOfPropertyOfType(type, "then"); @@ -76743,7 +77471,7 @@ ${lanes.join("\n")} return awaitedType || errorType; } function isThenableType(type) { - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* Primitive */ | 131072 /* Never */)) { + if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) { return false; } const thenFunction = getTypeOfPropertyOfType(type, "then"); @@ -76792,7 +77520,7 @@ ${lanes.join("\n")} return awaitedType; } } - Debug.assert(getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); + Debug.assert(isAwaitedTypeInstantiation(type) || getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); return type; } function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { @@ -79605,20 +80333,19 @@ ${lanes.join("\n")} } } } - function getMemberOverrideModifierStatus(node, member) { + function getMemberOverrideModifierStatus(node, member, memberSymbol) { if (!member.name) { return 0 /* Ok */; } - const symbol = getSymbolOfDeclaration(node); - const type = getDeclaredTypeOfSymbol(symbol); + const classSymbol = getSymbolOfDeclaration(node); + const type = getDeclaredTypeOfSymbol(classSymbol); const typeWithThis = getTypeWithThisArgument(type); - const staticType = getTypeOfSymbol(symbol); + const staticType = getTypeOfSymbol(classSymbol); const baseTypeNode = getEffectiveBaseTypeNode(node); const baseTypes = baseTypeNode && getBaseTypes(type); const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0; const baseStaticType = getBaseConstructorTypeOfClass(type); const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */); - const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name)); return checkMemberForOverrideModifier( node, staticType, @@ -79631,7 +80358,7 @@ ${lanes.join("\n")} isStatic(member), /* memberIsParameterProperty */ false, - memberName + symbolName(memberSymbol) ); } function getTargetSymbol(s) { @@ -80183,7 +80910,7 @@ ${lanes.join("\n")} getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */) { + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || node.parent.impliedNodeFormat === 1 /* CommonJS */)) { const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 93 /* ExportKeyword */); if (exportModifier) { error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); @@ -80514,8 +81241,6 @@ ${lanes.join("\n")} } else { if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); - } else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) { - grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); } } } @@ -80670,7 +81395,7 @@ ${lanes.join("\n")} const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 79 /* Identifier */) { const id = node.expression; - const sym = resolveEntityName( + const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName( id, 67108863 /* All */, /*ignoreErrors*/ @@ -80678,7 +81403,7 @@ ${lanes.join("\n")} /*dontResolveAlias*/ true, node - ); + )); if (sym) { markAliasReferenced(sym, id); if (getAllSymbolFlags(sym) & 111551 /* Value */) { @@ -80722,8 +81447,6 @@ ${lanes.join("\n")} grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead); } else if (moduleKind === 4 /* System */ && !(node.flags & 16777216 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); - } else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && !(node.flags & 16777216 /* Ambient */)) { - grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead); } } } @@ -81051,6 +81774,8 @@ ${lanes.join("\n")} if (!(links.flags & 1 /* TypeChecked */)) { links.deferredNodes || (links.deferredNodes = /* @__PURE__ */ new Set()); links.deferredNodes.add(node); + } else { + Debug.assert(!links.deferredNodes, "A type-checked file should have no deferred nodes."); } } function checkDeferredNodes(context) { @@ -81058,6 +81783,7 @@ ${lanes.join("\n")} if (links.deferredNodes) { links.deferredNodes.forEach(checkDeferredNode); } + links.deferredNodes = void 0; } function checkDeferredNode(node) { var _a2, _b; @@ -81313,7 +82039,7 @@ ${lanes.join("\n")} } return node.parent.kind === 180 /* TypeReference */; } - function isHeritageClauseElementIdentifier(node) { + function isInNameOfExpressionWithTypeArguments(node) { while (node.parent.kind === 208 /* PropertyAccessExpression */) { node = node.parent; } @@ -81423,10 +82149,10 @@ ${lanes.join("\n")} while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) { name = name.parent; } - if (isHeritageClauseElementIdentifier(name)) { + if (isInNameOfExpressionWithTypeArguments(name)) { let meaning = 0 /* None */; if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) { - meaning = 788968 /* Type */; + meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */; if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551 /* Value */; } @@ -81832,8 +82558,8 @@ ${lanes.join("\n")} } return getNamedMembers(propsByName); } - function typeHasCallOrConstructSignatures2(type) { - return typeHasCallOrConstructSignatures(type, checker); + function typeHasCallOrConstructSignatures(type) { + return getSignaturesOfType(type, 0 /* Call */).length !== 0 || getSignaturesOfType(type, 1 /* Construct */).length !== 0; } function getRootSymbols(symbol) { const roots = getImmediateRootSymbols(symbol); @@ -82138,7 +82864,7 @@ ${lanes.join("\n")} return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0; } function getTypeReferenceSerializationKind(typeNameIn, location) { - var _a2, _b; + var _a2; const typeName = getParseTreeNode(typeNameIn, isEntityName); if (!typeName) return 0 /* Unknown */; @@ -82170,7 +82896,7 @@ ${lanes.join("\n")} location ); const resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol; - isTypeOnly || (isTypeOnly = !!((_b = valueSymbol == null ? void 0 : valueSymbol.declarations) == null ? void 0 : _b.every(isTypeOnlyImportOrExportDeclaration))); + isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */))); const typeSymbol = resolveEntityName( typeName, 788968 /* Type */, @@ -82321,7 +83047,7 @@ ${lanes.join("\n")} return false; } function literalTypeToNode(type, enclosing, tracker) { - const enumResult = type.flags & 1024 /* EnumLiteral */ ? nodeBuilder.symbolToExpression( + const enumResult = type.flags & 1056 /* EnumLike */ ? nodeBuilder.symbolToExpression( type.symbol, 111551 /* Value */, enclosing, @@ -82864,6 +83590,7 @@ ${lanes.join("\n")} let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; let sawExportBeforeDecorators = false; + let hasLeadingDecorators = false; for (const modifier of node.modifiers) { if (isDecorator(modifier)) { if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { @@ -82881,8 +83608,22 @@ ${lanes.join("\n")} if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } + if (hasLeadingDecorators && flags & 126975 /* Modifier */) { + Debug.assertIsDefined(firstDecorator); + const sourceFile = getSourceFileOfNode(modifier); + if (!hasParseDiagnostics(sourceFile)) { + addRelatedInfo( + error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here) + ); + return true; + } + return false; + } flags |= 131072 /* Decorator */; - if (flags & 1 /* Export */) { + if (!(flags & 126975 /* Modifier */)) { + hasLeadingDecorators = true; + } else if (flags & 1 /* Export */) { sawExportBeforeDecorators = true; } firstDecorator != null ? firstDecorator : firstDecorator = modifier; @@ -83170,7 +83911,6 @@ ${lanes.join("\n")} case 299 /* PropertyAssignment */: case 300 /* ShorthandPropertyAssignment */: case 267 /* NamespaceExportDeclaration */: - case 181 /* FunctionType */: case 279 /* MissingDeclaration */: return find(node.modifiers, isModifier); default: @@ -83867,7 +84607,7 @@ ${lanes.join("\n")} } function isSimpleLiteralEnumReference(expr) { if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { - return !!(checkExpressionCached(expr).flags & 1024 /* EnumLiteral */); + return !!(checkExpressionCached(expr).flags & 1056 /* EnumLike */); } } function checkAmbientInitializer(node) { @@ -84269,10 +85009,10 @@ ${lanes.join("\n")} } function findMostOverlappyType(source, unionTarget) { let bestMatch; - if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { + if (!(source.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { let matchingCount = 0; for (const target of unionTarget.types) { - if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { + if (!(target.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { const overlap = getIntersectionType([getIndexType(source), getIndexType(target)]); if (overlap.flags & 4194304 /* Index */) { return target; @@ -84290,7 +85030,7 @@ ${lanes.join("\n")} } function filterPrimitivesIfContainsNonPrimitive(type) { if (maybeTypeOfKind(type, 67108864 /* NonPrimitive */)) { - const result = filterType(type, (t) => !(t.flags & 131068 /* Primitive */)); + const result = filterType(type, (t) => !(t.flags & 134348796 /* Primitive */)); if (!(result.flags & 131072 /* Never */)) { return result; } @@ -84375,9 +85115,8 @@ ${lanes.join("\n")} "src/compiler/checker.ts"() { "use strict"; init_ts2(); - init_ts2(); - init_ts_performance(); init_ts_moduleSpecifiers(); + init_ts_performance(); ambientModuleSymbolRegex = /^".+"$/; anon = "(anonymous)"; nextSymbolId = 1; @@ -84490,6 +85229,7 @@ ${lanes.join("\n")} SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback"; SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity"; + SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature"; SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback"; return SignatureCheckMode3; })(SignatureCheckMode || {}); @@ -85835,7 +86575,7 @@ ${lanes.join("\n")} [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + nodeVisitor(node.expression, visitor, isExpression) ); }, // Clauses @@ -85920,31 +86660,31 @@ ${lanes.join("\n")} // src/compiler/sourcemap.ts function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) { - const { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; - const rawSources = []; - const sources = []; - const sourceToSourceIndexMap = /* @__PURE__ */ new Map(); - let sourcesContent; - const names = []; - let nameToNameIndexMap; - const mappingCharCodes = []; - let mappings = ""; - let lastGeneratedLine = 0; - let lastGeneratedCharacter = 0; - let lastSourceIndex = 0; - let lastSourceLine = 0; - let lastSourceCharacter = 0; - let lastNameIndex = 0; - let hasLast = false; - let pendingGeneratedLine = 0; - let pendingGeneratedCharacter = 0; - let pendingSourceIndex = 0; - let pendingSourceLine = 0; - let pendingSourceCharacter = 0; - let pendingNameIndex = 0; - let hasPending = false; - let hasPendingSource = false; - let hasPendingName = false; + var { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; + var rawSources = []; + var sources = []; + var sourceToSourceIndexMap = /* @__PURE__ */ new Map(); + var sourcesContent; + var names = []; + var nameToNameIndexMap; + var mappingCharCodes = []; + var mappings = ""; + var lastGeneratedLine = 0; + var lastGeneratedCharacter = 0; + var lastSourceIndex = 0; + var lastSourceLine = 0; + var lastSourceCharacter = 0; + var lastNameIndex = 0; + var hasLast = false; + var pendingGeneratedLine = 0; + var pendingGeneratedCharacter = 0; + var pendingSourceIndex = 0; + var pendingSourceLine = 0; + var pendingSourceCharacter = 0; + var pendingNameIndex = 0; + var hasPending = false; + var hasPendingSource = false; + var hasPendingName = false; return { getSources: () => rawSources, addSource, @@ -89206,7 +89946,7 @@ ${lanes.join("\n")} return node; } function tryGetConstEnumValue(node) { - if (compilerOptions.isolatedModules) { + if (getIsolatedModules(compilerOptions)) { return void 0; } return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; @@ -89763,7 +90503,16 @@ ${lanes.join("\n")} visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) ); } - return visitEachChild(node, visitor, context); + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); } function transformPublicFieldInitializer(node) { if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) { @@ -95126,7 +95875,7 @@ ${lanes.join("\n")} ); } function visitBinaryExpression(node, expressionResultIsUnused2) { - if (isDestructuringAssignment(node) && node.left.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + if (isDestructuringAssignment(node) && containsObjectRestOrSpread(node.left)) { return flattenDestructuringAssignment( node, visitor, @@ -95258,7 +96007,7 @@ ${lanes.join("\n")} } function visitForOfStatement(node, outermostLabeledStatement) { const ancestorFacts = enterSubtree(0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */ || isAssignmentPattern(node.initializer) && containsObjectRestOrSpread(node.initializer)) { node = transformForOfStatementWithObjectRest(node); } const result = node.awaitModifier ? transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) : factory2.restoreEnclosingLabel(visitEachChild(node, visitor, context), outermostLabeledStatement); @@ -103156,6 +103905,9 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitImportCallExpression(node) { + if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) { + return visitEachChild(node, visitor, context); + } const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; @@ -105645,7 +106397,7 @@ ${lanes.join("\n")} if (node.isDeclarationFile) { return node; } - if (isExternalModule(node) || compilerOptions.isolatedModules) { + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { currentSourceFile = node; importRequireStatements = void 0; let result = updateExternalModule(node); @@ -105852,7 +106604,7 @@ ${lanes.join("\n")} } function onEmitNode(hint, node, emitCallback) { if (isSourceFile(node)) { - if ((isExternalModule(node) || compilerOptions.isolatedModules) && compilerOptions.importHelpers) { + if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) { helperNameSubstitutions = /* @__PURE__ */ new Map(); } previousOnEmitNode(hint, node, emitCallback); @@ -106721,7 +107473,7 @@ ${lanes.join("\n")} if (elem.kind === 229 /* OmittedExpression */) { return elem; } - if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) { + if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) { return factory2.updateBindingElement( elem, elem.dotDotDotToken, @@ -108610,15 +109362,15 @@ ${lanes.join("\n")} return Debug.fail(`project ${configFile.options.configFilePath} expected to have at least one output`); } function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, declarationTransformers }, emitOnly, onlyBuildInfo, forceDtsEmit) { - const compilerOptions = host.getCompilerOptions(); - const sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; - const emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; - const emitterDiagnostics = createDiagnosticCollection(); - const newLine = getNewLineCharacter(compilerOptions); - const writer = createTextWriter(newLine); - const { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); - let bundleBuildInfo; - let emitSkipped = false; + var compilerOptions = host.getCompilerOptions(); + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; + var emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; + var emitterDiagnostics = createDiagnosticCollection(); + var newLine = getNewLineCharacter(compilerOptions); + var writer = createTextWriter(newLine); + var { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); + var bundleBuildInfo; + var emitSkipped = false; enter(); forEachEmittedFile( host, @@ -109138,7 +109890,7 @@ ${lanes.join("\n")} return outputFiles; } function createPrinter(printerOptions = {}, handlers = {}) { - const { + var { hasGlobalName, onEmitNode = noEmitNotification, isEmitNotificationEnabled, @@ -109150,57 +109902,57 @@ ${lanes.join("\n")} onBeforeEmitToken, onAfterEmitToken } = handlers; - const extendedDiagnostics = !!printerOptions.extendedDiagnostics; - const newLine = getNewLineCharacter(printerOptions); - const moduleKind = getEmitModuleKind(printerOptions); - const bundledHelpers = /* @__PURE__ */ new Map(); - let currentSourceFile; - let nodeIdToGeneratedName; - let nodeIdToGeneratedPrivateName; - let autoGeneratedIdToGeneratedName; - let generatedNames; - let formattedNameTempFlagsStack; - let formattedNameTempFlags; - let privateNameTempFlagsStack; - let privateNameTempFlags; - let tempFlagsStack; - let tempFlags; - let reservedNamesStack; - let reservedNames; - let reservedPrivateNamesStack; - let reservedPrivateNames; - let preserveSourceNewlines = printerOptions.preserveSourceNewlines; - let nextListElementPos; - let writer; - let ownWriter; - let write = writeBase; - let isOwnFileEmit; - const bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; - const relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; - const recordInternalSection = printerOptions.recordInternalSection; - let sourceFileTextPos = 0; - let sourceFileTextKind = "text" /* Text */; - let sourceMapsDisabled = true; - let sourceMapGenerator; - let sourceMapSource; - let sourceMapSourceIndex = -1; - let mostRecentlyAddedSourceMapSource; - let mostRecentlyAddedSourceMapSourceIndex = -1; - let containerPos = -1; - let containerEnd = -1; - let declarationListContainerEnd = -1; - let currentLineMap; - let detachedCommentsInfo; - let hasWrittenComment = false; - let commentsDisabled = !!printerOptions.removeComments; - let lastSubstitution; - let currentParenthesizerRule; - const { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); - const parenthesizer = factory.parenthesizer; - const typeArgumentParenthesizerRuleSelector = { + var extendedDiagnostics = !!printerOptions.extendedDiagnostics; + var newLine = getNewLineCharacter(printerOptions); + var moduleKind = getEmitModuleKind(printerOptions); + var bundledHelpers = /* @__PURE__ */ new Map(); + var currentSourceFile; + var nodeIdToGeneratedName; + var nodeIdToGeneratedPrivateName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var formattedNameTempFlagsStack; + var formattedNameTempFlags; + var privateNameTempFlagsStack; + var privateNameTempFlags; + var tempFlagsStack; + var tempFlags; + var reservedNamesStack; + var reservedNames; + var reservedPrivateNamesStack; + var reservedPrivateNames; + var preserveSourceNewlines = printerOptions.preserveSourceNewlines; + var nextListElementPos; + var writer; + var ownWriter; + var write = writeBase; + var isOwnFileEmit; + var bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; + var relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; + var recordInternalSection = printerOptions.recordInternalSection; + var sourceFileTextPos = 0; + var sourceFileTextKind = "text" /* Text */; + var sourceMapsDisabled = true; + var sourceMapGenerator; + var sourceMapSource; + var sourceMapSourceIndex = -1; + var mostRecentlyAddedSourceMapSource; + var mostRecentlyAddedSourceMapSourceIndex = -1; + var containerPos = -1; + var containerEnd = -1; + var declarationListContainerEnd = -1; + var currentLineMap; + var detachedCommentsInfo; + var hasWrittenComment = false; + var commentsDisabled = !!printerOptions.removeComments; + var lastSubstitution; + var currentParenthesizerRule; + var { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); + var parenthesizer = factory.parenthesizer; + var typeArgumentParenthesizerRuleSelector = { select: (index) => index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 }; - const emitBinaryExpression = createEmitBinaryExpression(); + var emitBinaryExpression = createEmitBinaryExpression(); reset2(); return { // public API @@ -109459,9 +110211,9 @@ ${lanes.join("\n")} formattedNameTempFlagsStack = []; formattedNameTempFlags = /* @__PURE__ */ new Map(); privateNameTempFlagsStack = []; - privateNameTempFlags = TempFlags.Auto; + privateNameTempFlags = 0 /* Auto */; tempFlagsStack = []; - tempFlags = TempFlags.Auto; + tempFlags = 0 /* Auto */; reservedNamesStack = []; reservedNames = void 0; reservedPrivateNamesStack = []; @@ -110430,7 +111182,7 @@ ${lanes.join("\n")} } function emitTypeLiteral(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -110619,7 +111371,7 @@ ${lanes.join("\n")} } function emitObjectLiteralExpression(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -111385,7 +112137,7 @@ ${lanes.join("\n")} } function emitClassDeclarationOrExpression(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -111418,7 +112170,7 @@ ${lanes.join("\n")} } function emitInterfaceDeclaration(node) { pushPrivateNameGenerationScope( - TempFlags.Auto, + 0 /* Auto */, /*newReservedMemberNames*/ void 0 ); @@ -112861,7 +113613,7 @@ ${lanes.join("\n")} return; } tempFlagsStack.push(tempFlags); - tempFlags = TempFlags.Auto; + tempFlags = 0 /* Auto */; formattedNameTempFlagsStack.push(formattedNameTempFlags); formattedNameTempFlags = void 0; reservedNamesStack.push(reservedNames); @@ -113047,7 +113799,7 @@ ${lanes.join("\n")} case "#": return privateNameTempFlags; default: - return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : TempFlags.Auto; + return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : 0 /* Auto */; } } function setTempFlags(formattedNameKey, flags) { @@ -113071,7 +113823,7 @@ ${lanes.join("\n")} const key = formatGeneratedName(privateName, prefix, "", suffix); let tempFlags2 = getTempFlags(key); if (flags && !(tempFlags2 & flags)) { - const name = flags === TempFlags._i ? "_i" : "_n"; + const name = flags === 268435456 /* _i */ ? "_i" : "_n"; const fullName = formatGeneratedName(privateName, prefix, name, suffix); if (isUniqueName(fullName, privateName)) { tempFlags2 |= flags; @@ -113085,7 +113837,7 @@ ${lanes.join("\n")} } } while (true) { - const count = tempFlags2 & TempFlags.CountMask; + const count = tempFlags2 & 268435455 /* CountMask */; tempFlags2++; if (count !== 8 && count !== 13) { const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); @@ -113229,7 +113981,7 @@ ${lanes.join("\n")} return generateNameCached(node.name, privateName); } return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reservedInNestedScopes*/ false, privateName, @@ -113286,7 +114038,7 @@ ${lanes.join("\n")} return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); case 164 /* ComputedPropertyName */: return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reserveInNestedScopes*/ true, privateName, @@ -113295,7 +114047,7 @@ ${lanes.join("\n")} ); default: return makeTempVariableName( - TempFlags.Auto, + 0 /* Auto */, /*reserveInNestedScopes*/ false, privateName, @@ -113310,11 +114062,11 @@ ${lanes.join("\n")} const suffix = formatGeneratedNamePart(autoGenerate.suffix); switch (autoGenerate.flags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); + return makeTempVariableName(0 /* Auto */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); case 2 /* Loop */: Debug.assertNode(name, isIdentifier); return makeTempVariableName( - TempFlags._i, + 268435456 /* _i */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), /*privateName*/ false, @@ -113796,7 +114548,7 @@ ${lanes.join("\n")} function getEmitListItem(emit, parenthesizerRule) { return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; } - var brackets, notImplementedResolver, createPrinterWithDefaults, createPrinterWithRemoveComments, createPrinterWithRemoveCommentsNeverAsciiEscape, createPrinterWithRemoveCommentsOmitTrailingSemicolon, TempFlags; + var brackets, notImplementedResolver, createPrinterWithDefaults, createPrinterWithRemoveComments, createPrinterWithRemoveCommentsNeverAsciiEscape, createPrinterWithRemoveCommentsOmitTrailingSemicolon; var init_emitter = __esm({ "src/compiler/emitter.ts"() { "use strict"; @@ -113847,16 +114599,10 @@ ${lanes.join("\n")} getDeclarationStatementsForSourceFile: notImplemented, isImportRequiredByAugmentation: notImplemented }; - createPrinterWithDefaults = memoize(() => createPrinter({})); - createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); - createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); - createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); - TempFlags = /* @__PURE__ */ ((TempFlags2) => { - TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; - TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; - TempFlags2[TempFlags2["_i"] = 268435456] = "_i"; - return TempFlags2; - })(TempFlags || {}); + createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({})); + createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true })); + createPrinterWithRemoveCommentsNeverAsciiEscape = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); + createPrinterWithRemoveCommentsOmitTrailingSemicolon = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); } }); @@ -114810,14 +115556,14 @@ ${lanes.join("\n")} function createModuleResolutionLoader(containingFile, redirectedReference, options, host, cache) { return { nameAndMode: moduleResolutionNameAndModeGetter, - resolve: (moduleName, resoluionMode) => resolveModuleName( + resolve: (moduleName, resolutionMode) => resolveModuleName( moduleName, containingFile, options, host, cache, redirectedReference, - resoluionMode + resolutionMode ) }; } @@ -116256,11 +117002,19 @@ ${lanes.join("\n")} diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); } else if (isClassDeclaration(parent2)) { const exportIndex = findIndex(parent2.modifiers, isExportModifier); - const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); - if (exportIndex >= 0 && decoratorIndex < exportIndex) { - diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files)); - } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) { - diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + if (exportIndex >= 0) { + const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); + if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (exportIndex >= 0 && decoratorIndex < exportIndex) { + const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex); + if (trailingDecoratorIndex >= 0) { + diagnostics.push(addRelatedInfo( + createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here) + )); + } + } } } } @@ -116438,7 +117192,7 @@ ${lanes.join("\n")} let imports; let moduleAugmentations; let ambientModules; - if ((options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { + if ((getIsolatedModules(options) || isExternalModuleFile) && !file.isDeclarationFile) { if (options.importHelpers) { imports = [createSyntheticImport(externalHelpersModuleNameText, file)]; } @@ -117159,12 +117913,12 @@ ${lanes.join("\n")} if (options.exactOptionalPropertyTypes && !getStrictOptionValue(options, "strictNullChecks")) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks"); } - if (options.isolatedModules) { + if (options.isolatedModules || options.verbatimModuleSyntax) { if (options.out) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); } if (options.outFile) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", "isolatedModules"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); } } if (options.inlineSourceMap) { @@ -117375,10 +118129,10 @@ ${lanes.join("\n")} } } if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) { - createDiagnosticForOptionName(Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports"); } + const moduleKind = getEmitModuleKind(options); if (options.verbatimModuleSyntax) { - const moduleKind = getEmitModuleKind(options); if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } @@ -117397,13 +118151,16 @@ ${lanes.join("\n")} } const moduleResolution = getEmitModuleResolutionKind(options); if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("resolvePackageJsonExports", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); } if (options.resolvePackageJsonImports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("resolvePackageJsonImports", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); } if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createOptionValueDiagnostic("customConditions", Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + } + if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)) { + createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "bundler"); } if (!options.noEmit && !options.suppressOutputPathCheck) { const emitHost = getEmitHost(); @@ -117558,7 +118315,7 @@ ${lanes.join("\n")} if (version2 === "6.0" /* v6_0 */) { createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); } else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); } } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { @@ -118721,7 +119478,7 @@ ${lanes.join("\n")} return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); } const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || outFile(compilerOptions))) { + if (compilerOptions && (getIsolatedModules(compilerOptions) || outFile(compilerOptions))) { return [sourceFileWithUpdatedShape]; } const seenFileNamesMap = /* @__PURE__ */ new Map(); @@ -119136,7 +119893,7 @@ ${lanes.join("\n")} return; if (!isChangedSignature(state, affectedFile.resolvedPath)) return; - if (state.compilerOptions.isolatedModules) { + if (getIsolatedModules(state.compilerOptions)) { const seenFileNamesMap = /* @__PURE__ */ new Map(); seenFileNamesMap.set(affectedFile.resolvedPath, true); const queue = BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath); @@ -119229,14 +119986,17 @@ ${lanes.join("\n")} const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0; const fileNames = []; const fileNameToFileId = /* @__PURE__ */ new Map(); + const root = []; if (outFile(state.compilerOptions)) { const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => { - toFileId(key); + const fileId = toFileId(key); + tryAddRoot(key, fileId); return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version; }); const program2 = { fileNames, fileInfos: fileInfos2, + root, options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), outSignature: state.outSignature, latestChangedDtsFile, @@ -119264,6 +120024,7 @@ ${lanes.join("\n")} const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value]) => { var _a3, _b2; const fileId = toFileId(key); + tryAddRoot(key, fileId); Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key)); const oldSignature = (_a3 = state.oldSignatures) == null ? void 0 : _a3.get(key); const actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value.signature; @@ -119363,6 +120124,7 @@ ${lanes.join("\n")} const program = { fileNames, fileInfos, + root, options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), fileIdsList, referencedMap, @@ -119398,6 +120160,24 @@ ${lanes.join("\n")} } return fileIdListId; } + function tryAddRoot(path, fileId) { + const file = state.program.getSourceFile(path); + if (!state.program.getFileIncludeReasons().get(file.path).some((r) => r.kind === 0 /* RootFile */)) + return; + if (!root.length) + return root.push(fileId); + const last2 = root[root.length - 1]; + const isLastStartEnd = isArray(last2); + if (isLastStartEnd && last2[1] === fileId - 1) + return last2[1] = fileId; + if (isLastStartEnd || root.length === 1 || last2 !== fileId - 1) + return root.push(fileId); + const lastButOne = root[root.length - 2]; + if (!isNumber(lastButOne) || lastButOne !== last2 - 1) + return root.push(fileId); + root[root.length - 2] = [lastButOne, fileId]; + return root.length = root.length - 1; + } function convertToProgramBuildInfoCompilerOptions(options) { let result; const { optionsNameMap } = getOptionsNameMap(); @@ -119905,12 +120685,28 @@ ${lanes.join("\n")} const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); const fileInfos = /* @__PURE__ */ new Map(); + let rootIndex = 0; + const roots = []; program.fileInfos.forEach((fileInfo, index) => { const path = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName); const version2 = isString(fileInfo) ? fileInfo : fileInfo.version; fileInfos.set(path, version2); + if (rootIndex < program.root.length) { + const current = program.root[rootIndex]; + const fileId = index + 1; + if (isArray(current)) { + if (current[0] <= fileId && fileId <= current[1]) { + roots.push(path); + if (current[1] === fileId) + rootIndex++; + } + } else if (current === fileId) { + roots.push(path); + rootIndex++; + } + } }); - return fileInfos; + return { fileInfos, roots }; } function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) { return { @@ -120854,7 +121650,7 @@ ${lanes.join("\n")} return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine; } function getLocaleTimeString(system) { - return !system.now ? new Date().toLocaleTimeString() : ( + return !system.now ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : ( // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM. // This branch is solely for testing, so just switch it to a normal space for baseline stability. // See: @@ -122243,13 +123039,14 @@ ${lanes.join("\n")} UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithUpstream"] = 7] = "OutOfDateWithUpstream"; UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfo"] = 8] = "OutOfDateBuildInfo"; UpToDateStatusType2[UpToDateStatusType2["OutOfDateOptions"] = 9] = "OutOfDateOptions"; - UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 10] = "UpstreamOutOfDate"; - UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 11] = "UpstreamBlocked"; - UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 12] = "ComputingUpstream"; - UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 13] = "TsVersionOutputOfDate"; - UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 14] = "UpToDateWithInputFileText"; - UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 15] = "ContainerOnly"; - UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 16] = "ForceBuild"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateRoots"] = 10] = "OutOfDateRoots"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 11] = "UpstreamOutOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 12] = "UpstreamBlocked"; + UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 13] = "ComputingUpstream"; + UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 14] = "TsVersionOutputOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 15] = "UpToDateWithInputFileText"; + UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 16] = "ContainerOnly"; + UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 17] = "ForceBuild"; return UpToDateStatusType2; })(UpToDateStatusType || {}); } @@ -122269,7 +123066,7 @@ ${lanes.join("\n")} return getOrCreateValueFromConfigFileMap(configFileMap, resolved, () => /* @__PURE__ */ new Map()); } function getCurrentTime(host) { - return host.now ? host.now() : new Date(); + return host.now ? host.now() : /* @__PURE__ */ new Date(); } function isCircularBuildOrder(buildOrder) { return !!buildOrder && !!buildOrder.buildOrder; @@ -123131,7 +123928,7 @@ ${lanes.join("\n")} } continue; } - if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 14 /* UpToDateWithInputFileText */) { + if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) { reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); return { kind: 2 /* UpdateOutputFileStamps */, @@ -123143,7 +123940,7 @@ ${lanes.join("\n")} }; } } - if (status.type === 11 /* UpstreamBlocked */) { + if (status.type === 12 /* UpstreamBlocked */) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); projectPendingBuild.delete(projectPath); @@ -123157,7 +123954,7 @@ ${lanes.join("\n")} } continue; } - if (status.type === 15 /* ContainerOnly */) { + if (status.type === 16 /* ContainerOnly */) { verboseReportProjectStatus(state, project, status); reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); projectPendingBuild.delete(projectPath); @@ -123344,31 +124141,31 @@ ${lanes.join("\n")} var _a2, _b; if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) { return { - type: 15 /* ContainerOnly */ + type: 16 /* ContainerOnly */ }; } let referenceStatuses; const force = !!state.options.force; if (project.projectReferences) { - state.projectStatus.set(resolvedPath, { type: 12 /* ComputingUpstream */ }); + state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ }); for (const ref of project.projectReferences) { const resolvedRef = resolveProjectReferencePath(ref); const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef); const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath); const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath); - if (refStatus.type === 12 /* ComputingUpstream */ || refStatus.type === 15 /* ContainerOnly */) { + if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) { continue; } - if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 11 /* UpstreamBlocked */) { + if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) { return { - type: 11 /* UpstreamBlocked */, + type: 12 /* UpstreamBlocked */, upstreamProjectName: ref.path, - upstreamProjectBlocked: refStatus.type === 11 /* UpstreamBlocked */ + upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */ }; } if (refStatus.type !== 1 /* UpToDate */) { return { - type: 10 /* UpstreamOutOfDate */, + type: 11 /* UpstreamOutOfDate */, upstreamProjectName: ref.path }; } @@ -123377,7 +124174,7 @@ ${lanes.join("\n")} } } if (force) - return { type: 16 /* ForceBuild */ }; + return { type: 17 /* ForceBuild */ }; const { host } = state; const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options); let oldestOutputFileName; @@ -123410,7 +124207,7 @@ ${lanes.join("\n")} } if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== version) { return { - type: 13 /* TsVersionOutputOfDate */, + type: 14 /* TsVersionOutputOfDate */, version: buildInfo.version }; } @@ -123435,6 +124232,7 @@ ${lanes.join("\n")} let newestInputFileName = void 0; let newestInputFileTime = minimumDate; let pseudoInputUpToDate = false; + const seenRoots = /* @__PURE__ */ new Set(); for (const inputFile of project.fileNames) { const inputTime = getModifiedTime2(state, inputFile); if (inputTime === missingFileModifiedTime) { @@ -123449,7 +124247,7 @@ ${lanes.join("\n")} if (buildInfoProgram) { if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); - version2 = buildInfoVersionMap.get(toPath2(state, inputFile)); + version2 = buildInfoVersionMap.fileInfos.get(toPath2(state, inputFile)); const text = version2 ? state.readFileWithCache(inputFile) : void 0; currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0; if (version2 && version2 === currentVersion) @@ -123467,6 +124265,21 @@ ${lanes.join("\n")} newestInputFileName = inputFile; newestInputFileTime = inputTime; } + if (buildInfoProgram) + seenRoots.add(toPath2(state, inputFile)); + } + if (buildInfoProgram) { + if (!buildInfoVersionMap) + buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); + for (const existingRoot of buildInfoVersionMap.roots) { + if (!seenRoots.has(existingRoot)) { + return { + type: 10 /* OutOfDateRoots */, + buildInfoFile: buildInfoPath, + inputFile: existingRoot + }; + } + } } if (!buildInfoPath) { const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames()); @@ -123548,7 +124361,7 @@ ${lanes.join("\n")} }; } return { - type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 14 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, + type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, newestInputFileTime, newestInputFileName, oldestOutputFileName @@ -123667,7 +124480,7 @@ ${lanes.join("\n")} } break; } - case 14 /* UpToDateWithInputFileText */: + case 15 /* UpToDateWithInputFileText */: case 2 /* UpToDateWithUpstreamTypes */: case 3 /* OutOfDateWithPrepend */: if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) { @@ -123678,7 +124491,7 @@ ${lanes.join("\n")} }); } break; - case 11 /* UpstreamBlocked */: + case 12 /* UpstreamBlocked */: if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) { clearProjectStatus(state, nextProjectPath); } @@ -124129,6 +124942,14 @@ ${lanes.join("\n")} relName(state, configFileName), relName(state, status.buildInfoFile) ); + case 10 /* OutOfDateRoots */: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more, + relName(state, configFileName), + relName(state, status.buildInfoFile), + relName(state, status.inputFile) + ); case 1 /* UpToDate */: if (status.newestInputFileTime !== void 0) { return reportStatus( @@ -124153,20 +124974,20 @@ ${lanes.join("\n")} Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName) ); - case 14 /* UpToDateWithInputFileText */: + case 15 /* UpToDateWithInputFileText */: return reportStatus( state, Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files, relName(state, configFileName) ); - case 10 /* UpstreamOutOfDate */: + case 11 /* UpstreamOutOfDate */: return reportStatus( state, Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, relName(state, configFileName), relName(state, status.upstreamProjectName) ); - case 11 /* UpstreamBlocked */: + case 12 /* UpstreamBlocked */: return reportStatus( state, status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, @@ -124180,7 +125001,7 @@ ${lanes.join("\n")} relName(state, configFileName), status.reason ); - case 13 /* TsVersionOutputOfDate */: + case 14 /* TsVersionOutputOfDate */: return reportStatus( state, Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, @@ -124188,14 +125009,14 @@ ${lanes.join("\n")} status.version, version ); - case 16 /* ForceBuild */: + case 17 /* ForceBuild */: return reportStatus( state, Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName) ); - case 15 /* ContainerOnly */: - case 12 /* ComputingUpstream */: + case 16 /* ContainerOnly */: + case 13 /* ComputingUpstream */: break; default: assertType(status); @@ -124213,8 +125034,8 @@ ${lanes.join("\n")} init_ts2(); init_ts2(); init_ts_performance(); - minimumDate = new Date(-864e13); - maximumDate = new Date(864e13); + minimumDate = /* @__PURE__ */ new Date(-864e13); + maximumDate = /* @__PURE__ */ new Date(864e13); InvalidatedProjectKind = /* @__PURE__ */ ((InvalidatedProjectKind2) => { InvalidatedProjectKind2[InvalidatedProjectKind2["Build"] = 0] = "Build"; InvalidatedProjectKind2[InvalidatedProjectKind2["UpdateBundle"] = 1] = "UpdateBundle"; @@ -124645,7 +125466,7 @@ ${lanes.join("\n")} return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0; } function nowString() { - const d = new Date(); + const d = /* @__PURE__ */ new Date(); return `${padLeft(d.getHours().toString(), 2, "0")}:${padLeft(d.getMinutes().toString(), 2, "0")}:${padLeft(d.getSeconds().toString(), 2, "0")}.${padLeft(d.getMilliseconds().toString(), 3, "0")}`; } var ActionSet, ActionInvalidate, ActionPackageInstalled, EventTypesRegistry, EventBeginInstallTypes, EventEndInstallTypes, EventInitializationFailed, Arguments; @@ -126291,6 +127112,13 @@ ${lanes.join("\n")} } return false; } + function isStringAndEmptyAnonymousObjectIntersection(type) { + if (!type.isIntersection()) { + return false; + } + const { types, checker } = type; + return types.length === 2 && types[0].flags & 4 /* String */ && checker.isEmptyAnonymousObjectType(types[1]); + } function isPunctuation(kind) { return 18 /* FirstPunctuation */ <= kind && kind <= 78 /* LastPunctuation */; } @@ -126455,7 +127283,7 @@ ${lanes.join("\n")} }; } function moduleResolutionUsesNodeModules(moduleResolution) { - return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */; + return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) { return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0; @@ -126471,7 +127299,7 @@ ${lanes.join("\n")} ); } function makeStringLiteral(text, quotePreference) { - return factory.createStringLiteral(text, quotePreference === QuotePreference.Single); + return factory.createStringLiteral(text, quotePreference === 0 /* Single */); } function quotePreferenceFromString(str, sourceFile) { return isStringDoubleQuoted(str, sourceFile) ? 1 /* Double */ : 0 /* Single */; @@ -127102,7 +127930,7 @@ ${lanes.join("\n")} return isBinaryExpression(expression) && expression.operatorToken.kind === 27 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression); } function getContextualTypeFromParent(node, checker, contextFlags) { - const { parent: parent2 } = node; + const parent2 = walkUpParenthesizedExpressions(node.parent); switch (parent2.kind) { case 211 /* NewExpression */: return checker.getContextualType(parent2, contextFlags); @@ -127111,7 +127939,7 @@ ${lanes.join("\n")} return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags); } case 292 /* CaseClause */: - return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0; + return getSwitchedType(parent2, checker); default: return checker.getContextualType(node, contextFlags); } @@ -127373,7 +128201,13 @@ ${lanes.join("\n")} function createPackageJsonImportFilter(fromFile, preferences, host) { const packageJsons = (host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || getPackageJsonsVisibleToFile(fromFile.fileName, host)).filter((p) => p.parseable); let usesNodeCoreModules; - return { allowsImportingAmbientModule, allowsImportingSourceFile, allowsImportingSpecifier }; + let ambientModuleCache; + let sourceFileCache; + return { + allowsImportingAmbientModule, + allowsImportingSourceFile, + allowsImportingSpecifier + }; function moduleSpecifierIsCoveredByPackageJson(specifier) { const packageName = getNodeModuleRootSpecifier(specifier); for (const packageJson of packageJsons) { @@ -127387,26 +128221,49 @@ ${lanes.join("\n")} if (!packageJsons.length || !moduleSymbol.valueDeclaration) { return true; } - const declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); - const declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); - if (typeof declaringNodeModuleName === "undefined") { - return true; + if (!ambientModuleCache) { + ambientModuleCache = /* @__PURE__ */ new Map(); + } else { + const cached = ambientModuleCache.get(moduleSymbol); + if (cached !== void 0) { + return cached; + } } const declaredModuleSpecifier = stripQuotes(moduleSymbol.getName()); if (isAllowedCoreNodeModulesImport(declaredModuleSpecifier)) { + ambientModuleCache.set(moduleSymbol, true); return true; } - return moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); + const declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); + const declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); + if (typeof declaringNodeModuleName === "undefined") { + ambientModuleCache.set(moduleSymbol, true); + return true; + } + const result = moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); + ambientModuleCache.set(moduleSymbol, result); + return result; } function allowsImportingSourceFile(sourceFile, moduleSpecifierResolutionHost) { if (!packageJsons.length) { return true; } + if (!sourceFileCache) { + sourceFileCache = /* @__PURE__ */ new Map(); + } else { + const cached = sourceFileCache.get(sourceFile); + if (cached !== void 0) { + return cached; + } + } const moduleSpecifier = getNodeModulesPackageNameFromFileName(sourceFile.fileName, moduleSpecifierResolutionHost); if (!moduleSpecifier) { + sourceFileCache.set(sourceFile, true); return true; } - return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + const result = moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + sourceFileCache.set(sourceFile, result); + return result; } function allowsImportingSpecifier(moduleSpecifier) { if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) { @@ -127554,10 +128411,13 @@ ${lanes.join("\n")} return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */); } function getDefaultLikeExportNameFromDeclaration(symbol) { - return firstDefined(symbol.declarations, (d) => { - var _a2; - return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : void 0; - }); + return firstDefined( + symbol.declarations, + (d) => { + var _a2, _b; + return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text; + } + ); } function getSymbolParentOrFail(symbol) { var _a2; @@ -127626,6 +128486,64 @@ ${lanes.join("\n")} function isSourceFileFromLibrary(program, node) { return program.isSourceFileFromExternalLibrary(node) || program.isSourceFileDefaultLibrary(node); } + function newCaseClauseTracker(checker, clauses) { + const existingStrings = /* @__PURE__ */ new Set(); + const existingNumbers = /* @__PURE__ */ new Set(); + const existingBigInts = /* @__PURE__ */ new Set(); + for (const clause of clauses) { + if (!isDefaultClause(clause)) { + const expression = skipParentheses(clause.expression); + if (isLiteralExpression(expression)) { + switch (expression.kind) { + case 14 /* NoSubstitutionTemplateLiteral */: + case 10 /* StringLiteral */: + existingStrings.add(expression.text); + break; + case 8 /* NumericLiteral */: + existingNumbers.add(parseInt(expression.text)); + break; + case 9 /* BigIntLiteral */: + const parsedBigInt = parseBigInt(endsWith(expression.text, "n") ? expression.text.slice(0, -1) : expression.text); + if (parsedBigInt) { + existingBigInts.add(pseudoBigIntToString(parsedBigInt)); + } + break; + } + } else { + const symbol = checker.getSymbolAtLocation(clause.expression); + if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { + const enumValue = checker.getConstantValue(symbol.valueDeclaration); + if (enumValue !== void 0) { + addValue(enumValue); + } + } + } + } + } + return { + addValue, + hasValue + }; + function addValue(value) { + switch (typeof value) { + case "string": + existingStrings.add(value); + break; + case "number": + existingNumbers.add(value); + } + } + function hasValue(value) { + switch (typeof value) { + case "string": + return existingStrings.has(value); + case "number": + return existingNumbers.has(value); + case "object": + return existingBigInts.has(pseudoBigIntToString(value)); + } + } + } var scanner, SemanticMeaning, tripleSlashDirectivePrefixRegex, typeKeywords, QuotePreference, displayPartWriter, lineFeed2, ANONYMOUS, syntaxMayBeASICandidate; var init_utilities4 = __esm({ "src/services/utilities.ts"() { @@ -127922,13 +128840,25 @@ ${lanes.join("\n")} const autoImportProvider = useAutoImportProvider && ((_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host)); if (autoImportProvider) { const start = timestamp(); - forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => cb( - module2, - file, - autoImportProvider, - /*isFromPackageJson*/ - true - )); + const checker = program.getTypeChecker(); + forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => { + if (file && !program.getSourceFile(file.fileName) || !file && !checker.resolveName( + module2.name, + /*location*/ + void 0, + 1536 /* Module */, + /*excludeGlobals*/ + false + )) { + cb( + module2, + file, + autoImportProvider, + /*isFromPackageJson*/ + true + ); + } + }); (_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start}`); } } @@ -132429,7 +133359,8 @@ ${lanes.join("\n")} options.triggerCharacter, options.triggerKind, cancellationToken, - formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host) + formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host), + options.includeSymbol ); } function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) { @@ -133335,9 +134266,9 @@ ${lanes.join("\n")} "src/services/services.ts"() { "use strict"; init_ts4(); + init_ts4(); init_ts_NavigateTo(); init_ts_NavigationBar(); - init_ts4(); servicesVersion = "0.8"; NodeObject = class { constructor(kind, pos, end) { @@ -136343,8 +137274,8 @@ ${lanes.join("\n")} var init_addEmptyExportDeclaration = __esm({ "src/services/codefixes/addEmptyExportDeclaration.ts"() { "use strict"; - init_ts_codefix(); init_ts4(); + init_ts_codefix(); registerCodeFix({ errorCodes: [ Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code, @@ -138708,8 +139639,8 @@ ${lanes.join("\n")} var init_convertToEsModule = __esm({ "src/services/codefixes/convertToEsModule.ts"() { "use strict"; - init_ts_codefix(); init_ts4(); + init_ts_codefix(); registerCodeFix({ errorCodes: [Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code], getCodeActions(context) { @@ -139107,6 +140038,7 @@ ${lanes.join("\n")} sourceFile, symbol, symbolName2, + moduleSymbol, /*isJsxTagName*/ false, program, @@ -139118,7 +140050,6 @@ ${lanes.join("\n")} const fix = getImportFixForSymbol( sourceFile, Debug.checkDefined(exportInfo), - moduleSymbol, program, /*position*/ void 0, @@ -139135,13 +140066,13 @@ ${lanes.join("\n")} var _a2, _b; const { fix, symbolName: symbolName2 } = info; switch (fix.kind) { - case ImportFixKind.UseNamespace: + case 0 /* UseNamespace */: addToNamespace.push(fix); break; - case ImportFixKind.JsdocTypeImport: + case 1 /* JsdocTypeImport */: importType.push(fix); break; - case ImportFixKind.AddToExisting: { + case 2 /* AddToExisting */: { const { importClauseOrBindingPattern, importKind, addAsTypeOnly } = fix; const key = String(getNodeId(importClauseOrBindingPattern)); let entry = addToExisting.get(key); @@ -139160,7 +140091,7 @@ ${lanes.join("\n")} } break; } - case ImportFixKind.AddNew: { + case 3 /* AddNew */: { const { moduleSpecifier, importKind, useRequire, addAsTypeOnly } = fix; const entry = getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly); Debug.assert(entry.useRequire === useRequire, "(Add new) Tried to add an `import` and a `require` for the same module"); @@ -139181,7 +140112,7 @@ ${lanes.join("\n")} } break; } - case ImportFixKind.PromoteTypeOnly: + case 4 /* PromoteTypeOnly */: break; default: Debug.assertNever(fix, `fix wasn't never - got kind ${fix.kind}`); @@ -139208,13 +140139,13 @@ ${lanes.join("\n")} namespaceLikeImport: void 0, useRequire }; - if (importKind === 1 /* Default */ && addAsTypeOnly === AddAsTypeOnly.Required) { + if (importKind === 1 /* Default */ && addAsTypeOnly === 2 /* Required */) { if (typeOnlyEntry) return typeOnlyEntry; newImports.set(typeOnlyKey, newEntry); return newEntry; } - if (addAsTypeOnly === AddAsTypeOnly.Allowed && (typeOnlyEntry || nonTypeOnlyEntry)) { + if (addAsTypeOnly === 1 /* Allowed */ && (typeOnlyEntry || nonTypeOnlyEntry)) { return typeOnlyEntry || nonTypeOnlyEntry; } if (nonTypeOnlyEntry) { @@ -139255,7 +140186,8 @@ ${lanes.join("\n")} quotePreference, defaultImport, namedImports && arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })), - namespaceLikeImport + namespaceLikeImport, + compilerOptions ); newDeclarations = combine(newDeclarations, declarations); }); @@ -139296,13 +140228,19 @@ ${lanes.join("\n")} return result && { ...result, computedWithoutCacheCount }; } } - function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { + function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { const compilerOptions = program.getCompilerOptions(); - const exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, isJsxTagName, program, host, preferences, cancellationToken); - Debug.assertIsDefined(exportInfos); + let exportInfos; + if (exportMapKey) { + exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey); + Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified exportMapKey"); + } else { + exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, symbolName2, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, moduleSymbol, isJsxTagName, program, host, preferences, cancellationToken); + Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified symbol / moduleSymbol"); + } const useRequire = shouldUseRequire(sourceFile, program); const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); - const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); + const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); return { moduleSpecifier: fix.moduleSpecifier, codeAction: codeFixActionToCodeAction(codeActionForFix( @@ -139324,23 +140262,22 @@ ${lanes.join("\n")} const includeSymbolNameInDescription = symbolName2 !== symbolToken.text; return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences)); } - function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { - Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol"); + function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); } function codeFixActionToCodeAction({ description: description2, changes, commands }) { return { description: description2, changes, commands }; } - function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, preferCapitalized, program, host, preferences, cancellationToken) { + function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSymbol, preferCapitalized, program, host, preferences, cancellationToken) { const getChecker = createGetChecker(program, host); return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => { - if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol) { + if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol && info.some((i) => i.moduleSymbol === moduleSymbol || i.symbol.parent === moduleSymbol)) { return info; } }); } - function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) { + function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program, host) { var _a2, _b; const compilerOptions = program.getCompilerOptions(); const mainProgramInfo = getInfoWithChecker( @@ -139362,7 +140299,7 @@ ${lanes.join("\n")} if (defaultInfo && skipAlias(defaultInfo.symbol, checker) === symbol) { return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; } - const named = checker.tryGetMemberInModuleExportsAndProperties(symbol.name, moduleSymbol); + const named = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); if (named && skipAlias(named, checker) === symbol) { return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0 /* Named */, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; } @@ -139428,7 +140365,7 @@ ${lanes.join("\n")} if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2 /* Error */) { return 2 /* Required */; } - if ((compilerOptions.isolatedModules && compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { + if (importNameElisionDisabled(compilerOptions) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { return 2 /* Required */; } return 1 /* Allowed */; @@ -139912,7 +140849,14 @@ ${lanes.join("\n")} insertImports( changes, sourceFile, - getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport), + getDeclarations( + moduleSpecifier, + quotePreference, + defaultImport, + namedImports, + namespaceLikeImport, + compilerOptions + ), /*blankLineBetween*/ true, preferences @@ -139936,7 +140880,7 @@ ${lanes.join("\n")} return promotedDeclaration.kind === 268 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) { - const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax; + const convertExistingToTypeOnly = importNameElisionDisabled(compilerOptions); switch (aliasDeclaration.kind) { case 273 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { @@ -140010,7 +140954,7 @@ ${lanes.join("\n")} } const promoteFromTypeOnly2 = clause.isTypeOnly && some([defaultImport, ...namedImports], (i) => (i == null ? void 0 : i.addAsTypeOnly) === 4 /* NotAllowed */); const existingSpecifiers = clause.namedBindings && ((_a2 = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a2.elements); - const convertExistingToTypeOnly = promoteFromTypeOnly2 && (compilerOptions.preserveValueImports && compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax); + const convertExistingToTypeOnly = promoteFromTypeOnly2 && importNameElisionDisabled(compilerOptions); if (defaultImport) { Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " }); @@ -140094,11 +141038,11 @@ ${lanes.join("\n")} function needsTypeOnly({ addAsTypeOnly }) { return addAsTypeOnly === 2 /* Required */; } - function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport) { + function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions) { const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference); let statements; if (defaultImport !== void 0 || (namedImports == null ? void 0 : namedImports.length)) { - const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly); + const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || compilerOptions.verbatimModuleSyntax && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */); statements = combine(statements, makeImport( defaultImport && factory.createIdentifier(defaultImport.name), namedImports == null ? void 0 : namedImports.map(({ addAsTypeOnly, name }) => factory.createImportSpecifier( @@ -140221,7 +141165,7 @@ ${lanes.join("\n")} } return !isStringANonContextualKeyword(res) ? res || "_" : `_${res}`; } - var importFixName, importFixId, errorCodes17, ImportFixKind, AddAsTypeOnly; + var importFixName, importFixId, errorCodes17; var init_importFixes = __esm({ "src/services/codefixes/importFixes.ts"() { "use strict"; @@ -140280,20 +141224,6 @@ ${lanes.join("\n")} return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, importAdder.writeFixes)); } }); - ImportFixKind = /* @__PURE__ */ ((ImportFixKind2) => { - ImportFixKind2[ImportFixKind2["UseNamespace"] = 0] = "UseNamespace"; - ImportFixKind2[ImportFixKind2["JsdocTypeImport"] = 1] = "JsdocTypeImport"; - ImportFixKind2[ImportFixKind2["AddToExisting"] = 2] = "AddToExisting"; - ImportFixKind2[ImportFixKind2["AddNew"] = 3] = "AddNew"; - ImportFixKind2[ImportFixKind2["PromoteTypeOnly"] = 4] = "PromoteTypeOnly"; - return ImportFixKind2; - })(ImportFixKind || {}); - AddAsTypeOnly = /* @__PURE__ */ ((AddAsTypeOnly2) => { - AddAsTypeOnly2[AddAsTypeOnly2["Allowed"] = 1] = "Allowed"; - AddAsTypeOnly2[AddAsTypeOnly2["Required"] = 2] = "Required"; - AddAsTypeOnly2[AddAsTypeOnly2["NotAllowed"] = 4] = "NotAllowed"; - return AddAsTypeOnly2; - })(AddAsTypeOnly || {}); } }); @@ -140746,7 +141676,7 @@ ${lanes.join("\n")} } function updateExport(changes, program, sourceFile, node, names) { const namedExports = node.exportClause && isNamedExports(node.exportClause) ? node.exportClause.elements : factory.createNodeArray([]); - const allowTypeModifier = !node.isTypeOnly && !!(program.getCompilerOptions().isolatedModules || find(namedExports, (e) => e.isTypeOnly)); + const allowTypeModifier = !node.isTypeOnly && !!(getIsolatedModules(program.getCompilerOptions()) || find(namedExports, (e) => e.isTypeOnly)); changes.replaceNode( sourceFile, node, @@ -140778,7 +141708,7 @@ ${lanes.join("\n")} factory.createNamedExports(createExportSpecifiers( names, /*allowTypeModifier*/ - !!program.getCompilerOptions().isolatedModules + getIsolatedModules(program.getCompilerOptions()) )), /*moduleSpecifier*/ void 0, @@ -141741,7 +142671,7 @@ ${lanes.join("\n")} } if (isObjectLiteralType(type)) { const props = map(checker.getPropertiesOfType(type), (prop) => { - const initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration), enclosingDeclaration) : createUndefined(); + const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), enclosingDeclaration); return factory.createPropertyAssignment(prop.name, initializer); }); return factory.createObjectLiteralExpression( @@ -142308,8 +143238,8 @@ ${lanes.join("\n")} var init_fixModuleAndTargetOptions = __esm({ "src/services/codefixes/fixModuleAndTargetOptions.ts"() { "use strict"; - init_ts_codefix(); init_ts4(); + init_ts_codefix(); registerCodeFix({ errorCodes: [ Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code, @@ -145062,13 +145992,7 @@ ${lanes.join("\n")} function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) { if (length(signatures)) { const type = checker.getUnionType(map(signatures, checker.getReturnTypeOfSignature)); - return checker.typeToTypeNode( - type, - enclosingDeclaration, - /*flags*/ - void 0, - getNoopSymbolTrackerWithResolver(context) - ); + return checker.typeToTypeNode(type, enclosingDeclaration, 1 /* NoTruncation */, getNoopSymbolTrackerWithResolver(context)); } } function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType, quotePreference, body) { @@ -145360,7 +146284,14 @@ ${lanes.join("\n")} changeTracker.replaceNode(file, declaration, property); } function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { - const assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); + let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); + if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) { + if (assignment === declaration) + assignment = factory.cloneNode(assignment); + assignment.modifiers = void 0; + assignment.questionToken = void 0; + assignment.exclamationToken = void 0; + } changeTracker.replacePropertyAssignment(file, declaration, assignment); } function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { @@ -146489,7 +147420,7 @@ ${lanes.join("\n")} return !!(origin && origin.kind === 32 /* ResolvedExport */); } function originIncludesSymbolName(origin) { - return originIsExport(origin) || originIsResolvedExport(origin); + return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin); } function originIsPackageJsonImport(origin) { return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson; @@ -146509,6 +147440,9 @@ ${lanes.join("\n")} function originIsIgnore(origin) { return !!(origin && origin.kind & 256 /* Ignore */); } + function originIsComputedPropertyName(origin) { + return !!(origin && origin.kind & 512 /* ComputedPropertyName */); + } function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) { var _a2, _b, _c; const start = timestamp(); @@ -146551,7 +147485,7 @@ ${lanes.join("\n")} return result2 || (needsFullResolution ? "failed" : "skipped"); } } - function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) { + function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) { var _a2; const { previousToken } = getRelevantTokens(position, sourceFile); if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) { @@ -146573,7 +147507,7 @@ ${lanes.join("\n")} } else { incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear(); } - const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences); + const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol); if (stringCompletions) { return stringCompletions; } @@ -146597,19 +147531,19 @@ ${lanes.join("\n")} return void 0; } switch (completionData.kind) { - case CompletionDataKind.Data: - const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position); + case 0 /* Data */: + const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol); if (response == null ? void 0 : response.isIncomplete) { incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response); } return response; - case CompletionDataKind.JsDocTagName: + case 1 /* JsDocTagName */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocTagNameCompletions()); - case CompletionDataKind.JsDocTag: + case 2 /* JsDocTag */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocTagCompletions()); - case CompletionDataKind.JsDocParameterName: + case 3 /* JsDocParameterName */: return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocParameterNameCompletions(completionData.tag)); - case CompletionDataKind.Keywords: + case 4 /* Keywords */: return specificKeywordCompletionInfo(completionData.keywordCompletions, completionData.isNewIdentifierLocation); default: return Debug.assertNever(completionData); @@ -146712,7 +147646,7 @@ ${lanes.join("\n")} } function keywordCompletionData(keywordFilters, filterOutTsOnlyKeywords, isNewIdentifierLocation) { return { - kind: CompletionDataKind.Keywords, + kind: 4 /* Keywords */, keywordCompletions: getKeywordCompletions(keywordFilters, filterOutTsOnlyKeywords), isNewIdentifierLocation }; @@ -146728,7 +147662,7 @@ ${lanes.join("\n")} function getOptionalReplacementSpan(location) { return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0; } - function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) { + function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) { const { symbols, contextToken, @@ -146802,7 +147736,8 @@ ${lanes.join("\n")} symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, - isRightOfOpenTag + isRightOfOpenTag, + includeSymbol ); if (keywordFilters !== 0 /* None */) { for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) { @@ -146942,64 +147877,6 @@ ${lanes.join("\n")} } return void 0; } - function newCaseClauseTracker(checker, clauses) { - const existingStrings = /* @__PURE__ */ new Set(); - const existingNumbers = /* @__PURE__ */ new Set(); - const existingBigInts = /* @__PURE__ */ new Set(); - for (const clause of clauses) { - if (!isDefaultClause(clause)) { - if (isLiteralExpression(clause.expression)) { - const expression = clause.expression; - switch (expression.kind) { - case 14 /* NoSubstitutionTemplateLiteral */: - case 10 /* StringLiteral */: - existingStrings.add(expression.text); - break; - case 8 /* NumericLiteral */: - existingNumbers.add(parseInt(expression.text)); - break; - case 9 /* BigIntLiteral */: - const parsedBigInt = parseBigInt(endsWith(expression.text, "n") ? expression.text.slice(0, -1) : expression.text); - if (parsedBigInt) { - existingBigInts.add(pseudoBigIntToString(parsedBigInt)); - } - break; - } - } else { - const symbol = checker.getSymbolAtLocation(clause.expression); - if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { - const enumValue = checker.getConstantValue(symbol.valueDeclaration); - if (enumValue !== void 0) { - addValue(enumValue); - } - } - } - } - } - return { - addValue, - hasValue - }; - function addValue(value) { - switch (typeof value) { - case "string": - existingStrings.add(value); - break; - case "number": - existingNumbers.add(value); - } - } - function hasValue(value) { - switch (typeof value) { - case "string": - return existingStrings.has(value); - case "number": - return existingNumbers.has(value); - case "object": - return existingBigInts.has(pseudoBigIntToString(value)); - } - } - } function typeNodeToExpression(typeNode, languageVersion, quotePreference) { switch (typeNode.kind) { case 180 /* TypeReference */: @@ -147047,9 +147924,9 @@ ${lanes.join("\n")} } function isMemberCompletionKind(kind) { switch (kind) { - case CompletionKind.ObjectPropertyDeclaration: - case CompletionKind.MemberLike: - case CompletionKind.PropertyAccess: + case 0 /* ObjectPropertyDeclaration */: + case 3 /* MemberLike */: + case 2 /* PropertyAccess */: return true; default: return false; @@ -147109,7 +147986,7 @@ ${lanes.join("\n")} function createCompletionEntryForLiteral(sourceFile, preferences, literal) { return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } - function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { + function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) { let insertText; let replacementSpan = getReplacementSpanForContextToken(replacementToken); let data; @@ -147153,7 +148030,9 @@ ${lanes.join("\n")} } awaitText += `(await ${propertyAccessToConvert.expression.getText()})`; insertText = needsConvertPropertyAccess ? `${awaitText}${insertText}` : `${awaitText}${insertQuestionDot ? "?." : "."}${insertText}`; - replacementSpan = createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end); + const isInAwaitExpression = tryCast(propertyAccessToConvert.parent, isAwaitExpression); + const wrapNode = isInAwaitExpression ? propertyAccessToConvert.parent : propertyAccessToConvert.expression; + replacementSpan = createTextSpanFromBounds(wrapNode.getStart(sourceFile), propertyAccessToConvert.end); } if (originIsResolvedExport(origin)) { sourceDisplay = [textPart(origin.moduleSpecifier)]; @@ -147165,7 +148044,7 @@ ${lanes.join("\n")} if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) { hasAction = true; } - if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) { + if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) { let importAdder; ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext)); sortText = SortText.ClassMemberSnippets; @@ -147187,7 +148066,7 @@ ${lanes.join("\n")} let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces"; const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) { - if (type.flags & 402653316 /* StringLike */ || type.flags & 1048576 /* Union */ && every(type.types, (type2) => !!(type2.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)))) { + if (type.flags & 402653316 /* StringLike */ || type.flags & 1048576 /* Union */ && every(type.types, (type2) => !!(type2.flags & (402653316 /* StringLike */ | 32768 /* Undefined */) || isStringAndEmptyAnonymousObjectIntersection(type2)))) { insertText = `${escapeSnippetText(name)}=${quote(sourceFile, preferences, "$1")}`; isSnippet = true; } else { @@ -147221,7 +148100,8 @@ ${lanes.join("\n")} isSnippet, isPackageJsonImport: originIsPackageJsonImport(origin) || void 0, isImportStatementCompletion: !!importStatementCompletion || void 0, - data + data, + ...includeSymbol ? { symbol } : void 0 }; } function isClassLikeMemberCompletion(symbol, location, sourceFile) { @@ -147289,7 +148169,7 @@ ${lanes.join("\n")} if (isAbstract) { requiredModifiers |= 256 /* Abstract */; } - if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) { + if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) { requiredModifiers |= 16384 /* Override */; } if (!completionNodes.length) { @@ -147595,6 +148475,7 @@ ${lanes.join("\n")} if (originIsResolvedExport(origin)) { const resolvedData = { exportName: origin.exportName, + exportMapKey: origin.exportMapKey, moduleSpecifier: origin.moduleSpecifier, ambientModuleName, fileName: origin.fileName, @@ -147618,6 +148499,7 @@ ${lanes.join("\n")} const resolvedOrigin = { kind: 32 /* ResolvedExport */, exportName: data.exportName, + exportMapKey: data.exportMapKey, moduleSpecifier: data.moduleSpecifier, symbolName: completionName, fileName: data.fileName, @@ -147641,7 +148523,7 @@ ${lanes.join("\n")} } function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) { const replacementSpan = importStatementCompletion.replacementSpan; - const quotedModuleSpecifier = quote(sourceFile, preferences, origin.moduleSpecifier); + const quotedModuleSpecifier = quote(sourceFile, preferences, escapeSnippetText(origin.moduleSpecifier)); const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */; const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : ""; const importKind = ts_codefix_exports.getImportKind( @@ -147689,7 +148571,7 @@ ${lanes.join("\n")} return "TypeOnlyAlias/" /* TypeOnlyAlias */; } } - function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { + function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) { var _a2; const start = timestamp(); const variableDeclaration = getVariableDeclaration(location); @@ -147700,7 +148582,7 @@ ${lanes.join("\n")} const symbol = symbols[i]; const origin = symbolToOriginInfoMap == null ? void 0 : symbolToOriginInfoMap[i]; const info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected); - if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === CompletionKind.Global && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) { + if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 /* Global */ && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) { continue; } const { name, needsConvertPropertyAccess } = info; @@ -147729,7 +148611,8 @@ ${lanes.join("\n")} kind, formatContext, isJsxIdentifierExpected, - isRightOfOpenTag + isRightOfOpenTag, + includeSymbol ); if (!entry) { continue; @@ -147839,7 +148722,7 @@ ${lanes.join("\n")} if (!completionData) { return { type: "none" }; } - if (completionData.kind !== CompletionDataKind.Data) { + if (completionData.kind !== 0 /* Data */) { return { type: "request", request: completionData }; } const { symbols, literals, location, completionKind, symbolToOriginInfoMap, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } = completionData; @@ -147865,13 +148748,13 @@ ${lanes.join("\n")} case "request": { const { request } = symbolCompletion; switch (request.kind) { - case CompletionDataKind.JsDocTagName: + case 1 /* JsDocTagName */: return ts_JsDoc_exports.getJSDocTagNameCompletionDetails(name); - case CompletionDataKind.JsDocTag: + case 2 /* JsDocTag */: return ts_JsDoc_exports.getJSDocTagCompletionDetails(name); - case CompletionDataKind.JsDocParameterName: + case 3 /* JsDocParameterName */: return ts_JsDoc_exports.getJSDocParameterNameCompletionDetails(name); - case CompletionDataKind.Keywords: + case 4 /* Keywords */: return some(request.keywordCompletions, (c) => c.name === name) ? createSimpleDetails(name, "keyword" /* keyword */, 5 /* keyword */) : void 0; default: return Debug.assertNever(request); @@ -147880,7 +148763,8 @@ ${lanes.join("\n")} case "symbol": { const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion; const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken); - return createCompletionDetailsForSymbol(symbol, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay); + const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name; + return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay); } case "literal": { const { literal } = symbolCompletion; @@ -147931,12 +148815,12 @@ ${lanes.join("\n")} function createSimpleDetails(name, kind, kind2) { return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]); } - function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) { + function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) { const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken( cancellationToken, (checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */) ); - return createCompletionDetails(symbol.name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay); + return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay); } function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) { return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source }; @@ -147996,6 +148880,7 @@ ${lanes.join("\n")} const { moduleSpecifier, codeAction } = ts_codefix_exports.getImportCompletionAction( targetSymbol, moduleSymbol, + data == null ? void 0 : data.exportMapKey, sourceFile, name, isJsxOpeningTagName, @@ -148223,7 +149108,7 @@ ${lanes.join("\n")} break; case 291 /* JsxExpression */: case 290 /* JsxSpreadAttribute */: - if (previousToken.kind === 19 /* CloseBraceToken */ || (previousToken.kind === 79 /* Identifier */ || previousToken.parent.kind === 288 /* JsxAttribute */)) { + if (previousToken.kind === 19 /* CloseBraceToken */ || previousToken.kind === 79 /* Identifier */ && previousToken.parent.kind === 288 /* JsxAttribute */) { isJsxIdentifierExpected = true; } break; @@ -148685,16 +149570,16 @@ ${lanes.join("\n")} if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) { return; } - const firstImportableExportInfo = find(info, isImportableExportInfo); - if (!firstImportableExportInfo) { + info = filter(info, isImportableExportInfo); + if (!info.length) { return; } const result = context.tryResolve(info, isFromAmbientModule) || {}; if (result === "failed") return; - let exportInfo2 = firstImportableExportInfo, moduleSpecifier; + let exportInfo2 = info[0], moduleSpecifier; if (result !== "skipped") { - ({ exportInfo: exportInfo2 = firstImportableExportInfo, moduleSpecifier } = result); + ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result); } const isDefaultExport = exportInfo2.exportKind === 1 /* Default */; const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo2.symbol) || exportInfo2.symbol; @@ -148858,7 +149743,7 @@ ${lanes.join("\n")} return false; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) { - return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken2)), position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2))); + return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2))); } function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() { const typeLiteralNode = tryGetTypeLiteralNode(contextToken); @@ -149033,6 +149918,16 @@ ${lanes.join("\n")} return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type); }); symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags)); + forEach(symbols, (symbol, index) => { + const declaration = symbol == null ? void 0 : symbol.valueDeclaration; + if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) { + const origin = { + kind: 512 /* ComputedPropertyName */, + symbolName: typeChecker.symbolToString(symbol) + }; + symbolToOriginInfoMap[index] = origin; + } + }); } return 1 /* Success */; } @@ -149417,7 +150312,7 @@ ${lanes.join("\n")} } switch (kind) { case 3 /* MemberLike */: - return void 0; + return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0; case 0 /* ObjectPropertyDeclaration */: return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; case 2 /* PropertyAccess */: @@ -149557,7 +150452,7 @@ ${lanes.join("\n")} function getApparentProperties(type, node, checker) { if (!type.isUnion()) return type.getApparentProperties(); - return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 131068 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || typeHasCallOrConstructSignatures(memberType, checker) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())))); + return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 134348796 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())))); } function containsNonPublicProperties(props) { return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 24 /* NonPublicAccessibilityModifier */)); @@ -149877,7 +150772,7 @@ ${lanes.join("\n")} } return charCode; } - var moduleSpecifierResolutionLimit, moduleSpecifierResolutionCacheAttemptLimit, SortText, CompletionSource, SymbolOriginInfoKind, CompletionDataKind, CompletionKind, _keywordCompletions, allKeywordsCompletions; + var moduleSpecifierResolutionLimit, moduleSpecifierResolutionCacheAttemptLimit, SortText, CompletionSource, SymbolOriginInfoKind, CompletionKind, _keywordCompletions, allKeywordsCompletions; var init_completions = __esm({ "src/services/completions.ts"() { "use strict"; @@ -149925,18 +150820,11 @@ ${lanes.join("\n")} SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport"; SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport"; return SymbolOriginInfoKind2; })(SymbolOriginInfoKind || {}); - CompletionDataKind = /* @__PURE__ */ ((CompletionDataKind2) => { - CompletionDataKind2[CompletionDataKind2["Data"] = 0] = "Data"; - CompletionDataKind2[CompletionDataKind2["JsDocTagName"] = 1] = "JsDocTagName"; - CompletionDataKind2[CompletionDataKind2["JsDocTag"] = 2] = "JsDocTag"; - CompletionDataKind2[CompletionDataKind2["JsDocParameterName"] = 3] = "JsDocParameterName"; - CompletionDataKind2[CompletionDataKind2["Keywords"] = 4] = "Keywords"; - return CompletionDataKind2; - })(CompletionDataKind || {}); CompletionKind = /* @__PURE__ */ ((CompletionKind2) => { CompletionKind2[CompletionKind2["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; CompletionKind2[CompletionKind2["Global"] = 1] = "Global"; @@ -149977,7 +150865,7 @@ ${lanes.join("\n")} values: map2.values.bind(map2) }; } - function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) { + function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) { if (isInReferenceComment(sourceFile, position)) { const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host); return entries && convertPathCompletions(entries); @@ -149986,18 +150874,18 @@ ${lanes.join("\n")} if (!contextToken || !isStringLiteralLike(contextToken)) return void 0; const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences); - return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position); + return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol); } } - function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) { + function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) { if (completion === void 0) { return void 0; } const optionalReplacementSpan = createTextSpanFromStringLiteralLikeContent(contextToken); switch (completion.kind) { - case StringLiteralCompletionKind.Paths: + case 0 /* Paths */: return convertPathCompletions(completion.paths); - case StringLiteralCompletionKind.Properties: { + case 1 /* Properties */: { const entries = createSortedArray(); getCompletionEntriesFromSymbols( completion.symbols, @@ -150015,11 +150903,32 @@ ${lanes.join("\n")} preferences, options, /*formatContext*/ - void 0 + void 0, + /*isTypeOnlyLocation */ + void 0, + /*propertyAccessToConvert*/ + void 0, + /*jsxIdentifierExpected*/ + void 0, + /*isJsxInitializer*/ + void 0, + /*importStatementCompletion*/ + void 0, + /*recommendedCompletion*/ + void 0, + /*symbolToOriginInfoMap*/ + void 0, + /*symbolToSortTextMap*/ + void 0, + /*isJsxIdentifierExpected*/ + void 0, + /*isRightOfOpenTag*/ + void 0, + includeSymbol ); return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries }; } - case StringLiteralCompletionKind.Types: { + case 2 /* Types */: { const entries = completion.types.map((type) => ({ name: type.value, kindModifiers: "" /* none */, @@ -150041,16 +150950,16 @@ ${lanes.join("\n")} } function stringLiteralCompletionDetails(name, location, completion, sourceFile, checker, cancellationToken) { switch (completion.kind) { - case StringLiteralCompletionKind.Paths: { + case 0 /* Paths */: { const match = find(completion.paths, (p) => p.name === name); return match && createCompletionDetails(name, kindModifiersFromExtension(match.extension), match.kind, [textPart(name)]); } - case StringLiteralCompletionKind.Properties: { + case 1 /* Properties */: { const match = find(completion.symbols, (s) => s.name === name); - return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken); + return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken); } - case StringLiteralCompletionKind.Types: - return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "type" /* typeElement */, [textPart(name)]) : void 0; + case 2 /* Types */: + return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0; default: return Debug.assertNever(completion); } @@ -150133,7 +151042,7 @@ ${lanes.join("\n")} if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) { return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent); } - return fromContextualType(); + return fromContextualType() || fromContextualType(0 /* None */); case 209 /* ElementAccessExpression */: { const { expression, argumentExpression } = parent2; if (node === skipParentheses(argumentExpression)) { @@ -150152,11 +151061,23 @@ ${lanes.join("\n")} case 275 /* ExportDeclaration */: case 280 /* ExternalModuleReference */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) }; + case 292 /* CaseClause */: + const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses); + const contextualTypes = fromContextualType(); + if (!contextualTypes) { + return; + } + const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); + return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; default: return fromContextualType(); } - function fromContextualType() { - return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, 4 /* Completions */)), isNewIdentifier: false }; + function fromContextualType(contextFlags = 4 /* Completions */) { + const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); + if (!types.length) { + return; + } + return { kind: 2 /* Types */, types, isNewIdentifier: false }; } } function walkUpParentheses(node) { @@ -150247,12 +151168,12 @@ ${lanes.join("\n")} const mode = isStringLiteralLike(node) ? getModeForUsageLocation(sourceFile, node) : void 0; const scriptPath = sourceFile.path; const scriptDirectory = getDirectoryPath(scriptPath); - const extensionOptions = getExtensionOptions(compilerOptions, ReferenceKind.ModuleSpecifier, sourceFile, preferences, mode); + const extensionOptions = getExtensionOptions(compilerOptions, 1 /* ModuleSpecifier */, sourceFile, typeChecker, preferences, mode); return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, compilerOptions, host, extensionOptions, typeChecker); } - function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, preferences, resolutionMode) { + function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, typeChecker, preferences, resolutionMode) { return { - extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions)), + extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker)), referenceKind, importingSourceFile, endingPreference: preferences == null ? void 0 : preferences.importModuleSpecifierEnding, @@ -150282,8 +151203,17 @@ ${lanes.join("\n")} ).values()); } } - function getSupportedExtensionsForModuleResolution(compilerOptions) { - const extensions = getSupportedExtensions(compilerOptions); + function getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker) { + const ambientModulesExtensions = !typeChecker ? [] : mapDefined( + typeChecker.getAmbientModules(), + (module2) => { + const name = module2.name.slice(1, -1); + if (!name.startsWith("*.") || name.includes("/")) + return; + return name.slice(1); + } + ); + const extensions = [...getSupportedExtensions(compilerOptions), ambientModulesExtensions]; const moduleResolution = getEmitModuleResolutionKind(compilerOptions); return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) : extensions; } @@ -150754,7 +151684,7 @@ ${lanes.join("\n")} function isRequireCallArgument(node) { return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require"; } - var kindPrecedence, StringLiteralCompletionKind, ReferenceKind, tripleSlashDirectiveFragmentRegex, nodeModulesDependencyKeys; + var kindPrecedence, tripleSlashDirectiveFragmentRegex, nodeModulesDependencyKeys; var init_stringCompletions = __esm({ "src/services/stringCompletions.ts"() { "use strict"; @@ -150765,17 +151695,6 @@ ${lanes.join("\n")} ["script" /* scriptElement */]: 1, ["external module name" /* externalModuleName */]: 2 }; - StringLiteralCompletionKind = /* @__PURE__ */ ((StringLiteralCompletionKind2) => { - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Paths"] = 0] = "Paths"; - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Properties"] = 1] = "Properties"; - StringLiteralCompletionKind2[StringLiteralCompletionKind2["Types"] = 2] = "Types"; - return StringLiteralCompletionKind2; - })(StringLiteralCompletionKind || {}); - ReferenceKind = /* @__PURE__ */ ((ReferenceKind2) => { - ReferenceKind2[ReferenceKind2["Filename"] = 0] = "Filename"; - ReferenceKind2[ReferenceKind2["ModuleSpecifier"] = 1] = "ModuleSpecifier"; - return ReferenceKind2; - })(ReferenceKind || {}); tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* ` * ${c}`).join("\n")} if (isExpression(body)) { const returnStatement = factory.createReturnStatement(body); const file = body.getSourceFile(); + setTextRange(returnStatement, body); suppressLeadingAndTrailingTrivia(returnStatement); copyTrailingAsLeadingComments( body, @@ -159254,10 +160170,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const scopeDescription = isFunctionLikeDeclaration(scope) ? getDescriptionForFunctionLikeDeclaration(scope) : isClassLike(scope) ? getDescriptionForClassLikeDeclaration(scope) : getDescriptionForModuleLikeDeclaration(scope); let functionDescription; let constantDescription; - if (scopeDescription === SpecialScope.Global) { + if (scopeDescription === 1 /* Global */) { functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "global"]); constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "global"]); - } else if (scopeDescription === SpecialScope.Module) { + } else if (scopeDescription === 0 /* Module */) { functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "module"]); constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "module"]); } else { @@ -159323,7 +160239,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return scope.kind === 260 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 265 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global; + return scope.kind === 265 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations, range, context) { const checker = context.program.getTypeChecker(); @@ -159356,7 +160272,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} typeNode ); parameters.push(paramDecl); - if (usage.usage === Usage.Write) { + if (usage.usage === 2 /* Write */) { (writes || (writes = [])).push(usage); } callArguments.push(factory.createIdentifier(name)); @@ -160314,7 +161230,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isStringLiteralJsxAttribute(node) { return isStringLiteral(node) && node.parent && isJsxAttribute(node.parent); } - var refactorName11, extractConstantAction, extractFunctionAction, Messages, RangeFacts, SpecialScope, Usage; + var refactorName11, extractConstantAction, extractFunctionAction, Messages, RangeFacts; var init_extractSymbol = __esm({ "src/services/refactors/extractSymbol.ts"() { "use strict"; @@ -160377,16 +161293,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} RangeFacts2[RangeFacts2["InStaticRegion"] = 32] = "InStaticRegion"; return RangeFacts2; })(RangeFacts || {}); - SpecialScope = /* @__PURE__ */ ((SpecialScope2) => { - SpecialScope2[SpecialScope2["Module"] = 0] = "Module"; - SpecialScope2[SpecialScope2["Global"] = 1] = "Global"; - return SpecialScope2; - })(SpecialScope || {}); - Usage = /* @__PURE__ */ ((Usage2) => { - Usage2[Usage2["Read"] = 1] = "Read"; - Usage2[Usage2["Write"] = 2] = "Write"; - return Usage2; - })(Usage || {}); } }); @@ -160818,7 +161724,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!candidateInfo) { return isSourceFileJS(sourceFile) ? createJSSignatureHelpItems(argumentInfo, program, cancellationToken) : void 0; } - return typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => candidateInfo.kind === CandidateOrTypeKind.Candidate ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2)); + return typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => candidateInfo.kind === 0 /* Candidate */ ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2)); } function getCandidateOrTypeInfo({ invocation, argumentCount }, checker, sourceFile, startingToken, onlyUseSyntacticOwners) { switch (invocation.kind) { @@ -161290,16 +162196,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }); return { name: typeParameter.symbol.name, documentation: typeParameter.symbol.getDocumentationComment(checker), displayParts, isOptional: false, isRest: false }; } - var CandidateOrTypeKind, signatureHelpNodeBuilderFlags, separatorDisplayParts; + var signatureHelpNodeBuilderFlags, separatorDisplayParts; var init_signatureHelp = __esm({ "src/services/signatureHelp.ts"() { "use strict"; init_ts4(); - CandidateOrTypeKind = /* @__PURE__ */ ((CandidateOrTypeKind2) => { - CandidateOrTypeKind2[CandidateOrTypeKind2["Candidate"] = 0] = "Candidate"; - CandidateOrTypeKind2[CandidateOrTypeKind2["Type"] = 1] = "Type"; - return CandidateOrTypeKind2; - })(CandidateOrTypeKind || {}); signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; separatorDisplayParts = [punctuationPart(27 /* CommaToken */), spacePart()]; } @@ -164610,8 +165511,8 @@ ${options.prefix}` : "\n" : options.prefix var init_rules = __esm({ "src/services/formatting/rules.ts"() { "use strict"; - init_ts_formatting(); init_ts4(); + init_ts_formatting(); } }); @@ -165171,7 +166072,7 @@ ${options.prefix}` : "\n" : options.prefix } function processChildNode(child, inheritedIndentation, parent2, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { Debug.assert(!nodeIsSynthesized(child)); - if (nodeIsMissing(child)) { + if (nodeIsMissing(child) || isGrammarError(parent2, child)) { return inheritedIndentation; } const childStartPos = child.getStart(sourceFile); @@ -165304,7 +166205,7 @@ ${options.prefix}` : "\n" : options.prefix if (currentTokenInfo.leadingTrivia) { processTrivia(currentTokenInfo.leadingTrivia, parent2, childContextNode, dynamicIndentation); } - let lineAction = LineAction.None; + let lineAction = 0 /* None */; const isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); const tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); if (isTokenInRange) { @@ -165312,11 +166213,11 @@ ${options.prefix}` : "\n" : options.prefix const savePreviousRange = previousRange; lineAction = processRange(currentTokenInfo.token, tokenStart, parent2, childContextNode, dynamicIndentation); if (!rangeHasError) { - if (lineAction === LineAction.None) { + if (lineAction === 0 /* None */) { const prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line; indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine; } else { - indentToken = lineAction === LineAction.LineAdded; + indentToken = lineAction === 1 /* LineAdded */; } } } @@ -165342,7 +166243,7 @@ ${options.prefix}` : "\n" : options.prefix ); } if (tokenIndentation !== -1 /* Unknown */ && indentNextTokenOrTrivia) { - insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === LineAction.LineAdded); + insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === 1 /* LineAdded */); lastIndentedLine = tokenStart.line; indentationOnLastIndentedLine = tokenIndentation; } @@ -165389,7 +166290,7 @@ ${options.prefix}` : "\n" : options.prefix } function processRange(range, rangeStart, parent2, contextNode, dynamicIndentation) { const rangeHasError = rangeContainsError(range); - let lineAction = LineAction.None; + let lineAction = 0 /* None */; if (!rangeHasError) { if (!previousRange) { const originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); @@ -165408,13 +166309,13 @@ ${options.prefix}` : "\n" : options.prefix formattingContext.updateContext(previousItem, previousParent2, currentItem, currentParent, contextNode); const rules = getRules(formattingContext); let trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; - let lineAction = LineAction.None; + let lineAction = 0 /* None */; if (rules) { forEachRight(rules, (rule2) => { lineAction = applyRuleEdits(rule2, previousItem, previousStartLine, currentItem, currentStartLine); if (dynamicIndentation) { switch (lineAction) { - case LineAction.LineRemoved: + case 2 /* LineRemoved */: if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation( /*lineAddedByFormatting*/ @@ -165423,7 +166324,7 @@ ${options.prefix}` : "\n" : options.prefix ); } break; - case LineAction.LineAdded: + case 1 /* LineAdded */: if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation( /*lineAddedByFormatting*/ @@ -165433,7 +166334,7 @@ ${options.prefix}` : "\n" : options.prefix } break; default: - Debug.assert(lineAction === LineAction.None); + Debug.assert(lineAction === 0 /* None */); } } trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule2.action & 16 /* DeleteSpace */) && rule2.flags !== 1 /* CanDeleteNewLines */; @@ -165580,11 +166481,11 @@ ${options.prefix}` : "\n" : options.prefix const onLaterLine = currentStartLine !== previousStartLine; switch (rule2.action) { case 1 /* StopProcessingSpaceActions */: - return LineAction.None; + return 0 /* None */; case 16 /* DeleteSpace */: if (previousRange2.end !== currentRange.pos) { recordDelete(previousRange2.end, currentRange.pos - previousRange2.end); - return onLaterLine ? LineAction.LineRemoved : LineAction.None; + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 32 /* DeleteToken */: @@ -165592,28 +166493,28 @@ ${options.prefix}` : "\n" : options.prefix break; case 8 /* InsertNewLine */: if (rule2.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return LineAction.None; + return 0 /* None */; } const lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, getNewLineOrDefaultFromHost(host, options)); - return onLaterLine ? LineAction.None : LineAction.LineAdded; + return onLaterLine ? 0 /* None */ : 1 /* LineAdded */; } break; case 4 /* InsertSpace */: if (rule2.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return LineAction.None; + return 0 /* None */; } const posDelta = currentRange.pos - previousRange2.end; if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange2.end) !== 32 /* space */) { recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, " "); - return onLaterLine ? LineAction.LineRemoved : LineAction.None; + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 64 /* InsertTrailingSemicolon */: recordInsert(previousRange2.end, ";"); } - return LineAction.None; + return 0 /* None */; } } function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenAtPosition = getTokenAtPosition(sourceFile, position)) { @@ -165739,18 +166640,12 @@ ${options.prefix}` : "\n" : options.prefix return remainder ? spacesString + repeatString(" ", remainder) : spacesString; } } - var LineAction, internedSizes, internedTabsIndentation, internedSpacesIndentation; + var internedSizes, internedTabsIndentation, internedSpacesIndentation; var init_formatting = __esm({ "src/services/formatting/formatting.ts"() { "use strict"; init_ts4(); init_ts_formatting(); - LineAction = /* @__PURE__ */ ((LineAction2) => { - LineAction2[LineAction2["None"] = 0] = "None"; - LineAction2[LineAction2["LineAdded"] = 1] = "LineAdded"; - LineAction2[LineAction2["LineRemoved"] = 2] = "LineRemoved"; - return LineAction2; - })(LineAction || {}); } }); @@ -165854,7 +166749,7 @@ ${options.prefix}` : "\n" : options.prefix )) { const currentStart = getStartLineAndCharacterForNode(current, sourceFile); const nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); - const indentationDelta = nextTokenKind !== NextTokenKind.Unknown ? assumeNewLineBeforeCloseBrace && nextTokenKind === NextTokenKind.CloseBrace ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; + const indentationDelta = nextTokenKind !== 0 /* Unknown */ ? assumeNewLineBeforeCloseBrace && nextTokenKind === 2 /* CloseBrace */ ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; return getIndentationForNodeWorker( current, currentStart, @@ -166833,6 +167728,7 @@ ${options.prefix}` : "\n" : options.prefix consumesNodeCoreModules: () => consumesNodeCoreModules, contains: () => contains, containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, containsParseError: () => containsParseError, containsPath: () => containsPath, convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, @@ -167171,6 +168067,7 @@ ${options.prefix}` : "\n" : options.prefix getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, getCompilerOptionValue: () => getCompilerOptionValue, getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, getConstantValue: () => getConstantValue, getContainerNode: () => getContainerNode, @@ -167852,6 +168749,7 @@ ${options.prefix}` : "\n" : options.prefix isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, isGlobalDeclaration: () => isGlobalDeclaration, isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, + isGrammarError: () => isGrammarError, isHeritageClause: () => isHeritageClause, isHoistedFunction: () => isHoistedFunction, isHoistedVariableStatement: () => isHoistedVariableStatement, @@ -168194,6 +169092,7 @@ ${options.prefix}` : "\n" : options.prefix isString: () => isString, isStringAKeyword: () => isStringAKeyword, isStringANonContextualKeyword: () => isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, isStringDoubleQuoted: () => isStringDoubleQuoted, isStringLiteral: () => isStringLiteral, isStringLiteralLike: () => isStringLiteralLike, @@ -168358,6 +169257,7 @@ ${options.prefix}` : "\n" : options.prefix mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, needsParentheses: () => needsParentheses, needsScopeMarker: () => needsScopeMarker, + newCaseClauseTracker: () => newCaseClauseTracker, newPrivateEnvironment: () => newPrivateEnvironment, noEmitNotification: () => noEmitNotification, noEmitSubstitution: () => noEmitSubstitution, @@ -168731,7 +169631,6 @@ ${options.prefix}` : "\n" : options.prefix typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, typeAliasNamePart: () => typeAliasNamePart, typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, - typeHasCallOrConstructSignatures: () => typeHasCallOrConstructSignatures, typeKeywords: () => typeKeywords, typeParameterNamePart: () => typeParameterNamePart, typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter, diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 2d892a7d711e4..00afe537dc038 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -54,7 +54,7 @@ var path = __toESM(require("path")); // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.0-beta`; +var version = `${versionMajorMinor}.1-rc`; // src/compiler/core.ts var emptyArray = []; @@ -102,17 +102,6 @@ function find(array, predicate, startIndex) { } return void 0; } -function findLast(array, predicate, startIndex) { - if (array === void 0) - return void 0; - for (let i = startIndex != null ? startIndex : array.length - 1; i >= 0; i--) { - const value = array[i]; - if (predicate(value, i)) { - return value; - } - } - return void 0; -} function findIndex(array, predicate, startIndex) { if (array === void 0) return -1; @@ -484,15 +473,6 @@ function arrayToMap(array, makeKey, makeValue = identity) { } return result; } -function clone(object) { - const result = {}; - for (const id in object) { - if (hasOwnProperty.call(object, id)) { - result[id] = object[id]; - } - } - return result; -} function createMultiMap() { const map2 = /* @__PURE__ */ new Map(); map2.add = multiMapAdd; @@ -2280,7 +2260,7 @@ function tryGetNodePerformanceHooks() { } var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); var nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performance; -var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +new Date(); +var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date(); // src/compiler/perfLogger.ts var nullLogger = { @@ -2317,30 +2297,6 @@ var perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : // src/compiler/performance.ts var performanceImpl; -function createTimerIf(condition, measureName, startMarkName, endMarkName) { - return condition ? createTimer(measureName, startMarkName, endMarkName) : nullTimer; -} -function createTimer(measureName, startMarkName, endMarkName) { - let enterCount = 0; - return { - enter, - exit - }; - function enter() { - if (++enterCount === 1) { - mark(startMarkName); - } - } - function exit() { - if (--enterCount === 0) { - mark(endMarkName); - measure(measureName, startMarkName, endMarkName); - } else if (enterCount < 0) { - Debug.fail("enter/exit count does not match."); - } - } -} -var nullTimer = { enter: noop, exit: noop }; var enabled = false; var timeorigin = timestamp(); var marks = /* @__PURE__ */ new Map(); @@ -2353,6 +2309,9 @@ function mark(markName) { counts.set(markName, count + 1); marks.set(markName, timestamp()); performanceImpl == null ? void 0 : performanceImpl.mark(markName); + if (typeof onProfilerEvent === "function") { + onProfilerEvent(markName); + } } } function measure(measureName, startMarkName, endMarkName) { @@ -3122,19 +3081,6 @@ var RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => { RelationComparisonResult3[RelationComparisonResult3["ReportsMask"] = 24] = "ReportsMask"; return RelationComparisonResult3; })(RelationComparisonResult || {}); -var GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => { - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Loop"] = 2] = "Loop"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Unique"] = 3] = "Unique"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Node"] = 4] = "Node"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["KindMask"] = 7] = "KindMask"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Optimistic"] = 16] = "Optimistic"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["FileLevel"] = 32] = "FileLevel"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; - return GeneratedIdentifierFlags2; -})(GeneratedIdentifierFlags || {}); var FlowFlags = /* @__PURE__ */ ((FlowFlags2) => { FlowFlags2[FlowFlags2["Unreachable"] = 1] = "Unreachable"; FlowFlags2[FlowFlags2["Start"] = 2] = "Start"; @@ -3254,13 +3200,14 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => { TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; - TypeFlags2[TypeFlags2["Unit"] = 109440] = "Unit"; + TypeFlags2[TypeFlags2["Unit"] = 109472] = "Unit"; + TypeFlags2[TypeFlags2["Freshable"] = 2976] = "Freshable"; TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; - TypeFlags2[TypeFlags2["Primitive"] = 131068] = "Primitive"; + TypeFlags2[TypeFlags2["Primitive"] = 134348796] = "Primitive"; TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; @@ -3525,7 +3472,7 @@ var PollingInterval = /* @__PURE__ */ ((PollingInterval3) => { PollingInterval3[PollingInterval3["Low"] = 250] = "Low"; return PollingInterval3; })(PollingInterval || {}); -var missingFileModifiedTime = new Date(0); +var missingFileModifiedTime = /* @__PURE__ */ new Date(0); function getModifiedTime(host, fileName) { return host.getModifiedTime(fileName) || missingFileModifiedTime; } @@ -3750,7 +3697,7 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { const watcher = fsWatch( dirName, - FileSystemEntryKind.Directory, + 1 /* Directory */, (_eventName, relativeFileName, modifiedTime) => { if (!isString(relativeFileName)) return; @@ -3950,7 +3897,7 @@ function createDirectoryWatcherSupportingRecursive({ } function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { const parentWatcher = cache.get(dirPath); - if (parentWatcher && fileSystemEntryExists(dirName, FileSystemEntryKind.Directory)) { + if (parentWatcher && fileSystemEntryExists(dirName, 1 /* Directory */)) { scheduleUpdateChildWatches(dirName, dirPath, fileName, options); return; } @@ -4015,7 +3962,7 @@ function createDirectoryWatcherSupportingRecursive({ return false; let newChildWatches; const hasChanges = enumerateInsertsAndDeletes( - fileSystemEntryExists(parentDir, FileSystemEntryKind.Directory) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { + fileSystemEntryExists(parentDir, 1 /* Directory */) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { const childFullName = getNormalizedAbsolutePath(child, parentDir); return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath(childFullName))) === 0 /* EqualTo */ ? childFullName : void 0; }) : emptyArray, @@ -4046,11 +3993,6 @@ function createDirectoryWatcherSupportingRecursive({ return stringContains(toCanonicalFilePath(path2), searchPath); } } -var FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => { - FileSystemEntryKind2[FileSystemEntryKind2["File"] = 0] = "File"; - FileSystemEntryKind2[FileSystemEntryKind2["Directory"] = 1] = "Directory"; - return FileSystemEntryKind2; -})(FileSystemEntryKind || {}); function createFileWatcherCallback(callback) { return (_fileName, eventKind, modifiedTime) => callback(eventKind === 1 /* Changed */ ? "change" : "rename", "", modifiedTime); } @@ -4620,7 +4562,7 @@ var sys = (() => { if (!err) { try { if ((_a2 = statSync(profilePath)) == null ? void 0 : _a2.isDirectory()) { - profilePath = _path.join(profilePath, `${new Date().toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); + profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); } } catch (e) { } @@ -5513,7 +5455,6 @@ var Diagnostics = { Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), - Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."), A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), @@ -5642,6 +5583,7 @@ var Diagnostics = { To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -6035,7 +5977,6 @@ var Diagnostics = { Cannot_find_type_definition_file_for_0: diag(2688, 1 /* Error */, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), - An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, 1 /* Error */, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), @@ -6159,7 +6100,7 @@ var Diagnostics = { Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."), A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), - Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."), + Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."), Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), @@ -6351,13 +6292,11 @@ var Diagnostics = { The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), - Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), + Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."), Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), - Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`), + Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), @@ -6445,7 +6384,7 @@ var Diagnostics = { Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."), File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."), - File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."), + File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."), Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."), Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), @@ -6735,6 +6674,11 @@ var Diagnostics = { Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."), Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."), true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."), + Entering_conditional_exports: diag(6413, 3 /* Message */, "Entering_conditional_exports_6413", "Entering conditional exports."), + Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."), + Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."), + Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), @@ -6896,6 +6840,7 @@ var Diagnostics = { new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), + This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."), Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), @@ -6993,7 +6938,7 @@ var Diagnostics = { You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), - Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."), + Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."), Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), @@ -7533,17 +7478,6 @@ function computeLineOfPosition(lineStarts, position, lowerBound) { } return lineNumber; } -function getLinesBetweenPositions(sourceFile, pos1, pos2) { - if (pos1 === pos2) - return 0; - const lineStarts = getLineStarts(sourceFile); - const lower = Math.min(pos1, pos2); - const isNegative = lower === pos2; - const upper = isNegative ? pos1 : pos2; - const lowerLine = computeLineOfPosition(lineStarts, lower); - const upperLine = computeLineOfPosition(lineStarts, upper, lowerLine); - return isNegative ? lowerLine - upperLine : upperLine - lowerLine; -} function getLineAndCharacterOfPosition(sourceFile, position) { return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); } @@ -7798,30 +7732,6 @@ function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) { } return accumulator; } -function forEachLeadingCommentRange(text, pos, cb, state) { - return iterateCommentRanges( - /*reduce*/ - false, - text, - pos, - /*trailing*/ - false, - cb, - state - ); -} -function forEachTrailingCommentRange(text, pos, cb, state) { - return iterateCommentRanges( - /*reduce*/ - false, - text, - pos, - /*trailing*/ - true, - cb, - state - ); -} function reduceEachLeadingCommentRange(text, pos, cb, state, initial) { return iterateCommentRanges( /*reduce*/ @@ -7900,18 +7810,18 @@ function isIdentifierText(name, languageVersion, identifierVariant) { return true; } function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start, length2) { - let text = textInitial; - let pos; - let end; - let startPos; - let tokenPos; - let token; - let tokenValue; - let tokenFlags; - let commentDirectives; - let inJSDocType = 0; + var text = textInitial; + var pos; + var end; + var startPos; + var tokenPos; + var token; + var tokenValue; + var tokenFlags; + var commentDirectives; + var inJSDocType = 0; setText(text, start, length2); - const scanner = { + var scanner = { getStartPos: () => startPos, getTextPos: () => pos, getToken: () => token, @@ -9458,17 +9368,6 @@ function getCombinedModifierFlags(node) { function getCombinedNodeFlags(node) { return getCombinedFlags(node, (n) => n.flags); } -function getOriginalNode(node, nodeTest) { - if (node) { - while (node.original !== void 0) { - node = node.original; - } - } - if (!node || !nodeTest) { - return node; - } - return nodeTest(node) ? node : void 0; -} function findAncestor(node, callback) { while (node) { const result = callback(node); @@ -9767,15 +9666,6 @@ function getJSDocTagsWorker(node, noCache) { function getFirstJSDocTag(node, predicate, noCache) { return find(getJSDocTagsWorker(node, noCache), predicate); } -function getTextOfJSDocComment(comment) { - return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 324 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); -} -function formatJSDocLink(link) { - const kind = link.kind === 327 /* JSDocLink */ ? "link" : link.kind === 328 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; - const name = link.name ? entityNameToString(link.name) : ""; - const space = link.name && link.text.startsWith("://") ? "" : " "; - return `{@${kind} ${name}${space}${link.text}}`; -} function isMemberName(node) { return node.kind === 79 /* Identifier */ || node.kind === 80 /* PrivateIdentifier */; } @@ -9813,24 +9703,9 @@ function isNonNullChain(node) { function isNamedExportBindings(node) { return node.kind === 277 /* NamespaceExport */ || node.kind === 276 /* NamedExports */; } -function isUnparsedTextLike(node) { - switch (node.kind) { - case 305 /* UnparsedText */: - case 306 /* UnparsedInternalText */: - return true; - default: - return false; - } -} -function isUnparsedNode(node) { - return isUnparsedTextLike(node) || node.kind === 303 /* UnparsedPrologue */ || node.kind === 307 /* UnparsedSyntheticReference */; -} function isNodeKind(kind) { return kind >= 163 /* FirstNode */; } -function isTokenKind(kind) { - return kind >= 0 /* FirstToken */ && kind <= 162 /* LastToken */; -} function isNodeArray(array) { return hasProperty(array, "pos") && hasProperty(array, "end"); } @@ -10294,9 +10169,6 @@ function isCaseOrDefaultClause(node) { function isJSDocNode(node) { return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */; } -function isJSDocTag(node) { - return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */; -} function hasJSDocNodes(node) { if (!canHaveJSDoc(node)) return false; @@ -10306,28 +10178,6 @@ function hasJSDocNodes(node) { function hasInitializer(node) { return !!node.initializer; } -var MAX_SMI_X86 = 1073741823; -function guessIndentation(lines) { - let indentation = MAX_SMI_X86; - for (const line of lines) { - if (!line.length) { - continue; - } - let i = 0; - for (; i < line.length && i < indentation; i++) { - if (!isWhiteSpaceLike(line.charCodeAt(i))) { - break; - } - } - if (i < indentation) { - indentation = i; - } - if (indentation === 0) { - return 0; - } - } - return indentation === MAX_SMI_X86 ? void 0 : indentation; -} function isStringLiteralLike(node) { return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */; } @@ -10344,7 +10194,7 @@ function createSymbolTable(symbols) { } var stringWriter = createSingleLineStringWriter(); function createSingleLineStringWriter() { - let str = ""; + var str = ""; const writeText = (text) => str += text; return { getText: () => str, @@ -10426,9 +10276,6 @@ function getEndLinePosition(line, sourceFile) { return pos; } } -function isFileLevelUniqueName(sourceFile, name, hasGlobalName) { - return !(hasGlobalName && hasGlobalName(name)) && !sourceFile.identifiers.has(name); -} function nodeIsMissing(node) { if (node === void 0) { return true; @@ -10438,16 +10285,6 @@ function nodeIsMissing(node) { function nodeIsPresent(node) { return !nodeIsMissing(node); } -function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { - if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47 /* slash */) { - const textSubStr = text.substring(commentPos, commentEnd); - return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false; - } - return false; -} -function isPinnedComment(text, start) { - return text.charCodeAt(start + 1) === 42 /* asterisk */ && text.charCodeAt(start + 2) === 33 /* exclamation */; -} function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -10501,65 +10338,6 @@ function getEmitFlags(node) { const emitNode = node.emitNode; return emitNode && emitNode.flags || 0; } -function getInternalEmitFlags(node) { - const emitNode = node.emitNode; - return emitNode && emitNode.internalFlags || 0; -} -function getLiteralText(node, sourceFile, flags) { - var _a2; - if (sourceFile && canUseOriginalText(node, flags)) { - return getSourceTextOfNodeFromSourceFile(sourceFile, node); - } - switch (node.kind) { - case 10 /* StringLiteral */: { - const escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; - if (node.singleQuote) { - return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; - } else { - return '"' + escapeText(node.text, 34 /* doubleQuote */) + '"'; - } - } - case 14 /* NoSubstitutionTemplateLiteral */: - case 15 /* TemplateHead */: - case 16 /* TemplateMiddle */: - case 17 /* TemplateTail */: { - const escapeText = flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; - const rawText = (_a2 = node.rawText) != null ? _a2 : escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); - switch (node.kind) { - case 14 /* NoSubstitutionTemplateLiteral */: - return "`" + rawText + "`"; - case 15 /* TemplateHead */: - return "`" + rawText + "${"; - case 16 /* TemplateMiddle */: - return "}" + rawText + "${"; - case 17 /* TemplateTail */: - return "}" + rawText + "`"; - } - break; - } - case 8 /* NumericLiteral */: - case 9 /* BigIntLiteral */: - return node.text; - case 13 /* RegularExpressionLiteral */: - if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); - } - return node.text; - } - return Debug.fail(`Literal kind '${node.kind}' not accounted for.`); -} -function canUseOriginalText(node, flags) { - if (nodeIsSynthesized(node) || !node.parent || flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return false; - } - if (isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) { - return !!(flags & 8 /* AllowNumericSeparator */); - } - return !isBigIntLiteral(node); -} -function makeIdentifierFromModuleName(moduleName) { - return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); -} function isBlockOrCatchScoped(declaration) { return (getCombinedNodeFlags(declaration) & 3 /* BlockScoped */) !== 0 || isCatchClauseVariableDeclarationOrBindingElement(declaration); } @@ -10642,27 +10420,6 @@ function tryGetTextOfPropertyName(name) { function getTextOfPropertyName(name) { return Debug.checkDefined(tryGetTextOfPropertyName(name)); } -function entityNameToString(name) { - switch (name.kind) { - case 108 /* ThisKeyword */: - return "this"; - case 80 /* PrivateIdentifier */: - case 79 /* Identifier */: - return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name); - case 163 /* QualifiedName */: - return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 208 /* PropertyAccessExpression */: - if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) { - return entityNameToString(name.expression) + "." + entityNameToString(name.name); - } else { - return Debug.assertNever(name.name); - } - case 314 /* JSDocMemberName */: - return entityNameToString(name.left) + entityNameToString(name.right); - default: - return Debug.assertNever(name); - } -} function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { const span = getErrorSpanForNode(sourceFile, node); return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); @@ -10766,15 +10523,6 @@ function isJsonSourceFile(file) { function isEnumConst(node) { return !!(getCombinedModifierFlags(node) & 2048 /* Const */); } -function isVarConst(node) { - return !!(getCombinedNodeFlags(node) & 2 /* Const */); -} -function isLet(node) { - return !!(getCombinedNodeFlags(node) & 1 /* Let */); -} -function isLiteralImportTypeNode(n) { - return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal); -} function isPrologueDirective(node) { return node.kind === 241 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } @@ -10790,17 +10538,10 @@ function isHoistedVariable(node) { function isHoistedVariableStatement(node) { return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable); } -function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return node.kind !== 11 /* JsxText */ ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; -} function getJSDocCommentRanges(node, text) { const commentRanges = node.kind === 166 /* Parameter */ || node.kind === 165 /* TypeParameter */ || node.kind === 215 /* FunctionExpression */ || node.kind === 216 /* ArrowFunction */ || node.kind === 214 /* ParenthesizedExpression */ || node.kind === 257 /* VariableDeclaration */ || node.kind === 278 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */); } -var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; -var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; -var fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; -var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isVariableLike(node) { if (node) { switch (node.kind) { @@ -10917,9 +10658,6 @@ function isPartOfTypeQuery(node) { function isInJSFile(node) { return !!node && !!(node.flags & 262144 /* JavaScriptFile */); } -function isInJsonFile(node) { - return !!node && !!(node.flags & 67108864 /* JsonFile */); -} function isInJSDoc(node) { return !!node && !!(node.flags & 8388608 /* JSDoc */); } @@ -11166,23 +10904,6 @@ function isFunctionSymbol(symbol) { const decl = symbol.valueDeclaration; return decl.kind === 259 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); } -function getExternalModuleName(node) { - switch (node.kind) { - case 269 /* ImportDeclaration */: - case 275 /* ExportDeclaration */: - return node.moduleSpecifier; - case 268 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 280 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; - case 202 /* ImportType */: - return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; - case 210 /* CallExpression */: - return node.arguments[0]; - case 264 /* ModuleDeclaration */: - return node.name.kind === 10 /* StringLiteral */ ? node.name : void 0; - default: - return Debug.assertNever(node); - } -} function isJSDocConstructSignature(node) { const param = isJSDocFunctionType(node) ? firstOrUndefined(node.parameters) : void 0; const name = tryCast(param && param.name, isIdentifier); @@ -11411,14 +11132,6 @@ function skipParentheses(node, excludeJSDocTypeAssertions) { const flags = excludeJSDocTypeAssertions ? 1 /* Parentheses */ | 16 /* ExcludeJSDocTypeAssertion */ : 1 /* Parentheses */; return skipOuterExpressions(node, flags); } -function isNodeDescendantOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; - } - return false; -} function isIdentifierName(node) { const parent = node.parent; switch (parent.kind) { @@ -11705,16 +11418,9 @@ function getBinaryOperatorPrecedence(kind) { } return -1; } -var templateSubstitutionRegExp = /\$\{/g; -function escapeTemplateSubstitution(str) { - return str.replace(templateSubstitutionRegExp, "\\${"); -} function hasInvalidEscape(template) { return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags)); } -var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; -var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; -var backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g; var escapedCharsMap = new Map(Object.entries({ " ": "\\t", "\v": "\\v", @@ -11735,231 +11441,10 @@ var escapedCharsMap = new Map(Object.entries({ "\r\n": "\\r\\n" // special case for CRLFs in backticks })); -function encodeUtf16EscapeSequence(charCode) { - const hexCharCode = charCode.toString(16).toUpperCase(); - const paddedHexCode = ("0000" + hexCharCode).slice(-4); - return "\\u" + paddedHexCode; -} -function getReplacement(c, offset, input) { - if (c.charCodeAt(0) === 0 /* nullCharacter */) { - const lookAhead = input.charCodeAt(offset + c.length); - if (lookAhead >= 48 /* _0 */ && lookAhead <= 57 /* _9 */) { - return "\\x00"; - } - return "\\0"; - } - return escapedCharsMap.get(c) || encodeUtf16EscapeSequence(c.charCodeAt(0)); -} -function escapeString(s, quoteChar) { - const escapedCharsRegExp = quoteChar === 96 /* backtick */ ? backtickQuoteEscapedCharsRegExp : quoteChar === 39 /* singleQuote */ ? singleQuoteEscapedCharsRegExp : doubleQuoteEscapedCharsRegExp; - return s.replace(escapedCharsRegExp, getReplacement); -} -var nonAsciiCharacters = /[^\u0000-\u007F]/g; -function escapeNonAsciiString(s, quoteChar) { - s = escapeString(s, quoteChar); - return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, (c) => encodeUtf16EscapeSequence(c.charCodeAt(0))) : s; -} -var jsxDoubleQuoteEscapedCharsRegExp = /[\"\u0000-\u001f\u2028\u2029\u0085]/g; -var jsxSingleQuoteEscapedCharsRegExp = /[\'\u0000-\u001f\u2028\u2029\u0085]/g; var jsxEscapedCharsMap = new Map(Object.entries({ '"': """, "'": "'" })); -function encodeJsxCharacterEntity(charCode) { - const hexCharCode = charCode.toString(16).toUpperCase(); - return "&#x" + hexCharCode + ";"; -} -function getJsxAttributeStringReplacement(c) { - if (c.charCodeAt(0) === 0 /* nullCharacter */) { - return "�"; - } - return jsxEscapedCharsMap.get(c) || encodeJsxCharacterEntity(c.charCodeAt(0)); -} -function escapeJsxAttributeString(s, quoteChar) { - const escapedCharsRegExp = quoteChar === 39 /* singleQuote */ ? jsxSingleQuoteEscapedCharsRegExp : jsxDoubleQuoteEscapedCharsRegExp; - return s.replace(escapedCharsRegExp, getJsxAttributeStringReplacement); -} -var indentStrings = ["", " "]; -function getIndentString(level) { - const singleLevel = indentStrings[1]; - for (let current = indentStrings.length; current <= level; current++) { - indentStrings.push(indentStrings[current - 1] + singleLevel); - } - return indentStrings[level]; -} -function getIndentSize() { - return indentStrings[1].length; -} -function createTextWriter(newLine) { - let output; - let indent2; - let lineStart; - let lineCount; - let linePos; - let hasTrailingComment = false; - function updateLineCountAndPosFor(s) { - const lineStartsOfS = computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + last(lineStartsOfS); - lineStart = linePos - output.length === 0; - } else { - lineStart = false; - } - } - function writeText(s) { - if (s && s.length) { - if (lineStart) { - s = getIndentString(indent2) + s; - lineStart = false; - } - output += s; - updateLineCountAndPosFor(s); - } - } - function write(s) { - if (s) - hasTrailingComment = false; - writeText(s); - } - function writeComment(s) { - if (s) - hasTrailingComment = true; - writeText(s); - } - function reset() { - output = ""; - indent2 = 0; - lineStart = true; - lineCount = 0; - linePos = 0; - hasTrailingComment = false; - } - function rawWrite(s) { - if (s !== void 0) { - output += s; - updateLineCountAndPosFor(s); - hasTrailingComment = false; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - } - } - function writeLine(force) { - if (!lineStart || force) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - hasTrailingComment = false; - } - } - function getTextPosWithWriteLine() { - return lineStart ? output.length : output.length + newLine.length; - } - reset(); - return { - write, - rawWrite, - writeLiteral, - writeLine, - increaseIndent: () => { - indent2++; - }, - decreaseIndent: () => { - indent2--; - }, - getIndent: () => indent2, - getTextPos: () => output.length, - getLine: () => lineCount, - getColumn: () => lineStart ? indent2 * getIndentSize() : output.length - linePos, - getText: () => output, - isAtStartOfLine: () => lineStart, - hasTrailingComment: () => hasTrailingComment, - hasTrailingWhitespace: () => !!output.length && isWhiteSpaceLike(output.charCodeAt(output.length - 1)), - clear: reset, - writeKeyword: write, - writeOperator: write, - writeParameter: write, - writeProperty: write, - writePunctuation: write, - writeSpace: write, - writeStringLiteral: write, - writeSymbol: (s, _) => write(s), - writeTrailingSemicolon: write, - writeComment, - getTextPosWithWriteLine - }; -} -function getTrailingSemicolonDeferringWriter(writer) { - let pendingTrailingSemicolon = false; - function commitPendingTrailingSemicolon() { - if (pendingTrailingSemicolon) { - writer.writeTrailingSemicolon(";"); - pendingTrailingSemicolon = false; - } - } - return { - ...writer, - writeTrailingSemicolon() { - pendingTrailingSemicolon = true; - }, - writeLiteral(s) { - commitPendingTrailingSemicolon(); - writer.writeLiteral(s); - }, - writeStringLiteral(s) { - commitPendingTrailingSemicolon(); - writer.writeStringLiteral(s); - }, - writeSymbol(s, sym) { - commitPendingTrailingSemicolon(); - writer.writeSymbol(s, sym); - }, - writePunctuation(s) { - commitPendingTrailingSemicolon(); - writer.writePunctuation(s); - }, - writeKeyword(s) { - commitPendingTrailingSemicolon(); - writer.writeKeyword(s); - }, - writeOperator(s) { - commitPendingTrailingSemicolon(); - writer.writeOperator(s); - }, - writeParameter(s) { - commitPendingTrailingSemicolon(); - writer.writeParameter(s); - }, - writeSpace(s) { - commitPendingTrailingSemicolon(); - writer.writeSpace(s); - }, - writeProperty(s) { - commitPendingTrailingSemicolon(); - writer.writeProperty(s); - }, - writeComment(s) { - commitPendingTrailingSemicolon(); - writer.writeComment(s); - }, - writeLine() { - commitPendingTrailingSemicolon(); - writer.writeLine(); - }, - increaseIndent() { - commitPendingTrailingSemicolon(); - writer.increaseIndent(); - }, - decreaseIndent() { - commitPendingTrailingSemicolon(); - writer.decreaseIndent(); - } - }; -} function hostUsesCaseSensitiveFileNames(host) { return host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false; } @@ -11993,156 +11478,12 @@ function writeFileEnsuringDirectories(path2, data, writeByteOrderMark, writeFile writeFile2(path2, data, writeByteOrderMark); } } -function getLineOfLocalPositionFromLineMap(lineMap, pos) { - return computeLineOfPosition(lineMap, pos); -} function isThisIdentifier(node) { return !!node && node.kind === 79 /* Identifier */ && identifierIsThisKeyword(node); } function identifierIsThisKeyword(id) { return id.escapedText === "this"; } -function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { - emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments); -} -function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) { - if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { - writer.writeLine(); - } -} -function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) { - if (pos !== commentPos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) { - writer.writeLine(); - } -} -function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) { - if (comments && comments.length > 0) { - if (leadingSeparator) { - writer.writeSpace(" "); - } - let emitInterveningSeparator = false; - for (const comment of comments) { - if (emitInterveningSeparator) { - writer.writeSpace(" "); - emitInterveningSeparator = false; - } - writeComment(text, lineMap, writer, comment.pos, comment.end, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } else { - emitInterveningSeparator = true; - } - } - if (emitInterveningSeparator && trailingSeparator) { - writer.writeSpace(" "); - } - } -} -function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { - let leadingComments; - let currentDetachedCommentInfo; - if (removeComments) { - if (node.pos === 0) { - leadingComments = filter(getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); - } - } else { - leadingComments = getLeadingCommentRanges(text, node.pos); - } - if (leadingComments) { - const detachedComments = []; - let lastComment; - for (const comment of leadingComments) { - if (lastComment) { - const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); - const commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); - if (commentLine >= lastCommentLine + 2) { - break; - } - } - detachedComments.push(comment); - lastComment = comment; - } - if (detachedComments.length) { - const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, last(detachedComments).end); - const nodeLine = getLineOfLocalPositionFromLineMap(lineMap, skipTrivia(text, node.pos)); - if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); - emitComments( - text, - lineMap, - writer, - detachedComments, - /*leadingSeparator*/ - false, - /*trailingSeparator*/ - true, - newLine, - writeComment - ); - currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: last(detachedComments).end }; - } - } - } - return currentDetachedCommentInfo; - function isPinnedCommentLocal(comment) { - return isPinnedComment(text, comment.pos); - } -} -function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) { - if (text.charCodeAt(commentPos + 1) === 42 /* asterisk */) { - const firstCommentLineAndCharacter = computeLineAndCharacterOfPosition(lineMap, commentPos); - const lineCount = lineMap.length; - let firstCommentLineIndent; - for (let pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) { - const nextLineStart = currentLine + 1 === lineCount ? text.length + 1 : lineMap[currentLine + 1]; - if (pos !== commentPos) { - if (firstCommentLineIndent === void 0) { - firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos); - } - const currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - const spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); - if (spacesToEmit > 0) { - let numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - const indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart); - pos = nextLineStart; - } - } else { - writer.writeComment(text.substring(commentPos, commentEnd)); - } -} -function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { - const end = Math.min(commentEnd, nextLineStart - 1); - const currentLineText = trimString(text.substring(pos, end)); - if (currentLineText) { - writer.writeComment(currentLineText); - if (end !== commentEnd) { - writer.writeLine(); - } - } else { - writer.rawWrite(newLine); - } -} -function calculateIndent(text, pos, end) { - let currentLineIndent = 0; - for (; pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) { - if (text.charCodeAt(pos) === 9 /* tab */) { - currentLineIndent += getIndentSize() - currentLineIndent % getIndentSize(); - } else { - currentLineIndent++; - } - } - return currentLineIndent; -} function hasSyntacticModifier(node, flags) { return !!getSelectedSyntacticModifierFlags(node, flags); } @@ -12323,118 +11664,6 @@ function readJson(path2, host) { function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); } -var carriageReturnLineFeed = "\r\n"; -var lineFeed = "\n"; -function getNewLineCharacter(options) { - switch (options.newLine) { - case 0 /* CarriageReturnLineFeed */: - return carriageReturnLineFeed; - case 1 /* LineFeed */: - case void 0: - return lineFeed; - } -} -function createRange(pos, end = pos) { - Debug.assert(end >= pos || end === -1); - return { pos, end }; -} -function moveRangePos(range, pos) { - return createRange(pos, range.end); -} -function moveRangePastDecorators(node) { - const lastDecorator = canHaveModifiers(node) ? findLast(node.modifiers, isDecorator) : void 0; - return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; -} -function moveRangePastModifiers(node) { - if (isPropertyDeclaration(node) || isMethodDeclaration(node)) { - return moveRangePos(node, node.name.pos); - } - const lastModifier = canHaveModifiers(node) ? lastOrUndefined(node.modifiers) : void 0; - return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); -} -function rangeIsOnSingleLine(range, sourceFile) { - return rangeStartIsOnSameLineAsRangeEnd(range, range, sourceFile); -} -function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) { - return positionsAreOnSameLine( - getStartPositionOfRange( - range1, - sourceFile, - /*includeComments*/ - false - ), - getStartPositionOfRange( - range2, - sourceFile, - /*includeComments*/ - false - ), - sourceFile - ); -} -function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) { - return positionsAreOnSameLine(range1.end, range2.end, sourceFile); -} -function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) { - return positionsAreOnSameLine(getStartPositionOfRange( - range1, - sourceFile, - /*includeComments*/ - false - ), range2.end, sourceFile); -} -function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) { - return positionsAreOnSameLine(range1.end, getStartPositionOfRange( - range2, - sourceFile, - /*includeComments*/ - false - ), sourceFile); -} -function getLinesBetweenRangeEndAndRangeStart(range1, range2, sourceFile, includeSecondRangeComments) { - const range2Start = getStartPositionOfRange(range2, sourceFile, includeSecondRangeComments); - return getLinesBetweenPositions(sourceFile, range1.end, range2Start); -} -function positionsAreOnSameLine(pos1, pos2, sourceFile) { - return getLinesBetweenPositions(sourceFile, pos1, pos2) === 0; -} -function getStartPositionOfRange(range, sourceFile, includeComments) { - return positionIsSynthesized(range.pos) ? -1 : skipTrivia( - sourceFile.text, - range.pos, - /*stopAfterLineBreak*/ - false, - includeComments - ); -} -function getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { - const startPos = skipTrivia( - sourceFile.text, - pos, - /*stopAfterLineBreak*/ - false, - includeComments - ); - const prevPos = getPreviousNonWhitespacePosition(startPos, stopPos, sourceFile); - return getLinesBetweenPositions(sourceFile, prevPos != null ? prevPos : stopPos, startPos); -} -function getLinesBetweenPositionAndNextNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { - const nextPos = skipTrivia( - sourceFile.text, - pos, - /*stopAfterLineBreak*/ - false, - includeComments - ); - return getLinesBetweenPositions(sourceFile, pos, Math.min(stopPos, nextPos)); -} -function getPreviousNonWhitespacePosition(pos, stopPos = 0, sourceFile) { - while (pos-- > stopPos) { - if (!isWhiteSpaceLike(sourceFile.text.charCodeAt(pos))) { - return pos; - } - } -} function closeFileWatcher(watcher) { watcher.close(); } @@ -12467,15 +11696,6 @@ function isTypeNodeKind(kind) { function isAccessExpression(node) { return node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */; } -function isBundleFileTextLike(section) { - switch (section.kind) { - case "text" /* Text */: - case "internal" /* Internal */: - return true; - default: - return false; - } -} function getLeftmostAccessExpression(expr) { while (isAccessExpression(expr)) { expr = expr.expression; @@ -12728,12 +11948,18 @@ function getEmitModuleResolutionKind(compilerOptions) { } return moduleResolution; } +function getIsolatedModules(options) { + return !!(options.isolatedModules || options.verbatimModuleSyntax); +} function unreachableCodeIsError(options) { return options.allowUnreachableCode === false; } function unusedLabelIsError(options) { return options.allowUnusedLabels === false; } +function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { + return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; +} function getResolveJsonModule(compilerOptions) { if (compilerOptions.resolveJsonModule !== void 0) { return compilerOptions.resolveJsonModule; @@ -12741,7 +11967,7 @@ function getResolveJsonModule(compilerOptions) { return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */; } function shouldPreserveConstEnums(compilerOptions) { - return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); + return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions)); } function getStrictOptionValue(compilerOptions, flag) { return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag]; @@ -13151,71 +12377,6 @@ function setParentRecursive(rootNode, incremental) { return bindParentToChildIgnoringJSDoc(child, parent) || bindJSDoc(child); } } -function getContainingNodeArray(node) { - if (!node.parent) - return void 0; - switch (node.kind) { - case 165 /* TypeParameter */: - const { parent: parent2 } = node; - return parent2.kind === 192 /* InferType */ ? void 0 : parent2.typeParameters; - case 166 /* Parameter */: - return node.parent.parameters; - case 201 /* TemplateLiteralTypeSpan */: - return node.parent.templateSpans; - case 236 /* TemplateSpan */: - return node.parent.templateSpans; - case 167 /* Decorator */: { - const { parent: parent3 } = node; - return canHaveDecorators(parent3) ? parent3.modifiers : void 0; - } - case 294 /* HeritageClause */: - return node.parent.heritageClauses; - } - const { parent } = node; - if (isJSDocTag(node)) { - return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; - } - switch (parent.kind) { - case 184 /* TypeLiteral */: - case 261 /* InterfaceDeclaration */: - return isTypeElement(node) ? parent.members : void 0; - case 189 /* UnionType */: - case 190 /* IntersectionType */: - return parent.types; - case 186 /* TupleType */: - case 206 /* ArrayLiteralExpression */: - case 357 /* CommaListExpression */: - case 272 /* NamedImports */: - case 276 /* NamedExports */: - return parent.elements; - case 207 /* ObjectLiteralExpression */: - case 289 /* JsxAttributes */: - return parent.properties; - case 210 /* CallExpression */: - case 211 /* NewExpression */: - return isTypeNode(node) ? parent.typeArguments : parent.expression === node ? void 0 : parent.arguments; - case 281 /* JsxElement */: - case 285 /* JsxFragment */: - return isJsxChild(node) ? parent.children : void 0; - case 283 /* JsxOpeningElement */: - case 282 /* JsxSelfClosingElement */: - return isTypeNode(node) ? parent.typeArguments : void 0; - case 238 /* Block */: - case 292 /* CaseClause */: - case 293 /* DefaultClause */: - case 265 /* ModuleBlock */: - return parent.statements; - case 266 /* CaseBlock */: - return parent.clauses; - case 260 /* ClassDeclaration */: - case 228 /* ClassExpression */: - return isClassElement(node) ? parent.members : void 0; - case 263 /* EnumDeclaration */: - return isEnumMember(node) ? parent.members : void 0; - case 308 /* SourceFile */: - return parent.statements; - } -} // src/compiler/factory/baseNodeFactory.ts function createBaseNodeFactory() { @@ -15804,24 +14965,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) - return 65536 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 128 /* ContainsES2018 */) { - for (const element of getElementsOfBindingOrAssignmentPattern(node)) { - const target = getTargetOfBindingOrAssignmentElement(element); - if (target && isAssignmentPattern(target)) { - if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - return 65536 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 128 /* ContainsES2018 */) { - const flags2 = propagateAssignmentPatternFlags(target); - if (flags2) - return flags2; - } - } - } - } - return 0 /* None */; + return containsObjectRestOrSpread(node) ? 65536 /* ContainsObjectRestOrSpread */ : 0 /* None */; } function updateBinaryExpression(node, left, operator, right) { return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; @@ -18299,22 +17443,6 @@ function getSyntheticTrailingComments(node) { var _a2; return (_a2 = node.emitNode) == null ? void 0 : _a2.trailingComments; } -function getConstantValue(node) { - var _a2; - return (_a2 = node.emitNode) == null ? void 0 : _a2.constantValue; -} -function getEmitHelpers(node) { - var _a2; - return (_a2 = node.emitNode) == null ? void 0 : _a2.helpers; -} -function getSnippetElement(node) { - var _a2; - return (_a2 = node.emitNode) == null ? void 0 : _a2.snippetElement; -} -function getTypeNode(node) { - var _a2; - return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode; -} function setIdentifierTypeArguments(node, typeArguments) { getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; return node; @@ -18329,17 +17457,6 @@ function setIdentifierAutoGenerate(node, autoGenerate) { } // src/compiler/factory/emitHelpers.ts -function compareEmitHelpers(x, y) { - if (x === y) - return 0 /* EqualTo */; - if (x.priority === y.priority) - return 0 /* EqualTo */; - if (x.priority === void 0) - return 1 /* GreaterThan */; - if (y.priority === void 0) - return -1 /* LessThan */; - return compareValues(x.priority, y.priority); -} function helperString(input, ...args) { return (uniqueName) => { let result = ""; @@ -18623,9 +17740,6 @@ function isNonNullExpression(node) { function isMetaProperty(node) { return node.kind === 233 /* MetaProperty */; } -function isPartiallyEmittedExpression(node) { - return node.kind === 356 /* PartiallyEmittedExpression */; -} function isCommaListExpression(node) { return node.kind === 357 /* CommaListExpression */; } @@ -18638,9 +17752,6 @@ function isBlock(node) { function isVariableStatement(node) { return node.kind === 240 /* VariableStatement */; } -function isEmptyStatement(node) { - return node.kind === 239 /* EmptyStatement */; -} function isExpressionStatement(node) { return node.kind === 241 /* ExpressionStatement */; } @@ -18749,15 +17860,9 @@ function isShorthandPropertyAssignment(node) { function isEnumMember(node) { return node.kind === 302 /* EnumMember */; } -function isUnparsedPrepend(node) { - return node.kind === 304 /* UnparsedPrepend */; -} function isSourceFile(node) { return node.kind === 308 /* SourceFile */; } -function isUnparsedSource(node) { - return node.kind === 310 /* UnparsedSource */; -} function isJSDocTypeExpression(node) { return node.kind === 312 /* JSDocTypeExpression */; } @@ -18770,9 +17875,6 @@ function isJSDocFunctionType(node) { function isJSDoc(node) { return node.kind === 323 /* JSDoc */; } -function isJSDocTypeLiteral(node) { - return node.kind === 325 /* JSDocTypeLiteral */; -} function isJSDocPublicTag(node) { return node.kind === 336 /* JSDocPublicTag */; } @@ -18870,16 +17972,6 @@ function startOnNewLine(node) { true ); } -function getExternalHelpersModuleName(node) { - const parseNode = getOriginalNode(node, isSourceFile); - const emitNode = parseNode && parseNode.emitNode; - return emitNode && emitNode.externalHelpersModuleName; -} -function hasRecordedExternalHelpers(sourceFile) { - const parseNode = getOriginalNode(sourceFile, isSourceFile); - const emitNode = parseNode && parseNode.emitNode; - return !!emitNode && (!!emitNode.externalHelpersModuleName || !!emitNode.externalHelpers); -} function getTargetOfBindingOrAssignmentElement(bindingElement) { if (isDeclarationBindingElement(bindingElement)) { return bindingElement.name; @@ -19124,25 +18216,6 @@ function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, return resultHolder.value; } } -function getNodeForGeneratedName(name) { - var _a2; - const autoGenerate = name.emitNode.autoGenerate; - if (autoGenerate.flags & 4 /* Node */) { - const autoGenerateId = autoGenerate.id; - let node = name; - let original = node.original; - while (original) { - node = original; - const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; - if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) { - break; - } - original = node.original; - } - return node; - } - return name; -} function formatGeneratedNamePart(part, generateName) { return typeof part === "object" ? formatGeneratedName( /*privateName*/ @@ -19165,6 +18238,25 @@ function formatGeneratedName(privateName, prefix, baseName, suffix, generateName baseName = formatIdentifier(baseName, generateName); return `${privateName ? "#" : ""}${prefix}${baseName}${suffix}`; } +function containsObjectRestOrSpread(node) { + if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) + return true; + if (node.transformFlags & 128 /* ContainsES2018 */) { + for (const element of getElementsOfBindingOrAssignmentPattern(node)) { + const target = getTargetOfBindingOrAssignmentElement(element); + if (target && isAssignmentPattern(target)) { + if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { + return true; + } + if (target.transformFlags & 128 /* ContainsES2018 */) { + if (containsObjectRestOrSpread(target)) + return true; + } + } + } + } + return false; +} // src/compiler/factory/utilitiesPublic.ts function setTextRange(range, location) { @@ -19174,10 +18266,6 @@ function canHaveModifiers(node) { const kind = node.kind; return kind === 165 /* TypeParameter */ || kind === 166 /* Parameter */ || kind === 168 /* PropertySignature */ || kind === 169 /* PropertyDeclaration */ || kind === 170 /* MethodSignature */ || kind === 171 /* MethodDeclaration */ || kind === 173 /* Constructor */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */ || kind === 178 /* IndexSignature */ || kind === 182 /* ConstructorType */ || kind === 215 /* FunctionExpression */ || kind === 216 /* ArrowFunction */ || kind === 228 /* ClassExpression */ || kind === 240 /* VariableStatement */ || kind === 259 /* FunctionDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 275 /* ExportDeclaration */; } -function canHaveDecorators(node) { - const kind = node.kind; - return kind === 166 /* Parameter */ || kind === 169 /* PropertyDeclaration */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */ || kind === 228 /* ClassExpression */ || kind === 260 /* ClassDeclaration */; -} // src/compiler/parser.ts var NodeConstructor; @@ -19767,22 +18855,22 @@ function isExternalModule(file) { } var Parser; ((Parser2) => { - const scanner = createScanner( + var scanner = createScanner( 99 /* Latest */, /*skipTrivia*/ true ); - const disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; - let NodeConstructor2; - let TokenConstructor2; - let IdentifierConstructor2; - let PrivateIdentifierConstructor2; - let SourceFileConstructor2; + var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; + var NodeConstructor2; + var TokenConstructor2; + var IdentifierConstructor2; + var PrivateIdentifierConstructor2; + var SourceFileConstructor2; function countNode(node) { nodeCount++; return node; } - const baseNodeFactory = { + var baseNodeFactory = { createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2( kind, /*pos*/ @@ -19819,25 +18907,53 @@ var Parser; 0 )) }; - const factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); - let fileName; - let sourceFlags; - let sourceText; - let languageVersion; - let scriptKind; - let languageVariant; - let parseDiagnostics; - let jsDocDiagnostics; - let syntaxCursor; - let currentToken; - let nodeCount; - let identifiers; - let identifierCount; - let parsingContext; - let notParenthesizedArrow; - let contextFlags; - let topLevel = true; - let parseErrorBeforeNextFinishedNode = false; + var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); + var { + createNodeArray: factoryCreateNodeArray, + createNumericLiteral: factoryCreateNumericLiteral, + createStringLiteral: factoryCreateStringLiteral, + createLiteralLikeNode: factoryCreateLiteralLikeNode, + createIdentifier: factoryCreateIdentifier, + createPrivateIdentifier: factoryCreatePrivateIdentifier, + createToken: factoryCreateToken, + createArrayLiteralExpression: factoryCreateArrayLiteralExpression, + createObjectLiteralExpression: factoryCreateObjectLiteralExpression, + createPropertyAccessExpression: factoryCreatePropertyAccessExpression, + createPropertyAccessChain: factoryCreatePropertyAccessChain, + createElementAccessExpression: factoryCreateElementAccessExpression, + createElementAccessChain: factoryCreateElementAccessChain, + createCallExpression: factoryCreateCallExpression, + createCallChain: factoryCreateCallChain, + createNewExpression: factoryCreateNewExpression, + createParenthesizedExpression: factoryCreateParenthesizedExpression, + createBlock: factoryCreateBlock, + createVariableStatement: factoryCreateVariableStatement, + createExpressionStatement: factoryCreateExpressionStatement, + createIfStatement: factoryCreateIfStatement, + createWhileStatement: factoryCreateWhileStatement, + createForStatement: factoryCreateForStatement, + createForOfStatement: factoryCreateForOfStatement, + createVariableDeclaration: factoryCreateVariableDeclaration, + createVariableDeclarationList: factoryCreateVariableDeclarationList + } = factory2; + var fileName; + var sourceFlags; + var sourceText; + var languageVersion; + var scriptKind; + var languageVariant; + var parseDiagnostics; + var jsDocDiagnostics; + var syntaxCursor; + var currentToken; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; + var notParenthesizedArrow; + var contextFlags; + var topLevel = true; + var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) { var _a2; scriptKind2 = ensureScriptKind(fileName2, scriptKind2); @@ -19937,8 +19053,8 @@ var Parser; } } } - const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); - const statement = factory2.createExpressionStatement(expression); + const expression = isArray(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); + const statement = factoryCreateExpressionStatement(expression); finishNode(statement, pos); statements = createNodeArray([statement], pos); endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); @@ -20030,7 +19146,7 @@ var Parser; } sourceFlags = contextFlags; nextToken(); - const statements = parseList(ParsingContext.SourceElements, parseStatement); + const statements = parseList(0 /* SourceElements */, parseStatement); Debug.assert(token() === 1 /* EndOfFileToken */); const endOfFileToken = addJSDocComment(parseTokenNode()); const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); @@ -20093,7 +19209,7 @@ var Parser; nextToken(); while (token() !== 1 /* EndOfFileToken */) { const startPos = scanner.getStartPos(); - const statement = parseListElement(ParsingContext.SourceElements, parseStatement); + const statement = parseListElement(0 /* SourceElements */, parseStatement); statements.push(statement); if (startPos === scanner.getStartPos()) { nextToken(); @@ -20121,7 +19237,7 @@ var Parser; } } syntaxCursor = savedSyntaxCursor; - return factory2.updateSourceFile(sourceFile, setTextRange(factory2.createNodeArray(statements), sourceFile.statements)); + return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements)); function containsPossibleTopLevelAwait(node) { return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); } @@ -20562,13 +19678,13 @@ var Parser; const pos = getNodePos(); const kind = token(); nextToken(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseTokenNodeJSDoc() { const pos = getNodePos(); const kind = token(); nextTokenJSDoc(); - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function canParseSemicolon() { if (token() === 26 /* SemicolonToken */) { @@ -20589,7 +19705,7 @@ var Parser; return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); } function createNodeArray(elements, pos, end, hasTrailingComma) { - const array = factory2.createNodeArray(elements, hasTrailingComma); + const array = factoryCreateNodeArray(elements, hasTrailingComma); setTextRangePosEnd(array, pos, end != null ? end : scanner.getStartPos()); return array; } @@ -20611,7 +19727,7 @@ var Parser; parseErrorAtCurrentToken(diagnosticMessage, arg0); } const pos = getNodePos(); - const result = kind === 79 /* Identifier */ ? factory2.createIdentifier( + const result = kind === 79 /* Identifier */ ? factoryCreateIdentifier( "", /*originalKeywordKind*/ void 0 @@ -20621,15 +19737,15 @@ var Parser; "", /*templateFlags*/ void 0 - ) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral( + ) : kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral( "", /*numericLiteralFlags*/ void 0 - ) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + ) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( "", /*isSingleQuote*/ void 0 - ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind); + ) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); return finishNode(result, pos); } function internIdentifier(text) { @@ -20647,7 +19763,7 @@ var Parser; const text = internIdentifier(scanner.getTokenValue()); const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape(); nextTokenWithoutCheck(); - return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); + return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); } if (token() === 80 /* PrivateIdentifier */) { parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); @@ -20718,7 +19834,7 @@ var Parser; } function parsePrivateIdentifier() { const pos = getNodePos(); - const node = factory2.createPrivateIdentifier(internIdentifier(scanner.getTokenValue())); + const node = factoryCreatePrivateIdentifier(internIdentifier(scanner.getTokenValue())); nextToken(); return finishNode(node, pos); } @@ -20747,7 +19863,6 @@ var Parser; return canFollowExportModifier(); case 88 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); - case 127 /* AccessorKeyword */: case 124 /* StaticKeyword */: case 137 /* GetKeyword */: case 151 /* SetKeyword */: @@ -20780,19 +19895,19 @@ var Parser; return true; } switch (parsingContext2) { - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return lookAhead(isTypeMemberStart); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return lookAhead(isClassMemberStart) || token() === 26 /* SemicolonToken */ && !inErrorRecovery; - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return token() === 22 /* OpenBracketToken */ || isLiteralPropertyName(); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: switch (token()) { case 22 /* OpenBracketToken */: case 41 /* AsteriskToken */: @@ -20802,13 +19917,13 @@ var Parser; default: return isLiteralPropertyName(); } - case ParsingContext.RestProperties: + case 18 /* RestProperties */: return isLiteralPropertyName(); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName(); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return isAssertionKey2(); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: if (token() === 18 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); } @@ -20817,40 +19932,40 @@ var Parser; } else { return isIdentifier2() && !isHeritageClauseExtendsOrImplementsKeyword(); } - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 101 /* InKeyword */ || token() === 85 /* ConstKeyword */ || isIdentifier2(); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: switch (token()) { case 27 /* CommaToken */: case 24 /* DotToken */: return true; } - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 25 /* DotDotDotToken */ || isStartOfExpression(); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isStartOfParameter( /*isJSDocParameter*/ false ); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return isStartOfParameter( /*isJSDocParameter*/ true ); - case ParsingContext.TypeArguments: - case ParsingContext.TupleElementTypes: + case 20 /* TypeArguments */: + case 21 /* TupleElementTypes */: return token() === 27 /* CommaToken */ || isStartOfType(); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return isHeritageClause2(); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return tokenIsIdentifierOrKeyword(token()); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return true; } return Debug.fail("Non-exhaustive case in 'isListElement'."); @@ -20894,41 +20009,41 @@ var Parser; return true; } switch (kind) { - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauses: - case ParsingContext.TypeMembers: - case ParsingContext.ClassMembers: - case ParsingContext.EnumMembers: - case ParsingContext.ObjectLiteralMembers: - case ParsingContext.ObjectBindingElements: - case ParsingContext.ImportOrExportSpecifiers: - case ParsingContext.AssertEntries: + case 1 /* BlockStatements */: + case 2 /* SwitchClauses */: + case 4 /* TypeMembers */: + case 5 /* ClassMembers */: + case 6 /* EnumMembers */: + case 12 /* ObjectLiteralMembers */: + case 9 /* ObjectBindingElements */: + case 23 /* ImportOrExportSpecifiers */: + case 24 /* AssertEntries */: return token() === 19 /* CloseBraceToken */; - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return token() === 19 /* CloseBraceToken */ || token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */; - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */; - case ParsingContext.ArrayLiteralMembers: - case ParsingContext.TupleElementTypes: - case ParsingContext.ArrayBindingElements: + case 15 /* ArrayLiteralMembers */: + case 21 /* TupleElementTypes */: + case 10 /* ArrayBindingElements */: return token() === 23 /* CloseBracketToken */; - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: - case ParsingContext.RestProperties: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: + case 18 /* RestProperties */: return token() === 21 /* CloseParenToken */ || token() === 23 /* CloseBracketToken */; - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return token() !== 27 /* CommaToken */; - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return token() === 18 /* OpenBraceToken */ || token() === 19 /* CloseBraceToken */; - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return token() === 31 /* GreaterThanToken */ || token() === 43 /* SlashToken */; - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsSlash); default: return false; @@ -20947,7 +20062,7 @@ var Parser; return false; } function isInSomeParsingContext() { - for (let kind = 0; kind < ParsingContext.Count; kind++) { + for (let kind = 0; kind < 25 /* Count */; kind++) { if (parsingContext & 1 << kind) { if (isListElement( kind, @@ -21016,38 +20131,38 @@ var Parser; } function isReusableParsingContext(parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: - case ParsingContext.SwitchClauses: - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: - case ParsingContext.EnumMembers: - case ParsingContext.TypeMembers: - case ParsingContext.VariableDeclarations: - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 5 /* ClassMembers */: + case 2 /* SwitchClauses */: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: + case 6 /* EnumMembers */: + case 4 /* TypeMembers */: + case 8 /* VariableDeclarations */: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return true; } return false; } function canReuseNode(node, parsingContext2) { switch (parsingContext2) { - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return isReusableClassMember(node); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return isReusableSwitchClause(node); - case ParsingContext.SourceElements: - case ParsingContext.BlockStatements: - case ParsingContext.SwitchClauseStatements: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: return isReusableStatement(node); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return isReusableEnumMember(node); - case ParsingContext.TypeMembers: + case 4 /* TypeMembers */: return isReusableTypeMember(node); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isReusableVariableDeclaration(node); - case ParsingContext.JSDocParameters: - case ParsingContext.Parameters: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: return isReusableParameter(node); } return false; @@ -21157,56 +20272,56 @@ var Parser; } function parsingContextErrors(context) { switch (context) { - case ParsingContext.SourceElements: + case 0 /* SourceElements */: return token() === 88 /* DefaultKeyword */ ? parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(93 /* ExportKeyword */)) : parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.BlockStatements: + case 1 /* BlockStatements */: return parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case ParsingContext.SwitchClauses: + case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(Diagnostics.case_or_default_expected); - case ParsingContext.SwitchClauseStatements: + case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(Diagnostics.Statement_expected); - case ParsingContext.RestProperties: - case ParsingContext.TypeMembers: + case 18 /* RestProperties */: + case 4 /* TypeMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected); - case ParsingContext.ClassMembers: + case 5 /* ClassMembers */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case ParsingContext.EnumMembers: + case 6 /* EnumMembers */: return parseErrorAtCurrentToken(Diagnostics.Enum_member_expected); - case ParsingContext.HeritageClauseElement: + case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(Diagnostics.Expression_expected); - case ParsingContext.VariableDeclarations: + case 8 /* VariableDeclarations */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Variable_declaration_expected); - case ParsingContext.ObjectBindingElements: + case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Property_destructuring_pattern_expected); - case ParsingContext.ArrayBindingElements: + case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(Diagnostics.Array_element_destructuring_pattern_expected); - case ParsingContext.ArgumentExpressions: + case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(Diagnostics.Argument_expression_expected); - case ParsingContext.ObjectLiteralMembers: + case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Property_assignment_expected); - case ParsingContext.ArrayLiteralMembers: + case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(Diagnostics.Expression_or_comma_expected); - case ParsingContext.JSDocParameters: + case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.Parameters: + case 16 /* Parameters */: return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_parameter_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case ParsingContext.TypeParameters: + case 19 /* TypeParameters */: return parseErrorAtCurrentToken(Diagnostics.Type_parameter_declaration_expected); - case ParsingContext.TypeArguments: + case 20 /* TypeArguments */: return parseErrorAtCurrentToken(Diagnostics.Type_argument_expected); - case ParsingContext.TupleElementTypes: + case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(Diagnostics.Type_expected); - case ParsingContext.HeritageClauses: + case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected); - case ParsingContext.ImportOrExportSpecifiers: + case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxAttributes: + case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.JsxChildren: + case 14 /* JsxChildren */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.AssertEntries: + case 24 /* AssertEntries */: return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); - case ParsingContext.Count: + case 25 /* Count */: return Debug.fail("ParsingContext.Count used as a context"); default: Debug.assertNever(context); @@ -21265,7 +20380,7 @@ var Parser; ); } function getExpectedCommaDiagnostic(kind) { - return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; + return kind === 6 /* EnumMembers */ ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; } function createMissingList() { const list = createNodeArray([], getNodePos()); @@ -21434,12 +20549,12 @@ var Parser; // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral( + kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral( scanner.getTokenValue(), /*isSingleQuote*/ void 0, scanner.hasExtendedUnicodeEscape() - ) : isLiteralKind(kind) ? factory2.createLiteralLikeNode(kind, scanner.getTokenValue()) : Debug.fail() + ) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner.getTokenValue()) : Debug.fail() ); if (scanner.hasExtendedUnicodeEscape()) { node.hasExtendedUnicodeEscape = true; @@ -21459,7 +20574,7 @@ var Parser; } function parseTypeArgumentsOfTypeReference() { if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function parseTypeReference() { @@ -21641,7 +20756,7 @@ var Parser; } function parseTypeParameters() { if (token() === 29 /* LessThanToken */) { - return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); + return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); } } function isStartOfParameter(isJSDocParameter) { @@ -21747,7 +20862,7 @@ var Parser; const savedAwaitContext = inAwaitContext(); setYieldContext(!!(flags & 1 /* Yield */)); setAwaitContext(!!(flags & 2 /* Await */)); - const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(ParsingContext.JSDocParameters, parseJSDocParameter) : parseDelimitedList(ParsingContext.Parameters, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); + const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(17 /* JSDocParameters */, parseJSDocParameter) : parseDelimitedList(16 /* Parameters */, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); setYieldContext(savedYieldContext); setAwaitContext(savedAwaitContext); return parameters; @@ -21815,7 +20930,7 @@ var Parser; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { - const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter( + const parameters = parseBracketedList(16 /* Parameters */, () => parseParameter( /*inOuterAwaitContext*/ false ), 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); @@ -21914,7 +21029,7 @@ var Parser; function parseObjectTypeMembers() { let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = parseList(ParsingContext.TypeMembers, parseTypeMember); + members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -21968,7 +21083,7 @@ var Parser; } const type = parseTypeAnnotation(); parseSemicolon(); - const members = parseList(ParsingContext.TypeMembers, parseTypeMember); + const members = parseList(4 /* TypeMembers */, parseTypeMember); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), pos); } @@ -22013,7 +21128,7 @@ var Parser; const pos = getNodePos(); return finishNode( factory2.createTupleTypeNode( - parseBracketedList(ParsingContext.TupleElementTypes, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) + parseBracketedList(21 /* TupleElementTypes */, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) ), pos ); @@ -22030,7 +21145,7 @@ var Parser; if (token() === 126 /* AbstractKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(126 /* AbstractKeyword */), pos); + const modifier = finishNode(factoryCreateToken(126 /* AbstractKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -22040,6 +21155,7 @@ var Parser; const hasJSDoc = hasPrecedingJSDocComment(); const modifiers = parseModifiersForConstructorType(); const isConstructorType = parseOptional(103 /* NewKeyword */); + Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers."); const typeParameters = parseTypeParameters(); const parameters = parseParameters(4 /* Type */); const type = parseReturnType( @@ -22048,8 +21164,6 @@ var Parser; false ); const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type); - if (!isConstructorType) - node.modifiers = modifiers; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseKeywordAndNoDot() { @@ -22641,10 +21755,10 @@ var Parser; } function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { const triState = isParenthesizedArrowFunctionExpression(); - if (triState === Tristate.False) { + if (triState === 0 /* False */) { return void 0; } - return triState === Tristate.True ? parseParenthesizedArrowFunctionExpression( + return triState === 1 /* True */ ? parseParenthesizedArrowFunctionExpression( /*allowAmbiguity*/ true, /*allowReturnTypeInArrowFunction*/ @@ -22656,18 +21770,18 @@ var Parser; return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } if (token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner.hasPrecedingLineBreak()) { - return Tristate.False; + return 0 /* False */; } if (token() !== 20 /* OpenParenToken */ && token() !== 29 /* LessThanToken */) { - return Tristate.False; + return 0 /* False */; } } const first2 = token(); @@ -22679,45 +21793,45 @@ var Parser; case 38 /* EqualsGreaterThanToken */: case 58 /* ColonToken */: case 18 /* OpenBraceToken */: - return Tristate.True; + return 1 /* True */; default: - return Tristate.False; + return 0 /* False */; } } if (second === 22 /* OpenBracketToken */ || second === 18 /* OpenBraceToken */) { - return Tristate.Unknown; + return 2 /* Unknown */; } if (second === 25 /* DotDotDotToken */) { - return Tristate.True; + return 1 /* True */; } if (isModifierKind(second) && second !== 132 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { if (nextToken() === 128 /* AsKeyword */) { - return Tristate.False; + return 0 /* False */; } - return Tristate.True; + return 1 /* True */; } if (!isIdentifier2() && second !== 108 /* ThisKeyword */) { - return Tristate.False; + return 0 /* False */; } switch (nextToken()) { case 58 /* ColonToken */: - return Tristate.True; + return 1 /* True */; case 57 /* QuestionToken */: nextToken(); if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 63 /* EqualsToken */ || token() === 21 /* CloseParenToken */) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; case 27 /* CommaToken */: case 63 /* EqualsToken */: case 21 /* CloseParenToken */: - return Tristate.Unknown; + return 2 /* Unknown */; } - return Tristate.False; + return 0 /* False */; } else { Debug.assert(first2 === 29 /* LessThanToken */); if (!isIdentifier2() && token() !== 85 /* ConstKeyword */) { - return Tristate.False; + return 0 /* False */; } if (languageVariant === 1 /* JSX */) { const isArrowFunctionInJsx = lookAhead(() => { @@ -22728,6 +21842,7 @@ var Parser; switch (fourth) { case 63 /* EqualsToken */: case 31 /* GreaterThanToken */: + case 43 /* SlashToken */: return false; default: return true; @@ -22738,11 +21853,11 @@ var Parser; return false; }); if (isArrowFunctionInJsx) { - return Tristate.True; + return 1 /* True */; } - return Tristate.False; + return 0 /* False */; } - return Tristate.Unknown; + return 2 /* Unknown */; } } function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { @@ -22762,7 +21877,7 @@ var Parser; } function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { if (token() === 132 /* AsyncKeyword */) { - if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === Tristate.True) { + if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) { const pos = getNodePos(); const asyncModifier = parseModifiersForArrowFunction(); const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); @@ -22775,14 +21890,14 @@ var Parser; if (token() === 132 /* AsyncKeyword */) { nextToken(); if (scanner.hasPrecedingLineBreak() || token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.False; + return 0 /* False */; } const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); if (!scanner.hasPrecedingLineBreak() && expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) { - return Tristate.True; + return 1 /* True */; } } - return Tristate.False; + return 0 /* False */; } function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { const pos = getNodePos(); @@ -22987,6 +22102,12 @@ var Parser; case 114 /* VoidKeyword */: return parseVoidExpression(); case 29 /* LessThanToken */: + if (languageVariant === 1 /* JSX */) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } return parseTypeAssertion(); case 133 /* AwaitKeyword */: if (isAwaitExpression2()) { @@ -23081,7 +22202,7 @@ var Parser; return expression; } parseExpectedToken(24 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - return finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -23102,7 +22223,7 @@ var Parser; factory2.createJsxElement( lastChild.openingElement, lastChild.children, - finishNode(factory2.createJsxClosingElement(finishNode(factory2.createIdentifier(""), end, end)), end, end) + finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end) ), lastChild.openingElement.pos, end @@ -23190,7 +22311,7 @@ var Parser; const list = []; const listPos = getNodePos(); const saveParsingContext = parsingContext; - parsingContext |= 1 << ParsingContext.JsxChildren; + parsingContext |= 1 << 14 /* JsxChildren */; while (true) { const child = parseJsxChild(openingTag, currentToken = scanner.reScanJsxToken()); if (!child) @@ -23205,7 +22326,7 @@ var Parser; } function parseJsxAttributes() { const pos = getNodePos(); - return finishNode(factory2.createJsxAttributes(parseList(ParsingContext.JsxAttributes, parseJsxAttribute)), pos); + return finishNode(factory2.createJsxAttributes(parseList(13 /* JsxAttributes */, parseJsxAttribute)), pos); } function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { const pos = getNodePos(); @@ -23245,7 +22366,7 @@ var Parser; scanJsxIdentifier(); let expression = token() === 108 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - expression = finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot( + expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ @@ -23339,13 +22460,9 @@ var Parser; function parseJsxClosingFragment(inExpressionContext) { const pos = getNodePos(); parseExpected(30 /* LessThanSlashToken */); - if (tokenIsIdentifierOrKeyword(token())) { - parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); - } if (parseExpected( 31 /* GreaterThanToken */, - /*diagnostic*/ - void 0, + Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment, /*shouldAdvance*/ false )) { @@ -23358,6 +22475,7 @@ var Parser; return finishNode(factory2.createJsxJsxClosingFragment(), pos); } function parseTypeAssertion() { + Debug.assert(languageVariant !== 1 /* JSX */, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments."); const pos = getNodePos(); parseExpected(29 /* LessThanToken */); const type = parseType(); @@ -23399,7 +22517,7 @@ var Parser; true ); const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); - const propertyAccess = isOptionalChain2 ? factory2.createPropertyAccessChain(expression, questionDotToken, name) : factory2.createPropertyAccessExpression(expression, name); + const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name) : factoryCreatePropertyAccessExpression(expression, name); if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers); } @@ -23427,7 +22545,7 @@ var Parser; argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createElementAccessChain(expression, questionDotToken, argumentExpression) : factory2.createElementAccessExpression(expression, argumentExpression); + const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression); return finishNode(indexedAccess, pos); } function parseMemberExpressionRest(pos, expression, allowOptionalChain) { @@ -23514,7 +22632,7 @@ var Parser; expression = expression.expression; } const argumentList = parseArgumentList(); - const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList); + const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList); expression = finishNode(callExpr, pos); continue; } @@ -23525,7 +22643,7 @@ var Parser; false, Diagnostics.Identifier_expected ); - expression = finishNode(factory2.createPropertyAccessChain(expression, questionDotToken, name), pos); + expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name), pos); } break; } @@ -23533,7 +22651,7 @@ var Parser; } function parseArgumentList() { parseExpected(20 /* OpenParenToken */); - const result = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); + const result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(21 /* CloseParenToken */); return result; } @@ -23545,7 +22663,7 @@ var Parser; return void 0; } nextToken(); - const typeArguments = parseDelimitedList(ParsingContext.TypeArguments, parseType); + const typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType); if (reScanGreaterToken() !== 31 /* GreaterThanToken */) { return void 0; } @@ -23620,7 +22738,7 @@ var Parser; parseExpected(20 /* OpenParenToken */); const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - return withJSDoc(finishNode(factory2.createParenthesizedExpression(expression), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc); } function parseSpreadElement() { const pos = getNodePos(); @@ -23645,9 +22763,9 @@ var Parser; const openBracketPosition = scanner.getTokenPos(); const openBracketParsed = parseExpected(22 /* OpenBracketToken */); const multiLine = scanner.hasPrecedingLineBreak(); - const elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArgumentOrArrayLiteralElement); + const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketParsed, openBracketPosition); - return finishNode(factory2.createArrayLiteralExpression(elements, multiLine), pos); + return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos); } function parseObjectLiteralElement() { const pos = getNodePos(); @@ -23706,13 +22824,13 @@ var Parser; const openBraceParsed = parseExpected(18 /* OpenBraceToken */); const multiLine = scanner.hasPrecedingLineBreak(); const properties = parseDelimitedList( - ParsingContext.ObjectLiteralMembers, + 12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true ); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - return finishNode(factory2.createObjectLiteralExpression(properties, multiLine), pos); + return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos); } function parseFunctionExpression() { const savedDecoratorContext = inDecoratorContext(); @@ -23769,7 +22887,7 @@ var Parser; parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression)); } const argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : void 0; - return finishNode(factory2.createNewExpression(expression, typeArguments, argumentList), pos); + return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { const pos = getNodePos(); @@ -23778,17 +22896,17 @@ var Parser; const openBraceParsed = parseExpected(18 /* OpenBraceToken */, diagnosticMessage); if (openBraceParsed || ignoreMissingOpenBrace) { const multiLine = scanner.hasPrecedingLineBreak(); - const statements = parseList(ParsingContext.BlockStatements, parseStatement); + const statements = parseList(1 /* BlockStatements */, parseStatement); parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); - const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc); + const result = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc); if (token() === 63 /* EqualsToken */) { - parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); + parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses); nextToken(); } return result; } else { const statements = createMissingList(); - return withJSDoc(finishNode(factory2.createBlock( + return withJSDoc(finishNode(factoryCreateBlock( statements, /*multiLine*/ void 0 @@ -23837,7 +22955,7 @@ var Parser; parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const thenStatement = parseStatement(); const elseStatement = parseOptional(91 /* ElseKeyword */) ? parseStatement() : void 0; - return withJSDoc(finishNode(factory2.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); } function parseDoStatement() { const pos = getNodePos(); @@ -23861,7 +22979,7 @@ var Parser; const expression = allowInAnd(parseExpression); parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); const statement = parseStatement(); - return withJSDoc(finishNode(factory2.createWhileStatement(expression, statement), pos), hasJSDoc); + return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc); } function parseForOrForInOrForOfStatement() { const pos = getNodePos(); @@ -23887,7 +23005,7 @@ var Parser; true )); parseExpected(21 /* CloseParenToken */); - node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement()); + node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement()); } else if (parseOptional(101 /* InKeyword */)) { const expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); @@ -23898,7 +23016,7 @@ var Parser; parseExpected(26 /* SemicolonToken */); const incrementor = token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; parseExpected(21 /* CloseParenToken */); - node = factory2.createForStatement(initializer, condition, incrementor, parseStatement()); + node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement()); } return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -23936,14 +23054,14 @@ var Parser; parseExpected(82 /* CaseKeyword */); const expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return withJSDoc(finishNode(factory2.createCaseClause(expression, statements), pos), hasJSDoc); } function parseDefaultClause() { const pos = getNodePos(); parseExpected(88 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); - const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(factory2.createDefaultClause(statements), pos); } function parseCaseOrDefaultClause() { @@ -23952,7 +23070,7 @@ var Parser; function parseCaseBlock() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const clauses = parseList(ParsingContext.SwitchClauses, parseCaseOrDefaultClause); + const clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createCaseBlock(clauses), pos); } @@ -23973,7 +23091,7 @@ var Parser; let expression = scanner.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); if (expression === void 0) { identifierCount++; - expression = finishNode(factory2.createIdentifier(""), getNodePos()); + expression = finishNode(factoryCreateIdentifier(""), getNodePos()); } if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); @@ -24034,7 +23152,7 @@ var Parser; if (!tryParseSemicolon()) { parseErrorForMissingSemicolonAfter(expression); } - node = factory2.createExpressionStatement(expression); + node = factoryCreateExpressionStatement(expression); if (hasParen) { hasJSDoc = false; } @@ -24393,14 +23511,14 @@ var Parser; function parseObjectBindingPattern() { const pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); - const elements = parseDelimitedList(ParsingContext.ObjectBindingElements, parseObjectBindingElement); + const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(factory2.createObjectBindingPattern(elements), pos); } function parseArrayBindingPattern() { const pos = getNodePos(); parseExpected(22 /* OpenBracketToken */); - const elements = parseDelimitedList(ParsingContext.ArrayBindingElements, parseArrayBindingElement); + const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); return finishNode(factory2.createArrayBindingPattern(elements), pos); } @@ -24432,7 +23550,7 @@ var Parser; } const type = parseTypeAnnotation(); const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); - const node = factory2.createVariableDeclaration(name, exclamationToken, type, initializer); + const node = factoryCreateVariableDeclaration(name, exclamationToken, type, initializer); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseVariableDeclarationList(inForStatementInitializer) { @@ -24458,12 +23576,12 @@ var Parser; const savedDisallowIn = inDisallowInContext(); setDisallowInContext(inForStatementInitializer); declarations = parseDelimitedList( - ParsingContext.VariableDeclarations, + 8 /* VariableDeclarations */, inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation ); setDisallowInContext(savedDisallowIn); } - return finishNode(factory2.createVariableDeclarationList(declarations, flags), pos); + return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos); } function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; @@ -24474,7 +23592,7 @@ var Parser; false ); parseSemicolon(); - const node = factory2.createVariableStatement(modifiers, declarationList); + const node = factoryCreateVariableStatement(modifiers, declarationList); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { @@ -24703,22 +23821,30 @@ var Parser; return void 0; } } - return finishNode(factory2.createToken(kind), pos); + return finishNode(factoryCreateToken(kind), pos); } function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { const pos = getNodePos(); let list; - let modifier, hasSeenStaticModifier = false; + let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false; + if (allowDecorators && token() === 59 /* AtToken */) { + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + } while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; list = append(list, modifier); + hasLeadingModifier = true; } - if (allowDecorators && token() === 59 /* AtToken */) { - let decorator; + if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) { while (decorator = tryParseDecorator()) { list = append(list, decorator); + hasTrailingDecorator = true; } + } + if (hasTrailingDecorator) { while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { if (modifier.kind === 124 /* StaticKeyword */) hasSeenStaticModifier = true; @@ -24732,7 +23858,7 @@ var Parser; if (token() === 132 /* AsyncKeyword */) { const pos = getNodePos(); nextToken(); - const modifier = finishNode(factory2.createToken(132 /* AsyncKeyword */), pos); + const modifier = finishNode(factoryCreateToken(132 /* AsyncKeyword */), pos); modifiers = createNodeArray([modifier], pos); } return modifiers; @@ -24861,7 +23987,7 @@ var Parser; } function parseHeritageClauses() { if (isHeritageClause2()) { - return parseList(ParsingContext.HeritageClauses, parseHeritageClause); + return parseList(22 /* HeritageClauses */, parseHeritageClause); } return void 0; } @@ -24870,7 +23996,7 @@ var Parser; const tok = token(); Debug.assert(tok === 94 /* ExtendsKeyword */ || tok === 117 /* ImplementsKeyword */); nextToken(); - const types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseExpressionWithTypeArguments); + const types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(factory2.createHeritageClause(tok, types), pos); } function parseExpressionWithTypeArguments() { @@ -24883,13 +24009,13 @@ var Parser; return finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); } function tryParseTypeArguments() { - return token() === 29 /* LessThanToken */ ? parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; + return token() === 29 /* LessThanToken */ ? parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; } function isHeritageClause2() { return token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */; } function parseClassMembers() { - return parseList(ParsingContext.ClassMembers, parseClassElement); + return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { parseExpected(118 /* InterfaceKeyword */); @@ -24922,7 +24048,7 @@ var Parser; const name = parseIdentifier(); let members; if (parseExpected(18 /* OpenBraceToken */)) { - members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(ParsingContext.EnumMembers, parseEnumMember)); + members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(6 /* EnumMembers */, parseEnumMember)); parseExpected(19 /* CloseBraceToken */); } else { members = createMissingList(); @@ -24934,7 +24060,7 @@ var Parser; const pos = getNodePos(); let statements; if (parseExpected(18 /* OpenBraceToken */)) { - statements = parseList(ParsingContext.BlockStatements, parseStatement); + statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); } else { statements = createMissingList(); @@ -25059,7 +24185,7 @@ var Parser; if (parseExpected(18 /* OpenBraceToken */)) { const multiLine = scanner.hasPrecedingLineBreak(); const elements = parseDelimitedList( - ParsingContext.AssertEntries, + 24 /* AssertEntries */, parseAssertEntry, /*considerSemicolonAsDelimiter*/ true @@ -25143,7 +24269,7 @@ var Parser; } function parseNamedImportsOrExports(kind) { const pos = getNodePos(); - const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); + const node = kind === 272 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { @@ -25319,7 +24445,7 @@ var Parser; /*isDeclarationFile*/ false, [], - factory2.createToken(1 /* EndOfFileToken */), + factoryCreateToken(1 /* EndOfFileToken */), 0 /* None */, noop ); @@ -25980,7 +25106,7 @@ var Parser; let node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { const name = parseJSDocIdentifierName(); - node = finishNode(factory2.createPropertyAccessExpression(node, name), pos); + node = finishNode(factoryCreatePropertyAccessExpression(node, name), pos); } return node; } @@ -26271,7 +25397,7 @@ var Parser; const end2 = scanner.getTextPos(); const originalKeywordKind = token(); const text = internIdentifier(scanner.getTokenValue()); - const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2); + const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), pos, end2); nextTokenJSDoc(); return result; } @@ -26593,7 +25719,7 @@ var IncrementalParser; let currentArrayIndex = 0; Debug.assert(currentArrayIndex < currentArray.length); let current = currentArray[currentArrayIndex]; - let lastQueriedPosition = InvalidPosition.Value; + let lastQueriedPosition = -1 /* Value */; return { currentNode(position) { if (position !== lastQueriedPosition) { @@ -26612,7 +25738,7 @@ var IncrementalParser; }; function findHighestListElementThatStartsAtPosition(position) { currentArray = void 0; - currentArrayIndex = InvalidPosition.Value; + currentArrayIndex = -1 /* Value */; current = void 0; forEachChild(sourceFile, visitNode3, visitArray2); return; @@ -27926,7 +27052,7 @@ var commandOptionsWithoutBuild = [ { name: "allowArbitraryExtensions", type: "boolean", - affectsModuleResolution: true, + affectsProgramStructure: true, category: Diagnostics.Modules, description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present, defaultValueDescription: false @@ -28839,6 +27965,22 @@ function formatExtensions(extensions) { result.push("JSON"); return result.join(", "); } +function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) { + if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) { + const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled); + if (originalPath) + resolved = { ...resolved, path: resolvedFileName, originalPath }; + } + return createResolvedModuleWithFailedLookupLocations( + resolved, + isExternalLibraryImport, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache, + legacyResult + ); +} function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { if (resultFromCache) { resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); @@ -28971,36 +28113,48 @@ function arePathsEqual(path1, path2, host) { const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */; } +function getOriginalAndResolvedFileName(fileName, host, traceEnabled) { + const resolvedFileName = realPath(fileName, host, traceEnabled); + const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + return { + // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames + resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, + originalPath: pathsAreEqual ? void 0 : fileName + }; +} function getNodeResolutionFeatures(options) { - let features = NodeResolutionFeatures.None; + let features = 0 /* None */; switch (getEmitModuleResolutionKind(options)) { case 3 /* Node16 */: - features = NodeResolutionFeatures.Node16Default; + features = 30 /* Node16Default */; break; case 99 /* NodeNext */: - features = NodeResolutionFeatures.NodeNextDefault; + features = 30 /* NodeNextDefault */; break; case 100 /* Bundler */: - features = NodeResolutionFeatures.BundlerDefault; + features = 30 /* BundlerDefault */; break; } if (options.resolvePackageJsonExports) { - features |= NodeResolutionFeatures.Exports; + features |= 8 /* Exports */; } else if (options.resolvePackageJsonExports === false) { - features &= ~NodeResolutionFeatures.Exports; + features &= ~8 /* Exports */; } if (options.resolvePackageJsonImports) { - features |= NodeResolutionFeatures.Imports; + features |= 2 /* Imports */; } else if (options.resolvePackageJsonImports === false) { - features &= ~NodeResolutionFeatures.Imports; + features &= ~2 /* Imports */; } return features; } function getConditions(options, esmMode) { - const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["node", "import"] : ["node", "require"]; + const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["import"] : ["require"]; if (!options.noDtsResolution) { conditions.push("types"); } + if (getEmitModuleResolutionKind(options) !== 100 /* Bundler */) { + conditions.push("node"); + } return concatenate(conditions, options.customConditions); } function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { @@ -29204,19 +28358,6 @@ function resolveJSModule(moduleName, initialDir, host) { } return resolvedModule.resolvedFileName; } -var NodeResolutionFeatures = /* @__PURE__ */ ((NodeResolutionFeatures2) => { - NodeResolutionFeatures2[NodeResolutionFeatures2["None"] = 0] = "None"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Imports"] = 2] = "Imports"; - NodeResolutionFeatures2[NodeResolutionFeatures2["SelfName"] = 4] = "SelfName"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Exports"] = 8] = "Exports"; - NodeResolutionFeatures2[NodeResolutionFeatures2["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; - NodeResolutionFeatures2[NodeResolutionFeatures2["AllFeatures"] = 30] = "AllFeatures"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Node16Default"] = 30] = "Node16Default"; - NodeResolutionFeatures2[NodeResolutionFeatures2["NodeNextDefault"] = 30 /* AllFeatures */] = "NodeNextDefault"; - NodeResolutionFeatures2[NodeResolutionFeatures2["BundlerDefault"] = 30] = "BundlerDefault"; - NodeResolutionFeatures2[NodeResolutionFeatures2["EsmMode"] = 32] = "EsmMode"; - return NodeResolutionFeatures2; -})(NodeResolutionFeatures || {}); function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { return nodeNextModuleNameResolverWorker( 30 /* Node16Default */, @@ -29330,7 +28471,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, isConfigLookup, candidateIsFromPackageJsonField: false }; - if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) { + if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(compilerOptions))) { trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", ")); } let result; @@ -29356,13 +28497,14 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, legacyResult = diagnosticResult.value.resolved.path; } } - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved, (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache, + state, legacyResult ); function tryResolve(extensions2, state2) { @@ -29392,16 +28534,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, } resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } - if (!resolved2) - return void 0; - let resolvedValue = resolved2.value; - if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) { - const path2 = realPath(resolvedValue.path, host, traceEnabled); - const pathsAreEqual = arePathsEqual(path2, resolvedValue.path, host); - const originalPath = pathsAreEqual ? void 0 : resolvedValue.path; - resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path2, originalPath }; - } - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } }; } else { const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName); const resolved2 = nodeLoadModuleByRelativeName( @@ -29584,7 +28717,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) { if (!onlyRecordFailures) { if (state.host.fileExists(fileName)) { if (state.traceEnabled) { - trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); + trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName); } return fileName; } else { @@ -30062,18 +29195,24 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec ))); } else if (typeof target === "object" && target !== null) { if (!Array.isArray(target)) { + traceIfEnabled(state, Diagnostics.Entering_conditional_exports); for (const condition of getOwnKeys(target)) { if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) { traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); const subTarget = target[condition]; const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key); if (result) { + traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition); + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return result; + } else { + traceIfEnabled(state, Diagnostics.Failed_to_resolve_under_condition_0, condition); } } else { traceIfEnabled(state, Diagnostics.Saw_non_matching_condition_0, condition); } } + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); return void 0; } else { if (!length(target)) { @@ -30427,13 +29566,14 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host, candidateIsFromPackageJsonField: false }; const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0)); - return createResolvedModuleWithFailedLookupLocations( + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName, resolved && resolved.value, (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path), failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state ); function tryResolve(extensions) { const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); @@ -30612,35 +29752,36 @@ function initFlowNode(node) { } var binder = createBinder(); function createBinder() { - let file; - let options; - let languageVersion; - let parent; - let container; - let thisParentContainer; - let blockScopeContainer; - let lastContainer; - let delayedTypeAliases; - let seenThisKeyword; - let currentFlow; - let currentBreakTarget; - let currentContinueTarget; - let currentReturnTarget; - let currentTrueTarget; - let currentFalseTarget; - let currentExceptionTarget; - let preSwitchCaseFlow; - let activeLabelList; - let hasExplicitReturn; - let emitFlags; - let inStrictMode; - let inAssignmentPattern = false; - let symbolCount = 0; - let Symbol12; - let classifiableNames; - const unreachableFlow = { flags: 1 /* Unreachable */ }; - const reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; - const bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + var file; + var options; + var languageVersion; + var parent; + var container; + var thisParentContainer; + var blockScopeContainer; + var lastContainer; + var delayedTypeAliases; + var seenThisKeyword; + var currentFlow; + var currentBreakTarget; + var currentContinueTarget; + var currentReturnTarget; + var currentTrueTarget; + var currentFalseTarget; + var currentExceptionTarget; + var preSwitchCaseFlow; + var activeLabelList; + var hasExplicitReturn; + var emitFlags; + var inStrictMode; + var inAssignmentPattern = false; + var symbolCount = 0; + var Symbol12; + var classifiableNames; + var unreachableFlow = { flags: 1 /* Unreachable */ }; + var reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; + var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + return bindSourceFile2; function createDiagnosticForNode2(node, message, arg0, arg1, arg2) { return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2); } @@ -30691,7 +29832,6 @@ function createBinder() { inAssignmentPattern = false; emitFlags = 0 /* None */; } - return bindSourceFile2; function bindInStrictMode(file2, opts) { if (getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { return true; @@ -33461,6 +32601,7 @@ var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => { SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback"; SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity"; + SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature"; SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback"; return SignatureCheckMode3; })(SignatureCheckMode || {}); @@ -34677,7 +33818,7 @@ var visitEachChildTable = { [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + nodeVisitor(node.expression, visitor, isExpression) ); }, // Clauses @@ -34762,24 +33903,6 @@ function extractSingleNode(nodes) { return singleOrUndefined(nodes); } -// src/compiler/sourcemap.ts -function isStringOrNull(x) { - return typeof x === "string" || x === null; -} -function isRawSourceMap(x) { - return x !== null && typeof x === "object" && x.version === 3 && typeof x.file === "string" && typeof x.mappings === "string" && isArray(x.sources) && every(x.sources, isString) && (x.sourceRoot === void 0 || x.sourceRoot === null || typeof x.sourceRoot === "string") && (x.sourcesContent === void 0 || x.sourcesContent === null || isArray(x.sourcesContent) && every(x.sourcesContent, isStringOrNull)) && (x.names === void 0 || x.names === null || isArray(x.names) && every(x.names, isString)); -} -function tryParseRawSourceMap(text) { - try { - const parsed = JSON.parse(text); - if (isRawSourceMap(parsed)) { - return parsed; - } - } catch (e) { - } - return void 0; -} - // src/compiler/transformers/jsx.ts var entities = new Map(Object.entries({ quot: 34, @@ -35038,54 +34161,8 @@ var entities = new Map(Object.entries({ })); // src/compiler/transformers/declarations.ts -function hasInternalAnnotation(range, currentSourceFile) { - const comment = currentSourceFile.text.substring(range.pos, range.end); - return stringContains(comment, "@internal"); -} -function isInternalDeclaration(node, currentSourceFile) { - const parseTreeNode = getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 166 /* Parameter */) { - const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); - const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0; - const text = currentSourceFile.text; - const commentRanges = previousSibling ? concatenate( - // to handle - // ... parameters, /** @internal */ - // public param: string - getTrailingCommentRanges(text, skipTrivia( - text, - previousSibling.end + 1, - /* stopAfterLineBreak */ - false, - /* stopAtComments */ - true - )), - getLeadingCommentRanges(text, node.pos) - ) : getTrailingCommentRanges(text, skipTrivia( - text, - node.pos, - /* stopAfterLineBreak */ - false, - /* stopAtComments */ - true - )); - return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile); - } - const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile); - return !!forEach(leadingCommentRanges, (range) => { - return hasInternalAnnotation(range, currentSourceFile); - }); -} var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */; -// src/compiler/transformer.ts -function noEmitSubstitution(_hint, node) { - return node; -} -function noEmitNotification(hint, node, callback) { - callback(hint, node); -} - // src/compiler/emitter.ts var brackets = createBracketsMap(); function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCanonicalFileName, checkSourceFilesBelongToPath) { @@ -35104,4989 +34181,328 @@ function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCa } return commonSourceDirectory; } -var createPrinterWithDefaults = memoize(() => createPrinter({})); -var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); -var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); -var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); -function createPrinter(printerOptions = {}, handlers = {}) { - const { - hasGlobalName, - onEmitNode = noEmitNotification, - isEmitNotificationEnabled, - substituteNode = noEmitSubstitution, - onBeforeEmitNode, - onAfterEmitNode, - onBeforeEmitNodeArray, - onAfterEmitNodeArray, - onBeforeEmitToken, - onAfterEmitToken - } = handlers; - const extendedDiagnostics = !!printerOptions.extendedDiagnostics; - const newLine = getNewLineCharacter(printerOptions); - const moduleKind = getEmitModuleKind(printerOptions); - const bundledHelpers = /* @__PURE__ */ new Map(); - let currentSourceFile; - let nodeIdToGeneratedName; - let nodeIdToGeneratedPrivateName; - let autoGeneratedIdToGeneratedName; - let generatedNames; - let formattedNameTempFlagsStack; - let formattedNameTempFlags; - let privateNameTempFlagsStack; - let privateNameTempFlags; - let tempFlagsStack; - let tempFlags; - let reservedNamesStack; - let reservedNames; - let reservedPrivateNamesStack; - let reservedPrivateNames; - let preserveSourceNewlines = printerOptions.preserveSourceNewlines; - let nextListElementPos; - let writer; - let ownWriter; - let write = writeBase; - let isOwnFileEmit; - const bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; - const relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; - const recordInternalSection = printerOptions.recordInternalSection; - let sourceFileTextPos = 0; - let sourceFileTextKind = "text" /* Text */; - let sourceMapsDisabled = true; - let sourceMapGenerator; - let sourceMapSource; - let sourceMapSourceIndex = -1; - let mostRecentlyAddedSourceMapSource; - let mostRecentlyAddedSourceMapSourceIndex = -1; - let containerPos = -1; - let containerEnd = -1; - let declarationListContainerEnd = -1; - let currentLineMap; - let detachedCommentsInfo; - let hasWrittenComment = false; - let commentsDisabled = !!printerOptions.removeComments; - let lastSubstitution; - let currentParenthesizerRule; - const { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); - const parenthesizer = factory.parenthesizer; - const typeArgumentParenthesizerRuleSelector = { - select: (index) => index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 +function createBracketsMap() { + const brackets2 = []; + brackets2[1024 /* Braces */] = ["{", "}"]; + brackets2[2048 /* Parenthesis */] = ["(", ")"]; + brackets2[4096 /* AngleBrackets */] = ["<", ">"]; + brackets2[8192 /* SquareBrackets */] = ["[", "]"]; + return brackets2; +} + +// src/compiler/watchUtilities.ts +function getWatchFactory(host, watchLogLevel, log2, getDetailWatchInfo2) { + setSysLog(watchLogLevel === 2 /* Verbose */ ? log2 : noop); + const plainInvokeFactory = { + watchFile: (file, callback, pollingInterval, options) => host.watchFile(file, callback, pollingInterval, options), + watchDirectory: (directory, callback, flags, options) => host.watchDirectory(directory, callback, (flags & 1 /* Recursive */) !== 0, options) }; - const emitBinaryExpression = createEmitBinaryExpression(); - reset(); + const triggerInvokingFactory = watchLogLevel !== 0 /* None */ ? { + watchFile: createTriggerLoggingAddWatch("watchFile"), + watchDirectory: createTriggerLoggingAddWatch("watchDirectory") + } : void 0; + const factory2 = watchLogLevel === 2 /* Verbose */ ? { + watchFile: createFileWatcherWithLogging, + watchDirectory: createDirectoryWatcherWithLogging + } : triggerInvokingFactory || plainInvokeFactory; + const excludeWatcherFactory = watchLogLevel === 2 /* Verbose */ ? createExcludeWatcherWithLogging : returnNoopFileWatcher; return { - // public API - printNode, - printList, - printFile, - printBundle, - // internal API - writeNode, - writeList, - writeFile: writeFile2, - writeBundle, - bundleFileInfo + watchFile: createExcludeHandlingAddWatch("watchFile"), + watchDirectory: createExcludeHandlingAddWatch("watchDirectory") }; - function printNode(hint, node, sourceFile) { - switch (hint) { - case 0 /* SourceFile */: - Debug.assert(isSourceFile(node), "Expected a SourceFile node."); - break; - case 2 /* IdentifierName */: - Debug.assert(isIdentifier(node), "Expected an Identifier node."); - break; - case 1 /* Expression */: - Debug.assert(isExpression(node), "Expected an Expression node."); - break; - } - switch (node.kind) { - case 308 /* SourceFile */: - return printFile(node); - case 309 /* Bundle */: - return printBundle(node); - case 310 /* UnparsedSource */: - return printUnparsedSource(node); - } - writeNode(hint, node, sourceFile, beginPrint()); - return endPrint(); - } - function printList(format, nodes, sourceFile) { - writeList(format, nodes, sourceFile, beginPrint()); - return endPrint(); - } - function printBundle(bundle) { - writeBundle( - bundle, - beginPrint(), - /*sourceMapEmitter*/ - void 0 - ); - return endPrint(); + function createExcludeHandlingAddWatch(key) { + return (file, cb, flags, options, detailInfo1, detailInfo2) => { + var _a2; + return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames(), ((_a2 = host.getCurrentDirectory) == null ? void 0 : _a2.call(host)) || "") ? factory2[key].call( + /*thisArgs*/ + void 0, + file, + cb, + flags, + options, + detailInfo1, + detailInfo2 + ) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2); + }; } - function printFile(sourceFile) { - writeFile2( - sourceFile, - beginPrint(), - /*sourceMapEmitter*/ - void 0 - ); - return endPrint(); + function useCaseSensitiveFileNames() { + return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames(); } - function printUnparsedSource(unparsed) { - writeUnparsedSource(unparsed, beginPrint()); - return endPrint(); + function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) { + log2(`ExcludeWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); + return { + close: () => log2(`ExcludeWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`) + }; } - function writeNode(hint, node, sourceFile, output) { - const previousWriter = writer; - setWriter( - output, - /*_sourceMapGenerator*/ - void 0 - ); - print(hint, node, sourceFile); - reset(); - writer = previousWriter; + function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { + log2(`FileWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); + const watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2); + return { + close: () => { + log2(`FileWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); + watcher.close(); + } + }; } - function writeList(format, nodes, sourceFile, output) { - const previousWriter = writer; - setWriter( - output, - /*_sourceMapGenerator*/ - void 0 - ); - if (sourceFile) { - setSourceFile(sourceFile); - } - emitList( - /*parentNode*/ + function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { + const watchInfo = `DirectoryWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; + log2(watchInfo); + const start = timestamp(); + const watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2); + const elapsed = timestamp() - start; + log2(`Elapsed:: ${elapsed}ms ${watchInfo}`); + return { + close: () => { + const watchInfo2 = `DirectoryWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; + log2(watchInfo2); + const start2 = timestamp(); + watcher.close(); + const elapsed2 = timestamp() - start2; + log2(`Elapsed:: ${elapsed2}ms ${watchInfo2}`); + } + }; + } + function createTriggerLoggingAddWatch(key) { + return (file, cb, flags, options, detailInfo1, detailInfo2) => plainInvokeFactory[key].call( + /*thisArgs*/ void 0, - nodes, - format + file, + (...args) => { + const triggerredInfo = `${key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"}:: Triggered with ${args[0]} ${args[1] !== void 0 ? args[1] : ""}:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; + log2(triggerredInfo); + const start = timestamp(); + cb.call( + /*thisArg*/ + void 0, + ...args + ); + const elapsed = timestamp() - start; + log2(`Elapsed:: ${elapsed}ms ${triggerredInfo}`); + }, + flags, + options, + detailInfo1, + detailInfo2 ); - reset(); - writer = previousWriter; } - function getTextPosWithWriteLine() { - return writer.getTextPosWithWriteLine ? writer.getTextPosWithWriteLine() : writer.getTextPos(); + function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo3) { + return `WatchInfo: ${file} ${flags} ${JSON.stringify(options)} ${getDetailWatchInfo3 ? getDetailWatchInfo3(detailInfo1, detailInfo2) : detailInfo2 === void 0 ? detailInfo1 : `${detailInfo1} ${detailInfo2}`}`; } - function updateOrPushBundleFileTextLike(pos, end, kind) { - const last2 = lastOrUndefined(bundleFileInfo.sections); - if (last2 && last2.kind === kind) { - last2.end = end; - } else { - bundleFileInfo.sections.push({ pos, end, kind }); +} +function getFallbackOptions(options) { + const fallbackPolling = options == null ? void 0 : options.fallbackPolling; + return { + watchFile: fallbackPolling !== void 0 ? fallbackPolling : 1 /* PriorityPollingInterval */ + }; +} +function closeFileWatcherOf(objWithWatcher) { + objWithWatcher.watcher.close(); +} + +// src/compiler/program.ts +function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) { + let commonPathComponents; + const failed = forEach(fileNames, (sourceFile) => { + const sourcePathComponents = getNormalizedPathComponents(sourceFile, currentDirectory); + sourcePathComponents.pop(); + if (!commonPathComponents) { + commonPathComponents = sourcePathComponents; + return; } - } - function recordBundleFileInternalSectionStart(node) { - if (recordInternalSection && bundleFileInfo && currentSourceFile && (isDeclaration(node) || isVariableStatement(node)) && isInternalDeclaration(node, currentSourceFile) && sourceFileTextKind !== "internal" /* Internal */) { - const prevSourceFileTextKind = sourceFileTextKind; - recordBundleFileTextLikeSection(writer.getTextPos()); - sourceFileTextPos = getTextPosWithWriteLine(); - sourceFileTextKind = "internal" /* Internal */; - return prevSourceFileTextKind; + const n = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (let i = 0; i < n; i++) { + if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { + if (i === 0) { + return true; + } + commonPathComponents.length = i; + break; + } } - return void 0; - } - function recordBundleFileInternalSectionEnd(prevSourceFileTextKind) { - if (prevSourceFileTextKind) { - recordBundleFileTextLikeSection(writer.getTextPos()); - sourceFileTextPos = getTextPosWithWriteLine(); - sourceFileTextKind = prevSourceFileTextKind; + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; } + }); + if (failed) { + return ""; } - function recordBundleFileTextLikeSection(end) { - if (sourceFileTextPos < end) { - updateOrPushBundleFileTextLike(sourceFileTextPos, end, sourceFileTextKind); - return true; - } - return false; + if (!commonPathComponents) { + return currentDirectory; } - function writeBundle(bundle, output, sourceMapGenerator2) { - isOwnFileEmit = false; - const previousWriter = writer; - setWriter(output, sourceMapGenerator2); - emitShebangIfNeeded(bundle); - emitPrologueDirectivesIfNeeded(bundle); - emitHelpers(bundle); - emitSyntheticTripleSlashReferencesIfNeeded(bundle); - for (const prepend of bundle.prepends) { - writeLine(); - const pos = writer.getTextPos(); - const savedSections = bundleFileInfo && bundleFileInfo.sections; - if (savedSections) - bundleFileInfo.sections = []; - print( - 4 /* Unspecified */, - prepend, - /*sourceFile*/ - void 0 - ); - if (bundleFileInfo) { - const newSections = bundleFileInfo.sections; - bundleFileInfo.sections = savedSections; - if (prepend.oldFileOfCurrentEmit) - bundleFileInfo.sections.push(...newSections); - else { - newSections.forEach((section) => Debug.assert(isBundleFileTextLike(section))); - bundleFileInfo.sections.push({ - pos, - end: writer.getTextPos(), - kind: "prepend" /* Prepend */, - data: relativeToBuildInfo(prepend.fileName), - texts: newSections + return getPathFromPathComponents(commonPathComponents); +} +var plainJSErrors = /* @__PURE__ */ new Set([ + // binder errors + Diagnostics.Cannot_redeclare_block_scoped_variable_0.code, + Diagnostics.A_module_cannot_have_multiple_default_exports.code, + Diagnostics.Another_export_default_is_here.code, + Diagnostics.The_first_export_default_is_here.code, + Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code, + Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code, + Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code, + Diagnostics.constructor_is_a_reserved_word.code, + Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode.code, + Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code, + Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code, + Diagnostics.Invalid_use_of_0_in_strict_mode.code, + Diagnostics.A_label_is_not_allowed_here.code, + Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code, + Diagnostics.with_statements_are_not_allowed_in_strict_mode.code, + // grammar errors + Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code, + Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code, + Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code, + Diagnostics.A_class_member_cannot_have_the_0_keyword.code, + Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code, + Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code, + Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, + Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, + Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code, + Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code, + Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code, + Diagnostics.A_destructuring_declaration_must_have_an_initializer.code, + Diagnostics.A_get_accessor_cannot_have_parameters.code, + Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code, + Diagnostics.A_rest_element_cannot_have_a_property_name.code, + Diagnostics.A_rest_element_cannot_have_an_initializer.code, + Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code, + Diagnostics.A_rest_parameter_cannot_have_an_initializer.code, + Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code, + Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code, + Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code, + Diagnostics.A_set_accessor_cannot_have_rest_parameter.code, + Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code, + Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code, + Diagnostics.An_export_declaration_cannot_have_modifiers.code, + Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code, + Diagnostics.An_import_declaration_cannot_have_modifiers.code, + Diagnostics.An_object_member_cannot_be_declared_optional.code, + Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code, + Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code, + Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code, + Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code, + Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code, + Diagnostics.Classes_can_only_extend_a_single_class.code, + Diagnostics.Classes_may_not_have_a_field_named_constructor.code, + Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code, + Diagnostics.Duplicate_label_0.code, + Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code, + Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code, + Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code, + Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code, + Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code, + Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code, + Diagnostics.Jump_target_cannot_cross_function_boundary.code, + Diagnostics.Line_terminator_not_permitted_before_arrow.code, + Diagnostics.Modifiers_cannot_appear_here.code, + Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code, + Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code, + Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code, + Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, + Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code, + Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code, + Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code, + Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code, + Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code, + Diagnostics.Trailing_comma_not_allowed.code, + Diagnostics.Variable_declaration_list_cannot_be_empty.code, + Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code, + Diagnostics._0_expected.code, + Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code, + Diagnostics._0_list_cannot_be_empty.code, + Diagnostics._0_modifier_already_seen.code, + Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code, + Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code, + Diagnostics._0_modifier_cannot_appear_on_a_parameter.code, + Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code, + Diagnostics._0_modifier_cannot_be_used_here.code, + Diagnostics._0_modifier_must_precede_1_modifier.code, + Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code, + Diagnostics.const_declarations_must_be_initialized.code, + Diagnostics.extends_clause_already_seen.code, + Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code, + Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code, + Diagnostics.Class_constructor_may_not_be_a_generator.code, + Diagnostics.Class_constructor_may_not_be_an_accessor.code, + Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code +]); + +// src/compiler/builderState.ts +var BuilderState; +((BuilderState2) => { + function createManyToManyPathMap() { + function create2(forward, reverse, deleted) { + const map2 = { + getKeys: (v) => reverse.get(v), + getValues: (k) => forward.get(k), + keys: () => forward.keys(), + deleteKey: (k) => { + (deleted || (deleted = /* @__PURE__ */ new Set())).add(k); + const set = forward.get(k); + if (!set) { + return false; + } + set.forEach((v) => deleteFromMultimap(reverse, v, k)); + forward.delete(k); + return true; + }, + set: (k, vSet) => { + deleted == null ? void 0 : deleted.delete(k); + const existingVSet = forward.get(k); + forward.set(k, vSet); + existingVSet == null ? void 0 : existingVSet.forEach((v) => { + if (!vSet.has(v)) { + deleteFromMultimap(reverse, v, k); + } }); + vSet.forEach((v) => { + if (!(existingVSet == null ? void 0 : existingVSet.has(v))) { + addToMultimap(reverse, v, k); + } + }); + return map2; } - } - } - sourceFileTextPos = getTextPosWithWriteLine(); - for (const sourceFile of bundle.sourceFiles) { - print(0 /* SourceFile */, sourceFile, sourceFile); - } - if (bundleFileInfo && bundle.sourceFiles.length) { - const end = writer.getTextPos(); - if (recordBundleFileTextLikeSection(end)) { - const prologues = getPrologueDirectivesFromBundledSourceFiles(bundle); - if (prologues) { - if (!bundleFileInfo.sources) - bundleFileInfo.sources = {}; - bundleFileInfo.sources.prologues = prologues; - } - const helpers = getHelpersFromBundledSourceFiles(bundle); - if (helpers) { - if (!bundleFileInfo.sources) - bundleFileInfo.sources = {}; - bundleFileInfo.sources.helpers = helpers; - } - } + }; + return map2; } - reset(); - writer = previousWriter; - } - function writeUnparsedSource(unparsed, output) { - const previousWriter = writer; - setWriter( - output, - /*_sourceMapGenerator*/ - void 0 - ); - print( - 4 /* Unspecified */, - unparsed, - /*sourceFile*/ + return create2( + /* @__PURE__ */ new Map(), + /* @__PURE__ */ new Map(), + /*deleted*/ void 0 ); - reset(); - writer = previousWriter; - } - function writeFile2(sourceFile, output, sourceMapGenerator2) { - isOwnFileEmit = true; - const previousWriter = writer; - setWriter(output, sourceMapGenerator2); - emitShebangIfNeeded(sourceFile); - emitPrologueDirectivesIfNeeded(sourceFile); - print(0 /* SourceFile */, sourceFile, sourceFile); - reset(); - writer = previousWriter; - } - function beginPrint() { - return ownWriter || (ownWriter = createTextWriter(newLine)); - } - function endPrint() { - const text = ownWriter.getText(); - ownWriter.clear(); - return text; } - function print(hint, node, sourceFile) { - if (sourceFile) { - setSourceFile(sourceFile); + BuilderState2.createManyToManyPathMap = createManyToManyPathMap; + function addToMultimap(map2, k, v) { + let set = map2.get(k); + if (!set) { + set = /* @__PURE__ */ new Set(); + map2.set(k, set); } - pipelineEmit( - hint, - node, - /*parenthesizerRule*/ - void 0 - ); - } - function setSourceFile(sourceFile) { - currentSourceFile = sourceFile; - currentLineMap = void 0; - detachedCommentsInfo = void 0; - if (sourceFile) { - setSourceMapSource(sourceFile); - } - } - function setWriter(_writer, _sourceMapGenerator) { - if (_writer && printerOptions.omitTrailingSemicolon) { - _writer = getTrailingSemicolonDeferringWriter(_writer); - } - writer = _writer; - sourceMapGenerator = _sourceMapGenerator; - sourceMapsDisabled = !writer || !sourceMapGenerator; - } - function reset() { - nodeIdToGeneratedName = []; - nodeIdToGeneratedPrivateName = []; - autoGeneratedIdToGeneratedName = []; - generatedNames = /* @__PURE__ */ new Set(); - formattedNameTempFlagsStack = []; - formattedNameTempFlags = /* @__PURE__ */ new Map(); - privateNameTempFlagsStack = []; - privateNameTempFlags = TempFlags.Auto; - tempFlagsStack = []; - tempFlags = TempFlags.Auto; - reservedNamesStack = []; - reservedNames = void 0; - reservedPrivateNamesStack = []; - reservedPrivateNames = void 0; - currentSourceFile = void 0; - currentLineMap = void 0; - detachedCommentsInfo = void 0; - setWriter( - /*output*/ - void 0, - /*_sourceMapGenerator*/ - void 0 - ); - } - function getCurrentLineMap() { - return currentLineMap || (currentLineMap = getLineStarts(Debug.checkDefined(currentSourceFile))); - } - function emit(node, parenthesizerRule) { - if (node === void 0) - return; - const prevSourceFileTextKind = recordBundleFileInternalSectionStart(node); - pipelineEmit(4 /* Unspecified */, node, parenthesizerRule); - recordBundleFileInternalSectionEnd(prevSourceFileTextKind); - } - function emitIdentifierName(node) { - if (node === void 0) - return; - pipelineEmit( - 2 /* IdentifierName */, - node, - /*parenthesizerRule*/ - void 0 - ); - } - function emitExpression(node, parenthesizerRule) { - if (node === void 0) - return; - pipelineEmit(1 /* Expression */, node, parenthesizerRule); - } - function emitJsxAttributeValue(node) { - pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node); + set.add(v); } - function beforeEmitNode(node) { - if (preserveSourceNewlines && getInternalEmitFlags(node) & 4 /* IgnoreSourceNewlines */) { - preserveSourceNewlines = false; + function deleteFromMultimap(map2, k, v) { + const set = map2.get(k); + if (set == null ? void 0 : set.delete(v)) { + if (!set.size) { + map2.delete(k); + } + return true; } + return false; } - function afterEmitNode(savedPreserveSourceNewlines) { - preserveSourceNewlines = savedPreserveSourceNewlines; - } - function pipelineEmit(emitHint, node, parenthesizerRule) { - currentParenthesizerRule = parenthesizerRule; - const pipelinePhase = getPipelinePhase(0 /* Notification */, emitHint, node); - pipelinePhase(emitHint, node); - currentParenthesizerRule = void 0; - } - function shouldEmitComments(node) { - return !commentsDisabled && !isSourceFile(node); - } - function shouldEmitSourceMaps(node) { - return !sourceMapsDisabled && !isSourceFile(node) && !isInJsonFile(node) && !isUnparsedSource(node) && !isUnparsedPrepend(node); - } - function getPipelinePhase(phase, emitHint, node) { - switch (phase) { - case 0 /* Notification */: - if (onEmitNode !== noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) { - return pipelineEmitWithNotification; - } - case 1 /* Substitution */: - if (substituteNode !== noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) { - if (currentParenthesizerRule) { - lastSubstitution = currentParenthesizerRule(lastSubstitution); - } - return pipelineEmitWithSubstitution; - } - case 2 /* Comments */: - if (shouldEmitComments(node)) { - return pipelineEmitWithComments; - } - case 3 /* SourceMaps */: - if (shouldEmitSourceMaps(node)) { - return pipelineEmitWithSourceMaps; - } - case 4 /* Emit */: - return pipelineEmitWithHint; - default: - return Debug.assertNever(phase); - } + function getReferencedFilesFromImportedModuleSymbol(symbol) { + return mapDefined(symbol.declarations, (declaration) => { + var _a2; + return (_a2 = getSourceFileOfNode(declaration)) == null ? void 0 : _a2.resolvedPath; + }); } - function getNextPipelinePhase(currentPhase, emitHint, node) { - return getPipelinePhase(currentPhase + 1, emitHint, node); + function getReferencedFilesFromImportLiteral(checker, importName) { + const symbol = checker.getSymbolAtLocation(importName); + return symbol && getReferencedFilesFromImportedModuleSymbol(symbol); } - function pipelineEmitWithNotification(hint, node) { - const pipelinePhase = getNextPipelinePhase(0 /* Notification */, hint, node); - onEmitNode(hint, node, pipelinePhase); - } - function pipelineEmitWithHint(hint, node) { - onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); - if (preserveSourceNewlines) { - const savedPreserveSourceNewlines = preserveSourceNewlines; - beforeEmitNode(node); - pipelineEmitWithHintWorker(hint, node); - afterEmitNode(savedPreserveSourceNewlines); - } else { - pipelineEmitWithHintWorker(hint, node); - } - onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); - currentParenthesizerRule = void 0; - } - function pipelineEmitWithHintWorker(hint, node, allowSnippets = true) { - if (allowSnippets) { - const snippet = getSnippetElement(node); - if (snippet) { - return emitSnippetNode(hint, node, snippet); - } - } - if (hint === 0 /* SourceFile */) - return emitSourceFile(cast(node, isSourceFile)); - if (hint === 2 /* IdentifierName */) - return emitIdentifier(cast(node, isIdentifier)); - if (hint === 6 /* JsxAttributeValue */) - return emitLiteral( - cast(node, isStringLiteral), - /*jsxAttributeEscape*/ - true - ); - if (hint === 3 /* MappedTypeParameter */) - return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration)); - if (hint === 5 /* EmbeddedStatement */) { - Debug.assertNode(node, isEmptyStatement); - return emitEmptyStatement( - /*isEmbeddedStatement*/ - true - ); - } - if (hint === 4 /* Unspecified */) { - switch (node.kind) { - case 15 /* TemplateHead */: - case 16 /* TemplateMiddle */: - case 17 /* TemplateTail */: - return emitLiteral( - node, - /*jsxAttributeEscape*/ - false - ); - case 79 /* Identifier */: - return emitIdentifier(node); - case 80 /* PrivateIdentifier */: - return emitPrivateIdentifier(node); - case 163 /* QualifiedName */: - return emitQualifiedName(node); - case 164 /* ComputedPropertyName */: - return emitComputedPropertyName(node); - case 165 /* TypeParameter */: - return emitTypeParameter(node); - case 166 /* Parameter */: - return emitParameter(node); - case 167 /* Decorator */: - return emitDecorator(node); - case 168 /* PropertySignature */: - return emitPropertySignature(node); - case 169 /* PropertyDeclaration */: - return emitPropertyDeclaration(node); - case 170 /* MethodSignature */: - return emitMethodSignature(node); - case 171 /* MethodDeclaration */: - return emitMethodDeclaration(node); - case 172 /* ClassStaticBlockDeclaration */: - return emitClassStaticBlockDeclaration(node); - case 173 /* Constructor */: - return emitConstructor(node); - case 174 /* GetAccessor */: - case 175 /* SetAccessor */: - return emitAccessorDeclaration(node); - case 176 /* CallSignature */: - return emitCallSignature(node); - case 177 /* ConstructSignature */: - return emitConstructSignature(node); - case 178 /* IndexSignature */: - return emitIndexSignature(node); - case 179 /* TypePredicate */: - return emitTypePredicate(node); - case 180 /* TypeReference */: - return emitTypeReference(node); - case 181 /* FunctionType */: - return emitFunctionType(node); - case 182 /* ConstructorType */: - return emitConstructorType(node); - case 183 /* TypeQuery */: - return emitTypeQuery(node); - case 184 /* TypeLiteral */: - return emitTypeLiteral(node); - case 185 /* ArrayType */: - return emitArrayType(node); - case 186 /* TupleType */: - return emitTupleType(node); - case 187 /* OptionalType */: - return emitOptionalType(node); - case 189 /* UnionType */: - return emitUnionType(node); - case 190 /* IntersectionType */: - return emitIntersectionType(node); - case 191 /* ConditionalType */: - return emitConditionalType(node); - case 192 /* InferType */: - return emitInferType(node); - case 193 /* ParenthesizedType */: - return emitParenthesizedType(node); - case 230 /* ExpressionWithTypeArguments */: - return emitExpressionWithTypeArguments(node); - case 194 /* ThisType */: - return emitThisType(); - case 195 /* TypeOperator */: - return emitTypeOperator(node); - case 196 /* IndexedAccessType */: - return emitIndexedAccessType(node); - case 197 /* MappedType */: - return emitMappedType(node); - case 198 /* LiteralType */: - return emitLiteralType(node); - case 199 /* NamedTupleMember */: - return emitNamedTupleMember(node); - case 200 /* TemplateLiteralType */: - return emitTemplateType(node); - case 201 /* TemplateLiteralTypeSpan */: - return emitTemplateTypeSpan(node); - case 202 /* ImportType */: - return emitImportTypeNode(node); - case 203 /* ObjectBindingPattern */: - return emitObjectBindingPattern(node); - case 204 /* ArrayBindingPattern */: - return emitArrayBindingPattern(node); - case 205 /* BindingElement */: - return emitBindingElement(node); - case 236 /* TemplateSpan */: - return emitTemplateSpan(node); - case 237 /* SemicolonClassElement */: - return emitSemicolonClassElement(); - case 238 /* Block */: - return emitBlock(node); - case 240 /* VariableStatement */: - return emitVariableStatement(node); - case 239 /* EmptyStatement */: - return emitEmptyStatement( - /*isEmbeddedStatement*/ - false - ); - case 241 /* ExpressionStatement */: - return emitExpressionStatement(node); - case 242 /* IfStatement */: - return emitIfStatement(node); - case 243 /* DoStatement */: - return emitDoStatement(node); - case 244 /* WhileStatement */: - return emitWhileStatement(node); - case 245 /* ForStatement */: - return emitForStatement(node); - case 246 /* ForInStatement */: - return emitForInStatement(node); - case 247 /* ForOfStatement */: - return emitForOfStatement(node); - case 248 /* ContinueStatement */: - return emitContinueStatement(node); - case 249 /* BreakStatement */: - return emitBreakStatement(node); - case 250 /* ReturnStatement */: - return emitReturnStatement(node); - case 251 /* WithStatement */: - return emitWithStatement(node); - case 252 /* SwitchStatement */: - return emitSwitchStatement(node); - case 253 /* LabeledStatement */: - return emitLabeledStatement(node); - case 254 /* ThrowStatement */: - return emitThrowStatement(node); - case 255 /* TryStatement */: - return emitTryStatement(node); - case 256 /* DebuggerStatement */: - return emitDebuggerStatement(node); - case 257 /* VariableDeclaration */: - return emitVariableDeclaration(node); - case 258 /* VariableDeclarationList */: - return emitVariableDeclarationList(node); - case 259 /* FunctionDeclaration */: - return emitFunctionDeclaration(node); - case 260 /* ClassDeclaration */: - return emitClassDeclaration(node); - case 261 /* InterfaceDeclaration */: - return emitInterfaceDeclaration(node); - case 262 /* TypeAliasDeclaration */: - return emitTypeAliasDeclaration(node); - case 263 /* EnumDeclaration */: - return emitEnumDeclaration(node); - case 264 /* ModuleDeclaration */: - return emitModuleDeclaration(node); - case 265 /* ModuleBlock */: - return emitModuleBlock(node); - case 266 /* CaseBlock */: - return emitCaseBlock(node); - case 267 /* NamespaceExportDeclaration */: - return emitNamespaceExportDeclaration(node); - case 268 /* ImportEqualsDeclaration */: - return emitImportEqualsDeclaration(node); - case 269 /* ImportDeclaration */: - return emitImportDeclaration(node); - case 270 /* ImportClause */: - return emitImportClause(node); - case 271 /* NamespaceImport */: - return emitNamespaceImport(node); - case 277 /* NamespaceExport */: - return emitNamespaceExport(node); - case 272 /* NamedImports */: - return emitNamedImports(node); - case 273 /* ImportSpecifier */: - return emitImportSpecifier(node); - case 274 /* ExportAssignment */: - return emitExportAssignment(node); - case 275 /* ExportDeclaration */: - return emitExportDeclaration(node); - case 276 /* NamedExports */: - return emitNamedExports(node); - case 278 /* ExportSpecifier */: - return emitExportSpecifier(node); - case 296 /* AssertClause */: - return emitAssertClause(node); - case 297 /* AssertEntry */: - return emitAssertEntry(node); - case 279 /* MissingDeclaration */: - return; - case 280 /* ExternalModuleReference */: - return emitExternalModuleReference(node); - case 11 /* JsxText */: - return emitJsxText(node); - case 283 /* JsxOpeningElement */: - case 286 /* JsxOpeningFragment */: - return emitJsxOpeningElementOrFragment(node); - case 284 /* JsxClosingElement */: - case 287 /* JsxClosingFragment */: - return emitJsxClosingElementOrFragment(node); - case 288 /* JsxAttribute */: - return emitJsxAttribute(node); - case 289 /* JsxAttributes */: - return emitJsxAttributes(node); - case 290 /* JsxSpreadAttribute */: - return emitJsxSpreadAttribute(node); - case 291 /* JsxExpression */: - return emitJsxExpression(node); - case 292 /* CaseClause */: - return emitCaseClause(node); - case 293 /* DefaultClause */: - return emitDefaultClause(node); - case 294 /* HeritageClause */: - return emitHeritageClause(node); - case 295 /* CatchClause */: - return emitCatchClause(node); - case 299 /* PropertyAssignment */: - return emitPropertyAssignment(node); - case 300 /* ShorthandPropertyAssignment */: - return emitShorthandPropertyAssignment(node); - case 301 /* SpreadAssignment */: - return emitSpreadAssignment(node); - case 302 /* EnumMember */: - return emitEnumMember(node); - case 303 /* UnparsedPrologue */: - return writeUnparsedNode(node); - case 310 /* UnparsedSource */: - case 304 /* UnparsedPrepend */: - return emitUnparsedSourceOrPrepend(node); - case 305 /* UnparsedText */: - case 306 /* UnparsedInternalText */: - return emitUnparsedTextLike(node); - case 307 /* UnparsedSyntheticReference */: - return emitUnparsedSyntheticReference(node); - case 308 /* SourceFile */: - return emitSourceFile(node); - case 309 /* Bundle */: - return Debug.fail("Bundles should be printed using printBundle"); - case 311 /* InputFiles */: - return Debug.fail("InputFiles should not be printed"); - case 312 /* JSDocTypeExpression */: - return emitJSDocTypeExpression(node); - case 313 /* JSDocNameReference */: - return emitJSDocNameReference(node); - case 315 /* JSDocAllType */: - return writePunctuation("*"); - case 316 /* JSDocUnknownType */: - return writePunctuation("?"); - case 317 /* JSDocNullableType */: - return emitJSDocNullableType(node); - case 318 /* JSDocNonNullableType */: - return emitJSDocNonNullableType(node); - case 319 /* JSDocOptionalType */: - return emitJSDocOptionalType(node); - case 320 /* JSDocFunctionType */: - return emitJSDocFunctionType(node); - case 188 /* RestType */: - case 321 /* JSDocVariadicType */: - return emitRestOrJSDocVariadicType(node); - case 322 /* JSDocNamepathType */: - return; - case 323 /* JSDoc */: - return emitJSDoc(node); - case 325 /* JSDocTypeLiteral */: - return emitJSDocTypeLiteral(node); - case 326 /* JSDocSignature */: - return emitJSDocSignature(node); - case 330 /* JSDocTag */: - case 335 /* JSDocClassTag */: - case 340 /* JSDocOverrideTag */: - return emitJSDocSimpleTag(node); - case 331 /* JSDocAugmentsTag */: - case 332 /* JSDocImplementsTag */: - return emitJSDocHeritageTag(node); - case 333 /* JSDocAuthorTag */: - case 334 /* JSDocDeprecatedTag */: - return; - case 336 /* JSDocPublicTag */: - case 337 /* JSDocPrivateTag */: - case 338 /* JSDocProtectedTag */: - case 339 /* JSDocReadonlyTag */: - return; - case 341 /* JSDocCallbackTag */: - return emitJSDocCallbackTag(node); - case 342 /* JSDocOverloadTag */: - return emitJSDocOverloadTag(node); - case 344 /* JSDocParameterTag */: - case 351 /* JSDocPropertyTag */: - return emitJSDocPropertyLikeTag(node); - case 343 /* JSDocEnumTag */: - case 345 /* JSDocReturnTag */: - case 346 /* JSDocThisTag */: - case 347 /* JSDocTypeTag */: - case 352 /* JSDocThrowsTag */: - case 353 /* JSDocSatisfiesTag */: - return emitJSDocSimpleTypedTag(node); - case 348 /* JSDocTemplateTag */: - return emitJSDocTemplateTag(node); - case 349 /* JSDocTypedefTag */: - return emitJSDocTypedefTag(node); - case 350 /* JSDocSeeTag */: - return emitJSDocSeeTag(node); - case 355 /* NotEmittedStatement */: - case 359 /* EndOfDeclarationMarker */: - case 358 /* MergeDeclarationMarker */: - return; - } - if (isExpression(node)) { - hint = 1 /* Expression */; - if (substituteNode !== noEmitSubstitution) { - const substitute = substituteNode(hint, node) || node; - if (substitute !== node) { - node = substitute; - if (currentParenthesizerRule) { - node = currentParenthesizerRule(node); - } - } - } - } - } - if (hint === 1 /* Expression */) { - switch (node.kind) { - case 8 /* NumericLiteral */: - case 9 /* BigIntLiteral */: - return emitNumericOrBigIntLiteral(node); - case 10 /* StringLiteral */: - case 13 /* RegularExpressionLiteral */: - case 14 /* NoSubstitutionTemplateLiteral */: - return emitLiteral( - node, - /*jsxAttributeEscape*/ - false - ); - case 79 /* Identifier */: - return emitIdentifier(node); - case 80 /* PrivateIdentifier */: - return emitPrivateIdentifier(node); - case 206 /* ArrayLiteralExpression */: - return emitArrayLiteralExpression(node); - case 207 /* ObjectLiteralExpression */: - return emitObjectLiteralExpression(node); - case 208 /* PropertyAccessExpression */: - return emitPropertyAccessExpression(node); - case 209 /* ElementAccessExpression */: - return emitElementAccessExpression(node); - case 210 /* CallExpression */: - return emitCallExpression(node); - case 211 /* NewExpression */: - return emitNewExpression(node); - case 212 /* TaggedTemplateExpression */: - return emitTaggedTemplateExpression(node); - case 213 /* TypeAssertionExpression */: - return emitTypeAssertionExpression(node); - case 214 /* ParenthesizedExpression */: - return emitParenthesizedExpression(node); - case 215 /* FunctionExpression */: - return emitFunctionExpression(node); - case 216 /* ArrowFunction */: - return emitArrowFunction(node); - case 217 /* DeleteExpression */: - return emitDeleteExpression(node); - case 218 /* TypeOfExpression */: - return emitTypeOfExpression(node); - case 219 /* VoidExpression */: - return emitVoidExpression(node); - case 220 /* AwaitExpression */: - return emitAwaitExpression(node); - case 221 /* PrefixUnaryExpression */: - return emitPrefixUnaryExpression(node); - case 222 /* PostfixUnaryExpression */: - return emitPostfixUnaryExpression(node); - case 223 /* BinaryExpression */: - return emitBinaryExpression(node); - case 224 /* ConditionalExpression */: - return emitConditionalExpression(node); - case 225 /* TemplateExpression */: - return emitTemplateExpression(node); - case 226 /* YieldExpression */: - return emitYieldExpression(node); - case 227 /* SpreadElement */: - return emitSpreadElement(node); - case 228 /* ClassExpression */: - return emitClassExpression(node); - case 229 /* OmittedExpression */: - return; - case 231 /* AsExpression */: - return emitAsExpression(node); - case 232 /* NonNullExpression */: - return emitNonNullExpression(node); - case 230 /* ExpressionWithTypeArguments */: - return emitExpressionWithTypeArguments(node); - case 235 /* SatisfiesExpression */: - return emitSatisfiesExpression(node); - case 233 /* MetaProperty */: - return emitMetaProperty(node); - case 234 /* SyntheticExpression */: - return Debug.fail("SyntheticExpression should never be printed."); - case 279 /* MissingDeclaration */: - return; - case 281 /* JsxElement */: - return emitJsxElement(node); - case 282 /* JsxSelfClosingElement */: - return emitJsxSelfClosingElement(node); - case 285 /* JsxFragment */: - return emitJsxFragment(node); - case 354 /* SyntaxList */: - return Debug.fail("SyntaxList should not be printed"); - case 355 /* NotEmittedStatement */: - return; - case 356 /* PartiallyEmittedExpression */: - return emitPartiallyEmittedExpression(node); - case 357 /* CommaListExpression */: - return emitCommaList(node); - case 358 /* MergeDeclarationMarker */: - case 359 /* EndOfDeclarationMarker */: - return; - case 360 /* SyntheticReferenceExpression */: - return Debug.fail("SyntheticReferenceExpression should not be printed"); - } - } - if (isKeyword(node.kind)) - return writeTokenNode(node, writeKeyword); - if (isTokenKind(node.kind)) - return writeTokenNode(node, writePunctuation); - Debug.fail(`Unhandled SyntaxKind: ${Debug.formatSyntaxKind(node.kind)}.`); - } - function emitMappedTypeParameter(node) { - emit(node.name); - writeSpace(); - writeKeyword("in"); - writeSpace(); - emit(node.constraint); - } - function pipelineEmitWithSubstitution(hint, node) { - const pipelinePhase = getNextPipelinePhase(1 /* Substitution */, hint, node); - Debug.assertIsDefined(lastSubstitution); - node = lastSubstitution; - lastSubstitution = void 0; - pipelinePhase(hint, node); - } - function getHelpersFromBundledSourceFiles(bundle) { - let result; - if (moduleKind === 0 /* None */ || printerOptions.noEmitHelpers) { - return void 0; - } - const bundledHelpers2 = /* @__PURE__ */ new Map(); - for (const sourceFile of bundle.sourceFiles) { - const shouldSkip = getExternalHelpersModuleName(sourceFile) !== void 0; - const helpers = getSortedEmitHelpers(sourceFile); - if (!helpers) - continue; - for (const helper of helpers) { - if (!helper.scoped && !shouldSkip && !bundledHelpers2.get(helper.name)) { - bundledHelpers2.set(helper.name, true); - (result || (result = [])).push(helper.name); - } - } - } - return result; - } - function emitHelpers(node) { - let helpersEmitted = false; - const bundle = node.kind === 309 /* Bundle */ ? node : void 0; - if (bundle && moduleKind === 0 /* None */) { - return; - } - const numPrepends = bundle ? bundle.prepends.length : 0; - const numNodes = bundle ? bundle.sourceFiles.length + numPrepends : 1; - for (let i = 0; i < numNodes; i++) { - const currentNode = bundle ? i < numPrepends ? bundle.prepends[i] : bundle.sourceFiles[i - numPrepends] : node; - const sourceFile = isSourceFile(currentNode) ? currentNode : isUnparsedSource(currentNode) ? void 0 : currentSourceFile; - const shouldSkip = printerOptions.noEmitHelpers || !!sourceFile && hasRecordedExternalHelpers(sourceFile); - const shouldBundle = (isSourceFile(currentNode) || isUnparsedSource(currentNode)) && !isOwnFileEmit; - const helpers = isUnparsedSource(currentNode) ? currentNode.helpers : getSortedEmitHelpers(currentNode); - if (helpers) { - for (const helper of helpers) { - if (!helper.scoped) { - if (shouldSkip) - continue; - if (shouldBundle) { - if (bundledHelpers.get(helper.name)) { - continue; - } - bundledHelpers.set(helper.name, true); - } - } else if (bundle) { - continue; - } - const pos = getTextPosWithWriteLine(); - if (typeof helper.text === "string") { - writeLines(helper.text); - } else { - writeLines(helper.text(makeFileLevelOptimisticUniqueName)); - } - if (bundleFileInfo) - bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "emitHelpers" /* EmitHelpers */, data: helper.name }); - helpersEmitted = true; - } - } - } - return helpersEmitted; - } - function getSortedEmitHelpers(node) { - const helpers = getEmitHelpers(node); - return helpers && stableSort(helpers, compareEmitHelpers); - } - function emitNumericOrBigIntLiteral(node) { - emitLiteral( - node, - /*jsxAttributeEscape*/ - false - ); - } - function emitLiteral(node, jsxAttributeEscape) { - const text = getLiteralTextOfNode(node, printerOptions.neverAsciiEscape, jsxAttributeEscape); - if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind))) { - writeLiteral(text); - } else { - writeStringLiteral(text); - } - } - function emitUnparsedSourceOrPrepend(unparsed) { - for (const text of unparsed.texts) { - writeLine(); - emit(text); - } - } - function writeUnparsedNode(unparsed) { - writer.rawWrite(unparsed.parent.text.substring(unparsed.pos, unparsed.end)); - } - function emitUnparsedTextLike(unparsed) { - const pos = getTextPosWithWriteLine(); - writeUnparsedNode(unparsed); - if (bundleFileInfo) { - updateOrPushBundleFileTextLike( - pos, - writer.getTextPos(), - unparsed.kind === 305 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */ - ); - } - } - function emitUnparsedSyntheticReference(unparsed) { - const pos = getTextPosWithWriteLine(); - writeUnparsedNode(unparsed); - if (bundleFileInfo) { - const section = clone(unparsed.section); - section.pos = pos; - section.end = writer.getTextPos(); - bundleFileInfo.sections.push(section); - } - } - function emitSnippetNode(hint, node, snippet) { - switch (snippet.kind) { - case 1 /* Placeholder */: - emitPlaceholder(hint, node, snippet); - break; - case 0 /* TabStop */: - emitTabStop(hint, node, snippet); - break; - } - } - function emitPlaceholder(hint, node, snippet) { - nonEscapingWrite(`\${${snippet.order}:`); - pipelineEmitWithHintWorker( - hint, - node, - /*allowSnippets*/ - false - ); - nonEscapingWrite(`}`); - } - function emitTabStop(hint, node, snippet) { - Debug.assert( - node.kind === 239 /* EmptyStatement */, - `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.` - ); - Debug.assert( - hint !== 5 /* EmbeddedStatement */, - `A tab stop cannot be attached to an embedded statement.` - ); - nonEscapingWrite(`$${snippet.order}`); - } - function emitIdentifier(node) { - const writeText = node.symbol ? writeSymbol : write; - writeText(getTextOfNode2( - node, - /*includeTrivia*/ - false - ), node.symbol); - emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */); - } - function emitPrivateIdentifier(node) { - write(getTextOfNode2( - node, - /*includeTrivia*/ - false - )); - } - function emitQualifiedName(node) { - emitEntityName(node.left); - writePunctuation("."); - emit(node.right); - } - function emitEntityName(node) { - if (node.kind === 79 /* Identifier */) { - emitExpression(node); - } else { - emit(node); - } - } - function emitComputedPropertyName(node) { - const savedPrivateNameTempFlags = privateNameTempFlags; - const savedReservedMemberNames = reservedPrivateNames; - popPrivateNameGenerationScope(); - writePunctuation("["); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName); - writePunctuation("]"); - pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames); - } - function emitTypeParameter(node) { - emitModifierList(node, node.modifiers); - emit(node.name); - if (node.constraint) { - writeSpace(); - writeKeyword("extends"); - writeSpace(); - emit(node.constraint); - } - if (node.default) { - writeSpace(); - writeOperator("="); - writeSpace(); - emit(node.default); - } - } - function emitParameter(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - emit(node.dotDotDotToken); - emitNodeWithWriter(node.name, writeParameter); - emit(node.questionToken); - if (node.parent && node.parent.kind === 320 /* JSDocFunctionType */ && !node.name) { - emit(node.type); - } else { - emitTypeAnnotation(node.type); - } - emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.pos, node, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitDecorator(decorator) { - writePunctuation("@"); - emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); - } - function emitPropertySignature(node) { - emitModifierList(node, node.modifiers); - emitNodeWithWriter(node.name, writeProperty); - emit(node.questionToken); - emitTypeAnnotation(node.type); - writeTrailingSemicolon(); - } - function emitPropertyDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - emit(node.name); - emit(node.questionToken); - emit(node.exclamationToken); - emitTypeAnnotation(node.type); - emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); - writeTrailingSemicolon(); - } - function emitMethodSignature(node) { - pushNameGenerationScope(node); - emitModifierList(node, node.modifiers); - emit(node.name); - emit(node.questionToken); - emitTypeParameters(node, node.typeParameters); - emitParameters(node, node.parameters); - emitTypeAnnotation(node.type); - writeTrailingSemicolon(); - popNameGenerationScope(node); - } - function emitMethodDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - emit(node.asteriskToken); - emit(node.name); - emit(node.questionToken); - emitSignatureAndBody(node, emitSignatureHead); - } - function emitClassStaticBlockDeclaration(node) { - writeKeyword("static"); - emitBlockFunctionBody(node.body); - } - function emitConstructor(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("constructor"); - emitSignatureAndBody(node, emitSignatureHead); - } - function emitAccessorDeclaration(node) { - const pos = emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - const token = node.kind === 174 /* GetAccessor */ ? 137 /* GetKeyword */ : 151 /* SetKeyword */; - emitTokenWithComment(token, pos, writeKeyword, node); - writeSpace(); - emit(node.name); - emitSignatureAndBody(node, emitSignatureHead); - } - function emitCallSignature(node) { - pushNameGenerationScope(node); - emitTypeParameters(node, node.typeParameters); - emitParameters(node, node.parameters); - emitTypeAnnotation(node.type); - writeTrailingSemicolon(); - popNameGenerationScope(node); - } - function emitConstructSignature(node) { - pushNameGenerationScope(node); - writeKeyword("new"); - writeSpace(); - emitTypeParameters(node, node.typeParameters); - emitParameters(node, node.parameters); - emitTypeAnnotation(node.type); - writeTrailingSemicolon(); - popNameGenerationScope(node); - } - function emitIndexSignature(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - emitParametersForIndexSignature(node, node.parameters); - emitTypeAnnotation(node.type); - writeTrailingSemicolon(); - } - function emitTemplateTypeSpan(node) { - emit(node.type); - emit(node.literal); - } - function emitSemicolonClassElement() { - writeTrailingSemicolon(); - } - function emitTypePredicate(node) { - if (node.assertsModifier) { - emit(node.assertsModifier); - writeSpace(); - } - emit(node.parameterName); - if (node.type) { - writeSpace(); - writeKeyword("is"); - writeSpace(); - emit(node.type); - } - } - function emitTypeReference(node) { - emit(node.typeName); - emitTypeArguments(node, node.typeArguments); - } - function emitFunctionType(node) { - pushNameGenerationScope(node); - emitTypeParameters(node, node.typeParameters); - emitParametersForArrow(node, node.parameters); - writeSpace(); - writePunctuation("=>"); - writeSpace(); - emit(node.type); - popNameGenerationScope(node); - } - function emitJSDocFunctionType(node) { - writeKeyword("function"); - emitParameters(node, node.parameters); - writePunctuation(":"); - emit(node.type); - } - function emitJSDocNullableType(node) { - writePunctuation("?"); - emit(node.type); - } - function emitJSDocNonNullableType(node) { - writePunctuation("!"); - emit(node.type); - } - function emitJSDocOptionalType(node) { - emit(node.type); - writePunctuation("="); - } - function emitConstructorType(node) { - pushNameGenerationScope(node); - emitModifierList(node, node.modifiers); - writeKeyword("new"); - writeSpace(); - emitTypeParameters(node, node.typeParameters); - emitParameters(node, node.parameters); - writeSpace(); - writePunctuation("=>"); - writeSpace(); - emit(node.type); - popNameGenerationScope(node); - } - function emitTypeQuery(node) { - writeKeyword("typeof"); - writeSpace(); - emit(node.exprName); - emitTypeArguments(node, node.typeArguments); - } - function emitTypeLiteral(node) { - pushPrivateNameGenerationScope( - TempFlags.Auto, - /*newReservedMemberNames*/ - void 0 - ); - writePunctuation("{"); - const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */; - emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */); - writePunctuation("}"); - popPrivateNameGenerationScope(); - } - function emitArrayType(node) { - emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); - writePunctuation("["); - writePunctuation("]"); - } - function emitRestOrJSDocVariadicType(node) { - writePunctuation("..."); - emit(node.type); - } - function emitTupleType(node) { - emitTokenWithComment(22 /* OpenBracketToken */, node.pos, writePunctuation, node); - const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 528 /* SingleLineTupleTypeElements */ : 657 /* MultiLineTupleTypeElements */; - emitList(node, node.elements, flags | 524288 /* NoSpaceIfEmpty */, parenthesizer.parenthesizeElementTypeOfTupleType); - emitTokenWithComment(23 /* CloseBracketToken */, node.elements.end, writePunctuation, node); - } - function emitNamedTupleMember(node) { - emit(node.dotDotDotToken); - emit(node.name); - emit(node.questionToken); - emitTokenWithComment(58 /* ColonToken */, node.name.end, writePunctuation, node); - writeSpace(); - emit(node.type); - } - function emitOptionalType(node) { - emit(node.type, parenthesizer.parenthesizeTypeOfOptionalType); - writePunctuation("?"); - } - function emitUnionType(node) { - emitList(node, node.types, 516 /* UnionTypeConstituents */, parenthesizer.parenthesizeConstituentTypeOfUnionType); - } - function emitIntersectionType(node) { - emitList(node, node.types, 520 /* IntersectionTypeConstituents */, parenthesizer.parenthesizeConstituentTypeOfIntersectionType); - } - function emitConditionalType(node) { - emit(node.checkType, parenthesizer.parenthesizeCheckTypeOfConditionalType); - writeSpace(); - writeKeyword("extends"); - writeSpace(); - emit(node.extendsType, parenthesizer.parenthesizeExtendsTypeOfConditionalType); - writeSpace(); - writePunctuation("?"); - writeSpace(); - emit(node.trueType); - writeSpace(); - writePunctuation(":"); - writeSpace(); - emit(node.falseType); - } - function emitInferType(node) { - writeKeyword("infer"); - writeSpace(); - emit(node.typeParameter); - } - function emitParenthesizedType(node) { - writePunctuation("("); - emit(node.type); - writePunctuation(")"); - } - function emitThisType() { - writeKeyword("this"); - } - function emitTypeOperator(node) { - writeTokenText(node.operator, writeKeyword); - writeSpace(); - const parenthesizerRule = node.operator === 146 /* ReadonlyKeyword */ ? parenthesizer.parenthesizeOperandOfReadonlyTypeOperator : parenthesizer.parenthesizeOperandOfTypeOperator; - emit(node.type, parenthesizerRule); - } - function emitIndexedAccessType(node) { - emit(node.objectType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); - writePunctuation("["); - emit(node.indexType); - writePunctuation("]"); - } - function emitMappedType(node) { - const emitFlags = getEmitFlags(node); - writePunctuation("{"); - if (emitFlags & 1 /* SingleLine */) { - writeSpace(); - } else { - writeLine(); - increaseIndent(); - } - if (node.readonlyToken) { - emit(node.readonlyToken); - if (node.readonlyToken.kind !== 146 /* ReadonlyKeyword */) { - writeKeyword("readonly"); - } - writeSpace(); - } - writePunctuation("["); - pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); - if (node.nameType) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.nameType); - } - writePunctuation("]"); - if (node.questionToken) { - emit(node.questionToken); - if (node.questionToken.kind !== 57 /* QuestionToken */) { - writePunctuation("?"); - } - } - writePunctuation(":"); - writeSpace(); - emit(node.type); - writeTrailingSemicolon(); - if (emitFlags & 1 /* SingleLine */) { - writeSpace(); - } else { - writeLine(); - decreaseIndent(); - } - emitList(node, node.members, 2 /* PreserveLines */); - writePunctuation("}"); - } - function emitLiteralType(node) { - emitExpression(node.literal); - } - function emitTemplateType(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } - function emitImportTypeNode(node) { - if (node.isTypeOf) { - writeKeyword("typeof"); - writeSpace(); - } - writeKeyword("import"); - writePunctuation("("); - emit(node.argument); - if (node.assertions) { - writePunctuation(","); - writeSpace(); - writePunctuation("{"); - writeSpace(); - writeKeyword("assert"); - writePunctuation(":"); - writeSpace(); - const elements = node.assertions.assertClause.elements; - emitList(node.assertions.assertClause, elements, 526226 /* ImportClauseEntries */); - writeSpace(); - writePunctuation("}"); - } - writePunctuation(")"); - if (node.qualifier) { - writePunctuation("."); - emit(node.qualifier); - } - emitTypeArguments(node, node.typeArguments); - } - function emitObjectBindingPattern(node) { - writePunctuation("{"); - emitList(node, node.elements, 525136 /* ObjectBindingPatternElements */); - writePunctuation("}"); - } - function emitArrayBindingPattern(node) { - writePunctuation("["); - emitList(node, node.elements, 524880 /* ArrayBindingPatternElements */); - writePunctuation("]"); - } - function emitBindingElement(node) { - emit(node.dotDotDotToken); - if (node.propertyName) { - emit(node.propertyName); - writePunctuation(":"); - writeSpace(); - } - emit(node.name); - emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitArrayLiteralExpression(node) { - const elements = node.elements; - const preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */; - emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitObjectLiteralExpression(node) { - pushPrivateNameGenerationScope( - TempFlags.Auto, - /*newReservedMemberNames*/ - void 0 - ); - forEach(node.properties, generateMemberNames); - const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; - if (indentedFlag) { - increaseIndent(); - } - const preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */; - const allowTrailingComma = currentSourceFile && currentSourceFile.languageVersion >= 1 /* ES5 */ && !isJsonSourceFile(currentSourceFile) ? 64 /* AllowTrailingComma */ : 0 /* None */; - emitList(node, node.properties, 526226 /* ObjectLiteralExpressionProperties */ | allowTrailingComma | preferNewLine); - if (indentedFlag) { - decreaseIndent(); - } - popPrivateNameGenerationScope(); - } - function emitPropertyAccessExpression(node) { - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - const token = node.questionDotToken || setTextRangePosEnd(factory.createToken(24 /* DotToken */), node.expression.end, node.name.pos); - const linesBeforeDot = getLinesBetweenNodes(node, node.expression, token); - const linesAfterDot = getLinesBetweenNodes(node, token, node.name); - writeLinesAndIndent( - linesBeforeDot, - /*writeSpaceIfNotIndenting*/ - false - ); - const shouldEmitDotDot = token.kind !== 28 /* QuestionDotToken */ && mayNeedDotDotForPropertyAccess(node.expression) && !writer.hasTrailingComment() && !writer.hasTrailingWhitespace(); - if (shouldEmitDotDot) { - writePunctuation("."); - } - if (node.questionDotToken) { - emit(token); - } else { - emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); - } - writeLinesAndIndent( - linesAfterDot, - /*writeSpaceIfNotIndenting*/ - false - ); - emit(node.name); - decreaseIndentIf(linesBeforeDot, linesAfterDot); - } - function mayNeedDotDotForPropertyAccess(expression) { - expression = skipPartiallyEmittedExpressions(expression); - if (isNumericLiteral(expression)) { - const text = getLiteralTextOfNode( - expression, - /*neverAsciiEscape*/ - true, - /*jsxAttributeEscape*/ - false - ); - return !expression.numericLiteralFlags && !stringContains(text, tokenToString(24 /* DotToken */)); - } else if (isAccessExpression(expression)) { - const constantValue = getConstantValue(expression); - return typeof constantValue === "number" && isFinite(constantValue) && Math.floor(constantValue) === constantValue; - } - } - function emitElementAccessExpression(node) { - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - emit(node.questionDotToken); - emitTokenWithComment(22 /* OpenBracketToken */, node.expression.end, writePunctuation, node); - emitExpression(node.argumentExpression); - emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node); - } - function emitCallExpression(node) { - const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; - if (indirectCall) { - writePunctuation("("); - writeLiteral("0"); - writePunctuation(","); - writeSpace(); - } - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - if (indirectCall) { - writePunctuation(")"); - } - emit(node.questionDotToken); - emitTypeArguments(node, node.typeArguments); - emitExpressionList(node, node.arguments, 2576 /* CallExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitNewExpression(node) { - emitTokenWithComment(103 /* NewKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfNew); - emitTypeArguments(node, node.typeArguments); - emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitTaggedTemplateExpression(node) { - const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; - if (indirectCall) { - writePunctuation("("); - writeLiteral("0"); - writePunctuation(","); - writeSpace(); - } - emitExpression(node.tag, parenthesizer.parenthesizeLeftSideOfAccess); - if (indirectCall) { - writePunctuation(")"); - } - emitTypeArguments(node, node.typeArguments); - writeSpace(); - emitExpression(node.template); - } - function emitTypeAssertionExpression(node) { - writePunctuation("<"); - emit(node.type); - writePunctuation(">"); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitParenthesizedExpression(node) { - const openParenPos = emitTokenWithComment(20 /* OpenParenToken */, node.pos, writePunctuation, node); - const indented = writeLineSeparatorsAndIndentBefore(node.expression, node); - emitExpression( - node.expression, - /*parenthesizerRules*/ - void 0 - ); - writeLineSeparatorsAfter(node.expression, node); - decreaseIndentIf(indented); - emitTokenWithComment(21 /* CloseParenToken */, node.expression ? node.expression.end : openParenPos, writePunctuation, node); - } - function emitFunctionExpression(node) { - generateNameIfNeeded(node.name); - emitFunctionDeclarationOrExpression(node); - } - function emitArrowFunction(node) { - emitModifierList(node, node.modifiers); - emitSignatureAndBody(node, emitArrowFunctionHead); - } - function emitArrowFunctionHead(node) { - emitTypeParameters(node, node.typeParameters); - emitParametersForArrow(node, node.parameters); - emitTypeAnnotation(node.type); - writeSpace(); - emit(node.equalsGreaterThanToken); - } - function emitDeleteExpression(node) { - emitTokenWithComment(89 /* DeleteKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitTypeOfExpression(node) { - emitTokenWithComment(112 /* TypeOfKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitVoidExpression(node) { - emitTokenWithComment(114 /* VoidKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitAwaitExpression(node) { - emitTokenWithComment(133 /* AwaitKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitPrefixUnaryExpression(node) { - writeTokenText(node.operator, writeOperator); - if (shouldEmitWhitespaceBeforeOperand(node)) { - writeSpace(); - } - emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function shouldEmitWhitespaceBeforeOperand(node) { - const operand = node.operand; - return operand.kind === 221 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */)); - } - function emitPostfixUnaryExpression(node) { - emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary); - writeTokenText(node.operator, writeOperator); - } - function createEmitBinaryExpression() { - return createBinaryExpressionTrampoline( - onEnter, - onLeft, - onOperator, - onRight, - onExit, - /*foldState*/ - void 0 - ); - function onEnter(node, state) { - if (state) { - state.stackIndex++; - state.preserveSourceNewlinesStack[state.stackIndex] = preserveSourceNewlines; - state.containerPosStack[state.stackIndex] = containerPos; - state.containerEndStack[state.stackIndex] = containerEnd; - state.declarationListContainerEndStack[state.stackIndex] = declarationListContainerEnd; - const emitComments2 = state.shouldEmitCommentsStack[state.stackIndex] = shouldEmitComments(node); - const emitSourceMaps = state.shouldEmitSourceMapsStack[state.stackIndex] = shouldEmitSourceMaps(node); - onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); - if (emitComments2) - emitCommentsBeforeNode(node); - if (emitSourceMaps) - emitSourceMapsBeforeNode(node); - beforeEmitNode(node); - } else { - state = { - stackIndex: 0, - preserveSourceNewlinesStack: [void 0], - containerPosStack: [-1], - containerEndStack: [-1], - declarationListContainerEndStack: [-1], - shouldEmitCommentsStack: [false], - shouldEmitSourceMapsStack: [false] - }; - } - return state; - } - function onLeft(next, _workArea, parent) { - return maybeEmitExpression(next, parent, "left"); - } - function onOperator(operatorToken, _state, node) { - const isCommaOperator = operatorToken.kind !== 27 /* CommaToken */; - const linesBeforeOperator = getLinesBetweenNodes(node, node.left, operatorToken); - const linesAfterOperator = getLinesBetweenNodes(node, operatorToken, node.right); - writeLinesAndIndent(linesBeforeOperator, isCommaOperator); - emitLeadingCommentsOfPosition(operatorToken.pos); - writeTokenNode(operatorToken, operatorToken.kind === 101 /* InKeyword */ ? writeKeyword : writeOperator); - emitTrailingCommentsOfPosition( - operatorToken.end, - /*prefixSpace*/ - true - ); - writeLinesAndIndent( - linesAfterOperator, - /*writeSpaceIfNotIndenting*/ - true - ); - } - function onRight(next, _workArea, parent) { - return maybeEmitExpression(next, parent, "right"); - } - function onExit(node, state) { - const linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken); - const linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right); - decreaseIndentIf(linesBeforeOperator, linesAfterOperator); - if (state.stackIndex > 0) { - const savedPreserveSourceNewlines = state.preserveSourceNewlinesStack[state.stackIndex]; - const savedContainerPos = state.containerPosStack[state.stackIndex]; - const savedContainerEnd = state.containerEndStack[state.stackIndex]; - const savedDeclarationListContainerEnd = state.declarationListContainerEndStack[state.stackIndex]; - const shouldEmitComments2 = state.shouldEmitCommentsStack[state.stackIndex]; - const shouldEmitSourceMaps2 = state.shouldEmitSourceMapsStack[state.stackIndex]; - afterEmitNode(savedPreserveSourceNewlines); - if (shouldEmitSourceMaps2) - emitSourceMapsAfterNode(node); - if (shouldEmitComments2) - emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); - onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); - state.stackIndex--; - } - } - function maybeEmitExpression(next, parent, side) { - const parenthesizerRule = side === "left" ? parenthesizer.getParenthesizeLeftSideOfBinaryForOperator(parent.operatorToken.kind) : parenthesizer.getParenthesizeRightSideOfBinaryForOperator(parent.operatorToken.kind); - let pipelinePhase = getPipelinePhase(0 /* Notification */, 1 /* Expression */, next); - if (pipelinePhase === pipelineEmitWithSubstitution) { - Debug.assertIsDefined(lastSubstitution); - next = parenthesizerRule(cast(lastSubstitution, isExpression)); - pipelinePhase = getNextPipelinePhase(1 /* Substitution */, 1 /* Expression */, next); - lastSubstitution = void 0; - } - if (pipelinePhase === pipelineEmitWithComments || pipelinePhase === pipelineEmitWithSourceMaps || pipelinePhase === pipelineEmitWithHint) { - if (isBinaryExpression(next)) { - return next; - } - } - currentParenthesizerRule = parenthesizerRule; - pipelinePhase(1 /* Expression */, next); - } - } - function emitConditionalExpression(node) { - const linesBeforeQuestion = getLinesBetweenNodes(node, node.condition, node.questionToken); - const linesAfterQuestion = getLinesBetweenNodes(node, node.questionToken, node.whenTrue); - const linesBeforeColon = getLinesBetweenNodes(node, node.whenTrue, node.colonToken); - const linesAfterColon = getLinesBetweenNodes(node, node.colonToken, node.whenFalse); - emitExpression(node.condition, parenthesizer.parenthesizeConditionOfConditionalExpression); - writeLinesAndIndent( - linesBeforeQuestion, - /*writeSpaceIfNotIndenting*/ - true - ); - emit(node.questionToken); - writeLinesAndIndent( - linesAfterQuestion, - /*writeSpaceIfNotIndenting*/ - true - ); - emitExpression(node.whenTrue, parenthesizer.parenthesizeBranchOfConditionalExpression); - decreaseIndentIf(linesBeforeQuestion, linesAfterQuestion); - writeLinesAndIndent( - linesBeforeColon, - /*writeSpaceIfNotIndenting*/ - true - ); - emit(node.colonToken); - writeLinesAndIndent( - linesAfterColon, - /*writeSpaceIfNotIndenting*/ - true - ); - emitExpression(node.whenFalse, parenthesizer.parenthesizeBranchOfConditionalExpression); - decreaseIndentIf(linesBeforeColon, linesAfterColon); - } - function emitTemplateExpression(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } - function emitYieldExpression(node) { - emitTokenWithComment(125 /* YieldKeyword */, node.pos, writeKeyword, node); - emit(node.asteriskToken); - emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsiAndDisallowedComma); - } - function emitSpreadElement(node) { - emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitClassExpression(node) { - generateNameIfNeeded(node.name); - emitClassDeclarationOrExpression(node); - } - function emitExpressionWithTypeArguments(node) { - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - emitTypeArguments(node, node.typeArguments); - } - function emitAsExpression(node) { - emitExpression( - node.expression, - /*parenthesizerRules*/ - void 0 - ); - if (node.type) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.type); - } - } - function emitNonNullExpression(node) { - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - writeOperator("!"); - } - function emitSatisfiesExpression(node) { - emitExpression( - node.expression, - /*parenthesizerRules*/ - void 0 - ); - if (node.type) { - writeSpace(); - writeKeyword("satisfies"); - writeSpace(); - emit(node.type); - } - } - function emitMetaProperty(node) { - writeToken(node.keywordToken, node.pos, writePunctuation); - writePunctuation("."); - emit(node.name); - } - function emitTemplateSpan(node) { - emitExpression(node.expression); - emit(node.literal); - } - function emitBlock(node) { - emitBlockStatements( - node, - /*forceSingleLine*/ - !node.multiLine && isEmptyBlock(node) - ); - } - function emitBlockStatements(node, forceSingleLine) { - emitTokenWithComment( - 18 /* OpenBraceToken */, - node.pos, - writePunctuation, - /*contextNode*/ - node - ); - const format = forceSingleLine || getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineBlockStatements */ : 129 /* MultiLineBlockStatements */; - emitList(node, node.statements, format); - emitTokenWithComment( - 19 /* CloseBraceToken */, - node.statements.end, - writePunctuation, - /*contextNode*/ - node, - /*indentLeading*/ - !!(format & 1 /* MultiLine */) - ); - } - function emitVariableStatement(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - emit(node.declarationList); - writeTrailingSemicolon(); - } - function emitEmptyStatement(isEmbeddedStatement) { - if (isEmbeddedStatement) { - writePunctuation(";"); - } else { - writeTrailingSemicolon(); - } - } - function emitExpressionStatement(node) { - emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement); - if (!currentSourceFile || !isJsonSourceFile(currentSourceFile) || nodeIsSynthesized(node.expression)) { - writeTrailingSemicolon(); - } - } - function emitIfStatement(node) { - const openParenPos = emitTokenWithComment(99 /* IfKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitExpression(node.expression); - emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); - emitEmbeddedStatement(node, node.thenStatement); - if (node.elseStatement) { - writeLineOrSpace(node, node.thenStatement, node.elseStatement); - emitTokenWithComment(91 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 242 /* IfStatement */) { - writeSpace(); - emit(node.elseStatement); - } else { - emitEmbeddedStatement(node, node.elseStatement); - } - } - } - function emitWhileClause(node, startPos) { - const openParenPos = emitTokenWithComment(115 /* WhileKeyword */, startPos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitExpression(node.expression); - emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); - } - function emitDoStatement(node) { - emitTokenWithComment(90 /* DoKeyword */, node.pos, writeKeyword, node); - emitEmbeddedStatement(node, node.statement); - if (isBlock(node.statement) && !preserveSourceNewlines) { - writeSpace(); - } else { - writeLineOrSpace(node, node.statement, node.expression); - } - emitWhileClause(node, node.statement.end); - writeTrailingSemicolon(); - } - function emitWhileStatement(node) { - emitWhileClause(node, node.pos); - emitEmbeddedStatement(node, node.statement); - } - function emitForStatement(node) { - const openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node); - writeSpace(); - let pos = emitTokenWithComment( - 20 /* OpenParenToken */, - openParenPos, - writePunctuation, - /*contextNode*/ - node - ); - emitForBinding(node.initializer); - pos = emitTokenWithComment(26 /* SemicolonToken */, node.initializer ? node.initializer.end : pos, writePunctuation, node); - emitExpressionWithLeadingSpace(node.condition); - pos = emitTokenWithComment(26 /* SemicolonToken */, node.condition ? node.condition.end : pos, writePunctuation, node); - emitExpressionWithLeadingSpace(node.incrementor); - emitTokenWithComment(21 /* CloseParenToken */, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); - emitEmbeddedStatement(node, node.statement); - } - function emitForInStatement(node) { - const openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitForBinding(node.initializer); - writeSpace(); - emitTokenWithComment(101 /* InKeyword */, node.initializer.end, writeKeyword, node); - writeSpace(); - emitExpression(node.expression); - emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); - emitEmbeddedStatement(node, node.statement); - } - function emitForOfStatement(node) { - const openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitWithTrailingSpace(node.awaitModifier); - emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitForBinding(node.initializer); - writeSpace(); - emitTokenWithComment(162 /* OfKeyword */, node.initializer.end, writeKeyword, node); - writeSpace(); - emitExpression(node.expression); - emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); - emitEmbeddedStatement(node, node.statement); - } - function emitForBinding(node) { - if (node !== void 0) { - if (node.kind === 258 /* VariableDeclarationList */) { - emit(node); - } else { - emitExpression(node); - } - } - } - function emitContinueStatement(node) { - emitTokenWithComment(86 /* ContinueKeyword */, node.pos, writeKeyword, node); - emitWithLeadingSpace(node.label); - writeTrailingSemicolon(); - } - function emitBreakStatement(node) { - emitTokenWithComment(81 /* BreakKeyword */, node.pos, writeKeyword, node); - emitWithLeadingSpace(node.label); - writeTrailingSemicolon(); - } - function emitTokenWithComment(token, pos, writer2, contextNode, indentLeading) { - const node = getParseTreeNode(contextNode); - const isSimilarNode = node && node.kind === contextNode.kind; - const startPos = pos; - if (isSimilarNode && currentSourceFile) { - pos = skipTrivia(currentSourceFile.text, pos); - } - if (isSimilarNode && contextNode.pos !== startPos) { - const needsIndent = indentLeading && currentSourceFile && !positionsAreOnSameLine(startPos, pos, currentSourceFile); - if (needsIndent) { - increaseIndent(); - } - emitLeadingCommentsOfPosition(startPos); - if (needsIndent) { - decreaseIndent(); - } - } - pos = writeTokenText(token, writer2, pos); - if (isSimilarNode && contextNode.end !== pos) { - const isJsxExprContext = contextNode.kind === 291 /* JsxExpression */; - emitTrailingCommentsOfPosition( - pos, - /*prefixSpace*/ - !isJsxExprContext, - /*forceNoNewline*/ - isJsxExprContext - ); - } - return pos; - } - function commentWillEmitNewLine(node) { - return node.kind === 2 /* SingleLineCommentTrivia */ || !!node.hasTrailingNewLine; - } - function willEmitLeadingNewLine(node) { - if (!currentSourceFile) - return false; - if (some(getLeadingCommentRanges(currentSourceFile.text, node.pos), commentWillEmitNewLine)) - return true; - if (some(getSyntheticLeadingComments(node), commentWillEmitNewLine)) - return true; - if (isPartiallyEmittedExpression(node)) { - if (node.pos !== node.expression.pos) { - if (some(getTrailingCommentRanges(currentSourceFile.text, node.expression.pos), commentWillEmitNewLine)) - return true; - } - return willEmitLeadingNewLine(node.expression); - } - return false; - } - function parenthesizeExpressionForNoAsi(node) { - if (!commentsDisabled && isPartiallyEmittedExpression(node) && willEmitLeadingNewLine(node)) { - const parseNode = getParseTreeNode(node); - if (parseNode && isParenthesizedExpression(parseNode)) { - const parens = factory.createParenthesizedExpression(node.expression); - setOriginalNode(parens, node); - setTextRange(parens, parseNode); - return parens; - } - return factory.createParenthesizedExpression(node); - } - return node; - } - function parenthesizeExpressionForNoAsiAndDisallowedComma(node) { - return parenthesizeExpressionForNoAsi(parenthesizer.parenthesizeExpressionForDisallowedComma(node)); - } - function emitReturnStatement(node) { - emitTokenWithComment( - 105 /* ReturnKeyword */, - node.pos, - writeKeyword, - /*contextNode*/ - node - ); - emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); - writeTrailingSemicolon(); - } - function emitWithStatement(node) { - const openParenPos = emitTokenWithComment(116 /* WithKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitExpression(node.expression); - emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); - emitEmbeddedStatement(node, node.statement); - } - function emitSwitchStatement(node) { - const openParenPos = emitTokenWithComment(107 /* SwitchKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitExpression(node.expression); - emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); - writeSpace(); - emit(node.caseBlock); - } - function emitLabeledStatement(node) { - emit(node.label); - emitTokenWithComment(58 /* ColonToken */, node.label.end, writePunctuation, node); - writeSpace(); - emit(node.statement); - } - function emitThrowStatement(node) { - emitTokenWithComment(109 /* ThrowKeyword */, node.pos, writeKeyword, node); - emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); - writeTrailingSemicolon(); - } - function emitTryStatement(node) { - emitTokenWithComment(111 /* TryKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emit(node.tryBlock); - if (node.catchClause) { - writeLineOrSpace(node, node.tryBlock, node.catchClause); - emit(node.catchClause); - } - if (node.finallyBlock) { - writeLineOrSpace(node, node.catchClause || node.tryBlock, node.finallyBlock); - emitTokenWithComment(96 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node); - writeSpace(); - emit(node.finallyBlock); - } - } - function emitDebuggerStatement(node) { - writeToken(87 /* DebuggerKeyword */, node.pos, writeKeyword); - writeTrailingSemicolon(); - } - function emitVariableDeclaration(node) { - var _a2, _b, _c, _d, _e; - emit(node.name); - emit(node.exclamationToken); - emitTypeAnnotation(node.type); - emitInitializer(node.initializer, (_e = (_d = (_a2 = node.type) == null ? void 0 : _a2.end) != null ? _d : (_c = (_b = node.name.emitNode) == null ? void 0 : _b.typeNode) == null ? void 0 : _c.end) != null ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitVariableDeclarationList(node) { - writeKeyword(isLet(node) ? "let" : isVarConst(node) ? "const" : "var"); - writeSpace(); - emitList(node, node.declarations, 528 /* VariableDeclarationList */); - } - function emitFunctionDeclaration(node) { - emitFunctionDeclarationOrExpression(node); - } - function emitFunctionDeclarationOrExpression(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("function"); - emit(node.asteriskToken); - writeSpace(); - emitIdentifierName(node.name); - emitSignatureAndBody(node, emitSignatureHead); - } - function emitSignatureAndBody(node, emitSignatureHead2) { - const body = node.body; - if (body) { - if (isBlock(body)) { - const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; - if (indentedFlag) { - increaseIndent(); - } - pushNameGenerationScope(node); - forEach(node.parameters, generateNames); - generateNames(node.body); - emitSignatureHead2(node); - emitBlockFunctionBody(body); - popNameGenerationScope(node); - if (indentedFlag) { - decreaseIndent(); - } - } else { - emitSignatureHead2(node); - writeSpace(); - emitExpression(body, parenthesizer.parenthesizeConciseBodyOfArrowFunction); - } - } else { - emitSignatureHead2(node); - writeTrailingSemicolon(); - } - } - function emitSignatureHead(node) { - emitTypeParameters(node, node.typeParameters); - emitParameters(node, node.parameters); - emitTypeAnnotation(node.type); - } - function shouldEmitBlockFunctionBodyOnSingleLine(body) { - if (getEmitFlags(body) & 1 /* SingleLine */) { - return true; - } - if (body.multiLine) { - return false; - } - if (!nodeIsSynthesized(body) && currentSourceFile && !rangeIsOnSingleLine(body, currentSourceFile)) { - return false; - } - if (getLeadingLineTerminatorCount(body, firstOrUndefined(body.statements), 2 /* PreserveLines */) || getClosingLineTerminatorCount(body, lastOrUndefined(body.statements), 2 /* PreserveLines */, body.statements)) { - return false; - } - let previousStatement; - for (const statement of body.statements) { - if (getSeparatingLineTerminatorCount(previousStatement, statement, 2 /* PreserveLines */) > 0) { - return false; - } - previousStatement = statement; - } - return true; - } - function emitBlockFunctionBody(body) { - onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(body); - writeSpace(); - writePunctuation("{"); - increaseIndent(); - const emitBlockFunctionBody2 = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine : emitBlockFunctionBodyWorker; - emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody2); - decreaseIndent(); - writeToken(19 /* CloseBraceToken */, body.statements.end, writePunctuation, body); - onAfterEmitNode == null ? void 0 : onAfterEmitNode(body); - } - function emitBlockFunctionBodyOnSingleLine(body) { - emitBlockFunctionBodyWorker( - body, - /*emitBlockFunctionBodyOnSingleLine*/ - true - ); - } - function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine2) { - const statementOffset = emitPrologueDirectives(body.statements); - const pos = writer.getTextPos(); - emitHelpers(body); - if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine2) { - decreaseIndent(); - emitList(body, body.statements, 768 /* SingleLineFunctionBodyStatements */); - increaseIndent(); - } else { - emitList( - body, - body.statements, - 1 /* MultiLineFunctionBodyStatements */, - /*parenthesizerRule*/ - void 0, - statementOffset - ); - } - } - function emitClassDeclaration(node) { - emitClassDeclarationOrExpression(node); - } - function emitClassDeclarationOrExpression(node) { - pushPrivateNameGenerationScope( - TempFlags.Auto, - /*newReservedMemberNames*/ - void 0 - ); - forEach(node.members, generateMemberNames); - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - emitTokenWithComment(84 /* ClassKeyword */, moveRangePastModifiers(node).pos, writeKeyword, node); - if (node.name) { - writeSpace(); - emitIdentifierName(node.name); - } - const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; - if (indentedFlag) { - increaseIndent(); - } - emitTypeParameters(node, node.typeParameters); - emitList(node, node.heritageClauses, 0 /* ClassHeritageClauses */); - writeSpace(); - writePunctuation("{"); - emitList(node, node.members, 129 /* ClassMembers */); - writePunctuation("}"); - if (indentedFlag) { - decreaseIndent(); - } - popPrivateNameGenerationScope(); - } - function emitInterfaceDeclaration(node) { - pushPrivateNameGenerationScope( - TempFlags.Auto, - /*newReservedMemberNames*/ - void 0 - ); - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("interface"); - writeSpace(); - emit(node.name); - emitTypeParameters(node, node.typeParameters); - emitList(node, node.heritageClauses, 512 /* HeritageClauses */); - writeSpace(); - writePunctuation("{"); - emitList(node, node.members, 129 /* InterfaceMembers */); - writePunctuation("}"); - popPrivateNameGenerationScope(); - } - function emitTypeAliasDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("type"); - writeSpace(); - emit(node.name); - emitTypeParameters(node, node.typeParameters); - writeSpace(); - writePunctuation("="); - writeSpace(); - emit(node.type); - writeTrailingSemicolon(); - } - function emitEnumDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("enum"); - writeSpace(); - emit(node.name); - writeSpace(); - writePunctuation("{"); - emitList(node, node.members, 145 /* EnumMembers */); - writePunctuation("}"); - } - function emitModuleDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - if (~node.flags & 1024 /* GlobalAugmentation */) { - writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); - writeSpace(); - } - emit(node.name); - let body = node.body; - if (!body) - return writeTrailingSemicolon(); - while (body && isModuleDeclaration(body)) { - writePunctuation("."); - emit(body.name); - body = body.body; - } - writeSpace(); - emit(body); - } - function emitModuleBlock(node) { - pushNameGenerationScope(node); - forEach(node.statements, generateNames); - emitBlockStatements( - node, - /*forceSingleLine*/ - isEmptyBlock(node) - ); - popNameGenerationScope(node); - } - function emitCaseBlock(node) { - emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node); - emitList(node, node.clauses, 129 /* CaseBlockClauses */); - emitTokenWithComment( - 19 /* CloseBraceToken */, - node.clauses.end, - writePunctuation, - node, - /*indentLeading*/ - true - ); - } - function emitImportEqualsDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); - writeSpace(); - if (node.isTypeOnly) { - emitTokenWithComment(154 /* TypeKeyword */, node.pos, writeKeyword, node); - writeSpace(); - } - emit(node.name); - writeSpace(); - emitTokenWithComment(63 /* EqualsToken */, node.name.end, writePunctuation, node); - writeSpace(); - emitModuleReference(node.moduleReference); - writeTrailingSemicolon(); - } - function emitModuleReference(node) { - if (node.kind === 79 /* Identifier */) { - emitExpression(node); - } else { - emit(node); - } - } - function emitImportDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); - writeSpace(); - if (node.importClause) { - emit(node.importClause); - writeSpace(); - emitTokenWithComment(158 /* FromKeyword */, node.importClause.end, writeKeyword, node); - writeSpace(); - } - emitExpression(node.moduleSpecifier); - if (node.assertClause) { - emitWithLeadingSpace(node.assertClause); - } - writeTrailingSemicolon(); - } - function emitImportClause(node) { - if (node.isTypeOnly) { - emitTokenWithComment(154 /* TypeKeyword */, node.pos, writeKeyword, node); - writeSpace(); - } - emit(node.name); - if (node.name && node.namedBindings) { - emitTokenWithComment(27 /* CommaToken */, node.name.end, writePunctuation, node); - writeSpace(); - } - emit(node.namedBindings); - } - function emitNamespaceImport(node) { - const asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node); - writeSpace(); - emitTokenWithComment(128 /* AsKeyword */, asPos, writeKeyword, node); - writeSpace(); - emit(node.name); - } - function emitNamedImports(node) { - emitNamedImportsOrExports(node); - } - function emitImportSpecifier(node) { - emitImportOrExportSpecifier(node); - } - function emitExportAssignment(node) { - const nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); - writeSpace(); - if (node.isExportEquals) { - emitTokenWithComment(63 /* EqualsToken */, nextPos, writeOperator, node); - } else { - emitTokenWithComment(88 /* DefaultKeyword */, nextPos, writeKeyword, node); - } - writeSpace(); - emitExpression(node.expression, node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator(63 /* EqualsToken */) : parenthesizer.parenthesizeExpressionOfExportDefault); - writeTrailingSemicolon(); - } - function emitExportDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - let nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); - writeSpace(); - if (node.isTypeOnly) { - nextPos = emitTokenWithComment(154 /* TypeKeyword */, nextPos, writeKeyword, node); - writeSpace(); - } - if (node.exportClause) { - emit(node.exportClause); - } else { - nextPos = emitTokenWithComment(41 /* AsteriskToken */, nextPos, writePunctuation, node); - } - if (node.moduleSpecifier) { - writeSpace(); - const fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(158 /* FromKeyword */, fromPos, writeKeyword, node); - writeSpace(); - emitExpression(node.moduleSpecifier); - } - if (node.assertClause) { - emitWithLeadingSpace(node.assertClause); - } - writeTrailingSemicolon(); - } - function emitAssertClause(node) { - emitTokenWithComment(130 /* AssertKeyword */, node.pos, writeKeyword, node); - writeSpace(); - const elements = node.elements; - emitList(node, elements, 526226 /* ImportClauseEntries */); - } - function emitAssertEntry(node) { - emit(node.name); - writePunctuation(":"); - writeSpace(); - const value = node.value; - if ((getEmitFlags(value) & 1024 /* NoLeadingComments */) === 0) { - const commentRange = getCommentRange(value); - emitTrailingCommentsOfPosition(commentRange.pos); - } - emit(value); - } - function emitNamespaceExportDeclaration(node) { - let nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node); - writeSpace(); - nextPos = emitTokenWithComment(128 /* AsKeyword */, nextPos, writeKeyword, node); - writeSpace(); - nextPos = emitTokenWithComment(143 /* NamespaceKeyword */, nextPos, writeKeyword, node); - writeSpace(); - emit(node.name); - writeTrailingSemicolon(); - } - function emitNamespaceExport(node) { - const asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node); - writeSpace(); - emitTokenWithComment(128 /* AsKeyword */, asPos, writeKeyword, node); - writeSpace(); - emit(node.name); - } - function emitNamedExports(node) { - emitNamedImportsOrExports(node); - } - function emitExportSpecifier(node) { - emitImportOrExportSpecifier(node); - } - function emitNamedImportsOrExports(node) { - writePunctuation("{"); - emitList(node, node.elements, 525136 /* NamedImportsOrExportsElements */); - writePunctuation("}"); - } - function emitImportOrExportSpecifier(node) { - if (node.isTypeOnly) { - writeKeyword("type"); - writeSpace(); - } - if (node.propertyName) { - emit(node.propertyName); - writeSpace(); - emitTokenWithComment(128 /* AsKeyword */, node.propertyName.end, writeKeyword, node); - writeSpace(); - } - emit(node.name); - } - function emitExternalModuleReference(node) { - writeKeyword("require"); - writePunctuation("("); - emitExpression(node.expression); - writePunctuation(")"); - } - function emitJsxElement(node) { - emit(node.openingElement); - emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */); - emit(node.closingElement); - } - function emitJsxSelfClosingElement(node) { - writePunctuation("<"); - emitJsxTagName(node.tagName); - emitTypeArguments(node, node.typeArguments); - writeSpace(); - emit(node.attributes); - writePunctuation("/>"); - } - function emitJsxFragment(node) { - emit(node.openingFragment); - emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */); - emit(node.closingFragment); - } - function emitJsxOpeningElementOrFragment(node) { - writePunctuation("<"); - if (isJsxOpeningElement(node)) { - const indented = writeLineSeparatorsAndIndentBefore(node.tagName, node); - emitJsxTagName(node.tagName); - emitTypeArguments(node, node.typeArguments); - if (node.attributes.properties && node.attributes.properties.length > 0) { - writeSpace(); - } - emit(node.attributes); - writeLineSeparatorsAfter(node.attributes, node); - decreaseIndentIf(indented); - } - writePunctuation(">"); - } - function emitJsxText(node) { - writer.writeLiteral(node.text); - } - function emitJsxClosingElementOrFragment(node) { - writePunctuation(""); - } - function emitJsxAttributes(node) { - emitList(node, node.properties, 262656 /* JsxElementAttributes */); - } - function emitJsxAttribute(node) { - emit(node.name); - emitNodeWithPrefix("=", writePunctuation, node.initializer, emitJsxAttributeValue); - } - function emitJsxSpreadAttribute(node) { - writePunctuation("{..."); - emitExpression(node.expression); - writePunctuation("}"); - } - function hasTrailingCommentsAtPosition(pos) { - let result = false; - forEachTrailingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result = true); - return result; - } - function hasLeadingCommentsAtPosition(pos) { - let result = false; - forEachLeadingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result = true); - return result; - } - function hasCommentsAtPosition(pos) { - return hasTrailingCommentsAtPosition(pos) || hasLeadingCommentsAtPosition(pos); - } - function emitJsxExpression(node) { - var _a2; - if (node.expression || !commentsDisabled && !nodeIsSynthesized(node) && hasCommentsAtPosition(node.pos)) { - const isMultiline = currentSourceFile && !nodeIsSynthesized(node) && getLineAndCharacterOfPosition(currentSourceFile, node.pos).line !== getLineAndCharacterOfPosition(currentSourceFile, node.end).line; - if (isMultiline) { - writer.increaseIndent(); - } - const end = emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node); - emit(node.dotDotDotToken); - emitExpression(node.expression); - emitTokenWithComment(19 /* CloseBraceToken */, ((_a2 = node.expression) == null ? void 0 : _a2.end) || end, writePunctuation, node); - if (isMultiline) { - writer.decreaseIndent(); - } - } - } - function emitJsxTagName(node) { - if (node.kind === 79 /* Identifier */) { - emitExpression(node); - } else { - emit(node); - } - } - function emitCaseClause(node) { - emitTokenWithComment(82 /* CaseKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); - emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); - } - function emitDefaultClause(node) { - const pos = emitTokenWithComment(88 /* DefaultKeyword */, node.pos, writeKeyword, node); - emitCaseOrDefaultClauseRest(node, node.statements, pos); - } - function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { - const emitAsSingleStatement = statements.length === 1 && // treat synthesized nodes as located on the same line for emit purposes - (!currentSourceFile || nodeIsSynthesized(parentNode) || nodeIsSynthesized(statements[0]) || rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)); - let format = 163969 /* CaseOrDefaultClauseStatements */; - if (emitAsSingleStatement) { - writeToken(58 /* ColonToken */, colonPos, writePunctuation, parentNode); - writeSpace(); - format &= ~(1 /* MultiLine */ | 128 /* Indented */); - } else { - emitTokenWithComment(58 /* ColonToken */, colonPos, writePunctuation, parentNode); - } - emitList(parentNode, statements, format); - } - function emitHeritageClause(node) { - writeSpace(); - writeTokenText(node.token, writeKeyword); - writeSpace(); - emitList(node, node.types, 528 /* HeritageClauseTypes */); - } - function emitCatchClause(node) { - const openParenPos = emitTokenWithComment(83 /* CatchKeyword */, node.pos, writeKeyword, node); - writeSpace(); - if (node.variableDeclaration) { - emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); - emit(node.variableDeclaration); - emitTokenWithComment(21 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation, node); - writeSpace(); - } - emit(node.block); - } - function emitPropertyAssignment(node) { - emit(node.name); - writePunctuation(":"); - writeSpace(); - const initializer = node.initializer; - if ((getEmitFlags(initializer) & 1024 /* NoLeadingComments */) === 0) { - const commentRange = getCommentRange(initializer); - emitTrailingCommentsOfPosition(commentRange.pos); - } - emitExpression(initializer, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitShorthandPropertyAssignment(node) { - emit(node.name); - if (node.objectAssignmentInitializer) { - writeSpace(); - writePunctuation("="); - writeSpace(); - emitExpression(node.objectAssignmentInitializer, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - } - function emitSpreadAssignment(node) { - if (node.expression) { - emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - } - function emitEnumMember(node) { - emit(node.name); - emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitJSDoc(node) { - write("/**"); - if (node.comment) { - const text = getTextOfJSDocComment(node.comment); - if (text) { - const lines = text.split(/\r\n?|\n/g); - for (const line of lines) { - writeLine(); - writeSpace(); - writePunctuation("*"); - writeSpace(); - write(line); - } - } - } - if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 347 /* JSDocTypeTag */ && !node.comment) { - writeSpace(); - emit(node.tags[0]); - } else { - emitList(node, node.tags, 33 /* JSDocComment */); - } - } - writeSpace(); - write("*/"); - } - function emitJSDocSimpleTypedTag(tag) { - emitJSDocTagName(tag.tagName); - emitJSDocTypeExpression(tag.typeExpression); - emitJSDocComment(tag.comment); - } - function emitJSDocSeeTag(tag) { - emitJSDocTagName(tag.tagName); - emit(tag.name); - emitJSDocComment(tag.comment); - } - function emitJSDocNameReference(node) { - writeSpace(); - writePunctuation("{"); - emit(node.name); - writePunctuation("}"); - } - function emitJSDocHeritageTag(tag) { - emitJSDocTagName(tag.tagName); - writeSpace(); - writePunctuation("{"); - emit(tag.class); - writePunctuation("}"); - emitJSDocComment(tag.comment); - } - function emitJSDocTemplateTag(tag) { - emitJSDocTagName(tag.tagName); - emitJSDocTypeExpression(tag.constraint); - writeSpace(); - emitList(tag, tag.typeParameters, 528 /* CommaListElements */); - emitJSDocComment(tag.comment); - } - function emitJSDocTypedefTag(tag) { - emitJSDocTagName(tag.tagName); - if (tag.typeExpression) { - if (tag.typeExpression.kind === 312 /* JSDocTypeExpression */) { - emitJSDocTypeExpression(tag.typeExpression); - } else { - writeSpace(); - writePunctuation("{"); - write("Object"); - if (tag.typeExpression.isArrayType) { - writePunctuation("["); - writePunctuation("]"); - } - writePunctuation("}"); - } - } - if (tag.fullName) { - writeSpace(); - emit(tag.fullName); - } - emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 325 /* JSDocTypeLiteral */) { - emitJSDocTypeLiteral(tag.typeExpression); - } - } - function emitJSDocCallbackTag(tag) { - emitJSDocTagName(tag.tagName); - if (tag.name) { - writeSpace(); - emit(tag.name); - } - emitJSDocComment(tag.comment); - emitJSDocSignature(tag.typeExpression); - } - function emitJSDocOverloadTag(tag) { - emitJSDocComment(tag.comment); - emitJSDocSignature(tag.typeExpression); - } - function emitJSDocSimpleTag(tag) { - emitJSDocTagName(tag.tagName); - emitJSDocComment(tag.comment); - } - function emitJSDocTypeLiteral(lit) { - emitList(lit, factory.createNodeArray(lit.jsDocPropertyTags), 33 /* JSDocComment */); - } - function emitJSDocSignature(sig) { - if (sig.typeParameters) { - emitList(sig, factory.createNodeArray(sig.typeParameters), 33 /* JSDocComment */); - } - if (sig.parameters) { - emitList(sig, factory.createNodeArray(sig.parameters), 33 /* JSDocComment */); - } - if (sig.type) { - writeLine(); - writeSpace(); - writePunctuation("*"); - writeSpace(); - emit(sig.type); - } - } - function emitJSDocPropertyLikeTag(param) { - emitJSDocTagName(param.tagName); - emitJSDocTypeExpression(param.typeExpression); - writeSpace(); - if (param.isBracketed) { - writePunctuation("["); - } - emit(param.name); - if (param.isBracketed) { - writePunctuation("]"); - } - emitJSDocComment(param.comment); - } - function emitJSDocTagName(tagName) { - writePunctuation("@"); - emit(tagName); - } - function emitJSDocComment(comment) { - const text = getTextOfJSDocComment(comment); - if (text) { - writeSpace(); - write(text); - } - } - function emitJSDocTypeExpression(typeExpression) { - if (typeExpression) { - writeSpace(); - writePunctuation("{"); - emit(typeExpression.type); - writePunctuation("}"); - } - } - function emitSourceFile(node) { - writeLine(); - const statements = node.statements; - const shouldEmitDetachedComment = statements.length === 0 || !isPrologueDirective(statements[0]) || nodeIsSynthesized(statements[0]); - if (shouldEmitDetachedComment) { - emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); - return; - } - emitSourceFileWorker(node); - } - function emitSyntheticTripleSlashReferencesIfNeeded(node) { - emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []); - for (const prepend of node.prepends) { - if (isUnparsedSource(prepend) && prepend.syntheticReferences) { - for (const ref of prepend.syntheticReferences) { - emit(ref); - writeLine(); - } - } - } - } - function emitTripleSlashDirectivesIfNeeded(node) { - if (node.isDeclarationFile) - emitTripleSlashDirectives(node.hasNoDefaultLib, node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives); - } - function emitTripleSlashDirectives(hasNoDefaultLib, files, types, libs2) { - if (hasNoDefaultLib) { - const pos = writer.getTextPos(); - writeComment(`/// `); - if (bundleFileInfo) - bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "no-default-lib" /* NoDefaultLib */ }); - writeLine(); - } - if (currentSourceFile && currentSourceFile.moduleName) { - writeComment(`/// `); - writeLine(); - } - if (currentSourceFile && currentSourceFile.amdDependencies) { - for (const dep of currentSourceFile.amdDependencies) { - if (dep.name) { - writeComment(`/// `); - } else { - writeComment(`/// `); - } - writeLine(); - } - } - for (const directive of files) { - const pos = writer.getTextPos(); - writeComment(`/// `); - if (bundleFileInfo) - bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); - writeLine(); - } - for (const directive of types) { - const pos = writer.getTextPos(); - const resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile == null ? void 0 : currentSourceFile.impliedNodeFormat) ? `resolution-mode="${directive.resolutionMode === 99 /* ESNext */ ? "import" : "require"}"` : ""; - writeComment(`/// `); - if (bundleFileInfo) - bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: !directive.resolutionMode ? "type" /* Type */ : directive.resolutionMode === 99 /* ESNext */ ? "type-import" /* TypeResolutionModeImport */ : "type-require" /* TypeResolutionModeRequire */, data: directive.fileName }); - writeLine(); - } - for (const directive of libs2) { - const pos = writer.getTextPos(); - writeComment(`/// `); - if (bundleFileInfo) - bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName }); - writeLine(); - } - } - function emitSourceFileWorker(node) { - const statements = node.statements; - pushNameGenerationScope(node); - forEach(node.statements, generateNames); - emitHelpers(node); - const index = findIndex(statements, (statement) => !isPrologueDirective(statement)); - emitTripleSlashDirectivesIfNeeded(node); - emitList( - node, - statements, - 1 /* MultiLine */, - /*parenthesizerRule*/ - void 0, - index === -1 ? statements.length : index - ); - popNameGenerationScope(node); - } - function emitPartiallyEmittedExpression(node) { - const emitFlags = getEmitFlags(node); - if (!(emitFlags & 1024 /* NoLeadingComments */) && node.pos !== node.expression.pos) { - emitTrailingCommentsOfPosition(node.expression.pos); - } - emitExpression(node.expression); - if (!(emitFlags & 2048 /* NoTrailingComments */) && node.end !== node.expression.end) { - emitLeadingCommentsOfPosition(node.expression.end); - } - } - function emitCommaList(node) { - emitExpressionList( - node, - node.elements, - 528 /* CommaListElements */, - /*parenthesizerRule*/ - void 0 - ); - } - function emitPrologueDirectives(statements, sourceFile, seenPrologueDirectives, recordBundleFileSection) { - let needsToSetSourceFile = !!sourceFile; - for (let i = 0; i < statements.length; i++) { - const statement = statements[i]; - if (isPrologueDirective(statement)) { - const shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; - if (shouldEmitPrologueDirective) { - if (needsToSetSourceFile) { - needsToSetSourceFile = false; - setSourceFile(sourceFile); - } - writeLine(); - const pos = writer.getTextPos(); - emit(statement); - if (recordBundleFileSection && bundleFileInfo) - bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue" /* Prologue */, data: statement.expression.text }); - if (seenPrologueDirectives) { - seenPrologueDirectives.add(statement.expression.text); - } - } - } else { - return i; - } - } - return statements.length; - } - function emitUnparsedPrologues(prologues, seenPrologueDirectives) { - for (const prologue of prologues) { - if (!seenPrologueDirectives.has(prologue.data)) { - writeLine(); - const pos = writer.getTextPos(); - emit(prologue); - if (bundleFileInfo) - bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue" /* Prologue */, data: prologue.data }); - if (seenPrologueDirectives) { - seenPrologueDirectives.add(prologue.data); - } - } - } - } - function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { - if (isSourceFile(sourceFileOrBundle)) { - emitPrologueDirectives(sourceFileOrBundle.statements, sourceFileOrBundle); - } else { - const seenPrologueDirectives = /* @__PURE__ */ new Set(); - for (const prepend of sourceFileOrBundle.prepends) { - emitUnparsedPrologues(prepend.prologues, seenPrologueDirectives); - } - for (const sourceFile of sourceFileOrBundle.sourceFiles) { - emitPrologueDirectives( - sourceFile.statements, - sourceFile, - seenPrologueDirectives, - /*recordBundleFileSection*/ - true - ); - } - setSourceFile(void 0); - } - } - function getPrologueDirectivesFromBundledSourceFiles(bundle) { - const seenPrologueDirectives = /* @__PURE__ */ new Set(); - let prologues; - for (let index = 0; index < bundle.sourceFiles.length; index++) { - const sourceFile = bundle.sourceFiles[index]; - let directives; - let end = 0; - for (const statement of sourceFile.statements) { - if (!isPrologueDirective(statement)) - break; - if (seenPrologueDirectives.has(statement.expression.text)) - continue; - seenPrologueDirectives.add(statement.expression.text); - (directives || (directives = [])).push({ - pos: statement.pos, - end: statement.end, - expression: { - pos: statement.expression.pos, - end: statement.expression.end, - text: statement.expression.text - } - }); - end = end < statement.end ? statement.end : end; - } - if (directives) - (prologues || (prologues = [])).push({ file: index, text: sourceFile.text.substring(0, end), directives }); - } - return prologues; - } - function emitShebangIfNeeded(sourceFileOrBundle) { - if (isSourceFile(sourceFileOrBundle) || isUnparsedSource(sourceFileOrBundle)) { - const shebang = getShebang(sourceFileOrBundle.text); - if (shebang) { - writeComment(shebang); - writeLine(); - return true; - } - } else { - for (const prepend of sourceFileOrBundle.prepends) { - Debug.assertNode(prepend, isUnparsedSource); - if (emitShebangIfNeeded(prepend)) { - return true; - } - } - for (const sourceFile of sourceFileOrBundle.sourceFiles) { - if (emitShebangIfNeeded(sourceFile)) { - return true; - } - } - } - } - function emitNodeWithWriter(node, writer2) { - if (!node) - return; - const savedWrite = write; - write = writer2; - emit(node); - write = savedWrite; - } - function emitDecoratorsAndModifiers(node, modifiers, allowDecorators) { - if (modifiers == null ? void 0 : modifiers.length) { - if (every(modifiers, isModifier)) { - return emitModifierList(node, modifiers); - } - if (every(modifiers, isDecorator)) { - if (allowDecorators) { - return emitDecoratorList(node, modifiers); - } - return node.pos; - } - onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); - let lastMode; - let mode; - let start = 0; - let pos = 0; - let lastModifier; - while (start < modifiers.length) { - while (pos < modifiers.length) { - lastModifier = modifiers[pos]; - mode = isDecorator(lastModifier) ? "decorators" : "modifiers"; - if (lastMode === void 0) { - lastMode = mode; - } else if (mode !== lastMode) { - break; - } - pos++; - } - const textRange = { pos: -1, end: -1 }; - if (start === 0) - textRange.pos = modifiers.pos; - if (pos === modifiers.length - 1) - textRange.end = modifiers.end; - if (lastMode === "modifiers" || allowDecorators) { - emitNodeListItems( - emit, - node, - modifiers, - lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, - /*parenthesizerRule*/ - void 0, - start, - pos - start, - /*hasTrailingComma*/ - false, - textRange - ); - } - start = pos; - lastMode = mode; - pos++; - } - onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); - if (lastModifier && !positionIsSynthesized(lastModifier.end)) { - return lastModifier.end; - } - } - return node.pos; - } - function emitModifierList(node, modifiers) { - emitList(node, modifiers, 2359808 /* Modifiers */); - const lastModifier = lastOrUndefined(modifiers); - return lastModifier && !positionIsSynthesized(lastModifier.end) ? lastModifier.end : node.pos; - } - function emitTypeAnnotation(node) { - if (node) { - writePunctuation(":"); - writeSpace(); - emit(node); - } - } - function emitInitializer(node, equalCommentStartPos, container, parenthesizerRule) { - if (node) { - writeSpace(); - emitTokenWithComment(63 /* EqualsToken */, equalCommentStartPos, writeOperator, container); - writeSpace(); - emitExpression(node, parenthesizerRule); - } - } - function emitNodeWithPrefix(prefix, prefixWriter, node, emit2) { - if (node) { - prefixWriter(prefix); - emit2(node); - } - } - function emitWithLeadingSpace(node) { - if (node) { - writeSpace(); - emit(node); - } - } - function emitExpressionWithLeadingSpace(node, parenthesizerRule) { - if (node) { - writeSpace(); - emitExpression(node, parenthesizerRule); - } - } - function emitWithTrailingSpace(node) { - if (node) { - emit(node); - writeSpace(); - } - } - function emitEmbeddedStatement(parent, node) { - if (isBlock(node) || getEmitFlags(parent) & 1 /* SingleLine */) { - writeSpace(); - emit(node); - } else { - writeLine(); - increaseIndent(); - if (isEmptyStatement(node)) { - pipelineEmit(5 /* EmbeddedStatement */, node); - } else { - emit(node); - } - decreaseIndent(); - } - } - function emitDecoratorList(parentNode, decorators) { - emitList(parentNode, decorators, 2146305 /* Decorators */); - const lastDecorator = lastOrUndefined(decorators); - return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos; - } - function emitTypeArguments(parentNode, typeArguments) { - emitList(parentNode, typeArguments, 53776 /* TypeArguments */, typeArgumentParenthesizerRuleSelector); - } - function emitTypeParameters(parentNode, typeParameters) { - if (isFunctionLike(parentNode) && parentNode.typeArguments) { - return emitTypeArguments(parentNode, parentNode.typeArguments); - } - emitList(parentNode, typeParameters, 53776 /* TypeParameters */); - } - function emitParameters(parentNode, parameters) { - emitList(parentNode, parameters, 2576 /* Parameters */); - } - function canEmitSimpleArrowHead(parentNode, parameters) { - const parameter = singleOrUndefined(parameters); - return parameter && parameter.pos === parentNode.pos && isArrowFunction(parentNode) && !parentNode.type && !some(parentNode.modifiers) && !some(parentNode.typeParameters) && !some(parameter.modifiers) && !parameter.dotDotDotToken && !parameter.questionToken && !parameter.type && !parameter.initializer && isIdentifier(parameter.name); - } - function emitParametersForArrow(parentNode, parameters) { - if (canEmitSimpleArrowHead(parentNode, parameters)) { - emitList(parentNode, parameters, 2576 /* Parameters */ & ~2048 /* Parenthesis */); - } else { - emitParameters(parentNode, parameters); - } - } - function emitParametersForIndexSignature(parentNode, parameters) { - emitList(parentNode, parameters, 8848 /* IndexSignatureParameters */); - } - function writeDelimiter(format) { - switch (format & 60 /* DelimitersMask */) { - case 0 /* None */: - break; - case 16 /* CommaDelimited */: - writePunctuation(","); - break; - case 4 /* BarDelimited */: - writeSpace(); - writePunctuation("|"); - break; - case 32 /* AsteriskDelimited */: - writeSpace(); - writePunctuation("*"); - writeSpace(); - break; - case 8 /* AmpersandDelimited */: - writeSpace(); - writePunctuation("&"); - break; - } - } - function emitList(parentNode, children, format, parenthesizerRule, start, count) { - emitNodeList( - emit, - parentNode, - children, - format | (parentNode && getEmitFlags(parentNode) & 2 /* MultiLine */ ? 65536 /* PreferNewLine */ : 0), - parenthesizerRule, - start, - count - ); - } - function emitExpressionList(parentNode, children, format, parenthesizerRule, start, count) { - emitNodeList(emitExpression, parentNode, children, format, parenthesizerRule, start, count); - } - function emitNodeList(emit2, parentNode, children, format, parenthesizerRule, start = 0, count = children ? children.length - start : 0) { - const isUndefined = children === void 0; - if (isUndefined && format & 16384 /* OptionalIfUndefined */) { - return; - } - const isEmpty = children === void 0 || start >= children.length || count === 0; - if (isEmpty && format & 32768 /* OptionalIfEmpty */) { - onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); - onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); - return; - } - if (format & 15360 /* BracketsMask */) { - writePunctuation(getOpeningBracket(format)); - if (isEmpty && children) { - emitTrailingCommentsOfPosition( - children.pos, - /*prefixSpace*/ - true - ); - } - } - onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); - if (isEmpty) { - if (format & 1 /* MultiLine */ && !(preserveSourceNewlines && (!parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile)))) { - writeLine(); - } else if (format & 256 /* SpaceBetweenBraces */ && !(format & 524288 /* NoSpaceIfEmpty */)) { - writeSpace(); - } - } else { - emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start, count, children.hasTrailingComma, children); - } - onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); - if (format & 15360 /* BracketsMask */) { - if (isEmpty && children) { - emitLeadingCommentsOfPosition(children.end); - } - writePunctuation(getClosingBracket(format)); - } - } - function emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start, count, hasTrailingComma, childrenTextRange) { - const mayEmitInterveningComments = (format & 262144 /* NoInterveningComments */) === 0; - let shouldEmitInterveningComments = mayEmitInterveningComments; - const leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children[start], format); - if (leadingLineTerminatorCount) { - writeLine(leadingLineTerminatorCount); - shouldEmitInterveningComments = false; - } else if (format & 256 /* SpaceBetweenBraces */) { - writeSpace(); - } - if (format & 128 /* Indented */) { - increaseIndent(); - } - const emitListItem = getEmitListItem(emit2, parenthesizerRule); - let previousSibling; - let previousSourceFileTextKind; - let shouldDecreaseIndentAfterEmit = false; - for (let i = 0; i < count; i++) { - const child = children[start + i]; - if (format & 32 /* AsteriskDelimited */) { - writeLine(); - writeDelimiter(format); - } else if (previousSibling) { - if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) { - const previousSiblingEmitFlags = getEmitFlags(previousSibling); - if (!(previousSiblingEmitFlags & 2048 /* NoTrailingComments */)) { - emitLeadingCommentsOfPosition(previousSibling.end); - } - } - writeDelimiter(format); - recordBundleFileInternalSectionEnd(previousSourceFileTextKind); - const separatingLineTerminatorCount = getSeparatingLineTerminatorCount(previousSibling, child, format); - if (separatingLineTerminatorCount > 0) { - if ((format & (3 /* LinesMask */ | 128 /* Indented */)) === 0 /* SingleLine */) { - increaseIndent(); - shouldDecreaseIndentAfterEmit = true; - } - writeLine(separatingLineTerminatorCount); - shouldEmitInterveningComments = false; - } else if (previousSibling && format & 512 /* SpaceBetweenSiblings */) { - writeSpace(); - } - } - previousSourceFileTextKind = recordBundleFileInternalSectionStart(child); - if (shouldEmitInterveningComments) { - const commentRange = getCommentRange(child); - emitTrailingCommentsOfPosition(commentRange.pos); - } else { - shouldEmitInterveningComments = mayEmitInterveningComments; - } - nextListElementPos = child.pos; - emitListItem(child, emit2, parenthesizerRule, i); - if (shouldDecreaseIndentAfterEmit) { - decreaseIndent(); - shouldDecreaseIndentAfterEmit = false; - } - previousSibling = child; - } - const emitFlags = previousSibling ? getEmitFlags(previousSibling) : 0; - const skipTrailingComments = commentsDisabled || !!(emitFlags & 2048 /* NoTrailingComments */); - const emitTrailingComma = hasTrailingComma && format & 64 /* AllowTrailingComma */ && format & 16 /* CommaDelimited */; - if (emitTrailingComma) { - if (previousSibling && !skipTrailingComments) { - emitTokenWithComment(27 /* CommaToken */, previousSibling.end, writePunctuation, previousSibling); - } else { - writePunctuation(","); - } - } - if (previousSibling && (parentNode ? parentNode.end : -1) !== previousSibling.end && format & 60 /* DelimitersMask */ && !skipTrailingComments) { - emitLeadingCommentsOfPosition(emitTrailingComma && (childrenTextRange == null ? void 0 : childrenTextRange.end) ? childrenTextRange.end : previousSibling.end); - } - if (format & 128 /* Indented */) { - decreaseIndent(); - } - recordBundleFileInternalSectionEnd(previousSourceFileTextKind); - const closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children[start + count - 1], format, childrenTextRange); - if (closingLineTerminatorCount) { - writeLine(closingLineTerminatorCount); - } else if (format & (2097152 /* SpaceAfterList */ | 256 /* SpaceBetweenBraces */)) { - writeSpace(); - } - } - function writeLiteral(s) { - writer.writeLiteral(s); - } - function writeStringLiteral(s) { - writer.writeStringLiteral(s); - } - function writeBase(s) { - writer.write(s); - } - function writeSymbol(s, sym) { - writer.writeSymbol(s, sym); - } - function writePunctuation(s) { - writer.writePunctuation(s); - } - function writeTrailingSemicolon() { - writer.writeTrailingSemicolon(";"); - } - function writeKeyword(s) { - writer.writeKeyword(s); - } - function writeOperator(s) { - writer.writeOperator(s); - } - function writeParameter(s) { - writer.writeParameter(s); - } - function writeComment(s) { - writer.writeComment(s); - } - function writeSpace() { - writer.writeSpace(" "); - } - function writeProperty(s) { - writer.writeProperty(s); - } - function nonEscapingWrite(s) { - if (writer.nonEscapingWrite) { - writer.nonEscapingWrite(s); - } else { - writer.write(s); - } - } - function writeLine(count = 1) { - for (let i = 0; i < count; i++) { - writer.writeLine(i > 0); - } - } - function increaseIndent() { - writer.increaseIndent(); - } - function decreaseIndent() { - writer.decreaseIndent(); - } - function writeToken(token, pos, writer2, contextNode) { - return !sourceMapsDisabled ? emitTokenWithSourceMap(contextNode, token, writer2, pos, writeTokenText) : writeTokenText(token, writer2, pos); - } - function writeTokenNode(node, writer2) { - if (onBeforeEmitToken) { - onBeforeEmitToken(node); - } - writer2(tokenToString(node.kind)); - if (onAfterEmitToken) { - onAfterEmitToken(node); - } - } - function writeTokenText(token, writer2, pos) { - const tokenString = tokenToString(token); - writer2(tokenString); - return pos < 0 ? pos : pos + tokenString.length; - } - function writeLineOrSpace(parentNode, prevChildNode, nextChildNode) { - if (getEmitFlags(parentNode) & 1 /* SingleLine */) { - writeSpace(); - } else if (preserveSourceNewlines) { - const lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode); - if (lines) { - writeLine(lines); - } else { - writeSpace(); - } - } else { - writeLine(); - } - } - function writeLines(text) { - const lines = text.split(/\r\n?|\n/g); - const indentation = guessIndentation(lines); - for (const lineText of lines) { - const line = indentation ? lineText.slice(indentation) : lineText; - if (line.length) { - writeLine(); - write(line); - } - } - } - function writeLinesAndIndent(lineCount, writeSpaceIfNotIndenting) { - if (lineCount) { - increaseIndent(); - writeLine(lineCount); - } else if (writeSpaceIfNotIndenting) { - writeSpace(); - } - } - function decreaseIndentIf(value1, value2) { - if (value1) { - decreaseIndent(); - } - if (value2) { - decreaseIndent(); - } - } - function getLeadingLineTerminatorCount(parentNode, firstChild, format) { - if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { - if (format & 65536 /* PreferNewLine */) { - return 1; - } - if (firstChild === void 0) { - return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; - } - if (firstChild.pos === nextListElementPos) { - return 0; - } - if (firstChild.kind === 11 /* JsxText */) { - return 0; - } - if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(firstChild) && (!firstChild.parent || getOriginalNode(firstChild.parent) === getOriginalNode(parentNode))) { - if (preserveSourceNewlines) { - return getEffectiveLines( - (includeComments) => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter( - firstChild.pos, - parentNode.pos, - currentSourceFile, - includeComments - ) - ); - } - return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile) ? 0 : 1; - } - if (synthesizedNodeStartsOnNewLine(firstChild, format)) { - return 1; - } - } - return format & 1 /* MultiLine */ ? 1 : 0; - } - function getSeparatingLineTerminatorCount(previousNode, nextNode, format) { - if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { - if (previousNode === void 0 || nextNode === void 0) { - return 0; - } - if (nextNode.kind === 11 /* JsxText */) { - return 0; - } else if (currentSourceFile && !nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) { - if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) { - return getEffectiveLines( - (includeComments) => getLinesBetweenRangeEndAndRangeStart( - previousNode, - nextNode, - currentSourceFile, - includeComments - ) - ); - } else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) { - return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1; - } - return format & 65536 /* PreferNewLine */ ? 1 : 0; - } else if (synthesizedNodeStartsOnNewLine(previousNode, format) || synthesizedNodeStartsOnNewLine(nextNode, format)) { - return 1; - } - } else if (getStartsOnNewLine(nextNode)) { - return 1; - } - return format & 1 /* MultiLine */ ? 1 : 0; - } - function getClosingLineTerminatorCount(parentNode, lastChild, format, childrenTextRange) { - if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { - if (format & 65536 /* PreferNewLine */) { - return 1; - } - if (lastChild === void 0) { - return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; - } - if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) { - if (preserveSourceNewlines) { - const end = childrenTextRange && !positionIsSynthesized(childrenTextRange.end) ? childrenTextRange.end : lastChild.end; - return getEffectiveLines( - (includeComments) => getLinesBetweenPositionAndNextNonWhitespaceCharacter( - end, - parentNode.end, - currentSourceFile, - includeComments - ) - ); - } - return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1; - } - if (synthesizedNodeStartsOnNewLine(lastChild, format)) { - return 1; - } - } - if (format & 1 /* MultiLine */ && !(format & 131072 /* NoTrailingNewLine */)) { - return 1; - } - return 0; - } - function getEffectiveLines(getLineDifference) { - Debug.assert(!!preserveSourceNewlines); - const lines = getLineDifference( - /*includeComments*/ - true - ); - if (lines === 0) { - return getLineDifference( - /*includeComments*/ - false - ); - } - return lines; - } - function writeLineSeparatorsAndIndentBefore(node, parent) { - const leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent, node, 0 /* None */); - if (leadingNewlines) { - writeLinesAndIndent( - leadingNewlines, - /*writeSpaceIfNotIndenting*/ - false - ); - } - return !!leadingNewlines; - } - function writeLineSeparatorsAfter(node, parent) { - const trailingNewlines = preserveSourceNewlines && getClosingLineTerminatorCount( - parent, - node, - 0 /* None */, - /*childrenTextRange*/ - void 0 - ); - if (trailingNewlines) { - writeLine(trailingNewlines); - } - } - function synthesizedNodeStartsOnNewLine(node, format) { - if (nodeIsSynthesized(node)) { - const startsOnNewLine = getStartsOnNewLine(node); - if (startsOnNewLine === void 0) { - return (format & 65536 /* PreferNewLine */) !== 0; - } - return startsOnNewLine; - } - return (format & 65536 /* PreferNewLine */) !== 0; - } - function getLinesBetweenNodes(parent, node1, node2) { - if (getEmitFlags(parent) & 262144 /* NoIndentation */) { - return 0; - } - parent = skipSynthesizedParentheses(parent); - node1 = skipSynthesizedParentheses(node1); - node2 = skipSynthesizedParentheses(node2); - if (getStartsOnNewLine(node2)) { - return 1; - } - if (currentSourceFile && !nodeIsSynthesized(parent) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) { - if (preserveSourceNewlines) { - return getEffectiveLines( - (includeComments) => getLinesBetweenRangeEndAndRangeStart( - node1, - node2, - currentSourceFile, - includeComments - ) - ); - } - return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1; - } - return 0; - } - function isEmptyBlock(block) { - return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); - } - function skipSynthesizedParentheses(node) { - while (node.kind === 214 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { - node = node.expression; - } - return node; - } - function getTextOfNode2(node, includeTrivia) { - if (isGeneratedIdentifier(node) || isGeneratedPrivateIdentifier(node)) { - return generateName(node); - } - if (isStringLiteral(node) && node.textSourceNode) { - return getTextOfNode2(node.textSourceNode, includeTrivia); - } - const sourceFile = currentSourceFile; - const canUseSourceFile = !!sourceFile && !!node.parent && !nodeIsSynthesized(node); - if (isMemberName(node)) { - if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) { - return idText(node); - } - } else { - Debug.assertNode(node, isLiteralExpression); - if (!canUseSourceFile) { - return node.text; - } - } - return getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia); - } - function getLiteralTextOfNode(node, neverAsciiEscape, jsxAttributeEscape) { - if (node.kind === 10 /* StringLiteral */ && node.textSourceNode) { - const textSourceNode = node.textSourceNode; - if (isIdentifier(textSourceNode) || isPrivateIdentifier(textSourceNode) || isNumericLiteral(textSourceNode)) { - const text = isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode2(textSourceNode); - return jsxAttributeEscape ? `"${escapeJsxAttributeString(text)}"` : neverAsciiEscape || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? `"${escapeString(text)}"` : `"${escapeNonAsciiString(text)}"`; - } else { - return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); - } - } - const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0); - return getLiteralText(node, currentSourceFile, flags); - } - function pushNameGenerationScope(node) { - if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { - return; - } - tempFlagsStack.push(tempFlags); - tempFlags = TempFlags.Auto; - formattedNameTempFlagsStack.push(formattedNameTempFlags); - formattedNameTempFlags = void 0; - reservedNamesStack.push(reservedNames); - } - function popNameGenerationScope(node) { - if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { - return; - } - tempFlags = tempFlagsStack.pop(); - formattedNameTempFlags = formattedNameTempFlagsStack.pop(); - reservedNames = reservedNamesStack.pop(); - } - function reserveNameInNestedScopes(name) { - if (!reservedNames || reservedNames === lastOrUndefined(reservedNamesStack)) { - reservedNames = /* @__PURE__ */ new Set(); - } - reservedNames.add(name); - } - function pushPrivateNameGenerationScope(newPrivateNameTempFlags, newReservedMemberNames) { - privateNameTempFlagsStack.push(privateNameTempFlags); - privateNameTempFlags = newPrivateNameTempFlags; - reservedPrivateNamesStack.push(reservedNames); - reservedPrivateNames = newReservedMemberNames; - } - function popPrivateNameGenerationScope() { - privateNameTempFlags = privateNameTempFlagsStack.pop(); - reservedPrivateNames = reservedPrivateNamesStack.pop(); - } - function reservePrivateNameInNestedScopes(name) { - if (!reservedPrivateNames || reservedPrivateNames === lastOrUndefined(reservedPrivateNamesStack)) { - reservedPrivateNames = /* @__PURE__ */ new Set(); - } - reservedPrivateNames.add(name); - } - function generateNames(node) { - if (!node) - return; - switch (node.kind) { - case 238 /* Block */: - forEach(node.statements, generateNames); - break; - case 253 /* LabeledStatement */: - case 251 /* WithStatement */: - case 243 /* DoStatement */: - case 244 /* WhileStatement */: - generateNames(node.statement); - break; - case 242 /* IfStatement */: - generateNames(node.thenStatement); - generateNames(node.elseStatement); - break; - case 245 /* ForStatement */: - case 247 /* ForOfStatement */: - case 246 /* ForInStatement */: - generateNames(node.initializer); - generateNames(node.statement); - break; - case 252 /* SwitchStatement */: - generateNames(node.caseBlock); - break; - case 266 /* CaseBlock */: - forEach(node.clauses, generateNames); - break; - case 292 /* CaseClause */: - case 293 /* DefaultClause */: - forEach(node.statements, generateNames); - break; - case 255 /* TryStatement */: - generateNames(node.tryBlock); - generateNames(node.catchClause); - generateNames(node.finallyBlock); - break; - case 295 /* CatchClause */: - generateNames(node.variableDeclaration); - generateNames(node.block); - break; - case 240 /* VariableStatement */: - generateNames(node.declarationList); - break; - case 258 /* VariableDeclarationList */: - forEach(node.declarations, generateNames); - break; - case 257 /* VariableDeclaration */: - case 166 /* Parameter */: - case 205 /* BindingElement */: - case 260 /* ClassDeclaration */: - generateNameIfNeeded(node.name); - break; - case 259 /* FunctionDeclaration */: - generateNameIfNeeded(node.name); - if (getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { - forEach(node.parameters, generateNames); - generateNames(node.body); - } - break; - case 203 /* ObjectBindingPattern */: - case 204 /* ArrayBindingPattern */: - forEach(node.elements, generateNames); - break; - case 269 /* ImportDeclaration */: - generateNames(node.importClause); - break; - case 270 /* ImportClause */: - generateNameIfNeeded(node.name); - generateNames(node.namedBindings); - break; - case 271 /* NamespaceImport */: - generateNameIfNeeded(node.name); - break; - case 277 /* NamespaceExport */: - generateNameIfNeeded(node.name); - break; - case 272 /* NamedImports */: - forEach(node.elements, generateNames); - break; - case 273 /* ImportSpecifier */: - generateNameIfNeeded(node.propertyName || node.name); - break; - } - } - function generateMemberNames(node) { - if (!node) - return; - switch (node.kind) { - case 299 /* PropertyAssignment */: - case 300 /* ShorthandPropertyAssignment */: - case 169 /* PropertyDeclaration */: - case 171 /* MethodDeclaration */: - case 174 /* GetAccessor */: - case 175 /* SetAccessor */: - generateNameIfNeeded(node.name); - break; - } - } - function generateNameIfNeeded(name) { - if (name) { - if (isGeneratedIdentifier(name) || isGeneratedPrivateIdentifier(name)) { - generateName(name); - } else if (isBindingPattern(name)) { - generateNames(name); - } - } - } - function generateName(name) { - const autoGenerate = name.emitNode.autoGenerate; - if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { - return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix); - } else { - const autoGenerateId = autoGenerate.id; - return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name)); - } - } - function generateNameCached(node, privateName, flags, prefix, suffix) { - const nodeId = getNodeId(node); - const cache = privateName ? nodeIdToGeneratedPrivateName : nodeIdToGeneratedName; - return cache[nodeId] || (cache[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); - } - function isUniqueName(name, privateName) { - return isFileLevelUniqueName2(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name); - } - function isReservedName(name, privateName) { - return privateName ? !!(reservedPrivateNames == null ? void 0 : reservedPrivateNames.has(name)) : !!(reservedNames == null ? void 0 : reservedNames.has(name)); - } - function isFileLevelUniqueName2(name, _isPrivate) { - return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true; - } - function isUniqueLocalName(name, container) { - for (let node = container; node && isNodeDescendantOf(node, container); node = node.nextContainer) { - if (canHaveLocals(node) && node.locals) { - const local = node.locals.get(escapeLeadingUnderscores(name)); - if (local && local.flags & (111551 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) { - return false; - } - } - } - return true; - } - function getTempFlags(formattedNameKey) { - var _a2; - switch (formattedNameKey) { - case "": - return tempFlags; - case "#": - return privateNameTempFlags; - default: - return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : TempFlags.Auto; - } - } - function setTempFlags(formattedNameKey, flags) { - switch (formattedNameKey) { - case "": - tempFlags = flags; - break; - case "#": - privateNameTempFlags = flags; - break; - default: - formattedNameTempFlags != null ? formattedNameTempFlags : formattedNameTempFlags = /* @__PURE__ */ new Map(); - formattedNameTempFlags.set(formattedNameKey, flags); - break; - } - } - function makeTempVariableName(flags, reservedInNestedScopes, privateName, prefix, suffix) { - if (prefix.length > 0 && prefix.charCodeAt(0) === 35 /* hash */) { - prefix = prefix.slice(1); - } - const key = formatGeneratedName(privateName, prefix, "", suffix); - let tempFlags2 = getTempFlags(key); - if (flags && !(tempFlags2 & flags)) { - const name = flags === TempFlags._i ? "_i" : "_n"; - const fullName = formatGeneratedName(privateName, prefix, name, suffix); - if (isUniqueName(fullName, privateName)) { - tempFlags2 |= flags; - if (privateName) { - reservePrivateNameInNestedScopes(fullName); - } else if (reservedInNestedScopes) { - reserveNameInNestedScopes(fullName); - } - setTempFlags(key, tempFlags2); - return fullName; - } - } - while (true) { - const count = tempFlags2 & TempFlags.CountMask; - tempFlags2++; - if (count !== 8 && count !== 13) { - const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); - const fullName = formatGeneratedName(privateName, prefix, name, suffix); - if (isUniqueName(fullName, privateName)) { - if (privateName) { - reservePrivateNameInNestedScopes(fullName); - } else if (reservedInNestedScopes) { - reserveNameInNestedScopes(fullName); - } - setTempFlags(key, tempFlags2); - return fullName; - } - } - } - } - function makeUniqueName(baseName, checkFn = isUniqueName, optimistic, scoped, privateName, prefix, suffix) { - if (baseName.length > 0 && baseName.charCodeAt(0) === 35 /* hash */) { - baseName = baseName.slice(1); - } - if (prefix.length > 0 && prefix.charCodeAt(0) === 35 /* hash */) { - prefix = prefix.slice(1); - } - if (optimistic) { - const fullName = formatGeneratedName(privateName, prefix, baseName, suffix); - if (checkFn(fullName, privateName)) { - if (privateName) { - reservePrivateNameInNestedScopes(fullName); - } else if (scoped) { - reserveNameInNestedScopes(fullName); - } else { - generatedNames.add(fullName); - } - return fullName; - } - } - if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { - baseName += "_"; - } - let i = 1; - while (true) { - const fullName = formatGeneratedName(privateName, prefix, baseName + i, suffix); - if (checkFn(fullName, privateName)) { - if (privateName) { - reservePrivateNameInNestedScopes(fullName); - } else if (scoped) { - reserveNameInNestedScopes(fullName); - } else { - generatedNames.add(fullName); - } - return fullName; - } - i++; - } - } - function makeFileLevelOptimisticUniqueName(name) { - return makeUniqueName( - name, - isFileLevelUniqueName2, - /*optimistic*/ - true, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForModuleOrEnum(node) { - const name = getTextOfNode2(node.name); - return isUniqueLocalName(name, tryCast(node, canHaveLocals)) ? name : makeUniqueName( - name, - isUniqueName, - /*optimistic*/ - false, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForImportOrExportDeclaration(node) { - const expr = getExternalModuleName(node); - const baseName = isStringLiteral(expr) ? makeIdentifierFromModuleName(expr.text) : "module"; - return makeUniqueName( - baseName, - isUniqueName, - /*optimistic*/ - false, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForExportDefault() { - return makeUniqueName( - "default", - isUniqueName, - /*optimistic*/ - false, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForClassExpression() { - return makeUniqueName( - "class", - isUniqueName, - /*optimistic*/ - false, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForMethodOrAccessor(node, privateName, prefix, suffix) { - if (isIdentifier(node.name)) { - return generateNameCached(node.name, privateName); - } - return makeTempVariableName( - TempFlags.Auto, - /*reservedInNestedScopes*/ - false, - privateName, - prefix, - suffix - ); - } - function generateNameForNode(node, privateName, flags, prefix, suffix) { - switch (node.kind) { - case 79 /* Identifier */: - case 80 /* PrivateIdentifier */: - return makeUniqueName( - getTextOfNode2(node), - isUniqueName, - !!(flags & 16 /* Optimistic */), - !!(flags & 8 /* ReservedInNestedScopes */), - privateName, - prefix, - suffix - ); - case 264 /* ModuleDeclaration */: - case 263 /* EnumDeclaration */: - Debug.assert(!prefix && !suffix && !privateName); - return generateNameForModuleOrEnum(node); - case 269 /* ImportDeclaration */: - case 275 /* ExportDeclaration */: - Debug.assert(!prefix && !suffix && !privateName); - return generateNameForImportOrExportDeclaration(node); - case 259 /* FunctionDeclaration */: - case 260 /* ClassDeclaration */: { - Debug.assert(!prefix && !suffix && !privateName); - const name = node.name; - if (name && !isGeneratedIdentifier(name)) { - return generateNameForNode( - name, - /*privateName*/ - false, - flags, - prefix, - suffix - ); - } - return generateNameForExportDefault(); - } - case 274 /* ExportAssignment */: - Debug.assert(!prefix && !suffix && !privateName); - return generateNameForExportDefault(); - case 228 /* ClassExpression */: - Debug.assert(!prefix && !suffix && !privateName); - return generateNameForClassExpression(); - case 171 /* MethodDeclaration */: - case 174 /* GetAccessor */: - case 175 /* SetAccessor */: - return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); - case 164 /* ComputedPropertyName */: - return makeTempVariableName( - TempFlags.Auto, - /*reserveInNestedScopes*/ - true, - privateName, - prefix, - suffix - ); - default: - return makeTempVariableName( - TempFlags.Auto, - /*reserveInNestedScopes*/ - false, - privateName, - prefix, - suffix - ); - } - } - function makeName(name) { - const autoGenerate = name.emitNode.autoGenerate; - const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName); - const suffix = formatGeneratedNamePart(autoGenerate.suffix); - switch (autoGenerate.flags & 7 /* KindMask */) { - case 1 /* Auto */: - return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); - case 2 /* Loop */: - Debug.assertNode(name, isIdentifier); - return makeTempVariableName( - TempFlags._i, - !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), - /*privateName*/ - false, - prefix, - suffix - ); - case 3 /* Unique */: - return makeUniqueName( - idText(name), - autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, - !!(autoGenerate.flags & 16 /* Optimistic */), - !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), - isPrivateIdentifier(name), - prefix, - suffix - ); - } - return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum( - autoGenerate.flags & 7 /* KindMask */, - GeneratedIdentifierFlags, - /*isFlags*/ - true - )}.`); - } - function pipelineEmitWithComments(hint, node) { - const pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node); - const savedContainerPos = containerPos; - const savedContainerEnd = containerEnd; - const savedDeclarationListContainerEnd = declarationListContainerEnd; - emitCommentsBeforeNode(node); - pipelinePhase(hint, node); - emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); - } - function emitCommentsBeforeNode(node) { - const emitFlags = getEmitFlags(node); - const commentRange = getCommentRange(node); - emitLeadingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end); - if (emitFlags & 4096 /* NoNestedComments */) { - commentsDisabled = true; - } - } - function emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { - const emitFlags = getEmitFlags(node); - const commentRange = getCommentRange(node); - if (emitFlags & 4096 /* NoNestedComments */) { - commentsDisabled = false; - } - emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); - const typeNode = getTypeNode(node); - if (typeNode) { - emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); - } - } - function emitLeadingCommentsOfNode(node, emitFlags, pos, end) { - enterComment(); - hasWrittenComment = false; - const skipLeadingComments = pos < 0 || (emitFlags & 1024 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; - const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */; - if ((pos > 0 || end > 0) && pos !== end) { - if (!skipLeadingComments) { - emitLeadingComments( - pos, - /*isEmittedNode*/ - node.kind !== 355 /* NotEmittedStatement */ - ); - } - if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { - containerPos = pos; - } - if (!skipTrailingComments || end >= 0 && (emitFlags & 2048 /* NoTrailingComments */) !== 0) { - containerEnd = end; - if (node.kind === 258 /* VariableDeclarationList */) { - declarationListContainerEnd = end; - } - } - } - forEach(getSyntheticLeadingComments(node), emitLeadingSynthesizedComment); - exitComment(); - } - function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { - enterComment(); - const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */; - forEach(getSyntheticTrailingComments(node), emitTrailingSynthesizedComment); - if ((pos > 0 || end > 0) && pos !== end) { - containerPos = savedContainerPos; - containerEnd = savedContainerEnd; - declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) { - emitTrailingComments(end); - } - } - exitComment(); - } - function emitLeadingSynthesizedComment(comment) { - if (comment.hasLeadingNewline || comment.kind === 2 /* SingleLineCommentTrivia */) { - writer.writeLine(); - } - writeSynthesizedComment(comment); - if (comment.hasTrailingNewLine || comment.kind === 2 /* SingleLineCommentTrivia */) { - writer.writeLine(); - } else { - writer.writeSpace(" "); - } - } - function emitTrailingSynthesizedComment(comment) { - if (!writer.isAtStartOfLine()) { - writer.writeSpace(" "); - } - writeSynthesizedComment(comment); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - } - function writeSynthesizedComment(comment) { - const text = formatSynthesizedComment(comment); - const lineMap = comment.kind === 3 /* MultiLineCommentTrivia */ ? computeLineStarts(text) : void 0; - writeCommentRange(text, lineMap, writer, 0, text.length, newLine); - } - function formatSynthesizedComment(comment) { - return comment.kind === 3 /* MultiLineCommentTrivia */ ? `/*${comment.text}*/` : `//${comment.text}`; - } - function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { - enterComment(); - const { pos, end } = detachedRange; - const emitFlags = getEmitFlags(node); - const skipLeadingComments = pos < 0 || (emitFlags & 1024 /* NoLeadingComments */) !== 0; - const skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0; - if (!skipLeadingComments) { - emitDetachedCommentsAndUpdateCommentsInfo(detachedRange); - } - exitComment(); - if (emitFlags & 4096 /* NoNestedComments */ && !commentsDisabled) { - commentsDisabled = true; - emitCallback(node); - commentsDisabled = false; - } else { - emitCallback(node); - } - enterComment(); - if (!skipTrailingComments) { - emitLeadingComments( - detachedRange.end, - /*isEmittedNode*/ - true - ); - if (hasWrittenComment && !writer.isAtStartOfLine()) { - writer.writeLine(); - } - } - exitComment(); - } - function originalNodesHaveSameParent(nodeA, nodeB) { - nodeA = getOriginalNode(nodeA); - return nodeA.parent && nodeA.parent === getOriginalNode(nodeB).parent; - } - function siblingNodePositionsAreComparable(previousNode, nextNode) { - if (nextNode.pos < previousNode.end) { - return false; - } - previousNode = getOriginalNode(previousNode); - nextNode = getOriginalNode(nextNode); - const parent = previousNode.parent; - if (!parent || parent !== nextNode.parent) { - return false; - } - const parentNodeArray = getContainingNodeArray(previousNode); - const prevNodeIndex = parentNodeArray == null ? void 0 : parentNodeArray.indexOf(previousNode); - return prevNodeIndex !== void 0 && prevNodeIndex > -1 && parentNodeArray.indexOf(nextNode) === prevNodeIndex + 1; - } - function emitLeadingComments(pos, isEmittedNode) { - hasWrittenComment = false; - if (isEmittedNode) { - if (pos === 0 && (currentSourceFile == null ? void 0 : currentSourceFile.isDeclarationFile)) { - forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); - } else { - forEachLeadingCommentToEmit(pos, emitLeadingComment); - } - } else if (pos === 0) { - forEachLeadingCommentToEmit(pos, emitTripleSlashLeadingComment); - } - } - function emitTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } - function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } - function shouldWriteComment(text, pos) { - if (printerOptions.onlyPrintJsDocStyle) { - return isJSDocLikeText(text, pos) || isPinnedComment(text, pos); - } - return true; - } - function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) - return; - if (!hasWrittenComment) { - emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos); - hasWrittenComment = true; - } - emitPos(commentPos); - writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); - if (hasTrailingNewLine) { - writer.writeLine(); - } else if (kind === 3 /* MultiLineCommentTrivia */) { - writer.writeSpace(" "); - } - } - function emitLeadingCommentsOfPosition(pos) { - if (commentsDisabled || pos === -1) { - return; - } - emitLeadingComments( - pos, - /*isEmittedNode*/ - true - ); - } - function emitTrailingComments(pos) { - forEachTrailingCommentToEmit(pos, emitTrailingComment); - } - function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) { - if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) - return; - if (!writer.isAtStartOfLine()) { - writer.writeSpace(" "); - } - emitPos(commentPos); - writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); - if (hasTrailingNewLine) { - writer.writeLine(); - } - } - function emitTrailingCommentsOfPosition(pos, prefixSpace, forceNoNewline) { - if (commentsDisabled) { - return; - } - enterComment(); - forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : forceNoNewline ? emitTrailingCommentOfPositionNoNewline : emitTrailingCommentOfPosition); - exitComment(); - } - function emitTrailingCommentOfPositionNoNewline(commentPos, commentEnd, kind) { - if (!currentSourceFile) - return; - emitPos(commentPos); - writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); - if (kind === 2 /* SingleLineCommentTrivia */) { - writer.writeLine(); - } - } - function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { - if (!currentSourceFile) - return; - emitPos(commentPos); - writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); - if (hasTrailingNewLine) { - writer.writeLine(); - } else { - writer.writeSpace(" "); - } - } - function forEachLeadingCommentToEmit(pos, cb) { - if (currentSourceFile && (containerPos === -1 || pos !== containerPos)) { - if (hasDetachedComments(pos)) { - forEachLeadingCommentWithoutDetachedComments(cb); - } else { - forEachLeadingCommentRange( - currentSourceFile.text, - pos, - cb, - /*state*/ - pos - ); - } - } - } - function forEachTrailingCommentToEmit(end, cb) { - if (currentSourceFile && (containerEnd === -1 || end !== containerEnd && end !== declarationListContainerEnd)) { - forEachTrailingCommentRange(currentSourceFile.text, end, cb); - } - } - function hasDetachedComments(pos) { - return detachedCommentsInfo !== void 0 && last(detachedCommentsInfo).nodePos === pos; - } - function forEachLeadingCommentWithoutDetachedComments(cb) { - if (!currentSourceFile) - return; - const pos = last(detachedCommentsInfo).detachedCommentEndPos; - if (detachedCommentsInfo.length - 1) { - detachedCommentsInfo.pop(); - } else { - detachedCommentsInfo = void 0; - } - forEachLeadingCommentRange( - currentSourceFile.text, - pos, - cb, - /*state*/ - pos - ); - } - function emitDetachedCommentsAndUpdateCommentsInfo(range) { - const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled); - if (currentDetachedCommentInfo) { - if (detachedCommentsInfo) { - detachedCommentsInfo.push(currentDetachedCommentInfo); - } else { - detachedCommentsInfo = [currentDetachedCommentInfo]; - } - } - } - function emitComment(text, lineMap, writer2, commentPos, commentEnd, newLine2) { - if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) - return; - emitPos(commentPos); - writeCommentRange(text, lineMap, writer2, commentPos, commentEnd, newLine2); - emitPos(commentEnd); - } - function isTripleSlashComment(commentPos, commentEnd) { - return !!currentSourceFile && isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd); - } - function getParsedSourceMap(node) { - if (node.parsedSourceMap === void 0 && node.sourceMapText !== void 0) { - node.parsedSourceMap = tryParseRawSourceMap(node.sourceMapText) || false; - } - return node.parsedSourceMap || void 0; - } - function pipelineEmitWithSourceMaps(hint, node) { - const pipelinePhase = getNextPipelinePhase(3 /* SourceMaps */, hint, node); - emitSourceMapsBeforeNode(node); - pipelinePhase(hint, node); - emitSourceMapsAfterNode(node); - } - function emitSourceMapsBeforeNode(node) { - const emitFlags = getEmitFlags(node); - const sourceMapRange = getSourceMapRange(node); - if (isUnparsedNode(node)) { - Debug.assertIsDefined(node.parent, "UnparsedNodes must have parent pointers"); - const parsed = getParsedSourceMap(node.parent); - if (parsed && sourceMapGenerator) { - sourceMapGenerator.appendSourceMap( - writer.getLine(), - writer.getColumn(), - parsed, - node.parent.sourceMapPath, - node.parent.getLineAndCharacterOfPosition(node.pos), - node.parent.getLineAndCharacterOfPosition(node.end) - ); - } - } else { - const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { - emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); - } - if (emitFlags & 128 /* NoNestedSourceMaps */) { - sourceMapsDisabled = true; - } - } - } - function emitSourceMapsAfterNode(node) { - const emitFlags = getEmitFlags(node); - const sourceMapRange = getSourceMapRange(node); - if (!isUnparsedNode(node)) { - if (emitFlags & 128 /* NoNestedSourceMaps */) { - sourceMapsDisabled = false; - } - if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { - emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); - } - } - } - function skipSourceTrivia(source, pos) { - return source.skipTrivia ? source.skipTrivia(pos) : skipTrivia(source.text, pos); - } - function emitPos(pos) { - if (sourceMapsDisabled || positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) { - return; - } - const { line: sourceLine, character: sourceCharacter } = getLineAndCharacterOfPosition(sourceMapSource, pos); - sourceMapGenerator.addMapping( - writer.getLine(), - writer.getColumn(), - sourceMapSourceIndex, - sourceLine, - sourceCharacter, - /*nameIndex*/ - void 0 - ); - } - function emitSourcePos(source, pos) { - if (source !== sourceMapSource) { - const savedSourceMapSource = sourceMapSource; - const savedSourceMapSourceIndex = sourceMapSourceIndex; - setSourceMapSource(source); - emitPos(pos); - resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); - } else { - emitPos(pos); - } - } - function emitTokenWithSourceMap(node, token, writer2, tokenPos, emitCallback) { - if (sourceMapsDisabled || node && isInJsonFile(node)) { - return emitCallback(token, writer2, tokenPos); - } - const emitNode = node && node.emitNode; - const emitFlags = emitNode && emitNode.flags || 0 /* None */; - const range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token]; - const source = range && range.source || sourceMapSource; - tokenPos = skipSourceTrivia(source, range ? range.pos : tokenPos); - if ((emitFlags & 256 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) { - emitSourcePos(source, tokenPos); - } - tokenPos = emitCallback(token, writer2, tokenPos); - if (range) - tokenPos = range.end; - if ((emitFlags & 512 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) { - emitSourcePos(source, tokenPos); - } - return tokenPos; - } - function setSourceMapSource(source) { - if (sourceMapsDisabled) { - return; - } - sourceMapSource = source; - if (source === mostRecentlyAddedSourceMapSource) { - sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; - return; - } - if (isJsonSourceMapSource(source)) { - return; - } - sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName); - if (printerOptions.inlineSources) { - sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); - } - mostRecentlyAddedSourceMapSource = source; - mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; - } - function resetSourceMapSource(source, sourceIndex) { - sourceMapSource = source; - sourceMapSourceIndex = sourceIndex; - } - function isJsonSourceMapSource(sourceFile) { - return fileExtensionIs(sourceFile.fileName, ".json" /* Json */); - } -} -function createBracketsMap() { - const brackets2 = []; - brackets2[1024 /* Braces */] = ["{", "}"]; - brackets2[2048 /* Parenthesis */] = ["(", ")"]; - brackets2[4096 /* AngleBrackets */] = ["<", ">"]; - brackets2[8192 /* SquareBrackets */] = ["[", "]"]; - return brackets2; -} -function getOpeningBracket(format) { - return brackets[format & 15360 /* BracketsMask */][0]; -} -function getClosingBracket(format) { - return brackets[format & 15360 /* BracketsMask */][1]; -} -var TempFlags = /* @__PURE__ */ ((TempFlags2) => { - TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; - TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; - TempFlags2[TempFlags2["_i"] = 268435456] = "_i"; - return TempFlags2; -})(TempFlags || {}); -function emitListItemNoParenthesizer(node, emit, _parenthesizerRule, _index) { - emit(node); -} -function emitListItemWithParenthesizerRuleSelector(node, emit, parenthesizerRuleSelector, index) { - emit(node, parenthesizerRuleSelector.select(index)); -} -function emitListItemWithParenthesizerRule(node, emit, parenthesizerRule, _index) { - emit(node, parenthesizerRule); -} -function getEmitListItem(emit, parenthesizerRule) { - return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; -} - -// src/compiler/watchUtilities.ts -function getWatchFactory(host, watchLogLevel, log2, getDetailWatchInfo2) { - setSysLog(watchLogLevel === 2 /* Verbose */ ? log2 : noop); - const plainInvokeFactory = { - watchFile: (file, callback, pollingInterval, options) => host.watchFile(file, callback, pollingInterval, options), - watchDirectory: (directory, callback, flags, options) => host.watchDirectory(directory, callback, (flags & 1 /* Recursive */) !== 0, options) - }; - const triggerInvokingFactory = watchLogLevel !== 0 /* None */ ? { - watchFile: createTriggerLoggingAddWatch("watchFile"), - watchDirectory: createTriggerLoggingAddWatch("watchDirectory") - } : void 0; - const factory2 = watchLogLevel === 2 /* Verbose */ ? { - watchFile: createFileWatcherWithLogging, - watchDirectory: createDirectoryWatcherWithLogging - } : triggerInvokingFactory || plainInvokeFactory; - const excludeWatcherFactory = watchLogLevel === 2 /* Verbose */ ? createExcludeWatcherWithLogging : returnNoopFileWatcher; - return { - watchFile: createExcludeHandlingAddWatch("watchFile"), - watchDirectory: createExcludeHandlingAddWatch("watchDirectory") - }; - function createExcludeHandlingAddWatch(key) { - return (file, cb, flags, options, detailInfo1, detailInfo2) => { - var _a2; - return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames(), ((_a2 = host.getCurrentDirectory) == null ? void 0 : _a2.call(host)) || "") ? factory2[key].call( - /*thisArgs*/ - void 0, - file, - cb, - flags, - options, - detailInfo1, - detailInfo2 - ) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2); - }; - } - function useCaseSensitiveFileNames() { - return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames(); - } - function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) { - log2(`ExcludeWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); - return { - close: () => log2(`ExcludeWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`) - }; - } - function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { - log2(`FileWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); - const watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2); - return { - close: () => { - log2(`FileWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); - watcher.close(); - } - }; - } - function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { - const watchInfo = `DirectoryWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; - log2(watchInfo); - const start = timestamp(); - const watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2); - const elapsed = timestamp() - start; - log2(`Elapsed:: ${elapsed}ms ${watchInfo}`); - return { - close: () => { - const watchInfo2 = `DirectoryWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; - log2(watchInfo2); - const start2 = timestamp(); - watcher.close(); - const elapsed2 = timestamp() - start2; - log2(`Elapsed:: ${elapsed2}ms ${watchInfo2}`); - } - }; - } - function createTriggerLoggingAddWatch(key) { - return (file, cb, flags, options, detailInfo1, detailInfo2) => plainInvokeFactory[key].call( - /*thisArgs*/ - void 0, - file, - (...args) => { - const triggerredInfo = `${key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"}:: Triggered with ${args[0]} ${args[1] !== void 0 ? args[1] : ""}:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; - log2(triggerredInfo); - const start = timestamp(); - cb.call( - /*thisArg*/ - void 0, - ...args - ); - const elapsed = timestamp() - start; - log2(`Elapsed:: ${elapsed}ms ${triggerredInfo}`); - }, - flags, - options, - detailInfo1, - detailInfo2 - ); - } - function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo3) { - return `WatchInfo: ${file} ${flags} ${JSON.stringify(options)} ${getDetailWatchInfo3 ? getDetailWatchInfo3(detailInfo1, detailInfo2) : detailInfo2 === void 0 ? detailInfo1 : `${detailInfo1} ${detailInfo2}`}`; - } -} -function getFallbackOptions(options) { - const fallbackPolling = options == null ? void 0 : options.fallbackPolling; - return { - watchFile: fallbackPolling !== void 0 ? fallbackPolling : 1 /* PriorityPollingInterval */ - }; -} -function closeFileWatcherOf(objWithWatcher) { - objWithWatcher.watcher.close(); -} - -// src/compiler/program.ts -function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) { - let commonPathComponents; - const failed = forEach(fileNames, (sourceFile) => { - const sourcePathComponents = getNormalizedPathComponents(sourceFile, currentDirectory); - sourcePathComponents.pop(); - if (!commonPathComponents) { - commonPathComponents = sourcePathComponents; - return; - } - const n = Math.min(commonPathComponents.length, sourcePathComponents.length); - for (let i = 0; i < n; i++) { - if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { - if (i === 0) { - return true; - } - commonPathComponents.length = i; - break; - } - } - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - }); - if (failed) { - return ""; - } - if (!commonPathComponents) { - return currentDirectory; - } - return getPathFromPathComponents(commonPathComponents); -} -var plainJSErrors = /* @__PURE__ */ new Set([ - // binder errors - Diagnostics.Cannot_redeclare_block_scoped_variable_0.code, - Diagnostics.A_module_cannot_have_multiple_default_exports.code, - Diagnostics.Another_export_default_is_here.code, - Diagnostics.The_first_export_default_is_here.code, - Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code, - Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code, - Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code, - Diagnostics.constructor_is_a_reserved_word.code, - Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode.code, - Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code, - Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code, - Diagnostics.Invalid_use_of_0_in_strict_mode.code, - Diagnostics.A_label_is_not_allowed_here.code, - Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code, - Diagnostics.with_statements_are_not_allowed_in_strict_mode.code, - // grammar errors - Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code, - Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code, - Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code, - Diagnostics.A_class_member_cannot_have_the_0_keyword.code, - Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code, - Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code, - Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, - Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, - Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code, - Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code, - Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code, - Diagnostics.A_destructuring_declaration_must_have_an_initializer.code, - Diagnostics.A_get_accessor_cannot_have_parameters.code, - Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code, - Diagnostics.A_rest_element_cannot_have_a_property_name.code, - Diagnostics.A_rest_element_cannot_have_an_initializer.code, - Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code, - Diagnostics.A_rest_parameter_cannot_have_an_initializer.code, - Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code, - Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code, - Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code, - Diagnostics.A_set_accessor_cannot_have_rest_parameter.code, - Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code, - Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code, - Diagnostics.An_export_declaration_cannot_have_modifiers.code, - Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code, - Diagnostics.An_import_declaration_cannot_have_modifiers.code, - Diagnostics.An_object_member_cannot_be_declared_optional.code, - Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code, - Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code, - Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code, - Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code, - Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code, - Diagnostics.Classes_can_only_extend_a_single_class.code, - Diagnostics.Classes_may_not_have_a_field_named_constructor.code, - Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code, - Diagnostics.Duplicate_label_0.code, - Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code, - Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code, - Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code, - Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code, - Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code, - Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code, - Diagnostics.Jump_target_cannot_cross_function_boundary.code, - Diagnostics.Line_terminator_not_permitted_before_arrow.code, - Diagnostics.Modifiers_cannot_appear_here.code, - Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code, - Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code, - Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code, - Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, - Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code, - Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code, - Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code, - Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code, - Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code, - Diagnostics.Trailing_comma_not_allowed.code, - Diagnostics.Variable_declaration_list_cannot_be_empty.code, - Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code, - Diagnostics._0_expected.code, - Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code, - Diagnostics._0_list_cannot_be_empty.code, - Diagnostics._0_modifier_already_seen.code, - Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code, - Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code, - Diagnostics._0_modifier_cannot_appear_on_a_parameter.code, - Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code, - Diagnostics._0_modifier_cannot_be_used_here.code, - Diagnostics._0_modifier_must_precede_1_modifier.code, - Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code, - Diagnostics.const_declarations_must_be_initialized.code, - Diagnostics.extends_clause_already_seen.code, - Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code, - Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code, - Diagnostics.Class_constructor_may_not_be_a_generator.code, - Diagnostics.Class_constructor_may_not_be_an_accessor.code, - Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code -]); - -// src/compiler/builderState.ts -var BuilderState; -((BuilderState2) => { - function createManyToManyPathMap() { - function create2(forward, reverse, deleted) { - const map2 = { - getKeys: (v) => reverse.get(v), - getValues: (k) => forward.get(k), - keys: () => forward.keys(), - deleteKey: (k) => { - (deleted || (deleted = /* @__PURE__ */ new Set())).add(k); - const set = forward.get(k); - if (!set) { - return false; - } - set.forEach((v) => deleteFromMultimap(reverse, v, k)); - forward.delete(k); - return true; - }, - set: (k, vSet) => { - deleted == null ? void 0 : deleted.delete(k); - const existingVSet = forward.get(k); - forward.set(k, vSet); - existingVSet == null ? void 0 : existingVSet.forEach((v) => { - if (!vSet.has(v)) { - deleteFromMultimap(reverse, v, k); - } - }); - vSet.forEach((v) => { - if (!(existingVSet == null ? void 0 : existingVSet.has(v))) { - addToMultimap(reverse, v, k); - } - }); - return map2; - } - }; - return map2; - } - return create2( - /* @__PURE__ */ new Map(), - /* @__PURE__ */ new Map(), - /*deleted*/ - void 0 - ); - } - BuilderState2.createManyToManyPathMap = createManyToManyPathMap; - function addToMultimap(map2, k, v) { - let set = map2.get(k); - if (!set) { - set = /* @__PURE__ */ new Set(); - map2.set(k, set); - } - set.add(v); - } - function deleteFromMultimap(map2, k, v) { - const set = map2.get(k); - if (set == null ? void 0 : set.delete(v)) { - if (!set.size) { - map2.delete(k); - } - return true; - } - return false; - } - function getReferencedFilesFromImportedModuleSymbol(symbol) { - return mapDefined(symbol.declarations, (declaration) => { - var _a2; - return (_a2 = getSourceFileOfNode(declaration)) == null ? void 0 : _a2.resolvedPath; - }); - } - function getReferencedFilesFromImportLiteral(checker, importName) { - const symbol = checker.getSymbolAtLocation(importName); - return symbol && getReferencedFilesFromImportedModuleSymbol(symbol); - } - function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) { - return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName); + function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) { + return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName); } function getReferencedFiles(program, sourceFile, getCanonicalFileName) { let referencedFiles; @@ -40392,7 +34808,7 @@ var BuilderState; return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); } const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || outFile(compilerOptions))) { + if (compilerOptions && (getIsolatedModules(compilerOptions) || outFile(compilerOptions))) { return [sourceFileWithUpdatedShape]; } const seenFileNamesMap = /* @__PURE__ */ new Map(); @@ -40455,10 +34871,6 @@ var screenStartingMessageCodes = [ var noopFileWatcher = { close: noop }; var returnNoopFileWatcher = () => noopFileWatcher; -// src/compiler/tsbuildPublic.ts -var minimumDate = new Date(-864e13); -var maximumDate = new Date(864e13); - // src/jsTyping/_namespaces/ts.JsTyping.ts var ts_JsTyping_exports = {}; __export(ts_JsTyping_exports, { @@ -40805,7 +35217,7 @@ function findArgument(argumentName) { return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0; } function nowString() { - const d = new Date(); + const d = /* @__PURE__ */ new Date(); return `${padLeft(d.getHours().toString(), 2, "0")}:${padLeft(d.getMinutes().toString(), 2, "0")}:${padLeft(d.getSeconds().toString(), 2, "0")}.${padLeft(d.getMilliseconds().toString(), 3, "0")}`; } @@ -41326,47 +35738,45 @@ var NodeTypingsInstaller = class extends TypingsInstaller { } this.typesRegistry = loadTypesRegistryFile(getTypesRegistryFileLocation(globalTypingsCacheLocation2), this.installTypingHost, this.log); } - listen() { - process.on("message", (req) => { - if (this.delayedInitializationError) { - this.sendResponse(this.delayedInitializationError); - this.delayedInitializationError = void 0; + handleRequest(req) { + if (this.delayedInitializationError) { + this.sendResponse(this.delayedInitializationError); + this.delayedInitializationError = void 0; + } + switch (req.kind) { + case "discover": + this.install(req); + break; + case "closeProject": + this.closeProject(req); + break; + case "typesRegistry": { + const typesRegistry = {}; + this.typesRegistry.forEach((value, key) => { + typesRegistry[key] = value; + }); + const response = { kind: EventTypesRegistry, typesRegistry }; + this.sendResponse(response); + break; } - switch (req.kind) { - case "discover": - this.install(req); - break; - case "closeProject": - this.closeProject(req); - break; - case "typesRegistry": { - const typesRegistry = {}; - this.typesRegistry.forEach((value, key) => { - typesRegistry[key] = value; + case "installPackage": { + const { fileName, packageName, projectName, projectRootPath } = req; + const cwd = getDirectoryOfPackageJson(fileName, this.installTypingHost) || projectRootPath; + if (cwd) { + this.installWorker(-1, [packageName], cwd, (success) => { + const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`; + const response = { kind: ActionPackageInstalled, projectName, success, message }; + this.sendResponse(response); }); - const response = { kind: EventTypesRegistry, typesRegistry }; + } else { + const response = { kind: ActionPackageInstalled, projectName, success: false, message: "Could not determine a project root path." }; this.sendResponse(response); - break; - } - case "installPackage": { - const { fileName, packageName, projectName, projectRootPath } = req; - const cwd = getDirectoryOfPackageJson(fileName, this.installTypingHost) || projectRootPath; - if (cwd) { - this.installWorker(-1, [packageName], cwd, (success) => { - const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`; - const response = { kind: ActionPackageInstalled, projectName, success, message }; - this.sendResponse(response); - }); - } else { - const response = { kind: ActionPackageInstalled, projectName, success: false, message: "Could not determine a project root path." }; - this.sendResponse(response); - } - break; } - default: - Debug.assertNever(req); + break; } - }); + default: + Debug.assertNever(req); + } } sendResponse(response) { if (this.log.isEnabled()) { @@ -41432,17 +35842,20 @@ process.on("disconnect", () => { } process.exit(0); }); -var installer = new NodeTypingsInstaller( - globalTypingsCacheLocation, - typingSafeListLocation, - typesMapLocation, - npmLocation, - validateDefaultNpmLocation, - /*throttleLimit*/ - 5, - log -); -installer.listen(); +var installer; +process.on("message", (req) => { + installer != null ? installer : installer = new NodeTypingsInstaller( + globalTypingsCacheLocation, + typingSafeListLocation, + typesMapLocation, + npmLocation, + validateDefaultNpmLocation, + /*throttleLimit*/ + 5, + log + ); + installer.handleRequest(req); +}); function indent(newline, str) { return str && str.length ? `${newline} ` + str.replace(/\r?\n/, `${newline} `) : ""; } diff --git a/package.json b/package.json index 0210cdaffa0b3..6a27fc8f38983 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "5.0.0-beta", + "version": "5.0.1-rc", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 3ff67b980a4cc..3468e21af6272 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -4,7 +4,7 @@ export const versionMajorMinor = "5.0"; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = `${versionMajorMinor}.0-beta`; +export const version: string = `${versionMajorMinor}.1-rc`; /** * Type of objects whose values are all of the same type. From 3ede9245ce4508e1c457a218ee7959813605101f Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 2 Mar 2023 12:36:57 -0800 Subject: [PATCH 04/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53012=20(Omit?= =?UTF-8?q?=20intersection=20property=20check=20wh...)=20into=20release-5.?= =?UTF-8?q?0=20(#53024)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Anders Hejlsberg --- src/compiler/checker.ts | 2 +- .../reference/normalizedIntersectionTooComplex.errors.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 70e0220bbb39c..0bc1cd61fcfab 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21117,7 +21117,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // else if (result && isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & TypeFlags.Intersection && getApparentType(source).flags & TypeFlags.StructuredType && - !some((source as IntersectionType).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType))) { + !some((source as IntersectionType).types, t => t === target || !!(getObjectFlags(t) & ObjectFlags.NonInferrableType))) { result &= propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, /*optionalsOnly*/ true, intersectionState); } } diff --git a/tests/baselines/reference/normalizedIntersectionTooComplex.errors.txt b/tests/baselines/reference/normalizedIntersectionTooComplex.errors.txt index 4e214eff50715..64e7d7f00c510 100644 --- a/tests/baselines/reference/normalizedIntersectionTooComplex.errors.txt +++ b/tests/baselines/reference/normalizedIntersectionTooComplex.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/normalizedIntersectionTooComplex.ts(36,14): error TS2590: Expression produces a union type that is too complex to represent. tests/cases/compiler/normalizedIntersectionTooComplex.ts(36,40): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/normalizedIntersectionTooComplex.ts(36,40): error TS2590: Expression produces a union type that is too complex to represent. ==== tests/cases/compiler/normalizedIntersectionTooComplex.ts (2 errors) ==== @@ -39,8 +39,8 @@ tests/cases/compiler/normalizedIntersectionTooComplex.ts(36,40): error TS7006: P declare var all: keyof Big; const ctor = getCtor(all); const comp = ctor({ common: "ok", ref: x => console.log(x) }); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2590: Expression produces a union type that is too complex to represent. ~ !!! error TS7006: Parameter 'x' implicitly has an 'any' type. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2590: Expression produces a union type that is too complex to represent. \ No newline at end of file From b0afbd6aaa861709bbaa615be7301fd56cff1a28 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 2 Mar 2023 12:38:45 -0800 Subject: [PATCH 05/35] Cherry-pick #52565 to release-5.0 (#53055) Co-authored-by: Oleksandr T --- .../codefixes/convertToTypeOnlyImport.ts | 80 +++++++++++-------- .../getSupportedCodeFixes-can-be-proxied.js | 2 +- .../codeFixConvertToTypeOnlyImport1.ts | 14 ++-- .../codeFixConvertToTypeOnlyImport2.ts | 6 +- .../codeFixConvertToTypeOnlyImport3.ts | 6 +- .../codeFixConvertToTypeOnlyImport4.ts | 17 ++++ 6 files changed, 78 insertions(+), 47 deletions(-) create mode 100644 tests/cases/fourslash/codeFixConvertToTypeOnlyImport4.ts diff --git a/src/services/codefixes/convertToTypeOnlyImport.ts b/src/services/codefixes/convertToTypeOnlyImport.ts index b4f5bda36cafa..5b553bb33d0e5 100644 --- a/src/services/codefixes/convertToTypeOnlyImport.ts +++ b/src/services/codefixes/convertToTypeOnlyImport.ts @@ -1,14 +1,16 @@ import { - CodeFixContextBase, Diagnostics, factory, + getSynthesizedDeepClone, + getSynthesizedDeepClones, getTokenAtPosition, + ImportClause, ImportDeclaration, + ImportSpecifier, isImportDeclaration, + isImportSpecifier, SourceFile, textChanges, - TextSpan, - tryCast, } from "../_namespaces/ts"; import { codeFixAll, @@ -16,52 +18,64 @@ import { registerCodeFix, } from "../_namespaces/ts.codefix"; -const errorCodes = [Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code]; +const errorCodes = [ + Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code, + Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code, +]; const fixId = "convertToTypeOnlyImport"; + registerCodeFix({ errorCodes, getCodeActions: function getCodeActionsToConvertToTypeOnlyImport(context) { - const changes = textChanges.ChangeTracker.with(context, t => { - const importDeclaration = getImportDeclarationForDiagnosticSpan(context.span, context.sourceFile); - fixSingleImportDeclaration(t, importDeclaration, context); - }); - if (changes.length) { + const declaration = getDeclaration(context.sourceFile, context.span.start); + if (declaration) { + const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, declaration)); return [createCodeFixAction(fixId, changes, Diagnostics.Convert_to_type_only_import, fixId, Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]; } + return undefined; }, fixIds: [fixId], getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context) { return codeFixAll(context, errorCodes, (changes, diag) => { - const importDeclaration = getImportDeclarationForDiagnosticSpan(diag, context.sourceFile); - fixSingleImportDeclaration(changes, importDeclaration, context); + const declaration = getDeclaration(diag.file, diag.start); + if (declaration) { + doChange(changes, diag.file, declaration); + } }); } }); -function getImportDeclarationForDiagnosticSpan(span: TextSpan, sourceFile: SourceFile) { - return tryCast(getTokenAtPosition(sourceFile, span.start).parent, isImportDeclaration); +function getDeclaration(sourceFile: SourceFile, pos: number) { + const { parent } = getTokenAtPosition(sourceFile, pos); + return isImportSpecifier(parent) || isImportDeclaration(parent) && parent.importClause ? parent : undefined; } -function fixSingleImportDeclaration(changes: textChanges.ChangeTracker, importDeclaration: ImportDeclaration | undefined, context: CodeFixContextBase) { - if (!importDeclaration?.importClause) { - return; +function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, declaration: ImportDeclaration | ImportSpecifier) { + if (isImportSpecifier(declaration)) { + changes.replaceNode(sourceFile, declaration, factory.updateImportSpecifier(declaration, /*isTypeOnly*/ true, declaration.propertyName, declaration.name)); } - - const { importClause } = importDeclaration; - // `changes.insertModifierBefore` produces a range that might overlap further changes - changes.insertText(context.sourceFile, importDeclaration.getStart() + "import".length, " type"); - - // `import type foo, { Bar }` is not allowed, so move `foo` to new declaration - if (importClause.name && importClause.namedBindings) { - changes.deleteNodeRangeExcludingEnd(context.sourceFile, importClause.name, importDeclaration.importClause.namedBindings); - changes.insertNodeBefore(context.sourceFile, importDeclaration, factory.updateImportDeclaration( - importDeclaration, - /*modifiers*/ undefined, - factory.createImportClause( - /*isTypeOnly*/ true, - importClause.name, - /*namedBindings*/ undefined), - importDeclaration.moduleSpecifier, - /*assertClause*/ undefined)); + else { + const importClause = declaration.importClause as ImportClause; + if (importClause.name && importClause.namedBindings) { + changes.replaceNodeWithNodes(sourceFile, declaration, [ + factory.createImportDeclaration( + getSynthesizedDeepClones(declaration.modifiers, /*includeTrivia*/ true), + factory.createImportClause(/*isTypeOnly*/ true, getSynthesizedDeepClone(importClause.name, /*includeTrivia*/ true), /*namedBindings*/ undefined), + getSynthesizedDeepClone(declaration.moduleSpecifier, /*includeTrivia*/ true), + getSynthesizedDeepClone(declaration.assertClause, /*includeTrivia*/ true), + ), + factory.createImportDeclaration( + getSynthesizedDeepClones(declaration.modifiers, /*includeTrivia*/ true), + factory.createImportClause(/*isTypeOnly*/ true, /*name*/ undefined, getSynthesizedDeepClone(importClause.namedBindings, /*includeTrivia*/ true)), + getSynthesizedDeepClone(declaration.moduleSpecifier, /*includeTrivia*/ true), + getSynthesizedDeepClone(declaration.assertClause, /*includeTrivia*/ true), + ), + ]); + } + else { + const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, + factory.updateImportClause(importClause, /*isTypeOnly*/ true, importClause.name, importClause.namedBindings), declaration.moduleSpecifier, declaration.assertClause); + changes.replaceNode(sourceFile, declaration, importDeclaration); + } } } diff --git a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js index 7382a77537341..9e9c3d65930b0 100644 --- a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js +++ b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js @@ -309,6 +309,7 @@ Info 32 [00:01:13.000] response: "2713", "1205", "1371", + "1484", "2690", "2420", "2720", @@ -720,7 +721,6 @@ Info 32 [00:01:13.000] response: "1477", "1478", "1479", - "1484", "1485", "1486", "2200", diff --git a/tests/cases/fourslash/codeFixConvertToTypeOnlyImport1.ts b/tests/cases/fourslash/codeFixConvertToTypeOnlyImport1.ts index cd7fb8b05c399..2453338f71b34 100644 --- a/tests/cases/fourslash/codeFixConvertToTypeOnlyImport1.ts +++ b/tests/cases/fourslash/codeFixConvertToTypeOnlyImport1.ts @@ -9,8 +9,8 @@ // @Filename: imports.ts ////import { -//// B, -//// C, +//// B, +//// C, ////} from './exports'; //// ////declare const b: B; @@ -19,11 +19,11 @@ goTo.file("imports.ts"); verify.codeFix({ - index: 0, - description: ts.Diagnostics.Convert_to_type_only_import.message, - newFileContent: `import type { - B, - C, + index: 0, + description: ts.Diagnostics.Convert_to_type_only_import.message, + newFileContent: `import type { + B, + C, } from './exports'; declare const b: B; diff --git a/tests/cases/fourslash/codeFixConvertToTypeOnlyImport2.ts b/tests/cases/fourslash/codeFixConvertToTypeOnlyImport2.ts index 9cd7111d05cc7..fae95f35dfea7 100644 --- a/tests/cases/fourslash/codeFixConvertToTypeOnlyImport2.ts +++ b/tests/cases/fourslash/codeFixConvertToTypeOnlyImport2.ts @@ -17,9 +17,9 @@ goTo.file("imports.ts"); verify.codeFix({ - index: 0, - description: ts.Diagnostics.Convert_to_type_only_import.message, - newFileContent: `import type A from './exports'; + index: 0, + description: ts.Diagnostics.Convert_to_type_only_import.message, + newFileContent: `import type A from './exports'; import type { B, C } from './exports'; declare const a: A; diff --git a/tests/cases/fourslash/codeFixConvertToTypeOnlyImport3.ts b/tests/cases/fourslash/codeFixConvertToTypeOnlyImport3.ts index 0544e3035cdf4..3f9aba15cf0fb 100644 --- a/tests/cases/fourslash/codeFixConvertToTypeOnlyImport3.ts +++ b/tests/cases/fourslash/codeFixConvertToTypeOnlyImport3.ts @@ -25,9 +25,9 @@ goTo.file("imports.ts"); verify.codeFixAll({ - fixId: "convertToTypeOnlyImport", - fixAllDescription: ts.Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports.message, - newFileContent: `import type A from './exports1'; + fixId: "convertToTypeOnlyImport", + fixAllDescription: ts.Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports.message, + newFileContent: `import type A from './exports1'; import type { B, C } from './exports1'; import type D from "./exports2"; import type * as others from "./exports2"; diff --git a/tests/cases/fourslash/codeFixConvertToTypeOnlyImport4.ts b/tests/cases/fourslash/codeFixConvertToTypeOnlyImport4.ts new file mode 100644 index 0000000000000..126d0371f4674 --- /dev/null +++ b/tests/cases/fourslash/codeFixConvertToTypeOnlyImport4.ts @@ -0,0 +1,17 @@ +/// + +// @module: esnext +// @verbatimModuleSyntax: true +// @filename: /b.ts +////export interface I {} +////export const foo = {}; + +// @filename: /a.ts +////import { I, foo } from "./b"; + +goTo.file("/a.ts"); +verify.codeFix({ + index: 0, + description: ts.Diagnostics.Convert_to_type_only_import.message, + newFileContent: `import { type I, foo } from "./b";` +}); From 79bdd93ec5d6197f978e44c314b2f8f15c112c59 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 6 Mar 2023 17:17:49 -0800 Subject: [PATCH 06/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#52984=20(Chec?= =?UTF-8?q?k=20for=20strict=20subtypes=20and=20then=20...)=20into=20releas?= =?UTF-8?q?e-5.0=20(#53085)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Anders Hejlsberg --- src/compiler/checker.ts | 6 +- ...ssertedTypeThroughTypePredicate.errors.txt | 51 --- ...avorAssertedTypeThroughTypePredicate.types | 12 +- .../reference/narrowingMutualSubtypes.types | 4 +- .../strictSubtypeAndNarrowing.errors.txt | 100 ++++++ .../reference/strictSubtypeAndNarrowing.js | 140 +++++++++ .../strictSubtypeAndNarrowing.symbols | 290 ++++++++++++++++++ .../reference/strictSubtypeAndNarrowing.types | 231 ++++++++++++++ .../compiler/strictSubtypeAndNarrowing.ts | 100 ++++++ 9 files changed, 874 insertions(+), 60 deletions(-) delete mode 100644 tests/baselines/reference/controlFlowFavorAssertedTypeThroughTypePredicate.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0bc1cd61fcfab..5e374efbfba36 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19108,6 +19108,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return isTypeRelatedTo(source, target, subtypeRelation); } + function isTypeStrictSubtypeOf(source: Type, target: Type): boolean { + return isTypeRelatedTo(source, target, strictSubtypeRelation); + } + function isTypeAssignableTo(source: Type, target: Type): boolean { return isTypeRelatedTo(source, target, assignableRelation); } @@ -27262,7 +27266,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // prototype object types. const directlyRelated = mapType(matching || type, checkDerived ? t => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : - t => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + t => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType); // If no constituents are directly related, create intersections for any generic constituents that // are related by constraint. return directlyRelated.flags & TypeFlags.Never ? diff --git a/tests/baselines/reference/controlFlowFavorAssertedTypeThroughTypePredicate.errors.txt b/tests/baselines/reference/controlFlowFavorAssertedTypeThroughTypePredicate.errors.txt deleted file mode 100644 index 4ae99c4108d14..0000000000000 --- a/tests/baselines/reference/controlFlowFavorAssertedTypeThroughTypePredicate.errors.txt +++ /dev/null @@ -1,51 +0,0 @@ -tests/cases/compiler/controlFlowFavorAssertedTypeThroughTypePredicate.ts(26,5): error TS7053: Element implicitly has an 'any' type because expression of type '"attr"' can't be used to index type '{}'. - Property 'attr' does not exist on type '{}'. -tests/cases/compiler/controlFlowFavorAssertedTypeThroughTypePredicate.ts(34,5): error TS7053: Element implicitly has an 'any' type because expression of type '"attr"' can't be used to index type '{}'. - Property 'attr' does not exist on type '{}'. - - -==== tests/cases/compiler/controlFlowFavorAssertedTypeThroughTypePredicate.ts (2 errors) ==== - // repro 49988#issuecomment-1192016929 - - declare function isObject1(value: unknown): value is Record; - - declare const obj1: {}; - if (isObject1(obj1)) { - obj1; - obj1['attr']; - } - // check type after conditional block - obj1; - - declare const obj2: {} | undefined; - if (isObject1(obj2)) { - obj2; - obj2['attr']; - } - // check type after conditional block - obj2; - - declare function isObject2(value: unknown): value is {}; - - declare const obj3: Record; - if (isObject2(obj3)) { - obj3; - obj3['attr']; - ~~~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"attr"' can't be used to index type '{}'. -!!! error TS7053: Property 'attr' does not exist on type '{}'. - } - // check type after conditional block - obj3; - - declare const obj4: Record | undefined; - if (isObject2(obj4)) { - obj4; - obj4['attr']; - ~~~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"attr"' can't be used to index type '{}'. -!!! error TS7053: Property 'attr' does not exist on type '{}'. - } - // check type after conditional block - obj4; - \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowFavorAssertedTypeThroughTypePredicate.types b/tests/baselines/reference/controlFlowFavorAssertedTypeThroughTypePredicate.types index f79e73f03e4d6..ef09dea6f7795 100644 --- a/tests/baselines/reference/controlFlowFavorAssertedTypeThroughTypePredicate.types +++ b/tests/baselines/reference/controlFlowFavorAssertedTypeThroughTypePredicate.types @@ -58,11 +58,11 @@ if (isObject2(obj3)) { >obj3 : Record obj3; ->obj3 : {} +>obj3 : Record obj3['attr']; ->obj3['attr'] : any ->obj3 : {} +>obj3['attr'] : unknown +>obj3 : Record >'attr' : "attr" } // check type after conditional block @@ -78,11 +78,11 @@ if (isObject2(obj4)) { >obj4 : Record | undefined obj4; ->obj4 : {} +>obj4 : Record obj4['attr']; ->obj4['attr'] : any ->obj4 : {} +>obj4['attr'] : unknown +>obj4 : Record >'attr' : "attr" } // check type after conditional block diff --git a/tests/baselines/reference/narrowingMutualSubtypes.types b/tests/baselines/reference/narrowingMutualSubtypes.types index 7cf817697aafb..7ed2f5955d678 100644 --- a/tests/baselines/reference/narrowingMutualSubtypes.types +++ b/tests/baselines/reference/narrowingMutualSubtypes.types @@ -123,11 +123,11 @@ function gg2(x: Record) { >x : Record x; // {} ->x : {} +>x : Record } else { x; // Record ->x : Record +>x : never } x; // Record >x : Record diff --git a/tests/baselines/reference/strictSubtypeAndNarrowing.errors.txt b/tests/baselines/reference/strictSubtypeAndNarrowing.errors.txt index 1dd63fe6e0f77..12d23ddb7b5b7 100644 --- a/tests/baselines/reference/strictSubtypeAndNarrowing.errors.txt +++ b/tests/baselines/reference/strictSubtypeAndNarrowing.errors.txt @@ -146,4 +146,104 @@ tests/cases/compiler/strictSubtypeAndNarrowing.ts(129,26): error TS2322: Type '{ !!! error TS2322: Type '{ x: number; y: number; }' is not assignable to type '{ x?: number | undefined; }'. !!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. } + + // Repros from #52827 + + declare function isArrayLike(value: any): value is { length: number }; + + function ff1(value: { [index: number]: boolean, length: number } | undefined) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; + } + + function ff2(value: { [index: number]: boolean, length: number } | string) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; + } + + function ff3(value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; + } + + // Repro from comment in #52984 + + type DistributedKeyOf = T extends unknown ? keyof T : never; + + type NarrowByKeyValue = ObjT extends unknown + ? KeyT extends keyof ObjT + ? ValueT extends ObjT[KeyT] + ? ObjT & Readonly> + : never + : never + : never; + + type NarrowByDeepValue = DeepPathT extends readonly [ + infer Head extends DistributedKeyOf, + ] + ? NarrowByKeyValue + : DeepPathT extends readonly [infer Head extends DistributedKeyOf, ...infer Rest] + ? NarrowByKeyValue, Rest, ValueT>> + : never; + + + declare function doesValueAtDeepPathSatisfy< + ObjT extends object, + const DeepPathT extends ReadonlyArray, + ValueT, + >( + obj: ObjT, + deepPath: DeepPathT, + predicate: (arg: unknown) => arg is ValueT, + ): obj is NarrowByDeepValue; + + + type Foo = {value: {type: 'A'}; a?: number} | {value: {type: 'B'}; b?: number}; + + declare function isA(arg: unknown): arg is 'A'; + declare function isB(arg: unknown): arg is 'B'; + + declare function assert(condition: boolean): asserts condition; + + function test1(foo: Foo): {value: {type: 'A'}; a?: number} { + assert(doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isA)); + return foo; + } + + function test2(foo: Foo): {value: {type: 'A'}; a?: number} { + assert(!doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB)); + return foo; + } + + // Repro from #53063 + + interface Free { + premium: false; + } + + interface Premium { + premium: true; + } + + type Union = { premium: false } | { premium: true }; + + declare const checkIsPremium: (a: Union) => a is Union & Premium; + + const f = (value: Union) => { + if (!checkIsPremium(value)) { + value.premium; + } + }; \ No newline at end of file diff --git a/tests/baselines/reference/strictSubtypeAndNarrowing.js b/tests/baselines/reference/strictSubtypeAndNarrowing.js index 3e135c3af6fc1..ec143633beba9 100644 --- a/tests/baselines/reference/strictSubtypeAndNarrowing.js +++ b/tests/baselines/reference/strictSubtypeAndNarrowing.js @@ -129,6 +129,106 @@ function fx11(): { x?: number } { let obj: { x?: number, y?: number }; return obj = { x: 1, y: 2 }; } + +// Repros from #52827 + +declare function isArrayLike(value: any): value is { length: number }; + +function ff1(value: { [index: number]: boolean, length: number } | undefined) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; +} + +function ff2(value: { [index: number]: boolean, length: number } | string) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; +} + +function ff3(value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; +} + +// Repro from comment in #52984 + +type DistributedKeyOf = T extends unknown ? keyof T : never; + +type NarrowByKeyValue = ObjT extends unknown + ? KeyT extends keyof ObjT + ? ValueT extends ObjT[KeyT] + ? ObjT & Readonly> + : never + : never + : never; + +type NarrowByDeepValue = DeepPathT extends readonly [ + infer Head extends DistributedKeyOf, +] + ? NarrowByKeyValue + : DeepPathT extends readonly [infer Head extends DistributedKeyOf, ...infer Rest] + ? NarrowByKeyValue, Rest, ValueT>> + : never; + + +declare function doesValueAtDeepPathSatisfy< + ObjT extends object, + const DeepPathT extends ReadonlyArray, + ValueT, +>( + obj: ObjT, + deepPath: DeepPathT, + predicate: (arg: unknown) => arg is ValueT, +): obj is NarrowByDeepValue; + + +type Foo = {value: {type: 'A'}; a?: number} | {value: {type: 'B'}; b?: number}; + +declare function isA(arg: unknown): arg is 'A'; +declare function isB(arg: unknown): arg is 'B'; + +declare function assert(condition: boolean): asserts condition; + +function test1(foo: Foo): {value: {type: 'A'}; a?: number} { + assert(doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isA)); + return foo; +} + +function test2(foo: Foo): {value: {type: 'A'}; a?: number} { + assert(!doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB)); + return foo; +} + +// Repro from #53063 + +interface Free { + premium: false; +} + +interface Premium { + premium: true; +} + +type Union = { premium: false } | { premium: true }; + +declare const checkIsPremium: (a: Union) => a is Union & Premium; + +const f = (value: Union) => { + if (!checkIsPremium(value)) { + value.premium; + } +}; //// [strictSubtypeAndNarrowing.js] @@ -226,3 +326,43 @@ function fx11() { var obj; return obj = { x: 1, y: 2 }; } +function ff1(value) { + if (isArrayLike(value)) { + value; + } + else { + value; + } + value; +} +function ff2(value) { + if (isArrayLike(value)) { + value; + } + else { + value; + } + value; +} +function ff3(value) { + if (isArrayLike(value)) { + value; + } + else { + value; + } + value; +} +function test1(foo) { + assert(doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isA)); + return foo; +} +function test2(foo) { + assert(!doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB)); + return foo; +} +var f = function (value) { + if (!checkIsPremium(value)) { + value.premium; + } +}; diff --git a/tests/baselines/reference/strictSubtypeAndNarrowing.symbols b/tests/baselines/reference/strictSubtypeAndNarrowing.symbols index 2bdf3b7777cae..99dde89722e12 100644 --- a/tests/baselines/reference/strictSubtypeAndNarrowing.symbols +++ b/tests/baselines/reference/strictSubtypeAndNarrowing.symbols @@ -311,3 +311,293 @@ function fx11(): { x?: number } { >y : Symbol(y, Decl(strictSubtypeAndNarrowing.ts, 128, 24)) } +// Repros from #52827 + +declare function isArrayLike(value: any): value is { length: number }; +>isArrayLike : Symbol(isArrayLike, Decl(strictSubtypeAndNarrowing.ts, 129, 1)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 133, 29)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 133, 29)) +>length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 133, 52)) + +function ff1(value: { [index: number]: boolean, length: number } | undefined) { +>ff1 : Symbol(ff1, Decl(strictSubtypeAndNarrowing.ts, 133, 70)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13)) +>index : Symbol(index, Decl(strictSubtypeAndNarrowing.ts, 135, 23)) +>length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 135, 47)) + + if (isArrayLike(value)) { +>isArrayLike : Symbol(isArrayLike, Decl(strictSubtypeAndNarrowing.ts, 129, 1)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13)) + + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13)) + + } else { + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13)) + } + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13)) +} + +function ff2(value: { [index: number]: boolean, length: number } | string) { +>ff2 : Symbol(ff2, Decl(strictSubtypeAndNarrowing.ts, 142, 1)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13)) +>index : Symbol(index, Decl(strictSubtypeAndNarrowing.ts, 144, 23)) +>length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 144, 47)) + + if (isArrayLike(value)) { +>isArrayLike : Symbol(isArrayLike, Decl(strictSubtypeAndNarrowing.ts, 129, 1)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13)) + + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13)) + + } else { + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13)) + } + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13)) +} + +function ff3(value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined) { +>ff3 : Symbol(ff3, Decl(strictSubtypeAndNarrowing.ts, 151, 1)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13)) +>index : Symbol(index, Decl(strictSubtypeAndNarrowing.ts, 153, 43)) +>length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 153, 67)) +>length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 153, 117)) +>a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 153, 138)) + + if (isArrayLike(value)) { +>isArrayLike : Symbol(isArrayLike, Decl(strictSubtypeAndNarrowing.ts, 129, 1)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13)) + + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13)) + + } else { + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13)) + } + value; +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13)) +} + +// Repro from comment in #52984 + +type DistributedKeyOf = T extends unknown ? keyof T : never; +>DistributedKeyOf : Symbol(DistributedKeyOf, Decl(strictSubtypeAndNarrowing.ts, 160, 1)) +>T : Symbol(T, Decl(strictSubtypeAndNarrowing.ts, 164, 22)) +>T : Symbol(T, Decl(strictSubtypeAndNarrowing.ts, 164, 22)) +>T : Symbol(T, Decl(strictSubtypeAndNarrowing.ts, 164, 22)) + +type NarrowByKeyValue = ObjT extends unknown +>NarrowByKeyValue : Symbol(NarrowByKeyValue, Decl(strictSubtypeAndNarrowing.ts, 164, 63)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 166, 22)) +>KeyT : Symbol(KeyT, Decl(strictSubtypeAndNarrowing.ts, 166, 27)) +>PropertyKey : Symbol(PropertyKey, Decl(lib.es5.d.ts, --, --)) +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 166, 53)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 166, 22)) + + ? KeyT extends keyof ObjT +>KeyT : Symbol(KeyT, Decl(strictSubtypeAndNarrowing.ts, 166, 27)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 166, 22)) + + ? ValueT extends ObjT[KeyT] +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 166, 53)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 166, 22)) +>KeyT : Symbol(KeyT, Decl(strictSubtypeAndNarrowing.ts, 166, 27)) + + ? ObjT & Readonly> +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 166, 22)) +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>KeyT : Symbol(KeyT, Decl(strictSubtypeAndNarrowing.ts, 166, 27)) +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 166, 53)) + + : never + : never + : never; + +type NarrowByDeepValue = DeepPathT extends readonly [ +>NarrowByDeepValue : Symbol(NarrowByDeepValue, Decl(strictSubtypeAndNarrowing.ts, 172, 12)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 174, 23)) +>DeepPathT : Symbol(DeepPathT, Decl(strictSubtypeAndNarrowing.ts, 174, 28)) +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 174, 39)) +>DeepPathT : Symbol(DeepPathT, Decl(strictSubtypeAndNarrowing.ts, 174, 28)) + + infer Head extends DistributedKeyOf, +>Head : Symbol(Head, Decl(strictSubtypeAndNarrowing.ts, 175, 9)) +>DistributedKeyOf : Symbol(DistributedKeyOf, Decl(strictSubtypeAndNarrowing.ts, 160, 1)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 174, 23)) + +] + ? NarrowByKeyValue +>NarrowByKeyValue : Symbol(NarrowByKeyValue, Decl(strictSubtypeAndNarrowing.ts, 164, 63)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 174, 23)) +>Head : Symbol(Head, Decl(strictSubtypeAndNarrowing.ts, 175, 9)) +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 174, 39)) + + : DeepPathT extends readonly [infer Head extends DistributedKeyOf, ...infer Rest] +>DeepPathT : Symbol(DeepPathT, Decl(strictSubtypeAndNarrowing.ts, 174, 28)) +>Head : Symbol(Head, Decl(strictSubtypeAndNarrowing.ts, 178, 39)) +>DistributedKeyOf : Symbol(DistributedKeyOf, Decl(strictSubtypeAndNarrowing.ts, 160, 1)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 174, 23)) +>Rest : Symbol(Rest, Decl(strictSubtypeAndNarrowing.ts, 178, 85)) + + ? NarrowByKeyValue, Rest, ValueT>> +>NarrowByKeyValue : Symbol(NarrowByKeyValue, Decl(strictSubtypeAndNarrowing.ts, 164, 63)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 174, 23)) +>Head : Symbol(Head, Decl(strictSubtypeAndNarrowing.ts, 178, 39)) +>NarrowByDeepValue : Symbol(NarrowByDeepValue, Decl(strictSubtypeAndNarrowing.ts, 172, 12)) +>NonNullable : Symbol(NonNullable, Decl(lib.es5.d.ts, --, --)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 174, 23)) +>Head : Symbol(Head, Decl(strictSubtypeAndNarrowing.ts, 178, 39)) +>Rest : Symbol(Rest, Decl(strictSubtypeAndNarrowing.ts, 178, 85)) +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 174, 39)) + + : never; + + +declare function doesValueAtDeepPathSatisfy< +>doesValueAtDeepPathSatisfy : Symbol(doesValueAtDeepPathSatisfy, Decl(strictSubtypeAndNarrowing.ts, 180, 12)) + + ObjT extends object, +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 183, 44)) + + const DeepPathT extends ReadonlyArray, +>DeepPathT : Symbol(DeepPathT, Decl(strictSubtypeAndNarrowing.ts, 184, 24)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --)) + + ValueT, +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 185, 59)) + +>( + obj: ObjT, +>obj : Symbol(obj, Decl(strictSubtypeAndNarrowing.ts, 187, 2)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 183, 44)) + + deepPath: DeepPathT, +>deepPath : Symbol(deepPath, Decl(strictSubtypeAndNarrowing.ts, 188, 14)) +>DeepPathT : Symbol(DeepPathT, Decl(strictSubtypeAndNarrowing.ts, 184, 24)) + + predicate: (arg: unknown) => arg is ValueT, +>predicate : Symbol(predicate, Decl(strictSubtypeAndNarrowing.ts, 189, 24)) +>arg : Symbol(arg, Decl(strictSubtypeAndNarrowing.ts, 190, 16)) +>arg : Symbol(arg, Decl(strictSubtypeAndNarrowing.ts, 190, 16)) +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 185, 59)) + +): obj is NarrowByDeepValue; +>obj : Symbol(obj, Decl(strictSubtypeAndNarrowing.ts, 187, 2)) +>NarrowByDeepValue : Symbol(NarrowByDeepValue, Decl(strictSubtypeAndNarrowing.ts, 172, 12)) +>ObjT : Symbol(ObjT, Decl(strictSubtypeAndNarrowing.ts, 183, 44)) +>DeepPathT : Symbol(DeepPathT, Decl(strictSubtypeAndNarrowing.ts, 184, 24)) +>ValueT : Symbol(ValueT, Decl(strictSubtypeAndNarrowing.ts, 185, 59)) + + +type Foo = {value: {type: 'A'}; a?: number} | {value: {type: 'B'}; b?: number}; +>Foo : Symbol(Foo, Decl(strictSubtypeAndNarrowing.ts, 191, 53)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 194, 12)) +>type : Symbol(type, Decl(strictSubtypeAndNarrowing.ts, 194, 20)) +>a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 194, 31)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 194, 47)) +>type : Symbol(type, Decl(strictSubtypeAndNarrowing.ts, 194, 55)) +>b : Symbol(b, Decl(strictSubtypeAndNarrowing.ts, 194, 66)) + +declare function isA(arg: unknown): arg is 'A'; +>isA : Symbol(isA, Decl(strictSubtypeAndNarrowing.ts, 194, 79)) +>arg : Symbol(arg, Decl(strictSubtypeAndNarrowing.ts, 196, 21)) +>arg : Symbol(arg, Decl(strictSubtypeAndNarrowing.ts, 196, 21)) + +declare function isB(arg: unknown): arg is 'B'; +>isB : Symbol(isB, Decl(strictSubtypeAndNarrowing.ts, 196, 47)) +>arg : Symbol(arg, Decl(strictSubtypeAndNarrowing.ts, 197, 21)) +>arg : Symbol(arg, Decl(strictSubtypeAndNarrowing.ts, 197, 21)) + +declare function assert(condition: boolean): asserts condition; +>assert : Symbol(assert, Decl(strictSubtypeAndNarrowing.ts, 197, 47)) +>condition : Symbol(condition, Decl(strictSubtypeAndNarrowing.ts, 199, 24)) +>condition : Symbol(condition, Decl(strictSubtypeAndNarrowing.ts, 199, 24)) + +function test1(foo: Foo): {value: {type: 'A'}; a?: number} { +>test1 : Symbol(test1, Decl(strictSubtypeAndNarrowing.ts, 199, 63)) +>foo : Symbol(foo, Decl(strictSubtypeAndNarrowing.ts, 201, 15)) +>Foo : Symbol(Foo, Decl(strictSubtypeAndNarrowing.ts, 191, 53)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 201, 27)) +>type : Symbol(type, Decl(strictSubtypeAndNarrowing.ts, 201, 35)) +>a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 201, 46)) + + assert(doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isA)); +>assert : Symbol(assert, Decl(strictSubtypeAndNarrowing.ts, 197, 47)) +>doesValueAtDeepPathSatisfy : Symbol(doesValueAtDeepPathSatisfy, Decl(strictSubtypeAndNarrowing.ts, 180, 12)) +>foo : Symbol(foo, Decl(strictSubtypeAndNarrowing.ts, 201, 15)) +>isA : Symbol(isA, Decl(strictSubtypeAndNarrowing.ts, 194, 79)) + + return foo; +>foo : Symbol(foo, Decl(strictSubtypeAndNarrowing.ts, 201, 15)) +} + +function test2(foo: Foo): {value: {type: 'A'}; a?: number} { +>test2 : Symbol(test2, Decl(strictSubtypeAndNarrowing.ts, 204, 1)) +>foo : Symbol(foo, Decl(strictSubtypeAndNarrowing.ts, 206, 15)) +>Foo : Symbol(Foo, Decl(strictSubtypeAndNarrowing.ts, 191, 53)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 206, 27)) +>type : Symbol(type, Decl(strictSubtypeAndNarrowing.ts, 206, 35)) +>a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 206, 46)) + + assert(!doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB)); +>assert : Symbol(assert, Decl(strictSubtypeAndNarrowing.ts, 197, 47)) +>doesValueAtDeepPathSatisfy : Symbol(doesValueAtDeepPathSatisfy, Decl(strictSubtypeAndNarrowing.ts, 180, 12)) +>foo : Symbol(foo, Decl(strictSubtypeAndNarrowing.ts, 206, 15)) +>isB : Symbol(isB, Decl(strictSubtypeAndNarrowing.ts, 196, 47)) + + return foo; +>foo : Symbol(foo, Decl(strictSubtypeAndNarrowing.ts, 206, 15)) +} + +// Repro from #53063 + +interface Free { +>Free : Symbol(Free, Decl(strictSubtypeAndNarrowing.ts, 209, 1)) + + premium: false; +>premium : Symbol(Free.premium, Decl(strictSubtypeAndNarrowing.ts, 213, 16)) +} + +interface Premium { +>Premium : Symbol(Premium, Decl(strictSubtypeAndNarrowing.ts, 215, 1)) + + premium: true; +>premium : Symbol(Premium.premium, Decl(strictSubtypeAndNarrowing.ts, 217, 19)) +} + +type Union = { premium: false } | { premium: true }; +>Union : Symbol(Union, Decl(strictSubtypeAndNarrowing.ts, 219, 1)) +>premium : Symbol(premium, Decl(strictSubtypeAndNarrowing.ts, 221, 14)) +>premium : Symbol(premium, Decl(strictSubtypeAndNarrowing.ts, 221, 35)) + +declare const checkIsPremium: (a: Union) => a is Union & Premium; +>checkIsPremium : Symbol(checkIsPremium, Decl(strictSubtypeAndNarrowing.ts, 223, 13)) +>a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 223, 31)) +>Union : Symbol(Union, Decl(strictSubtypeAndNarrowing.ts, 219, 1)) +>a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 223, 31)) +>Union : Symbol(Union, Decl(strictSubtypeAndNarrowing.ts, 219, 1)) +>Premium : Symbol(Premium, Decl(strictSubtypeAndNarrowing.ts, 215, 1)) + +const f = (value: Union) => { +>f : Symbol(f, Decl(strictSubtypeAndNarrowing.ts, 225, 5)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 225, 11)) +>Union : Symbol(Union, Decl(strictSubtypeAndNarrowing.ts, 219, 1)) + + if (!checkIsPremium(value)) { +>checkIsPremium : Symbol(checkIsPremium, Decl(strictSubtypeAndNarrowing.ts, 223, 13)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 225, 11)) + + value.premium; +>value.premium : Symbol(premium, Decl(strictSubtypeAndNarrowing.ts, 221, 14)) +>value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 225, 11)) +>premium : Symbol(premium, Decl(strictSubtypeAndNarrowing.ts, 221, 14)) + } +}; + diff --git a/tests/baselines/reference/strictSubtypeAndNarrowing.types b/tests/baselines/reference/strictSubtypeAndNarrowing.types index 8f2e6a2cd8c83..1dcee9598a60a 100644 --- a/tests/baselines/reference/strictSubtypeAndNarrowing.types +++ b/tests/baselines/reference/strictSubtypeAndNarrowing.types @@ -326,3 +326,234 @@ function fx11(): { x?: number } { >2 : 2 } +// Repros from #52827 + +declare function isArrayLike(value: any): value is { length: number }; +>isArrayLike : (value: any) => value is { length: number; } +>value : any +>length : number + +function ff1(value: { [index: number]: boolean, length: number } | undefined) { +>ff1 : (value: { [index: number]: boolean; length: number; } | undefined) => void +>value : { [index: number]: boolean; length: number; } | undefined +>index : number +>length : number + + if (isArrayLike(value)) { +>isArrayLike(value) : boolean +>isArrayLike : (value: any) => value is { length: number; } +>value : { [index: number]: boolean; length: number; } | undefined + + value; +>value : { [index: number]: boolean; length: number; } + + } else { + value; +>value : undefined + } + value; +>value : { [index: number]: boolean; length: number; } | undefined +} + +function ff2(value: { [index: number]: boolean, length: number } | string) { +>ff2 : (value: string | { [index: number]: boolean; length: number; }) => void +>value : string | { [index: number]: boolean; length: number; } +>index : number +>length : number + + if (isArrayLike(value)) { +>isArrayLike(value) : boolean +>isArrayLike : (value: any) => value is { length: number; } +>value : string | { [index: number]: boolean; length: number; } + + value; +>value : string | { [index: number]: boolean; length: number; } + + } else { + value; +>value : never + } + value; +>value : string | { [index: number]: boolean; length: number; } +} + +function ff3(value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined) { +>ff3 : (value: string | number | { [index: number]: boolean; length: number; } | [number, boolean] | { length: string; } | { a: string; } | string[] | null | undefined) => void +>value : string | number | { [index: number]: boolean; length: number; } | [number, boolean] | { length: string; } | { a: string; } | string[] | null | undefined +>index : number +>length : number +>length : string +>a : string +>null : null + + if (isArrayLike(value)) { +>isArrayLike(value) : boolean +>isArrayLike : (value: any) => value is { length: number; } +>value : string | number | { [index: number]: boolean; length: number; } | [number, boolean] | { length: string; } | { a: string; } | string[] | null | undefined + + value; +>value : string | { [index: number]: boolean; length: number; } | [number, boolean] | string[] + + } else { + value; +>value : number | { length: string; } | { a: string; } | null | undefined + } + value; +>value : string | number | { [index: number]: boolean; length: number; } | [number, boolean] | { length: string; } | { a: string; } | string[] | null | undefined +} + +// Repro from comment in #52984 + +type DistributedKeyOf = T extends unknown ? keyof T : never; +>DistributedKeyOf : DistributedKeyOf + +type NarrowByKeyValue = ObjT extends unknown +>NarrowByKeyValue : NarrowByKeyValue + + ? KeyT extends keyof ObjT + ? ValueT extends ObjT[KeyT] + ? ObjT & Readonly> + : never + : never + : never; + +type NarrowByDeepValue = DeepPathT extends readonly [ +>NarrowByDeepValue : NarrowByDeepValue + + infer Head extends DistributedKeyOf, +] + ? NarrowByKeyValue + : DeepPathT extends readonly [infer Head extends DistributedKeyOf, ...infer Rest] + ? NarrowByKeyValue, Rest, ValueT>> + : never; + + +declare function doesValueAtDeepPathSatisfy< +>doesValueAtDeepPathSatisfy : (obj: ObjT, deepPath: DeepPathT, predicate: (arg: unknown) => arg is ValueT) => obj is NarrowByDeepValue + + ObjT extends object, + const DeepPathT extends ReadonlyArray, + ValueT, +>( + obj: ObjT, +>obj : ObjT + + deepPath: DeepPathT, +>deepPath : DeepPathT + + predicate: (arg: unknown) => arg is ValueT, +>predicate : (arg: unknown) => arg is ValueT +>arg : unknown + +): obj is NarrowByDeepValue; + + +type Foo = {value: {type: 'A'}; a?: number} | {value: {type: 'B'}; b?: number}; +>Foo : { value: { type: 'A';}; a?: number | undefined; } | { value: { type: 'B';}; b?: number | undefined; } +>value : { type: 'A'; } +>type : "A" +>a : number | undefined +>value : { type: 'B'; } +>type : "B" +>b : number | undefined + +declare function isA(arg: unknown): arg is 'A'; +>isA : (arg: unknown) => arg is "A" +>arg : unknown + +declare function isB(arg: unknown): arg is 'B'; +>isB : (arg: unknown) => arg is "B" +>arg : unknown + +declare function assert(condition: boolean): asserts condition; +>assert : (condition: boolean) => asserts condition +>condition : boolean + +function test1(foo: Foo): {value: {type: 'A'}; a?: number} { +>test1 : (foo: Foo) => { value: { type: 'A'; }; a?: number;} +>foo : Foo +>value : { type: 'A'; } +>type : "A" +>a : number | undefined + + assert(doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isA)); +>assert(doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isA)) : void +>assert : (condition: boolean) => asserts condition +>doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isA) : boolean +>doesValueAtDeepPathSatisfy : (obj: ObjT, deepPath: DeepPathT, predicate: (arg: unknown) => arg is ValueT) => obj is NarrowByDeepValue +>foo : Foo +>['value', 'type'] : ["value", "type"] +>'value' : "value" +>'type' : "type" +>isA : (arg: unknown) => arg is "A" + + return foo; +>foo : { value: { type: "A"; }; a?: number | undefined; } +} + +function test2(foo: Foo): {value: {type: 'A'}; a?: number} { +>test2 : (foo: Foo) => { value: { type: 'A'; }; a?: number;} +>foo : Foo +>value : { type: 'A'; } +>type : "A" +>a : number | undefined + + assert(!doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB)); +>assert(!doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB)) : void +>assert : (condition: boolean) => asserts condition +>!doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB) : boolean +>doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB) : boolean +>doesValueAtDeepPathSatisfy : (obj: ObjT, deepPath: DeepPathT, predicate: (arg: unknown) => arg is ValueT) => obj is NarrowByDeepValue +>foo : Foo +>['value', 'type'] : ["value", "type"] +>'value' : "value" +>'type' : "type" +>isB : (arg: unknown) => arg is "B" + + return foo; +>foo : { value: { type: "A"; }; a?: number | undefined; } +} + +// Repro from #53063 + +interface Free { + premium: false; +>premium : false +>false : false +} + +interface Premium { + premium: true; +>premium : true +>true : true +} + +type Union = { premium: false } | { premium: true }; +>Union : { premium: false; } | { premium: true; } +>premium : false +>false : false +>premium : true +>true : true + +declare const checkIsPremium: (a: Union) => a is Union & Premium; +>checkIsPremium : (a: Union) => a is { premium: true; } & Premium +>a : Union + +const f = (value: Union) => { +>f : (value: Union) => void +>(value: Union) => { if (!checkIsPremium(value)) { value.premium; }} : (value: Union) => void +>value : Union + + if (!checkIsPremium(value)) { +>!checkIsPremium(value) : boolean +>checkIsPremium(value) : boolean +>checkIsPremium : (a: Union) => a is { premium: true; } & Premium +>value : Union + + value.premium; +>value.premium : false +>value : { premium: false; } +>premium : false + } +}; + diff --git a/tests/cases/compiler/strictSubtypeAndNarrowing.ts b/tests/cases/compiler/strictSubtypeAndNarrowing.ts index 6239072f97efe..58a7629ff4307 100644 --- a/tests/cases/compiler/strictSubtypeAndNarrowing.ts +++ b/tests/cases/compiler/strictSubtypeAndNarrowing.ts @@ -130,3 +130,103 @@ function fx11(): { x?: number } { let obj: { x?: number, y?: number }; return obj = { x: 1, y: 2 }; } + +// Repros from #52827 + +declare function isArrayLike(value: any): value is { length: number }; + +function ff1(value: { [index: number]: boolean, length: number } | undefined) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; +} + +function ff2(value: { [index: number]: boolean, length: number } | string) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; +} + +function ff3(value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined) { + if (isArrayLike(value)) { + value; + } else { + value; + } + value; +} + +// Repro from comment in #52984 + +type DistributedKeyOf = T extends unknown ? keyof T : never; + +type NarrowByKeyValue = ObjT extends unknown + ? KeyT extends keyof ObjT + ? ValueT extends ObjT[KeyT] + ? ObjT & Readonly> + : never + : never + : never; + +type NarrowByDeepValue = DeepPathT extends readonly [ + infer Head extends DistributedKeyOf, +] + ? NarrowByKeyValue + : DeepPathT extends readonly [infer Head extends DistributedKeyOf, ...infer Rest] + ? NarrowByKeyValue, Rest, ValueT>> + : never; + + +declare function doesValueAtDeepPathSatisfy< + ObjT extends object, + const DeepPathT extends ReadonlyArray, + ValueT, +>( + obj: ObjT, + deepPath: DeepPathT, + predicate: (arg: unknown) => arg is ValueT, +): obj is NarrowByDeepValue; + + +type Foo = {value: {type: 'A'}; a?: number} | {value: {type: 'B'}; b?: number}; + +declare function isA(arg: unknown): arg is 'A'; +declare function isB(arg: unknown): arg is 'B'; + +declare function assert(condition: boolean): asserts condition; + +function test1(foo: Foo): {value: {type: 'A'}; a?: number} { + assert(doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isA)); + return foo; +} + +function test2(foo: Foo): {value: {type: 'A'}; a?: number} { + assert(!doesValueAtDeepPathSatisfy(foo, ['value', 'type'], isB)); + return foo; +} + +// Repro from #53063 + +interface Free { + premium: false; +} + +interface Premium { + premium: true; +} + +type Union = { premium: false } | { premium: true }; + +declare const checkIsPremium: (a: Union) => a is Union & Premium; + +const f = (value: Union) => { + if (!checkIsPremium(value)) { + value.premium; + } +}; From 4d4227adc4bb6e083796afa2b1f9f43e6b58516d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 6 Mar 2023 23:22:27 -0800 Subject: [PATCH 07/35] Pin dependencies in `release-5.0` (#53126) Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- package-lock.json | 38 +++++++++++++++++++------------------- package.json | 26 +++++++++++++------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 09a8e4598a335..aaefe0d9eafc0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,21 +15,21 @@ "devDependencies": { "@esfx/canceltoken": "^1.0.0", "@octokit/rest": "latest", - "@types/chai": "latest", + "@types/chai": "^4.3.4", "@types/fs-extra": "^9.0.13", - "@types/glob": "latest", - "@types/microsoft__typescript-etw": "latest", - "@types/minimist": "latest", - "@types/mocha": "latest", - "@types/ms": "latest", + "@types/glob": "^8.1.0", + "@types/microsoft__typescript-etw": "^0.1.1", + "@types/minimist": "^1.2.2", + "@types/mocha": "^10.0.1", + "@types/ms": "^0.7.31", "@types/node": "latest", - "@types/source-map-support": "latest", + "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", "@typescript-eslint/eslint-plugin": "^5.33.1", "@typescript-eslint/parser": "^5.33.1", "@typescript-eslint/utils": "^5.33.1", "azure-devops-node-api": "^11.2.0", - "chai": "latest", + "chai": "^4.3.7", "chalk": "^4.1.2", "chokidar": "^3.5.3", "del": "^6.1.1", @@ -43,15 +43,15 @@ "eslint-plugin-simple-import-sort": "^10.0.0", "fast-xml-parser": "^4.0.11", "fs-extra": "^9.1.0", - "glob": "latest", + "glob": "^8.1.0", "hereby": "^1.6.4", "jsonc-parser": "^3.2.0", - "minimist": "latest", - "mocha": "latest", - "mocha-fivemat-progress-reporter": "latest", + "minimist": "^1.2.8", + "mocha": "^10.2.0", + "mocha-fivemat-progress-reporter": "^0.1.0", "ms": "^2.1.3", "node-fetch": "^3.2.10", - "source-map-support": "latest", + "source-map-support": "^0.5.21", "typescript": "5.0.0-dev.20230112", "which": "^2.0.2" }, @@ -2786,9 +2786,9 @@ } }, "node_modules/irregular-plurals": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.4.0.tgz", - "integrity": "sha512-YXxECO/W6N9aMBVKMKKZ8TXESgq7EFrp3emCGGUcrYY1cgJIeZjoB75MTu8qi+NAKntS9NwPU8VdcQ3r6E6aWQ==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.4.1.tgz", + "integrity": "sha512-JR7VL+1Kd9z79bE+2uSgifpzrTwLWmTvyeUewhxZCHVtpPImAsLk4adfRxg86uvdsJ8etYYrpzN7vRT30gGnOA==", "dev": true, "engines": { "node": ">=8" @@ -6485,9 +6485,9 @@ } }, "irregular-plurals": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.4.0.tgz", - "integrity": "sha512-YXxECO/W6N9aMBVKMKKZ8TXESgq7EFrp3emCGGUcrYY1cgJIeZjoB75MTu8qi+NAKntS9NwPU8VdcQ3r6E6aWQ==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.4.1.tgz", + "integrity": "sha512-JR7VL+1Kd9z79bE+2uSgifpzrTwLWmTvyeUewhxZCHVtpPImAsLk4adfRxg86uvdsJ8etYYrpzN7vRT30gGnOA==", "dev": true }, "is-array-buffer": { diff --git a/package.json b/package.json index 6a27fc8f38983..35f7b0f586981 100644 --- a/package.json +++ b/package.json @@ -41,21 +41,21 @@ "devDependencies": { "@esfx/canceltoken": "^1.0.0", "@octokit/rest": "latest", - "@types/chai": "latest", + "@types/chai": "^4.3.4", "@types/fs-extra": "^9.0.13", - "@types/glob": "latest", - "@types/microsoft__typescript-etw": "latest", - "@types/minimist": "latest", - "@types/mocha": "latest", - "@types/ms": "latest", + "@types/glob": "^8.1.0", + "@types/microsoft__typescript-etw": "^0.1.1", + "@types/minimist": "^1.2.2", + "@types/mocha": "^10.0.1", + "@types/ms": "^0.7.31", "@types/node": "latest", - "@types/source-map-support": "latest", + "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", "@typescript-eslint/eslint-plugin": "^5.33.1", "@typescript-eslint/parser": "^5.33.1", "@typescript-eslint/utils": "^5.33.1", "azure-devops-node-api": "^11.2.0", - "chai": "latest", + "chai": "^4.3.7", "chalk": "^4.1.2", "chokidar": "^3.5.3", "del": "^6.1.1", @@ -69,15 +69,15 @@ "eslint-plugin-simple-import-sort": "^10.0.0", "fast-xml-parser": "^4.0.11", "fs-extra": "^9.1.0", - "glob": "latest", + "glob": "^8.1.0", "hereby": "^1.6.4", "jsonc-parser": "^3.2.0", - "minimist": "latest", - "mocha": "latest", - "mocha-fivemat-progress-reporter": "latest", + "minimist": "^1.2.8", + "mocha": "^10.2.0", + "mocha-fivemat-progress-reporter": "^0.1.0", "ms": "^2.1.3", "node-fetch": "^3.2.10", - "source-map-support": "latest", + "source-map-support": "^0.5.21", "typescript": "5.0.0-dev.20230112", "which": "^2.0.2" }, From f7f44da0649c6c4037065c7c3377136771c0c057 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 9 Mar 2023 14:26:44 -0800 Subject: [PATCH 08/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53183=20(Set?= =?UTF-8?q?=20package.json=20minimum=20to=20Node=2012...)=20into=20release?= =?UTF-8?q?-5.0=20(#53186)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index aaefe0d9eafc0..1950a8d9f661d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,7 @@ "which": "^2.0.2" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/@esbuild/android-arm": { diff --git a/package.json b/package.json index 35f7b0f586981..63600f1316936 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "tsserver": "./bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" }, "files": [ "bin", From 23455b4aab1a6a30acd8fa381eb6d980e158f6bd Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 9 Mar 2023 16:07:26 -0800 Subject: [PATCH 09/35] Cherry-pick #52993 to release-5.0 (#53142) --- src/compiler/diagnosticMessages.json | 12 +- src/compiler/program.ts | 193 ++++++++++-------- src/compiler/types.ts | 9 - .../reference/ES3For-ofTypeCheck1.errors.txt | 4 +- .../reference/ES3For-ofTypeCheck2.errors.txt | 4 +- .../reference/ES3For-ofTypeCheck4.errors.txt | 4 +- .../reference/ES3For-ofTypeCheck6.errors.txt | 4 +- .../reference/accessorWithES3.errors.txt | 4 +- .../accessorsNotAllowedInES3.errors.txt | 4 +- ...alwaysStrictNoImplicitUseStrict.errors.txt | 4 +- .../ambientAccessors(target=es3).errors.txt | 4 +- ...mdDeclarationEmitNoExtraDeclare.errors.txt | 6 +- .../reference/bigIntWithTargetES3.errors.txt | 4 +- ...aintOfJavascriptClassExpression.errors.txt | 6 +- .../reference/checkJsdocReturnTag1.errors.txt | 6 +- .../reference/checkJsdocReturnTag2.errors.txt | 6 +- .../compilerOptionsOutAndNoEmit.errors.txt | 6 +- ...dPropertyNames52(target=es2015).errors.txt | 6 +- ...utedPropertyNames52(target=es5).errors.txt | 6 +- ...clarations-useBeforeDefinition2.errors.txt | 6 +- .../controlFlowJavascript.errors.txt | 6 +- ...rsInInputDeclarationFileWithOut.errors.txt | 6 +- ...rationFileOverwriteErrorWithOut.errors.txt | 6 +- .../definePropertyOutputES3.errors.txt | 4 +- .../deprecatedCompilerOptions1.errors.txt | 34 +-- .../deprecatedCompilerOptions3.errors.txt | 34 +-- .../deprecatedCompilerOptions4.errors.txt | 46 +++++ .../deprecatedCompilerOptions5.errors.txt | 39 ++-- .../deprecatedCompilerOptions6.errors.txt | 50 +++++ .../reference/deprecatedCompilerOptions6.js | 6 + .../deprecatedCompilerOptions6.symbols | 4 + .../deprecatedCompilerOptions6.types | 5 + .../reference/dynamicRequire.errors.txt | 6 +- .../emptyFile-declaration.errors.txt | 4 +- .../reference/emptyFile-souremap.errors.txt | 4 +- tests/baselines/reference/es3-amd.errors.txt | 4 +- .../reference/es3-declaration-amd.errors.txt | 4 +- .../reference/es3-jsx-preserve.errors.txt | 4 +- .../reference/es3-jsx-react-native.errors.txt | 4 +- .../reference/es3-jsx-react.errors.txt | 4 +- ...es3-oldStyleOctalLiteralInEnums.errors.txt | 4 +- .../es3-oldStyleOctalLiteralTypes.errors.txt | 4 +- .../reference/es3-sourcemap-amd.errors.txt | 4 +- .../es3defaultAliasIsQuoted.errors.txt | 4 +- ...teropWithExportStar(target=es3).errors.txt | 4 +- .../excessPropertyErrorsSuppressed.errors.txt | 4 +- .../exportAndImport-es3-amd.errors.txt | 4 +- .../reference/exportAndImport-es3.errors.txt | 4 +- .../exportDefaultInJsFile01.errors.txt | 4 +- ...portsAndImportsWithUnderscores1.errors.txt | 4 +- ...portsAndImportsWithUnderscores2.errors.txt | 4 +- ...portsAndImportsWithUnderscores3.errors.txt | 4 +- ...portsAndImportsWithUnderscores4.errors.txt | 4 +- ...tingIntoSameOutputWithOutOption.errors.txt | 6 +- .../genericSetterInClassTypeJsDoc.errors.txt | 6 +- .../globalThisVarDeclaration.errors.txt | 6 +- ...importCallExpressionAsyncES3AMD.errors.txt | 4 +- ...importCallExpressionAsyncES3CJS.errors.txt | 4 +- ...ortCallExpressionAsyncES3System.errors.txt | 4 +- ...importCallExpressionAsyncES3UMD.errors.txt | 4 +- .../importsNotUsedAsValues_error.errors.txt | 4 +- .../reference/incrementalOut.errors.txt | 6 +- ...ringClassMembersFromAssignments.errors.txt | 6 +- .../reference/inlineSourceMap.errors.txt | 4 +- .../reference/inlineSourceMap2.errors.txt | 10 +- .../reference/inlineSources.errors.txt | 10 +- .../reference/inlineSources2.errors.txt | 10 +- .../baselines/reference/isLiteral2.errors.txt | 4 +- .../reference/isolatedModulesOut.errors.txt | 6 +- ...ssMethodContainingArrowFunction.errors.txt | 6 +- ...DuplicateFunctionImplementation.errors.txt | 6 +- ...ImplementationFileOrderReversed.errors.txt | 6 +- ...ileCompilationDuplicateVariable.errors.txt | 6 +- ...nDuplicateVariableErrorReported.errors.txt | 6 +- ...FileCompilationEmitDeclarations.errors.txt | 6 +- ...lationEmitTrippleSlashReference.errors.txt | 6 +- ...tionsWithJsFileReferenceWithOut.errors.txt | 6 +- ...sFileCompilationLetBeingRenamed.errors.txt | 6 +- ...eCompilationLetDeclarationOrder.errors.txt | 6 +- ...CompilationLetDeclarationOrder2.errors.txt | 6 +- ...tionsWithJsFileReferenceWithOut.errors.txt | 6 +- ...FileCompilationNonNullAssertion.errors.txt | 6 +- ...mpilationRestParamJsDocFunction.errors.txt | 6 +- .../jsFileCompilationRestParameter.errors.txt | 6 +- ...ileCompilationShortHandProperty.errors.txt | 6 +- ...jsFileCompilationTypeAssertions.errors.txt | 6 +- ...ationWithEnabledCompositeOption.errors.txt | 6 +- .../jsFileCompilationWithOut.errors.txt | 6 +- ...rationFileNameSameAsInputJsFile.errors.txt | 6 +- ...ithOutFileNameSameAsInputJsFile.errors.txt | 6 +- .../jsObjectsMarkedAsOpenEnded.errors.txt | 6 +- ...ocAccessibilityTagsDeclarations.errors.txt | 6 +- .../reference/jsdocLiteral.errors.txt | 6 +- .../jsdocNeverUndefinedNull.errors.txt | 6 +- .../jsdocReadonlyDeclarations.errors.txt | 6 +- .../reference/jsdocReturnTag1.errors.txt | 6 +- .../reference/keepImportsInDts3.errors.txt | 6 +- .../reference/keepImportsInDts4.errors.txt | 6 +- .../keyofDoesntContainSymbols.errors.txt | 4 +- ...ndConstraintTypeChecksCorrectly.errors.txt | 4 +- ...clarations-useBeforeDefinition2.errors.txt | 6 +- ...edTypeUnionConstraintInferences.errors.txt | 4 +- .../reference/methodsReturningThis.errors.txt | 6 +- ...duleAugmentationsBundledOutput1.errors.txt | 6 +- .../moduleAugmentationsImports1.errors.txt | 6 +- .../moduleAugmentationsImports2.errors.txt | 6 +- .../moduleAugmentationsImports3.errors.txt | 6 +- .../moduleAugmentationsImports4.errors.txt | 6 +- .../reference/multipleDeclarations.errors.txt | 6 +- ...noImplicitAnyIndexingSuppressed.errors.txt | 4 +- .../noImplicitUseStrict_amd.errors.txt | 4 +- .../noImplicitUseStrict_commonjs.errors.txt | 4 +- .../noImplicitUseStrict_es6.errors.txt | 4 +- .../noImplicitUseStrict_system.errors.txt | 4 +- .../noImplicitUseStrict_umd.errors.txt | 4 +- .../noStrictGenericChecks.errors.txt | 4 +- ...veIndexingWithForInSupressError.errors.txt | 4 +- ...nderscoredSeparator(target=es3).errors.txt | 4 +- .../objectLiteralErrorsES3.errors.txt | 4 +- ...eWithStringNamedNumericProperty.errors.txt | 4 +- .../optionsOutAndNoModuleGen.errors.txt | 6 +- .../baselines/reference/out-flag3.errors.txt | 6 +- ...unctionExpression10(target=es3).errors.txt | 4 +- ...unctionExpression11(target=es3).errors.txt | 4 +- ...unctionExpression12(target=es3).errors.txt | 4 +- ...unctionExpression13(target=es3).errors.txt | 4 +- ...unctionExpression14(target=es3).errors.txt | 4 +- ...unctionExpression15(target=es3).errors.txt | 4 +- ...unctionExpression16(target=es3).errors.txt | 4 +- ...unctionExpression17(target=es3).errors.txt | 4 +- ...FunctionExpression8(target=es3).errors.txt | 4 +- ...FunctionExpression9(target=es3).errors.txt | 4 +- .../preserveUnusedImports.errors.txt | 4 +- ...eImports(isolatedmodules=false).errors.txt | 4 +- ...ueImports(isolatedmodules=true).errors.txt | 4 +- ...s_errors(isolatedmodules=false).errors.txt | 4 +- ...ts_errors(isolatedmodules=true).errors.txt | 4 +- ...eImports_importsNotUsedAsValues.errors.txt | 8 +- ...eserveValueImports_mixedImports.errors.txt | 4 +- ...ValueImports_module(module=amd).errors.txt | 4 +- ...Imports_module(module=commonjs).errors.txt | 4 +- ...ueImports_module(module=es2015).errors.txt | 4 +- ...ueImports_module(module=system).errors.txt | 4 +- .../privateNameES5Ban(target=es3).errors.txt | 4 +- .../amd/declarationDir3.errors.txt | 6 +- .../node/declarationDir3.errors.txt | 6 +- ...ationDifferentNamesNotSpecified.errors.txt | 6 +- ...ationDifferentNamesNotSpecified.errors.txt | 6 +- ...entNamesNotSpecifiedWithAllowJs.errors.txt | 6 +- ...entNamesNotSpecifiedWithAllowJs.errors.txt | 6 +- ...pilationDifferentNamesSpecified.errors.txt | 6 +- ...pilationDifferentNamesSpecified.errors.txt | 6 +- ...ferentNamesSpecifiedWithAllowJs.errors.txt | 6 +- ...ferentNamesSpecifiedWithAllowJs.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...thModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...thModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...athMultifolderSpecifyOutputFile.errors.txt | 6 +- ...athMultifolderSpecifyOutputFile.errors.txt | 6 +- ...lutePathSimpleSpecifyOutputFile.errors.txt | 6 +- ...lutePathSimpleSpecifyOutputFile.errors.txt | 6 +- ...PathSingleFileSpecifyOutputFile.errors.txt | 6 +- ...PathSingleFileSpecifyOutputFile.errors.txt | 6 +- ...ePathSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ePathSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...thModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...thModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...athMultifolderSpecifyOutputFile.errors.txt | 6 +- ...athMultifolderSpecifyOutputFile.errors.txt | 6 +- ...tivePathSimpleSpecifyOutputFile.errors.txt | 6 +- ...tivePathSimpleSpecifyOutputFile.errors.txt | 6 +- ...PathSingleFileSpecifyOutputFile.errors.txt | 6 +- ...PathSingleFileSpecifyOutputFile.errors.txt | 6 +- ...ePathSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ePathSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...rlModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...rlModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...UrlMultifolderSpecifyOutputFile.errors.txt | 6 +- ...UrlMultifolderSpecifyOutputFile.errors.txt | 6 +- ...prootUrlSimpleSpecifyOutputFile.errors.txt | 6 +- ...prootUrlSimpleSpecifyOutputFile.errors.txt | 6 +- ...tUrlSingleFileSpecifyOutputFile.errors.txt | 6 +- ...tUrlSingleFileSpecifyOutputFile.errors.txt | 6 +- ...otUrlSubfolderSpecifyOutputFile.errors.txt | 6 +- ...otUrlSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...rlModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...rlModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...UrlMultifolderSpecifyOutputFile.errors.txt | 6 +- ...UrlMultifolderSpecifyOutputFile.errors.txt | 6 +- ...erootUrlSimpleSpecifyOutputFile.errors.txt | 6 +- ...erootUrlSimpleSpecifyOutputFile.errors.txt | 6 +- ...tUrlSingleFileSpecifyOutputFile.errors.txt | 6 +- ...tUrlSingleFileSpecifyOutputFile.errors.txt | 6 +- ...otUrlSubfolderSpecifyOutputFile.errors.txt | 6 +- ...otUrlSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...utModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...utModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...outMultifolderSpecifyOutputFile.errors.txt | 6 +- ...outMultifolderSpecifyOutputFile.errors.txt | 6 +- .../amd/outSimpleSpecifyOutputFile.errors.txt | 6 +- .../outSimpleSpecifyOutputFile.errors.txt | 6 +- .../outSingleFileSpecifyOutputFile.errors.txt | 6 +- .../outSingleFileSpecifyOutputFile.errors.txt | 6 +- .../outSubfolderSpecifyOutputFile.errors.txt | 6 +- .../outSubfolderSpecifyOutputFile.errors.txt | 6 +- .../prologueEmit/amd/prologueEmit.errors.txt | 6 +- .../prologueEmit/node/prologueEmit.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...thModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...thModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...athMultifolderSpecifyOutputFile.errors.txt | 6 +- ...athMultifolderSpecifyOutputFile.errors.txt | 6 +- ...lutePathSimpleSpecifyOutputFile.errors.txt | 6 +- ...lutePathSimpleSpecifyOutputFile.errors.txt | 6 +- ...PathSingleFileSpecifyOutputFile.errors.txt | 6 +- ...PathSingleFileSpecifyOutputFile.errors.txt | 6 +- ...ePathSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ePathSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...thModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...thModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...athMultifolderSpecifyOutputFile.errors.txt | 6 +- ...athMultifolderSpecifyOutputFile.errors.txt | 6 +- ...tivePathSimpleSpecifyOutputFile.errors.txt | 6 +- ...tivePathSimpleSpecifyOutputFile.errors.txt | 6 +- ...PathSingleFileSpecifyOutputFile.errors.txt | 6 +- ...PathSingleFileSpecifyOutputFile.errors.txt | 6 +- ...ePathSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ePathSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...apModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...apModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...mapMultifolderSpecifyOutputFile.errors.txt | 6 +- ...mapMultifolderSpecifyOutputFile.errors.txt | 6 +- ...ourcemapSimpleSpecifyOutputFile.errors.txt | 6 +- ...ourcemapSimpleSpecifyOutputFile.errors.txt | 6 +- ...emapSingleFileSpecifyOutputFile.errors.txt | 6 +- ...emapSingleFileSpecifyOutputFile.errors.txt | 6 +- ...cemapSubfolderSpecifyOutputFile.errors.txt | 6 +- ...cemapSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...MixedSubfolderSpecifyOutputFile.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...ifyOutputFileAndOutputDirectory.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...uleMultifolderSpecifyOutputFile.errors.txt | 6 +- ...rlModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...rlModuleSimpleSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...oduleSubfolderSpecifyOutputFile.errors.txt | 6 +- ...UrlMultifolderSpecifyOutputFile.errors.txt | 6 +- ...UrlMultifolderSpecifyOutputFile.errors.txt | 6 +- ...erootUrlSimpleSpecifyOutputFile.errors.txt | 6 +- ...erootUrlSimpleSpecifyOutputFile.errors.txt | 6 +- ...tUrlSingleFileSpecifyOutputFile.errors.txt | 6 +- ...tUrlSingleFileSpecifyOutputFile.errors.txt | 6 +- ...otUrlSubfolderSpecifyOutputFile.errors.txt | 6 +- ...otUrlSubfolderSpecifyOutputFile.errors.txt | 6 +- .../propertyAccessNumericLiterals.errors.txt | 4 +- ...esUseJSDocForOptionalParameters.errors.txt | 6 +- .../reference/sourceMap-Comment1.errors.txt | 4 +- .../reference/sourceMap-EmptyFile1.errors.txt | 4 +- ...cePrecedingVariableDeclaration1.errors.txt | 4 +- .../reference/sourceMap-LineBreaks.errors.txt | 4 +- .../reference/sourceMap-NewLine1.errors.txt | 4 +- .../reference/sourceMap-SemiColon1.errors.txt | 4 +- .../sourceMap-SingleSpace1.errors.txt | 4 +- ...rceMap-StringLiteralWithNewLine.errors.txt | 4 +- ...ceMapWithCaseSensitiveFileNames.errors.txt | 6 +- ...pWithMultipleFilesWithCopyright.errors.txt | 6 +- ...ilesWithFileEndingWithInterface.errors.txt | 6 +- ...apWithNonCaseSensitiveFileNames.errors.txt | 6 +- ...plateStringsWithCurriedFunction.errors.txt | 4 +- .../topLevelThisAssignment.errors.txt | 6 +- .../reference/trailingCommasES3.errors.txt | 4 +- ...t generate semantic diagnostics.errors.txt | 4 +- ...mantic diagnostics.oldTranspile.errors.txt | 4 +- ... referenced only by export type.errors.txt | 4 +- ...nly by export type.oldTranspile.errors.txt | 4 +- ...y by type only export specifier.errors.txt | 4 +- ...y export specifier.oldTranspile.errors.txt | 4 +- ...r as ns conflict does not crash.errors.txt | 4 +- ...ict does not crash.oldTranspile.errors.txt | 4 +- ... expected syntactic diagnostics.errors.txt | 4 +- ...tactic diagnostics.oldTranspile.errors.txt | 4 +- .../Generates module output.errors.txt | 4 +- ...ates module output.oldTranspile.errors.txt | 4 +- ...ics for missing file references.errors.txt | 4 +- ...ng file references.oldTranspile.errors.txt | 4 +- ...tics for missing module imports.errors.txt | 4 +- ...ing module imports.oldTranspile.errors.txt | 4 +- ...o diagnostics with valid inputs.errors.txt | 4 +- ... with valid inputs.oldTranspile.errors.txt | 4 +- .../Infer correct file extension.errors.txt | 4 +- ...ect file extension.oldTranspile.errors.txt | 4 +- ...rors for file without extension.errors.txt | 4 +- ... without extension.oldTranspile.errors.txt | 4 +- .../Rename dependencies - AMD.errors.txt | 4 +- .../Rename dependencies - System.errors.txt | 4 +- .../Rename dependencies - UMD.errors.txt | 4 +- ...ons module-kind is out-of-range.errors.txt | 4 +- ...nd is out-of-range.oldTranspile.errors.txt | 4 +- ...s target-script is out-of-range.errors.txt | 4 +- ...pt is out-of-range.oldTranspile.errors.txt | 4 +- .../transpile/Sets module name.errors.txt | 4 +- .../Sets module name.oldTranspile.errors.txt | 4 +- ...Support options with lib values.errors.txt | 4 +- ...ns with lib values.oldTranspile.errors.txt | 4 +- ...pport options with types values.errors.txt | 4 +- ... with types values.oldTranspile.errors.txt | 4 +- .../Supports as const arrays.errors.txt | 4 +- ...ts as const arrays.oldTranspile.errors.txt | 4 +- ...pports backslashes in file name.errors.txt | 4 +- ...ashes in file name.oldTranspile.errors.txt | 4 +- ...rts readonly keyword for arrays.errors.txt | 4 +- ...keyword for arrays.oldTranspile.errors.txt | 4 +- .../Supports setting allowJs.errors.txt | 4 +- ...ts setting allowJs.oldTranspile.errors.txt | 4 +- ...ng allowSyntheticDefaultImports.errors.txt | 4 +- ...eticDefaultImports.oldTranspile.errors.txt | 4 +- ...ts setting allowUnreachableCode.errors.txt | 4 +- ...lowUnreachableCode.oldTranspile.errors.txt | 4 +- ...ports setting allowUnusedLabels.errors.txt | 4 +- ... allowUnusedLabels.oldTranspile.errors.txt | 4 +- .../Supports setting alwaysStrict.errors.txt | 4 +- ...tting alwaysStrict.oldTranspile.errors.txt | 4 +- .../Supports setting baseUrl.errors.txt | 4 +- ...ts setting baseUrl.oldTranspile.errors.txt | 4 +- .../Supports setting charset.errors.txt | 8 +- ...ts setting charset.oldTranspile.errors.txt | 8 +- .../Supports setting composite.errors.txt | 4 +- ... setting composite.oldTranspile.errors.txt | 4 +- .../Supports setting declaration.errors.txt | 4 +- ...etting declaration.oldTranspile.errors.txt | 4 +- ...Supports setting declarationDir.errors.txt | 4 +- ...ing declarationDir.oldTranspile.errors.txt | 4 +- .../Supports setting emitBOM.errors.txt | 4 +- ...ts setting emitBOM.oldTranspile.errors.txt | 4 +- ...s setting emitDecoratorMetadata.errors.txt | 4 +- ...tDecoratorMetadata.oldTranspile.errors.txt | 4 +- ... setting experimentalDecorators.errors.txt | 4 +- ...rimentalDecorators.oldTranspile.errors.txt | 4 +- ...orceConsistentCasingInFileNames.errors.txt | 4 +- ...tCasingInFileNames.oldTranspile.errors.txt | 4 +- .../Supports setting incremental.errors.txt | 4 +- ...etting incremental.oldTranspile.errors.txt | 4 +- ...upports setting isolatedModules.errors.txt | 4 +- ...ng isolatedModules.oldTranspile.errors.txt | 4 +- .../transpile/Supports setting jsx.errors.txt | 4 +- ...pports setting jsx.oldTranspile.errors.txt | 4 +- .../Supports setting jsxFactory.errors.txt | 4 +- ...setting jsxFactory.oldTranspile.errors.txt | 4 +- ...orts setting jsxFragmentFactory.errors.txt | 4 +- ...jsxFragmentFactory.oldTranspile.errors.txt | 4 +- .../transpile/Supports setting lib.errors.txt | 4 +- ...pports setting lib.oldTranspile.errors.txt | 4 +- .../Supports setting locale.errors.txt | 4 +- ...rts setting locale.oldTranspile.errors.txt | 4 +- .../Supports setting module.errors.txt | 4 +- ...rts setting module.oldTranspile.errors.txt | 4 +- ...pports setting moduleResolution.errors.txt | 4 +- ...g moduleResolution.oldTranspile.errors.txt | 4 +- .../Supports setting newLine.errors.txt | 4 +- ...ts setting newLine.oldTranspile.errors.txt | 4 +- .../Supports setting noEmit.errors.txt | 4 +- ...rts setting noEmit.oldTranspile.errors.txt | 4 +- .../Supports setting noEmitHelpers.errors.txt | 4 +- ...ting noEmitHelpers.oldTranspile.errors.txt | 4 +- .../Supports setting noEmitOnError.errors.txt | 4 +- ...ting noEmitOnError.oldTranspile.errors.txt | 4 +- ...ports setting noErrorTruncation.errors.txt | 4 +- ... noErrorTruncation.oldTranspile.errors.txt | 4 +- ...ting noFallthroughCasesInSwitch.errors.txt | 4 +- ...roughCasesInSwitch.oldTranspile.errors.txt | 4 +- .../Supports setting noImplicitAny.errors.txt | 4 +- ...ting noImplicitAny.oldTranspile.errors.txt | 4 +- ...ports setting noImplicitReturns.errors.txt | 4 +- ... noImplicitReturns.oldTranspile.errors.txt | 4 +- ...Supports setting noImplicitThis.errors.txt | 4 +- ...ing noImplicitThis.oldTranspile.errors.txt | 4 +- ...rts setting noImplicitUseStrict.errors.txt | 8 +- ...oImplicitUseStrict.oldTranspile.errors.txt | 8 +- .../Supports setting noLib.errors.txt | 4 +- ...orts setting noLib.oldTranspile.errors.txt | 4 +- .../Supports setting noResolve.errors.txt | 4 +- ... setting noResolve.oldTranspile.errors.txt | 4 +- .../transpile/Supports setting out.errors.txt | 4 +- ...pports setting out.oldTranspile.errors.txt | 4 +- .../Supports setting outDir.errors.txt | 4 +- ...rts setting outDir.oldTranspile.errors.txt | 4 +- .../Supports setting outFile.errors.txt | 4 +- ...ts setting outFile.oldTranspile.errors.txt | 4 +- .../Supports setting paths.errors.txt | 4 +- ...orts setting paths.oldTranspile.errors.txt | 4 +- ...orts setting preserveConstEnums.errors.txt | 4 +- ...preserveConstEnums.oldTranspile.errors.txt | 4 +- ...Supports setting reactNamespace.errors.txt | 4 +- ...ing reactNamespace.oldTranspile.errors.txt | 4 +- ...Supports setting removeComments.errors.txt | 4 +- ...ing removeComments.oldTranspile.errors.txt | 4 +- .../Supports setting rootDir.errors.txt | 4 +- ...ts setting rootDir.oldTranspile.errors.txt | 4 +- .../Supports setting rootDirs.errors.txt | 4 +- ...s setting rootDirs.oldTranspile.errors.txt | 4 +- ...rts setting skipDefaultLibCheck.errors.txt | 4 +- ...kipDefaultLibCheck.oldTranspile.errors.txt | 4 +- .../Supports setting skipLibCheck.errors.txt | 4 +- ...tting skipLibCheck.oldTranspile.errors.txt | 4 +- ...pports setting strictNullChecks.errors.txt | 4 +- ...g strictNullChecks.oldTranspile.errors.txt | 4 +- .../Supports setting stripInternal.errors.txt | 4 +- ...ting stripInternal.oldTranspile.errors.txt | 4 +- ...ng suppressExcessPropertyErrors.errors.txt | 8 +- ...cessPropertyErrors.oldTranspile.errors.txt | 8 +- ... suppressImplicitAnyIndexErrors.errors.txt | 8 +- ...icitAnyIndexErrors.oldTranspile.errors.txt | 8 +- .../Supports setting tsbuildinfo.errors.txt | 4 +- ...etting tsbuildinfo.oldTranspile.errors.txt | 4 +- .../Supports setting typeRoots.errors.txt | 4 +- ... setting typeRoots.oldTranspile.errors.txt | 4 +- .../Supports setting types.errors.txt | 4 +- ...orts setting types.oldTranspile.errors.txt | 4 +- .../Supports urls in file name.errors.txt | 4 +- ... urls in file name.oldTranspile.errors.txt | 4 +- .../Uses correct newLine character.errors.txt | 4 +- ... newLine character.oldTranspile.errors.txt | 4 +- .../transpile/transpile .js files.errors.txt | 4 +- ...ranspile .js files.oldTranspile.errors.txt | 4 +- ...file as tsx if jsx is specified.errors.txt | 4 +- ...f jsx is specified.oldTranspile.errors.txt | 4 +- .../prepend-reports-deprecation-error.js | 4 +- .../can-detect-when-and-what-to-rebuild.js | 2 +- ...uilds-when-extended-config-file-changes.js | 2 +- .../config-has-out.js | 9 +- ...tes-diagnostics-and-emit-for-decorators.js | 6 +- ...mit-when-importsNotUsedAsValues-changes.js | 4 +- .../getSupportedCodeFixes-can-be-proxied.js | 2 + ...romPropertyAssignmentOutOfOrder.errors.txt | 4 +- .../typeReferenceDirectives11.errors.txt | 6 +- .../typeReferenceDirectives12.errors.txt | 6 +- .../reference/typeSatisfaction_js.errors.txt | 6 +- .../uniqueSymbolsDeclarationsInJs.errors.txt | 6 +- ...ueSymbolsDeclarationsInJsErrors.errors.txt | 6 +- .../verbatimModuleSyntaxCompat.errors.txt | 8 +- .../verbatimModuleSyntaxCompat2.errors.txt | 8 +- .../verbatimModuleSyntaxCompat3.errors.txt | 8 +- .../verbatimModuleSyntaxCompat4.errors.txt | 8 +- .../compiler/deprecatedCompilerOptions6.ts | 19 ++ 508 files changed, 1817 insertions(+), 1173 deletions(-) create mode 100644 tests/baselines/reference/deprecatedCompilerOptions4.errors.txt create mode 100644 tests/baselines/reference/deprecatedCompilerOptions6.errors.txt create mode 100644 tests/baselines/reference/deprecatedCompilerOptions6.js create mode 100644 tests/baselines/reference/deprecatedCompilerOptions6.symbols create mode 100644 tests/baselines/reference/deprecatedCompilerOptions6.types create mode 100644 tests/cases/compiler/deprecatedCompilerOptions6.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 02620ab7620b1..46c732695ff8c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4281,11 +4281,11 @@ "category": "Error", "code": 5098 }, - "Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '\"ignoreDeprecations\": \"{2}\"' to silence this error.": { + "Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '\"ignoreDeprecations\": \"{2}\"' to silence this error.": { "category": "Error", "code": 5101 }, - "Flag '{0}' is deprecated. Please remove it from your configuration.": { + "Option '{0}' has been removed. Please remove it from your configuration.": { "category": "Error", "code": 5102 }, @@ -4305,6 +4305,14 @@ "category": "Message", "code": 5106 }, + "Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '\"ignoreDeprecations\": \"{3}\"' to silence this error.": { + "category": "Error", + "code": 5107 + }, + "Option '{0}={1}' has been removed. Please remove it from your configuration.": { + "category": "Error", + "code": 5108 + }, "Generates a sourcemap for each corresponding '.d.ts' file.": { "category": "Message", diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 60a8a9c0b6bf6..a3d49f9b600f1 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -56,7 +56,6 @@ import { CustomTransformers, Debug, DeclarationWithTypeParameterChildren, - DeprecationVersion, Diagnostic, DiagnosticCategory, diagnosticCategoryName, @@ -318,6 +317,7 @@ import { UnparsedSource, VariableDeclaration, VariableStatement, + Version, versionMajorMinor, walkUpParenthesizedExpressions, WriteFileCallback, @@ -1445,6 +1445,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion } = createProgramOptions; let { oldProgram } = createProgramOptions; + const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations)); + let processingDefaultLibFiles: SourceFile[] | undefined; let processingOtherFiles: SourceFile[] | undefined; let files: SourceFile[]; @@ -4320,97 +4322,112 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } } - function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations: boolean) { - const version = typeScriptVersion || versionMajorMinor; + function getIgnoreDeprecationsVersion(): Version { const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { - if (ignoreDeprecations === DeprecationVersion.v5_0 && (version === DeprecationVersion.v5_0 || version === DeprecationVersion.v5_5)) { - return; - } - else if (reportInvalidIgnoreDeprecations) { - createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); + // While we could do Version.tryParse here to support any version, + // for now, only allow "5.0". We aren't planning on deprecating anything + // until 6.0. + if (ignoreDeprecations === "5.0") { + return new Version(ignoreDeprecations); } + reportInvalidIgnoreDeprecations(); } - return version; + return Version.zero; } - function verifyDeprecatedCompilerOptions() { - const version = getVersionForDeprecationDiagnostics(/*reportInvalidIgnoreDeprecations*/ true); - if (!version) return; - if (options.target === ScriptTarget.ES3) { - createDeprecatedDiagnosticForOption(version, "target", "ES3"); - } - if (options.noImplicitUseStrict) { - createDeprecatedDiagnosticForOption(version, "noImplicitUseStrict"); - } - if (options.keyofStringsOnly) { - createDeprecatedDiagnosticForOption(version, "keyofStringsOnly"); - } - if (options.suppressExcessPropertyErrors) { - createDeprecatedDiagnosticForOption(version, "suppressExcessPropertyErrors"); - } - if (options.suppressImplicitAnyIndexErrors) { - createDeprecatedDiagnosticForOption(version, "suppressImplicitAnyIndexErrors"); - } - if (options.noStrictGenericChecks) { - createDeprecatedDiagnosticForOption(version, "noStrictGenericChecks"); - } - if (options.charset) { - createDeprecatedDiagnosticForOption(version, "charset"); - } - if (options.out) { - createDeprecatedDiagnosticForOption(version, "out"); - } - if (options.importsNotUsedAsValues) { - createDeprecatedDiagnosticForOption(version, "importsNotUsedAsValues", /*value*/ undefined, "verbatimModuleSyntax"); - } - if (options.preserveValueImports) { - createDeprecatedDiagnosticForOption(version, "preserveValueImports", /*value*/ undefined, "verbatimModuleSyntax"); + function checkDeprecations( + deprecatedIn: string, + removedIn: string, + createDiagnostic: (name: string, value: string | undefined, useInstead: string | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number) => void, + fn: (createDeprecatedDiagnostic: (name: string, value?: string, useInstead?: string) => void) => void, + ) { + const deprecatedInVersion = new Version(deprecatedIn); + const removedInVersion = new Version(removedIn); + const typescriptVersion = new Version(typeScriptVersion || versionMajorMinor); + const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion(); + + const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === Comparison.GreaterThan); + const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === Comparison.LessThan; + + if (mustBeRemoved || canBeSilenced) { + fn((name, value, useInstead) => { + if (mustBeRemoved) { + if (value === undefined) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name); + } + else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value); + } + } + else { + if (value === undefined) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn); + } + else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn); + } + } + }); } } - function verifyDeprecatedProjectReference(ref: ProjectReference, parentFile: JsonSourceFile | undefined, index: number) { - if (ref.prepend) { - const version = getVersionForDeprecationDiagnostics(/*reportInvalidIgnoreDeprecations*/ false); - if (version) { - createDeprecatedOptionForVersionDiagnostic( - version, - (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), - "prepend", - ); + function verifyDeprecatedCompilerOptions() { + function createDiagnostic(name: string, value: string | undefined, useInstead: string | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number) { + if (useInstead) { + const details = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Use_0_instead, useInstead); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2, arg3); + createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined, chain); + } + else { + createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined, message, arg0, arg1, arg2, arg3); } } - } - function createDeprecatedDiagnosticForOption(version: string, name: string, value?: string, useInstead?: string) { - return createDeprecatedOptionForVersionDiagnostic( - version, - (message, arg0, arg1, arg2) => { - if (useInstead) { - const details = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Use_0_instead, useInstead); - const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); - createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined, chain); - } - else { - createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined, message, arg0, arg1, arg2); - } - }, - name, - value, - ); + checkDeprecations("5.0", "5.5", createDiagnostic, createDeprecatedDiagnostic => { + if (options.target === ScriptTarget.ES3) { + createDeprecatedDiagnostic("target", "ES3"); + } + if (options.noImplicitUseStrict) { + createDeprecatedDiagnostic("noImplicitUseStrict"); + } + if (options.keyofStringsOnly) { + createDeprecatedDiagnostic("keyofStringsOnly"); + } + if (options.suppressExcessPropertyErrors) { + createDeprecatedDiagnostic("suppressExcessPropertyErrors"); + } + if (options.suppressImplicitAnyIndexErrors) { + createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors"); + } + if (options.noStrictGenericChecks) { + createDeprecatedDiagnostic("noStrictGenericChecks"); + } + if (options.charset) { + createDeprecatedDiagnostic("charset"); + } + if (options.out) { + createDeprecatedDiagnostic("out", /*value*/ undefined, "outFile"); + } + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnostic("importsNotUsedAsValues", /*value*/ undefined, "verbatimModuleSyntax"); + } + if (options.preserveValueImports) { + createDeprecatedDiagnostic("preserveValueImports", /*value*/ undefined, "verbatimModuleSyntax"); + } + }); } - function createDeprecatedOptionForVersionDiagnostic( - version: string, - createDiagnostic: (message: DiagnosticMessage, arg0: string, arg1?: string, arg2?: string) => void, - name: string, - value?: string) { - if (version === DeprecationVersion.v6_0) { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); - } - else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, DeprecationVersion.v5_5, DeprecationVersion.v5_0); + function verifyDeprecatedProjectReference(ref: ProjectReference, parentFile: JsonSourceFile | undefined, index: number) { + function createDiagnostic(_name: string, _value: string | undefined, _useInstead: string | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number) { + createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2, arg3); } + + checkDeprecations("5.0", "5.5", createDiagnostic, createDeprecatedDiagnostic => { + if (ref.prepend) { + createDeprecatedDiagnostic("prepend"); + } + }); } function createDiagnosticExplainingFile(file: SourceFile | undefined, fileProcessingReason: FileIncludeReason | undefined, diagnostic: DiagnosticMessage, args: (string | number | undefined)[] | undefined): Diagnostic { @@ -4648,23 +4665,23 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0, arg1); } - function createDiagnosticForReference(sourceFile: JsonSourceFile | undefined, index: number, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number) { + function createDiagnosticForReference(sourceFile: JsonSourceFile | undefined, index: number, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number) { const referencesSyntax = firstDefined(getTsConfigPropArray(sourceFile || options.configFile, "references"), property => isArrayLiteralExpression(property.initializer) ? property.initializer : undefined); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile!, referencesSyntax.elements[index], message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile!, referencesSyntax.elements[index], message, arg0, arg1, arg2, arg3)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } function createDiagnosticForOption(onKey: boolean, option1: string, option2: string | undefined, message: DiagnosticMessageChain): void; - function createDiagnosticForOption(onKey: boolean, option1: string, option2: string | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number): void; - function createDiagnosticForOption(onKey: boolean, option1: string, option2: string | undefined, message: DiagnosticMessage | DiagnosticMessageChain, arg0?: string | number, arg1?: string | number, arg2?: string | number): void { + function createDiagnosticForOption(onKey: boolean, option1: string, option2: string | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void; + function createDiagnosticForOption(onKey: boolean, option1: string, option2: string | undefined, message: DiagnosticMessage | DiagnosticMessageChain, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || - !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); + !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2, arg3); if (needCompilerDiagnostic) { // eslint-disable-next-line local/no-in-operator @@ -4672,7 +4689,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } } @@ -4694,9 +4711,9 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral: ObjectLiteralExpression, onKey: boolean, key1: string, key2: string | undefined, messageChain: DiagnosticMessageChain): boolean; - function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral: ObjectLiteralExpression, onKey: boolean, key1: string, key2: string | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number): boolean; - function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral: ObjectLiteralExpression, onKey: boolean, key1: string, key2: string | undefined, message: DiagnosticMessage | DiagnosticMessageChain, arg0?: string | number, arg1?: string | number, arg2?: string | number): boolean; - function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral: ObjectLiteralExpression, onKey: boolean, key1: string, key2: string | undefined, message: DiagnosticMessage | DiagnosticMessageChain, arg0?: string | number, arg1?: string | number, arg2?: string | number): boolean { + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral: ObjectLiteralExpression, onKey: boolean, key1: string, key2: string | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): boolean; + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral: ObjectLiteralExpression, onKey: boolean, key1: string, key2: string | undefined, message: DiagnosticMessage | DiagnosticMessageChain, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): boolean; + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral: ObjectLiteralExpression, onKey: boolean, key1: string, key2: string | undefined, message: DiagnosticMessage | DiagnosticMessageChain, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): boolean { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { // eslint-disable-next-line local/no-in-operator @@ -4704,7 +4721,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile!, onKey ? prop.name : prop.initializer, message)); } else { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile!, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile!, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2, arg3)); } } return !!props.length; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index df0ba774ae5b3..4b4e79616c3cc 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -9874,12 +9874,3 @@ export interface Queue { dequeue(): T; isEmpty(): boolean; } - -/** @internal */ -export const enum DeprecationVersion { - /* eslint-disable @typescript-eslint/naming-convention */ - v5_0 = "5.0", - v5_5 = "5.5", - v6_0 = "6.0", - /* eslint-enable @typescript-eslint/naming-convention */ -} diff --git a/tests/baselines/reference/ES3For-ofTypeCheck1.errors.txt b/tests/baselines/reference/ES3For-ofTypeCheck1.errors.txt index 4e17fb8093d0b..520392a911da5 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck1.errors.txt +++ b/tests/baselines/reference/ES3For-ofTypeCheck1.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck1.ts(1,15): error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck1.ts (1 errors) ==== for (var v of "") { } ~~ diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2.errors.txt b/tests/baselines/reference/ES3For-ofTypeCheck2.errors.txt index 7520be7645117..a97ae3abfb267 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck2.errors.txt +++ b/tests/baselines/reference/ES3For-ofTypeCheck2.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck2.ts (0 errors) ==== for (var v of [true]) { } \ No newline at end of file diff --git a/tests/baselines/reference/ES3For-ofTypeCheck4.errors.txt b/tests/baselines/reference/ES3For-ofTypeCheck4.errors.txt index fa2927aa454be..388e7db13c87b 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck4.errors.txt +++ b/tests/baselines/reference/ES3For-ofTypeCheck4.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts(2,17): error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts (1 errors) ==== var union: string | string[]; for (const v of union) { } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck6.errors.txt b/tests/baselines/reference/ES3For-ofTypeCheck6.errors.txt index a3c1eac9be535..148ef044ff129 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck6.errors.txt +++ b/tests/baselines/reference/ES3For-ofTypeCheck6.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck6.ts (0 errors) ==== var union: string[] | number[]; for (var v of union) { } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithES3.errors.txt b/tests/baselines/reference/accessorWithES3.errors.txt index 0418b7b8df110..0d0a482c20983 100644 --- a/tests/baselines/reference/accessorWithES3.errors.txt +++ b/tests/baselines/reference/accessorWithES3.errors.txt @@ -1,11 +1,11 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts (4 errors) ==== // error to use accessors in ES3 mode diff --git a/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt b/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt index 4e28bc616bd78..e482b16103e8a 100644 --- a/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt +++ b/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt @@ -1,9 +1,9 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/compiler/accessorsNotAllowedInES3.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessorsNotAllowedInES3.ts(4,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/accessorsNotAllowedInES3.ts (2 errors) ==== class C { get x(): number { return 1; } diff --git a/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt b/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt index d28c5fa62f5f5..75df661fc9715 100644 --- a/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt +++ b/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt @@ -1,10 +1,10 @@ error TS5053: Option 'noImplicitUseStrict' cannot be specified with option 'alwaysStrict'. -error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/compiler/alwaysStrictNoImplicitUseStrict.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode. !!! error TS5053: Option 'noImplicitUseStrict' cannot be specified with option 'alwaysStrict'. -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/alwaysStrictNoImplicitUseStrict.ts (1 errors) ==== module M { export function f() { diff --git a/tests/baselines/reference/ambientAccessors(target=es3).errors.txt b/tests/baselines/reference/ambientAccessors(target=es3).errors.txt index 8be0f71e5438e..8e365237fd925 100644 --- a/tests/baselines/reference/ambientAccessors(target=es3).errors.txt +++ b/tests/baselines/reference/ambientAccessors(target=es3).errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/ambientAccessors.ts (0 errors) ==== // ok to use accessors in ambient class in ES3 declare class C { diff --git a/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.errors.txt b/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.errors.txt index a99f63a88ba78..e79d8d4d56ef6 100644 --- a/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.errors.txt +++ b/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/Class.ts (0 errors) ==== import { Configurable } from "./Configurable" diff --git a/tests/baselines/reference/bigIntWithTargetES3.errors.txt b/tests/baselines/reference/bigIntWithTargetES3.errors.txt index b8ab2617649d9..0c2b1793eb9ba 100644 --- a/tests/baselines/reference/bigIntWithTargetES3.errors.txt +++ b/tests/baselines/reference/bigIntWithTargetES3.errors.txt @@ -1,11 +1,11 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/compiler/bigIntWithTargetES3.ts(5,22): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigIntWithTargetES3.ts(5,29): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigIntWithTargetES3.ts(5,39): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigIntWithTargetES3.ts(5,48): error TS2737: BigInt literals are not available when targeting lower than ES2020. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/bigIntWithTargetES3.ts (4 errors) ==== const normalNumber = 123; // should not error let bigintType: bigint; // should not error diff --git a/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt b/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt index 015a6ec607084..c62df130f972a 100644 --- a/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt +++ b/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt @@ -1,10 +1,12 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/weird.js(1,1): error TS2552: Cannot find name 'someFunction'. Did you mean 'Function'? tests/cases/compiler/weird.js(1,23): error TS7006: Parameter 'BaseClass' implicitly has an 'any' type. tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly has an 'any' type. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/weird.js (3 errors) ==== someFunction(function(BaseClass) { ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/checkJsdocReturnTag1.errors.txt b/tests/baselines/reference/checkJsdocReturnTag1.errors.txt index 2e0c41faeec44..69a8247b72191 100644 --- a/tests/baselines/reference/checkJsdocReturnTag1.errors.txt +++ b/tests/baselines/reference/checkJsdocReturnTag1.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/jsdoc/returns.js (0 errors) ==== // @ts-check /** diff --git a/tests/baselines/reference/checkJsdocReturnTag2.errors.txt b/tests/baselines/reference/checkJsdocReturnTag2.errors.txt index f373377254f0d..5785a0d357c87 100644 --- a/tests/baselines/reference/checkJsdocReturnTag2.errors.txt +++ b/tests/baselines/reference/checkJsdocReturnTag2.errors.txt @@ -1,10 +1,12 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/conformance/jsdoc/returns.js(6,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsdoc/returns.js(13,5): error TS2322: Type 'number | boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'string | number'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/jsdoc/returns.js (2 errors) ==== // @ts-check /** diff --git a/tests/baselines/reference/compilerOptionsOutAndNoEmit.errors.txt b/tests/baselines/reference/compilerOptionsOutAndNoEmit.errors.txt index 0662a6a18f0d6..d273318f4b432 100644 --- a/tests/baselines/reference/compilerOptionsOutAndNoEmit.errors.txt +++ b/tests/baselines/reference/compilerOptionsOutAndNoEmit.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/computedPropertyNames52(target=es2015).errors.txt b/tests/baselines/reference/computedPropertyNames52(target=es2015).errors.txt index f703c20b1fa6d..a20182981d231 100644 --- a/tests/baselines/reference/computedPropertyNames52(target=es2015).errors.txt +++ b/tests/baselines/reference/computedPropertyNames52(target=es2015).errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames52.js (0 errors) ==== const array = []; for (let i = 0; i < 10; ++i) { diff --git a/tests/baselines/reference/computedPropertyNames52(target=es5).errors.txt b/tests/baselines/reference/computedPropertyNames52(target=es5).errors.txt index f703c20b1fa6d..a20182981d231 100644 --- a/tests/baselines/reference/computedPropertyNames52(target=es5).errors.txt +++ b/tests/baselines/reference/computedPropertyNames52(target=es5).errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames52.js (0 errors) ==== const array = []; for (let i = 0; i < 10; ++i) { diff --git a/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt b/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt index a8fd10ae8e4e7..4573941d5539e 100644 --- a/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt +++ b/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/file1.ts(1,1): error TS2448: Block-scoped variable 'c' used before its declaration. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/file1.ts (1 errors) ==== c; ~ diff --git a/tests/baselines/reference/controlFlowJavascript.errors.txt b/tests/baselines/reference/controlFlowJavascript.errors.txt index a74d5af03dff1..e228bb80ef72d 100644 --- a/tests/baselines/reference/controlFlowJavascript.errors.txt +++ b/tests/baselines/reference/controlFlowJavascript.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/controlFlowJavascript.js (0 errors) ==== let cond = true; diff --git a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt index e1d206ff23cf2..f15b76b5d85ec 100644 --- a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt +++ b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt @@ -1,11 +1,13 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/declFile.d.ts(2,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/declFile.d.ts(3,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/declFile.d.ts(5,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/declFile.d.ts(7,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/client.ts (0 errors) ==== /// var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt index 2030449d8d798..e065bfe5aa12c 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt @@ -1,11 +1,13 @@ error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. !!! error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. !!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/out.d.ts (0 errors) ==== declare class c { } diff --git a/tests/baselines/reference/definePropertyOutputES3.errors.txt b/tests/baselines/reference/definePropertyOutputES3.errors.txt index 34787d62f17c7..61ee69bfcc616 100644 --- a/tests/baselines/reference/definePropertyOutputES3.errors.txt +++ b/tests/baselines/reference/definePropertyOutputES3.errors.txt @@ -1,9 +1,9 @@ error TS5048: Option 'useDefineForClassFields' cannot be specified when option 'target' is 'ES3'. -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5048: Option 'useDefineForClassFields' cannot be specified when option 'target' is 'ES3'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/classes/propertyMemberDeclarations/definePropertyOutputES3.ts (0 errors) ==== class A { a = 12 diff --git a/tests/baselines/reference/deprecatedCompilerOptions1.errors.txt b/tests/baselines/reference/deprecatedCompilerOptions1.errors.txt index 48f93f935068a..effa688c713b0 100644 --- a/tests/baselines/reference/deprecatedCompilerOptions1.errors.txt +++ b/tests/baselines/reference/deprecatedCompilerOptions1.errors.txt @@ -1,11 +1,12 @@ -/foo/tsconfig.json(3,19): error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -/foo/tsconfig.json(4,9): error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -/foo/tsconfig.json(5,9): error TS5101: Flag 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -/foo/tsconfig.json(6,9): error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -/foo/tsconfig.json(7,9): error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -/foo/tsconfig.json(8,9): error TS5101: Flag 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -/foo/tsconfig.json(9,9): error TS5101: Flag 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -/foo/tsconfig.json(10,9): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(3,19): error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(4,9): error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(5,9): error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(6,9): error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(7,9): error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(8,9): error TS5101: Option 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(9,9): error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(10,9): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. ==== /foo/tsconfig.json (8 errors) ==== @@ -13,28 +14,29 @@ "compilerOptions": { "target": "ES3", ~~~~~ -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. "noImplicitUseStrict": true, ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. "keyofStringsOnly": true, ~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. "suppressExcessPropertyErrors": true, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. "suppressImplicitAnyIndexErrors": true, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. "noStrictGenericChecks": true, ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. "charset": "utf8", ~~~~~~~~~ -!!! error TS5101: Flag 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. "out": "dist.js" ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. } } diff --git a/tests/baselines/reference/deprecatedCompilerOptions3.errors.txt b/tests/baselines/reference/deprecatedCompilerOptions3.errors.txt index b745353cd68c6..c484184a8cba4 100644 --- a/tests/baselines/reference/deprecatedCompilerOptions3.errors.txt +++ b/tests/baselines/reference/deprecatedCompilerOptions3.errors.txt @@ -1,11 +1,12 @@ -/foo/tsconfig.json(3,19): error TS5102: Flag 'ES3' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(4,9): error TS5102: Flag 'noImplicitUseStrict' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(5,9): error TS5102: Flag 'keyofStringsOnly' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(6,9): error TS5102: Flag 'suppressExcessPropertyErrors' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(7,9): error TS5102: Flag 'suppressImplicitAnyIndexErrors' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(8,9): error TS5102: Flag 'noStrictGenericChecks' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(9,9): error TS5102: Flag 'charset' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(10,9): error TS5102: Flag 'out' is deprecated. Please remove it from your configuration. +/foo/tsconfig.json(3,19): error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(4,9): error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(5,9): error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(6,9): error TS5102: Option 'suppressExcessPropertyErrors' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(7,9): error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(8,9): error TS5102: Option 'noStrictGenericChecks' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(9,9): error TS5102: Option 'charset' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(10,9): error TS5102: Option 'out' has been removed. Please remove it from your configuration. + Use 'outFile' instead. ==== /foo/tsconfig.json (8 errors) ==== @@ -13,28 +14,29 @@ "compilerOptions": { "target": "ES3", ~~~~~ -!!! error TS5102: Flag 'ES3' is deprecated. Please remove it from your configuration. +!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration. "noImplicitUseStrict": true, ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'noImplicitUseStrict' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration. "keyofStringsOnly": true, ~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'keyofStringsOnly' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration. "suppressExcessPropertyErrors": true, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'suppressExcessPropertyErrors' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'suppressExcessPropertyErrors' has been removed. Please remove it from your configuration. "suppressImplicitAnyIndexErrors": true, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'suppressImplicitAnyIndexErrors' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration. "noStrictGenericChecks": true, ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'noStrictGenericChecks' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'noStrictGenericChecks' has been removed. Please remove it from your configuration. "charset": "utf8", ~~~~~~~~~ -!!! error TS5102: Flag 'charset' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'charset' has been removed. Please remove it from your configuration. "out": "dist.js", ~~~~~ -!!! error TS5102: Flag 'out' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'out' has been removed. Please remove it from your configuration. +!!! error TS5102: Use 'outFile' instead. } } diff --git a/tests/baselines/reference/deprecatedCompilerOptions4.errors.txt b/tests/baselines/reference/deprecatedCompilerOptions4.errors.txt new file mode 100644 index 0000000000000..01d4b95238ce6 --- /dev/null +++ b/tests/baselines/reference/deprecatedCompilerOptions4.errors.txt @@ -0,0 +1,46 @@ +/foo/tsconfig.json(3,19): error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(4,9): error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(5,9): error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(6,9): error TS5102: Option 'suppressExcessPropertyErrors' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(7,9): error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(8,9): error TS5102: Option 'noStrictGenericChecks' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(9,9): error TS5102: Option 'charset' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(10,9): error TS5102: Option 'out' has been removed. Please remove it from your configuration. + Use 'outFile' instead. + + +==== /foo/tsconfig.json (8 errors) ==== + { + "compilerOptions": { + "target": "ES3", + ~~~~~ +!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration. + "noImplicitUseStrict": true, + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration. + "keyofStringsOnly": true, + ~~~~~~~~~~~~~~~~~~ +!!! error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration. + "suppressExcessPropertyErrors": true, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5102: Option 'suppressExcessPropertyErrors' has been removed. Please remove it from your configuration. + "suppressImplicitAnyIndexErrors": true, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration. + "noStrictGenericChecks": true, + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5102: Option 'noStrictGenericChecks' has been removed. Please remove it from your configuration. + "charset": "utf8", + ~~~~~~~~~ +!!! error TS5102: Option 'charset' has been removed. Please remove it from your configuration. + "out": "dist.js", + ~~~~~ +!!! error TS5102: Option 'out' has been removed. Please remove it from your configuration. +!!! error TS5102: Use 'outFile' instead. + "ignoreDeprecations": "5.0" + } + } + +==== /foo/a.ts (0 errors) ==== + const a = 1; + \ No newline at end of file diff --git a/tests/baselines/reference/deprecatedCompilerOptions5.errors.txt b/tests/baselines/reference/deprecatedCompilerOptions5.errors.txt index a214229ef01e7..01d4b95238ce6 100644 --- a/tests/baselines/reference/deprecatedCompilerOptions5.errors.txt +++ b/tests/baselines/reference/deprecatedCompilerOptions5.errors.txt @@ -1,44 +1,43 @@ -/foo/tsconfig.json(3,19): error TS5102: Flag 'ES3' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(4,9): error TS5102: Flag 'noImplicitUseStrict' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(5,9): error TS5102: Flag 'keyofStringsOnly' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(6,9): error TS5102: Flag 'suppressExcessPropertyErrors' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(7,9): error TS5102: Flag 'suppressImplicitAnyIndexErrors' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(8,9): error TS5102: Flag 'noStrictGenericChecks' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(9,9): error TS5102: Flag 'charset' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(10,9): error TS5102: Flag 'out' is deprecated. Please remove it from your configuration. -/foo/tsconfig.json(11,31): error TS5103: Invalid value for '--ignoreDeprecations'. +/foo/tsconfig.json(3,19): error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(4,9): error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(5,9): error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(6,9): error TS5102: Option 'suppressExcessPropertyErrors' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(7,9): error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(8,9): error TS5102: Option 'noStrictGenericChecks' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(9,9): error TS5102: Option 'charset' has been removed. Please remove it from your configuration. +/foo/tsconfig.json(10,9): error TS5102: Option 'out' has been removed. Please remove it from your configuration. + Use 'outFile' instead. -==== /foo/tsconfig.json (9 errors) ==== +==== /foo/tsconfig.json (8 errors) ==== { "compilerOptions": { "target": "ES3", ~~~~~ -!!! error TS5102: Flag 'ES3' is deprecated. Please remove it from your configuration. +!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration. "noImplicitUseStrict": true, ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'noImplicitUseStrict' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration. "keyofStringsOnly": true, ~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'keyofStringsOnly' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration. "suppressExcessPropertyErrors": true, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'suppressExcessPropertyErrors' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'suppressExcessPropertyErrors' has been removed. Please remove it from your configuration. "suppressImplicitAnyIndexErrors": true, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'suppressImplicitAnyIndexErrors' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration. "noStrictGenericChecks": true, ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5102: Flag 'noStrictGenericChecks' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'noStrictGenericChecks' has been removed. Please remove it from your configuration. "charset": "utf8", ~~~~~~~~~ -!!! error TS5102: Flag 'charset' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'charset' has been removed. Please remove it from your configuration. "out": "dist.js", ~~~~~ -!!! error TS5102: Flag 'out' is deprecated. Please remove it from your configuration. +!!! error TS5102: Option 'out' has been removed. Please remove it from your configuration. +!!! error TS5102: Use 'outFile' instead. "ignoreDeprecations": "5.0" - ~~~~~ -!!! error TS5103: Invalid value for '--ignoreDeprecations'. } } diff --git a/tests/baselines/reference/deprecatedCompilerOptions6.errors.txt b/tests/baselines/reference/deprecatedCompilerOptions6.errors.txt new file mode 100644 index 0000000000000..1d97da4493ad2 --- /dev/null +++ b/tests/baselines/reference/deprecatedCompilerOptions6.errors.txt @@ -0,0 +1,50 @@ +/foo/tsconfig.json(4,19): error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(5,9): error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(6,9): error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(7,9): error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(8,9): error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(9,9): error TS5101: Option 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(10,9): error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/foo/tsconfig.json(11,9): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. +/foo/tsconfig.json(12,31): error TS5103: Invalid value for '--ignoreDeprecations'. + + +==== /foo/tsconfig.json (9 errors) ==== + { + "compilerOptions": { + "module": "amd", + "target": "ES3", + ~~~~~ +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + "noImplicitUseStrict": true, + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + "keyofStringsOnly": true, + ~~~~~~~~~~~~~~~~~~ +!!! error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + "suppressExcessPropertyErrors": true, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + "suppressImplicitAnyIndexErrors": true, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + "noStrictGenericChecks": true, + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5101: Option 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + "charset": "utf8", + ~~~~~~~~~ +!!! error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + "out": "dist.js", + ~~~~~ +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. + "ignoreDeprecations": "5.1" + ~~~~~ +!!! error TS5103: Invalid value for '--ignoreDeprecations'. + } + } + +==== /foo/a.ts (0 errors) ==== + const a = 1; + \ No newline at end of file diff --git a/tests/baselines/reference/deprecatedCompilerOptions6.js b/tests/baselines/reference/deprecatedCompilerOptions6.js new file mode 100644 index 0000000000000..a4778b0abf319 --- /dev/null +++ b/tests/baselines/reference/deprecatedCompilerOptions6.js @@ -0,0 +1,6 @@ +//// [a.ts] +const a = 1; + + +//// [dist.js] +var a = 1; diff --git a/tests/baselines/reference/deprecatedCompilerOptions6.symbols b/tests/baselines/reference/deprecatedCompilerOptions6.symbols new file mode 100644 index 0000000000000..d0f69434bc68f --- /dev/null +++ b/tests/baselines/reference/deprecatedCompilerOptions6.symbols @@ -0,0 +1,4 @@ +=== /foo/a.ts === +const a = 1; +>a : Symbol(a, Decl(a.ts, 0, 5)) + diff --git a/tests/baselines/reference/deprecatedCompilerOptions6.types b/tests/baselines/reference/deprecatedCompilerOptions6.types new file mode 100644 index 0000000000000..ce7bf5f351b1a --- /dev/null +++ b/tests/baselines/reference/deprecatedCompilerOptions6.types @@ -0,0 +1,5 @@ +=== /foo/a.ts === +const a = 1; +>a : 1 +>1 : 1 + diff --git a/tests/baselines/reference/dynamicRequire.errors.txt b/tests/baselines/reference/dynamicRequire.errors.txt index 3461945c79112..eadb566a1a700 100644 --- a/tests/baselines/reference/dynamicRequire.errors.txt +++ b/tests/baselines/reference/dynamicRequire.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.js (0 errors) ==== function foo(name) { var s = require("t/" + name) diff --git a/tests/baselines/reference/emptyFile-declaration.errors.txt b/tests/baselines/reference/emptyFile-declaration.errors.txt index 9d98970e9f772..eb83a609a586d 100644 --- a/tests/baselines/reference/emptyFile-declaration.errors.txt +++ b/tests/baselines/reference/emptyFile-declaration.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/emptyFile-declaration.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile-souremap.errors.txt b/tests/baselines/reference/emptyFile-souremap.errors.txt index 09c7f933c28c3..5105df5b501e5 100644 --- a/tests/baselines/reference/emptyFile-souremap.errors.txt +++ b/tests/baselines/reference/emptyFile-souremap.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/emptyFile-souremap.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/es3-amd.errors.txt b/tests/baselines/reference/es3-amd.errors.txt index ca031e9ef9de8..64971aff3775f 100644 --- a/tests/baselines/reference/es3-amd.errors.txt +++ b/tests/baselines/reference/es3-amd.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3-amd.ts (0 errors) ==== class A { diff --git a/tests/baselines/reference/es3-declaration-amd.errors.txt b/tests/baselines/reference/es3-declaration-amd.errors.txt index d8cd0698e2d29..368157acf6e09 100644 --- a/tests/baselines/reference/es3-declaration-amd.errors.txt +++ b/tests/baselines/reference/es3-declaration-amd.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3-declaration-amd.ts (0 errors) ==== class A { diff --git a/tests/baselines/reference/es3-jsx-preserve.errors.txt b/tests/baselines/reference/es3-jsx-preserve.errors.txt index 5510b37cdb6ca..4d7a35cb95fe8 100644 --- a/tests/baselines/reference/es3-jsx-preserve.errors.txt +++ b/tests/baselines/reference/es3-jsx-preserve.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3-jsx-preserve.tsx (0 errors) ==== const React: any = null; diff --git a/tests/baselines/reference/es3-jsx-react-native.errors.txt b/tests/baselines/reference/es3-jsx-react-native.errors.txt index af2d8e3d69609..b74b87442a61f 100644 --- a/tests/baselines/reference/es3-jsx-react-native.errors.txt +++ b/tests/baselines/reference/es3-jsx-react-native.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3-jsx-react-native.tsx (0 errors) ==== const React: any = null; diff --git a/tests/baselines/reference/es3-jsx-react.errors.txt b/tests/baselines/reference/es3-jsx-react.errors.txt index d779b268e0168..da2d76b87374a 100644 --- a/tests/baselines/reference/es3-jsx-react.errors.txt +++ b/tests/baselines/reference/es3-jsx-react.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3-jsx-react.tsx (0 errors) ==== const React: any = null; diff --git a/tests/baselines/reference/es3-oldStyleOctalLiteralInEnums.errors.txt b/tests/baselines/reference/es3-oldStyleOctalLiteralInEnums.errors.txt index 7cc9d08cb5b35..6bb7d5bf90a09 100644 --- a/tests/baselines/reference/es3-oldStyleOctalLiteralInEnums.errors.txt +++ b/tests/baselines/reference/es3-oldStyleOctalLiteralInEnums.errors.txt @@ -1,9 +1,9 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(2,7): error TS8018: Octal literals are not allowed in enums members initializer. Use the syntax '-0o1'. tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(3,7): error TS8018: Octal literals are not allowed in enums members initializer. Use the syntax '0o2'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts (2 errors) ==== enum E { x = -01, diff --git a/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.errors.txt b/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.errors.txt index 00b0c9ce2273a..796881d795e3b 100644 --- a/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.errors.txt +++ b/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.errors.txt @@ -1,9 +1,9 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts(1,8): error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '0o10'. tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts(2,8): error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '-0o20'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts (2 errors) ==== let x: 010; ~~~ diff --git a/tests/baselines/reference/es3-sourcemap-amd.errors.txt b/tests/baselines/reference/es3-sourcemap-amd.errors.txt index 2601c56c331ce..1f2dbfcba168f 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.errors.txt +++ b/tests/baselines/reference/es3-sourcemap-amd.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3-sourcemap-amd.ts (0 errors) ==== class A { diff --git a/tests/baselines/reference/es3defaultAliasIsQuoted.errors.txt b/tests/baselines/reference/es3defaultAliasIsQuoted.errors.txt index edbf56d0b8ddd..6dce55bc42654 100644 --- a/tests/baselines/reference/es3defaultAliasIsQuoted.errors.txt +++ b/tests/baselines/reference/es3defaultAliasIsQuoted.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/es3defaultAliasQuoted_file0.ts (0 errors) ==== export class Foo { static CONSTANT = "Foo"; diff --git a/tests/baselines/reference/esModuleInteropWithExportStar(target=es3).errors.txt b/tests/baselines/reference/esModuleInteropWithExportStar(target=es3).errors.txt index 07c186e687a66..f1e3f6a3ce614 100644 --- a/tests/baselines/reference/esModuleInteropWithExportStar(target=es3).errors.txt +++ b/tests/baselines/reference/esModuleInteropWithExportStar(target=es3).errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/fs.d.ts (0 errors) ==== export const x: number; ==== tests/cases/compiler/mjts.ts (0 errors) ==== diff --git a/tests/baselines/reference/excessPropertyErrorsSuppressed.errors.txt b/tests/baselines/reference/excessPropertyErrorsSuppressed.errors.txt index bde06f085e48c..856b68fdf54ab 100644 --- a/tests/baselines/reference/excessPropertyErrorsSuppressed.errors.txt +++ b/tests/baselines/reference/excessPropertyErrorsSuppressed.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/excessPropertyErrorsSuppressed.ts (0 errors) ==== var x: { a: string } = { a: "hello", b: 42 }; // No error \ No newline at end of file diff --git a/tests/baselines/reference/exportAndImport-es3-amd.errors.txt b/tests/baselines/reference/exportAndImport-es3-amd.errors.txt index 1fd8ac8007e17..d9b0a538dc0bd 100644 --- a/tests/baselines/reference/exportAndImport-es3-amd.errors.txt +++ b/tests/baselines/reference/exportAndImport-es3-amd.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ==== export default function f1() { } diff --git a/tests/baselines/reference/exportAndImport-es3.errors.txt b/tests/baselines/reference/exportAndImport-es3.errors.txt index d6afb2baf6585..c68799d9c0dc6 100644 --- a/tests/baselines/reference/exportAndImport-es3.errors.txt +++ b/tests/baselines/reference/exportAndImport-es3.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ==== export default function f1() { } diff --git a/tests/baselines/reference/exportDefaultInJsFile01.errors.txt b/tests/baselines/reference/exportDefaultInJsFile01.errors.txt index 89cb8f66b9b66..3908b927cfdda 100644 --- a/tests/baselines/reference/exportDefaultInJsFile01.errors.txt +++ b/tests/baselines/reference/exportDefaultInJsFile01.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file. Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file. !!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/salsa/myFile01.js (0 errors) ==== export default "hello"; \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores1.errors.txt b/tests/baselines/reference/exportsAndImportsWithUnderscores1.errors.txt index 8eadb640fe61e..9236ea28ce824 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores1.errors.txt +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores1.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/es6/modules/m1.ts(5,5): error TS1005: ',' expected. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/es6/modules/m1.ts (1 errors) ==== var R: any export default R = { diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores2.errors.txt b/tests/baselines/reference/exportsAndImportsWithUnderscores2.errors.txt index 57403dc2198fb..a4e781650c1e5 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores2.errors.txt +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores2.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ==== var R: any export default R = { diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores3.errors.txt b/tests/baselines/reference/exportsAndImportsWithUnderscores3.errors.txt index 68c1db5fc50f7..3a8b29a45896e 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores3.errors.txt +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores3.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ==== var R: any export default R = { diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores4.errors.txt b/tests/baselines/reference/exportsAndImportsWithUnderscores4.errors.txt index d73759ed55e03..63128d237acaa 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores4.errors.txt +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores4.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ==== declare var console: any; export function _() { diff --git a/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.errors.txt b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.errors.txt index 5a0d6657412ab..f5464085a76b7 100644 --- a/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.errors.txt +++ b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== export class c { } diff --git a/tests/baselines/reference/genericSetterInClassTypeJsDoc.errors.txt b/tests/baselines/reference/genericSetterInClassTypeJsDoc.errors.txt index 80216644c8d84..c840a88ad33ca 100644 --- a/tests/baselines/reference/genericSetterInClassTypeJsDoc.errors.txt +++ b/tests/baselines/reference/genericSetterInClassTypeJsDoc.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/classes/members/classTypes/genericSetterInClassTypeJsDoc.js (0 errors) ==== /** * @template T diff --git a/tests/baselines/reference/globalThisVarDeclaration.errors.txt b/tests/baselines/reference/globalThisVarDeclaration.errors.txt index c01f85ad6a454..6a5d72fced162 100644 --- a/tests/baselines/reference/globalThisVarDeclaration.errors.txt +++ b/tests/baselines/reference/globalThisVarDeclaration.errors.txt @@ -1,11 +1,13 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/conformance/es2019/actual.ts(12,5): error TS2339: Property 'a' does not exist on type 'Window'. tests/cases/conformance/es2019/actual.ts(13,5): error TS2339: Property 'b' does not exist on type 'Window'. tests/cases/conformance/es2019/b.js(12,5): error TS2339: Property 'a' does not exist on type 'Window'. tests/cases/conformance/es2019/b.js(13,5): error TS2339: Property 'b' does not exist on type 'Window'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/es2019/b.js (2 errors) ==== var a = 10; this.a; diff --git a/tests/baselines/reference/importCallExpressionAsyncES3AMD.errors.txt b/tests/baselines/reference/importCallExpressionAsyncES3AMD.errors.txt index c79fc28b48cfe..8d2dd823ae0dc 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3AMD.errors.txt +++ b/tests/baselines/reference/importCallExpressionAsyncES3AMD.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/dynamicImport/test.ts (0 errors) ==== export async function fn() { const req = await import('./test') // ONE diff --git a/tests/baselines/reference/importCallExpressionAsyncES3CJS.errors.txt b/tests/baselines/reference/importCallExpressionAsyncES3CJS.errors.txt index c79fc28b48cfe..8d2dd823ae0dc 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3CJS.errors.txt +++ b/tests/baselines/reference/importCallExpressionAsyncES3CJS.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/dynamicImport/test.ts (0 errors) ==== export async function fn() { const req = await import('./test') // ONE diff --git a/tests/baselines/reference/importCallExpressionAsyncES3System.errors.txt b/tests/baselines/reference/importCallExpressionAsyncES3System.errors.txt index c79fc28b48cfe..8d2dd823ae0dc 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3System.errors.txt +++ b/tests/baselines/reference/importCallExpressionAsyncES3System.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/dynamicImport/test.ts (0 errors) ==== export async function fn() { const req = await import('./test') // ONE diff --git a/tests/baselines/reference/importCallExpressionAsyncES3UMD.errors.txt b/tests/baselines/reference/importCallExpressionAsyncES3UMD.errors.txt index c79fc28b48cfe..8d2dd823ae0dc 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3UMD.errors.txt +++ b/tests/baselines/reference/importCallExpressionAsyncES3UMD.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/dynamicImport/test.ts (0 errors) ==== export async function fn() { const req = await import('./test') // ONE diff --git a/tests/baselines/reference/importsNotUsedAsValues_error.errors.txt b/tests/baselines/reference/importsNotUsedAsValues_error.errors.txt index 943af5f043dde..dd2eda5644c57 100644 --- a/tests/baselines/reference/importsNotUsedAsValues_error.errors.txt +++ b/tests/baselines/reference/importsNotUsedAsValues_error.errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. /b.ts(1,1): error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'. /c.ts(1,1): error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'. @@ -7,7 +7,7 @@ error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop function /i.ts(1,1): error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'. -!!! error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== /a.ts (0 errors) ==== export default class {} diff --git a/tests/baselines/reference/incrementalOut.errors.txt b/tests/baselines/reference/incrementalOut.errors.txt index 58069665e7e22..ac131062c1993 100644 --- a/tests/baselines/reference/incrementalOut.errors.txt +++ b/tests/baselines/reference/incrementalOut.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/incrementalOut.ts (0 errors) ==== const x = 10; diff --git a/tests/baselines/reference/inferringClassMembersFromAssignments.errors.txt b/tests/baselines/reference/inferringClassMembersFromAssignments.errors.txt index 16bece7b7b7ef..beb9e1eca33b3 100644 --- a/tests/baselines/reference/inferringClassMembersFromAssignments.errors.txt +++ b/tests/baselines/reference/inferringClassMembersFromAssignments.errors.txt @@ -1,10 +1,12 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/conformance/salsa/a.js(14,13): error TS7008: Member 'inMethodNullable' implicitly has an 'any' type. tests/cases/conformance/salsa/a.js(20,9): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/salsa/a.js(39,9): error TS2322: Type 'boolean' is not assignable to type 'number'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/salsa/a.js (3 errors) ==== class C { constructor() { diff --git a/tests/baselines/reference/inlineSourceMap.errors.txt b/tests/baselines/reference/inlineSourceMap.errors.txt index fd4506186cfef..edcf4b9d86cc8 100644 --- a/tests/baselines/reference/inlineSourceMap.errors.txt +++ b/tests/baselines/reference/inlineSourceMap.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/inlineSourceMap.ts (0 errors) ==== var x = 0; console.log(x); \ No newline at end of file diff --git a/tests/baselines/reference/inlineSourceMap2.errors.txt b/tests/baselines/reference/inlineSourceMap2.errors.txt index 41de14359bdf0..08316c78261e3 100644 --- a/tests/baselines/reference/inlineSourceMap2.errors.txt +++ b/tests/baselines/reference/inlineSourceMap2.errors.txt @@ -1,13 +1,15 @@ error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. !!! error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/inlineSourceMap2.ts (0 errors) ==== // configuration errors diff --git a/tests/baselines/reference/inlineSources.errors.txt b/tests/baselines/reference/inlineSources.errors.txt index 3e80237b69391..7e354d8a02bf7 100644 --- a/tests/baselines/reference/inlineSources.errors.txt +++ b/tests/baselines/reference/inlineSources.errors.txt @@ -1,9 +1,11 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/a.ts (0 errors) ==== var a = 0; console.log(a); diff --git a/tests/baselines/reference/inlineSources2.errors.txt b/tests/baselines/reference/inlineSources2.errors.txt index 3e80237b69391..7e354d8a02bf7 100644 --- a/tests/baselines/reference/inlineSources2.errors.txt +++ b/tests/baselines/reference/inlineSources2.errors.txt @@ -1,9 +1,11 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/a.ts (0 errors) ==== var a = 0; console.log(a); diff --git a/tests/baselines/reference/isLiteral2.errors.txt b/tests/baselines/reference/isLiteral2.errors.txt index da56a3d549afa..f1d6f83823ff5 100644 --- a/tests/baselines/reference/isLiteral2.errors.txt +++ b/tests/baselines/reference/isLiteral2.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/isLiteral2.ts (0 errors) ==== var x: number = 02343 \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesOut.errors.txt b/tests/baselines/reference/isolatedModulesOut.errors.txt index e87ef53482462..0d4d4cd3bd40d 100644 --- a/tests/baselines/reference/isolatedModulesOut.errors.txt +++ b/tests/baselines/reference/isolatedModulesOut.errors.txt @@ -1,10 +1,12 @@ error TS5053: Option 'out' cannot be specified with option 'isolatedModules'. -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/file1.ts(1,1): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. !!! error TS5053: Option 'out' cannot be specified with option 'isolatedModules'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/file1.ts (1 errors) ==== export var x; ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.errors.txt b/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.errors.txt index fb77ff760d2aa..aaece85510a20 100644 --- a/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.errors.txt +++ b/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.js (0 errors) ==== class c { method(a) { diff --git a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt index ed2c697b88eca..5ad35537fc3ce 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt +++ b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/b.js (0 errors) ==== function foo() { return 10; diff --git a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt index b629125b74f3a..b90d746d3f7a4 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt +++ b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (1 errors) ==== function foo() { ~~~ diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt index 71eaa47b58138..4bb13b6f6075b 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== var x = 10; diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt index fec222ace70fb..bf39086071125 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/b.js (0 errors) ==== var x = "hello"; diff --git a/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt b/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt index 6deb90634f36c..ea2af3c251dd2 100644 --- a/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt +++ b/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt index dec141bf8e24d..8723135ebeb51 100644 --- a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt +++ b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt index 9b6c3b09dba95..f92092f97d7e7 100644 --- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.errors.txt b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.errors.txt index a6e2584b2de1b..b566ff0a349b5 100644 --- a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.errors.txt +++ b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.js (0 errors) ==== function foo(a) { for (let a = 0; a < 10; a++) { diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt index c51efb592aab6..1e5192ea2d55d 100644 --- a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt +++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/b.js (0 errors) ==== let a = 10; b = 30; diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt index eb1253352dcc3..8b11b436e3638 100644 --- a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt +++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/a.ts(2,1): error TS2448: Block-scoped variable 'a' used before its declaration. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (1 errors) ==== let b = 30; a = 10; diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.errors.txt b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.errors.txt index d66c233fddd8c..42c0b385f57d9 100644 --- a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.errors.txt +++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationNonNullAssertion.errors.txt b/tests/baselines/reference/jsFileCompilationNonNullAssertion.errors.txt index f331e6e99d15f..767ce9cd60410 100644 --- a/tests/baselines/reference/jsFileCompilationNonNullAssertion.errors.txt +++ b/tests/baselines/reference/jsFileCompilationNonNullAssertion.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. /src/a.js(1,1): error TS8013: Non-null assertions can only be used in TypeScript files. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== /src/a.js (1 errors) ==== 0! ~~ diff --git a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.errors.txt b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.errors.txt index a35da21ea5265..13fc148d58f0d 100644 --- a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.errors.txt +++ b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/_apply.js (0 errors) ==== /** * A faster alternative to `Function#apply`, this function invokes `func` diff --git a/tests/baselines/reference/jsFileCompilationRestParameter.errors.txt b/tests/baselines/reference/jsFileCompilationRestParameter.errors.txt index d7c0e0e44f0fc..83904b67ec3c7 100644 --- a/tests/baselines/reference/jsFileCompilationRestParameter.errors.txt +++ b/tests/baselines/reference/jsFileCompilationRestParameter.errors.txt @@ -1,6 +1,8 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.js (0 errors) ==== function foo(...a) { } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationShortHandProperty.errors.txt b/tests/baselines/reference/jsFileCompilationShortHandProperty.errors.txt index 1c8b6b6b8142c..bb0541bd213fd 100644 --- a/tests/baselines/reference/jsFileCompilationShortHandProperty.errors.txt +++ b/tests/baselines/reference/jsFileCompilationShortHandProperty.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.js (0 errors) ==== function foo() { var a = 10; diff --git a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt index a64ae32073722..ec53565069f85 100644 --- a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt @@ -1,10 +1,12 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. /src/a.js(1,6): error TS8016: Type assertion expressions can only be used in TypeScript files. /src/a.js(2,10): error TS17008: JSX element 'string' has no corresponding closing tag. /src/a.js(3,1): error TS1005: ' = Pick>; export declare type PartialProperties = Partial> & Omit; diff --git a/tests/baselines/reference/methodsReturningThis.errors.txt b/tests/baselines/reference/methodsReturningThis.errors.txt index 1fcd047bcbf82..08edddb8b37e4 100644 --- a/tests/baselines/reference/methodsReturningThis.errors.txt +++ b/tests/baselines/reference/methodsReturningThis.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/salsa/input.js (0 errors) ==== function Class() { diff --git a/tests/baselines/reference/moduleAugmentationsBundledOutput1.errors.txt b/tests/baselines/reference/moduleAugmentationsBundledOutput1.errors.txt index b90d6637fcbb1..814be0951419d 100644 --- a/tests/baselines/reference/moduleAugmentationsBundledOutput1.errors.txt +++ b/tests/baselines/reference/moduleAugmentationsBundledOutput1.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/m1.ts (0 errors) ==== export class Cls { } diff --git a/tests/baselines/reference/moduleAugmentationsImports1.errors.txt b/tests/baselines/reference/moduleAugmentationsImports1.errors.txt index 81f4df1e6bcaf..d3a444ba86d97 100644 --- a/tests/baselines/reference/moduleAugmentationsImports1.errors.txt +++ b/tests/baselines/reference/moduleAugmentationsImports1.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== export class A {} diff --git a/tests/baselines/reference/moduleAugmentationsImports2.errors.txt b/tests/baselines/reference/moduleAugmentationsImports2.errors.txt index 623f42a3ecc4d..28638042d1771 100644 --- a/tests/baselines/reference/moduleAugmentationsImports2.errors.txt +++ b/tests/baselines/reference/moduleAugmentationsImports2.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== export class A {} diff --git a/tests/baselines/reference/moduleAugmentationsImports3.errors.txt b/tests/baselines/reference/moduleAugmentationsImports3.errors.txt index 8dc3e9ede79da..056e39be90147 100644 --- a/tests/baselines/reference/moduleAugmentationsImports3.errors.txt +++ b/tests/baselines/reference/moduleAugmentationsImports3.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/main.ts (0 errors) ==== /// import {A} from "./a"; diff --git a/tests/baselines/reference/moduleAugmentationsImports4.errors.txt b/tests/baselines/reference/moduleAugmentationsImports4.errors.txt index 0665903c1dd13..7f6768ce721c9 100644 --- a/tests/baselines/reference/moduleAugmentationsImports4.errors.txt +++ b/tests/baselines/reference/moduleAugmentationsImports4.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/main.ts (0 errors) ==== /// /// diff --git a/tests/baselines/reference/multipleDeclarations.errors.txt b/tests/baselines/reference/multipleDeclarations.errors.txt index f74a0bb784f10..387ec52360cca 100644 --- a/tests/baselines/reference/multipleDeclarations.errors.txt +++ b/tests/baselines/reference/multipleDeclarations.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/salsa/input.js (0 errors) ==== function C() { this.m = null; diff --git a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.errors.txt b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.errors.txt index 4ebf67f2587be..db25b74a8aa58 100644 --- a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.errors.txt +++ b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.errors.txt @@ -1,9 +1,9 @@ -error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/compiler/noImplicitAnyIndexingSuppressed.ts(19,9): error TS2339: Property 'hi' does not exist on type '{}'. tests/cases/compiler/noImplicitAnyIndexingSuppressed.ts(22,9): error TS2339: Property '10' does not exist on type '{}'. -!!! error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/noImplicitAnyIndexingSuppressed.ts (2 errors) ==== enum MyEmusEnum { emu diff --git a/tests/baselines/reference/noImplicitUseStrict_amd.errors.txt b/tests/baselines/reference/noImplicitUseStrict_amd.errors.txt index 3e0c45283d065..1761236fbe5cf 100644 --- a/tests/baselines/reference/noImplicitUseStrict_amd.errors.txt +++ b/tests/baselines/reference/noImplicitUseStrict_amd.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/noImplicitUseStrict_amd.ts (0 errors) ==== export var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitUseStrict_commonjs.errors.txt b/tests/baselines/reference/noImplicitUseStrict_commonjs.errors.txt index c8dbd9e67f16c..55c9ce71a32a1 100644 --- a/tests/baselines/reference/noImplicitUseStrict_commonjs.errors.txt +++ b/tests/baselines/reference/noImplicitUseStrict_commonjs.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/noImplicitUseStrict_commonjs.ts (0 errors) ==== export var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitUseStrict_es6.errors.txt b/tests/baselines/reference/noImplicitUseStrict_es6.errors.txt index 015dd75aff894..36e9817b50451 100644 --- a/tests/baselines/reference/noImplicitUseStrict_es6.errors.txt +++ b/tests/baselines/reference/noImplicitUseStrict_es6.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/noImplicitUseStrict_es6.ts (0 errors) ==== export var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitUseStrict_system.errors.txt b/tests/baselines/reference/noImplicitUseStrict_system.errors.txt index 74379d2bbceb1..664b9bbd77f06 100644 --- a/tests/baselines/reference/noImplicitUseStrict_system.errors.txt +++ b/tests/baselines/reference/noImplicitUseStrict_system.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/noImplicitUseStrict_system.ts (0 errors) ==== export var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitUseStrict_umd.errors.txt b/tests/baselines/reference/noImplicitUseStrict_umd.errors.txt index 17a6269f25b42..1d2c3eafbe7f0 100644 --- a/tests/baselines/reference/noImplicitUseStrict_umd.errors.txt +++ b/tests/baselines/reference/noImplicitUseStrict_umd.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/noImplicitUseStrict_umd.ts (0 errors) ==== export var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/noStrictGenericChecks.errors.txt b/tests/baselines/reference/noStrictGenericChecks.errors.txt index c760a864a3b18..17c05780ea811 100644 --- a/tests/baselines/reference/noStrictGenericChecks.errors.txt +++ b/tests/baselines/reference/noStrictGenericChecks.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/noStrictGenericChecks.ts (0 errors) ==== type A = (x: T, y: U) => [T, U]; type B = (x: S, y: S) => [S, S]; diff --git a/tests/baselines/reference/nonPrimitiveIndexingWithForInSupressError.errors.txt b/tests/baselines/reference/nonPrimitiveIndexingWithForInSupressError.errors.txt index 6d8098c507e0f..94751b019a8bf 100644 --- a/tests/baselines/reference/nonPrimitiveIndexingWithForInSupressError.errors.txt +++ b/tests/baselines/reference/nonPrimitiveIndexingWithForInSupressError.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveIndexingWithForInSupressError.ts (0 errors) ==== var a: object; diff --git a/tests/baselines/reference/numericUnderscoredSeparator(target=es3).errors.txt b/tests/baselines/reference/numericUnderscoredSeparator(target=es3).errors.txt index 163033c30a04b..c2f218879d239 100644 --- a/tests/baselines/reference/numericUnderscoredSeparator(target=es3).errors.txt +++ b/tests/baselines/reference/numericUnderscoredSeparator(target=es3).errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/numericUnderscoredSeparator.ts (0 errors) ==== 1_000_000_000_000 0b1010_0001_1000_0101 diff --git a/tests/baselines/reference/objectLiteralErrorsES3.errors.txt b/tests/baselines/reference/objectLiteralErrorsES3.errors.txt index 912d2e1616cee..249c43afb3bab 100644 --- a/tests/baselines/reference/objectLiteralErrorsES3.errors.txt +++ b/tests/baselines/reference/objectLiteralErrorsES3.errors.txt @@ -1,11 +1,11 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(1,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(3,40): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts (4 errors) ==== var e1 = { get a() { return 4; } }; ~ diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.errors.txt b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.errors.txt index f5d1d539f9c28..8e1ccabbeac44 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.errors.txt +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts (0 errors) ==== // string named numeric properties are legal and distinct when indexed by string values // indexed numerically the value is converted to a number diff --git a/tests/baselines/reference/optionsOutAndNoModuleGen.errors.txt b/tests/baselines/reference/optionsOutAndNoModuleGen.errors.txt index 8702ba6720166..0f346faf1fd57 100644 --- a/tests/baselines/reference/optionsOutAndNoModuleGen.errors.txt +++ b/tests/baselines/reference/optionsOutAndNoModuleGen.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/compiler/optionsOutAndNoModuleGen.ts(1,1): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/optionsOutAndNoModuleGen.ts (1 errors) ==== export var x = 10; ~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/out-flag3.errors.txt b/tests/baselines/reference/out-flag3.errors.txt index b82f9f1f77bb6..8a073b09dab11 100644 --- a/tests/baselines/reference/out-flag3.errors.txt +++ b/tests/baselines/reference/out-flag3.errors.txt @@ -1,10 +1,12 @@ error TS5053: Option 'out' cannot be specified with option 'outFile'. -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. !!! error TS5053: Option 'out' cannot be specified with option 'outFile'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== tests/cases/compiler/a.ts (0 errors) ==== // --out and --outFile error diff --git a/tests/baselines/reference/parserArrowFunctionExpression10(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression10(target=es3).errors.txt index 305361bc25aa5..20e0ea6e0a43e 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression10(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression10(target=es3).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,11): error TS2304: Cannot find name 'c'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,11): error TS8010: Type annotations can only be used in TypeScript files. @@ -10,7 +10,7 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1, tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,27): error TS2304: Cannot find name 'f'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (5 errors) ==== a ? (b) : c => (d) : e => f // Not legal JS; "Unexpected token ':'" at last colon ~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression11(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression11(target=es3).errors.txt index ffccff6fadb43..37da3d8382076 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression11(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression11(target=es3).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,5): error TS2304: Cannot find name 'b'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,9): error TS2304: Cannot find name 'c'. @@ -11,7 +11,7 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1, tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,24): error TS2304: Cannot find name 'f'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (5 errors) ==== a ? b ? c : (d) : e => f // Legal JS ~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression12(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression12(target=es3).errors.txt index 555a0bd0fe48e..0ec0ea0e216f7 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression12(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression12(target=es3).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,13): error TS2304: Cannot find name 'c'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,22): error TS2304: Cannot find name 'e'. @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1, tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,22): error TS2304: Cannot find name 'e'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (3 errors) ==== a ? (b) => (c): d => e // Legal JS ~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression13(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression13(target=es3).errors.txt index 9324e59e8f93d..96f863778fa73 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression13(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression13(target=es3).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,11): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,21): error TS8010: Type annotations can only be used in TypeScript files. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1, tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,11): error TS2304: Cannot find name 'a'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (3 errors) ==== a ? () => a() : (): any => null; // Not legal JS; "Unexpected token ')'" at last paren ~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression14(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression14(target=es3).errors.txt index 3e3daad2486cb..963b0de199462 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression14(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression14(target=es3).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,11): error TS8010: Type annotations can only be used in TypeScript files. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,20): error TS8009: The '?' modifier can only be used in TypeScript files. @@ -11,7 +11,7 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1, tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,46): error TS2304: Cannot find name 'e'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (7 errors) ==== a() ? (b: number, c?: string): void => d() : e; // Not legal JS; "Unexpected token ':'" at first colon ~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression15(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression15(target=es3).errors.txt index 0de3cd0966599..d120553b86dbf 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression15(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression15(target=es3).errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,18): error TS8010: Type annotations can only be used in TypeScript files. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (1 errors) ==== false ? (param): string => param : null // Not legal JS; "Unexpected token ':'" at last colon ~~~~~~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression16(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression16(target=es3).errors.txt index 13e7b275d42cf..7f8af79a95c61 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression16(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression16(target=es3).errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,25): error TS8010: Type annotations can only be used in TypeScript files. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (1 errors) ==== true ? false ? (param): string => param : null : null // Not legal JS; "Unexpected token ':'" at last colon ~~~~~~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression17(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression17(target=es3).errors.txt index d7a808b6fc9eb..1153fb7ed531a 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression17(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression17(target=es3).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,5): error TS2304: Cannot find name 'b'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,15): error TS2304: Cannot find name 'd'. @@ -10,7 +10,7 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1, tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,20): error TS2304: Cannot find name 'e'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (5 errors) ==== a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon ~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression8(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression8(target=es3).errors.txt index bc6585aa73faf..44e9198ca5d54 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression8(target=es3).errors.txt @@ -1,9 +1,9 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'x'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,1): error TS2304: Cannot find name 'x'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (1 errors) ==== x ? y => ({ y }) : z => ({ z }) // Legal JS ~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression9(target=es3).errors.txt b/tests/baselines/reference/parserArrowFunctionExpression9(target=es3).errors.txt index 2fda8e3b43a38..366ef89b1e3e4 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression9(target=es3).errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression9(target=es3).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'b'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,6): error TS2304: Cannot find name 'c'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,16): error TS2304: Cannot find name 'e'. @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1, tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,16): error TS2304: Cannot find name 'e'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (3 errors) ==== b ? (c) : d => e // Legal JS ~ diff --git a/tests/baselines/reference/preserveUnusedImports.errors.txt b/tests/baselines/reference/preserveUnusedImports.errors.txt index 51d2f0b8a4a64..32f67a0b60d29 100644 --- a/tests/baselines/reference/preserveUnusedImports.errors.txt +++ b/tests/baselines/reference/preserveUnusedImports.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. -!!! error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== export type A = {}; diff --git a/tests/baselines/reference/preserveValueImports(isolatedmodules=false).errors.txt b/tests/baselines/reference/preserveValueImports(isolatedmodules=false).errors.txt index b40ffd45f3649..448ddf02f4a21 100644 --- a/tests/baselines/reference/preserveValueImports(isolatedmodules=false).errors.txt +++ b/tests/baselines/reference/preserveValueImports(isolatedmodules=false).errors.txt @@ -1,11 +1,11 @@ -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. tests/cases/conformance/externalModules/typeOnly/d.ts(1,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. tests/cases/conformance/externalModules/typeOnly/e.ts(1,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead. tests/cases/conformance/externalModules/typeOnly/e.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/conformance/externalModules/typeOnly/a.ts (0 errors) ==== export default {}; diff --git a/tests/baselines/reference/preserveValueImports(isolatedmodules=true).errors.txt b/tests/baselines/reference/preserveValueImports(isolatedmodules=true).errors.txt index beb7d216b120d..ed33d69dab7a8 100644 --- a/tests/baselines/reference/preserveValueImports(isolatedmodules=true).errors.txt +++ b/tests/baselines/reference/preserveValueImports(isolatedmodules=true).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. tests/cases/conformance/externalModules/typeOnly/b.ts(1,19): error TS1444: 'D' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled. tests/cases/conformance/externalModules/typeOnly/d.ts(1,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. @@ -6,7 +6,7 @@ tests/cases/conformance/externalModules/typeOnly/e.ts(1,1): error TS1202: Import tests/cases/conformance/externalModules/typeOnly/e.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/conformance/externalModules/typeOnly/a.ts (0 errors) ==== export default {}; diff --git a/tests/baselines/reference/preserveValueImports_errors(isolatedmodules=false).errors.txt b/tests/baselines/reference/preserveValueImports_errors(isolatedmodules=false).errors.txt index 21f8551b4f652..cf12f79b061c5 100644 --- a/tests/baselines/reference/preserveValueImports_errors(isolatedmodules=false).errors.txt +++ b/tests/baselines/reference/preserveValueImports_errors(isolatedmodules=false).errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/conformance/externalModules/typeOnly/a.ts (0 errors) ==== export type A = {}; diff --git a/tests/baselines/reference/preserveValueImports_errors(isolatedmodules=true).errors.txt b/tests/baselines/reference/preserveValueImports_errors(isolatedmodules=true).errors.txt index f748372c31b9e..1179d751515cf 100644 --- a/tests/baselines/reference/preserveValueImports_errors(isolatedmodules=true).errors.txt +++ b/tests/baselines/reference/preserveValueImports_errors(isolatedmodules=true).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. tests/cases/conformance/externalModules/typeOnly/c.ts(1,8): error TS1444: 'DefaultA' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled. tests/cases/conformance/externalModules/typeOnly/c.ts(2,10): error TS1444: 'A' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled. @@ -10,7 +10,7 @@ tests/cases/conformance/externalModules/typeOnly/e.ts(1,10): error TS1444: 'AA' tests/cases/conformance/externalModules/typeOnly/e.ts(1,14): error TS1446: 'BB' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/conformance/externalModules/typeOnly/a.ts (0 errors) ==== export type A = {}; diff --git a/tests/baselines/reference/preserveValueImports_importsNotUsedAsValues.errors.txt b/tests/baselines/reference/preserveValueImports_importsNotUsedAsValues.errors.txt index f31ce03bea234..364382869daf9 100644 --- a/tests/baselines/reference/preserveValueImports_importsNotUsedAsValues.errors.txt +++ b/tests/baselines/reference/preserveValueImports_importsNotUsedAsValues.errors.txt @@ -1,12 +1,12 @@ -error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. -!!! error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== /mod.ts (0 errors) ==== export type A = unknown; diff --git a/tests/baselines/reference/preserveValueImports_mixedImports.errors.txt b/tests/baselines/reference/preserveValueImports_mixedImports.errors.txt index cf72fd6e391b7..098b6d9cd6d56 100644 --- a/tests/baselines/reference/preserveValueImports_mixedImports.errors.txt +++ b/tests/baselines/reference/preserveValueImports_mixedImports.errors.txt @@ -1,9 +1,9 @@ -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. /index.ts(1,21): error TS1444: 'ComponentProps' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== /exports.ts (0 errors) ==== export function Component() {} diff --git a/tests/baselines/reference/preserveValueImports_module(module=amd).errors.txt b/tests/baselines/reference/preserveValueImports_module(module=amd).errors.txt index 26645a278635c..76bc6b88fe467 100644 --- a/tests/baselines/reference/preserveValueImports_module(module=amd).errors.txt +++ b/tests/baselines/reference/preserveValueImports_module(module=amd).errors.txt @@ -1,10 +1,10 @@ error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/conformance/externalModules/typeOnly/preserveValueImports_module.ts (0 errors) ==== export {}; diff --git a/tests/baselines/reference/preserveValueImports_module(module=commonjs).errors.txt b/tests/baselines/reference/preserveValueImports_module(module=commonjs).errors.txt index 26645a278635c..76bc6b88fe467 100644 --- a/tests/baselines/reference/preserveValueImports_module(module=commonjs).errors.txt +++ b/tests/baselines/reference/preserveValueImports_module(module=commonjs).errors.txt @@ -1,10 +1,10 @@ error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/conformance/externalModules/typeOnly/preserveValueImports_module.ts (0 errors) ==== export {}; diff --git a/tests/baselines/reference/preserveValueImports_module(module=es2015).errors.txt b/tests/baselines/reference/preserveValueImports_module(module=es2015).errors.txt index 6c0aed993f474..4fbed5427644f 100644 --- a/tests/baselines/reference/preserveValueImports_module(module=es2015).errors.txt +++ b/tests/baselines/reference/preserveValueImports_module(module=es2015).errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/conformance/externalModules/typeOnly/preserveValueImports_module.ts (0 errors) ==== export {}; diff --git a/tests/baselines/reference/preserveValueImports_module(module=system).errors.txt b/tests/baselines/reference/preserveValueImports_module(module=system).errors.txt index 26645a278635c..76bc6b88fe467 100644 --- a/tests/baselines/reference/preserveValueImports_module(module=system).errors.txt +++ b/tests/baselines/reference/preserveValueImports_module(module=system).errors.txt @@ -1,10 +1,10 @@ error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== tests/cases/conformance/externalModules/typeOnly/preserveValueImports_module.ts (0 errors) ==== export {}; diff --git a/tests/baselines/reference/privateNameES5Ban(target=es3).errors.txt b/tests/baselines/reference/privateNameES5Ban(target=es3).errors.txt index ea490e3be76ac..64d71a61d6296 100644 --- a/tests/baselines/reference/privateNameES5Ban(target=es3).errors.txt +++ b/tests/baselines/reference/privateNameES5Ban(target=es3).errors.txt @@ -1,4 +1,4 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. tests/cases/conformance/classes/members/privateNames/privateNameES5Ban.ts(3,5): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher. tests/cases/conformance/classes/members/privateNames/privateNameES5Ban.ts(4,5): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher. tests/cases/conformance/classes/members/privateNames/privateNameES5Ban.ts(5,12): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher. @@ -9,7 +9,7 @@ tests/cases/conformance/classes/members/privateNames/privateNameES5Ban.ts(9,16): tests/cases/conformance/classes/members/privateNames/privateNameES5Ban.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/classes/members/privateNames/privateNameES5Ban.ts (8 errors) ==== class A { constructor() {} diff --git a/tests/baselines/reference/project/declarationDir3/amd/declarationDir3.errors.txt b/tests/baselines/reference/project/declarationDir3/amd/declarationDir3.errors.txt index 718e3075de4af..d9678b62ff161 100644 --- a/tests/baselines/reference/project/declarationDir3/amd/declarationDir3.errors.txt +++ b/tests/baselines/reference/project/declarationDir3/amd/declarationDir3.errors.txt @@ -1,9 +1,11 @@ error TS5053: Option 'declarationDir' cannot be specified with option 'out'. -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. !!! error TS5053: Option 'declarationDir' cannot be specified with option 'out'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== b.ts (0 errors) ==== export class B { diff --git a/tests/baselines/reference/project/declarationDir3/node/declarationDir3.errors.txt b/tests/baselines/reference/project/declarationDir3/node/declarationDir3.errors.txt index 4ef11942519a7..059f6d13a1f97 100644 --- a/tests/baselines/reference/project/declarationDir3/node/declarationDir3.errors.txt +++ b/tests/baselines/reference/project/declarationDir3/node/declarationDir3.errors.txt @@ -1,10 +1,12 @@ error TS5053: Option 'declarationDir' cannot be specified with option 'out'. -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. !!! error TS5053: Option 'declarationDir' cannot be specified with option 'out'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== b.ts (0 errors) ==== export class B { diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/jsFileCompilationDifferentNamesNotSpecified.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/jsFileCompilationDifferentNamesNotSpecified.errors.txt index dfd04fe25554c..fce9f492876db 100644 --- a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/jsFileCompilationDifferentNamesNotSpecified.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/jsFileCompilationDifferentNamesNotSpecified.errors.txt @@ -1,11 +1,13 @@ -DifferentNamesNotSpecified/tsconfig.json(2,24): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +DifferentNamesNotSpecified/tsconfig.json(2,24): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. ==== DifferentNamesNotSpecified/tsconfig.json (1 errors) ==== { "compilerOptions": { "out": "test.js" } ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. } ==== DifferentNamesNotSpecified/a.ts (0 errors) ==== var test = 10; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.errors.txt index 715c0424fce5e..82f2252cca75e 100644 --- a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.errors.txt @@ -1,4 +1,5 @@ -DifferentNamesNotSpecified/tsconfig.json(2,24): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +DifferentNamesNotSpecified/tsconfig.json(2,24): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. DifferentNamesNotSpecified/tsconfig.json(2,24): error TS6082: Only 'amd' and 'system' modules are supported alongside --out. @@ -6,7 +7,8 @@ DifferentNamesNotSpecified/tsconfig.json(2,24): error TS6082: Only 'amd' and 'sy { "compilerOptions": { "out": "test.js" } ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ~~~~~ !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. } diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt index 546920ddfc290..1bea6c8ad8b6d 100644 --- a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt @@ -1,4 +1,5 @@ -DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. ==== DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json (1 errors) ==== @@ -6,7 +7,8 @@ DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Flag 'ou "compilerOptions": { "out": "test.js", ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. "allowJs": true } } diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt index 28c065f08513c..ed7a1ac63058d 100644 --- a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt @@ -1,4 +1,5 @@ -DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json(3,5): error TS6082: Only 'amd' and 'system' modules are supported alongside --out. @@ -7,7 +8,8 @@ DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json(3,5): error TS6082: Only 'am "compilerOptions": { "out": "test.js", ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ~~~~~ !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. "allowJs": true diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.errors.txt index bd6b1a651cb73..8d87f5102ea9b 100644 --- a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.errors.txt @@ -1,7 +1,8 @@ error TS6504: File 'DifferentNamesSpecified/b.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? The file is in the program because: Part of 'files' list in tsconfig.json -DifferentNamesSpecified/tsconfig.json(2,24): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +DifferentNamesSpecified/tsconfig.json(2,24): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. !!! error TS6504: File 'DifferentNamesSpecified/b.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? @@ -12,7 +13,8 @@ DifferentNamesSpecified/tsconfig.json(2,24): error TS5101: Flag 'out' is depreca { "compilerOptions": { "out": "test.js" }, ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. "files": [ "a.ts", "b.js" ] } ==== DifferentNamesSpecified/a.ts (0 errors) ==== diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.errors.txt index ad4abcf43f0cd..17632e3d6be23 100644 --- a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.errors.txt @@ -1,7 +1,8 @@ error TS6504: File 'DifferentNamesSpecified/b.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? The file is in the program because: Part of 'files' list in tsconfig.json -DifferentNamesSpecified/tsconfig.json(2,24): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +DifferentNamesSpecified/tsconfig.json(2,24): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. DifferentNamesSpecified/tsconfig.json(2,24): error TS6082: Only 'amd' and 'system' modules are supported alongside --out. @@ -13,7 +14,8 @@ DifferentNamesSpecified/tsconfig.json(2,24): error TS6082: Only 'amd' and 'syste { "compilerOptions": { "out": "test.js" }, ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ~~~~~ !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. "files": [ "a.ts", "b.js" ] diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt index 1bdab1a6c2c7e..75423493ecfe0 100644 --- a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt @@ -1,4 +1,5 @@ -DifferentNamesSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +DifferentNamesSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. ==== DifferentNamesSpecifiedWithAllowJs/tsconfig.json (1 errors) ==== @@ -6,7 +7,8 @@ DifferentNamesSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Flag 'out' "compilerOptions": { "out": "test.js", ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. "allowJs": true }, "files": [ "a.ts", "b.js" ] diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt index d8e6b8c15db82..e1b40f2e08191 100644 --- a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt @@ -1,4 +1,5 @@ -DifferentNamesSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +DifferentNamesSpecifiedWithAllowJs/tsconfig.json(3,5): error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. DifferentNamesSpecifiedWithAllowJs/tsconfig.json(3,5): error TS6082: Only 'amd' and 'system' modules are supported alongside --out. @@ -7,7 +8,8 @@ DifferentNamesSpecifiedWithAllowJs/tsconfig.json(3,5): error TS6082: Only 'amd' "compilerOptions": { "out": "test.js", ~~~~~ -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ~~~~~ !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. "allowJs": true diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/outMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/outMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/outMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/outMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/outSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/outSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/outSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/outSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/outSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/outSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/outSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/outSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/outSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/outSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/outSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/outSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.errors.txt b/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.errors.txt index 7fd88361ca7de..c25d6eb915c48 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.errors.txt +++ b/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== globalThisCapture.ts (0 errors) ==== // Add a lambda to ensure global 'this' capture is triggered (()=>this.window); diff --git a/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt b/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt index c70b671262cc0..7819598111af2 100644 --- a/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt +++ b/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== globalThisCapture.ts (0 errors) ==== // Add a lambda to ensure global 'this' capture is triggered diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 45b0d2cdf50b2..19a05ba9d1ac8 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt index 705335219db40..235fc8477efea 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt index 138924ccd44e8..37fa51f273f66 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt index 1c7541e7c3b0d..66f7ea7b3a250 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt index 149618ce17936..3c0d816fe85cc 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt index be553e6738677..6a7483593d26f 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt index 9f6499ceb2aa2..8274ae8907a7b 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; export class m1_c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt index 43eba59e956df..e6b1a69828125 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== export var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt index f099f50146368..0effddb001fce 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt index 0a2373c98b3ab..67c1d0220148d 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.errors.txt index bf5258bd2d8ac..8bb337d288045 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt index dac40e9b915c3..cec00391a2706 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt index e228759a197b5..ce79abb2a79c5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== test.ts (0 errors) ==== var a1 = 10; class c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt index a3401edd171f3..8030290f6a09d 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== test.ts (0 errors) ==== var a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt index abf1877840249..2e1e4f9438ef7 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; class m1_c1 { diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt index 906028d54de16..b54ec12445ead 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== ref/m1.ts (0 errors) ==== var m1_a1 = 10; diff --git a/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt b/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt index ee99f73dcf1b8..bcb6f86fd0203 100644 --- a/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt +++ b/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts (0 errors) ==== 0xffffffff.toString(); 0o01234.toString(); diff --git a/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.errors.txt b/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.errors.txt index 1761d9d7dfc77..d6ffff0f8a496 100644 --- a/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.errors.txt +++ b/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/jsDocOptionality.js (0 errors) ==== function MyClass() { this.prop = null; diff --git a/tests/baselines/reference/sourceMap-Comment1.errors.txt b/tests/baselines/reference/sourceMap-Comment1.errors.txt index d78097773f379..1dbd0137ef593 100644 --- a/tests/baselines/reference/sourceMap-Comment1.errors.txt +++ b/tests/baselines/reference/sourceMap-Comment1.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/sourceMap-Comment1.ts (0 errors) ==== // Comment \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-EmptyFile1.errors.txt b/tests/baselines/reference/sourceMap-EmptyFile1.errors.txt index ac9e2e52a4e22..8fa3baf3ee04f 100644 --- a/tests/baselines/reference/sourceMap-EmptyFile1.errors.txt +++ b/tests/baselines/reference/sourceMap-EmptyFile1.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/sourceMap-EmptyFile1.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.errors.txt b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.errors.txt index 35994a97270d6..bdb5ab38fb123 100644 --- a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.errors.txt +++ b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/sourceMap-InterfacePrecedingVariableDeclaration1.ts (0 errors) ==== interface I {} var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-LineBreaks.errors.txt b/tests/baselines/reference/sourceMap-LineBreaks.errors.txt index 27aa2ef8fec3d..869640d3b2aab 100644 --- a/tests/baselines/reference/sourceMap-LineBreaks.errors.txt +++ b/tests/baselines/reference/sourceMap-LineBreaks.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/sourceMap-LineBreaks.ts (0 errors) ==== var endsWithlineSeparator = 10; 
var endsWithParagraphSeparator = 10; 
var endsWithNextLine = 1;…var endsWithLineFeed = 1; var endsWithCarriageReturnLineFeed = 1; diff --git a/tests/baselines/reference/sourceMap-NewLine1.errors.txt b/tests/baselines/reference/sourceMap-NewLine1.errors.txt index 6cea8235a41c2..8667b40fdda41 100644 --- a/tests/baselines/reference/sourceMap-NewLine1.errors.txt +++ b/tests/baselines/reference/sourceMap-NewLine1.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/sourceMap-NewLine1.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SemiColon1.errors.txt b/tests/baselines/reference/sourceMap-SemiColon1.errors.txt index ddad68331a8ca..2e1b0950852cd 100644 --- a/tests/baselines/reference/sourceMap-SemiColon1.errors.txt +++ b/tests/baselines/reference/sourceMap-SemiColon1.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/sourceMap-SemiColon1.ts (0 errors) ==== ; \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SingleSpace1.errors.txt b/tests/baselines/reference/sourceMap-SingleSpace1.errors.txt index 5efb2ee390c93..84a6831d36396 100644 --- a/tests/baselines/reference/sourceMap-SingleSpace1.errors.txt +++ b/tests/baselines/reference/sourceMap-SingleSpace1.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/sourceMap-SingleSpace1.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.errors.txt b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.errors.txt index 6aa5d90ff8218..1314fed6b9509 100644 --- a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.errors.txt +++ b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/sourceMap-StringLiteralWithNewLine.ts (0 errors) ==== interface Document { } diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.errors.txt b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.errors.txt index 09c9142b89766..d7c75d01ac11b 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.errors.txt +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/testFiles/app.ts (0 errors) ==== // Note in the out result we are using same folder name only different in casing // Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.errors.txt b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.errors.txt index 4ae0bfebaf09b..7e681b7656da4 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.errors.txt +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/b.ts (0 errors) ==== /*-------------------------------------------------------------------------- Copyright diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.errors.txt b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.errors.txt index 4adf73858fb2b..f19322d9fb168 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.errors.txt +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/a.ts (0 errors) ==== module M { export var X = 1; diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.errors.txt b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.errors.txt index 86dd28c61ec38..b76ab7fe9d86d 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.errors.txt +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/compiler/testFiles/app.ts (0 errors) ==== // Note in the out result we are using same folder name only different in casing // Since this is non case sensitive, the relative paths should be just app.ts and app2.ts in the sourcemap diff --git a/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.errors.txt index b701c0b1bde9d..c9da008201c8c 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/taggedTemplateStringsWithCurriedFunction.ts (0 errors) ==== // Originated from #38558 diff --git a/tests/baselines/reference/topLevelThisAssignment.errors.txt b/tests/baselines/reference/topLevelThisAssignment.errors.txt index b1abf244eb16d..275b4cbaabebe 100644 --- a/tests/baselines/reference/topLevelThisAssignment.errors.txt +++ b/tests/baselines/reference/topLevelThisAssignment.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/salsa/a.js (0 errors) ==== this.a = 10; this.a; diff --git a/tests/baselines/reference/trailingCommasES3.errors.txt b/tests/baselines/reference/trailingCommasES3.errors.txt index 3965a75d3d083..a4cf4b6d22fe5 100644 --- a/tests/baselines/reference/trailingCommasES3.errors.txt +++ b/tests/baselines/reference/trailingCommasES3.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/compiler/trailingCommasES3.ts (0 errors) ==== var o1 = { a: 1, b: 2 }; var o2 = { a: 1, b: 2, }; diff --git a/tests/baselines/reference/transpile/Does not generate semantic diagnostics.errors.txt b/tests/baselines/reference/transpile/Does not generate semantic diagnostics.errors.txt index a88dc4e6e9f0a..48e2c35e4443f 100644 --- a/tests/baselines/reference/transpile/Does not generate semantic diagnostics.errors.txt +++ b/tests/baselines/reference/transpile/Does not generate semantic diagnostics.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x: string = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not generate semantic diagnostics.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Does not generate semantic diagnostics.oldTranspile.errors.txt index a88dc4e6e9f0a..48e2c35e4443f 100644 --- a/tests/baselines/reference/transpile/Does not generate semantic diagnostics.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Does not generate semantic diagnostics.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x: string = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Elides import equals referenced only by export type.errors.txt b/tests/baselines/reference/transpile/Elides import equals referenced only by export type.errors.txt index 067bbacaf9e13..446d224f1ce3d 100644 --- a/tests/baselines/reference/transpile/Elides import equals referenced only by export type.errors.txt +++ b/tests/baselines/reference/transpile/Elides import equals referenced only by export type.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import IFoo = Namespace.IFoo;export type { IFoo }; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Elides import equals referenced only by export type.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Elides import equals referenced only by export type.oldTranspile.errors.txt index 067bbacaf9e13..446d224f1ce3d 100644 --- a/tests/baselines/reference/transpile/Elides import equals referenced only by export type.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Elides import equals referenced only by export type.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import IFoo = Namespace.IFoo;export type { IFoo }; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Elides import equals referenced only by type only export specifier.errors.txt b/tests/baselines/reference/transpile/Elides import equals referenced only by type only export specifier.errors.txt index dda58fe23e5d5..4f2320c9c4e04 100644 --- a/tests/baselines/reference/transpile/Elides import equals referenced only by type only export specifier.errors.txt +++ b/tests/baselines/reference/transpile/Elides import equals referenced only by type only export specifier.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import IFoo = Namespace.IFoo;export { type IFoo }; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Elides import equals referenced only by type only export specifier.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Elides import equals referenced only by type only export specifier.oldTranspile.errors.txt index dda58fe23e5d5..4f2320c9c4e04 100644 --- a/tests/baselines/reference/transpile/Elides import equals referenced only by type only export specifier.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Elides import equals referenced only by type only export specifier.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import IFoo = Namespace.IFoo;export { type IFoo }; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Export star as ns conflict does not crash.errors.txt b/tests/baselines/reference/transpile/Export star as ns conflict does not crash.errors.txt index 8171331057ce4..5d165a9e5cb32 100644 --- a/tests/baselines/reference/transpile/Export star as ns conflict does not crash.errors.txt +++ b/tests/baselines/reference/transpile/Export star as ns conflict does not crash.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var a; diff --git a/tests/baselines/reference/transpile/Export star as ns conflict does not crash.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Export star as ns conflict does not crash.oldTranspile.errors.txt index 8171331057ce4..5d165a9e5cb32 100644 --- a/tests/baselines/reference/transpile/Export star as ns conflict does not crash.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Export star as ns conflict does not crash.oldTranspile.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var a; diff --git a/tests/baselines/reference/transpile/Generates expected syntactic diagnostics.errors.txt b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics.errors.txt index 62b9c50bad901..cb892b6e4312d 100644 --- a/tests/baselines/reference/transpile/Generates expected syntactic diagnostics.errors.txt +++ b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. file.ts(1,1): error TS1434: Unexpected keyword or identifier. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (1 errors) ==== a b ~ diff --git a/tests/baselines/reference/transpile/Generates expected syntactic diagnostics.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics.oldTranspile.errors.txt index 62b9c50bad901..cb892b6e4312d 100644 --- a/tests/baselines/reference/transpile/Generates expected syntactic diagnostics.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics.oldTranspile.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. file.ts(1,1): error TS1434: Unexpected keyword or identifier. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (1 errors) ==== a b ~ diff --git a/tests/baselines/reference/transpile/Generates module output.errors.txt b/tests/baselines/reference/transpile/Generates module output.errors.txt index fef912219ef6c..5b06d0efa56ec 100644 --- a/tests/baselines/reference/transpile/Generates module output.errors.txt +++ b/tests/baselines/reference/transpile/Generates module output.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates module output.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates module output.oldTranspile.errors.txt index fef912219ef6c..5b06d0efa56ec 100644 --- a/tests/baselines/reference/transpile/Generates module output.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Generates module output.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing file references.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references.errors.txt index 861ab2e8924bd..9af2d50b93057 100644 --- a/tests/baselines/reference/transpile/Generates no diagnostics for missing file references.errors.txt +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== /// var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing file references.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references.oldTranspile.errors.txt index 861ab2e8924bd..9af2d50b93057 100644 --- a/tests/baselines/reference/transpile/Generates no diagnostics for missing file references.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references.oldTranspile.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== /// var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports.errors.txt index 88fe5b6c54176..5088820790e6a 100644 --- a/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports.errors.txt +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import {a} from "module2"; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports.oldTranspile.errors.txt index 88fe5b6c54176..5088820790e6a 100644 --- a/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import {a} from "module2"; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs.errors.txt index fef912219ef6c..5b06d0efa56ec 100644 --- a/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs.errors.txt +++ b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs.oldTranspile.errors.txt index fef912219ef6c..5b06d0efa56ec 100644 --- a/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Infer correct file extension.errors.txt b/tests/baselines/reference/transpile/Infer correct file extension.errors.txt index 6535984b1a2bb..2dbc7833f54af 100644 --- a/tests/baselines/reference/transpile/Infer correct file extension.errors.txt +++ b/tests/baselines/reference/transpile/Infer correct file extension.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== const fn = (a: T) => a \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Infer correct file extension.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Infer correct file extension.oldTranspile.errors.txt index 6535984b1a2bb..2dbc7833f54af 100644 --- a/tests/baselines/reference/transpile/Infer correct file extension.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Infer correct file extension.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== const fn = (a: T) => a \ No newline at end of file diff --git a/tests/baselines/reference/transpile/No extra errors for file without extension.errors.txt b/tests/baselines/reference/transpile/No extra errors for file without extension.errors.txt index 2d8cddf9f0d2d..00d0f6d0d9b9b 100644 --- a/tests/baselines/reference/transpile/No extra errors for file without extension.errors.txt +++ b/tests/baselines/reference/transpile/No extra errors for file without extension.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file (0 errors) ==== "use strict"; var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/No extra errors for file without extension.oldTranspile.errors.txt b/tests/baselines/reference/transpile/No extra errors for file without extension.oldTranspile.errors.txt index 2d8cddf9f0d2d..00d0f6d0d9b9b 100644 --- a/tests/baselines/reference/transpile/No extra errors for file without extension.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/No extra errors for file without extension.oldTranspile.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file (0 errors) ==== "use strict"; var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Rename dependencies - AMD.errors.txt b/tests/baselines/reference/transpile/Rename dependencies - AMD.errors.txt index 7764253ba9a9b..e39ca9344d5f1 100644 --- a/tests/baselines/reference/transpile/Rename dependencies - AMD.errors.txt +++ b/tests/baselines/reference/transpile/Rename dependencies - AMD.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import {foo} from "SomeName"; declare function use(a: any); diff --git a/tests/baselines/reference/transpile/Rename dependencies - System.errors.txt b/tests/baselines/reference/transpile/Rename dependencies - System.errors.txt index 7764253ba9a9b..e39ca9344d5f1 100644 --- a/tests/baselines/reference/transpile/Rename dependencies - System.errors.txt +++ b/tests/baselines/reference/transpile/Rename dependencies - System.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import {foo} from "SomeName"; declare function use(a: any); diff --git a/tests/baselines/reference/transpile/Rename dependencies - UMD.errors.txt b/tests/baselines/reference/transpile/Rename dependencies - UMD.errors.txt index 7764253ba9a9b..e39ca9344d5f1 100644 --- a/tests/baselines/reference/transpile/Rename dependencies - UMD.errors.txt +++ b/tests/baselines/reference/transpile/Rename dependencies - UMD.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== import {foo} from "SomeName"; declare function use(a: any); diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt index e30f175a4c2cb..fad550d1d91ac 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt index e30f175a4c2cb..fad550d1d91ac 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt index e30f175a4c2cb..fad550d1d91ac 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt index e30f175a4c2cb..fad550d1d91ac 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Sets module name.errors.txt b/tests/baselines/reference/transpile/Sets module name.errors.txt index e39e25e9c4548..806012c63fa83 100644 --- a/tests/baselines/reference/transpile/Sets module name.errors.txt +++ b/tests/baselines/reference/transpile/Sets module name.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x = 1; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Sets module name.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Sets module name.oldTranspile.errors.txt index e39e25e9c4548..806012c63fa83 100644 --- a/tests/baselines/reference/transpile/Sets module name.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Sets module name.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x = 1; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with lib values.errors.txt b/tests/baselines/reference/transpile/Support options with lib values.errors.txt index 4ea3259d69bd7..dc710829d5256 100644 --- a/tests/baselines/reference/transpile/Support options with lib values.errors.txt +++ b/tests/baselines/reference/transpile/Support options with lib values.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with lib values.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Support options with lib values.oldTranspile.errors.txt index 4ea3259d69bd7..dc710829d5256 100644 --- a/tests/baselines/reference/transpile/Support options with lib values.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Support options with lib values.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with types values.errors.txt b/tests/baselines/reference/transpile/Support options with types values.errors.txt index 4ea3259d69bd7..dc710829d5256 100644 --- a/tests/baselines/reference/transpile/Support options with types values.errors.txt +++ b/tests/baselines/reference/transpile/Support options with types values.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with types values.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Support options with types values.oldTranspile.errors.txt index 4ea3259d69bd7..dc710829d5256 100644 --- a/tests/baselines/reference/transpile/Support options with types values.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Support options with types values.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports as const arrays.errors.txt b/tests/baselines/reference/transpile/Supports as const arrays.errors.txt index 644b1221ae35e..07ca9ddfed490 100644 --- a/tests/baselines/reference/transpile/Supports as const arrays.errors.txt +++ b/tests/baselines/reference/transpile/Supports as const arrays.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== ([] as const).forEach(k => console.log(k)); \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports as const arrays.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports as const arrays.oldTranspile.errors.txt index 644b1221ae35e..07ca9ddfed490 100644 --- a/tests/baselines/reference/transpile/Supports as const arrays.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports as const arrays.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== ([] as const).forEach(k => console.log(k)); \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports backslashes in file name.errors.txt b/tests/baselines/reference/transpile/Supports backslashes in file name.errors.txt index a776d50210c00..42af06f8d33d1 100644 --- a/tests/baselines/reference/transpile/Supports backslashes in file name.errors.txt +++ b/tests/baselines/reference/transpile/Supports backslashes in file name.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== a\b.ts (0 errors) ==== var x \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports backslashes in file name.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports backslashes in file name.oldTranspile.errors.txt index a776d50210c00..42af06f8d33d1 100644 --- a/tests/baselines/reference/transpile/Supports backslashes in file name.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports backslashes in file name.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== a\b.ts (0 errors) ==== var x \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports readonly keyword for arrays.errors.txt b/tests/baselines/reference/transpile/Supports readonly keyword for arrays.errors.txt index c9e88c7beb3b6..36495a53372d3 100644 --- a/tests/baselines/reference/transpile/Supports readonly keyword for arrays.errors.txt +++ b/tests/baselines/reference/transpile/Supports readonly keyword for arrays.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== let x: readonly string[]; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports readonly keyword for arrays.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports readonly keyword for arrays.oldTranspile.errors.txt index c9e88c7beb3b6..36495a53372d3 100644 --- a/tests/baselines/reference/transpile/Supports readonly keyword for arrays.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports readonly keyword for arrays.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== let x: readonly string[]; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowJs.errors.txt b/tests/baselines/reference/transpile/Supports setting allowJs.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting allowJs.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting allowJs.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowJs.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting allowJs.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting allowJs.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting allowJs.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports.errors.txt b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnreachableCode.errors.txt b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting allowUnreachableCode.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnreachableCode.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting allowUnreachableCode.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnusedLabels.errors.txt b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting allowUnusedLabels.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnusedLabels.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting allowUnusedLabels.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting alwaysStrict.errors.txt b/tests/baselines/reference/transpile/Supports setting alwaysStrict.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting alwaysStrict.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting alwaysStrict.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting alwaysStrict.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting alwaysStrict.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting alwaysStrict.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting alwaysStrict.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting baseUrl.errors.txt b/tests/baselines/reference/transpile/Supports setting baseUrl.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting baseUrl.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting baseUrl.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting baseUrl.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting baseUrl.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting baseUrl.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting baseUrl.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting charset.errors.txt b/tests/baselines/reference/transpile/Supports setting charset.errors.txt index 4e134f442adea..d0357734678dd 100644 --- a/tests/baselines/reference/transpile/Supports setting charset.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting charset.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting charset.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting charset.oldTranspile.errors.txt index 4e134f442adea..d0357734678dd 100644 --- a/tests/baselines/reference/transpile/Supports setting charset.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting charset.oldTranspile.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting composite.errors.txt b/tests/baselines/reference/transpile/Supports setting composite.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting composite.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting composite.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting composite.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting composite.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting composite.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting composite.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declaration.errors.txt b/tests/baselines/reference/transpile/Supports setting declaration.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting declaration.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting declaration.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declaration.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting declaration.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting declaration.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting declaration.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declarationDir.errors.txt b/tests/baselines/reference/transpile/Supports setting declarationDir.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting declarationDir.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting declarationDir.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declarationDir.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting declarationDir.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting declarationDir.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting declarationDir.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitBOM.errors.txt b/tests/baselines/reference/transpile/Supports setting emitBOM.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting emitBOM.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting emitBOM.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitBOM.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting emitBOM.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting emitBOM.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting emitBOM.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata.errors.txt b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting experimentalDecorators.errors.txt b/tests/baselines/reference/transpile/Supports setting experimentalDecorators.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting experimentalDecorators.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting experimentalDecorators.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting experimentalDecorators.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting experimentalDecorators.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting experimentalDecorators.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting experimentalDecorators.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames.errors.txt b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting incremental.errors.txt b/tests/baselines/reference/transpile/Supports setting incremental.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting incremental.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting incremental.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting incremental.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting incremental.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting incremental.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting incremental.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting isolatedModules.errors.txt b/tests/baselines/reference/transpile/Supports setting isolatedModules.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting isolatedModules.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting isolatedModules.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting isolatedModules.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting isolatedModules.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting isolatedModules.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting isolatedModules.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsx.errors.txt b/tests/baselines/reference/transpile/Supports setting jsx.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting jsx.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting jsx.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsx.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting jsx.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting jsx.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting jsx.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFactory.errors.txt b/tests/baselines/reference/transpile/Supports setting jsxFactory.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting jsxFactory.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting jsxFactory.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFactory.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting jsxFactory.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting jsxFactory.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting jsxFactory.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.errors.txt b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting lib.errors.txt b/tests/baselines/reference/transpile/Supports setting lib.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting lib.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting lib.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting lib.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting lib.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting lib.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting lib.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting locale.errors.txt b/tests/baselines/reference/transpile/Supports setting locale.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting locale.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting locale.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting locale.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting locale.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting locale.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting locale.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting module.errors.txt b/tests/baselines/reference/transpile/Supports setting module.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting module.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting module.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting module.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting module.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting module.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting module.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting moduleResolution.errors.txt b/tests/baselines/reference/transpile/Supports setting moduleResolution.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting moduleResolution.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting moduleResolution.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting moduleResolution.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting moduleResolution.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting moduleResolution.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting moduleResolution.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting newLine.errors.txt b/tests/baselines/reference/transpile/Supports setting newLine.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting newLine.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting newLine.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting newLine.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting newLine.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting newLine.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting newLine.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmit.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmit.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noEmit.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noEmit.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmit.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmit.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noEmit.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noEmit.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitHelpers.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmitHelpers.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noEmitHelpers.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noEmitHelpers.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitHelpers.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmitHelpers.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noEmitHelpers.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noEmitHelpers.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitOnError.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmitOnError.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noEmitOnError.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noEmitOnError.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitOnError.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmitOnError.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noEmitOnError.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noEmitOnError.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noErrorTruncation.errors.txt b/tests/baselines/reference/transpile/Supports setting noErrorTruncation.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noErrorTruncation.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noErrorTruncation.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noErrorTruncation.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noErrorTruncation.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noErrorTruncation.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noErrorTruncation.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch.errors.txt b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitAny.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitAny.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noImplicitAny.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noImplicitAny.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitAny.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitAny.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noImplicitAny.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noImplicitAny.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitReturns.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitReturns.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noImplicitReturns.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noImplicitReturns.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitReturns.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitReturns.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noImplicitReturns.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noImplicitReturns.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitThis.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitThis.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noImplicitThis.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noImplicitThis.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitThis.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitThis.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noImplicitThis.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noImplicitThis.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict.errors.txt index a77880cac0fdd..d018d9ffb97c7 100644 --- a/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict.oldTranspile.errors.txt index a77880cac0fdd..d018d9ffb97c7 100644 --- a/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict.oldTranspile.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noLib.errors.txt b/tests/baselines/reference/transpile/Supports setting noLib.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noLib.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noLib.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noLib.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noLib.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noLib.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noLib.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noResolve.errors.txt b/tests/baselines/reference/transpile/Supports setting noResolve.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noResolve.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noResolve.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noResolve.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noResolve.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting noResolve.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting noResolve.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting out.errors.txt b/tests/baselines/reference/transpile/Supports setting out.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting out.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting out.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting out.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting out.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting out.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting out.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outDir.errors.txt b/tests/baselines/reference/transpile/Supports setting outDir.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting outDir.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting outDir.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outDir.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting outDir.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting outDir.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting outDir.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outFile.errors.txt b/tests/baselines/reference/transpile/Supports setting outFile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting outFile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting outFile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outFile.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting outFile.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting outFile.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting outFile.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting paths.errors.txt b/tests/baselines/reference/transpile/Supports setting paths.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting paths.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting paths.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting paths.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting paths.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting paths.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting paths.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting preserveConstEnums.errors.txt b/tests/baselines/reference/transpile/Supports setting preserveConstEnums.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting preserveConstEnums.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting preserveConstEnums.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting preserveConstEnums.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting preserveConstEnums.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting preserveConstEnums.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting preserveConstEnums.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting reactNamespace.errors.txt b/tests/baselines/reference/transpile/Supports setting reactNamespace.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting reactNamespace.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting reactNamespace.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting reactNamespace.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting reactNamespace.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting reactNamespace.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting reactNamespace.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting removeComments.errors.txt b/tests/baselines/reference/transpile/Supports setting removeComments.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting removeComments.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting removeComments.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting removeComments.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting removeComments.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting removeComments.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting removeComments.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDir.errors.txt b/tests/baselines/reference/transpile/Supports setting rootDir.errors.txt index f97a5251277a1..aabde4cab2729 100644 --- a/tests/baselines/reference/transpile/Supports setting rootDir.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting rootDir.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== ./rootDir/input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDir.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting rootDir.oldTranspile.errors.txt index f97a5251277a1..aabde4cab2729 100644 --- a/tests/baselines/reference/transpile/Supports setting rootDir.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting rootDir.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== ./rootDir/input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDirs.errors.txt b/tests/baselines/reference/transpile/Supports setting rootDirs.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting rootDirs.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting rootDirs.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDirs.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting rootDirs.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting rootDirs.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting rootDirs.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck.errors.txt b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipLibCheck.errors.txt b/tests/baselines/reference/transpile/Supports setting skipLibCheck.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting skipLibCheck.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting skipLibCheck.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipLibCheck.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting skipLibCheck.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting skipLibCheck.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting skipLibCheck.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting strictNullChecks.errors.txt b/tests/baselines/reference/transpile/Supports setting strictNullChecks.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting strictNullChecks.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting strictNullChecks.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting strictNullChecks.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting strictNullChecks.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting strictNullChecks.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting strictNullChecks.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting stripInternal.errors.txt b/tests/baselines/reference/transpile/Supports setting stripInternal.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting stripInternal.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting stripInternal.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting stripInternal.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting stripInternal.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting stripInternal.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting stripInternal.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors.errors.txt b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors.errors.txt index a10da5dbc090f..a33a5c24a1bcd 100644 --- a/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors.oldTranspile.errors.txt index a10da5dbc090f..a33a5c24a1bcd 100644 --- a/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors.oldTranspile.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors.errors.txt b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors.errors.txt index c980445b64b00..f9ea56e463d40 100644 --- a/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors.oldTranspile.errors.txt index c980445b64b00..f9ea56e463d40 100644 --- a/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors.oldTranspile.errors.txt @@ -1,8 +1,8 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting tsbuildinfo.errors.txt b/tests/baselines/reference/transpile/Supports setting tsbuildinfo.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting tsbuildinfo.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting tsbuildinfo.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting tsbuildinfo.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting tsbuildinfo.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting tsbuildinfo.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting tsbuildinfo.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting typeRoots.errors.txt b/tests/baselines/reference/transpile/Supports setting typeRoots.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting typeRoots.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting typeRoots.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting typeRoots.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting typeRoots.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting typeRoots.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting typeRoots.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting types.errors.txt b/tests/baselines/reference/transpile/Supports setting types.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting types.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting types.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting types.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting types.oldTranspile.errors.txt index 66bb42584d88b..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Supports setting types.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports setting types.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports urls in file name.errors.txt b/tests/baselines/reference/transpile/Supports urls in file name.errors.txt index cf788253f5a7e..25e154f9af082 100644 --- a/tests/baselines/reference/transpile/Supports urls in file name.errors.txt +++ b/tests/baselines/reference/transpile/Supports urls in file name.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== http://somewhere/directory//directory2/file.ts (0 errors) ==== var x \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports urls in file name.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports urls in file name.oldTranspile.errors.txt index cf788253f5a7e..25e154f9af082 100644 --- a/tests/baselines/reference/transpile/Supports urls in file name.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Supports urls in file name.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== http://somewhere/directory//directory2/file.ts (0 errors) ==== var x \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Uses correct newLine character.errors.txt b/tests/baselines/reference/transpile/Uses correct newLine character.errors.txt index fef912219ef6c..5b06d0efa56ec 100644 --- a/tests/baselines/reference/transpile/Uses correct newLine character.errors.txt +++ b/tests/baselines/reference/transpile/Uses correct newLine character.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Uses correct newLine character.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Uses correct newLine character.oldTranspile.errors.txt index fef912219ef6c..5b06d0efa56ec 100644 --- a/tests/baselines/reference/transpile/Uses correct newLine character.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Uses correct newLine character.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.ts (0 errors) ==== var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/transpile .js files.errors.txt b/tests/baselines/reference/transpile/transpile .js files.errors.txt index 4ea3259d69bd7..dc710829d5256 100644 --- a/tests/baselines/reference/transpile/transpile .js files.errors.txt +++ b/tests/baselines/reference/transpile/transpile .js files.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/transpile .js files.oldTranspile.errors.txt b/tests/baselines/reference/transpile/transpile .js files.oldTranspile.errors.txt index 4ea3259d69bd7..dc710829d5256 100644 --- a/tests/baselines/reference/transpile/transpile .js files.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/transpile .js files.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/transpile file as tsx if jsx is specified.errors.txt b/tests/baselines/reference/transpile/transpile file as tsx if jsx is specified.errors.txt index 3af45aefbbd96..391f2a206dc69 100644 --- a/tests/baselines/reference/transpile/transpile file as tsx if jsx is specified.errors.txt +++ b/tests/baselines/reference/transpile/transpile file as tsx if jsx is specified.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.tsx (0 errors) ==== var x =
\ No newline at end of file diff --git a/tests/baselines/reference/transpile/transpile file as tsx if jsx is specified.oldTranspile.errors.txt b/tests/baselines/reference/transpile/transpile file as tsx if jsx is specified.oldTranspile.errors.txt index 3af45aefbbd96..391f2a206dc69 100644 --- a/tests/baselines/reference/transpile/transpile file as tsx if jsx is specified.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/transpile file as tsx if jsx is specified.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== file.tsx (0 errors) ==== var x =
\ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js index 1d60459c56461..b169015e317bf 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js @@ -82,7 +82,7 @@ Output:: [12:00:19 AM] Building project '/src/app/tsconfig.json'... -src/app/tsconfig.json:14:9 - error TS5101: Flag 'prepend' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +src/app/tsconfig.json:14:9 - error TS5101: Option 'prepend' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. 14 { "path": "../lib", "prepend": true }    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -500,7 +500,7 @@ Output:: [12:00:34 AM] Building project '/src/app/tsconfig.json'... -src/app/tsconfig.json:14:9 - error TS5101: Flag 'prepend' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +src/app/tsconfig.json:14:9 - error TS5101: Option 'prepend' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. 14 { "path": "../lib", "prepend": true }    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js b/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js index fef3b35abf3a7..2836e021ed9e3 100644 --- a/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js +++ b/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js @@ -714,7 +714,7 @@ Output:: [12:01:03 AM] Building project '/src/tests/tsconfig.json'... -src/tests/tsconfig.json:8:38 - error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +src/tests/tsconfig.json:8:38 - error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. 8 "composite": true, "target": "es3",    ~~~~~ diff --git a/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js index 1c1d0824e7968..aed1167adeb89 100644 --- a/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js @@ -131,7 +131,7 @@ Output:: [12:00:29 AM] Building project '/src/tests/tsconfig.json'... -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Found 1 error. diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js index d8c6b04f4232e..7f5a53f4b2407 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js @@ -27,7 +27,8 @@ Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... -a/tsconfig.json:1:21 - error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +a/tsconfig.json:1:21 - error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. 1 {"compilerOptions":{"out":"/a/out.js"}}    ~~~~~ @@ -85,7 +86,8 @@ Output:: >> Screen clear [12:00:22 AM] File change detected. Starting incremental compilation... -a/tsconfig.json:1:21 - error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +a/tsconfig.json:1:21 - error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. 1 {"compilerOptions":{"out":"/a/out.js"}}    ~~~~~ @@ -143,7 +145,8 @@ Output:: >> Screen clear [12:00:30 AM] File change detected. Starting incremental compilation... -a/tsconfig.json:1:21 - error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +a/tsconfig.json:1:21 - error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. 1 {"compilerOptions":{"out":"/a/out.js"}}    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js index 39887a751498c..d9f3bce5a1cfa 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js @@ -31,7 +31,7 @@ Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... -tsconfig.json:1:36 - error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +tsconfig.json:1:36 - error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. 1 {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error"}} @@ -149,7 +149,7 @@ Output:: >> Screen clear [12:00:23 AM] File change detected. Starting incremental compilation... -tsconfig.json:1:36 - error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +tsconfig.json:1:36 - error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. 1 {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error","experimentalDecorators":true}} @@ -219,7 +219,7 @@ Output:: >> Screen clear [12:00:33 AM] File change detected. Starting incremental compilation... -tsconfig.json:1:36 - error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +tsconfig.json:1:36 - error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. 1 {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error","experimentalDecorators":true,"emitDecoratorMetadata":true}} diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js index c4b8e5933792c..2e4051f6d1d00 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js @@ -155,7 +155,7 @@ Output:: >> Screen clear [12:00:43 AM] File change detected. Starting incremental compilation... -tsconfig.json:1:21 - error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +tsconfig.json:1:21 - error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. 1 {"compilerOptions":{"importsNotUsedAsValues":"error"}} @@ -219,7 +219,7 @@ Output:: >> Screen clear [12:00:54 AM] File change detected. Starting incremental compilation... -tsconfig.json:1:21 - error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +tsconfig.json:1:21 - error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. 1 {"compilerOptions":{"importsNotUsedAsValues":"preserve"}} diff --git a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js index 9e9c3d65930b0..3fcb4cda6a4b5 100644 --- a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js +++ b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js @@ -1315,6 +1315,8 @@ Info 32 [00:01:13.000] response: "5103", "5104", "5105", + "5107", + "5108", "6044", "6045", "6046", diff --git a/tests/baselines/reference/typeFromPropertyAssignmentOutOfOrder.errors.txt b/tests/baselines/reference/typeFromPropertyAssignmentOutOfOrder.errors.txt index 18364bc5a364b..f1a58b7b28448 100644 --- a/tests/baselines/reference/typeFromPropertyAssignmentOutOfOrder.errors.txt +++ b/tests/baselines/reference/typeFromPropertyAssignmentOutOfOrder.errors.txt @@ -1,7 +1,7 @@ -error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== tests/cases/conformance/salsa/index.js (0 errors) ==== First.Item = class I {} Common.Object = class extends First.Item {} diff --git a/tests/baselines/reference/typeReferenceDirectives11.errors.txt b/tests/baselines/reference/typeReferenceDirectives11.errors.txt index f10523aa85388..97da3c36cb1ef 100644 --- a/tests/baselines/reference/typeReferenceDirectives11.errors.txt +++ b/tests/baselines/reference/typeReferenceDirectives11.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. /mod1.ts(1,17): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== /mod2.ts (0 errors) ==== import {foo} from "./mod1"; export const bar = foo(); diff --git a/tests/baselines/reference/typeReferenceDirectives12.errors.txt b/tests/baselines/reference/typeReferenceDirectives12.errors.txt index 1a90109550600..2676fd49f18b5 100644 --- a/tests/baselines/reference/typeReferenceDirectives12.errors.txt +++ b/tests/baselines/reference/typeReferenceDirectives12.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. /main.ts(1,14): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== /mod2.ts (0 errors) ==== import { Cls } from "./main"; import "./mod1"; diff --git a/tests/baselines/reference/typeSatisfaction_js.errors.txt b/tests/baselines/reference/typeSatisfaction_js.errors.txt index a6650964d1cf5..650f5beca5dd9 100644 --- a/tests/baselines/reference/typeSatisfaction_js.errors.txt +++ b/tests/baselines/reference/typeSatisfaction_js.errors.txt @@ -1,8 +1,10 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. /src/a.js(1,29): error TS8037: Type satisfaction expressions can only be used in TypeScript files. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== /src/a.js (1 errors) ==== var v = undefined satisfies 1; ~ diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.errors.txt b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.errors.txt index 91d21a14fa139..45fbb76413bb0 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.errors.txt +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.errors.txt @@ -1,7 +1,9 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJs.js (0 errors) ==== // classes class C { diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.errors.txt b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.errors.txt index 6984785dec83f..6c4b4fa645228 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.errors.txt +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.errors.txt @@ -1,9 +1,11 @@ -error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + Use 'outFile' instead. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJsErrors.js(5,12): error TS1331: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJsErrors.js(14,12): error TS1331: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. -!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Use 'outFile' instead. ==== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJsErrors.js (2 errors) ==== class C { /** diff --git a/tests/baselines/reference/verbatimModuleSyntaxCompat.errors.txt b/tests/baselines/reference/verbatimModuleSyntaxCompat.errors.txt index 329618867938b..e9851f75ee188 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxCompat.errors.txt +++ b/tests/baselines/reference/verbatimModuleSyntaxCompat.errors.txt @@ -1,7 +1,7 @@ error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. @@ -10,9 +10,9 @@ error TS5105: Option 'verbatimModuleSyntax' cannot be used when 'module' is set !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -!!! error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. !!! error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. !!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. diff --git a/tests/baselines/reference/verbatimModuleSyntaxCompat2.errors.txt b/tests/baselines/reference/verbatimModuleSyntaxCompat2.errors.txt index 7189d103bebf5..8efe570e1eac1 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxCompat2.errors.txt +++ b/tests/baselines/reference/verbatimModuleSyntaxCompat2.errors.txt @@ -1,9 +1,9 @@ /tsconfig.json(4,9): error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. /tsconfig.json(5,9): error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -/tsconfig.json(5,9): error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/tsconfig.json(5,9): error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. /tsconfig.json(5,9): error TS5104: Option 'preserveValueImports' is redundant and cannot be specified with option 'verbatimModuleSyntax'. -/tsconfig.json(6,9): error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/tsconfig.json(6,9): error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. /tsconfig.json(6,9): error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. @@ -19,13 +19,13 @@ ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS5104: Option 'preserveValueImports' is redundant and cannot be specified with option 'verbatimModuleSyntax'. "importsNotUsedAsValues": "error", ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. diff --git a/tests/baselines/reference/verbatimModuleSyntaxCompat3.errors.txt b/tests/baselines/reference/verbatimModuleSyntaxCompat3.errors.txt index f0fa25c37686c..2a172af4540da 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxCompat3.errors.txt +++ b/tests/baselines/reference/verbatimModuleSyntaxCompat3.errors.txt @@ -1,14 +1,14 @@ error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. -error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -!!! error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ==== /tsconfig.json (0 errors) ==== { diff --git a/tests/baselines/reference/verbatimModuleSyntaxCompat4.errors.txt b/tests/baselines/reference/verbatimModuleSyntaxCompat4.errors.txt index 4eba24032042a..cca2512076220 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxCompat4.errors.txt +++ b/tests/baselines/reference/verbatimModuleSyntaxCompat4.errors.txt @@ -1,9 +1,9 @@ /tsconfig.json(4,9): error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. /tsconfig.json(5,9): error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. -/tsconfig.json(5,9): error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/tsconfig.json(5,9): error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. /tsconfig.json(5,9): error TS5104: Option 'preserveValueImports' is redundant and cannot be specified with option 'verbatimModuleSyntax'. -/tsconfig.json(6,9): error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +/tsconfig.json(6,9): error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. /tsconfig.json(6,9): error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. @@ -19,13 +19,13 @@ ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS5104: Option 'preserveValueImports' is redundant and cannot be specified with option 'verbatimModuleSyntax'. "importsNotUsedAsValues": "error", ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS5101: Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. diff --git a/tests/cases/compiler/deprecatedCompilerOptions6.ts b/tests/cases/compiler/deprecatedCompilerOptions6.ts new file mode 100644 index 0000000000000..466d9677e7abc --- /dev/null +++ b/tests/cases/compiler/deprecatedCompilerOptions6.ts @@ -0,0 +1,19 @@ +// @typeScriptVersion: 5.0 +// @filename: /foo/tsconfig.json +{ + "compilerOptions": { + "module": "amd", + "target": "ES3", + "noImplicitUseStrict": true, + "keyofStringsOnly": true, + "suppressExcessPropertyErrors": true, + "suppressImplicitAnyIndexErrors": true, + "noStrictGenericChecks": true, + "charset": "utf8", + "out": "dist.js", + "ignoreDeprecations": "5.1" + } +} + +// @filename: /foo/a.ts +const a = 1; From a5484aebf87cfe2d51747d77fcde780111c8556c Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 10 Mar 2023 15:53:10 -0800 Subject: [PATCH 10/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53139=20(Make?= =?UTF-8?q?=20ModuleResolutionKind.Node10=20ch...)=20into=20release-5.0=20?= =?UTF-8?q?(#53143)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrew Branch --- src/compiler/types.ts | 8 +++++++- tests/baselines/reference/api/tsserverlibrary.d.ts | 6 ++++++ tests/baselines/reference/api/typescript.d.ts | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4b4e79616c3cc..881f3576868cd 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6914,6 +6914,12 @@ export function diagnosticCategoryName(d: { category: DiagnosticCategory }, lowe export enum ModuleResolutionKind { Classic = 1, + /** + * @deprecated + * `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets. + * Use the new name or consider switching to a modern module resolution target. + */ + NodeJs = 2, Node10 = 2, // Starting with node12, node's module resolver has significant departures from traditional cjs resolution // to better support ecmascript modules and their use within node - however more features are still being added. @@ -6922,7 +6928,7 @@ export enum ModuleResolutionKind { // In turn, we offer both a `NodeNext` moving resolution target, and a `Node16` version-anchored resolution target Node16 = 3, NodeNext = 99, // Not simply `Node16` so that compiled code linked against TS can use the `Next` value reliably (same as with `ModuleKind`) - Bundler = 100, + Bundler = 100, } export enum ModuleDetectionKind { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 34006d63b2ea5..f23fc06fcc24a 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -6991,6 +6991,12 @@ declare namespace ts { } enum ModuleResolutionKind { Classic = 1, + /** + * @deprecated + * `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets. + * Use the new name or consider switching to a modern module resolution target. + */ + NodeJs = 2, Node10 = 2, Node16 = 3, NodeNext = 99, diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 2201712f7c4eb..4b06d971712f5 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3016,6 +3016,12 @@ declare namespace ts { } enum ModuleResolutionKind { Classic = 1, + /** + * @deprecated + * `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets. + * Use the new name or consider switching to a modern module resolution target. + */ + NodeJs = 2, Node10 = 2, Node16 = 3, NodeNext = 99, From 9a8badd238a12db762c6f332fe41092521866bb2 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sat, 11 Mar 2023 00:09:47 +0000 Subject: [PATCH 11/35] Bump version to 5.0.2 and LKG --- lib/tsc.js | 259 ++++++++-------- lib/tsserver.js | 590 ++++++++++++++++++++---------------- lib/tsserverlibrary.d.ts | 6 + lib/tsserverlibrary.js | 591 +++++++++++++++++++++---------------- lib/typescript.d.ts | 6 + lib/typescript.js | 590 ++++++++++++++++++++---------------- lib/typingsInstaller.js | 9 +- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 9 files changed, 1147 insertions(+), 908 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 92bf3cf998750..455e89ea50ece 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -23,7 +23,7 @@ var __export = (target, all) => { // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.1-rc`; +var version = "5.0.2"; // src/compiler/core.ts var emptyArray = []; @@ -3854,6 +3854,7 @@ function diagnosticCategoryName(d, lowerCase = true) { } var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => { ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic"; + ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs"; ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10"; ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16"; ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext"; @@ -6894,12 +6895,14 @@ var Diagnostics = { Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), - Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), + Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), + Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), + Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`), + Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -58167,6 +58170,9 @@ function createTypeChecker(host) { function isTypeSubtypeOf(source, target) { return isTypeRelatedTo(source, target, subtypeRelation); } + function isTypeStrictSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, strictSubtypeRelation); + } function isTypeAssignableTo(source, target) { return isTypeRelatedTo(source, target, assignableRelation); } @@ -60075,7 +60081,7 @@ function createTypeChecker(host) { 0 /* None */ ); } - } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { + } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { result2 &= propertiesRelatedTo( source2, target2, @@ -65262,7 +65268,7 @@ function createTypeChecker(host) { const narrowedType = mapType(candidate, (c) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -112911,6 +112917,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion2 } = createProgramOptions; let { oldProgram } = createProgramOptions; + const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations)); let processingDefaultLibFiles; let processingOtherFiles; let files; @@ -115337,127 +115344,131 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } } - function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) { - const version2 = typeScriptVersion2 || versionMajorMinor; + function getIgnoreDeprecationsVersion() { const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { - if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) { - return; - } else if (reportInvalidIgnoreDeprecations) { - createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); - } + if (ignoreDeprecations === "5.0") { + return new Version(ignoreDeprecations); + } + reportInvalidIgnoreDeprecations(); + } + return Version.zero; + } + function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) { + const deprecatedInVersion = new Version(deprecatedIn); + const removedInVersion = new Version(removedIn); + const typescriptVersion = new Version(typeScriptVersion2 || versionMajorMinor); + const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion(); + const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */); + const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */; + if (mustBeRemoved || canBeSilenced) { + fn((name, value, useInstead) => { + if (mustBeRemoved) { + if (value === void 0) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name); + } else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value); + } + } else { + if (value === void 0) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn); + } else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn); + } + } + }); } - return version2; } function verifyDeprecatedCompilerOptions() { - const version2 = getVersionForDeprecationDiagnostics( - /*reportInvalidIgnoreDeprecations*/ - true - ); - if (!version2) - return; - if (options.target === 0 /* ES3 */) { - createDeprecatedDiagnosticForOption(version2, "target", "ES3"); - } - if (options.noImplicitUseStrict) { - createDeprecatedDiagnosticForOption(version2, "noImplicitUseStrict"); - } - if (options.keyofStringsOnly) { - createDeprecatedDiagnosticForOption(version2, "keyofStringsOnly"); - } - if (options.suppressExcessPropertyErrors) { - createDeprecatedDiagnosticForOption(version2, "suppressExcessPropertyErrors"); - } - if (options.suppressImplicitAnyIndexErrors) { - createDeprecatedDiagnosticForOption(version2, "suppressImplicitAnyIndexErrors"); - } - if (options.noStrictGenericChecks) { - createDeprecatedDiagnosticForOption(version2, "noStrictGenericChecks"); - } - if (options.charset) { - createDeprecatedDiagnosticForOption(version2, "charset"); - } - if (options.out) { - createDeprecatedDiagnosticForOption(version2, "out"); - } - if (options.importsNotUsedAsValues) { - createDeprecatedDiagnosticForOption( - version2, - "importsNotUsedAsValues", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - if (options.preserveValueImports) { - createDeprecatedDiagnosticForOption( - version2, - "preserveValueImports", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - } - function verifyDeprecatedProjectReference(ref, parentFile, index) { - if (ref.prepend) { - const version2 = getVersionForDeprecationDiagnostics( - /*reportInvalidIgnoreDeprecations*/ - false - ); - if (version2) { - createDeprecatedOptionForVersionDiagnostic( - version2, - (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), - "prepend" + function createDiagnostic(name, value, useInstead, message, arg0, arg1, arg2, arg3) { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2, arg3); + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + chain + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + message, + arg0, + arg1, + arg2, + arg3 ); } } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (options.target === 0 /* ES3 */) { + createDeprecatedDiagnostic("target", "ES3"); + } + if (options.noImplicitUseStrict) { + createDeprecatedDiagnostic("noImplicitUseStrict"); + } + if (options.keyofStringsOnly) { + createDeprecatedDiagnostic("keyofStringsOnly"); + } + if (options.suppressExcessPropertyErrors) { + createDeprecatedDiagnostic("suppressExcessPropertyErrors"); + } + if (options.suppressImplicitAnyIndexErrors) { + createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors"); + } + if (options.noStrictGenericChecks) { + createDeprecatedDiagnostic("noStrictGenericChecks"); + } + if (options.charset) { + createDeprecatedDiagnostic("charset"); + } + if (options.out) { + createDeprecatedDiagnostic( + "out", + /*value*/ + void 0, + "outFile" + ); + } + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnostic( + "importsNotUsedAsValues", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + if (options.preserveValueImports) { + createDeprecatedDiagnostic( + "preserveValueImports", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + }); } - function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) { - return createDeprecatedOptionForVersionDiagnostic( - version2, - (message, arg0, arg1, arg2) => { - if (useInstead) { - const details = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Use_0_instead, - useInstead - ); - const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - chain - ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - message, - arg0, - arg1, - arg2 - ); - } - }, - name, - value - ); - } - function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) { - if (version2 === "6.0" /* v6_0 */) { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); - } else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + function verifyDeprecatedProjectReference(ref, parentFile, index) { + function createDiagnostic(_name, _value, _useInstead, message, arg0, arg1, arg2, arg3) { + createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2, arg3); } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (ref.prepend) { + createDeprecatedDiagnostic("prepend"); + } + }); } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { var _a3; @@ -115710,25 +115721,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config arg1 ); } - function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) { + function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2, arg3) { const referencesSyntax = firstDefined( getTsConfigPropArray(sourceFile || options.configFile, "references"), (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 ); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2, arg3)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } - function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { + function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2, arg3) { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); - const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); + const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2, arg3); if (needCompilerDiagnostic) { if ("messageText" in message) { programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } } @@ -115747,13 +115758,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } return _compilerOptionsObjectLiteralSyntax || void 0; } - function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2, arg3) { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { if ("messageText" in message) { programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); } else { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2, arg3)); } } return !!props.length; diff --git a/lib/tsserver.js b/lib/tsserver.js index 20cb517f86aaa..31ae89cd7fee9 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -62,7 +62,6 @@ __export(server_exports, { ContextFlags: () => ContextFlags, CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter, Debug: () => Debug, - DeprecationVersion: () => DeprecationVersion, DiagnosticCategory: () => DiagnosticCategory, Diagnostics: () => Diagnostics, DocumentHighlights: () => DocumentHighlights, @@ -2288,7 +2287,7 @@ module.exports = __toCommonJS(server_exports); // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.1-rc`; +var version = "5.0.2"; var Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -6885,6 +6884,7 @@ function diagnosticCategoryName(d, lowerCase = true) { } var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind3) => { ModuleResolutionKind3[ModuleResolutionKind3["Classic"] = 1] = "Classic"; + ModuleResolutionKind3[ModuleResolutionKind3["NodeJs"] = 2] = "NodeJs"; ModuleResolutionKind3[ModuleResolutionKind3["Node10"] = 2] = "Node10"; ModuleResolutionKind3[ModuleResolutionKind3["Node16"] = 3] = "Node16"; ModuleResolutionKind3[ModuleResolutionKind3["NodeNext"] = 99] = "NodeNext"; @@ -7449,12 +7449,6 @@ var commentPragmas = { kind: 4 /* MultiLine */ } }; -var DeprecationVersion = /* @__PURE__ */ ((DeprecationVersion2) => { - DeprecationVersion2["v5_0"] = "5.0"; - DeprecationVersion2["v5_5"] = "5.5"; - DeprecationVersion2["v6_0"] = "6.0"; - return DeprecationVersion2; -})(DeprecationVersion || {}); // src/compiler/sys.ts function generateDjb2Hash(data) { @@ -10358,12 +10352,14 @@ var Diagnostics = { Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), - Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), + Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), + Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), + Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`), + Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -62774,6 +62770,9 @@ function createTypeChecker(host) { function isTypeSubtypeOf(source, target) { return isTypeRelatedTo(source, target, subtypeRelation); } + function isTypeStrictSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, strictSubtypeRelation); + } function isTypeAssignableTo(source, target) { return isTypeRelatedTo(source, target, assignableRelation); } @@ -64682,7 +64681,7 @@ function createTypeChecker(host) { 0 /* None */ ); } - } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { + } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { result2 &= propertiesRelatedTo( source2, target2, @@ -69869,7 +69868,7 @@ function createTypeChecker(host) { const narrowedType = mapType(candidate, (c) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -117754,6 +117753,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions; let { oldProgram } = createProgramOptions; + const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations)); let processingDefaultLibFiles; let processingOtherFiles; let files; @@ -120180,127 +120180,131 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } } } - function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) { - const version2 = typeScriptVersion3 || versionMajorMinor; + function getIgnoreDeprecationsVersion() { const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { - if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) { - return; - } else if (reportInvalidIgnoreDeprecations) { - createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); - } + if (ignoreDeprecations === "5.0") { + return new Version(ignoreDeprecations); + } + reportInvalidIgnoreDeprecations(); + } + return Version.zero; + } + function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) { + const deprecatedInVersion = new Version(deprecatedIn); + const removedInVersion = new Version(removedIn); + const typescriptVersion = new Version(typeScriptVersion3 || versionMajorMinor); + const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion(); + const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */); + const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */; + if (mustBeRemoved || canBeSilenced) { + fn((name, value, useInstead) => { + if (mustBeRemoved) { + if (value === void 0) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name); + } else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value); + } + } else { + if (value === void 0) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn); + } else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn); + } + } + }); } - return version2; } function verifyDeprecatedCompilerOptions() { - const version2 = getVersionForDeprecationDiagnostics( - /*reportInvalidIgnoreDeprecations*/ - true - ); - if (!version2) - return; - if (options.target === 0 /* ES3 */) { - createDeprecatedDiagnosticForOption(version2, "target", "ES3"); - } - if (options.noImplicitUseStrict) { - createDeprecatedDiagnosticForOption(version2, "noImplicitUseStrict"); - } - if (options.keyofStringsOnly) { - createDeprecatedDiagnosticForOption(version2, "keyofStringsOnly"); - } - if (options.suppressExcessPropertyErrors) { - createDeprecatedDiagnosticForOption(version2, "suppressExcessPropertyErrors"); - } - if (options.suppressImplicitAnyIndexErrors) { - createDeprecatedDiagnosticForOption(version2, "suppressImplicitAnyIndexErrors"); - } - if (options.noStrictGenericChecks) { - createDeprecatedDiagnosticForOption(version2, "noStrictGenericChecks"); - } - if (options.charset) { - createDeprecatedDiagnosticForOption(version2, "charset"); - } - if (options.out) { - createDeprecatedDiagnosticForOption(version2, "out"); - } - if (options.importsNotUsedAsValues) { - createDeprecatedDiagnosticForOption( - version2, - "importsNotUsedAsValues", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - if (options.preserveValueImports) { - createDeprecatedDiagnosticForOption( - version2, - "preserveValueImports", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - } - function verifyDeprecatedProjectReference(ref, parentFile, index) { - if (ref.prepend) { - const version2 = getVersionForDeprecationDiagnostics( - /*reportInvalidIgnoreDeprecations*/ - false - ); - if (version2) { - createDeprecatedOptionForVersionDiagnostic( - version2, - (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), - "prepend" + function createDiagnostic(name, value, useInstead, message, arg0, arg1, arg2, arg3) { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2, arg3); + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + chain + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + message, + arg0, + arg1, + arg2, + arg3 ); } } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (options.target === 0 /* ES3 */) { + createDeprecatedDiagnostic("target", "ES3"); + } + if (options.noImplicitUseStrict) { + createDeprecatedDiagnostic("noImplicitUseStrict"); + } + if (options.keyofStringsOnly) { + createDeprecatedDiagnostic("keyofStringsOnly"); + } + if (options.suppressExcessPropertyErrors) { + createDeprecatedDiagnostic("suppressExcessPropertyErrors"); + } + if (options.suppressImplicitAnyIndexErrors) { + createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors"); + } + if (options.noStrictGenericChecks) { + createDeprecatedDiagnostic("noStrictGenericChecks"); + } + if (options.charset) { + createDeprecatedDiagnostic("charset"); + } + if (options.out) { + createDeprecatedDiagnostic( + "out", + /*value*/ + void 0, + "outFile" + ); + } + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnostic( + "importsNotUsedAsValues", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + if (options.preserveValueImports) { + createDeprecatedDiagnostic( + "preserveValueImports", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + }); } - function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) { - return createDeprecatedOptionForVersionDiagnostic( - version2, - (message, arg0, arg1, arg2) => { - if (useInstead) { - const details = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Use_0_instead, - useInstead - ); - const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - chain - ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - message, - arg0, - arg1, - arg2 - ); - } - }, - name, - value - ); - } - function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) { - if (version2 === "6.0" /* v6_0 */) { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); - } else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + function verifyDeprecatedProjectReference(ref, parentFile, index) { + function createDiagnostic(_name, _value, _useInstead, message, arg0, arg1, arg2, arg3) { + createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2, arg3); } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (ref.prepend) { + createDeprecatedDiagnostic("prepend"); + } + }); } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { var _a3; @@ -120553,25 +120557,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config arg1 ); } - function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) { + function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2, arg3) { const referencesSyntax = firstDefined( getTsConfigPropArray(sourceFile || options.configFile, "references"), (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 ); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2, arg3)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } - function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { + function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2, arg3) { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); - const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); + const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2, arg3); if (needCompilerDiagnostic) { if ("messageText" in message) { programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } } @@ -120590,13 +120594,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config } return _compilerOptionsObjectLiteralSyntax || void 0; } - function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2, arg3) { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { if ("messageText" in message) { programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); } else { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2, arg3)); } } return !!props.length; @@ -141198,53 +141202,121 @@ function getTypeExportSpecifiers(originExportSpecifier, context) { } // src/services/codefixes/convertToTypeOnlyImport.ts -var errorCodes14 = [Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code]; +var errorCodes14 = [ + Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code, + Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code +]; var fixId13 = "convertToTypeOnlyImport"; registerCodeFix({ errorCodes: errorCodes14, getCodeActions: function getCodeActionsToConvertToTypeOnlyImport(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - const importDeclaration = getImportDeclarationForDiagnosticSpan(context.span, context.sourceFile); - fixSingleImportDeclaration(t, importDeclaration, context); - }); - if (changes.length) { + const declaration = getDeclaration2(context.sourceFile, context.span.start); + if (declaration) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(t, context.sourceFile, declaration)); return [createCodeFixAction(fixId13, changes, Diagnostics.Convert_to_type_only_import, fixId13, Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]; } + return void 0; }, fixIds: [fixId13], getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context) { return codeFixAll(context, errorCodes14, (changes, diag2) => { - const importDeclaration = getImportDeclarationForDiagnosticSpan(diag2, context.sourceFile); - fixSingleImportDeclaration(changes, importDeclaration, context); + const declaration = getDeclaration2(diag2.file, diag2.start); + if (declaration) { + doChange4(changes, diag2.file, declaration); + } }); } }); -function getImportDeclarationForDiagnosticSpan(span, sourceFile) { - return tryCast(getTokenAtPosition(sourceFile, span.start).parent, isImportDeclaration); +function getDeclaration2(sourceFile, pos) { + const { parent: parent2 } = getTokenAtPosition(sourceFile, pos); + return isImportSpecifier(parent2) || isImportDeclaration(parent2) && parent2.importClause ? parent2 : void 0; } -function fixSingleImportDeclaration(changes, importDeclaration, context) { - if (!(importDeclaration == null ? void 0 : importDeclaration.importClause)) { - return; - } - const { importClause } = importDeclaration; - changes.insertText(context.sourceFile, importDeclaration.getStart() + "import".length, " type"); - if (importClause.name && importClause.namedBindings) { - changes.deleteNodeRangeExcludingEnd(context.sourceFile, importClause.name, importDeclaration.importClause.namedBindings); - changes.insertNodeBefore(context.sourceFile, importDeclaration, factory.updateImportDeclaration( - importDeclaration, - /*modifiers*/ - void 0, - factory.createImportClause( - /*isTypeOnly*/ - true, - importClause.name, - /*namedBindings*/ - void 0 - ), - importDeclaration.moduleSpecifier, - /*assertClause*/ - void 0 +function doChange4(changes, sourceFile, declaration) { + if (isImportSpecifier(declaration)) { + changes.replaceNode(sourceFile, declaration, factory.updateImportSpecifier( + declaration, + /*isTypeOnly*/ + true, + declaration.propertyName, + declaration.name )); + } else { + const importClause = declaration.importClause; + if (importClause.name && importClause.namedBindings) { + changes.replaceNodeWithNodes(sourceFile, declaration, [ + factory.createImportDeclaration( + getSynthesizedDeepClones( + declaration.modifiers, + /*includeTrivia*/ + true + ), + factory.createImportClause( + /*isTypeOnly*/ + true, + getSynthesizedDeepClone( + importClause.name, + /*includeTrivia*/ + true + ), + /*namedBindings*/ + void 0 + ), + getSynthesizedDeepClone( + declaration.moduleSpecifier, + /*includeTrivia*/ + true + ), + getSynthesizedDeepClone( + declaration.assertClause, + /*includeTrivia*/ + true + ) + ), + factory.createImportDeclaration( + getSynthesizedDeepClones( + declaration.modifiers, + /*includeTrivia*/ + true + ), + factory.createImportClause( + /*isTypeOnly*/ + true, + /*name*/ + void 0, + getSynthesizedDeepClone( + importClause.namedBindings, + /*includeTrivia*/ + true + ) + ), + getSynthesizedDeepClone( + declaration.moduleSpecifier, + /*includeTrivia*/ + true + ), + getSynthesizedDeepClone( + declaration.assertClause, + /*includeTrivia*/ + true + ) + ) + ]); + } else { + const importDeclaration = factory.updateImportDeclaration( + declaration, + declaration.modifiers, + factory.updateImportClause( + importClause, + /*isTypeOnly*/ + true, + importClause.name, + importClause.namedBindings + ), + declaration.moduleSpecifier, + declaration.assertClause + ); + changes.replaceNode(sourceFile, declaration, importDeclaration); + } } } @@ -141260,14 +141332,14 @@ registerCodeFix({ return void 0; } const { name, constraint } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange5(t, sourceFile, info)); return [createCodeFixAction(fixId14, changes, [Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId14, Diagnostics.Convert_all_type_literals_to_mapped_type)]; }, fixIds: [fixId14], getAllCodeActions: (context) => codeFixAll(context, errorCodes15, (changes, diag2) => { const info = getInfo2(diag2.file, diag2.start); if (info) { - doChange4(changes, diag2.file, info); + doChange5(changes, diag2.file, info); } }) }); @@ -141285,7 +141357,7 @@ function getInfo2(sourceFile, pos) { } return void 0; } -function doChange4(changes, sourceFile, { container, typeNode, constraint, name }) { +function doChange5(changes, sourceFile, { container, typeNode, constraint, name }) { changes.replaceNode(sourceFile, container, factory.createMappedTypeNode( /*readonlyToken*/ void 0, @@ -142878,12 +142950,12 @@ registerCodeFix({ getCodeActions(context) { const { sourceFile, span, preferences } = context; const property = getPropertyAccessExpression(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange5(t, context.sourceFile, property, preferences)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange6(t, context.sourceFile, property, preferences)); return [createCodeFixAction(fixId17, changes, [Diagnostics.Use_element_access_for_0, property.name.text], fixId17, Diagnostics.Use_element_access_for_all_undeclared_properties)]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes20, (changes, diag2) => doChange5(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context.preferences)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes20, (changes, diag2) => doChange6(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context.preferences)) }); -function doChange5(changes, sourceFile, node, preferences) { +function doChange6(changes, sourceFile, node, preferences) { const quotePreference = getQuotePreference(sourceFile, preferences); const argumentsExpression = factory.createStringLiteral(node.name.text, quotePreference === 0 /* Single */); changes.replaceNode( @@ -142905,16 +142977,16 @@ registerCodeFix({ const { sourceFile, program, span } = context; let diagnostic; const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - diagnostic = doChange6(t, sourceFile, span.start, program.getTypeChecker()); + diagnostic = doChange7(t, sourceFile, span.start, program.getTypeChecker()); }); return diagnostic ? [createCodeFixAction(fixId18, changes, diagnostic, fixId18, Diagnostics.Fix_all_implicit_this_errors)] : emptyArray; }, fixIds: [fixId18], getAllCodeActions: (context) => codeFixAll(context, errorCodes21, (changes, diag2) => { - doChange6(changes, diag2.file, diag2.start, context.program.getTypeChecker()); + doChange7(changes, diag2.file, diag2.start, context.program.getTypeChecker()); }) }); -function doChange6(changes, sourceFile, pos, checker) { +function doChange7(changes, sourceFile, pos, checker) { const token = getTokenAtPosition(sourceFile, pos); if (!isThis(token)) return void 0; @@ -142969,7 +143041,7 @@ registerCodeFix({ const info = getInfo4(sourceFile, span.start, program); if (info === void 0) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange7(t, program, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange8(t, program, info)); return [createCodeFixAction(fixId19, changes, [Diagnostics.Export_0_from_module_1, info.exportName.node.text, info.moduleSpecifier], fixId19, Diagnostics.Export_all_referenced_locals)]; }, getAllCodeActions(context) { @@ -143049,7 +143121,7 @@ function getInfo4(sourceFile, pos, program) { } return void 0; } -function doChange7(changes, program, { exportName, node, moduleSourceFile }) { +function doChange8(changes, program, { exportName, node, moduleSourceFile }) { const exportDeclaration = tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly); if (exportDeclaration) { updateExport(changes, program, moduleSourceFile, exportDeclaration, [exportName]); @@ -143143,7 +143215,7 @@ registerCodeFix({ getCodeActions: function getCodeActionsToFixIncorrectNamedTupleSyntax(context) { const { sourceFile, span } = context; const namedTupleMember = getNamedTupleMember(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange8(t, sourceFile, namedTupleMember)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange9(t, sourceFile, namedTupleMember)); return [createCodeFixAction(fixId20, changes, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels, fixId20, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]; }, fixIds: [fixId20] @@ -143152,7 +143224,7 @@ function getNamedTupleMember(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); return findAncestor(token, (t) => t.kind === 199 /* NamedTupleMember */); } -function doChange8(changes, sourceFile, namedTupleMember) { +function doChange9(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { return; } @@ -143207,7 +143279,7 @@ registerCodeFix({ return void 0; const { node, suggestedSymbol } = info; const target = getEmitScriptTarget(context.host.getCompilationSettings()); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange9(t, sourceFile, node, suggestedSymbol, target)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange10(t, sourceFile, node, suggestedSymbol, target)); return [createCodeFixAction("spelling", changes, [Diagnostics.Change_spelling_to_0, symbolName(suggestedSymbol)], fixId21, Diagnostics.Fix_all_detected_spelling_errors)]; }, fixIds: [fixId21], @@ -143215,7 +143287,7 @@ registerCodeFix({ const info = getInfo5(diag2.file, diag2.start, context, diag2.code); const target = getEmitScriptTarget(context.host.getCompilationSettings()); if (info) - doChange9(changes, context.sourceFile, info.node, info.suggestedSymbol, target); + doChange10(changes, context.sourceFile, info.node, info.suggestedSymbol, target); }) }); function getInfo5(sourceFile, pos, context, errorCode) { @@ -143267,7 +143339,7 @@ function getInfo5(sourceFile, pos, context, errorCode) { } return suggestedSymbol === void 0 ? void 0 : { node, suggestedSymbol }; } -function doChange9(changes, sourceFile, node, suggestedSymbol, target) { +function doChange10(changes, sourceFile, node, suggestedSymbol, target) { const suggestion = symbolName(suggestedSymbol); if (!isIdentifierText(suggestion, target) && isPropertyAccessExpression(node.parent)) { const valDecl = suggestedSymbol.valueDeclaration; @@ -144325,7 +144397,7 @@ registerCodeFix({ if (!nodes) return void 0; const { constructor, superCall } = nodes; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange10(t, sourceFile, constructor, superCall)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, sourceFile, constructor, superCall)); return [createCodeFixAction(fixId25, changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId25, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]; }, fixIds: [fixId25], @@ -144338,12 +144410,12 @@ registerCodeFix({ return; const { constructor, superCall } = nodes; if (addToSeen(seenClasses, getNodeId(constructor.parent))) { - doChange10(changes, sourceFile, constructor, superCall); + doChange11(changes, sourceFile, constructor, superCall); } }); } }); -function doChange10(changes, sourceFile, constructor, superCall) { +function doChange11(changes, sourceFile, constructor, superCall) { changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); changes.delete(sourceFile, superCall); } @@ -144367,18 +144439,18 @@ registerCodeFix({ getCodeActions(context) { const { sourceFile, span } = context; const ctr = getNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, sourceFile, ctr)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange12(t, sourceFile, ctr)); return [createCodeFixAction(fixId26, changes, Diagnostics.Add_missing_super_call, fixId26, Diagnostics.Add_all_missing_super_calls)]; }, fixIds: [fixId26], - getAllCodeActions: (context) => codeFixAll(context, errorCodes31, (changes, diag2) => doChange11(changes, context.sourceFile, getNode(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes31, (changes, diag2) => doChange12(changes, context.sourceFile, getNode(diag2.file, diag2.start))) }); function getNode(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); Debug.assert(isConstructorDeclaration(token.parent), "token should be at the constructor declaration"); return token.parent; } -function doChange11(changes, sourceFile, ctr) { +function doChange12(changes, sourceFile, ctr) { const superCall = factory.createExpressionStatement(factory.createCallExpression( factory.createSuper(), /*typeArguments*/ @@ -144401,7 +144473,7 @@ registerCodeFix({ } const changes = ts_textChanges_exports.ChangeTracker.with( context, - (changeTracker) => doChange12(changeTracker, configFile) + (changeTracker) => doChange13(changeTracker, configFile) ); return [ createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) @@ -144413,10 +144485,10 @@ registerCodeFix({ if (configFile === void 0) { return void 0; } - doChange12(changes, configFile); + doChange13(changes, configFile); }) }); -function doChange12(changeTracker, configFile) { +function doChange13(changeTracker, configFile) { setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react")); } @@ -144433,7 +144505,7 @@ registerCodeFix({ if (info === void 0) return; const { suggestion, expression, arg } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange13(t, sourceFile, arg, expression)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, sourceFile, arg, expression)); return [createCodeFixAction(fixId27, changes, [Diagnostics.Use_0, suggestion], fixId27, Diagnostics.Use_Number_isNaN_in_all_conditions)]; }, fixIds: [fixId27], @@ -144441,7 +144513,7 @@ registerCodeFix({ return codeFixAll(context, errorCodes33, (changes, diag2) => { const info = getInfo8(context.program, diag2.file, createTextSpan(diag2.start, diag2.length)); if (info) { - doChange13(changes, diag2.file, info.arg, info.expression); + doChange14(changes, diag2.file, info.arg, info.expression); } }); } @@ -144461,7 +144533,7 @@ function getInfo8(program, sourceFile, span) { } return void 0; } -function doChange13(changes, sourceFile, arg, expression) { +function doChange14(changes, sourceFile, arg, expression) { const callExpression = factory.createCallExpression( factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")), /*typeArguments*/ @@ -144531,12 +144603,12 @@ registerCodeFix({ getCodeActions(context) { const { sourceFile, span } = context; const property = getProperty2(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile, property)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, context.sourceFile, property)); return [createCodeFixAction(fixId28, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId28, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange14(changes, diag2.file, getProperty2(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange15(changes, diag2.file, getProperty2(diag2.file, diag2.start))) }); -function doChange14(changes, sourceFile, node) { +function doChange15(changes, sourceFile, node) { changes.replaceNode(sourceFile, node, factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer)); } function getProperty2(sourceFile, pos) { @@ -144601,14 +144673,14 @@ registerCodeFix({ if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16(t, sourceFile, info)); return [createCodeFixAction(fixId30, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId30, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; }, fixIds: [fixId30], getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { const info = getInfo9(diag2.file, diag2.start, diag2.code); if (info) - doChange15(changes, context.sourceFile, info); + doChange16(changes, context.sourceFile, info); }) }); function getInfo9(sourceFile, pos, diagCode) { @@ -144617,7 +144689,7 @@ function getInfo9(sourceFile, pos, diagCode) { return { node, className: diagCode === didYouMeanStaticMemberCode ? getContainingClass(node).name.text : void 0 }; } } -function doChange15(changes, sourceFile, { node, className }) { +function doChange16(changes, sourceFile, { node, className }) { suppressLeadingAndTrailingTrivia(node); changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node)); } @@ -144634,7 +144706,7 @@ registerCodeFix({ fixIds: [fixIdExpression, fixIdHtmlEntity], getCodeActions(context) { const { sourceFile, preferences, span } = context; - const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( + const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( t, preferences, sourceFile, @@ -144642,7 +144714,7 @@ registerCodeFix({ /* useHtmlEntity */ false )); - const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( + const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( t, preferences, sourceFile, @@ -144656,7 +144728,7 @@ registerCodeFix({ ]; }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange16(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); + return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange17(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); } }); var htmlEntity = { @@ -144666,7 +144738,7 @@ var htmlEntity = { function isValidCharacter(character) { return hasProperty(htmlEntity, character); } -function doChange16(changes, preferences, sourceFile, start2, useHtmlEntity) { +function doChange17(changes, preferences, sourceFile, start2, useHtmlEntity) { const character = sourceFile.getText()[start2]; if (!isValidCharacter(character)) { return; @@ -145142,13 +145214,13 @@ registerCodeFix({ const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken); if (syntacticDiagnostics.length) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); return [createCodeFixAction(fixId32, changes, Diagnostics.Remove_unreachable_code, fixId32, Diagnostics.Remove_all_unreachable_code)]; }, fixIds: [fixId32], - getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange17(changes, diag2.file, diag2.start, diag2.length, diag2.code)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange18(changes, diag2.file, diag2.start, diag2.length, diag2.code)) }); -function doChange17(changes, sourceFile, start2, length2, errorCode) { +function doChange18(changes, sourceFile, start2, length2, errorCode) { const token = getTokenAtPosition(sourceFile, start2); const statement = findAncestor(token, isStatement); if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { @@ -145203,13 +145275,13 @@ var errorCodes42 = [Diagnostics.Unused_label.code]; registerCodeFix({ errorCodes: errorCodes42, getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, context.sourceFile, context.span.start)); return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unused_label, fixId33, Diagnostics.Remove_all_unused_labels)]; }, fixIds: [fixId33], - getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange19(changes, diag2.file, diag2.start)) }); -function doChange18(changes, sourceFile, start2) { +function doChange19(changes, sourceFile, start2) { const token = getTokenAtPosition(sourceFile, start2); const labeledStatement = cast(token.parent, isLabeledStatement); const pos = token.getStart(sourceFile); @@ -145247,7 +145319,7 @@ registerCodeFix({ } return actions2; function fix(type2, fixId51, fixAllDescription) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, sourceFile, typeNode, type2, checker)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, sourceFile, typeNode, type2, checker)); return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId51, fixAllDescription); } }, @@ -145261,11 +145333,11 @@ registerCodeFix({ return; const { typeNode, type } = info; const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId51 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; - doChange19(changes, sourceFile, typeNode, fixedType, checker); + doChange20(changes, sourceFile, typeNode, fixedType, checker); }); } }); -function doChange19(changes, sourceFile, oldTypeNode, newType, checker) { +function doChange20(changes, sourceFile, oldTypeNode, newType, checker) { changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( newType, /*enclosingDeclaration*/ @@ -145328,16 +145400,16 @@ registerCodeFix({ const callName = getCallName(sourceFile, span.start); if (!callName) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, context.sourceFile, callName)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, context.sourceFile, callName)); return [createCodeFixAction(fixId34, changes, Diagnostics.Add_missing_call_parentheses, fixId34, Diagnostics.Add_all_missing_call_parentheses)]; }, getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => { const callName = getCallName(diag2.file, diag2.start); if (callName) - doChange20(changes, diag2.file, callName); + doChange21(changes, diag2.file, callName); }) }); -function doChange20(changes, sourceFile, name) { +function doChange21(changes, sourceFile, name) { changes.replaceNodeWithText(sourceFile, name, `${name.text}()`); } function getCallName(sourceFile, start2) { @@ -145369,7 +145441,7 @@ registerCodeFix({ const nodes = getNodes3(sourceFile, span.start); if (!nodes) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, sourceFile, nodes)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange22(t, sourceFile, nodes)); return [createCodeFixAction(fixId35, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId35, Diagnostics.Add_all_missing_async_modifiers)]; }, fixIds: [fixId35], @@ -145379,7 +145451,7 @@ registerCodeFix({ const nodes = getNodes3(diag2.file, diag2.start); if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return; - doChange21(changes, context.sourceFile, nodes); + doChange22(changes, context.sourceFile, nodes); }); } }); @@ -145418,7 +145490,7 @@ function getNodes3(sourceFile, start2) { returnType: getReturnType(containingFunction) }; } -function doChange21(changes, sourceFile, { insertBefore, returnType }) { +function doChange22(changes, sourceFile, { insertBefore, returnType }) { if (returnType) { const entityName = getEntityNameFromTypeNode(returnType); if (!entityName || entityName.kind !== 79 /* Identifier */ || entityName.text !== "Promise") { @@ -145437,14 +145509,14 @@ var fixId36 = "fixPropertyOverrideAccessor"; registerCodeFix({ errorCodes: errorCodes46, getCodeActions(context) { - const edits = doChange22(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); + const edits = doChange23(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); if (edits) { return [createCodeFixAction(fixId36, edits, Diagnostics.Generate_get_and_set_accessors, fixId36, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; } }, fixIds: [fixId36], getAllCodeActions: (context) => codeFixAll(context, errorCodes46, (changes, diag2) => { - const edits = doChange22(diag2.file, diag2.start, diag2.length, diag2.code, context); + const edits = doChange23(diag2.file, diag2.start, diag2.length, diag2.code, context); if (edits) { for (const edit of edits) { changes.pushRaw(context.sourceFile, edit); @@ -145452,7 +145524,7 @@ registerCodeFix({ } }) }); -function doChange22(file, start2, length2, code, context) { +function doChange23(file, start2, length2, code, context) { let startPosition; let endPosition; if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) { @@ -145522,7 +145594,7 @@ registerCodeFix({ const token = getTokenAtPosition(sourceFile, start2); let declaration; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - declaration = doChange23( + declaration = doChange24( changes2, sourceFile, token, @@ -145543,7 +145615,7 @@ registerCodeFix({ const { sourceFile, program, cancellationToken, host, preferences } = context; const markSeen = nodeSeenTracker(); return codeFixAll(context, errorCodes47, (changes, err) => { - doChange23(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); + doChange24(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); }); } }); @@ -145582,7 +145654,7 @@ function mapSuggestionDiagnostic(errorCode) { } return errorCode; } -function doChange23(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { +function doChange24(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { if (!isParameterPropertyModifier(token.kind) && token.kind !== 79 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 108 /* ThisKeyword */) { return void 0; } @@ -146493,7 +146565,7 @@ registerCodeFix({ return void 0; } const { returnTypeNode, returnType, promisedTypeNode, promisedType } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, sourceFile, returnTypeNode, promisedTypeNode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, sourceFile, returnTypeNode, promisedTypeNode)); return [createCodeFixAction( fixId38, changes, @@ -146509,7 +146581,7 @@ registerCodeFix({ getAllCodeActions: (context) => codeFixAll(context, errorCodes48, (changes, diag2) => { const info = getInfo12(diag2.file, context.program.getTypeChecker(), diag2.start); if (info) { - doChange24(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); + doChange25(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); } }) }); @@ -146536,7 +146608,7 @@ function getInfo12(sourceFile, checker, pos) { return { returnTypeNode, returnType, promisedTypeNode, promisedType }; } } -function doChange24(changes, sourceFile, returnTypeNode, promisedTypeNode) { +function doChange25(changes, sourceFile, returnTypeNode, promisedTypeNode) { changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode])); } @@ -147707,18 +147779,18 @@ registerCodeFix({ if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, context.sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, context.sourceFile, info)); return [createCodeFixAction(fixId40, changes, Diagnostics.Convert_require_to_import, fixId40, Diagnostics.Convert_all_require_to_import)]; }, fixIds: [fixId40], getAllCodeActions: (context) => codeFixAll(context, errorCodes51, (changes, diag2) => { const info = getInfo14(diag2.file, context.program, diag2.start); if (info) { - doChange25(changes, context.sourceFile, info); + doChange26(changes, context.sourceFile, info); } }) }); -function doChange25(changes, sourceFile, info) { +function doChange26(changes, sourceFile, info) { const { allowSyntheticDefaults, defaultImportName, namedImports, statement, required } = info; changes.replaceNode(sourceFile, statement, defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( /*modifiers*/ @@ -147791,14 +147863,14 @@ registerCodeFix({ const info = getInfo15(sourceFile, start2); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, sourceFile, info, context.preferences)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, info, context.preferences)); return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_to_default_import, fixId41, Diagnostics.Convert_all_to_default_imports)]; }, fixIds: [fixId41], getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { const info = getInfo15(diag2.file, diag2.start); if (info) - doChange26(changes, diag2.file, info, context.preferences); + doChange27(changes, diag2.file, info, context.preferences); }) }); function getInfo15(sourceFile, pos) { @@ -147813,7 +147885,7 @@ function getInfo15(sourceFile, pos) { return { importNode, name, moduleSpecifier: importNode.moduleSpecifier }; } } -function doChange26(changes, sourceFile, info, preferences) { +function doChange27(changes, sourceFile, info, preferences) { changes.replaceNode(sourceFile, info.importNode, makeImport( info.name, /*namedImports*/ @@ -147859,11 +147931,11 @@ registerCodeFix({ getCodeActions: function getCodeActionsToAddMissingTypeof(context) { const { sourceFile, span } = context; const importType = getImportTypeNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, importType)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, importType)); return [createCodeFixAction(fixId43, changes, Diagnostics.Add_missing_typeof, fixId43, Diagnostics.Add_missing_typeof)]; }, fixIds: [fixId43], - getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange27(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange28(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) }); function getImportTypeNode(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); @@ -147871,7 +147943,7 @@ function getImportTypeNode(sourceFile, pos) { Debug.assert(token.parent.kind === 202 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } -function doChange27(changes, sourceFile, importType) { +function doChange28(changes, sourceFile, importType) { const newTypeNode = factory.updateImportTypeNode( importType, importType.argument, @@ -147894,7 +147966,7 @@ registerCodeFix({ const node = findNodeToFix(sourceFile, span.start); if (!node) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, node)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, node)); return [createCodeFixAction(fixID2, changes, Diagnostics.Wrap_in_JSX_fragment, fixID2, Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]; }, fixIds: [fixID2], @@ -147902,7 +147974,7 @@ registerCodeFix({ const node = findNodeToFix(context.sourceFile, diag2.start); if (!node) return void 0; - doChange28(changes, context.sourceFile, node); + doChange29(changes, context.sourceFile, node); }) }); function findNodeToFix(sourceFile, pos) { @@ -147918,7 +147990,7 @@ function findNodeToFix(sourceFile, pos) { return void 0; return binaryExpr; } -function doChange28(changeTracker, sf, node) { +function doChange29(changeTracker, sf, node) { const jsx = flattenInvalidBinaryExpr(node); if (jsx) changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment())); @@ -147952,7 +148024,7 @@ registerCodeFix({ const info = getInfo16(sourceFile, span.start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info)); const name = idText(info.container.name); return [createCodeFixAction(fixId44, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId44, [Diagnostics.Convert_0_to_mapped_object_type, name])]; }, @@ -147960,7 +148032,7 @@ registerCodeFix({ getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { const info = getInfo16(diag2.file, diag2.start); if (info) - doChange29(changes, diag2.file, info); + doChange30(changes, diag2.file, info); }) }); function getInfo16(sourceFile, pos) { @@ -147976,7 +148048,7 @@ function getInfo16(sourceFile, pos) { function createTypeAliasFromInterface(declaration, type) { return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type); } -function doChange29(changes, sourceFile, { indexSignature, container }) { +function doChange30(changes, sourceFile, { indexSignature, container }) { const members = isInterfaceDeclaration(container) ? container.members : container.type.members; const otherMembers = members.filter((member) => !isIndexSignatureDeclaration(member)); const parameter = first(indexSignature.parameters); @@ -148130,7 +148202,7 @@ registerCodeFix({ const info = getInfo17(sourceFile, span.start, program); if (info === void 0) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info.token)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info.token)); return [createCodeFixActionMaybeFixAll(fixId48, changes, Diagnostics.Convert_const_to_let, fixId48, Diagnostics.Convert_all_const_to_let)]; }, getAllCodeActions: (context) => { @@ -148141,7 +148213,7 @@ registerCodeFix({ const info = getInfo17(diag2.file, diag2.start, program); if (info) { if (addToSeen(seen, getSymbolId(info.symbol))) { - return doChange30(changes, diag2.file, info.token); + return doChange31(changes, diag2.file, info.token); } } return void 0; @@ -148164,7 +148236,7 @@ function getInfo17(sourceFile, pos, program) { return; return { symbol, token: constToken }; } -function doChange30(changes, sourceFile, token) { +function doChange31(changes, sourceFile, token) { changes.replaceNode(sourceFile, token, factory.createToken(119 /* LetKeyword */)); } @@ -148179,7 +148251,7 @@ registerCodeFix({ const info = getInfo18(sourceFile, context.span.start, context.errorCode); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(t, sourceFile, info)); return [createCodeFixAction( fixId49, changes, @@ -148192,14 +148264,14 @@ registerCodeFix({ getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, diag2) => { const info = getInfo18(diag2.file, diag2.start, diag2.code); if (info) - doChange31(changes, context.sourceFile, info); + doChange32(changes, context.sourceFile, info); }) }); function getInfo18(sourceFile, pos, _) { const node = getTokenAtPosition(sourceFile, pos); return node.kind === 26 /* SemicolonToken */ && node.parent && (isObjectLiteralExpression(node.parent) || isArrayLiteralExpression(node.parent)) ? { node } : void 0; } -function doChange31(changes, sourceFile, { node }) { +function doChange32(changes, sourceFile, { node }) { const newNode = factory.createToken(27 /* CommaToken */); changes.replaceNode(sourceFile, node, newNode); } @@ -157256,7 +157328,7 @@ registerRefactor(refactorName, { Debug.assert(actionName2 === defaultToNamedAction.name || actionName2 === namedToDefaultAction.name, "Unexpected action name"); const info = getInfo19(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(context.file, context.program, info, t, context.cancellationToken)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, info, t, context.cancellationToken)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -157309,7 +157381,7 @@ function getInfo19(context, considerPartialSpans = true) { return void 0; } } -function doChange32(exportingSourceFile, program, info, changes, cancellationToken) { +function doChange33(exportingSourceFile, program, info, changes, cancellationToken) { changeExport(exportingSourceFile, info, changes, program.getTypeChecker()); changeImports(program, info, changes, cancellationToken); } @@ -157504,7 +157576,7 @@ registerRefactor(refactorName2, { Debug.assert(some(getOwnValues(actions), (action) => action.name === actionName2), "Unexpected action name"); const info = getImportConversionInfo(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, t, info)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, t, info)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -157535,7 +157607,7 @@ function getImportConversionInfo(context, considerPartialSpans = true) { function getShouldUseDefault(program, importClause) { return getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); } -function doChange33(sourceFile, program, changes, info) { +function doChange34(sourceFile, program, changes, info) { const checker = program.getTypeChecker(); if (info.convertTo === 0 /* Named */) { doChangeNamespaceToNamed(sourceFile, checker, changes, info.import, getAllowSyntheticDefaultImports(program.getCompilerOptions())); @@ -158008,7 +158080,7 @@ registerRefactor(refactorName4, { getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) { Debug.assert(actionName2 === refactorName4, "Wrong refactor invoked"); const statements = Debug.checkDefined(getStatementsToMove(context)); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, statements, t, context.host, context.preferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(context.file, context.program, statements, t, context.host, context.preferences)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -158033,7 +158105,7 @@ function getRangeToMove(context) { afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex] }; } -function doChange34(oldFile, program, toMove, changes, host, preferences) { +function doChange35(oldFile, program, toMove, changes, host, preferences) { const checker = program.getTypeChecker(); const usage = getUsageInfo(oldFile, toMove.all, checker); const currentDirectory = getDirectoryPath(oldFile.fileName); @@ -159405,12 +159477,12 @@ function getRefactorEditsToConvertParametersToDestructuredObject(context, action return void 0; const groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); if (groupedReferences.valid) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(file, program, host, t, functionDeclaration, groupedReferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(file, program, host, t, functionDeclaration, groupedReferences)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return { edits: [] }; } -function doChange35(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { +function doChange36(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { const signature = groupedReferences.signature; const newFunctionDeclarationParams = map(createNewParameters(functionDeclaration, program, host), (param) => getSynthesizedDeepClone(param)); if (signature) { @@ -160174,7 +160246,7 @@ function getRefactorEditsToConvertToOptionalChain(context, actionName2) { Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); const edits = ts_textChanges_exports.ChangeTracker.with( context, - (t) => doChange36(context.file, context.program.getTypeChecker(), t, info, actionName2) + (t) => doChange37(context.file, context.program.getTypeChecker(), t, info, actionName2) ); return { edits, renameFilename: void 0, renameLocation: void 0 }; } @@ -160330,7 +160402,7 @@ function convertOccurrences(checker, toConvert, occurrences) { } return toConvert; } -function doChange36(sourceFile, checker, changes, info, _actionName) { +function doChange37(sourceFile, checker, changes, info, _actionName) { const { finalExpression, occurrences, expression } = info; const firstOccurrence = occurrences[occurrences.length - 1]; const convertedChain = convertOccurrences(checker, finalExpression, occurrences); @@ -162025,7 +162097,7 @@ registerRefactor(refactorName12, { function getRefactorEditsToInferReturnType(context) { const info = getInfo21(context); if (info && !isRefactorErrorInfo(info)) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(context.file, t, info.declaration, info.returnTypeNode)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange38(context.file, t, info.declaration, info.returnTypeNode)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return void 0; @@ -162050,7 +162122,7 @@ function getRefactorActionsToInferReturnType(context) { } return emptyArray; } -function doChange37(sourceFile, changes, declaration, typeNode) { +function doChange38(sourceFile, changes, declaration, typeNode) { const closeParen = findChildOfKind(declaration, 21 /* CloseParenToken */, sourceFile); const needParens = isArrowFunction(declaration) && closeParen === void 0; const endNode2 = needParens ? first(declaration.parameters) : closeParen; @@ -167693,7 +167765,6 @@ __export(ts_exports3, { ContextFlags: () => ContextFlags, CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter, Debug: () => Debug, - DeprecationVersion: () => DeprecationVersion, DiagnosticCategory: () => DiagnosticCategory, Diagnostics: () => Diagnostics, DocumentHighlights: () => DocumentHighlights, @@ -181643,7 +181714,6 @@ start(initializeNodeSystem(), require("os").platform()); ContextFlags, CoreServicesShimHostAdapter, Debug, - DeprecationVersion, DiagnosticCategory, Diagnostics, DocumentHighlights, diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 34006d63b2ea5..f23fc06fcc24a 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -6991,6 +6991,12 @@ declare namespace ts { } enum ModuleResolutionKind { Classic = 1, + /** + * @deprecated + * `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets. + * Use the new name or consider switching to a modern module resolution target. + */ + NodeJs = 2, Node10 = 2, Node16 = 3, NodeNext = 99, diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index a69e846e71fc5..d15d5ed7220f3 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -35,7 +35,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = `${versionMajorMinor}.1-rc`; + version = "5.0.2"; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -3585,7 +3585,7 @@ ${lanes.join("\n")} const name = DiagnosticCategory[d.category]; return lowerCase ? name.toLowerCase() : name; } - var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, DeprecationVersion; + var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas; var init_types = __esm({ "src/compiler/types.ts"() { "use strict"; @@ -4686,6 +4686,7 @@ ${lanes.join("\n")} })(DiagnosticCategory || {}); ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind3) => { ModuleResolutionKind3[ModuleResolutionKind3["Classic"] = 1] = "Classic"; + ModuleResolutionKind3[ModuleResolutionKind3["NodeJs"] = 2] = "NodeJs"; ModuleResolutionKind3[ModuleResolutionKind3["Node10"] = 2] = "Node10"; ModuleResolutionKind3[ModuleResolutionKind3["Node16"] = 3] = "Node16"; ModuleResolutionKind3[ModuleResolutionKind3["NodeNext"] = 99] = "NodeNext"; @@ -5250,12 +5251,6 @@ ${lanes.join("\n")} kind: 4 /* MultiLine */ } }; - DeprecationVersion = /* @__PURE__ */ ((DeprecationVersion2) => { - DeprecationVersion2["v5_0"] = "5.0"; - DeprecationVersion2["v5_5"] = "5.5"; - DeprecationVersion2["v6_0"] = "6.0"; - return DeprecationVersion2; - })(DeprecationVersion || {}); } }); @@ -8180,12 +8175,14 @@ ${lanes.join("\n")} Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), - Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), + Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), + Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), + Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`), + Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -60582,6 +60579,9 @@ ${lanes.join("\n")} function isTypeSubtypeOf(source, target) { return isTypeRelatedTo(source, target, subtypeRelation); } + function isTypeStrictSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, strictSubtypeRelation); + } function isTypeAssignableTo(source, target) { return isTypeRelatedTo(source, target, assignableRelation); } @@ -62490,7 +62490,7 @@ ${lanes.join("\n")} 0 /* None */ ); } - } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { + } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { result2 &= propertiesRelatedTo( source2, target2, @@ -67677,7 +67677,7 @@ ${lanes.join("\n")} const narrowedType = mapType(candidate, (c) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -115770,6 +115770,7 @@ ${lanes.join("\n")} const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions; let { oldProgram } = createProgramOptions; + const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations)); let processingDefaultLibFiles; let processingOtherFiles; let files; @@ -118196,127 +118197,131 @@ ${lanes.join("\n")} } } } - function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) { - const version2 = typeScriptVersion3 || versionMajorMinor; + function getIgnoreDeprecationsVersion() { const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { - if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) { - return; - } else if (reportInvalidIgnoreDeprecations) { - createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); - } + if (ignoreDeprecations === "5.0") { + return new Version(ignoreDeprecations); + } + reportInvalidIgnoreDeprecations(); + } + return Version.zero; + } + function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) { + const deprecatedInVersion = new Version(deprecatedIn); + const removedInVersion = new Version(removedIn); + const typescriptVersion = new Version(typeScriptVersion3 || versionMajorMinor); + const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion(); + const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */); + const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */; + if (mustBeRemoved || canBeSilenced) { + fn((name, value, useInstead) => { + if (mustBeRemoved) { + if (value === void 0) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name); + } else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value); + } + } else { + if (value === void 0) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn); + } else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn); + } + } + }); } - return version2; } function verifyDeprecatedCompilerOptions() { - const version2 = getVersionForDeprecationDiagnostics( - /*reportInvalidIgnoreDeprecations*/ - true - ); - if (!version2) - return; - if (options.target === 0 /* ES3 */) { - createDeprecatedDiagnosticForOption(version2, "target", "ES3"); - } - if (options.noImplicitUseStrict) { - createDeprecatedDiagnosticForOption(version2, "noImplicitUseStrict"); - } - if (options.keyofStringsOnly) { - createDeprecatedDiagnosticForOption(version2, "keyofStringsOnly"); - } - if (options.suppressExcessPropertyErrors) { - createDeprecatedDiagnosticForOption(version2, "suppressExcessPropertyErrors"); - } - if (options.suppressImplicitAnyIndexErrors) { - createDeprecatedDiagnosticForOption(version2, "suppressImplicitAnyIndexErrors"); - } - if (options.noStrictGenericChecks) { - createDeprecatedDiagnosticForOption(version2, "noStrictGenericChecks"); - } - if (options.charset) { - createDeprecatedDiagnosticForOption(version2, "charset"); - } - if (options.out) { - createDeprecatedDiagnosticForOption(version2, "out"); - } - if (options.importsNotUsedAsValues) { - createDeprecatedDiagnosticForOption( - version2, - "importsNotUsedAsValues", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - if (options.preserveValueImports) { - createDeprecatedDiagnosticForOption( - version2, - "preserveValueImports", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - } - function verifyDeprecatedProjectReference(ref, parentFile, index) { - if (ref.prepend) { - const version2 = getVersionForDeprecationDiagnostics( - /*reportInvalidIgnoreDeprecations*/ - false - ); - if (version2) { - createDeprecatedOptionForVersionDiagnostic( - version2, - (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), - "prepend" + function createDiagnostic(name, value, useInstead, message, arg0, arg1, arg2, arg3) { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2, arg3); + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + chain + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + message, + arg0, + arg1, + arg2, + arg3 ); } } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (options.target === 0 /* ES3 */) { + createDeprecatedDiagnostic("target", "ES3"); + } + if (options.noImplicitUseStrict) { + createDeprecatedDiagnostic("noImplicitUseStrict"); + } + if (options.keyofStringsOnly) { + createDeprecatedDiagnostic("keyofStringsOnly"); + } + if (options.suppressExcessPropertyErrors) { + createDeprecatedDiagnostic("suppressExcessPropertyErrors"); + } + if (options.suppressImplicitAnyIndexErrors) { + createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors"); + } + if (options.noStrictGenericChecks) { + createDeprecatedDiagnostic("noStrictGenericChecks"); + } + if (options.charset) { + createDeprecatedDiagnostic("charset"); + } + if (options.out) { + createDeprecatedDiagnostic( + "out", + /*value*/ + void 0, + "outFile" + ); + } + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnostic( + "importsNotUsedAsValues", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + if (options.preserveValueImports) { + createDeprecatedDiagnostic( + "preserveValueImports", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + }); } - function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) { - return createDeprecatedOptionForVersionDiagnostic( - version2, - (message, arg0, arg1, arg2) => { - if (useInstead) { - const details = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Use_0_instead, - useInstead - ); - const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - chain - ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - message, - arg0, - arg1, - arg2 - ); - } - }, - name, - value - ); - } - function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) { - if (version2 === "6.0" /* v6_0 */) { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); - } else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + function verifyDeprecatedProjectReference(ref, parentFile, index) { + function createDiagnostic(_name, _value, _useInstead, message, arg0, arg1, arg2, arg3) { + createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2, arg3); } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (ref.prepend) { + createDeprecatedDiagnostic("prepend"); + } + }); } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { var _a3; @@ -118569,25 +118574,25 @@ ${lanes.join("\n")} arg1 ); } - function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) { + function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2, arg3) { const referencesSyntax = firstDefined( getTsConfigPropArray(sourceFile || options.configFile, "references"), (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 ); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2, arg3)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } - function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { + function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2, arg3) { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); - const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); + const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2, arg3); if (needCompilerDiagnostic) { if ("messageText" in message) { programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } } @@ -118606,13 +118611,13 @@ ${lanes.join("\n")} } return _compilerOptionsObjectLiteralSyntax || void 0; } - function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2, arg3) { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { if ("messageText" in message) { programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); } else { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2, arg3)); } } return !!props.length; @@ -139778,32 +139783,96 @@ ${lanes.join("\n")} }); // src/services/codefixes/convertToTypeOnlyImport.ts - function getImportDeclarationForDiagnosticSpan(span, sourceFile) { - return tryCast(getTokenAtPosition(sourceFile, span.start).parent, isImportDeclaration); + function getDeclaration2(sourceFile, pos) { + const { parent: parent2 } = getTokenAtPosition(sourceFile, pos); + return isImportSpecifier(parent2) || isImportDeclaration(parent2) && parent2.importClause ? parent2 : void 0; } - function fixSingleImportDeclaration(changes, importDeclaration, context) { - if (!(importDeclaration == null ? void 0 : importDeclaration.importClause)) { - return; - } - const { importClause } = importDeclaration; - changes.insertText(context.sourceFile, importDeclaration.getStart() + "import".length, " type"); - if (importClause.name && importClause.namedBindings) { - changes.deleteNodeRangeExcludingEnd(context.sourceFile, importClause.name, importDeclaration.importClause.namedBindings); - changes.insertNodeBefore(context.sourceFile, importDeclaration, factory.updateImportDeclaration( - importDeclaration, - /*modifiers*/ - void 0, - factory.createImportClause( - /*isTypeOnly*/ - true, - importClause.name, - /*namedBindings*/ - void 0 - ), - importDeclaration.moduleSpecifier, - /*assertClause*/ - void 0 + function doChange4(changes, sourceFile, declaration) { + if (isImportSpecifier(declaration)) { + changes.replaceNode(sourceFile, declaration, factory.updateImportSpecifier( + declaration, + /*isTypeOnly*/ + true, + declaration.propertyName, + declaration.name )); + } else { + const importClause = declaration.importClause; + if (importClause.name && importClause.namedBindings) { + changes.replaceNodeWithNodes(sourceFile, declaration, [ + factory.createImportDeclaration( + getSynthesizedDeepClones( + declaration.modifiers, + /*includeTrivia*/ + true + ), + factory.createImportClause( + /*isTypeOnly*/ + true, + getSynthesizedDeepClone( + importClause.name, + /*includeTrivia*/ + true + ), + /*namedBindings*/ + void 0 + ), + getSynthesizedDeepClone( + declaration.moduleSpecifier, + /*includeTrivia*/ + true + ), + getSynthesizedDeepClone( + declaration.assertClause, + /*includeTrivia*/ + true + ) + ), + factory.createImportDeclaration( + getSynthesizedDeepClones( + declaration.modifiers, + /*includeTrivia*/ + true + ), + factory.createImportClause( + /*isTypeOnly*/ + true, + /*name*/ + void 0, + getSynthesizedDeepClone( + importClause.namedBindings, + /*includeTrivia*/ + true + ) + ), + getSynthesizedDeepClone( + declaration.moduleSpecifier, + /*includeTrivia*/ + true + ), + getSynthesizedDeepClone( + declaration.assertClause, + /*includeTrivia*/ + true + ) + ) + ]); + } else { + const importDeclaration = factory.updateImportDeclaration( + declaration, + declaration.modifiers, + factory.updateImportClause( + importClause, + /*isTypeOnly*/ + true, + importClause.name, + importClause.namedBindings + ), + declaration.moduleSpecifier, + declaration.assertClause + ); + changes.replaceNode(sourceFile, declaration, importDeclaration); + } } } var errorCodes14, fixId13; @@ -139812,24 +139881,28 @@ ${lanes.join("\n")} "use strict"; init_ts4(); init_ts_codefix(); - errorCodes14 = [Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code]; + errorCodes14 = [ + Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code, + Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code + ]; fixId13 = "convertToTypeOnlyImport"; registerCodeFix({ errorCodes: errorCodes14, getCodeActions: function getCodeActionsToConvertToTypeOnlyImport(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - const importDeclaration = getImportDeclarationForDiagnosticSpan(context.span, context.sourceFile); - fixSingleImportDeclaration(t, importDeclaration, context); - }); - if (changes.length) { + const declaration = getDeclaration2(context.sourceFile, context.span.start); + if (declaration) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(t, context.sourceFile, declaration)); return [createCodeFixAction(fixId13, changes, Diagnostics.Convert_to_type_only_import, fixId13, Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]; } + return void 0; }, fixIds: [fixId13], getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context) { return codeFixAll(context, errorCodes14, (changes, diag2) => { - const importDeclaration = getImportDeclarationForDiagnosticSpan(diag2, context.sourceFile); - fixSingleImportDeclaration(changes, importDeclaration, context); + const declaration = getDeclaration2(diag2.file, diag2.start); + if (declaration) { + doChange4(changes, diag2.file, declaration); + } }); } }); @@ -139851,7 +139924,7 @@ ${lanes.join("\n")} } return void 0; } - function doChange4(changes, sourceFile, { container, typeNode, constraint, name }) { + function doChange5(changes, sourceFile, { container, typeNode, constraint, name }) { changes.replaceNode(sourceFile, container, factory.createMappedTypeNode( /*readonlyToken*/ void 0, @@ -139887,14 +139960,14 @@ ${lanes.join("\n")} return void 0; } const { name, constraint } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange5(t, sourceFile, info)); return [createCodeFixAction(fixId14, changes, [Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId14, Diagnostics.Convert_all_type_literals_to_mapped_type)]; }, fixIds: [fixId14], getAllCodeActions: (context) => codeFixAll(context, errorCodes15, (changes, diag2) => { const info = getInfo2(diag2.file, diag2.start); if (info) { - doChange4(changes, diag2.file, info); + doChange5(changes, diag2.file, info); } }) }); @@ -141496,7 +141569,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixNoPropertyAccessFromIndexSignature.ts - function doChange5(changes, sourceFile, node, preferences) { + function doChange6(changes, sourceFile, node, preferences) { const quotePreference = getQuotePreference(sourceFile, preferences); const argumentsExpression = factory.createStringLiteral(node.name.text, quotePreference === 0 /* Single */); changes.replaceNode( @@ -141524,16 +141597,16 @@ ${lanes.join("\n")} getCodeActions(context) { const { sourceFile, span, preferences } = context; const property = getPropertyAccessExpression(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange5(t, context.sourceFile, property, preferences)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange6(t, context.sourceFile, property, preferences)); return [createCodeFixAction(fixId17, changes, [Diagnostics.Use_element_access_for_0, property.name.text], fixId17, Diagnostics.Use_element_access_for_all_undeclared_properties)]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes20, (changes, diag2) => doChange5(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context.preferences)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes20, (changes, diag2) => doChange6(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context.preferences)) }); } }); // src/services/codefixes/fixImplicitThis.ts - function doChange6(changes, sourceFile, pos, checker) { + function doChange7(changes, sourceFile, pos, checker) { const token = getTokenAtPosition(sourceFile, pos); if (!isThis(token)) return void 0; @@ -141588,13 +141661,13 @@ ${lanes.join("\n")} const { sourceFile, program, span } = context; let diagnostic; const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - diagnostic = doChange6(t, sourceFile, span.start, program.getTypeChecker()); + diagnostic = doChange7(t, sourceFile, span.start, program.getTypeChecker()); }); return diagnostic ? [createCodeFixAction(fixId18, changes, diagnostic, fixId18, Diagnostics.Fix_all_implicit_this_errors)] : emptyArray; }, fixIds: [fixId18], getAllCodeActions: (context) => codeFixAll(context, errorCodes21, (changes, diag2) => { - doChange6(changes, diag2.file, diag2.start, context.program.getTypeChecker()); + doChange7(changes, diag2.file, diag2.start, context.program.getTypeChecker()); }) }); } @@ -141637,7 +141710,7 @@ ${lanes.join("\n")} } return void 0; } - function doChange7(changes, program, { exportName, node, moduleSourceFile }) { + function doChange8(changes, program, { exportName, node, moduleSourceFile }) { const exportDeclaration = tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly); if (exportDeclaration) { updateExport(changes, program, moduleSourceFile, exportDeclaration, [exportName]); @@ -141737,7 +141810,7 @@ ${lanes.join("\n")} const info = getInfo4(sourceFile, span.start, program); if (info === void 0) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange7(t, program, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange8(t, program, info)); return [createCodeFixAction(fixId19, changes, [Diagnostics.Export_0_from_module_1, info.exportName.node.text, info.moduleSpecifier], fixId19, Diagnostics.Export_all_referenced_locals)]; }, getAllCodeActions(context) { @@ -141789,7 +141862,7 @@ ${lanes.join("\n")} const token = getTokenAtPosition(sourceFile, pos); return findAncestor(token, (t) => t.kind === 199 /* NamedTupleMember */); } - function doChange8(changes, sourceFile, namedTupleMember) { + function doChange9(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { return; } @@ -141832,7 +141905,7 @@ ${lanes.join("\n")} getCodeActions: function getCodeActionsToFixIncorrectNamedTupleSyntax(context) { const { sourceFile, span } = context; const namedTupleMember = getNamedTupleMember(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange8(t, sourceFile, namedTupleMember)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange9(t, sourceFile, namedTupleMember)); return [createCodeFixAction(fixId20, changes, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels, fixId20, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]; }, fixIds: [fixId20] @@ -141890,7 +141963,7 @@ ${lanes.join("\n")} } return suggestedSymbol === void 0 ? void 0 : { node, suggestedSymbol }; } - function doChange9(changes, sourceFile, node, suggestedSymbol, target) { + function doChange10(changes, sourceFile, node, suggestedSymbol, target) { const suggestion = symbolName(suggestedSymbol); if (!isIdentifierText(suggestion, target) && isPropertyAccessExpression(node.parent)) { const valDecl = suggestedSymbol.valueDeclaration; @@ -141956,7 +142029,7 @@ ${lanes.join("\n")} return void 0; const { node, suggestedSymbol } = info; const target = getEmitScriptTarget(context.host.getCompilationSettings()); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange9(t, sourceFile, node, suggestedSymbol, target)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange10(t, sourceFile, node, suggestedSymbol, target)); return [createCodeFixAction("spelling", changes, [Diagnostics.Change_spelling_to_0, symbolName(suggestedSymbol)], fixId21, Diagnostics.Fix_all_detected_spelling_errors)]; }, fixIds: [fixId21], @@ -141964,7 +142037,7 @@ ${lanes.join("\n")} const info = getInfo5(diag2.file, diag2.start, context, diag2.code); const target = getEmitScriptTarget(context.host.getCompilationSettings()); if (info) - doChange9(changes, context.sourceFile, info.node, info.suggestedSymbol, target); + doChange10(changes, context.sourceFile, info.node, info.suggestedSymbol, target); }) }); } @@ -143023,7 +143096,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts - function doChange10(changes, sourceFile, constructor, superCall) { + function doChange11(changes, sourceFile, constructor, superCall) { changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); changes.delete(sourceFile, superCall); } @@ -143054,7 +143127,7 @@ ${lanes.join("\n")} if (!nodes) return void 0; const { constructor, superCall } = nodes; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange10(t, sourceFile, constructor, superCall)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, sourceFile, constructor, superCall)); return [createCodeFixAction(fixId25, changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId25, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]; }, fixIds: [fixId25], @@ -143067,7 +143140,7 @@ ${lanes.join("\n")} return; const { constructor, superCall } = nodes; if (addToSeen(seenClasses, getNodeId(constructor.parent))) { - doChange10(changes, sourceFile, constructor, superCall); + doChange11(changes, sourceFile, constructor, superCall); } }); } @@ -143081,7 +143154,7 @@ ${lanes.join("\n")} Debug.assert(isConstructorDeclaration(token.parent), "token should be at the constructor declaration"); return token.parent; } - function doChange11(changes, sourceFile, ctr) { + function doChange12(changes, sourceFile, ctr) { const superCall = factory.createExpressionStatement(factory.createCallExpression( factory.createSuper(), /*typeArguments*/ @@ -143104,17 +143177,17 @@ ${lanes.join("\n")} getCodeActions(context) { const { sourceFile, span } = context; const ctr = getNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, sourceFile, ctr)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange12(t, sourceFile, ctr)); return [createCodeFixAction(fixId26, changes, Diagnostics.Add_missing_super_call, fixId26, Diagnostics.Add_all_missing_super_calls)]; }, fixIds: [fixId26], - getAllCodeActions: (context) => codeFixAll(context, errorCodes31, (changes, diag2) => doChange11(changes, context.sourceFile, getNode(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes31, (changes, diag2) => doChange12(changes, context.sourceFile, getNode(diag2.file, diag2.start))) }); } }); // src/services/codefixes/fixEnableJsxFlag.ts - function doChange12(changeTracker, configFile) { + function doChange13(changeTracker, configFile) { setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react")); } var fixID, errorCodes32; @@ -143134,7 +143207,7 @@ ${lanes.join("\n")} } const changes = ts_textChanges_exports.ChangeTracker.with( context, - (changeTracker) => doChange12(changeTracker, configFile) + (changeTracker) => doChange13(changeTracker, configFile) ); return [ createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) @@ -143146,7 +143219,7 @@ ${lanes.join("\n")} if (configFile === void 0) { return void 0; } - doChange12(changes, configFile); + doChange13(changes, configFile); }) }); } @@ -143168,7 +143241,7 @@ ${lanes.join("\n")} } return void 0; } - function doChange13(changes, sourceFile, arg, expression) { + function doChange14(changes, sourceFile, arg, expression) { const callExpression = factory.createCallExpression( factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")), /*typeArguments*/ @@ -143204,7 +143277,7 @@ ${lanes.join("\n")} if (info === void 0) return; const { suggestion, expression, arg } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange13(t, sourceFile, arg, expression)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, sourceFile, arg, expression)); return [createCodeFixAction(fixId27, changes, [Diagnostics.Use_0, suggestion], fixId27, Diagnostics.Use_Number_isNaN_in_all_conditions)]; }, fixIds: [fixId27], @@ -143212,7 +143285,7 @@ ${lanes.join("\n")} return codeFixAll(context, errorCodes33, (changes, diag2) => { const info = getInfo8(context.program, diag2.file, createTextSpan(diag2.start, diag2.length)); if (info) { - doChange13(changes, diag2.file, info.arg, info.expression); + doChange14(changes, diag2.file, info.arg, info.expression); } }); } @@ -143268,7 +143341,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixPropertyAssignment.ts - function doChange14(changes, sourceFile, node) { + function doChange15(changes, sourceFile, node) { changes.replaceNode(sourceFile, node, factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer)); } function getProperty2(sourceFile, pos) { @@ -143290,10 +143363,10 @@ ${lanes.join("\n")} getCodeActions(context) { const { sourceFile, span } = context; const property = getProperty2(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile, property)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, context.sourceFile, property)); return [createCodeFixAction(fixId28, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId28, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange14(changes, diag2.file, getProperty2(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange15(changes, diag2.file, getProperty2(diag2.file, diag2.start))) }); } }); @@ -143355,7 +143428,7 @@ ${lanes.join("\n")} return { node, className: diagCode === didYouMeanStaticMemberCode ? getContainingClass(node).name.text : void 0 }; } } - function doChange15(changes, sourceFile, { node, className }) { + function doChange16(changes, sourceFile, { node, className }) { suppressLeadingAndTrailingTrivia(node); changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node)); } @@ -143380,14 +143453,14 @@ ${lanes.join("\n")} if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16(t, sourceFile, info)); return [createCodeFixAction(fixId30, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId30, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; }, fixIds: [fixId30], getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { const info = getInfo9(diag2.file, diag2.start, diag2.code); if (info) - doChange15(changes, context.sourceFile, info); + doChange16(changes, context.sourceFile, info); }) }); } @@ -143397,7 +143470,7 @@ ${lanes.join("\n")} function isValidCharacter(character) { return hasProperty(htmlEntity, character); } - function doChange16(changes, preferences, sourceFile, start, useHtmlEntity) { + function doChange17(changes, preferences, sourceFile, start, useHtmlEntity) { const character = sourceFile.getText()[start]; if (!isValidCharacter(character)) { return; @@ -143422,7 +143495,7 @@ ${lanes.join("\n")} fixIds: [fixIdExpression, fixIdHtmlEntity], getCodeActions(context) { const { sourceFile, preferences, span } = context; - const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( + const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( t, preferences, sourceFile, @@ -143430,7 +143503,7 @@ ${lanes.join("\n")} /* useHtmlEntity */ false )); - const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( + const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( t, preferences, sourceFile, @@ -143444,7 +143517,7 @@ ${lanes.join("\n")} ]; }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange16(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); + return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange17(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); } }); htmlEntity = { @@ -143937,7 +144010,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixUnreachableCode.ts - function doChange17(changes, sourceFile, start, length2, errorCode) { + function doChange18(changes, sourceFile, start, length2, errorCode) { const token = getTokenAtPosition(sourceFile, start); const statement = findAncestor(token, isStatement); if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { @@ -143999,17 +144072,17 @@ ${lanes.join("\n")} const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken); if (syntacticDiagnostics.length) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); return [createCodeFixAction(fixId32, changes, Diagnostics.Remove_unreachable_code, fixId32, Diagnostics.Remove_all_unreachable_code)]; }, fixIds: [fixId32], - getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange17(changes, diag2.file, diag2.start, diag2.length, diag2.code)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange18(changes, diag2.file, diag2.start, diag2.length, diag2.code)) }); } }); // src/services/codefixes/fixUnusedLabel.ts - function doChange18(changes, sourceFile, start) { + function doChange19(changes, sourceFile, start) { const token = getTokenAtPosition(sourceFile, start); const labeledStatement = cast(token.parent, isLabeledStatement); const pos = token.getStart(sourceFile); @@ -144033,17 +144106,17 @@ ${lanes.join("\n")} registerCodeFix({ errorCodes: errorCodes42, getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, context.sourceFile, context.span.start)); return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unused_label, fixId33, Diagnostics.Remove_all_unused_labels)]; }, fixIds: [fixId33], - getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange19(changes, diag2.file, diag2.start)) }); } }); // src/services/codefixes/fixJSDocTypes.ts - function doChange19(changes, sourceFile, oldTypeNode, newType, checker) { + function doChange20(changes, sourceFile, oldTypeNode, newType, checker) { changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( newType, /*enclosingDeclaration*/ @@ -144121,7 +144194,7 @@ ${lanes.join("\n")} } return actions2; function fix(type2, fixId51, fixAllDescription) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, sourceFile, typeNode, type2, checker)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, sourceFile, typeNode, type2, checker)); return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId51, fixAllDescription); } }, @@ -144135,7 +144208,7 @@ ${lanes.join("\n")} return; const { typeNode, type } = info; const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId51 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; - doChange19(changes, sourceFile, typeNode, fixedType, checker); + doChange20(changes, sourceFile, typeNode, fixedType, checker); }); } }); @@ -144143,7 +144216,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixMissingCallParentheses.ts - function doChange20(changes, sourceFile, name) { + function doChange21(changes, sourceFile, name) { changes.replaceNodeWithText(sourceFile, name, `${name.text}()`); } function getCallName(sourceFile, start) { @@ -144178,13 +144251,13 @@ ${lanes.join("\n")} const callName = getCallName(sourceFile, span.start); if (!callName) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, context.sourceFile, callName)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, context.sourceFile, callName)); return [createCodeFixAction(fixId34, changes, Diagnostics.Add_missing_call_parentheses, fixId34, Diagnostics.Add_all_missing_call_parentheses)]; }, getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => { const callName = getCallName(diag2.file, diag2.start); if (callName) - doChange20(changes, diag2.file, callName); + doChange21(changes, diag2.file, callName); }) }); } @@ -144226,7 +144299,7 @@ ${lanes.join("\n")} returnType: getReturnType(containingFunction) }; } - function doChange21(changes, sourceFile, { insertBefore, returnType }) { + function doChange22(changes, sourceFile, { insertBefore, returnType }) { if (returnType) { const entityName = getEntityNameFromTypeNode(returnType); if (!entityName || entityName.kind !== 79 /* Identifier */ || entityName.text !== "Promise") { @@ -144254,7 +144327,7 @@ ${lanes.join("\n")} const nodes = getNodes3(sourceFile, span.start); if (!nodes) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, sourceFile, nodes)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange22(t, sourceFile, nodes)); return [createCodeFixAction(fixId35, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId35, Diagnostics.Add_all_missing_async_modifiers)]; }, fixIds: [fixId35], @@ -144264,7 +144337,7 @@ ${lanes.join("\n")} const nodes = getNodes3(diag2.file, diag2.start); if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return; - doChange21(changes, context.sourceFile, nodes); + doChange22(changes, context.sourceFile, nodes); }); } }); @@ -144272,7 +144345,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixPropertyOverrideAccessor.ts - function doChange22(file, start, length2, code, context) { + function doChange23(file, start, length2, code, context) { let startPosition; let endPosition; if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) { @@ -144313,14 +144386,14 @@ ${lanes.join("\n")} registerCodeFix({ errorCodes: errorCodes46, getCodeActions(context) { - const edits = doChange22(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); + const edits = doChange23(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); if (edits) { return [createCodeFixAction(fixId36, edits, Diagnostics.Generate_get_and_set_accessors, fixId36, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; } }, fixIds: [fixId36], getAllCodeActions: (context) => codeFixAll(context, errorCodes46, (changes, diag2) => { - const edits = doChange22(diag2.file, diag2.start, diag2.length, diag2.code, context); + const edits = doChange23(diag2.file, diag2.start, diag2.length, diag2.code, context); if (edits) { for (const edit of edits) { changes.pushRaw(context.sourceFile, edit); @@ -144367,7 +144440,7 @@ ${lanes.join("\n")} } return errorCode; } - function doChange23(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { + function doChange24(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { if (!isParameterPropertyModifier(token.kind) && token.kind !== 79 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 108 /* ThisKeyword */) { return void 0; } @@ -145308,7 +145381,7 @@ ${lanes.join("\n")} const token = getTokenAtPosition(sourceFile, start); let declaration; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - declaration = doChange23( + declaration = doChange24( changes2, sourceFile, token, @@ -145329,7 +145402,7 @@ ${lanes.join("\n")} const { sourceFile, program, cancellationToken, host, preferences } = context; const markSeen = nodeSeenTracker(); return codeFixAll(context, errorCodes47, (changes, err) => { - doChange23(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); + doChange24(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); }); } }); @@ -145360,7 +145433,7 @@ ${lanes.join("\n")} return { returnTypeNode, returnType, promisedTypeNode, promisedType }; } } - function doChange24(changes, sourceFile, returnTypeNode, promisedTypeNode) { + function doChange25(changes, sourceFile, returnTypeNode, promisedTypeNode) { changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode])); } var fixId38, errorCodes48; @@ -145384,7 +145457,7 @@ ${lanes.join("\n")} return void 0; } const { returnTypeNode, returnType, promisedTypeNode, promisedType } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, sourceFile, returnTypeNode, promisedTypeNode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, sourceFile, returnTypeNode, promisedTypeNode)); return [createCodeFixAction( fixId38, changes, @@ -145400,7 +145473,7 @@ ${lanes.join("\n")} getAllCodeActions: (context) => codeFixAll(context, errorCodes48, (changes, diag2) => { const info = getInfo12(diag2.file, context.program.getTypeChecker(), diag2.start); if (info) { - doChange24(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); + doChange25(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); } }) }); @@ -146602,7 +146675,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/requireInTs.ts - function doChange25(changes, sourceFile, info) { + function doChange26(changes, sourceFile, info) { const { allowSyntheticDefaults, defaultImportName, namedImports, statement, required } = info; changes.replaceNode(sourceFile, statement, defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( /*modifiers*/ @@ -146679,14 +146752,14 @@ ${lanes.join("\n")} if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, context.sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, context.sourceFile, info)); return [createCodeFixAction(fixId40, changes, Diagnostics.Convert_require_to_import, fixId40, Diagnostics.Convert_all_require_to_import)]; }, fixIds: [fixId40], getAllCodeActions: (context) => codeFixAll(context, errorCodes51, (changes, diag2) => { const info = getInfo14(diag2.file, context.program, diag2.start); if (info) { - doChange25(changes, context.sourceFile, info); + doChange26(changes, context.sourceFile, info); } }) }); @@ -146706,7 +146779,7 @@ ${lanes.join("\n")} return { importNode, name, moduleSpecifier: importNode.moduleSpecifier }; } } - function doChange26(changes, sourceFile, info, preferences) { + function doChange27(changes, sourceFile, info, preferences) { changes.replaceNode(sourceFile, info.importNode, makeImport( info.name, /*namedImports*/ @@ -146730,14 +146803,14 @@ ${lanes.join("\n")} const info = getInfo15(sourceFile, start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, sourceFile, info, context.preferences)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, info, context.preferences)); return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_to_default_import, fixId41, Diagnostics.Convert_all_to_default_imports)]; }, fixIds: [fixId41], getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { const info = getInfo15(diag2.file, diag2.start); if (info) - doChange26(changes, diag2.file, info, context.preferences); + doChange27(changes, diag2.file, info, context.preferences); }) }); } @@ -146785,7 +146858,7 @@ ${lanes.join("\n")} Debug.assert(token.parent.kind === 202 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } - function doChange27(changes, sourceFile, importType) { + function doChange28(changes, sourceFile, importType) { const newTypeNode = factory.updateImportTypeNode( importType, importType.argument, @@ -146811,11 +146884,11 @@ ${lanes.join("\n")} getCodeActions: function getCodeActionsToAddMissingTypeof(context) { const { sourceFile, span } = context; const importType = getImportTypeNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, importType)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, importType)); return [createCodeFixAction(fixId43, changes, Diagnostics.Add_missing_typeof, fixId43, Diagnostics.Add_missing_typeof)]; }, fixIds: [fixId43], - getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange27(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange28(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) }); } }); @@ -146834,7 +146907,7 @@ ${lanes.join("\n")} return void 0; return binaryExpr; } - function doChange28(changeTracker, sf, node) { + function doChange29(changeTracker, sf, node) { const jsx = flattenInvalidBinaryExpr(node); if (jsx) changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment())); @@ -146872,7 +146945,7 @@ ${lanes.join("\n")} const node = findNodeToFix(sourceFile, span.start); if (!node) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, node)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, node)); return [createCodeFixAction(fixID2, changes, Diagnostics.Wrap_in_JSX_fragment, fixID2, Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]; }, fixIds: [fixID2], @@ -146880,7 +146953,7 @@ ${lanes.join("\n")} const node = findNodeToFix(context.sourceFile, diag2.start); if (!node) return void 0; - doChange28(changes, context.sourceFile, node); + doChange29(changes, context.sourceFile, node); }) }); } @@ -146900,7 +146973,7 @@ ${lanes.join("\n")} function createTypeAliasFromInterface(declaration, type) { return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type); } - function doChange29(changes, sourceFile, { indexSignature, container }) { + function doChange30(changes, sourceFile, { indexSignature, container }) { const members = isInterfaceDeclaration(container) ? container.members : container.type.members; const otherMembers = members.filter((member) => !isIndexSignatureDeclaration(member)); const parameter = first(indexSignature.parameters); @@ -146942,7 +147015,7 @@ ${lanes.join("\n")} const info = getInfo16(sourceFile, span.start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info)); const name = idText(info.container.name); return [createCodeFixAction(fixId44, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId44, [Diagnostics.Convert_0_to_mapped_object_type, name])]; }, @@ -146950,7 +147023,7 @@ ${lanes.join("\n")} getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { const info = getInfo16(diag2.file, diag2.start); if (info) - doChange29(changes, diag2.file, info); + doChange30(changes, diag2.file, info); }) }); } @@ -147111,7 +147184,7 @@ ${lanes.join("\n")} return; return { symbol, token: constToken }; } - function doChange30(changes, sourceFile, token) { + function doChange31(changes, sourceFile, token) { changes.replaceNode(sourceFile, token, factory.createToken(119 /* LetKeyword */)); } var fixId48, errorCodes60; @@ -147129,7 +147202,7 @@ ${lanes.join("\n")} const info = getInfo17(sourceFile, span.start, program); if (info === void 0) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info.token)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info.token)); return [createCodeFixActionMaybeFixAll(fixId48, changes, Diagnostics.Convert_const_to_let, fixId48, Diagnostics.Convert_all_const_to_let)]; }, getAllCodeActions: (context) => { @@ -147140,7 +147213,7 @@ ${lanes.join("\n")} const info = getInfo17(diag2.file, diag2.start, program); if (info) { if (addToSeen(seen, getSymbolId(info.symbol))) { - return doChange30(changes, diag2.file, info.token); + return doChange31(changes, diag2.file, info.token); } } return void 0; @@ -147157,7 +147230,7 @@ ${lanes.join("\n")} const node = getTokenAtPosition(sourceFile, pos); return node.kind === 26 /* SemicolonToken */ && node.parent && (isObjectLiteralExpression(node.parent) || isArrayLiteralExpression(node.parent)) ? { node } : void 0; } - function doChange31(changes, sourceFile, { node }) { + function doChange32(changes, sourceFile, { node }) { const newNode = factory.createToken(27 /* CommaToken */); changes.replaceNode(sourceFile, node, newNode); } @@ -147177,7 +147250,7 @@ ${lanes.join("\n")} const info = getInfo18(sourceFile, context.span.start, context.errorCode); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(t, sourceFile, info)); return [createCodeFixAction( fixId49, changes, @@ -147190,7 +147263,7 @@ ${lanes.join("\n")} getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, diag2) => { const info = getInfo18(diag2.file, diag2.start, diag2.code); if (info) - doChange31(changes, context.sourceFile, info); + doChange32(changes, context.sourceFile, info); }) }); } @@ -156486,7 +156559,7 @@ ${lanes.join("\n")} return void 0; } } - function doChange32(exportingSourceFile, program, info, changes, cancellationToken) { + function doChange33(exportingSourceFile, program, info, changes, cancellationToken) { changeExport(exportingSourceFile, info, changes, program.getTypeChecker()); changeImports(program, info, changes, cancellationToken); } @@ -156682,7 +156755,7 @@ ${lanes.join("\n")} Debug.assert(actionName2 === defaultToNamedAction.name || actionName2 === namedToDefaultAction.name, "Unexpected action name"); const info = getInfo19(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(context.file, context.program, info, t, context.cancellationToken)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, info, t, context.cancellationToken)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -156717,7 +156790,7 @@ ${lanes.join("\n")} function getShouldUseDefault(program, importClause) { return getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); } - function doChange33(sourceFile, program, changes, info) { + function doChange34(sourceFile, program, changes, info) { const checker = program.getTypeChecker(); if (info.convertTo === 0 /* Named */) { doChangeNamespaceToNamed(sourceFile, checker, changes, info.import, getAllowSyntheticDefaultImports(program.getCompilerOptions())); @@ -156909,7 +156982,7 @@ ${lanes.join("\n")} Debug.assert(some(getOwnValues(actions), (action) => action.name === actionName2), "Unexpected action name"); const info = getImportConversionInfo(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, t, info)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, t, info)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -157251,7 +157324,7 @@ ${lanes.join("\n")} afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex] }; } - function doChange34(oldFile, program, toMove, changes, host, preferences) { + function doChange35(oldFile, program, toMove, changes, host, preferences) { const checker = program.getTypeChecker(); const usage = getUsageInfo(oldFile, toMove.all, checker); const currentDirectory = getDirectoryPath(oldFile.fileName); @@ -158021,7 +158094,7 @@ ${lanes.join("\n")} getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) { Debug.assert(actionName2 === refactorName4, "Wrong refactor invoked"); const statements = Debug.checkDefined(getStatementsToMove(context)); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, statements, t, context.host, context.preferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(context.file, context.program, statements, t, context.host, context.preferences)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -158683,12 +158756,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; const groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); if (groupedReferences.valid) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(file, program, host, t, functionDeclaration, groupedReferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(file, program, host, t, functionDeclaration, groupedReferences)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return { edits: [] }; } - function doChange35(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { + function doChange36(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { const signature = groupedReferences.signature; const newFunctionDeclarationParams = map(createNewParameters(functionDeclaration, program, host), (param) => getSynthesizedDeepClone(param)); if (signature) { @@ -159481,7 +159554,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); const edits = ts_textChanges_exports.ChangeTracker.with( context, - (t) => doChange36(context.file, context.program.getTypeChecker(), t, info, actionName2) + (t) => doChange37(context.file, context.program.getTypeChecker(), t, info, actionName2) ); return { edits, renameFilename: void 0, renameLocation: void 0 }; } @@ -159637,7 +159710,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return toConvert; } - function doChange36(sourceFile, checker, changes, info, _actionName) { + function doChange37(sourceFile, checker, changes, info, _actionName) { const { finalExpression, occurrences, expression } = info; const firstOccurrence = occurrences[occurrences.length - 1]; const convertedChain = convertOccurrences(checker, finalExpression, occurrences); @@ -161373,7 +161446,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getRefactorEditsToInferReturnType(context) { const info = getInfo21(context); if (info && !isRefactorErrorInfo(info)) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(context.file, t, info.declaration, info.returnTypeNode)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange38(context.file, t, info.declaration, info.returnTypeNode)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return void 0; @@ -161398,7 +161471,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return emptyArray; } - function doChange37(sourceFile, changes, declaration, typeNode) { + function doChange38(sourceFile, changes, declaration, typeNode) { const closeParen = findChildOfKind(declaration, 21 /* CloseParenToken */, sourceFile); const needParens = isArrowFunction(declaration) && closeParen === void 0; const endNode2 = needParens ? first(declaration.parameters) : closeParen; @@ -178278,7 +178351,6 @@ ${e.message}`; ContextFlags: () => ContextFlags, CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter, Debug: () => Debug, - DeprecationVersion: () => DeprecationVersion, DiagnosticCategory: () => DiagnosticCategory, Diagnostics: () => Diagnostics, DocumentHighlights: () => DocumentHighlights, @@ -180638,7 +180710,6 @@ ${e.message}`; ContextFlags: () => ContextFlags, CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter, Debug: () => Debug, - DeprecationVersion: () => DeprecationVersion, DiagnosticCategory: () => DiagnosticCategory, Diagnostics: () => Diagnostics, DocumentHighlights: () => DocumentHighlights, diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 2201712f7c4eb..4b06d971712f5 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -3016,6 +3016,12 @@ declare namespace ts { } enum ModuleResolutionKind { Classic = 1, + /** + * @deprecated + * `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets. + * Use the new name or consider switching to a modern module resolution target. + */ + NodeJs = 2, Node10 = 2, Node16 = 3, NodeNext = 99, diff --git a/lib/typescript.js b/lib/typescript.js index 4b53c156ee249..8eecfac202aaf 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -35,7 +35,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = `${versionMajorMinor}.1-rc`; + version = "5.0.2"; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -3585,7 +3585,7 @@ ${lanes.join("\n")} const name = DiagnosticCategory[d.category]; return lowerCase ? name.toLowerCase() : name; } - var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, DeprecationVersion; + var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas; var init_types = __esm({ "src/compiler/types.ts"() { "use strict"; @@ -4686,6 +4686,7 @@ ${lanes.join("\n")} })(DiagnosticCategory || {}); ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => { ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic"; + ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs"; ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10"; ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16"; ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext"; @@ -5250,12 +5251,6 @@ ${lanes.join("\n")} kind: 4 /* MultiLine */ } }; - DeprecationVersion = /* @__PURE__ */ ((DeprecationVersion2) => { - DeprecationVersion2["v5_0"] = "5.0"; - DeprecationVersion2["v5_5"] = "5.5"; - DeprecationVersion2["v6_0"] = "6.0"; - return DeprecationVersion2; - })(DeprecationVersion || {}); } }); @@ -8180,12 +8175,14 @@ ${lanes.join("\n")} Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), - Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), + Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), + Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), + Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`), + Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -60582,6 +60579,9 @@ ${lanes.join("\n")} function isTypeSubtypeOf(source, target) { return isTypeRelatedTo(source, target, subtypeRelation); } + function isTypeStrictSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, strictSubtypeRelation); + } function isTypeAssignableTo(source, target) { return isTypeRelatedTo(source, target, assignableRelation); } @@ -62490,7 +62490,7 @@ ${lanes.join("\n")} 0 /* None */ ); } - } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { + } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { result2 &= propertiesRelatedTo( source2, target2, @@ -67677,7 +67677,7 @@ ${lanes.join("\n")} const narrowedType = mapType(candidate, (c) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType); + const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -115770,6 +115770,7 @@ ${lanes.join("\n")} const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions; let { oldProgram } = createProgramOptions; + const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations)); let processingDefaultLibFiles; let processingOtherFiles; let files; @@ -118196,127 +118197,131 @@ ${lanes.join("\n")} } } } - function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) { - const version2 = typeScriptVersion3 || versionMajorMinor; + function getIgnoreDeprecationsVersion() { const ignoreDeprecations = options.ignoreDeprecations; if (ignoreDeprecations) { - if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) { - return; - } else if (reportInvalidIgnoreDeprecations) { - createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); - } + if (ignoreDeprecations === "5.0") { + return new Version(ignoreDeprecations); + } + reportInvalidIgnoreDeprecations(); + } + return Version.zero; + } + function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) { + const deprecatedInVersion = new Version(deprecatedIn); + const removedInVersion = new Version(removedIn); + const typescriptVersion = new Version(typeScriptVersion3 || versionMajorMinor); + const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion(); + const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */); + const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */; + if (mustBeRemoved || canBeSilenced) { + fn((name, value, useInstead) => { + if (mustBeRemoved) { + if (value === void 0) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name); + } else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value); + } + } else { + if (value === void 0) { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn); + } else { + createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn); + } + } + }); } - return version2; } function verifyDeprecatedCompilerOptions() { - const version2 = getVersionForDeprecationDiagnostics( - /*reportInvalidIgnoreDeprecations*/ - true - ); - if (!version2) - return; - if (options.target === 0 /* ES3 */) { - createDeprecatedDiagnosticForOption(version2, "target", "ES3"); - } - if (options.noImplicitUseStrict) { - createDeprecatedDiagnosticForOption(version2, "noImplicitUseStrict"); - } - if (options.keyofStringsOnly) { - createDeprecatedDiagnosticForOption(version2, "keyofStringsOnly"); - } - if (options.suppressExcessPropertyErrors) { - createDeprecatedDiagnosticForOption(version2, "suppressExcessPropertyErrors"); - } - if (options.suppressImplicitAnyIndexErrors) { - createDeprecatedDiagnosticForOption(version2, "suppressImplicitAnyIndexErrors"); - } - if (options.noStrictGenericChecks) { - createDeprecatedDiagnosticForOption(version2, "noStrictGenericChecks"); - } - if (options.charset) { - createDeprecatedDiagnosticForOption(version2, "charset"); - } - if (options.out) { - createDeprecatedDiagnosticForOption(version2, "out"); - } - if (options.importsNotUsedAsValues) { - createDeprecatedDiagnosticForOption( - version2, - "importsNotUsedAsValues", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - if (options.preserveValueImports) { - createDeprecatedDiagnosticForOption( - version2, - "preserveValueImports", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - } - function verifyDeprecatedProjectReference(ref, parentFile, index) { - if (ref.prepend) { - const version2 = getVersionForDeprecationDiagnostics( - /*reportInvalidIgnoreDeprecations*/ - false - ); - if (version2) { - createDeprecatedOptionForVersionDiagnostic( - version2, - (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2), - "prepend" + function createDiagnostic(name, value, useInstead, message, arg0, arg1, arg2, arg3) { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2, arg3); + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + chain + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value, + name, + /*option2*/ + void 0, + message, + arg0, + arg1, + arg2, + arg3 ); } } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (options.target === 0 /* ES3 */) { + createDeprecatedDiagnostic("target", "ES3"); + } + if (options.noImplicitUseStrict) { + createDeprecatedDiagnostic("noImplicitUseStrict"); + } + if (options.keyofStringsOnly) { + createDeprecatedDiagnostic("keyofStringsOnly"); + } + if (options.suppressExcessPropertyErrors) { + createDeprecatedDiagnostic("suppressExcessPropertyErrors"); + } + if (options.suppressImplicitAnyIndexErrors) { + createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors"); + } + if (options.noStrictGenericChecks) { + createDeprecatedDiagnostic("noStrictGenericChecks"); + } + if (options.charset) { + createDeprecatedDiagnostic("charset"); + } + if (options.out) { + createDeprecatedDiagnostic( + "out", + /*value*/ + void 0, + "outFile" + ); + } + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnostic( + "importsNotUsedAsValues", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + if (options.preserveValueImports) { + createDeprecatedDiagnostic( + "preserveValueImports", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + }); } - function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) { - return createDeprecatedOptionForVersionDiagnostic( - version2, - (message, arg0, arg1, arg2) => { - if (useInstead) { - const details = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Use_0_instead, - useInstead - ); - const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2); - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - chain - ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - message, - arg0, - arg1, - arg2 - ); - } - }, - name, - value - ); - } - function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) { - if (version2 === "6.0" /* v6_0 */) { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name); - } else { - createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */); + function verifyDeprecatedProjectReference(ref, parentFile, index) { + function createDiagnostic(_name, _value, _useInstead, message, arg0, arg1, arg2, arg3) { + createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2, arg3); } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (ref.prepend) { + createDeprecatedDiagnostic("prepend"); + } + }); } function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { var _a3; @@ -118569,25 +118574,25 @@ ${lanes.join("\n")} arg1 ); } - function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) { + function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2, arg3) { const referencesSyntax = firstDefined( getTsConfigPropArray(sourceFile || options.configFile, "references"), (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 ); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2, arg3)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } - function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { + function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2, arg3) { const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); - const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); + const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2, arg3); if (needCompilerDiagnostic) { if ("messageText" in message) { programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2)); + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3)); } } } @@ -118606,13 +118611,13 @@ ${lanes.join("\n")} } return _compilerOptionsObjectLiteralSyntax || void 0; } - function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2, arg3) { const props = getPropertyAssignment(objectLiteral, key1, key2); for (const prop of props) { if ("messageText" in message) { programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); } else { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2, arg3)); } } return !!props.length; @@ -139792,32 +139797,96 @@ ${lanes.join("\n")} }); // src/services/codefixes/convertToTypeOnlyImport.ts - function getImportDeclarationForDiagnosticSpan(span, sourceFile) { - return tryCast(getTokenAtPosition(sourceFile, span.start).parent, isImportDeclaration); + function getDeclaration2(sourceFile, pos) { + const { parent: parent2 } = getTokenAtPosition(sourceFile, pos); + return isImportSpecifier(parent2) || isImportDeclaration(parent2) && parent2.importClause ? parent2 : void 0; } - function fixSingleImportDeclaration(changes, importDeclaration, context) { - if (!(importDeclaration == null ? void 0 : importDeclaration.importClause)) { - return; - } - const { importClause } = importDeclaration; - changes.insertText(context.sourceFile, importDeclaration.getStart() + "import".length, " type"); - if (importClause.name && importClause.namedBindings) { - changes.deleteNodeRangeExcludingEnd(context.sourceFile, importClause.name, importDeclaration.importClause.namedBindings); - changes.insertNodeBefore(context.sourceFile, importDeclaration, factory.updateImportDeclaration( - importDeclaration, - /*modifiers*/ - void 0, - factory.createImportClause( - /*isTypeOnly*/ - true, - importClause.name, - /*namedBindings*/ - void 0 - ), - importDeclaration.moduleSpecifier, - /*assertClause*/ - void 0 + function doChange4(changes, sourceFile, declaration) { + if (isImportSpecifier(declaration)) { + changes.replaceNode(sourceFile, declaration, factory.updateImportSpecifier( + declaration, + /*isTypeOnly*/ + true, + declaration.propertyName, + declaration.name )); + } else { + const importClause = declaration.importClause; + if (importClause.name && importClause.namedBindings) { + changes.replaceNodeWithNodes(sourceFile, declaration, [ + factory.createImportDeclaration( + getSynthesizedDeepClones( + declaration.modifiers, + /*includeTrivia*/ + true + ), + factory.createImportClause( + /*isTypeOnly*/ + true, + getSynthesizedDeepClone( + importClause.name, + /*includeTrivia*/ + true + ), + /*namedBindings*/ + void 0 + ), + getSynthesizedDeepClone( + declaration.moduleSpecifier, + /*includeTrivia*/ + true + ), + getSynthesizedDeepClone( + declaration.assertClause, + /*includeTrivia*/ + true + ) + ), + factory.createImportDeclaration( + getSynthesizedDeepClones( + declaration.modifiers, + /*includeTrivia*/ + true + ), + factory.createImportClause( + /*isTypeOnly*/ + true, + /*name*/ + void 0, + getSynthesizedDeepClone( + importClause.namedBindings, + /*includeTrivia*/ + true + ) + ), + getSynthesizedDeepClone( + declaration.moduleSpecifier, + /*includeTrivia*/ + true + ), + getSynthesizedDeepClone( + declaration.assertClause, + /*includeTrivia*/ + true + ) + ) + ]); + } else { + const importDeclaration = factory.updateImportDeclaration( + declaration, + declaration.modifiers, + factory.updateImportClause( + importClause, + /*isTypeOnly*/ + true, + importClause.name, + importClause.namedBindings + ), + declaration.moduleSpecifier, + declaration.assertClause + ); + changes.replaceNode(sourceFile, declaration, importDeclaration); + } } } var errorCodes14, fixId13; @@ -139826,24 +139895,28 @@ ${lanes.join("\n")} "use strict"; init_ts4(); init_ts_codefix(); - errorCodes14 = [Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code]; + errorCodes14 = [ + Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code, + Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code + ]; fixId13 = "convertToTypeOnlyImport"; registerCodeFix({ errorCodes: errorCodes14, getCodeActions: function getCodeActionsToConvertToTypeOnlyImport(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - const importDeclaration = getImportDeclarationForDiagnosticSpan(context.span, context.sourceFile); - fixSingleImportDeclaration(t, importDeclaration, context); - }); - if (changes.length) { + const declaration = getDeclaration2(context.sourceFile, context.span.start); + if (declaration) { + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(t, context.sourceFile, declaration)); return [createCodeFixAction(fixId13, changes, Diagnostics.Convert_to_type_only_import, fixId13, Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]; } + return void 0; }, fixIds: [fixId13], getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context) { return codeFixAll(context, errorCodes14, (changes, diag2) => { - const importDeclaration = getImportDeclarationForDiagnosticSpan(diag2, context.sourceFile); - fixSingleImportDeclaration(changes, importDeclaration, context); + const declaration = getDeclaration2(diag2.file, diag2.start); + if (declaration) { + doChange4(changes, diag2.file, declaration); + } }); } }); @@ -139865,7 +139938,7 @@ ${lanes.join("\n")} } return void 0; } - function doChange4(changes, sourceFile, { container, typeNode, constraint, name }) { + function doChange5(changes, sourceFile, { container, typeNode, constraint, name }) { changes.replaceNode(sourceFile, container, factory.createMappedTypeNode( /*readonlyToken*/ void 0, @@ -139901,14 +139974,14 @@ ${lanes.join("\n")} return void 0; } const { name, constraint } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange5(t, sourceFile, info)); return [createCodeFixAction(fixId14, changes, [Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId14, Diagnostics.Convert_all_type_literals_to_mapped_type)]; }, fixIds: [fixId14], getAllCodeActions: (context) => codeFixAll(context, errorCodes15, (changes, diag2) => { const info = getInfo2(diag2.file, diag2.start); if (info) { - doChange4(changes, diag2.file, info); + doChange5(changes, diag2.file, info); } }) }); @@ -141510,7 +141583,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixNoPropertyAccessFromIndexSignature.ts - function doChange5(changes, sourceFile, node, preferences) { + function doChange6(changes, sourceFile, node, preferences) { const quotePreference = getQuotePreference(sourceFile, preferences); const argumentsExpression = factory.createStringLiteral(node.name.text, quotePreference === 0 /* Single */); changes.replaceNode( @@ -141538,16 +141611,16 @@ ${lanes.join("\n")} getCodeActions(context) { const { sourceFile, span, preferences } = context; const property = getPropertyAccessExpression(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange5(t, context.sourceFile, property, preferences)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange6(t, context.sourceFile, property, preferences)); return [createCodeFixAction(fixId17, changes, [Diagnostics.Use_element_access_for_0, property.name.text], fixId17, Diagnostics.Use_element_access_for_all_undeclared_properties)]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes20, (changes, diag2) => doChange5(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context.preferences)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes20, (changes, diag2) => doChange6(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context.preferences)) }); } }); // src/services/codefixes/fixImplicitThis.ts - function doChange6(changes, sourceFile, pos, checker) { + function doChange7(changes, sourceFile, pos, checker) { const token = getTokenAtPosition(sourceFile, pos); if (!isThis(token)) return void 0; @@ -141602,13 +141675,13 @@ ${lanes.join("\n")} const { sourceFile, program, span } = context; let diagnostic; const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - diagnostic = doChange6(t, sourceFile, span.start, program.getTypeChecker()); + diagnostic = doChange7(t, sourceFile, span.start, program.getTypeChecker()); }); return diagnostic ? [createCodeFixAction(fixId18, changes, diagnostic, fixId18, Diagnostics.Fix_all_implicit_this_errors)] : emptyArray; }, fixIds: [fixId18], getAllCodeActions: (context) => codeFixAll(context, errorCodes21, (changes, diag2) => { - doChange6(changes, diag2.file, diag2.start, context.program.getTypeChecker()); + doChange7(changes, diag2.file, diag2.start, context.program.getTypeChecker()); }) }); } @@ -141651,7 +141724,7 @@ ${lanes.join("\n")} } return void 0; } - function doChange7(changes, program, { exportName, node, moduleSourceFile }) { + function doChange8(changes, program, { exportName, node, moduleSourceFile }) { const exportDeclaration = tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly); if (exportDeclaration) { updateExport(changes, program, moduleSourceFile, exportDeclaration, [exportName]); @@ -141751,7 +141824,7 @@ ${lanes.join("\n")} const info = getInfo4(sourceFile, span.start, program); if (info === void 0) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange7(t, program, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange8(t, program, info)); return [createCodeFixAction(fixId19, changes, [Diagnostics.Export_0_from_module_1, info.exportName.node.text, info.moduleSpecifier], fixId19, Diagnostics.Export_all_referenced_locals)]; }, getAllCodeActions(context) { @@ -141803,7 +141876,7 @@ ${lanes.join("\n")} const token = getTokenAtPosition(sourceFile, pos); return findAncestor(token, (t) => t.kind === 199 /* NamedTupleMember */); } - function doChange8(changes, sourceFile, namedTupleMember) { + function doChange9(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { return; } @@ -141846,7 +141919,7 @@ ${lanes.join("\n")} getCodeActions: function getCodeActionsToFixIncorrectNamedTupleSyntax(context) { const { sourceFile, span } = context; const namedTupleMember = getNamedTupleMember(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange8(t, sourceFile, namedTupleMember)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange9(t, sourceFile, namedTupleMember)); return [createCodeFixAction(fixId20, changes, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels, fixId20, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]; }, fixIds: [fixId20] @@ -141904,7 +141977,7 @@ ${lanes.join("\n")} } return suggestedSymbol === void 0 ? void 0 : { node, suggestedSymbol }; } - function doChange9(changes, sourceFile, node, suggestedSymbol, target) { + function doChange10(changes, sourceFile, node, suggestedSymbol, target) { const suggestion = symbolName(suggestedSymbol); if (!isIdentifierText(suggestion, target) && isPropertyAccessExpression(node.parent)) { const valDecl = suggestedSymbol.valueDeclaration; @@ -141970,7 +142043,7 @@ ${lanes.join("\n")} return void 0; const { node, suggestedSymbol } = info; const target = getEmitScriptTarget(context.host.getCompilationSettings()); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange9(t, sourceFile, node, suggestedSymbol, target)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange10(t, sourceFile, node, suggestedSymbol, target)); return [createCodeFixAction("spelling", changes, [Diagnostics.Change_spelling_to_0, symbolName(suggestedSymbol)], fixId21, Diagnostics.Fix_all_detected_spelling_errors)]; }, fixIds: [fixId21], @@ -141978,7 +142051,7 @@ ${lanes.join("\n")} const info = getInfo5(diag2.file, diag2.start, context, diag2.code); const target = getEmitScriptTarget(context.host.getCompilationSettings()); if (info) - doChange9(changes, context.sourceFile, info.node, info.suggestedSymbol, target); + doChange10(changes, context.sourceFile, info.node, info.suggestedSymbol, target); }) }); } @@ -143037,7 +143110,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts - function doChange10(changes, sourceFile, constructor, superCall) { + function doChange11(changes, sourceFile, constructor, superCall) { changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); changes.delete(sourceFile, superCall); } @@ -143068,7 +143141,7 @@ ${lanes.join("\n")} if (!nodes) return void 0; const { constructor, superCall } = nodes; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange10(t, sourceFile, constructor, superCall)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, sourceFile, constructor, superCall)); return [createCodeFixAction(fixId25, changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId25, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]; }, fixIds: [fixId25], @@ -143081,7 +143154,7 @@ ${lanes.join("\n")} return; const { constructor, superCall } = nodes; if (addToSeen(seenClasses, getNodeId(constructor.parent))) { - doChange10(changes, sourceFile, constructor, superCall); + doChange11(changes, sourceFile, constructor, superCall); } }); } @@ -143095,7 +143168,7 @@ ${lanes.join("\n")} Debug.assert(isConstructorDeclaration(token.parent), "token should be at the constructor declaration"); return token.parent; } - function doChange11(changes, sourceFile, ctr) { + function doChange12(changes, sourceFile, ctr) { const superCall = factory.createExpressionStatement(factory.createCallExpression( factory.createSuper(), /*typeArguments*/ @@ -143118,17 +143191,17 @@ ${lanes.join("\n")} getCodeActions(context) { const { sourceFile, span } = context; const ctr = getNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, sourceFile, ctr)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange12(t, sourceFile, ctr)); return [createCodeFixAction(fixId26, changes, Diagnostics.Add_missing_super_call, fixId26, Diagnostics.Add_all_missing_super_calls)]; }, fixIds: [fixId26], - getAllCodeActions: (context) => codeFixAll(context, errorCodes31, (changes, diag2) => doChange11(changes, context.sourceFile, getNode(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes31, (changes, diag2) => doChange12(changes, context.sourceFile, getNode(diag2.file, diag2.start))) }); } }); // src/services/codefixes/fixEnableJsxFlag.ts - function doChange12(changeTracker, configFile) { + function doChange13(changeTracker, configFile) { setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react")); } var fixID, errorCodes32; @@ -143148,7 +143221,7 @@ ${lanes.join("\n")} } const changes = ts_textChanges_exports.ChangeTracker.with( context, - (changeTracker) => doChange12(changeTracker, configFile) + (changeTracker) => doChange13(changeTracker, configFile) ); return [ createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) @@ -143160,7 +143233,7 @@ ${lanes.join("\n")} if (configFile === void 0) { return void 0; } - doChange12(changes, configFile); + doChange13(changes, configFile); }) }); } @@ -143182,7 +143255,7 @@ ${lanes.join("\n")} } return void 0; } - function doChange13(changes, sourceFile, arg, expression) { + function doChange14(changes, sourceFile, arg, expression) { const callExpression = factory.createCallExpression( factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")), /*typeArguments*/ @@ -143218,7 +143291,7 @@ ${lanes.join("\n")} if (info === void 0) return; const { suggestion, expression, arg } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange13(t, sourceFile, arg, expression)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, sourceFile, arg, expression)); return [createCodeFixAction(fixId27, changes, [Diagnostics.Use_0, suggestion], fixId27, Diagnostics.Use_Number_isNaN_in_all_conditions)]; }, fixIds: [fixId27], @@ -143226,7 +143299,7 @@ ${lanes.join("\n")} return codeFixAll(context, errorCodes33, (changes, diag2) => { const info = getInfo8(context.program, diag2.file, createTextSpan(diag2.start, diag2.length)); if (info) { - doChange13(changes, diag2.file, info.arg, info.expression); + doChange14(changes, diag2.file, info.arg, info.expression); } }); } @@ -143282,7 +143355,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixPropertyAssignment.ts - function doChange14(changes, sourceFile, node) { + function doChange15(changes, sourceFile, node) { changes.replaceNode(sourceFile, node, factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer)); } function getProperty2(sourceFile, pos) { @@ -143304,10 +143377,10 @@ ${lanes.join("\n")} getCodeActions(context) { const { sourceFile, span } = context; const property = getProperty2(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile, property)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, context.sourceFile, property)); return [createCodeFixAction(fixId28, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId28, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange14(changes, diag2.file, getProperty2(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange15(changes, diag2.file, getProperty2(diag2.file, diag2.start))) }); } }); @@ -143369,7 +143442,7 @@ ${lanes.join("\n")} return { node, className: diagCode === didYouMeanStaticMemberCode ? getContainingClass(node).name.text : void 0 }; } } - function doChange15(changes, sourceFile, { node, className }) { + function doChange16(changes, sourceFile, { node, className }) { suppressLeadingAndTrailingTrivia(node); changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node)); } @@ -143394,14 +143467,14 @@ ${lanes.join("\n")} if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange15(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16(t, sourceFile, info)); return [createCodeFixAction(fixId30, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId30, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; }, fixIds: [fixId30], getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => { const info = getInfo9(diag2.file, diag2.start, diag2.code); if (info) - doChange15(changes, context.sourceFile, info); + doChange16(changes, context.sourceFile, info); }) }); } @@ -143411,7 +143484,7 @@ ${lanes.join("\n")} function isValidCharacter(character) { return hasProperty(htmlEntity, character); } - function doChange16(changes, preferences, sourceFile, start, useHtmlEntity) { + function doChange17(changes, preferences, sourceFile, start, useHtmlEntity) { const character = sourceFile.getText()[start]; if (!isValidCharacter(character)) { return; @@ -143436,7 +143509,7 @@ ${lanes.join("\n")} fixIds: [fixIdExpression, fixIdHtmlEntity], getCodeActions(context) { const { sourceFile, preferences, span } = context; - const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( + const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( t, preferences, sourceFile, @@ -143444,7 +143517,7 @@ ${lanes.join("\n")} /* useHtmlEntity */ false )); - const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16( + const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17( t, preferences, sourceFile, @@ -143458,7 +143531,7 @@ ${lanes.join("\n")} ]; }, getAllCodeActions(context) { - return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange16(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); + return codeFixAll(context, errorCodes37, (changes, diagnostic) => doChange17(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); } }); htmlEntity = { @@ -143951,7 +144024,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixUnreachableCode.ts - function doChange17(changes, sourceFile, start, length2, errorCode) { + function doChange18(changes, sourceFile, start, length2, errorCode) { const token = getTokenAtPosition(sourceFile, start); const statement = findAncestor(token, isStatement); if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { @@ -144013,17 +144086,17 @@ ${lanes.join("\n")} const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken); if (syntacticDiagnostics.length) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); return [createCodeFixAction(fixId32, changes, Diagnostics.Remove_unreachable_code, fixId32, Diagnostics.Remove_all_unreachable_code)]; }, fixIds: [fixId32], - getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange17(changes, diag2.file, diag2.start, diag2.length, diag2.code)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes41, (changes, diag2) => doChange18(changes, diag2.file, diag2.start, diag2.length, diag2.code)) }); } }); // src/services/codefixes/fixUnusedLabel.ts - function doChange18(changes, sourceFile, start) { + function doChange19(changes, sourceFile, start) { const token = getTokenAtPosition(sourceFile, start); const labeledStatement = cast(token.parent, isLabeledStatement); const pos = token.getStart(sourceFile); @@ -144047,17 +144120,17 @@ ${lanes.join("\n")} registerCodeFix({ errorCodes: errorCodes42, getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, context.sourceFile, context.span.start)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, context.sourceFile, context.span.start)); return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unused_label, fixId33, Diagnostics.Remove_all_unused_labels)]; }, fixIds: [fixId33], - getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange18(changes, diag2.file, diag2.start)) + getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange19(changes, diag2.file, diag2.start)) }); } }); // src/services/codefixes/fixJSDocTypes.ts - function doChange19(changes, sourceFile, oldTypeNode, newType, checker) { + function doChange20(changes, sourceFile, oldTypeNode, newType, checker) { changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( newType, /*enclosingDeclaration*/ @@ -144135,7 +144208,7 @@ ${lanes.join("\n")} } return actions2; function fix(type2, fixId51, fixAllDescription) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, sourceFile, typeNode, type2, checker)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, sourceFile, typeNode, type2, checker)); return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId51, fixAllDescription); } }, @@ -144149,7 +144222,7 @@ ${lanes.join("\n")} return; const { typeNode, type } = info; const fixedType = typeNode.kind === 317 /* JSDocNullableType */ && fixId51 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; - doChange19(changes, sourceFile, typeNode, fixedType, checker); + doChange20(changes, sourceFile, typeNode, fixedType, checker); }); } }); @@ -144157,7 +144230,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixMissingCallParentheses.ts - function doChange20(changes, sourceFile, name) { + function doChange21(changes, sourceFile, name) { changes.replaceNodeWithText(sourceFile, name, `${name.text}()`); } function getCallName(sourceFile, start) { @@ -144192,13 +144265,13 @@ ${lanes.join("\n")} const callName = getCallName(sourceFile, span.start); if (!callName) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, context.sourceFile, callName)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, context.sourceFile, callName)); return [createCodeFixAction(fixId34, changes, Diagnostics.Add_missing_call_parentheses, fixId34, Diagnostics.Add_all_missing_call_parentheses)]; }, getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => { const callName = getCallName(diag2.file, diag2.start); if (callName) - doChange20(changes, diag2.file, callName); + doChange21(changes, diag2.file, callName); }) }); } @@ -144240,7 +144313,7 @@ ${lanes.join("\n")} returnType: getReturnType(containingFunction) }; } - function doChange21(changes, sourceFile, { insertBefore, returnType }) { + function doChange22(changes, sourceFile, { insertBefore, returnType }) { if (returnType) { const entityName = getEntityNameFromTypeNode(returnType); if (!entityName || entityName.kind !== 79 /* Identifier */ || entityName.text !== "Promise") { @@ -144268,7 +144341,7 @@ ${lanes.join("\n")} const nodes = getNodes3(sourceFile, span.start); if (!nodes) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, sourceFile, nodes)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange22(t, sourceFile, nodes)); return [createCodeFixAction(fixId35, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId35, Diagnostics.Add_all_missing_async_modifiers)]; }, fixIds: [fixId35], @@ -144278,7 +144351,7 @@ ${lanes.join("\n")} const nodes = getNodes3(diag2.file, diag2.start); if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return; - doChange21(changes, context.sourceFile, nodes); + doChange22(changes, context.sourceFile, nodes); }); } }); @@ -144286,7 +144359,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/fixPropertyOverrideAccessor.ts - function doChange22(file, start, length2, code, context) { + function doChange23(file, start, length2, code, context) { let startPosition; let endPosition; if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) { @@ -144327,14 +144400,14 @@ ${lanes.join("\n")} registerCodeFix({ errorCodes: errorCodes46, getCodeActions(context) { - const edits = doChange22(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); + const edits = doChange23(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); if (edits) { return [createCodeFixAction(fixId36, edits, Diagnostics.Generate_get_and_set_accessors, fixId36, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; } }, fixIds: [fixId36], getAllCodeActions: (context) => codeFixAll(context, errorCodes46, (changes, diag2) => { - const edits = doChange22(diag2.file, diag2.start, diag2.length, diag2.code, context); + const edits = doChange23(diag2.file, diag2.start, diag2.length, diag2.code, context); if (edits) { for (const edit of edits) { changes.pushRaw(context.sourceFile, edit); @@ -144381,7 +144454,7 @@ ${lanes.join("\n")} } return errorCode; } - function doChange23(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { + function doChange24(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { if (!isParameterPropertyModifier(token.kind) && token.kind !== 79 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 108 /* ThisKeyword */) { return void 0; } @@ -145322,7 +145395,7 @@ ${lanes.join("\n")} const token = getTokenAtPosition(sourceFile, start); let declaration; const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - declaration = doChange23( + declaration = doChange24( changes2, sourceFile, token, @@ -145343,7 +145416,7 @@ ${lanes.join("\n")} const { sourceFile, program, cancellationToken, host, preferences } = context; const markSeen = nodeSeenTracker(); return codeFixAll(context, errorCodes47, (changes, err) => { - doChange23(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); + doChange24(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); }); } }); @@ -145374,7 +145447,7 @@ ${lanes.join("\n")} return { returnTypeNode, returnType, promisedTypeNode, promisedType }; } } - function doChange24(changes, sourceFile, returnTypeNode, promisedTypeNode) { + function doChange25(changes, sourceFile, returnTypeNode, promisedTypeNode) { changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode])); } var fixId38, errorCodes48; @@ -145398,7 +145471,7 @@ ${lanes.join("\n")} return void 0; } const { returnTypeNode, returnType, promisedTypeNode, promisedType } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, sourceFile, returnTypeNode, promisedTypeNode)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, sourceFile, returnTypeNode, promisedTypeNode)); return [createCodeFixAction( fixId38, changes, @@ -145414,7 +145487,7 @@ ${lanes.join("\n")} getAllCodeActions: (context) => codeFixAll(context, errorCodes48, (changes, diag2) => { const info = getInfo12(diag2.file, context.program.getTypeChecker(), diag2.start); if (info) { - doChange24(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); + doChange25(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); } }) }); @@ -146616,7 +146689,7 @@ ${lanes.join("\n")} }); // src/services/codefixes/requireInTs.ts - function doChange25(changes, sourceFile, info) { + function doChange26(changes, sourceFile, info) { const { allowSyntheticDefaults, defaultImportName, namedImports, statement, required } = info; changes.replaceNode(sourceFile, statement, defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( /*modifiers*/ @@ -146693,14 +146766,14 @@ ${lanes.join("\n")} if (!info) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, context.sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, context.sourceFile, info)); return [createCodeFixAction(fixId40, changes, Diagnostics.Convert_require_to_import, fixId40, Diagnostics.Convert_all_require_to_import)]; }, fixIds: [fixId40], getAllCodeActions: (context) => codeFixAll(context, errorCodes51, (changes, diag2) => { const info = getInfo14(diag2.file, context.program, diag2.start); if (info) { - doChange25(changes, context.sourceFile, info); + doChange26(changes, context.sourceFile, info); } }) }); @@ -146720,7 +146793,7 @@ ${lanes.join("\n")} return { importNode, name, moduleSpecifier: importNode.moduleSpecifier }; } } - function doChange26(changes, sourceFile, info, preferences) { + function doChange27(changes, sourceFile, info, preferences) { changes.replaceNode(sourceFile, info.importNode, makeImport( info.name, /*namedImports*/ @@ -146744,14 +146817,14 @@ ${lanes.join("\n")} const info = getInfo15(sourceFile, start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, sourceFile, info, context.preferences)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, info, context.preferences)); return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_to_default_import, fixId41, Diagnostics.Convert_all_to_default_imports)]; }, fixIds: [fixId41], getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { const info = getInfo15(diag2.file, diag2.start); if (info) - doChange26(changes, diag2.file, info, context.preferences); + doChange27(changes, diag2.file, info, context.preferences); }) }); } @@ -146799,7 +146872,7 @@ ${lanes.join("\n")} Debug.assert(token.parent.kind === 202 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } - function doChange27(changes, sourceFile, importType) { + function doChange28(changes, sourceFile, importType) { const newTypeNode = factory.updateImportTypeNode( importType, importType.argument, @@ -146825,11 +146898,11 @@ ${lanes.join("\n")} getCodeActions: function getCodeActionsToAddMissingTypeof(context) { const { sourceFile, span } = context; const importType = getImportTypeNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, sourceFile, importType)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, importType)); return [createCodeFixAction(fixId43, changes, Diagnostics.Add_missing_typeof, fixId43, Diagnostics.Add_missing_typeof)]; }, fixIds: [fixId43], - getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange27(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) + getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => doChange28(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) }); } }); @@ -146848,7 +146921,7 @@ ${lanes.join("\n")} return void 0; return binaryExpr; } - function doChange28(changeTracker, sf, node) { + function doChange29(changeTracker, sf, node) { const jsx = flattenInvalidBinaryExpr(node); if (jsx) changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment())); @@ -146886,7 +146959,7 @@ ${lanes.join("\n")} const node = findNodeToFix(sourceFile, span.start); if (!node) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, node)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, node)); return [createCodeFixAction(fixID2, changes, Diagnostics.Wrap_in_JSX_fragment, fixID2, Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]; }, fixIds: [fixID2], @@ -146894,7 +146967,7 @@ ${lanes.join("\n")} const node = findNodeToFix(context.sourceFile, diag2.start); if (!node) return void 0; - doChange28(changes, context.sourceFile, node); + doChange29(changes, context.sourceFile, node); }) }); } @@ -146914,7 +146987,7 @@ ${lanes.join("\n")} function createTypeAliasFromInterface(declaration, type) { return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type); } - function doChange29(changes, sourceFile, { indexSignature, container }) { + function doChange30(changes, sourceFile, { indexSignature, container }) { const members = isInterfaceDeclaration(container) ? container.members : container.type.members; const otherMembers = members.filter((member) => !isIndexSignatureDeclaration(member)); const parameter = first(indexSignature.parameters); @@ -146956,7 +147029,7 @@ ${lanes.join("\n")} const info = getInfo16(sourceFile, span.start); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info)); const name = idText(info.container.name); return [createCodeFixAction(fixId44, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId44, [Diagnostics.Convert_0_to_mapped_object_type, name])]; }, @@ -146964,7 +147037,7 @@ ${lanes.join("\n")} getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { const info = getInfo16(diag2.file, diag2.start); if (info) - doChange29(changes, diag2.file, info); + doChange30(changes, diag2.file, info); }) }); } @@ -147125,7 +147198,7 @@ ${lanes.join("\n")} return; return { symbol, token: constToken }; } - function doChange30(changes, sourceFile, token) { + function doChange31(changes, sourceFile, token) { changes.replaceNode(sourceFile, token, factory.createToken(119 /* LetKeyword */)); } var fixId48, errorCodes60; @@ -147143,7 +147216,7 @@ ${lanes.join("\n")} const info = getInfo17(sourceFile, span.start, program); if (info === void 0) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, info.token)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info.token)); return [createCodeFixActionMaybeFixAll(fixId48, changes, Diagnostics.Convert_const_to_let, fixId48, Diagnostics.Convert_all_const_to_let)]; }, getAllCodeActions: (context) => { @@ -147154,7 +147227,7 @@ ${lanes.join("\n")} const info = getInfo17(diag2.file, diag2.start, program); if (info) { if (addToSeen(seen, getSymbolId(info.symbol))) { - return doChange30(changes, diag2.file, info.token); + return doChange31(changes, diag2.file, info.token); } } return void 0; @@ -147171,7 +147244,7 @@ ${lanes.join("\n")} const node = getTokenAtPosition(sourceFile, pos); return node.kind === 26 /* SemicolonToken */ && node.parent && (isObjectLiteralExpression(node.parent) || isArrayLiteralExpression(node.parent)) ? { node } : void 0; } - function doChange31(changes, sourceFile, { node }) { + function doChange32(changes, sourceFile, { node }) { const newNode = factory.createToken(27 /* CommaToken */); changes.replaceNode(sourceFile, node, newNode); } @@ -147191,7 +147264,7 @@ ${lanes.join("\n")} const info = getInfo18(sourceFile, context.span.start, context.errorCode); if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, info)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(t, sourceFile, info)); return [createCodeFixAction( fixId49, changes, @@ -147204,7 +147277,7 @@ ${lanes.join("\n")} getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, diag2) => { const info = getInfo18(diag2.file, diag2.start, diag2.code); if (info) - doChange31(changes, context.sourceFile, info); + doChange32(changes, context.sourceFile, info); }) }); } @@ -156500,7 +156573,7 @@ ${lanes.join("\n")} return void 0; } } - function doChange32(exportingSourceFile, program, info, changes, cancellationToken) { + function doChange33(exportingSourceFile, program, info, changes, cancellationToken) { changeExport(exportingSourceFile, info, changes, program.getTypeChecker()); changeImports(program, info, changes, cancellationToken); } @@ -156696,7 +156769,7 @@ ${lanes.join("\n")} Debug.assert(actionName2 === defaultToNamedAction.name || actionName2 === namedToDefaultAction.name, "Unexpected action name"); const info = getInfo19(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange32(context.file, context.program, info, t, context.cancellationToken)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, info, t, context.cancellationToken)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -156731,7 +156804,7 @@ ${lanes.join("\n")} function getShouldUseDefault(program, importClause) { return getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); } - function doChange33(sourceFile, program, changes, info) { + function doChange34(sourceFile, program, changes, info) { const checker = program.getTypeChecker(); if (info.convertTo === 0 /* Named */) { doChangeNamespaceToNamed(sourceFile, checker, changes, info.import, getAllowSyntheticDefaultImports(program.getCompilerOptions())); @@ -156923,7 +156996,7 @@ ${lanes.join("\n")} Debug.assert(some(getOwnValues(actions), (action) => action.name === actionName2), "Unexpected action name"); const info = getImportConversionInfo(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(context.file, context.program, t, info)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, t, info)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -157265,7 +157338,7 @@ ${lanes.join("\n")} afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex] }; } - function doChange34(oldFile, program, toMove, changes, host, preferences) { + function doChange35(oldFile, program, toMove, changes, host, preferences) { const checker = program.getTypeChecker(); const usage = getUsageInfo(oldFile, toMove.all, checker); const currentDirectory = getDirectoryPath(oldFile.fileName); @@ -158035,7 +158108,7 @@ ${lanes.join("\n")} getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) { Debug.assert(actionName2 === refactorName4, "Wrong refactor invoked"); const statements = Debug.checkDefined(getStatementsToMove(context)); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(context.file, context.program, statements, t, context.host, context.preferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(context.file, context.program, statements, t, context.host, context.preferences)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } }); @@ -158697,12 +158770,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; const groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); if (groupedReferences.valid) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(file, program, host, t, functionDeclaration, groupedReferences)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(file, program, host, t, functionDeclaration, groupedReferences)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return { edits: [] }; } - function doChange35(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { + function doChange36(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { const signature = groupedReferences.signature; const newFunctionDeclarationParams = map(createNewParameters(functionDeclaration, program, host), (param) => getSynthesizedDeepClone(param)); if (signature) { @@ -159495,7 +159568,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); const edits = ts_textChanges_exports.ChangeTracker.with( context, - (t) => doChange36(context.file, context.program.getTypeChecker(), t, info, actionName2) + (t) => doChange37(context.file, context.program.getTypeChecker(), t, info, actionName2) ); return { edits, renameFilename: void 0, renameLocation: void 0 }; } @@ -159651,7 +159724,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return toConvert; } - function doChange36(sourceFile, checker, changes, info, _actionName) { + function doChange37(sourceFile, checker, changes, info, _actionName) { const { finalExpression, occurrences, expression } = info; const firstOccurrence = occurrences[occurrences.length - 1]; const convertedChain = convertOccurrences(checker, finalExpression, occurrences); @@ -161387,7 +161460,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getRefactorEditsToInferReturnType(context) { const info = getInfo21(context); if (info && !isRefactorErrorInfo(info)) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(context.file, t, info.declaration, info.returnTypeNode)); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange38(context.file, t, info.declaration, info.returnTypeNode)); return { renameFilename: void 0, renameLocation: void 0, edits }; } return void 0; @@ -161412,7 +161485,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return emptyArray; } - function doChange37(sourceFile, changes, declaration, typeNode) { + function doChange38(sourceFile, changes, declaration, typeNode) { const closeParen = findChildOfKind(declaration, 21 /* CloseParenToken */, sourceFile); const needParens = isArrowFunction(declaration) && closeParen === void 0; const endNode2 = needParens ? first(declaration.parameters) : closeParen; @@ -167459,7 +167532,6 @@ ${options.prefix}` : "\n" : options.prefix ContextFlags: () => ContextFlags, CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter, Debug: () => Debug, - DeprecationVersion: () => DeprecationVersion, DiagnosticCategory: () => DiagnosticCategory, Diagnostics: () => Diagnostics, DocumentHighlights: () => DocumentHighlights, diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 00afe537dc038..c2e6ea1276b7c 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -54,7 +54,7 @@ var path = __toESM(require("path")); // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = `${versionMajorMinor}.1-rc`; +var version = "5.0.2"; // src/compiler/core.ts var emptyArray = []; @@ -3302,6 +3302,7 @@ var DiagnosticCategory = /* @__PURE__ */ ((DiagnosticCategory2) => { })(DiagnosticCategory || {}); var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => { ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic"; + ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs"; ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10"; ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16"; ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext"; @@ -6296,12 +6297,14 @@ var Diagnostics = { Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), - Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), - Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."), + Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), + Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."), Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), + Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`), + Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), diff --git a/package.json b/package.json index 63600f1316936..69ab01a5a616e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "5.0.1-rc", + "version": "5.0.2", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 3468e21af6272..139cfa95efb9e 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -4,7 +4,7 @@ export const versionMajorMinor = "5.0"; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = `${versionMajorMinor}.1-rc`; +export const version = "5.0.2" as string; /** * Type of objects whose values are all of the same type. From 6e598742e7dad35ea04b04209ee14651787cc3b6 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 14 Mar 2023 13:26:22 -0700 Subject: [PATCH 12/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53240=20(Allo?= =?UTF-8?q?w=20'verbatimModuleSyntax'=20with=20t...)=20into=20release-5.0?= =?UTF-8?q?=20(#53253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniel Rosenwasser Co-authored-by: typescript-bot --- lib/tsserver.js | 8 + lib/tsserverlibrary.js | 10 +- lib/typescript.js | 10 +- src/services/transpile.ts | 11 + .../unittests/services/transpile.ts | 251 +++++++++++++----- ...onJS option (verbatimModuleSyntax=true).js | 24 ++ ...verbatimModuleSyntax=true).oldTranspile.js | 24 ++ ...ype (verbatimModuleSyntax=true).errors.txt | 6 + ...export type (verbatimModuleSyntax=true).js | 4 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 4 + ...ier (verbatimModuleSyntax=true).errors.txt | 6 + ...t specifier (verbatimModuleSyntax=true).js | 4 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 4 + ...ics (verbatimModuleSyntax=true).errors.txt | 6 + ...diagnostics (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...les (verbatimModuleSyntax=true).errors.txt | 8 + ...atedModules (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 8 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ash (verbatimModuleSyntax=true).errors.txt | 9 + ...s not crash (verbatimModuleSyntax=true).js | 7 + ...ModuleSyntax=true).oldTranspile.errors.txt | 9 + ...verbatimModuleSyntax=true).oldTranspile.js | 7 + ...ics (verbatimModuleSyntax=true).errors.txt | 9 + ...diagnostics (verbatimModuleSyntax=true).js | 3 + ...ModuleSyntax=true).oldTranspile.errors.txt | 9 + ...verbatimModuleSyntax=true).oldTranspile.js | 3 + ...ces (verbatimModuleSyntax=true).errors.txt | 7 + ... references (verbatimModuleSyntax=true).js | 3 + ...ModuleSyntax=true).oldTranspile.errors.txt | 7 + ...verbatimModuleSyntax=true).oldTranspile.js | 3 + ...rts (verbatimModuleSyntax=true).errors.txt | 6 + ...ule imports (verbatimModuleSyntax=true).js | 4 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 4 + ...uts (verbatimModuleSyntax=true).errors.txt | 6 + ...alid inputs (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ion (verbatimModuleSyntax=true).errors.txt | 6 + ...e extension (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ion (verbatimModuleSyntax=true).errors.txt | 7 + ...t extension (verbatimModuleSyntax=true).js | 3 + ...ModuleSyntax=true).oldTranspile.errors.txt | 7 + ...verbatimModuleSyntax=true).oldTranspile.js | 3 + ...ues (verbatimModuleSyntax=true).errors.txt | 6 + ... lib values (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ues (verbatimModuleSyntax=true).errors.txt | 6 + ...ypes values (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ays (verbatimModuleSyntax=true).errors.txt | 6 + ...onst arrays (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ays (verbatimModuleSyntax=true).errors.txt | 6 + ... for arrays (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...wJs (verbatimModuleSyntax=true).errors.txt | 6 + ...ing allowJs (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...rts (verbatimModuleSyntax=true).errors.txt | 6 + ...aultImports (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ode (verbatimModuleSyntax=true).errors.txt | 6 + ...achableCode (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...els (verbatimModuleSyntax=true).errors.txt | 6 + ...nusedLabels (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ict (verbatimModuleSyntax=true).errors.txt | 6 + ...lwaysStrict (verbatimModuleSyntax=true).js | 3 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 3 + ...Url (verbatimModuleSyntax=true).errors.txt | 6 + ...ing baseUrl (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...set (verbatimModuleSyntax=true).errors.txt | 8 + ...ing charset (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 8 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ite (verbatimModuleSyntax=true).errors.txt | 6 + ...g composite (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ion (verbatimModuleSyntax=true).errors.txt | 6 + ...declaration (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...Dir (verbatimModuleSyntax=true).errors.txt | 6 + ...larationDir (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...BOM (verbatimModuleSyntax=true).errors.txt | 6 + ...ing emitBOM (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ata (verbatimModuleSyntax=true).errors.txt | 6 + ...torMetadata (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ors (verbatimModuleSyntax=true).errors.txt | 6 + ...lDecorators (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...mes (verbatimModuleSyntax=true).errors.txt | 6 + ...InFileNames (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...tal (verbatimModuleSyntax=true).errors.txt | 6 + ...incremental (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...jsx (verbatimModuleSyntax=true).errors.txt | 6 + ...setting jsx (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ory (verbatimModuleSyntax=true).errors.txt | 6 + ... jsxFactory (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ory (verbatimModuleSyntax=true).errors.txt | 6 + ...mentFactory (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...lib (verbatimModuleSyntax=true).errors.txt | 6 + ...setting lib (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ale (verbatimModuleSyntax=true).errors.txt | 6 + ...ting locale (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ule (verbatimModuleSyntax=true).errors.txt | 6 + ...ting module (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ion (verbatimModuleSyntax=true).errors.txt | 6 + ...eResolution (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ine (verbatimModuleSyntax=true).errors.txt | 6 + ...ing newLine (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...mit (verbatimModuleSyntax=true).errors.txt | 6 + ...ting noEmit (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ers (verbatimModuleSyntax=true).errors.txt | 6 + ...EmitHelpers (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ror (verbatimModuleSyntax=true).errors.txt | 6 + ...EmitOnError (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ion (verbatimModuleSyntax=true).errors.txt | 6 + ...rTruncation (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...tch (verbatimModuleSyntax=true).errors.txt | 6 + ...sesInSwitch (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...Any (verbatimModuleSyntax=true).errors.txt | 6 + ...ImplicitAny (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...rns (verbatimModuleSyntax=true).errors.txt | 6 + ...icitReturns (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...his (verbatimModuleSyntax=true).errors.txt | 6 + ...mplicitThis (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ict (verbatimModuleSyntax=true).errors.txt | 8 + ...itUseStrict (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 8 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...Lib (verbatimModuleSyntax=true).errors.txt | 6 + ...tting noLib (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...lve (verbatimModuleSyntax=true).errors.txt | 6 + ...g noResolve (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...out (verbatimModuleSyntax=true).errors.txt | 6 + ...setting out (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...Dir (verbatimModuleSyntax=true).errors.txt | 6 + ...ting outDir (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ile (verbatimModuleSyntax=true).errors.txt | 6 + ...ing outFile (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ths (verbatimModuleSyntax=true).errors.txt | 6 + ...tting paths (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ums (verbatimModuleSyntax=true).errors.txt | 6 + ...eConstEnums (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ace (verbatimModuleSyntax=true).errors.txt | 6 + ...ctNamespace (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...nts (verbatimModuleSyntax=true).errors.txt | 6 + ...oveComments (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...Dir (verbatimModuleSyntax=true).errors.txt | 6 + ...ing rootDir (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...irs (verbatimModuleSyntax=true).errors.txt | 6 + ...ng rootDirs (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...eck (verbatimModuleSyntax=true).errors.txt | 6 + ...ultLibCheck (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...eck (verbatimModuleSyntax=true).errors.txt | 6 + ...kipLibCheck (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...cks (verbatimModuleSyntax=true).errors.txt | 6 + ...tNullChecks (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...nal (verbatimModuleSyntax=true).errors.txt | 6 + ...ripInternal (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ors (verbatimModuleSyntax=true).errors.txt | 8 + ...pertyErrors (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 8 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ors (verbatimModuleSyntax=true).errors.txt | 8 + ...IndexErrors (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 8 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ting target (verbatimModuleSyntax=true).js | 2 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...nfo (verbatimModuleSyntax=true).errors.txt | 6 + ...tsbuildinfo (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...ots (verbatimModuleSyntax=true).errors.txt | 6 + ...g typeRoots (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...pes (verbatimModuleSyntax=true).errors.txt | 6 + ...tting types (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + ...it metadata (verbatimModuleSyntax=true).js | 21 ++ ...verbatimModuleSyntax=true).oldTranspile.js | 21 ++ ...ter (verbatimModuleSyntax=true).errors.txt | 6 + ...e character (verbatimModuleSyntax=true).js | 2 + ...ModuleSyntax=true).oldTranspile.errors.txt | 6 + ...verbatimModuleSyntax=true).oldTranspile.js | 2 + 283 files changed, 1463 insertions(+), 75 deletions(-) create mode 100644 tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting target (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting target (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).errors.txt create mode 100644 tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).oldTranspile.errors.txt create mode 100644 tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).oldTranspile.js diff --git a/lib/tsserver.js b/lib/tsserver.js index 31ae89cd7fee9..95cf3dfd1867b 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -133402,6 +133402,11 @@ function canBeConvertedToAsync(node) { } // src/services/transpile.ts +var optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([ + "isolatedModules", + "preserveValueImports", + "importsNotUsedAsValues" +]); function transpileModule(input, transpileOptions) { const diagnostics = []; const options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : {}; @@ -133412,6 +133417,9 @@ function transpileModule(input, transpileOptions) { } } for (const option of transpileOptionValueCompilerOptions) { + if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) { + continue; + } options[option.name] = option.transpileOptionValue; } options.suppressOutputPathCheck = true; diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index d15d5ed7220f3..6ee07994a3c51 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -131819,6 +131819,9 @@ ${lanes.join("\n")} } } for (const option of transpileOptionValueCompilerOptions) { + if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) { + continue; + } options[option.name] = option.transpileOptionValue; } options.suppressOutputPathCheck = true; @@ -131922,11 +131925,16 @@ ${lanes.join("\n")} } return options; } - var commandLineOptionsStringToEnum; + var optionsRedundantWithVerbatimModuleSyntax, commandLineOptionsStringToEnum; var init_transpile = __esm({ "src/services/transpile.ts"() { "use strict"; init_ts4(); + optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([ + "isolatedModules", + "preserveValueImports", + "importsNotUsedAsValues" + ]); } }); diff --git a/lib/typescript.js b/lib/typescript.js index 8eecfac202aaf..463d182232629 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -131833,6 +131833,9 @@ ${lanes.join("\n")} } } for (const option of transpileOptionValueCompilerOptions) { + if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) { + continue; + } options[option.name] = option.transpileOptionValue; } options.suppressOutputPathCheck = true; @@ -131936,11 +131939,16 @@ ${lanes.join("\n")} } return options; } - var commandLineOptionsStringToEnum; + var optionsRedundantWithVerbatimModuleSyntax, commandLineOptionsStringToEnum; var init_transpile = __esm({ "src/services/transpile.ts"() { "use strict"; init_ts4(); + optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([ + "isolatedModules", + "preserveValueImports", + "importsNotUsedAsValues" + ]); } }); diff --git a/src/services/transpile.ts b/src/services/transpile.ts index 719fca06aea5b..eb7fb2da6d3c0 100644 --- a/src/services/transpile.ts +++ b/src/services/transpile.ts @@ -43,6 +43,12 @@ export interface TranspileOutput { sourceMapText?: string; } +const optionsRedundantWithVerbatimModuleSyntax = new Set([ + "isolatedModules", + "preserveValueImports", + "importsNotUsedAsValues" +]); + /* * This function will compile source text from 'input' argument using specified compiler options. * If not options are provided - it will use a set of default compiler options. @@ -66,6 +72,11 @@ export function transpileModule(input: string, transpileOptions: TranspileOption } for (const option of transpileOptionValueCompilerOptions) { + // Do not set redundant config options if `verbatimModuleSyntax` was supplied. + if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) { + continue; + } + options[option.name] = option.transpileOptionValue; } diff --git a/src/testRunner/unittests/services/transpile.ts b/src/testRunner/unittests/services/transpile.ts index 418b1d1675dea..f20efec044f93 100644 --- a/src/testRunner/unittests/services/transpile.ts +++ b/src/testRunner/unittests/services/transpile.ts @@ -6,10 +6,11 @@ describe("unittests:: services:: Transpile", () => { interface TranspileTestSettings { options?: ts.TranspileOptions; noSetFileName?: boolean; + testVerbatimModuleSyntax?: true | "only"; } - function transpilesCorrectly(name: string, input: string, testSettings: TranspileTestSettings) { - describe(name, () => { + function transpilesCorrectly(nameIn: string, input: string, testSettings: TranspileTestSettings) { + const runOnce = (name: string, testSettings: TranspileTestSettings) => describe(name, () => { let transpileResult: ts.TranspileOutput; let oldTranspileResult: string; let oldTranspileDiagnostics: ts.Diagnostic[]; @@ -39,7 +40,7 @@ describe("unittests:: services:: Transpile", () => { transpileOptions.reportDiagnostics = true; - const justName = "transpile/" + name.replace(/[^a-z0-9\-. ]/ig, "") + (transpileOptions.compilerOptions.jsx ? ts.Extension.Tsx : ts.Extension.Ts); + const justName = "transpile/" + name.replace(/[^a-z0-9\-. ()=]/ig, "") + (transpileOptions.compilerOptions.jsx ? ts.Extension.Tsx : ts.Extension.Ts); const toBeCompiled = [{ unitName, content: input @@ -85,27 +86,48 @@ describe("unittests:: services:: Transpile", () => { }); } }); + + if (testSettings.testVerbatimModuleSyntax !== "only") { + runOnce(nameIn, testSettings); + } + if (testSettings.testVerbatimModuleSyntax) { + runOnce(nameIn + " (verbatimModuleSyntax=true)", { + ...testSettings, + options: { + ...testSettings.options, + compilerOptions: { + ...testSettings.options?.compilerOptions, + verbatimModuleSyntax: true + } + } + }); + } } transpilesCorrectly("Generates no diagnostics with valid inputs", `var x = 0;`, { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS } } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Generates no diagnostics for missing file references", `/// var x = 0;`, { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS } } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Generates no diagnostics for missing module imports", `import {a} from "module2";`, { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS } } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Generates expected syntactic diagnostics", `a b`, { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS } } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Does not generate semantic diagnostics", `var x: string = 0;`, { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS } } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Generates module output", `var x = 0;`, { @@ -113,7 +135,8 @@ var x = 0;`, { }); transpilesCorrectly("Uses correct newLine character", `var x = 0;`, { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS, newLine: ts.NewLineKind.LineFeed } } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS, newLine: ts.NewLineKind.LineFeed } }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Sets module name", "var x = 1;", { @@ -121,7 +144,8 @@ var x = 0;`, { }); transpilesCorrectly("No extra errors for file without extension", `"use strict";\r\nvar x = 0;`, { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS }, fileName: "file" } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS }, fileName: "file" }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Rename dependencies - System", @@ -168,7 +192,8 @@ var x = 0;`, { experimentalDecorators: true, target: ts.ScriptTarget.ES5, } - } + }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports backslashes in file name", "var x", { @@ -206,227 +231,287 @@ var x = 0;`, { }); transpilesCorrectly("Support options with lib values", "const a = 10;", { - options: { compilerOptions: { lib: ["es6", "dom"], module: ts.ModuleKind.CommonJS }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { lib: ["es6", "dom"], module: ts.ModuleKind.CommonJS }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Support options with types values", "const a = 10;", { - options: { compilerOptions: { types: ["jquery", "typescript"], module: ts.ModuleKind.CommonJS }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { types: ["jquery", "typescript"], module: ts.ModuleKind.CommonJS }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'allowJs'", "x;", { - options: { compilerOptions: { allowJs: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { allowJs: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'allowSyntheticDefaultImports'", "x;", { - options: { compilerOptions: { allowSyntheticDefaultImports: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { allowSyntheticDefaultImports: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'allowUnreachableCode'", "x;", { - options: { compilerOptions: { allowUnreachableCode: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { allowUnreachableCode: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'allowUnusedLabels'", "x;", { - options: { compilerOptions: { allowUnusedLabels: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { allowUnusedLabels: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'alwaysStrict'", "x;", { - options: { compilerOptions: { alwaysStrict: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { alwaysStrict: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'baseUrl'", "x;", { - options: { compilerOptions: { baseUrl: "./folder/baseUrl" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { baseUrl: "./folder/baseUrl" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'charset'", "x;", { - options: { compilerOptions: { charset: "en-us" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { charset: "en-us" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'declaration'", "x;", { - options: { compilerOptions: { declaration: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { declaration: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'declarationDir'", "x;", { - options: { compilerOptions: { declarationDir: "out/declarations" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { declarationDir: "out/declarations" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'emitBOM'", "x;", { - options: { compilerOptions: { emitBOM: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { emitBOM: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'emitDecoratorMetadata'", "x;", { - options: { compilerOptions: { emitDecoratorMetadata: true, experimentalDecorators: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { emitDecoratorMetadata: true, experimentalDecorators: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'experimentalDecorators'", "x;", { - options: { compilerOptions: { experimentalDecorators: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { experimentalDecorators: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'forceConsistentCasingInFileNames'", "x;", { - options: { compilerOptions: { forceConsistentCasingInFileNames: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { forceConsistentCasingInFileNames: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'isolatedModules'", "x;", { options: { compilerOptions: { isolatedModules: true }, fileName: "input.js", reportDiagnostics: true } }); + transpilesCorrectly("Does not support setting 'isolatedModules'", "x;", { + options: { compilerOptions: { isolatedModules: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: "only" + }); + transpilesCorrectly("Supports setting 'jsx'", "x;", { - options: { compilerOptions: { jsx: 1 }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { jsx: 1 }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'lib'", "x;", { - options: { compilerOptions: { lib: ["es2015", "dom"] }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { lib: ["es2015", "dom"] }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'locale'", "x;", { - options: { compilerOptions: { locale: "en-us" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { locale: "en-us" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'module'", "x;", { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'moduleResolution'", "x;", { - options: { compilerOptions: { moduleResolution: ts.ModuleResolutionKind.Node10 }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { moduleResolution: ts.ModuleResolutionKind.Node10 }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'newLine'", "x;", { - options: { compilerOptions: { newLine: ts.NewLineKind.CarriageReturnLineFeed }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { newLine: ts.NewLineKind.CarriageReturnLineFeed }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noEmit'", "x;", { - options: { compilerOptions: { noEmit: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noEmit: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noEmitHelpers'", "x;", { - options: { compilerOptions: { noEmitHelpers: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noEmitHelpers: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noEmitOnError'", "x;", { - options: { compilerOptions: { noEmitOnError: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noEmitOnError: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noErrorTruncation'", "x;", { - options: { compilerOptions: { noErrorTruncation: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noErrorTruncation: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noFallthroughCasesInSwitch'", "x;", { - options: { compilerOptions: { noFallthroughCasesInSwitch: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noFallthroughCasesInSwitch: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noImplicitAny'", "x;", { - options: { compilerOptions: { noImplicitAny: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noImplicitAny: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noImplicitReturns'", "x;", { - options: { compilerOptions: { noImplicitReturns: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noImplicitReturns: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noImplicitThis'", "x;", { - options: { compilerOptions: { noImplicitThis: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noImplicitThis: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noImplicitUseStrict'", "x;", { - options: { compilerOptions: { noImplicitUseStrict: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noImplicitUseStrict: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noLib'", "x;", { - options: { compilerOptions: { noLib: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noLib: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'noResolve'", "x;", { - options: { compilerOptions: { noResolve: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { noResolve: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'out'", "x;", { - options: { compilerOptions: { out: "./out" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { out: "./out" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'outDir'", "x;", { - options: { compilerOptions: { outDir: "./outDir" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { outDir: "./outDir" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'outFile'", "x;", { - options: { compilerOptions: { outFile: "./outFile" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { outFile: "./outFile" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'paths'", "x;", { - options: { compilerOptions: { paths: { "*": ["./generated*"] } }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { paths: { "*": ["./generated*"] } }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'preserveConstEnums'", "x;", { - options: { compilerOptions: { preserveConstEnums: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { preserveConstEnums: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'reactNamespace'", "x;", { - options: { compilerOptions: { reactNamespace: "react" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { reactNamespace: "react" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'jsxFactory'", "x;", { - options: { compilerOptions: { jsxFactory: "createElement" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { jsxFactory: "createElement" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'jsxFragmentFactory'", "x;", { - options: { compilerOptions: { jsxFactory: "x", jsxFragmentFactory: "frag" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { jsxFactory: "x", jsxFragmentFactory: "frag" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'removeComments'", "x;", { - options: { compilerOptions: { removeComments: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { removeComments: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'rootDir'", "x;", { - options: { compilerOptions: { rootDir: "./rootDir" }, fileName: "./rootDir/input.js", reportDiagnostics: true } + options: { compilerOptions: { rootDir: "./rootDir" }, fileName: "./rootDir/input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'rootDirs'", "x;", { - options: { compilerOptions: { rootDirs: ["./a", "./b"] }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { rootDirs: ["./a", "./b"] }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'skipLibCheck'", "x;", { - options: { compilerOptions: { skipLibCheck: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { skipLibCheck: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'skipDefaultLibCheck'", "x;", { - options: { compilerOptions: { skipDefaultLibCheck: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { skipDefaultLibCheck: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'strictNullChecks'", "x;", { - options: { compilerOptions: { strictNullChecks: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { strictNullChecks: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'stripInternal'", "x;", { - options: { compilerOptions: { stripInternal: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { stripInternal: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'suppressExcessPropertyErrors'", "x;", { - options: { compilerOptions: { suppressExcessPropertyErrors: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { suppressExcessPropertyErrors: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'suppressImplicitAnyIndexErrors'", "x;", { - options: { compilerOptions: { suppressImplicitAnyIndexErrors: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { suppressImplicitAnyIndexErrors: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'target'", "x;", { - options: { compilerOptions: { target: 2 }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { target: 2 }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'types'", "x;", { - options: { compilerOptions: { types: ["jquery", "jasmine"] }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { types: ["jquery", "jasmine"] }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'typeRoots'", "x;", { - options: { compilerOptions: { typeRoots: ["./folder"] }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { typeRoots: ["./folder"] }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'incremental'", "x;", { - options: { compilerOptions: { incremental: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { incremental: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'composite'", "x;", { - options: { compilerOptions: { composite: true }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { composite: true }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports setting 'tsbuildinfo'", "x;", { - options: { compilerOptions: { incremental: true, tsBuildInfoFile: "./folder/config.tsbuildinfo" }, fileName: "input.js", reportDiagnostics: true } + options: { compilerOptions: { incremental: true, tsBuildInfoFile: "./folder/config.tsbuildinfo" }, fileName: "input.js", reportDiagnostics: true }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Correctly serialize metadata when transpile with CommonJS option", @@ -443,9 +528,9 @@ var x = 0;`, { moduleResolution: ts.ModuleResolutionKind.Node10, emitDecoratorMetadata: true, experimentalDecorators: true, - isolatedModules: true, } - } + }, + testVerbatimModuleSyntax: true } ); @@ -463,29 +548,33 @@ var x = 0;`, { moduleResolution: ts.ModuleResolutionKind.Node10, emitDecoratorMetadata: true, experimentalDecorators: true, - isolatedModules: true, + isolatedModules: true } } } ); transpilesCorrectly("Supports readonly keyword for arrays", "let x: readonly string[];", { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS } } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Supports 'as const' arrays", `([] as const).forEach(k => console.log(k));`, { - options: { compilerOptions: { module: ts.ModuleKind.CommonJS } } + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Infer correct file extension", `const fn = (a: T) => a`, { - noSetFileName: true + noSetFileName: true, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Export star as ns conflict does not crash", ` var a; export { a as alias }; export * as alias from './file';`, { - noSetFileName: true + noSetFileName: true, + testVerbatimModuleSyntax: true }); transpilesCorrectly("Elides import equals referenced only by export type", @@ -495,10 +584,26 @@ export * as alias from './file';`, { } ); + transpilesCorrectly("Does not elide import equals referenced only by export type", + `import IFoo = Namespace.IFoo;` + + `export type { IFoo };`, { + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: "only" + } + ); + transpilesCorrectly("Elides import equals referenced only by type only export specifier", `import IFoo = Namespace.IFoo;` + `export { type IFoo };`, { options: { compilerOptions: { module: ts.ModuleKind.CommonJS } } } ); + + transpilesCorrectly("Does not elide import equals referenced only by type only export specifier", + `import IFoo = Namespace.IFoo;` + + `export { type IFoo };`, { + options: { compilerOptions: { module: ts.ModuleKind.CommonJS } }, + testVerbatimModuleSyntax: "only" + } + ); }); diff --git a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..cbdee94b59fe1 --- /dev/null +++ b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option (verbatimModuleSyntax=true).js @@ -0,0 +1,24 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var ng = require("angular2/core"); +var MyClass1 = /** @class */ (function () { + function MyClass1(_elementRef) { + this._elementRef = _elementRef; + } + var _a; + MyClass1 = __decorate([ + fooexport, + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) + ], MyClass1); + return MyClass1; +}()); +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..cbdee94b59fe1 --- /dev/null +++ b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,24 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var ng = require("angular2/core"); +var MyClass1 = /** @class */ (function () { + function MyClass1(_elementRef) { + this._elementRef = _elementRef; + } + var _a; + MyClass1 = __decorate([ + fooexport, + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) + ], MyClass1); + return MyClass1; +}()); +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..446d224f1ce3d --- /dev/null +++ b/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + import IFoo = Namespace.IFoo;export type { IFoo }; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..3b56b45b823aa --- /dev/null +++ b/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).js @@ -0,0 +1,4 @@ +"use strict"; +exports.__esModule = true; +var IFoo = Namespace.IFoo; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..446d224f1ce3d --- /dev/null +++ b/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + import IFoo = Namespace.IFoo;export type { IFoo }; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..3b56b45b823aa --- /dev/null +++ b/tests/baselines/reference/transpile/Does not elide import equals referenced only by export type (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,4 @@ +"use strict"; +exports.__esModule = true; +var IFoo = Namespace.IFoo; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..4f2320c9c4e04 --- /dev/null +++ b/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + import IFoo = Namespace.IFoo;export { type IFoo }; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..3b56b45b823aa --- /dev/null +++ b/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).js @@ -0,0 +1,4 @@ +"use strict"; +exports.__esModule = true; +var IFoo = Namespace.IFoo; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..4f2320c9c4e04 --- /dev/null +++ b/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + import IFoo = Namespace.IFoo;export { type IFoo }; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..3b56b45b823aa --- /dev/null +++ b/tests/baselines/reference/transpile/Does not elide import equals referenced only by type only export specifier (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,4 @@ +"use strict"; +exports.__esModule = true; +var IFoo = Namespace.IFoo; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..48e2c35e4443f --- /dev/null +++ b/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + var x: string = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..eb8be3556a141 --- /dev/null +++ b/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..48e2c35e4443f --- /dev/null +++ b/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + var x: string = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..eb8be3556a141 --- /dev/null +++ b/tests/baselines/reference/transpile/Does not generate semantic diagnostics (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..e2c1781e29fad --- /dev/null +++ b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,8 @@ +error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..e2c1781e29fad --- /dev/null +++ b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,8 @@ +error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..5d165a9e5cb32 --- /dev/null +++ b/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,9 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + + var a; + export { a as alias }; + export * as alias from './file'; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..e0f6c0cc4dda0 --- /dev/null +++ b/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).js @@ -0,0 +1,7 @@ +"use strict"; +exports.__esModule = true; +exports.alias = void 0; +var a; +exports.alias = a; +exports.alias = require("./file"); +//# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..5d165a9e5cb32 --- /dev/null +++ b/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,9 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + + var a; + export { a as alias }; + export * as alias from './file'; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..e0f6c0cc4dda0 --- /dev/null +++ b/tests/baselines/reference/transpile/Export star as ns conflict does not crash (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,7 @@ +"use strict"; +exports.__esModule = true; +exports.alias = void 0; +var a; +exports.alias = a; +exports.alias = require("./file"); +//# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..cb892b6e4312d --- /dev/null +++ b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,9 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +file.ts(1,1): error TS1434: Unexpected keyword or identifier. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (1 errors) ==== + a b + ~ +!!! error TS1434: Unexpected keyword or identifier. \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..c2c5134015c6f --- /dev/null +++ b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).js @@ -0,0 +1,3 @@ +a; +b; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..cb892b6e4312d --- /dev/null +++ b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,9 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +file.ts(1,1): error TS1434: Unexpected keyword or identifier. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (1 errors) ==== + a b + ~ +!!! error TS1434: Unexpected keyword or identifier. \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..c2c5134015c6f --- /dev/null +++ b/tests/baselines/reference/transpile/Generates expected syntactic diagnostics (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,3 @@ +a; +b; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..9af2d50b93057 --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,7 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + /// + var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..9324d64de1efa --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).js @@ -0,0 +1,3 @@ +/// +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..9af2d50b93057 --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,7 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + /// + var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..9324d64de1efa --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing file references (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,3 @@ +/// +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..5088820790e6a --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + import {a} from "module2"; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..5008119217a2f --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).js @@ -0,0 +1,4 @@ +"use strict"; +exports.__esModule = true; +var module2_1 = require("module2"); +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..5088820790e6a --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + import {a} from "module2"; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..5008119217a2f --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics for missing module imports (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,4 @@ +"use strict"; +exports.__esModule = true; +var module2_1 = require("module2"); +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..5b06d0efa56ec --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..eb8be3556a141 --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..5b06d0efa56ec --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..eb8be3556a141 --- /dev/null +++ b/tests/baselines/reference/transpile/Generates no diagnostics with valid inputs (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..2dbc7833f54af --- /dev/null +++ b/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + const fn = (a: T) => a \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..76701b98d64fc --- /dev/null +++ b/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +var fn = function (a) { return a; }; +//# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..2dbc7833f54af --- /dev/null +++ b/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + const fn = (a: T) => a \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..76701b98d64fc --- /dev/null +++ b/tests/baselines/reference/transpile/Infer correct file extension (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +var fn = function (a) { return a; }; +//# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..00d0f6d0d9b9b --- /dev/null +++ b/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,7 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file (0 errors) ==== + "use strict"; + var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..61a703e13bbba --- /dev/null +++ b/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).js @@ -0,0 +1,3 @@ +"use strict"; +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..00d0f6d0d9b9b --- /dev/null +++ b/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,7 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file (0 errors) ==== + "use strict"; + var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..61a703e13bbba --- /dev/null +++ b/tests/baselines/reference/transpile/No extra errors for file without extension (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,3 @@ +"use strict"; +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..dc710829d5256 --- /dev/null +++ b/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..1c5faaae6784b --- /dev/null +++ b/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +var a = 10; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..dc710829d5256 --- /dev/null +++ b/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..1c5faaae6784b --- /dev/null +++ b/tests/baselines/reference/transpile/Support options with lib values (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +var a = 10; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..dc710829d5256 --- /dev/null +++ b/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..1c5faaae6784b --- /dev/null +++ b/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +var a = 10; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..dc710829d5256 --- /dev/null +++ b/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + const a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..1c5faaae6784b --- /dev/null +++ b/tests/baselines/reference/transpile/Support options with types values (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +var a = 10; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..07ca9ddfed490 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + ([] as const).forEach(k => console.log(k)); \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..aec83eb5ae525 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +[].forEach(function (k) { return console.log(k); }); +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..07ca9ddfed490 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + ([] as const).forEach(k => console.log(k)); \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..aec83eb5ae525 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports as const arrays (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +[].forEach(function (k) { return console.log(k); }); +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..36495a53372d3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + let x: readonly string[]; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..50fa840c62e8f --- /dev/null +++ b/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +var x; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..36495a53372d3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + let x: readonly string[]; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..50fa840c62e8f --- /dev/null +++ b/tests/baselines/reference/transpile/Supports readonly keyword for arrays (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +var x; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowJs (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowSyntheticDefaultImports (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowUnreachableCode (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting allowUnusedLabels (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8d91090453b8a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).js @@ -0,0 +1,3 @@ +"use strict"; +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8d91090453b8a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting alwaysStrict (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,3 @@ +"use strict"; +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting baseUrl (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..d0357734678dd --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..d0357734678dd --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5101: Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting charset (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting composite (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting declaration (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting declarationDir (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting emitBOM (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting emitDecoratorMetadata (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting experimentalDecorators (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting forceConsistentCasingInFileNames (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting incremental (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsx (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsxFactory (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting jsxFragmentFactory (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting lib (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting locale (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting module (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting moduleResolution (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting newLine (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmit (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmitHelpers (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noEmitOnError (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noErrorTruncation (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noFallthroughCasesInSwitch (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitAny (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitReturns (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitThis (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..d018d9ffb97c7 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..d018d9ffb97c7 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noImplicitUseStrict (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noLib (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting noResolve (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting out (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting outDir (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting outFile (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting paths (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting preserveConstEnums (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting reactNamespace (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting removeComments (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..aabde4cab2729 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== ./rootDir/input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..aabde4cab2729 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== ./rootDir/input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting rootDir (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting rootDirs (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting skipDefaultLibCheck (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting skipLibCheck (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting strictNullChecks (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting stripInternal (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..a33a5c24a1bcd --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..a33a5c24a1bcd --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting suppressExcessPropertyErrors (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..f9ea56e463d40 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..f9ea56e463d40 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting suppressImplicitAnyIndexErrors (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting target (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting target (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting target (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting target (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting target (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting target (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting tsbuildinfo (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting typeRoots (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..3d6bff97de1a3 --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== input.js (0 errors) ==== + x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting types (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..eaad023b29980 --- /dev/null +++ b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata (verbatimModuleSyntax=true).js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MyClass = void 0; +var db_1 = require("./db"); +function someDecorator(target) { + return target; +} +var MyClass = /** @class */ (function () { + function MyClass(db) { + this.db = db; + this.db.doSomething(); + } + var _a; + MyClass = __decorate([ + someDecorator, + __metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" ? _a : Object]) + ], MyClass); + return MyClass; +}()); +exports.MyClass = MyClass; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..eaad023b29980 --- /dev/null +++ b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MyClass = void 0; +var db_1 = require("./db"); +function someDecorator(target) { + return target; +} +var MyClass = /** @class */ (function () { + function MyClass(db) { + this.db = db; + this.db.doSomething(); + } + var _a; + MyClass = __decorate([ + someDecorator, + __metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" ? _a : Object]) + ], MyClass); + return MyClass; +}()); +exports.MyClass = MyClass; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).errors.txt new file mode 100644 index 0000000000000..5b06d0efa56ec --- /dev/null +++ b/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..976498c2da8c6 --- /dev/null +++ b/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).oldTranspile.errors.txt new file mode 100644 index 0000000000000..5b06d0efa56ec --- /dev/null +++ b/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -0,0 +1,6 @@ +error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. + + +!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. +==== file.ts (0 errors) ==== + var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..976498c2da8c6 --- /dev/null +++ b/tests/baselines/reference/transpile/Uses correct newLine character (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +var x = 0; +//# sourceMappingURL=file.js.map \ No newline at end of file From d97bb67c0a52b5a48067c7ada1d1a587b3d36d39 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 14 Mar 2023 14:15:54 -0700 Subject: [PATCH 13/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53174=20(Remo?= =?UTF-8?q?ve=20old=20references=20to=20Node=20v4,=20s...)=20into=20releas?= =?UTF-8?q?e-5.0=20(#53189)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- src/compiler/sys.ts | 19 +------------------ src/tsserver/nodeServer.ts | 5 +---- src/tsserver/server.ts | 3 +-- .../reference/api/tsserverlibrary.d.ts | 1 - tests/baselines/reference/api/typescript.d.ts | 1 - 5 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 7efb312fadc51..21418f24574e0 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1449,21 +1449,6 @@ declare const global: any; declare const __filename: string; declare const __dirname: string; -export function getNodeMajorVersion(): number | undefined { - if (typeof process === "undefined") { - return undefined; - } - const version: string = process.version; - if (!version) { - return undefined; - } - const dot = version.indexOf("."); - if (dot === -1) { - return undefined; - } - return parseInt(version.substring(1, dot)); -} - // TODO: GH#18217 this is used as if it's certainly defined in many places. // eslint-disable-next-line prefer-const export let sys: System = (() => { @@ -1493,8 +1478,6 @@ export let sys: System = (() => { from?(input: string, encoding?: string): any; } = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion! >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform: string = _os.platform(); @@ -1508,7 +1491,7 @@ export let sys: System = (() => { // Note that if we ever emit as files like cjs/mjs, this check will be wrong. const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, diff --git a/src/tsserver/nodeServer.ts b/src/tsserver/nodeServer.ts index a3c65bec0c245..bba46b325be81 100644 --- a/src/tsserver/nodeServer.ts +++ b/src/tsserver/nodeServer.ts @@ -11,7 +11,6 @@ import { DirectoryWatcherCallback, FileWatcher, getDirectoryPath, - getNodeMajorVersion, getRootLength, JsTyping, LanguageServiceMode, @@ -299,9 +298,7 @@ export function initializeNodeSystem(): StartInput { const libDirectory = getDirectoryPath(normalizePath(sys.getExecutingFilePath())); - const nodeVersion = getNodeMajorVersion(); - // use watchGuard process on Windows when node version is 4 or later - const useWatchGuard = process.platform === "win32" && nodeVersion! >= 4; + const useWatchGuard = process.platform === "win32"; const originalWatchDirectory: ServerHost["watchDirectory"] = sys.watchDirectory.bind(sys); const logger = createLogger(); diff --git a/src/tsserver/server.ts b/src/tsserver/server.ts index 38dc43c224479..f752178022f08 100644 --- a/src/tsserver/server.ts +++ b/src/tsserver/server.ts @@ -1,6 +1,5 @@ import { Debug, - getNodeMajorVersion, setStackTraceLimit, sys, version, @@ -30,7 +29,7 @@ function start({ args, logger, cancellationToken, serverMode, unknownServerMode, logger.info(`Starting TS Server`); logger.info(`Version: ${version}`); logger.info(`Arguments: ${args.join(" ")}`); - logger.info(`Platform: ${platform} NodeVersion: ${getNodeMajorVersion()} CaseSensitive: ${sys.useCaseSensitiveFileNames}`); + logger.info(`Platform: ${platform} NodeVersion: ${process.version} CaseSensitive: ${sys.useCaseSensitiveFileNames}`); logger.info(`ServerMode: ${serverMode} hasUnknownServerMode: ${unknownServerMode}`); setStackTraceLimit(); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index f23fc06fcc24a..c77ba617e3617 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8286,7 +8286,6 @@ declare namespace ts { negative: boolean; base10Value: string; } - function getNodeMajorVersion(): number | undefined; enum FileWatcherEventKind { Created = 0, Changed = 1, diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 4b06d971712f5..374e65ab49e59 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4311,7 +4311,6 @@ declare namespace ts { negative: boolean; base10Value: string; } - function getNodeMajorVersion(): number | undefined; enum FileWatcherEventKind { Created = 0, Changed = 1, From cb69c8a717820c9873170e55108dab77f8a086bf Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 14 Mar 2023 21:26:18 +0000 Subject: [PATCH 14/35] Update LKG --- lib/tsc.js | 18 +----------------- lib/tsserver.js | 26 +++----------------------- lib/tsserverlibrary.d.ts | 1 - lib/tsserverlibrary.js | 20 +------------------- lib/typescript.d.ts | 1 - lib/typescript.js | 19 +------------------ lib/typingsInstaller.js | 18 +----------------- 7 files changed, 7 insertions(+), 96 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 455e89ea50ece..4cc491cdfb3f4 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -4915,20 +4915,6 @@ function patchWriteFileEnsuringDirectory(sys2) { (path2) => sys2.directoryExists(path2) ); } -function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); -} var sys = (() => { const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { @@ -4945,14 +4931,12 @@ var sys = (() => { let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, diff --git a/lib/tsserver.js b/lib/tsserver.js index 95cf3dfd1867b..6727606fbd625 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -884,7 +884,6 @@ __export(server_exports, { getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, @@ -8356,20 +8355,6 @@ function patchWriteFileEnsuringDirectory(sys2) { (path2) => sys2.directoryExists(path2) ); } -function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); -} var sys = (() => { const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { @@ -8386,14 +8371,12 @@ var sys = (() => { let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, @@ -168595,7 +168578,6 @@ __export(ts_exports3, { getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, @@ -181109,8 +181091,7 @@ function initializeNodeSystem() { } } const libDirectory = getDirectoryPath(normalizePath(sys2.getExecutingFilePath())); - const nodeVersion = getNodeMajorVersion(); - const useWatchGuard = process.platform === "win32" && nodeVersion >= 4; + const useWatchGuard = process.platform === "win32"; const originalWatchDirectory = sys2.watchDirectory.bind(sys2); const logger = createLogger(); Debug.loggingHost = { @@ -181665,7 +181646,7 @@ function start({ args, logger, cancellationToken, serverMode, unknownServerMode, logger.info(`Starting TS Server`); logger.info(`Version: ${version}`); logger.info(`Arguments: ${args.join(" ")}`); - logger.info(`Platform: ${platform} NodeVersion: ${getNodeMajorVersion()} CaseSensitive: ${sys.useCaseSensitiveFileNames}`); + logger.info(`Platform: ${platform} NodeVersion: ${process.version} CaseSensitive: ${sys.useCaseSensitiveFileNames}`); logger.info(`ServerMode: ${serverMode} hasUnknownServerMode: ${unknownServerMode}`); setStackTraceLimit(); if (Debug.isDebugging) { @@ -182544,7 +182525,6 @@ start(initializeNodeSystem(), require("os").platform()); getNodeForGeneratedName, getNodeId, getNodeKind, - getNodeMajorVersion, getNodeModifiers, getNodeModulePathParts, getNonAssignedNameOfDeclaration, diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index f23fc06fcc24a..c77ba617e3617 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -8286,7 +8286,6 @@ declare namespace ts { negative: boolean; base10Value: string; } - function getNodeMajorVersion(): number | undefined; enum FileWatcherEventKind { Created = 0, Changed = 1, diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 6ee07994a3c51..8bc15d4f5b870 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -6137,20 +6137,6 @@ ${lanes.join("\n")} (path2) => sys2.directoryExists(path2) ); } - function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); - } function setSys(s) { sys = s; } @@ -6198,14 +6184,12 @@ ${lanes.join("\n")} let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, @@ -179181,7 +179165,6 @@ ${e.message}`; getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, @@ -181540,7 +181523,6 @@ ${e.message}`; getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 4b06d971712f5..374e65ab49e59 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -4311,7 +4311,6 @@ declare namespace ts { negative: boolean; base10Value: string; } - function getNodeMajorVersion(): number | undefined; enum FileWatcherEventKind { Created = 0, Changed = 1, diff --git a/lib/typescript.js b/lib/typescript.js index 463d182232629..c74ab926d761b 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -6137,20 +6137,6 @@ ${lanes.join("\n")} (path2) => sys2.directoryExists(path2) ); } - function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); - } function setSys(s) { sys = s; } @@ -6198,14 +6184,12 @@ ${lanes.join("\n")} let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, @@ -168362,7 +168346,6 @@ ${options.prefix}` : "\n" : options.prefix getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index c2e6ea1276b7c..1f8713008fa60 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -4349,20 +4349,6 @@ function patchWriteFileEnsuringDirectory(sys2) { (path3) => sys2.directoryExists(path3) ); } -function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); -} var sys = (() => { const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { @@ -4379,14 +4365,12 @@ var sys = (() => { let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, From 0e765ac48d833c18d70d7baf7254d0b6409f47bc Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 15 Mar 2023 15:39:00 -0700 Subject: [PATCH 15/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53268=20(fix(?= =?UTF-8?q?53204):=20Bug:=20=5F=5FrunInitializers(...)=20into=20release-5.?= =?UTF-8?q?0=20(#53273)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Oleksandr T --- src/compiler/transformers/esDecorators.ts | 6 ++- ...Decorators-classExpression-classSuper.7.js | 50 +++++++++++++++++++ ...Decorators-classExpression-classSuper.7.ts | 24 +++++++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/esDecorators-classExpression-classSuper.7.js create mode 100644 tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.7.ts diff --git a/src/compiler/transformers/esDecorators.ts b/src/compiler/transformers/esDecorators.ts index d0614bf9f907d..ede888850b445 100644 --- a/src/compiler/transformers/esDecorators.ts +++ b/src/compiler/transformers/esDecorators.ts @@ -36,6 +36,7 @@ import { Expression, ExpressionStatement, findComputedPropertyNameCacheAssignment, + findSuperStatementIndex, firstOrUndefined, forEachEntry, ForStatement, @@ -1072,8 +1073,11 @@ export function transformESDecorators(context: TransformationContext): (x: Sourc if (initializerStatements) { const statements: Statement[] = []; const nonPrologueStart = factory.copyPrologue(node.body.statements, statements, /*ensureUseStrict*/ false, visitor); + const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); + const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : undefined; + addRange(statements, visitNodes(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : undefined)); addRange(statements, initializerStatements); - addRange(statements, visitNodes(node.body.statements, visitor, isStatement, nonPrologueStart)); + addRange(statements, visitNodes(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); body = factory.createBlock(statements, /*multiLine*/ true); setOriginalNode(body, node.body); setTextRange(body, node.body); diff --git a/tests/baselines/reference/esDecorators-classExpression-classSuper.7.js b/tests/baselines/reference/esDecorators-classExpression-classSuper.7.js new file mode 100644 index 0000000000000..b496925f6861f --- /dev/null +++ b/tests/baselines/reference/esDecorators-classExpression-classSuper.7.js @@ -0,0 +1,50 @@ +//// [esDecorators-classExpression-classSuper.7.ts] +class A {} +class B extends A { + public constructor() { + 'inject'; + super(); + const a = 1; + const b = 1; + } + + @foo + public m(): void {} +} + +function foo(method: any, _context: any): any { + return function (this: any) { + method.call(this); + }; +} + +new B(); + + +//// [esDecorators-classExpression-classSuper.7.js] +class A { +} +let B = (() => { + let _instanceExtraInitializers = []; + let _m_decorators; + return class B extends A { + static { + _m_decorators = [foo]; + __esDecorate(this, null, _m_decorators, { kind: "method", name: "m", static: false, private: false, access: { has: obj => "m" in obj, get: obj => obj.m } }, null, _instanceExtraInitializers); + } + constructor() { + 'inject'; + super(); + __runInitializers(this, _instanceExtraInitializers); + const a = 1; + const b = 1; + } + m() { } + }; +})(); +function foo(method, _context) { + return function () { + method.call(this); + }; +} +new B(); diff --git a/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.7.ts b/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.7.ts new file mode 100644 index 0000000000000..2c1452bbcbf4e --- /dev/null +++ b/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.7.ts @@ -0,0 +1,24 @@ +// @target: es2022 +// @noEmitHelpers: true +// @noTypesAndSymbols: true + +class A {} +class B extends A { + public constructor() { + 'inject'; + super(); + const a = 1; + const b = 1; + } + + @foo + public m(): void {} +} + +function foo(method: any, _context: any): any { + return function (this: any) { + method.call(this); + }; +} + +new B(); From 3ec598c947cdcda4349f7f8615d6344c9673235f Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 15 Mar 2023 23:58:05 +0000 Subject: [PATCH 16/35] Update LKG --- lib/tsc.js | 5 ++++- lib/tsserver.js | 5 ++++- lib/tsserverlibrary.js | 5 ++++- lib/typescript.js | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 4cc491cdfb3f4..d3d0ee328b340 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -91029,8 +91029,11 @@ function transformESDecorators(context) { false, visitor ); + const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); + const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0; + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0)); addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart)); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); body = factory2.createBlock( statements, /*multiLine*/ diff --git a/lib/tsserver.js b/lib/tsserver.js index 6727606fbd625..e923d557263b3 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -95799,8 +95799,11 @@ function transformESDecorators(context) { false, visitor ); + const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); + const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0; + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0)); addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart)); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); body = factory2.createBlock( statements, /*multiLine*/ diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 8bc15d4f5b870..66bf62109d21b 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -93802,8 +93802,11 @@ ${lanes.join("\n")} false, visitor ); + const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); + const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0; + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0)); addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart)); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); body = factory2.createBlock( statements, /*multiLine*/ diff --git a/lib/typescript.js b/lib/typescript.js index c74ab926d761b..c812bf9575857 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -93802,8 +93802,11 @@ ${lanes.join("\n")} false, visitor ); + const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); + const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0; + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0)); addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart)); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); body = factory2.createBlock( statements, /*multiLine*/ From 5348903e8891b39c7b8b0400b2c6e5e426e11175 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 22 Mar 2023 14:46:54 -0700 Subject: [PATCH 17/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53385=20(Add?= =?UTF-8?q?=20missing=20ambient=20check=20to=20`verba...)=20into=20release?= =?UTF-8?q?-5.0=20(#53389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrew Branch --- src/compiler/checker.ts | 4 ++-- ...erbatimModuleSyntaxDeclarationFile.symbols | 24 +++++++++++++++++++ .../verbatimModuleSyntaxDeclarationFile.types | 22 +++++++++++++++++ ...erbatimModuleSyntaxNoElisionCJS.errors.txt | 5 +--- .../verbatimModuleSyntaxDeclarationFile.ts | 15 ++++++++++++ 5 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 tests/baselines/reference/verbatimModuleSyntaxDeclarationFile.symbols create mode 100644 tests/baselines/reference/verbatimModuleSyntaxDeclarationFile.types create mode 100644 tests/cases/conformance/externalModules/verbatimModuleSyntaxDeclarationFile.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5e374efbfba36..c962f183997e5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -44164,7 +44164,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (getAllSymbolFlags(sym) & SymbolFlags.Value) { // However if it is a value, we need to check it's being used correctly checkExpressionCached(id); - if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, SymbolFlags.Value)) { + if (!isIllegalExportDefaultInCJS && !(node.flags & NodeFlags.Ambient) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, SymbolFlags.Value)) { error(id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration @@ -44172,7 +44172,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { idText(id)); } } - else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + else if (!isIllegalExportDefaultInCJS && !(node.flags & NodeFlags.Ambient) && compilerOptions.verbatimModuleSyntax) { error(id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type diff --git a/tests/baselines/reference/verbatimModuleSyntaxDeclarationFile.symbols b/tests/baselines/reference/verbatimModuleSyntaxDeclarationFile.symbols new file mode 100644 index 0000000000000..ff0b6e6691ad9 --- /dev/null +++ b/tests/baselines/reference/verbatimModuleSyntaxDeclarationFile.symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/externalModules/type1.d.ts === +declare namespace NS { +>NS : Symbol(NS, Decl(type1.d.ts, 0, 0)) + + type A = object; +>A : Symbol(A, Decl(type1.d.ts, 0, 22)) +} + +export = NS; +>NS : Symbol(NS, Decl(type1.d.ts, 0, 0)) + +export as namespace MyTypes; +>MyTypes : Symbol(MyTypes, Decl(type1.d.ts, 4, 12)) + +=== tests/cases/conformance/externalModules/type2.d.ts === +import type * as NS from './type1'; +>NS : Symbol(NS, Decl(type2.d.ts, 0, 11)) + +export = NS; +>NS : Symbol(NS, Decl(type2.d.ts, 0, 11)) + +export as namespace ModuleATypes; +>ModuleATypes : Symbol(ModuleATypes, Decl(type2.d.ts, 2, 12)) + diff --git a/tests/baselines/reference/verbatimModuleSyntaxDeclarationFile.types b/tests/baselines/reference/verbatimModuleSyntaxDeclarationFile.types new file mode 100644 index 0000000000000..3191db67a3217 --- /dev/null +++ b/tests/baselines/reference/verbatimModuleSyntaxDeclarationFile.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/externalModules/type1.d.ts === +declare namespace NS { + type A = object; +>A : object +} + +export = NS; +>NS : any + +export as namespace MyTypes; +>MyTypes : error + +=== tests/cases/conformance/externalModules/type2.d.ts === +import type * as NS from './type1'; +>NS : error + +export = NS; +>NS : any + +export as namespace ModuleATypes; +>ModuleATypes : error + diff --git a/tests/baselines/reference/verbatimModuleSyntaxNoElisionCJS.errors.txt b/tests/baselines/reference/verbatimModuleSyntaxNoElisionCJS.errors.txt index f035e2365b774..65c8813196309 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxNoElisionCJS.errors.txt +++ b/tests/baselines/reference/verbatimModuleSyntaxNoElisionCJS.errors.txt @@ -1,7 +1,6 @@ /a.ts(2,10): error TS1282: An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but 'I' only refers to a type. /b.ts(1,1): error TS1484: 'I' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. /d.ts(3,10): error TS1283: An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but 'J' resolves to a type-only declaration. -/e.d.ts(2,10): error TS1282: An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but 'I' only refers to a type. ==== /a.ts (1 errors) ==== @@ -29,11 +28,9 @@ ~ !!! error TS1283: An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but 'J' resolves to a type-only declaration. -==== /e.d.ts (1 errors) ==== +==== /e.d.ts (0 errors) ==== interface I {} export = I; - ~ -!!! error TS1282: An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but 'I' only refers to a type. ==== /f.ts (0 errors) ==== import type I = require("./e"); diff --git a/tests/cases/conformance/externalModules/verbatimModuleSyntaxDeclarationFile.ts b/tests/cases/conformance/externalModules/verbatimModuleSyntaxDeclarationFile.ts new file mode 100644 index 0000000000000..e5ae260180147 --- /dev/null +++ b/tests/cases/conformance/externalModules/verbatimModuleSyntaxDeclarationFile.ts @@ -0,0 +1,15 @@ +// @verbatimModuleSyntax: true + +// @Filename: type1.d.ts +declare namespace NS { + type A = object; +} + +export = NS; +export as namespace MyTypes; + +// @Filename: type2.d.ts +import type * as NS from './type1'; + +export = NS; +export as namespace ModuleATypes; From e34eaff0c61e564656643cb7b67d6590b271b3c4 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 23 Mar 2023 11:54:51 -0700 Subject: [PATCH 18/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53388=20(Excl?= =?UTF-8?q?ude=20special=20index=20signature=20rul...)=20into=20release-5.?= =?UTF-8?q?0=20(#53445)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniel Rosenwasser --- src/compiler/checker.ts | 2 +- .../narrowingMutualSubtypes.errors.txt | 155 ++++++++++ .../reference/narrowingMutualSubtypes.js | 132 ++++++++- .../reference/narrowingMutualSubtypes.symbols | 265 ++++++++++++++---- .../reference/narrowingMutualSubtypes.types | 184 +++++++++++- .../cases/compiler/narrowingMutualSubtypes.ts | 72 ++++- 6 files changed, 741 insertions(+), 69 deletions(-) create mode 100644 tests/baselines/reference/narrowingMutualSubtypes.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c962f183997e5..576450d0bd1e7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -22357,7 +22357,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const targetHasStringIndex = some(indexInfos, info => info.keyType === stringType); let result = Ternary.True; for (const targetInfo of indexInfos) { - const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & TypeFlags.Any ? Ternary.True : + const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & TypeFlags.Any ? Ternary.True : isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, RecursionFlags.Both, reportErrors) : typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState); if (!related) { diff --git a/tests/baselines/reference/narrowingMutualSubtypes.errors.txt b/tests/baselines/reference/narrowingMutualSubtypes.errors.txt new file mode 100644 index 0000000000000..8f65deade7c12 --- /dev/null +++ b/tests/baselines/reference/narrowingMutualSubtypes.errors.txt @@ -0,0 +1,155 @@ +tests/cases/compiler/narrowingMutualSubtypes.ts(117,17): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'any[] | Record'. + No index signature with a parameter of type 'string' was found on type 'any[] | Record'. +tests/cases/compiler/narrowingMutualSubtypes.ts(118,29): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'any[] | Record'. + No index signature with a parameter of type 'string' was found on type 'any[] | Record'. + + +==== tests/cases/compiler/narrowingMutualSubtypes.ts (2 errors) ==== + // Check that `any` is a strict supertype of `unknown` + + declare const ru1: { [x: string]: unknown }; + declare const ra1: { [x: string]: any }; + + const a1a = [ru1, ra1]; // { [x: string]: any }[] + const a1b = [ra1, ru1]; // { [x: string]: any }[] + + declare const ra2: { [x: string]: any }; + declare const ru2: { [x: string]: unknown }; + + const a2a = [ru2, ra2]; // { [x: string]: any }[] + const a2b = [ra2, ru2]; // { [x: string]: any }[] + + // Check that `{}` is strict supertype of any non-empty object + + const c3 = {}; + declare const r3: { [x: string]: unknown } + + const a3a = [c3, r3]; // {}[] + const a3b = [r3, c3]; // {}[] + + declare const r4: { [x: string]: unknown } + const c4 = {}; + + const a4a = [c4, r4]; // {}[] + const a4b = [r4, c4]; // {}[] + + // Check that {} is a strict supertype of Record + + declare function isObject1(value: unknown): value is Record; + + function gg1(x: {}) { + if (isObject1(x)) { + x; // Record + } + else { + x; // {} + } + x; // {} + } + + declare function isObject2(value: unknown): value is {}; + + function gg2(x: Record) { + if (isObject2(x)) { + x; // Record + } + else { + x; // never + } + x; // Record + } + + // Check that {} is a strict supertype of Record + + declare function isObject3(value: unknown): value is Record; + + function gg3(x: {}) { + if (isObject3(x)) { + x; // Record + } + else { + x; // {} + } + x; // {} + } + + declare function isObject4(value: unknown): value is {}; + + function gg4(x: Record) { + if (isObject4(x)) { + x; // Record + } + else { + x; // never + } + x; // Record + } + + // Repro from #50916 + + type Identity = {[K in keyof T]: T[K]}; + + type Self = T extends unknown ? Identity : never; + + function is(value: T): value is Self { + return true; + } + + type Union = {a: number} | {b: number} | {c: number}; + + function example(x: Union) { + if (is(x)) {} + if (is(x)) {} + if (is(x)) {} + if (is(x)) {} + if (is(x)) {} + if (is(x)) {} + if (is(x)) {} + if (is(x)) {} + x; // Union + } + + function checksArrayOrObject1(obj: Record | Record[]) { + // "accidentally" guards the first branch on the length + if (Array.isArray(obj) && obj.length) { + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { + if (obj[key] !== undefined) { + ~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'any[] | Record'. +!!! error TS7053: No index signature with a parameter of type 'string' was found on type 'any[] | Record'. + console.log(obj[key]) + ~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'any[] | Record'. +!!! error TS7053: No index signature with a parameter of type 'string' was found on type 'any[] | Record'. + } + } + } + } + + function checksArrayOrObject2(obj: Record | Record[]) { + if (Array.isArray(obj)) { + // obj should only be an array type here + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/narrowingMutualSubtypes.js b/tests/baselines/reference/narrowingMutualSubtypes.js index 0d5f36d2f9551..69faca4689f3d 100644 --- a/tests/baselines/reference/narrowingMutualSubtypes.js +++ b/tests/baselines/reference/narrowingMutualSubtypes.js @@ -27,11 +27,11 @@ const c4 = {}; const a4a = [c4, r4]; // {}[] const a4b = [r4, c4]; // {}[] -// Check that narrowing preserves original type in false branch for non-identical mutual subtypes +// Check that {} is a strict supertype of Record declare function isObject1(value: unknown): value is Record; -function gg(x: {}) { +function gg1(x: {}) { if (isObject1(x)) { x; // Record } @@ -45,14 +45,40 @@ declare function isObject2(value: unknown): value is {}; function gg2(x: Record) { if (isObject2(x)) { - x; // {} + x; // Record } else { - x; // Record + x; // never } x; // Record } +// Check that {} is a strict supertype of Record + +declare function isObject3(value: unknown): value is Record; + +function gg3(x: {}) { + if (isObject3(x)) { + x; // Record + } + else { + x; // {} + } + x; // {} +} + +declare function isObject4(value: unknown): value is {}; + +function gg4(x: Record) { + if (isObject4(x)) { + x; // Record + } + else { + x; // never + } + x; // Record +} + // Repro from #50916 type Identity = {[K in keyof T]: T[K]}; @@ -76,6 +102,44 @@ function example(x: Union) { if (is(x)) {} x; // Union } + +function checksArrayOrObject1(obj: Record | Record[]) { + // "accidentally" guards the first branch on the length + if (Array.isArray(obj) && obj.length) { + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } +} + +function checksArrayOrObject2(obj: Record | Record[]) { + if (Array.isArray(obj)) { + // obj should only be an array type here + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } +} //// [narrowingMutualSubtypes.js] @@ -92,7 +156,7 @@ var a3b = [r3, c3]; // {}[] var c4 = {}; var a4a = [c4, r4]; // {}[] var a4b = [r4, c4]; // {}[] -function gg(x) { +function gg1(x) { if (isObject1(x)) { x; // Record } @@ -103,13 +167,31 @@ function gg(x) { } function gg2(x) { if (isObject2(x)) { - x; // {} + x; // Record } else { - x; // Record + x; // never } x; // Record } +function gg3(x) { + if (isObject3(x)) { + x; // Record + } + else { + x; // {} + } + x; // {} +} +function gg4(x) { + if (isObject4(x)) { + x; // Record + } + else { + x; // never + } + x; // Record +} function is(value) { return true; } @@ -124,3 +206,39 @@ function example(x) { if (is(x)) { } x; // Union } +function checksArrayOrObject1(obj) { + // "accidentally" guards the first branch on the length + if (Array.isArray(obj) && obj.length) { + for (var key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]); + } + } + } + else { + // 'obj' should probably not include an array type here. + for (var key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]); + } + } + } +} +function checksArrayOrObject2(obj) { + if (Array.isArray(obj)) { + // obj should only be an array type here + for (var key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]); + } + } + } + else { + // 'obj' should probably not include an array type here. + for (var key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]); + } + } + } +} diff --git a/tests/baselines/reference/narrowingMutualSubtypes.symbols b/tests/baselines/reference/narrowingMutualSubtypes.symbols index 9229c0b6e2946..a08534ac2a31c 100644 --- a/tests/baselines/reference/narrowingMutualSubtypes.symbols +++ b/tests/baselines/reference/narrowingMutualSubtypes.symbols @@ -73,7 +73,7 @@ const a4b = [r4, c4]; // {}[] >r4 : Symbol(r4, Decl(narrowingMutualSubtypes.ts, 22, 13)) >c4 : Symbol(c4, Decl(narrowingMutualSubtypes.ts, 23, 5)) -// Check that narrowing preserves original type in false branch for non-identical mutual subtypes +// Check that {} is a strict supertype of Record declare function isObject1(value: unknown): value is Record; >isObject1 : Symbol(isObject1, Decl(narrowingMutualSubtypes.ts, 26, 21)) @@ -81,23 +81,23 @@ declare function isObject1(value: unknown): value is Record; >value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 30, 27)) >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) -function gg(x: {}) { ->gg : Symbol(gg, Decl(narrowingMutualSubtypes.ts, 30, 77)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 12)) +function gg1(x: {}) { +>gg1 : Symbol(gg1, Decl(narrowingMutualSubtypes.ts, 30, 77)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 13)) if (isObject1(x)) { >isObject1 : Symbol(isObject1, Decl(narrowingMutualSubtypes.ts, 26, 21)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 12)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 13)) x; // Record ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 12)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 13)) } else { x; // {} ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 12)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 13)) } x; // {} ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 12)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 32, 13)) } declare function isObject2(value: unknown): value is {}; @@ -114,90 +114,251 @@ function gg2(x: Record) { >isObject2 : Symbol(isObject2, Decl(narrowingMutualSubtypes.ts, 40, 1)) >x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 44, 13)) - x; // {} + x; // Record >x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 44, 13)) } else { - x; // Record + x; // never >x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 44, 13)) } x; // Record >x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 44, 13)) } +// Check that {} is a strict supertype of Record + +declare function isObject3(value: unknown): value is Record; +>isObject3 : Symbol(isObject3, Decl(narrowingMutualSubtypes.ts, 52, 1)) +>value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 56, 27)) +>value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 56, 27)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + +function gg3(x: {}) { +>gg3 : Symbol(gg3, Decl(narrowingMutualSubtypes.ts, 56, 73)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 58, 13)) + + if (isObject3(x)) { +>isObject3 : Symbol(isObject3, Decl(narrowingMutualSubtypes.ts, 52, 1)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 58, 13)) + + x; // Record +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 58, 13)) + } + else { + x; // {} +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 58, 13)) + } + x; // {} +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 58, 13)) +} + +declare function isObject4(value: unknown): value is {}; +>isObject4 : Symbol(isObject4, Decl(narrowingMutualSubtypes.ts, 66, 1)) +>value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 68, 27)) +>value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 68, 27)) + +function gg4(x: Record) { +>gg4 : Symbol(gg4, Decl(narrowingMutualSubtypes.ts, 68, 56)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 70, 13)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + + if (isObject4(x)) { +>isObject4 : Symbol(isObject4, Decl(narrowingMutualSubtypes.ts, 66, 1)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 70, 13)) + + x; // Record +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 70, 13)) + } + else { + x; // never +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 70, 13)) + } + x; // Record +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 70, 13)) +} + // Repro from #50916 type Identity = {[K in keyof T]: T[K]}; ->Identity : Symbol(Identity, Decl(narrowingMutualSubtypes.ts, 52, 1)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 56, 14)) ->K : Symbol(K, Decl(narrowingMutualSubtypes.ts, 56, 21)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 56, 14)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 56, 14)) ->K : Symbol(K, Decl(narrowingMutualSubtypes.ts, 56, 21)) +>Identity : Symbol(Identity, Decl(narrowingMutualSubtypes.ts, 78, 1)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 82, 14)) +>K : Symbol(K, Decl(narrowingMutualSubtypes.ts, 82, 21)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 82, 14)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 82, 14)) +>K : Symbol(K, Decl(narrowingMutualSubtypes.ts, 82, 21)) type Self = T extends unknown ? Identity : never; ->Self : Symbol(Self, Decl(narrowingMutualSubtypes.ts, 56, 42)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 58, 10)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 58, 10)) ->Identity : Symbol(Identity, Decl(narrowingMutualSubtypes.ts, 52, 1)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 58, 10)) +>Self : Symbol(Self, Decl(narrowingMutualSubtypes.ts, 82, 42)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 84, 10)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 84, 10)) +>Identity : Symbol(Identity, Decl(narrowingMutualSubtypes.ts, 78, 1)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 84, 10)) function is(value: T): value is Self { ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 60, 12)) ->value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 60, 15)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 60, 12)) ->value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 60, 15)) ->Self : Symbol(Self, Decl(narrowingMutualSubtypes.ts, 56, 42)) ->T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 60, 12)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 86, 12)) +>value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 86, 15)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 86, 12)) +>value : Symbol(value, Decl(narrowingMutualSubtypes.ts, 86, 15)) +>Self : Symbol(Self, Decl(narrowingMutualSubtypes.ts, 82, 42)) +>T : Symbol(T, Decl(narrowingMutualSubtypes.ts, 86, 12)) return true; } type Union = {a: number} | {b: number} | {c: number}; ->Union : Symbol(Union, Decl(narrowingMutualSubtypes.ts, 62, 1)) ->a : Symbol(a, Decl(narrowingMutualSubtypes.ts, 64, 15)) ->b : Symbol(b, Decl(narrowingMutualSubtypes.ts, 64, 29)) ->c : Symbol(c, Decl(narrowingMutualSubtypes.ts, 64, 43)) +>Union : Symbol(Union, Decl(narrowingMutualSubtypes.ts, 88, 1)) +>a : Symbol(a, Decl(narrowingMutualSubtypes.ts, 90, 15)) +>b : Symbol(b, Decl(narrowingMutualSubtypes.ts, 90, 29)) +>c : Symbol(c, Decl(narrowingMutualSubtypes.ts, 90, 43)) function example(x: Union) { ->example : Symbol(example, Decl(narrowingMutualSubtypes.ts, 64, 54)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) ->Union : Symbol(Union, Decl(narrowingMutualSubtypes.ts, 62, 1)) +>example : Symbol(example, Decl(narrowingMutualSubtypes.ts, 90, 54)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) +>Union : Symbol(Union, Decl(narrowingMutualSubtypes.ts, 88, 1)) if (is(x)) {} ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) if (is(x)) {} ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) if (is(x)) {} ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) if (is(x)) {} ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) if (is(x)) {} ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) if (is(x)) {} ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) if (is(x)) {} ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) if (is(x)) {} ->is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 58, 55)) ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>is : Symbol(is, Decl(narrowingMutualSubtypes.ts, 84, 55)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) x; // Union ->x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 66, 17)) +>x : Symbol(x, Decl(narrowingMutualSubtypes.ts, 92, 17)) +} + +function checksArrayOrObject1(obj: Record | Record[]) { +>checksArrayOrObject1 : Symbol(checksArrayOrObject1, Decl(narrowingMutualSubtypes.ts, 102, 1)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + + // "accidentally" guards the first branch on the length + if (Array.isArray(obj) && obj.length) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) +>obj.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) + + for (let key in obj) { +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 107, 16)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) + + if (obj[key] !== undefined) { +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 107, 16)) +>undefined : Symbol(undefined) + + console.log(obj[key]) +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 107, 16)) + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 115, 16)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) + + if (obj[key] !== undefined) { +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 115, 16)) +>undefined : Symbol(undefined) + + console.log(obj[key]) +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 104, 30)) +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 115, 16)) + } + } + } +} + +function checksArrayOrObject2(obj: Record | Record[]) { +>checksArrayOrObject2 : Symbol(checksArrayOrObject2, Decl(narrowingMutualSubtypes.ts, 121, 1)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 123, 30)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + + if (Array.isArray(obj)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 123, 30)) + + // obj should only be an array type here + for (let key in obj) { +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 126, 16)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 123, 30)) + + if (obj[key] !== undefined) { +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 123, 30)) +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 126, 16)) +>undefined : Symbol(undefined) + + console.log(obj[key]) +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 123, 30)) +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 126, 16)) + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 134, 16)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 123, 30)) + + if (obj[key] !== undefined) { +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 123, 30)) +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 134, 16)) +>undefined : Symbol(undefined) + + console.log(obj[key]) +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>obj : Symbol(obj, Decl(narrowingMutualSubtypes.ts, 123, 30)) +>key : Symbol(key, Decl(narrowingMutualSubtypes.ts, 134, 16)) + } + } + } } diff --git a/tests/baselines/reference/narrowingMutualSubtypes.types b/tests/baselines/reference/narrowingMutualSubtypes.types index 7ed2f5955d678..c335387467d23 100644 --- a/tests/baselines/reference/narrowingMutualSubtypes.types +++ b/tests/baselines/reference/narrowingMutualSubtypes.types @@ -83,14 +83,14 @@ const a4b = [r4, c4]; // {}[] >r4 : { [x: string]: unknown; } >c4 : {} -// Check that narrowing preserves original type in false branch for non-identical mutual subtypes +// Check that {} is a strict supertype of Record declare function isObject1(value: unknown): value is Record; >isObject1 : (value: unknown) => value is Record >value : unknown -function gg(x: {}) { ->gg : (x: {}) => void +function gg1(x: {}) { +>gg1 : (x: {}) => void >x : {} if (isObject1(x)) { @@ -122,17 +122,67 @@ function gg2(x: Record) { >isObject2 : (value: unknown) => value is {} >x : Record - x; // {} + x; // Record >x : Record } else { - x; // Record + x; // never >x : never } x; // Record >x : Record } +// Check that {} is a strict supertype of Record + +declare function isObject3(value: unknown): value is Record; +>isObject3 : (value: unknown) => value is Record +>value : unknown + +function gg3(x: {}) { +>gg3 : (x: {}) => void +>x : {} + + if (isObject3(x)) { +>isObject3(x) : boolean +>isObject3 : (value: unknown) => value is Record +>x : {} + + x; // Record +>x : Record + } + else { + x; // {} +>x : {} + } + x; // {} +>x : {} +} + +declare function isObject4(value: unknown): value is {}; +>isObject4 : (value: unknown) => value is {} +>value : unknown + +function gg4(x: Record) { +>gg4 : (x: Record) => void +>x : Record + + if (isObject4(x)) { +>isObject4(x) : boolean +>isObject4 : (value: unknown) => value is {} +>x : Record + + x; // Record +>x : Record + } + else { + x; // never +>x : never + } + x; // Record +>x : Record +} + // Repro from #50916 type Identity = {[K in keyof T]: T[K]}; @@ -203,3 +253,127 @@ function example(x: Union) { >x : Union } +function checksArrayOrObject1(obj: Record | Record[]) { +>checksArrayOrObject1 : (obj: Record | Record[]) => void +>obj : Record | Record[] + + // "accidentally" guards the first branch on the length + if (Array.isArray(obj) && obj.length) { +>Array.isArray(obj) && obj.length : number | false +>Array.isArray(obj) : boolean +>Array.isArray : (arg: any) => arg is any[] +>Array : ArrayConstructor +>isArray : (arg: any) => arg is any[] +>obj : Record | Record[] +>obj.length : number +>obj : any[] | Record[] +>length : number + + for (let key in obj) { +>key : string +>obj : any[] | Record[] + + if (obj[key] !== undefined) { +>obj[key] !== undefined : boolean +>obj[key] : any +>obj : any[] | Record[] +>key : string +>undefined : undefined + + console.log(obj[key]) +>console.log(obj[key]) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>obj[key] : any +>obj : any[] | Record[] +>key : string + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { +>key : string +>obj : any[] | Record + + if (obj[key] !== undefined) { +>obj[key] !== undefined : boolean +>obj[key] : any +>obj : any[] | Record +>key : string +>undefined : undefined + + console.log(obj[key]) +>console.log(obj[key]) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>obj[key] : any +>obj : any[] | Record +>key : string + } + } + } +} + +function checksArrayOrObject2(obj: Record | Record[]) { +>checksArrayOrObject2 : (obj: Record | Record[]) => void +>obj : Record | Record[] + + if (Array.isArray(obj)) { +>Array.isArray(obj) : boolean +>Array.isArray : (arg: any) => arg is any[] +>Array : ArrayConstructor +>isArray : (arg: any) => arg is any[] +>obj : Record | Record[] + + // obj should only be an array type here + for (let key in obj) { +>key : string +>obj : any[] | Record[] + + if (obj[key] !== undefined) { +>obj[key] !== undefined : boolean +>obj[key] : any +>obj : any[] | Record[] +>key : string +>undefined : undefined + + console.log(obj[key]) +>console.log(obj[key]) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>obj[key] : any +>obj : any[] | Record[] +>key : string + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { +>key : string +>obj : Record + + if (obj[key] !== undefined) { +>obj[key] !== undefined : boolean +>obj[key] : any +>obj : Record +>key : string +>undefined : undefined + + console.log(obj[key]) +>console.log(obj[key]) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>obj[key] : any +>obj : Record +>key : string + } + } + } +} + diff --git a/tests/cases/compiler/narrowingMutualSubtypes.ts b/tests/cases/compiler/narrowingMutualSubtypes.ts index 1d666c256fa77..de026cb2066ad 100644 --- a/tests/cases/compiler/narrowingMutualSubtypes.ts +++ b/tests/cases/compiler/narrowingMutualSubtypes.ts @@ -28,11 +28,11 @@ const c4 = {}; const a4a = [c4, r4]; // {}[] const a4b = [r4, c4]; // {}[] -// Check that narrowing preserves original type in false branch for non-identical mutual subtypes +// Check that {} is a strict supertype of Record declare function isObject1(value: unknown): value is Record; -function gg(x: {}) { +function gg1(x: {}) { if (isObject1(x)) { x; // Record } @@ -46,14 +46,40 @@ declare function isObject2(value: unknown): value is {}; function gg2(x: Record) { if (isObject2(x)) { - x; // {} + x; // Record } else { - x; // Record + x; // never } x; // Record } +// Check that {} is a strict supertype of Record + +declare function isObject3(value: unknown): value is Record; + +function gg3(x: {}) { + if (isObject3(x)) { + x; // Record + } + else { + x; // {} + } + x; // {} +} + +declare function isObject4(value: unknown): value is {}; + +function gg4(x: Record) { + if (isObject4(x)) { + x; // Record + } + else { + x; // never + } + x; // Record +} + // Repro from #50916 type Identity = {[K in keyof T]: T[K]}; @@ -77,3 +103,41 @@ function example(x: Union) { if (is(x)) {} x; // Union } + +function checksArrayOrObject1(obj: Record | Record[]) { + // "accidentally" guards the first branch on the length + if (Array.isArray(obj) && obj.length) { + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } +} + +function checksArrayOrObject2(obj: Record | Record[]) { + if (Array.isArray(obj)) { + // obj should only be an array type here + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } + else { + // 'obj' should probably not include an array type here. + for (let key in obj) { + if (obj[key] !== undefined) { + console.log(obj[key]) + } + } + } +} From e674ef3d583936f1a15b4208834db7fae0929fa9 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 23 Mar 2023 13:15:25 -0700 Subject: [PATCH 19/35] Pick PR #53468 (Fix incorrect assert about configFi...) into release-5.0 (#53471) --- src/compiler/watchPublic.ts | 3 +- src/testRunner/unittests/tscWatch/watchApi.ts | 104 ++++++++- ...oject-when-there-is-no-config-file-name.js | 157 +++++++++++++ ...tends-when-there-is-no-config-file-name.js | 218 ++++++++++++++++++ 4 files changed, 479 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/tscWatch/watchApi/when-watching-referenced-project-when-there-is-no-config-file-name.js create mode 100644 tests/baselines/reference/tscWatch/watchApi/when-watching-referenced-project-with-extends-when-there-is-no-config-file-name.js diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index 48b50a68a766c..1c2b92fce7fb6 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -1088,7 +1088,6 @@ export function createWatchProgram(host: WatchCompiler } function updateExtendedConfigFilesWatches(forProjectPath: Path, options: CompilerOptions | undefined, watchOptions: WatchOptions | undefined, watchType: WatchTypeRegistry["ExtendedConfigFile"] | WatchTypeRegistry["ExtendedConfigOfReferencedProject"]) { - Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, @@ -1104,7 +1103,7 @@ export function createWatchProgram(host: WatchCompiler // If there are no referenced projects this extended config file watcher depend on ignore if (!projects?.size) return; projects.forEach(projectPath => { - if (toPath(configFileName) === projectPath) { + if (configFileName && toPath(configFileName) === projectPath) { // If this is the config file of the project, reload completely reloadLevel = ConfigFileProgramReloadLevel.Full; } diff --git a/src/testRunner/unittests/tscWatch/watchApi.ts b/src/testRunner/unittests/tscWatch/watchApi.ts index c7c80c1daf280..8e6c86af257cf 100644 --- a/src/testRunner/unittests/tscWatch/watchApi.ts +++ b/src/testRunner/unittests/tscWatch/watchApi.ts @@ -1,6 +1,7 @@ import * as Harness from "../../_namespaces/Harness"; import * as ts from "../../_namespaces/ts"; -import { commandLineCallbacks } from "../tsc/helpers"; +import { dedent } from "../../_namespaces/Utils"; +import { commandLineCallbacks, libContent } from "../tsc/helpers"; import { createWatchedSystem, File, @@ -11,6 +12,7 @@ import { applyEdit, createBaseline, createWatchCompilerHostOfConfigFileForBaseline, + createWatchCompilerHostOfFilesAndCompilerOptionsForBaseline, runWatchBaseline, watchBaseline, } from "./helpers"; @@ -718,3 +720,103 @@ describe("unittests:: tsc-watch:: watchAPI:: when builder emit occurs with emitO verify("when emitting with emitOnlyDtsFiles"); verify("when emitting with emitOnlyDtsFiles with outFile", "outFile.js"); }); + +describe("unittests:: tsc-watch:: watchAPI:: when creating program with project references but not config file", () => { + function setup(libExtends: boolean) { + const system = createWatchedSystem({ + "/user/username/projects/project/tsconfig.json": JSON.stringify({ + compilerOptions: { types: [] }, + files: ["app.ts"], + references: [{ path: "./lib" }] + }), + "/user/username/projects/project/app.ts": dedent` + import { one } from './lib'; + console.log(one); + `, + "/user/username/projects/project/lib/tsconfig.json": JSON.stringify({ + extends: libExtends ? "./tsconfig.base.json" : undefined, + compilerOptions: libExtends ? undefined : { composite: true, types: [] }, + files: ["index.ts"], + }), + "/user/username/projects/project/lib/tsconfig.base.json": JSON.stringify({ + compilerOptions: { composite: true, types: [] }, + }), + "/user/username/projects/project/lib/index.ts": "export const one = 1;", + "/user/username/projects/project/lib/index.d.ts": "export const one = 1;", + [libFile.path]: libContent, + }); + const baseline = createBaseline(system); + const commandLine = ts.getParsedCommandLineOfConfigFile( + "/user/username/projects/project/tsconfig.json", + { extendedDiagnostics: true }, + { + useCaseSensitiveFileNames: true, + fileExists: path => system.fileExists(path), + readFile: path => system.readFile(path), + getCurrentDirectory: () => system.getCurrentDirectory(), + readDirectory: (path, extensions, excludes, includes, depth) => system.readDirectory(path, extensions, excludes, includes, depth), + onUnRecoverableConfigFileDiagnostic: ts.noop, + } + )!; + const compilerHost = createWatchCompilerHostOfFilesAndCompilerOptionsForBaseline({ + cb: baseline.cb, + system, + rootFiles: commandLine.fileNames, + options: commandLine.options, + projectReferences: commandLine.projectReferences, + watchOptions: commandLine.watchOptions, + }); + const watch = ts.createWatchProgram(compilerHost); + return { watch, baseline }; + } + + it("when watching referenced project when there is no config file name", () => { + const { watch, baseline } = setup(/*libExtends*/ false); + runWatchBaseline({ + scenario: "watchApi", + subScenario: "when watching referenced project when there is no config file name", + commandLineArgs: ["--w", "-p", ".", "--extendedDiagnostics"], + ...baseline, + edits: [ + { + caption: "Modify lib tsconfig", + edit: sys => sys.writeFile(`/user/username/projects/project/lib/tsconfig.json`, JSON.stringify({ + compilerOptions: { composite: true }, + files: ["index.ts"], + })), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ], + watchOrSolution: watch + }); + }); + + it("when watching referenced project with extends when there is no config file name", () => { + const { watch, baseline } = setup(/*libExtends*/ true); + runWatchBaseline({ + scenario: "watchApi", + subScenario: "when watching referenced project with extends when there is no config file name", + commandLineArgs: ["--w", "-p", ".", "--extendedDiagnostics"], + ...baseline, + edits: [ + { + caption: "Modify lib tsconfig", + edit: sys => sys.writeFile(`/user/username/projects/project/lib/tsconfig.json`, JSON.stringify({ + extends: "./tsconfig.base.json", + compilerOptions: { typeRoots: [] }, + files: ["index.ts"], + })), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "Modify lib extends", + edit: sys => sys.writeFile(`/user/username/projects/project/lib/tsconfig.base.json`, JSON.stringify({ + compilerOptions: { composite: true }, + })), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ], + watchOrSolution: watch + }); + }); +}); diff --git a/tests/baselines/reference/tscWatch/watchApi/when-watching-referenced-project-when-there-is-no-config-file-name.js b/tests/baselines/reference/tscWatch/watchApi/when-watching-referenced-project-when-there-is-no-config-file-name.js new file mode 100644 index 0000000000000..8687427d074c0 --- /dev/null +++ b/tests/baselines/reference/tscWatch/watchApi/when-watching-referenced-project-when-there-is-no-config-file-name.js @@ -0,0 +1,157 @@ +Input:: +//// [/user/username/projects/project/tsconfig.json] +{"compilerOptions":{"types":[]},"files":["app.ts"],"references":[{"path":"./lib"}]} + +//// [/user/username/projects/project/app.ts] +import { one } from './lib'; +console.log(one); + + +//// [/user/username/projects/project/lib/tsconfig.json] +{"compilerOptions":{"composite":true,"types":[]},"files":["index.ts"]} + +//// [/user/username/projects/project/lib/tsconfig.base.json] +{"compilerOptions":{"composite":true,"types":[]}} + +//// [/user/username/projects/project/lib/index.ts] +export const one = 1; + +//// [/user/username/projects/project/lib/index.d.ts] +export const one = 1; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js --w -p . --extendedDiagnostics +Output:: +[12:00:31 AM] Starting compilation in watch mode... + +Current directory: / CaseSensitiveFileNames: false +Synchronizing program +CreatingProgramWith:: + roots: ["/user/username/projects/project/app.ts"] + options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} + projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}] +Loading config file: /user/username/projects/project/lib/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project +FileWatcher:: Added:: WatchInfo: /user/username/projects/project/app.ts 250 undefined Source file +DirectoryWatcher:: Added:: WatchInfo: /user 1 undefined Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user 1 undefined Failed Lookup Locations +FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/index.d.ts 250 undefined Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 undefined Source file +DirectoryWatcher:: Triggered with /user/username/projects/project/app.js :: WatchInfo: /user 1 undefined Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/project/app.js :: WatchInfo: /user 1 undefined Failed Lookup Locations +[12:00:34 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/project/app.ts"] +Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/project/lib/index.d.ts +/user/username/projects/project/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/project/lib/index.d.ts +/user/username/projects/project/app.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/project/lib/index.d.ts (used version) +/user/username/projects/project/app.ts (used version) + +PolledWatches:: + +FsWatches:: +/user/username/projects/project/lib/tsconfig.json: + {} +/user/username/projects/project/app.ts: + {} +/user/username/projects/project/lib/index.d.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/user: + {} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/project/app.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var lib_1 = require("./lib"); +console.log(lib_1.one); + + + +Change:: Modify lib tsconfig + +Input:: +//// [/user/username/projects/project/lib/tsconfig.json] +{"compilerOptions":{"composite":true},"files":["index.ts"]} + + +Output:: +FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project +Synchronizing program +Loading config file: /user/username/projects/project/lib/tsconfig.json +[12:00:38 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["/user/username/projects/project/app.ts"] + options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} + projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}] +[12:00:39 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/project/app.ts"] +Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/project/lib/index.d.ts +/user/username/projects/project/app.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +PolledWatches:: + +FsWatches:: +/user/username/projects/project/lib/tsconfig.json: + {} +/user/username/projects/project/app.ts: + {} +/user/username/projects/project/lib/index.d.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/user: + {} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/watchApi/when-watching-referenced-project-with-extends-when-there-is-no-config-file-name.js b/tests/baselines/reference/tscWatch/watchApi/when-watching-referenced-project-with-extends-when-there-is-no-config-file-name.js new file mode 100644 index 0000000000000..e5e8fbccf2c5f --- /dev/null +++ b/tests/baselines/reference/tscWatch/watchApi/when-watching-referenced-project-with-extends-when-there-is-no-config-file-name.js @@ -0,0 +1,218 @@ +Input:: +//// [/user/username/projects/project/tsconfig.json] +{"compilerOptions":{"types":[]},"files":["app.ts"],"references":[{"path":"./lib"}]} + +//// [/user/username/projects/project/app.ts] +import { one } from './lib'; +console.log(one); + + +//// [/user/username/projects/project/lib/tsconfig.json] +{"extends":"./tsconfig.base.json","files":["index.ts"]} + +//// [/user/username/projects/project/lib/tsconfig.base.json] +{"compilerOptions":{"composite":true,"types":[]}} + +//// [/user/username/projects/project/lib/index.ts] +export const one = 1; + +//// [/user/username/projects/project/lib/index.d.ts] +export const one = 1; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js --w -p . --extendedDiagnostics +Output:: +[12:00:31 AM] Starting compilation in watch mode... + +Current directory: / CaseSensitiveFileNames: false +Synchronizing program +CreatingProgramWith:: + roots: ["/user/username/projects/project/app.ts"] + options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} + projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}] +Loading config file: /user/username/projects/project/lib/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project +FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/tsconfig.base.json 2000 undefined Extended config file of referenced project +FileWatcher:: Added:: WatchInfo: /user/username/projects/project/app.ts 250 undefined Source file +DirectoryWatcher:: Added:: WatchInfo: /user 1 undefined Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user 1 undefined Failed Lookup Locations +FileWatcher:: Added:: WatchInfo: /user/username/projects/project/lib/index.d.ts 250 undefined Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 undefined Source file +DirectoryWatcher:: Triggered with /user/username/projects/project/app.js :: WatchInfo: /user 1 undefined Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/project/app.js :: WatchInfo: /user 1 undefined Failed Lookup Locations +[12:00:34 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/project/app.ts"] +Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/project/lib/index.d.ts +/user/username/projects/project/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/project/lib/index.d.ts +/user/username/projects/project/app.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/project/lib/index.d.ts (used version) +/user/username/projects/project/app.ts (used version) + +PolledWatches:: + +FsWatches:: +/user/username/projects/project/lib/tsconfig.json: + {} +/user/username/projects/project/lib/tsconfig.base.json: + {} +/user/username/projects/project/app.ts: + {} +/user/username/projects/project/lib/index.d.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/user: + {} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/project/app.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var lib_1 = require("./lib"); +console.log(lib_1.one); + + + +Change:: Modify lib tsconfig + +Input:: +//// [/user/username/projects/project/lib/tsconfig.json] +{"extends":"./tsconfig.base.json","compilerOptions":{"typeRoots":[]},"files":["index.ts"]} + + +Output:: +FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.json 2000 undefined Config file of referened project +Synchronizing program +Loading config file: /user/username/projects/project/lib/tsconfig.json +[12:00:38 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["/user/username/projects/project/app.ts"] + options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} + projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}] +[12:00:39 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/project/app.ts"] +Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/project/lib/index.d.ts +/user/username/projects/project/app.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +PolledWatches:: + +FsWatches:: +/user/username/projects/project/lib/tsconfig.json: + {} +/user/username/projects/project/lib/tsconfig.base.json: + {} +/user/username/projects/project/app.ts: + {} +/user/username/projects/project/lib/index.d.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/user: + {} + +exitCode:: ExitStatus.undefined + + +Change:: Modify lib extends + +Input:: +//// [/user/username/projects/project/lib/tsconfig.base.json] +{"compilerOptions":{"composite":true}} + + +Output:: +FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.base.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.base.json 2000 undefined Extended config file of referenced project +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/project/lib/tsconfig.base.json 1:: WatchInfo: /user/username/projects/project/lib/tsconfig.base.json 2000 undefined Extended config file of referenced project +Synchronizing program +Loading config file: /user/username/projects/project/lib/tsconfig.json +[12:00:43 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["/user/username/projects/project/app.ts"] + options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} + projectReferences: [{"path":"/user/username/projects/project/lib","originalPath":"./lib"}] +[12:00:44 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/project/app.ts"] +Program options: {"types":[],"extendedDiagnostics":true,"configFilePath":"/user/username/projects/project/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/project/lib/index.d.ts +/user/username/projects/project/app.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +PolledWatches:: + +FsWatches:: +/user/username/projects/project/lib/tsconfig.json: + {} +/user/username/projects/project/lib/tsconfig.base.json: + {} +/user/username/projects/project/app.ts: + {} +/user/username/projects/project/lib/index.d.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/user: + {} + +exitCode:: ExitStatus.undefined + From b78f920ea09cef0ded4ca620e6f546b4e893e154 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 27 Mar 2023 14:01:09 -0700 Subject: [PATCH 20/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53365=20(Chan?= =?UTF-8?q?ge=20ParamaterDecorator=20to=20allow=20...)=20into=20release-5.?= =?UTF-8?q?0=20(#53392)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniel Hritzkiv --- src/lib/decorators.legacy.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/decorators.legacy.d.ts b/src/lib/decorators.legacy.d.ts index 5638b44921b7a..2207e50bbda2d 100644 --- a/src/lib/decorators.legacy.d.ts +++ b/src/lib/decorators.legacy.d.ts @@ -1,4 +1,4 @@ declare type ClassDecorator = (target: TFunction) => TFunction | void; declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void; From aebd31be07b6ba9f18f092ae9d70daa2a62686c8 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 27 Mar 2023 18:12:23 -0700 Subject: [PATCH 21/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53547=20(Fix?= =?UTF-8?q?=20double-emit=20in=20constructor)=20into=20release-5.0=20(#535?= =?UTF-8?q?50)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ron Buckton --- src/compiler/transformers/esDecorators.ts | 13 ++- ...ecorators-classDeclaration-classSuper.7.js | 101 ++++++++++++++++++ ...Decorators-classExpression-classSuper.7.js | 50 --------- ...corators-classDeclaration-classSuper.7.ts} | 19 ++++ 4 files changed, 129 insertions(+), 54 deletions(-) create mode 100644 tests/baselines/reference/esDecorators-classDeclaration-classSuper.7.js delete mode 100644 tests/baselines/reference/esDecorators-classExpression-classSuper.7.js rename tests/cases/conformance/esDecorators/{classExpression/classSuper/esDecorators-classExpression-classSuper.7.ts => classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.7.ts} (51%) diff --git a/src/compiler/transformers/esDecorators.ts b/src/compiler/transformers/esDecorators.ts index ede888850b445..c6cf63c375926 100644 --- a/src/compiler/transformers/esDecorators.ts +++ b/src/compiler/transformers/esDecorators.ts @@ -1074,10 +1074,15 @@ export function transformESDecorators(context: TransformationContext): (x: Sourc const statements: Statement[] = []; const nonPrologueStart = factory.copyPrologue(node.body.statements, statements, /*ensureUseStrict*/ false, visitor); const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); - const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : undefined; - addRange(statements, visitNodes(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : undefined)); - addRange(statements, initializerStatements); - addRange(statements, visitNodes(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); + if (superStatementIndex >= 0) { + addRange(statements, visitNodes(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart)); + addRange(statements, initializerStatements); + addRange(statements, visitNodes(node.body.statements, visitor, isStatement, superStatementIndex + 1)); + } + else { + addRange(statements, initializerStatements); + addRange(statements, visitNodes(node.body.statements, visitor, isStatement)); + } body = factory.createBlock(statements, /*multiLine*/ true); setOriginalNode(body, node.body); setTextRange(body, node.body); diff --git a/tests/baselines/reference/esDecorators-classDeclaration-classSuper.7.js b/tests/baselines/reference/esDecorators-classDeclaration-classSuper.7.js new file mode 100644 index 0000000000000..e0f2c4397b00b --- /dev/null +++ b/tests/baselines/reference/esDecorators-classDeclaration-classSuper.7.js @@ -0,0 +1,101 @@ +//// [esDecorators-classDeclaration-classSuper.7.ts] +class A {} +class B extends A { + public constructor() { + 'inject'; + super(); + const a = 1; + const b = 1; + } + + @foo + public m(): void {} +} + +function foo(method: any, _context: any): any { + return function (this: any) { + method.call(this); + }; +} + +new B(); + +// https://github.com/microsoft/TypeScript/issues/53448 +class C { + public constructor() { + this.val; + } + + @foo + public get val(): number { return 3; } +} +class D extends A { + public constructor() { + super(); + this.val; + } + + @foo + public get val(): number { return 3; } +} + + +//// [esDecorators-classDeclaration-classSuper.7.js] +class A { +} +let B = (() => { + let _instanceExtraInitializers = []; + let _m_decorators; + return class B extends A { + static { + _m_decorators = [foo]; + __esDecorate(this, null, _m_decorators, { kind: "method", name: "m", static: false, private: false, access: { has: obj => "m" in obj, get: obj => obj.m } }, null, _instanceExtraInitializers); + } + constructor() { + 'inject'; + super(); + __runInitializers(this, _instanceExtraInitializers); + const a = 1; + const b = 1; + } + m() { } + }; +})(); +function foo(method, _context) { + return function () { + method.call(this); + }; +} +new B(); +// https://github.com/microsoft/TypeScript/issues/53448 +let C = (() => { + let _instanceExtraInitializers_1 = []; + let _get_val_decorators; + return class C { + static { + _get_val_decorators = [foo]; + __esDecorate(this, null, _get_val_decorators, { kind: "getter", name: "val", static: false, private: false, access: { has: obj => "val" in obj, get: obj => obj.val } }, null, _instanceExtraInitializers_1); + } + constructor() { + __runInitializers(this, _instanceExtraInitializers_1); + this.val; + } + get val() { return 3; } + }; +})(); +let D = (() => { + let _instanceExtraInitializers_2 = []; + let _get_val_decorators; + return class D extends A { + static { + _get_val_decorators = [foo]; + __esDecorate(this, null, _get_val_decorators, { kind: "getter", name: "val", static: false, private: false, access: { has: obj => "val" in obj, get: obj => obj.val } }, null, _instanceExtraInitializers_2); + } + constructor() { + super(); + __runInitializers(this, _instanceExtraInitializers_2); + this.val; + } + get val() { return 3; } + }; +})(); diff --git a/tests/baselines/reference/esDecorators-classExpression-classSuper.7.js b/tests/baselines/reference/esDecorators-classExpression-classSuper.7.js deleted file mode 100644 index b496925f6861f..0000000000000 --- a/tests/baselines/reference/esDecorators-classExpression-classSuper.7.js +++ /dev/null @@ -1,50 +0,0 @@ -//// [esDecorators-classExpression-classSuper.7.ts] -class A {} -class B extends A { - public constructor() { - 'inject'; - super(); - const a = 1; - const b = 1; - } - - @foo - public m(): void {} -} - -function foo(method: any, _context: any): any { - return function (this: any) { - method.call(this); - }; -} - -new B(); - - -//// [esDecorators-classExpression-classSuper.7.js] -class A { -} -let B = (() => { - let _instanceExtraInitializers = []; - let _m_decorators; - return class B extends A { - static { - _m_decorators = [foo]; - __esDecorate(this, null, _m_decorators, { kind: "method", name: "m", static: false, private: false, access: { has: obj => "m" in obj, get: obj => obj.m } }, null, _instanceExtraInitializers); - } - constructor() { - 'inject'; - super(); - __runInitializers(this, _instanceExtraInitializers); - const a = 1; - const b = 1; - } - m() { } - }; -})(); -function foo(method, _context) { - return function () { - method.call(this); - }; -} -new B(); diff --git a/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.7.ts b/tests/cases/conformance/esDecorators/classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.7.ts similarity index 51% rename from tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.7.ts rename to tests/cases/conformance/esDecorators/classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.7.ts index 2c1452bbcbf4e..0365481bfc2d1 100644 --- a/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.7.ts +++ b/tests/cases/conformance/esDecorators/classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.7.ts @@ -22,3 +22,22 @@ function foo(method: any, _context: any): any { } new B(); + +// https://github.com/microsoft/TypeScript/issues/53448 +class C { + public constructor() { + this.val; + } + + @foo + public get val(): number { return 3; } +} +class D extends A { + public constructor() { + super(); + this.val; + } + + @foo + public get val(): number { return 3; } +} From b345c3a563a9ec66660075297ad50ac1d195e5a3 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 28 Mar 2023 09:50:12 -0700 Subject: [PATCH 22/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53443=20(Supp?= =?UTF-8?q?ort=20wildcard=20exports=20in=20tsconfi...)=20into=20release-5.?= =?UTF-8?q?0=20(#53557)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrew Branch --- src/compiler/moduleNameResolver.ts | 2 +- ...tendsPackageJsonExportsWildcard.errors.txt | 30 +++++++++++++++++++ ...configExtendsPackageJsonExportsWildcard.ts | 27 +++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/tsconfigExtendsPackageJsonExportsWildcard.errors.txt create mode 100644 tests/cases/compiler/tsconfigExtendsPackageJsonExportsWildcard.ts diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index e24f647c99c2f..a673672119cf3 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -1679,7 +1679,7 @@ export function nodeModuleNameResolver(moduleName: string, containingFile: strin /** @internal */ export function nodeNextJsonConfigResolver(moduleName: string, containingFile: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations { - return nodeModuleNameResolverWorker(NodeResolutionFeatures.Exports, moduleName, getDirectoryPath(containingFile), { moduleResolution: ModuleResolutionKind.NodeNext }, host, /*cache*/ undefined, Extensions.Json, /*isConfigLookup*/ true, /*redirectedReference*/ undefined); + return nodeModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, getDirectoryPath(containingFile), { moduleResolution: ModuleResolutionKind.NodeNext }, host, /*cache*/ undefined, Extensions.Json, /*isConfigLookup*/ true, /*redirectedReference*/ undefined); } function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleName: string, containingDirectory: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: ModuleResolutionCache | undefined, extensions: Extensions, isConfigLookup: boolean, redirectedReference: ResolvedProjectReference | undefined): ResolvedModuleWithFailedLookupLocations { diff --git a/tests/baselines/reference/tsconfigExtendsPackageJsonExportsWildcard.errors.txt b/tests/baselines/reference/tsconfigExtendsPackageJsonExportsWildcard.errors.txt new file mode 100644 index 0000000000000..1cc129214b666 --- /dev/null +++ b/tests/baselines/reference/tsconfigExtendsPackageJsonExportsWildcard.errors.txt @@ -0,0 +1,30 @@ +/index.ts(2,1): error TS2454: Variable 'x' is used before being assigned. + + +==== /tsconfig.json (0 errors) ==== + { + "extends": "foo/strict.json" + } + +==== /node_modules/foo/package.json (0 errors) ==== + { + "name": "foo", + "version": "1.0.0", + "exports": { + "./*.json": "./configs/*.json" + } + } + +==== /node_modules/foo/configs/strict.json (0 errors) ==== + { + "compilerOptions": { + "strict": true + } + } + +==== /index.ts (1 errors) ==== + let x: string; + x.toLowerCase(); + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + \ No newline at end of file diff --git a/tests/cases/compiler/tsconfigExtendsPackageJsonExportsWildcard.ts b/tests/cases/compiler/tsconfigExtendsPackageJsonExportsWildcard.ts new file mode 100644 index 0000000000000..1caadbb1260b1 --- /dev/null +++ b/tests/cases/compiler/tsconfigExtendsPackageJsonExportsWildcard.ts @@ -0,0 +1,27 @@ +// @noTypesAndSymbols: true +// @noEmit: true + +// @Filename: /node_modules/foo/package.json +{ + "name": "foo", + "version": "1.0.0", + "exports": { + "./*.json": "./configs/*.json" + } +} + +// @Filename: /node_modules/foo/configs/strict.json +{ + "compilerOptions": { + "strict": true + } +} + +// @Filename: /tsconfig.json +{ + "extends": "foo/strict.json" +} + +// @Filename: /index.ts +let x: string; +x.toLowerCase(); From 7e093f072bb47e3a2818d5acc497eae091112ad0 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 28 Mar 2023 10:02:37 -0700 Subject: [PATCH 23/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53351=20(Fix?= =?UTF-8?q?=20subtype=20reduction=20involving=20typ...)=20into=20release-5?= =?UTF-8?q?.0=20(#53422)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Anders Hejlsberg --- src/compiler/checker.ts | 10 ++ .../subtypeReductionUnionConstraints.symbols | 113 ++++++++++++++++++ .../subtypeReductionUnionConstraints.types | 99 +++++++++++++++ .../subtypeReductionUnionConstraints.ts | 39 ++++++ 4 files changed, 261 insertions(+) create mode 100644 tests/baselines/reference/subtypeReductionUnionConstraints.symbols create mode 100644 tests/baselines/reference/subtypeReductionUnionConstraints.types create mode 100644 tests/cases/compiler/subtypeReductionUnionConstraints.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 576450d0bd1e7..d4deb510a20c3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16199,6 +16199,16 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { i--; const source = types[i]; if (hasEmptyObject || source.flags & TypeFlags.StructuredOrInstantiable) { + // A type parameter with a union constraint may be a subtype of some union, but not a subtype of the + // individual constituents of that union. For example, `T extends A | B` is a subtype of `A | B`, but not + // a subtype of just `A` or just `B`. When we encounter such a type parameter, we therefore check if the + // type parameter is a subtype of a union of all the other types. + if (source.flags & TypeFlags.TypeParameter && getBaseConstraintOrType(source).flags & TypeFlags.Union) { + if (isTypeRelatedTo(source, getUnionType(map(types, t => t === source ? neverType : t)), strictSubtypeRelation)) { + orderedRemoveItemAt(types, i); + } + continue; + } // Find the first property with a unit type, if any. When constituents have a property by the same name // but of a different unit type, we can quickly disqualify them from subtype checks. This helps subtype // reduction of large discriminated union types. diff --git a/tests/baselines/reference/subtypeReductionUnionConstraints.symbols b/tests/baselines/reference/subtypeReductionUnionConstraints.symbols new file mode 100644 index 0000000000000..926ecfd2e3974 --- /dev/null +++ b/tests/baselines/reference/subtypeReductionUnionConstraints.symbols @@ -0,0 +1,113 @@ +=== tests/cases/compiler/subtypeReductionUnionConstraints.ts === +// Repro from #53311 + +type FooNode = { +>FooNode : Symbol(FooNode, Decl(subtypeReductionUnionConstraints.ts, 0, 0)) + + kind: 'foo'; +>kind : Symbol(kind, Decl(subtypeReductionUnionConstraints.ts, 2, 16)) + + children: Node[]; +>children : Symbol(children, Decl(subtypeReductionUnionConstraints.ts, 3, 16)) +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) + +}; + +type BarNode = { +>BarNode : Symbol(BarNode, Decl(subtypeReductionUnionConstraints.ts, 5, 2)) + + kind: 'bar'; +>kind : Symbol(kind, Decl(subtypeReductionUnionConstraints.ts, 7, 16)) +} + +type Node = FooNode | BarNode; +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) +>FooNode : Symbol(FooNode, Decl(subtypeReductionUnionConstraints.ts, 0, 0)) +>BarNode : Symbol(BarNode, Decl(subtypeReductionUnionConstraints.ts, 5, 2)) + +type Document = { +>Document : Symbol(Document, Decl(subtypeReductionUnionConstraints.ts, 11, 30)) + + kind: 'document'; +>kind : Symbol(kind, Decl(subtypeReductionUnionConstraints.ts, 13, 17)) + + children: Node[]; +>children : Symbol(children, Decl(subtypeReductionUnionConstraints.ts, 14, 21)) +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) + +}; + +declare function isNode(node: unknown): node is Node; +>isNode : Symbol(isNode, Decl(subtypeReductionUnionConstraints.ts, 16, 2)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 18, 24)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 18, 24)) +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) + +declare function isBar(node: Node): node is BarNode; +>isBar : Symbol(isBar, Decl(subtypeReductionUnionConstraints.ts, 18, 53)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 19, 23)) +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 19, 23)) +>BarNode : Symbol(BarNode, Decl(subtypeReductionUnionConstraints.ts, 5, 2)) + +export function visitNodes(node: Document | Node, predicate: (testNode: Node) => testNode is T): void { +>visitNodes : Symbol(visitNodes, Decl(subtypeReductionUnionConstraints.ts, 19, 52)) +>T : Symbol(T, Decl(subtypeReductionUnionConstraints.ts, 21, 27)) +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 21, 43)) +>Document : Symbol(Document, Decl(subtypeReductionUnionConstraints.ts, 11, 30)) +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) +>predicate : Symbol(predicate, Decl(subtypeReductionUnionConstraints.ts, 21, 65)) +>testNode : Symbol(testNode, Decl(subtypeReductionUnionConstraints.ts, 21, 78)) +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) +>testNode : Symbol(testNode, Decl(subtypeReductionUnionConstraints.ts, 21, 78)) +>T : Symbol(T, Decl(subtypeReductionUnionConstraints.ts, 21, 27)) + + isNode(node) && predicate(node); +>isNode : Symbol(isNode, Decl(subtypeReductionUnionConstraints.ts, 16, 2)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 21, 43)) +>predicate : Symbol(predicate, Decl(subtypeReductionUnionConstraints.ts, 21, 65)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 21, 43)) + + if (!isNode(node) || !isBar(node)) { +>isNode : Symbol(isNode, Decl(subtypeReductionUnionConstraints.ts, 16, 2)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 21, 43)) +>isBar : Symbol(isBar, Decl(subtypeReductionUnionConstraints.ts, 18, 53)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 21, 43)) + + const nodes: Node[] = node.children; +>nodes : Symbol(nodes, Decl(subtypeReductionUnionConstraints.ts, 24, 13)) +>Node : Symbol(Node, Decl(subtypeReductionUnionConstraints.ts, 9, 1)) +>node.children : Symbol(children, Decl(subtypeReductionUnionConstraints.ts, 3, 16), Decl(subtypeReductionUnionConstraints.ts, 14, 21)) +>node : Symbol(node, Decl(subtypeReductionUnionConstraints.ts, 21, 43)) +>children : Symbol(children, Decl(subtypeReductionUnionConstraints.ts, 3, 16), Decl(subtypeReductionUnionConstraints.ts, 14, 21)) + } +} + +// Repro from #53311 + +type A = { a: string }; +>A : Symbol(A, Decl(subtypeReductionUnionConstraints.ts, 26, 1)) +>a : Symbol(a, Decl(subtypeReductionUnionConstraints.ts, 30, 10)) + +type B = { b: string }; +>B : Symbol(B, Decl(subtypeReductionUnionConstraints.ts, 30, 23)) +>b : Symbol(b, Decl(subtypeReductionUnionConstraints.ts, 31, 10)) + +function f1(t: T, x: A | B) { +>f1 : Symbol(f1, Decl(subtypeReductionUnionConstraints.ts, 31, 23)) +>T : Symbol(T, Decl(subtypeReductionUnionConstraints.ts, 33, 12)) +>A : Symbol(A, Decl(subtypeReductionUnionConstraints.ts, 26, 1)) +>B : Symbol(B, Decl(subtypeReductionUnionConstraints.ts, 30, 23)) +>t : Symbol(t, Decl(subtypeReductionUnionConstraints.ts, 33, 29)) +>T : Symbol(T, Decl(subtypeReductionUnionConstraints.ts, 33, 12)) +>x : Symbol(x, Decl(subtypeReductionUnionConstraints.ts, 33, 34)) +>A : Symbol(A, Decl(subtypeReductionUnionConstraints.ts, 26, 1)) +>B : Symbol(B, Decl(subtypeReductionUnionConstraints.ts, 30, 23)) + + const a = [t, x]; // (A | B)[] by subtype reduction +>a : Symbol(a, Decl(subtypeReductionUnionConstraints.ts, 34, 9)) +>t : Symbol(t, Decl(subtypeReductionUnionConstraints.ts, 33, 29)) +>x : Symbol(x, Decl(subtypeReductionUnionConstraints.ts, 33, 34)) +} + diff --git a/tests/baselines/reference/subtypeReductionUnionConstraints.types b/tests/baselines/reference/subtypeReductionUnionConstraints.types new file mode 100644 index 0000000000000..35ccf8ca5316e --- /dev/null +++ b/tests/baselines/reference/subtypeReductionUnionConstraints.types @@ -0,0 +1,99 @@ +=== tests/cases/compiler/subtypeReductionUnionConstraints.ts === +// Repro from #53311 + +type FooNode = { +>FooNode : { kind: 'foo'; children: Node[]; } + + kind: 'foo'; +>kind : "foo" + + children: Node[]; +>children : Node[] + +}; + +type BarNode = { +>BarNode : { kind: 'bar'; } + + kind: 'bar'; +>kind : "bar" +} + +type Node = FooNode | BarNode; +>Node : FooNode | BarNode + +type Document = { +>Document : { kind: 'document'; children: Node[]; } + + kind: 'document'; +>kind : "document" + + children: Node[]; +>children : Node[] + +}; + +declare function isNode(node: unknown): node is Node; +>isNode : (node: unknown) => node is Node +>node : unknown + +declare function isBar(node: Node): node is BarNode; +>isBar : (node: Node) => node is BarNode +>node : Node + +export function visitNodes(node: Document | Node, predicate: (testNode: Node) => testNode is T): void { +>visitNodes : (node: Document | Node, predicate: (testNode: Node) => testNode is T) => void +>node : Node | Document +>predicate : (testNode: Node) => testNode is T +>testNode : Node + + isNode(node) && predicate(node); +>isNode(node) && predicate(node) : boolean +>isNode(node) : boolean +>isNode : (node: unknown) => node is Node +>node : Node | Document +>predicate(node) : boolean +>predicate : (testNode: Node) => testNode is T +>node : Node + + if (!isNode(node) || !isBar(node)) { +>!isNode(node) || !isBar(node) : boolean +>!isNode(node) : boolean +>isNode(node) : boolean +>isNode : (node: unknown) => node is Node +>node : Node | Document +>!isBar(node) : boolean +>isBar(node) : boolean +>isBar : (node: Node) => node is BarNode +>node : Node + + const nodes: Node[] = node.children; +>nodes : Node[] +>node.children : Node[] +>node : FooNode | Document +>children : Node[] + } +} + +// Repro from #53311 + +type A = { a: string }; +>A : { a: string; } +>a : string + +type B = { b: string }; +>B : { b: string; } +>b : string + +function f1(t: T, x: A | B) { +>f1 : (t: T, x: A | B) => void +>t : T +>x : A | B + + const a = [t, x]; // (A | B)[] by subtype reduction +>a : (A | B)[] +>[t, x] : (A | B)[] +>t : T +>x : A | B +} + diff --git a/tests/cases/compiler/subtypeReductionUnionConstraints.ts b/tests/cases/compiler/subtypeReductionUnionConstraints.ts new file mode 100644 index 0000000000000..614b8683856b4 --- /dev/null +++ b/tests/cases/compiler/subtypeReductionUnionConstraints.ts @@ -0,0 +1,39 @@ +// @strict: true +// @noEmit: true + +// Repro from #53311 + +type FooNode = { + kind: 'foo'; + children: Node[]; +}; + +type BarNode = { + kind: 'bar'; +} + +type Node = FooNode | BarNode; + +type Document = { + kind: 'document'; + children: Node[]; +}; + +declare function isNode(node: unknown): node is Node; +declare function isBar(node: Node): node is BarNode; + +export function visitNodes(node: Document | Node, predicate: (testNode: Node) => testNode is T): void { + isNode(node) && predicate(node); + if (!isNode(node) || !isBar(node)) { + const nodes: Node[] = node.children; + } +} + +// Repro from #53311 + +type A = { a: string }; +type B = { b: string }; + +function f1(t: T, x: A | B) { + const a = [t, x]; // (A | B)[] by subtype reduction +} From 1e70bb8dc4be0eff311278765352913537350a48 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 28 Mar 2023 10:02:57 -0700 Subject: [PATCH 24/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53481=20(Retr?= =?UTF-8?q?y=20string=20completions=20from=20the=20i...)=20into=20release-?= =?UTF-8?q?5.0=20(#53551)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mateusz Burzyński --- src/services/stringCompletions.ts | 2 +- ...onsLiteralFromInferenceWithinInferredType3.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType3.ts diff --git a/src/services/stringCompletions.ts b/src/services/stringCompletions.ts index ec445e7aabc71..8548dbdbd323e 100644 --- a/src/services/stringCompletions.ts +++ b/src/services/stringCompletions.ts @@ -439,7 +439,7 @@ function getStringLiteralCompletionEntries(sourceFile: SourceFile, node: StringL const literals = contextualTypes.types.filter(literal => !tracker.hasValue(literal.value)); return { kind: StringLiteralCompletionKind.Types, types: literals, isNewIdentifier: false }; default: - return fromContextualType(); + return fromContextualType() || fromContextualType(ContextFlags.None); } function fromContextualType(contextFlags: ContextFlags = ContextFlags.Completions): StringLiteralCompletionsFromTypes | undefined { diff --git a/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType3.ts b/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType3.ts new file mode 100644 index 0000000000000..9cbe1777324d0 --- /dev/null +++ b/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType3.ts @@ -0,0 +1,16 @@ +/// + +//// declare function test(a: { +//// [K in keyof T]: { +//// b?: (keyof T)[]; +//// }; +//// }): void; +//// +//// test({ +//// foo: {}, +//// bar: { +//// b: ["/*ts*/"], +//// }, +//// }); + +verify.completions({ marker: ["ts"], exact: ["foo", "bar"] }); From 111df34f4109aee766b06998db41c4494dddbfa2 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 28 Mar 2023 10:52:11 -0700 Subject: [PATCH 25/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53207=20(Fixe?= =?UTF-8?q?d=20symbol=20declarations=20for=20gener...)=20into=20release-5.?= =?UTF-8?q?0=20(#53271)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mateusz Burzyński --- src/compiler/checker.ts | 17 ++++++++----- ...ToDefinition_filteringGenericMappedType.ts | 25 +++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 tests/cases/fourslash/goToDefinition_filteringGenericMappedType.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d4deb510a20c3..406313020adff 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13179,9 +13179,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // and T as the template type. const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); - const nameType = getNameTypeFromMappedType(type.target as MappedType || type); - const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); - const templateType = getTemplateTypeFromMappedType(type.target as MappedType || type); + const mappedType = (type.target as MappedType) || type; + const nameType = getNameTypeFromMappedType(mappedType); + const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType); + const templateType = getTemplateTypeFromMappedType(mappedType); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' const templateModifiers = getMappedTypeModifiers(type); const include = keyofStringsOnly ? TypeFlags.StringLiteral : TypeFlags.StringOrNumberLiteralOrUnique; @@ -13227,7 +13228,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : undefined; + prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : undefined; } members.set(propName, prop); } @@ -13360,6 +13361,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return false; } + function isFilteringMappedType(type: MappedType): boolean { + const nameType = getNameTypeFromMappedType(type); + return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type)); + } + function resolveStructuredTypeMembers(type: StructuredType): ResolvedType { if (!(type as ResolvedType).members) { if (type.flags & TypeFlags.Object) { @@ -17488,8 +17494,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // K is generic and N is assignable to P, instantiate E using a mapper that substitutes the index type for P. // For example, for an index access { [P in K]: Box }[X], we construct the type Box. if (isGenericMappedType(objectType)) { - const nameType = getNameTypeFromMappedType(objectType); - if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) { + if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) { return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), t => getSimplifiedType(t, writing)); } } diff --git a/tests/cases/fourslash/goToDefinition_filteringGenericMappedType.ts b/tests/cases/fourslash/goToDefinition_filteringGenericMappedType.ts new file mode 100644 index 0000000000000..95a8ec67ced4c --- /dev/null +++ b/tests/cases/fourslash/goToDefinition_filteringGenericMappedType.ts @@ -0,0 +1,25 @@ +/// + +//// const obj = { +//// get /*def*/id() { +//// return 1; +//// }, +//// name: "test", +//// }; +//// +//// type Omit2 = { +//// [K in keyof T as Exclude]: T[K]; +//// }; +//// +//// declare function omit2( +//// obj: O, +//// mask: Mask +//// ): Omit2; +//// +//// const obj2 = omit2(obj, { +//// name: true, +//// }); +//// +//// obj2.[|/*ref*/id|]; + +verify.goToDefinition("ref", "def"); From 0e198c2c1d33eb97653ff51ce71e97683e22b1ed Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 30 Mar 2023 00:26:45 +0000 Subject: [PATCH 26/35] Bump version to 5.0.3 and LKG --- lib/lib.decorators.legacy.d.ts | 2 +- lib/tsc.js | 47 ++++++++++++++++++++------------ lib/tsserver.js | 49 +++++++++++++++++++++------------- lib/tsserverlibrary.js | 49 +++++++++++++++++++++------------- lib/typescript.js | 49 +++++++++++++++++++++------------- lib/typingsInstaller.js | 2 +- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 8 files changed, 127 insertions(+), 75 deletions(-) diff --git a/lib/lib.decorators.legacy.d.ts b/lib/lib.decorators.legacy.d.ts index 39bf2413e2baa..26fbcb526ab2e 100644 --- a/lib/lib.decorators.legacy.d.ts +++ b/lib/lib.decorators.legacy.d.ts @@ -19,4 +19,4 @@ and limitations under the License. declare type ClassDecorator = (target: TFunction) => TFunction | void; declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void; diff --git a/lib/tsc.js b/lib/tsc.js index d3d0ee328b340..6addc1d5ee94d 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -23,7 +23,7 @@ var __export = (target, all) => { // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = "5.0.2"; +var version = "5.0.3"; // src/compiler/core.ts var emptyArray = []; @@ -37424,7 +37424,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos } function nodeNextJsonConfigResolver(moduleName, containingFile, host) { return nodeModuleNameResolverWorker( - 8 /* Exports */, + 30 /* NodeNextDefault */, moduleName, getDirectoryPath(containingFile), { moduleResolution: 99 /* NodeNext */ }, @@ -53129,9 +53129,10 @@ function createTypeChecker(host) { setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray); const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); - const nameType = getNameTypeFromMappedType(type.target || type); - const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); - const templateType = getTemplateTypeFromMappedType(type.target || type); + const mappedType = type.target || type; + const nameType = getNameTypeFromMappedType(mappedType); + const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType); + const templateType = getTemplateTypeFromMappedType(mappedType); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); const templateModifiers = getMappedTypeModifiers(type); const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */; @@ -53168,7 +53169,7 @@ function createTypeChecker(host) { prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0; + prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0; } members.set(propName, prop); } @@ -53274,6 +53275,10 @@ function createTypeChecker(host) { } return false; } + function isFilteringMappedType(type) { + const nameType = getNameTypeFromMappedType(type); + return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type)); + } function resolveStructuredTypeMembers(type) { if (!type.members) { if (type.flags & 524288 /* Object */) { @@ -55778,6 +55783,12 @@ function createTypeChecker(host) { i--; const source = types[i]; if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 262144 /* TypeParameter */ && getBaseConstraintOrType(source).flags & 1048576 /* Union */) { + if (isTypeRelatedTo(source, getUnionType(map(types, (t) => t === source ? neverType : t)), strictSubtypeRelation)) { + orderedRemoveItemAt(types, i); + } + continue; + } const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0; const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty)); for (const target of types) { @@ -56815,8 +56826,7 @@ function createTypeChecker(host) { } } if (isGenericMappedType(objectType)) { - const nameType = getNameTypeFromMappedType(objectType); - if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) { + if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) { return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing)); } } @@ -61315,7 +61325,7 @@ function createTypeChecker(host) { const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType); let result2 = -1 /* True */; for (const targetInfo of indexInfos) { - const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); + const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); if (!related) { return 0 /* False */; } @@ -78983,14 +78993,14 @@ function createTypeChecker(host) { markAliasReferenced(sym, id); if (getAllSymbolFlags(sym) & 111551 /* Value */) { checkExpressionCached(id); - if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { + if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { error( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, idText(id) ); } - } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + } else if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax) { error( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, @@ -91030,10 +91040,14 @@ function transformESDecorators(context) { visitor ); const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); - const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0; - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0)); - addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); + if (superStatementIndex >= 0) { + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart)); + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1)); + } else { + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement)); + } body = factory2.createBlock( statements, /*multiLine*/ @@ -119815,7 +119829,6 @@ function createWatchProgram(host) { ); } function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { - Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, @@ -119831,7 +119844,7 @@ function createWatchProgram(host) { if (!(projects == null ? void 0 : projects.size)) return; projects.forEach((projectPath) => { - if (toPath3(configFileName) === projectPath) { + if (configFileName && toPath3(configFileName) === projectPath) { reloadLevel = 2 /* Full */; } else { const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath); diff --git a/lib/tsserver.js b/lib/tsserver.js index e923d557263b3..6158bf4eb0a40 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(server_exports); // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = "5.0.2"; +var version = "5.0.3"; var Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -41868,7 +41868,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos } function nodeNextJsonConfigResolver(moduleName, containingFile, host) { return nodeModuleNameResolverWorker( - 8 /* Exports */, + 30 /* NodeNextDefault */, moduleName, getDirectoryPath(containingFile), { moduleResolution: 99 /* NodeNext */ }, @@ -57728,9 +57728,10 @@ function createTypeChecker(host) { setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray); const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); - const nameType = getNameTypeFromMappedType(type.target || type); - const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); - const templateType = getTemplateTypeFromMappedType(type.target || type); + const mappedType = type.target || type; + const nameType = getNameTypeFromMappedType(mappedType); + const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType); + const templateType = getTemplateTypeFromMappedType(mappedType); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); const templateModifiers = getMappedTypeModifiers(type); const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */; @@ -57767,7 +57768,7 @@ function createTypeChecker(host) { prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0; + prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0; } members.set(propName, prop); } @@ -57873,6 +57874,10 @@ function createTypeChecker(host) { } return false; } + function isFilteringMappedType(type) { + const nameType = getNameTypeFromMappedType(type); + return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type)); + } function resolveStructuredTypeMembers(type) { if (!type.members) { if (type.flags & 524288 /* Object */) { @@ -60377,6 +60382,12 @@ function createTypeChecker(host) { i--; const source = types[i]; if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 262144 /* TypeParameter */ && getBaseConstraintOrType(source).flags & 1048576 /* Union */) { + if (isTypeRelatedTo(source, getUnionType(map(types, (t) => t === source ? neverType : t)), strictSubtypeRelation)) { + orderedRemoveItemAt(types, i); + } + continue; + } const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0; const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty)); for (const target of types) { @@ -61414,8 +61425,7 @@ function createTypeChecker(host) { } } if (isGenericMappedType(objectType)) { - const nameType = getNameTypeFromMappedType(objectType); - if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) { + if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) { return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing)); } } @@ -65914,7 +65924,7 @@ function createTypeChecker(host) { const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType); let result2 = -1 /* True */; for (const targetInfo of indexInfos) { - const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); + const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); if (!related) { return 0 /* False */; } @@ -83582,14 +83592,14 @@ function createTypeChecker(host) { markAliasReferenced(sym, id); if (getAllSymbolFlags(sym) & 111551 /* Value */) { checkExpressionCached(id); - if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { + if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { error( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, idText(id) ); } - } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + } else if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax) { error( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, @@ -95800,10 +95810,14 @@ function transformESDecorators(context) { visitor ); const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); - const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0; - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0)); - addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); + if (superStatementIndex >= 0) { + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart)); + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1)); + } else { + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement)); + } body = factory2.createBlock( statements, /*multiLine*/ @@ -124707,7 +124721,6 @@ function createWatchProgram(host) { ); } function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { - Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, @@ -124723,7 +124736,7 @@ function createWatchProgram(host) { if (!(projects == null ? void 0 : projects.size)) return; projects.forEach((projectPath) => { - if (toPath3(configFileName) === projectPath) { + if (configFileName && toPath3(configFileName) === projectPath) { reloadLevel = 2 /* Full */; } else { const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath); @@ -152027,7 +152040,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; default: - return fromContextualType(); + return fromContextualType() || fromContextualType(0 /* None */); } function fromContextualType(contextFlags = 4 /* Completions */) { const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 66bf62109d21b..d18ae2db12b4b 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -35,7 +35,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = "5.0.2"; + version = "5.0.3"; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -39756,7 +39756,7 @@ ${lanes.join("\n")} } function nodeNextJsonConfigResolver(moduleName, containingFile, host) { return nodeModuleNameResolverWorker( - 8 /* Exports */, + 30 /* NodeNextDefault */, moduleName, getDirectoryPath(containingFile), { moduleResolution: 99 /* NodeNext */ }, @@ -55538,9 +55538,10 @@ ${lanes.join("\n")} setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray); const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); - const nameType = getNameTypeFromMappedType(type.target || type); - const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); - const templateType = getTemplateTypeFromMappedType(type.target || type); + const mappedType = type.target || type; + const nameType = getNameTypeFromMappedType(mappedType); + const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType); + const templateType = getTemplateTypeFromMappedType(mappedType); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); const templateModifiers = getMappedTypeModifiers(type); const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */; @@ -55577,7 +55578,7 @@ ${lanes.join("\n")} prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0; + prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0; } members.set(propName, prop); } @@ -55683,6 +55684,10 @@ ${lanes.join("\n")} } return false; } + function isFilteringMappedType(type) { + const nameType = getNameTypeFromMappedType(type); + return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type)); + } function resolveStructuredTypeMembers(type) { if (!type.members) { if (type.flags & 524288 /* Object */) { @@ -58187,6 +58192,12 @@ ${lanes.join("\n")} i--; const source = types[i]; if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 262144 /* TypeParameter */ && getBaseConstraintOrType(source).flags & 1048576 /* Union */) { + if (isTypeRelatedTo(source, getUnionType(map(types, (t) => t === source ? neverType : t)), strictSubtypeRelation)) { + orderedRemoveItemAt(types, i); + } + continue; + } const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0; const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty)); for (const target of types) { @@ -59224,8 +59235,7 @@ ${lanes.join("\n")} } } if (isGenericMappedType(objectType)) { - const nameType = getNameTypeFromMappedType(objectType); - if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) { + if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) { return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing)); } } @@ -63724,7 +63734,7 @@ ${lanes.join("\n")} const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType); let result2 = -1 /* True */; for (const targetInfo of indexInfos) { - const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); + const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); if (!related) { return 0 /* False */; } @@ -81392,14 +81402,14 @@ ${lanes.join("\n")} markAliasReferenced(sym, id); if (getAllSymbolFlags(sym) & 111551 /* Value */) { checkExpressionCached(id); - if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { + if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { error( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, idText(id) ); } - } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + } else if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax) { error( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, @@ -93803,10 +93813,14 @@ ${lanes.join("\n")} visitor ); const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); - const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0; - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0)); - addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); + if (superStatementIndex >= 0) { + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart)); + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1)); + } else { + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement)); + } body = factory2.createBlock( statements, /*multiLine*/ @@ -122897,7 +122911,6 @@ ${lanes.join("\n")} ); } function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { - Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, @@ -122913,7 +122926,7 @@ ${lanes.join("\n")} if (!(projects == null ? void 0 : projects.size)) return; projects.forEach((projectPath) => { - if (toPath3(configFileName) === projectPath) { + if (configFileName && toPath3(configFileName) === projectPath) { reloadLevel = 2 /* Full */; } else { const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath); @@ -151124,7 +151137,7 @@ ${lanes.join("\n")} const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; default: - return fromContextualType(); + return fromContextualType() || fromContextualType(0 /* None */); } function fromContextualType(contextFlags = 4 /* Completions */) { const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); diff --git a/lib/typescript.js b/lib/typescript.js index c812bf9575857..4c5d21f4b46c0 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -35,7 +35,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = "5.0.2"; + version = "5.0.3"; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -39756,7 +39756,7 @@ ${lanes.join("\n")} } function nodeNextJsonConfigResolver(moduleName, containingFile, host) { return nodeModuleNameResolverWorker( - 8 /* Exports */, + 30 /* NodeNextDefault */, moduleName, getDirectoryPath(containingFile), { moduleResolution: 99 /* NodeNext */ }, @@ -55538,9 +55538,10 @@ ${lanes.join("\n")} setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray); const typeParameter = getTypeParameterFromMappedType(type); const constraintType = getConstraintTypeFromMappedType(type); - const nameType = getNameTypeFromMappedType(type.target || type); - const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter); - const templateType = getTemplateTypeFromMappedType(type.target || type); + const mappedType = type.target || type; + const nameType = getNameTypeFromMappedType(mappedType); + const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType); + const templateType = getTemplateTypeFromMappedType(mappedType); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); const templateModifiers = getMappedTypeModifiers(type); const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */; @@ -55577,7 +55578,7 @@ ${lanes.join("\n")} prop.links.keyType = keyType; if (modifiersProp) { prop.links.syntheticOrigin = modifiersProp; - prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0; + prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0; } members.set(propName, prop); } @@ -55683,6 +55684,10 @@ ${lanes.join("\n")} } return false; } + function isFilteringMappedType(type) { + const nameType = getNameTypeFromMappedType(type); + return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type)); + } function resolveStructuredTypeMembers(type) { if (!type.members) { if (type.flags & 524288 /* Object */) { @@ -58187,6 +58192,12 @@ ${lanes.join("\n")} i--; const source = types[i]; if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 262144 /* TypeParameter */ && getBaseConstraintOrType(source).flags & 1048576 /* Union */) { + if (isTypeRelatedTo(source, getUnionType(map(types, (t) => t === source ? neverType : t)), strictSubtypeRelation)) { + orderedRemoveItemAt(types, i); + } + continue; + } const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0; const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty)); for (const target of types) { @@ -59224,8 +59235,7 @@ ${lanes.join("\n")} } } if (isGenericMappedType(objectType)) { - const nameType = getNameTypeFromMappedType(objectType); - if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) { + if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) { return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing)); } } @@ -63724,7 +63734,7 @@ ${lanes.join("\n")} const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType); let result2 = -1 /* True */; for (const targetInfo of indexInfos) { - const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); + const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); if (!related) { return 0 /* False */; } @@ -81392,14 +81402,14 @@ ${lanes.join("\n")} markAliasReferenced(sym, id); if (getAllSymbolFlags(sym) & 111551 /* Value */) { checkExpressionCached(id); - if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { + if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { error( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, idText(id) ); } - } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) { + } else if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax) { error( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, @@ -93803,10 +93813,14 @@ ${lanes.join("\n")} visitor ); const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); - const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0; - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0)); - addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper)); + if (superStatementIndex >= 0) { + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart)); + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1)); + } else { + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement)); + } body = factory2.createBlock( statements, /*multiLine*/ @@ -122897,7 +122911,6 @@ ${lanes.join("\n")} ); } function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { - Debug.assert(configFileName); updateSharedExtendedConfigFileWatcher( forProjectPath, options, @@ -122913,7 +122926,7 @@ ${lanes.join("\n")} if (!(projects == null ? void 0 : projects.size)) return; projects.forEach((projectPath) => { - if (toPath3(configFileName) === projectPath) { + if (configFileName && toPath3(configFileName) === projectPath) { reloadLevel = 2 /* Full */; } else { const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath); @@ -151138,7 +151151,7 @@ ${lanes.join("\n")} const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; default: - return fromContextualType(); + return fromContextualType() || fromContextualType(0 /* None */); } function fromContextualType(contextFlags = 4 /* Completions */) { const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 1f8713008fa60..9829c4b9ef38c 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -54,7 +54,7 @@ var path = __toESM(require("path")); // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = "5.0.2"; +var version = "5.0.3"; // src/compiler/core.ts var emptyArray = []; diff --git a/package.json b/package.json index 69ab01a5a616e..9bf31add9adc8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "5.0.2", + "version": "5.0.3", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 139cfa95efb9e..00780e262d647 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -4,7 +4,7 @@ export const versionMajorMinor = "5.0"; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version = "5.0.2" as string; +export const version = "5.0.3" as string; /** * Type of objects whose values are all of the same type. From b2d5d9b13f11d2a83f9694a2aed44caf34ff7249 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 5 Apr 2023 13:35:33 -0700 Subject: [PATCH 27/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53666=20(Disa?= =?UTF-8?q?ble=20JSX=20recovery=20hack=20when=20in=20u...)=20into=20releas?= =?UTF-8?q?e-5.0=20(#53676)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- src/compiler/parser.ts | 8 +++++--- ...arseJsxElementInUnaryExpressionNoCrash1.errors.txt | 11 +++++++++++ .../parseJsxElementInUnaryExpressionNoCrash1.js | 7 +++++++ .../parseJsxElementInUnaryExpressionNoCrash1.symbols | 4 ++++ .../parseJsxElementInUnaryExpressionNoCrash1.types | 9 +++++++++ ...arseJsxElementInUnaryExpressionNoCrash2.errors.txt | 8 ++++++++ .../parseJsxElementInUnaryExpressionNoCrash2.js | 7 +++++++ .../parseJsxElementInUnaryExpressionNoCrash2.symbols | 4 ++++ .../parseJsxElementInUnaryExpressionNoCrash2.types | 8 ++++++++ .../parseJsxElementInUnaryExpressionNoCrash1.ts | 4 ++++ .../parseJsxElementInUnaryExpressionNoCrash2.ts | 4 ++++ 11 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.errors.txt create mode 100644 tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.js create mode 100644 tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.symbols create mode 100644 tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.types create mode 100644 tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.errors.txt create mode 100644 tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.js create mode 100644 tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.symbols create mode 100644 tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.types create mode 100644 tests/cases/compiler/parseJsxElementInUnaryExpressionNoCrash1.ts create mode 100644 tests/cases/compiler/parseJsxElementInUnaryExpressionNoCrash2.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index be81d789c57d0..cd0d806794c31 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -5684,7 +5684,7 @@ namespace Parser { // Just like in parseUpdateExpression, we need to avoid parsing type assertions when // in JSX and we see an expression like "+ bar". if (languageVariant === LanguageVariant.JSX) { - return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); + return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true, /*topInvalidNodePosition*/ undefined, /*openingTag*/ undefined, /*mustBeUnary*/ true); } // This is modified UnaryExpression grammar in TypeScript // UnaryExpression (modified): @@ -5911,7 +5911,7 @@ namespace Parser { return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true)), pos); } - function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext: boolean, topInvalidNodePosition?: number, openingTag?: JsxOpeningElement | JsxOpeningFragment): JsxElement | JsxSelfClosingElement | JsxFragment { + function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext: boolean, topInvalidNodePosition?: number, openingTag?: JsxOpeningElement | JsxOpeningFragment, mustBeUnary = false): JsxElement | JsxSelfClosingElement | JsxFragment { const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result: JsxElement | JsxSelfClosingElement | JsxFragment; @@ -5968,7 +5968,9 @@ namespace Parser { // does less damage and we can report a better error. // Since JSX elements are invalid < operands anyway, this lookahead parse will only occur in error scenarios // of one sort or another. - if (inExpressionContext && token() === SyntaxKind.LessThanToken) { + // If we are in a unary context, we can't do this recovery; the binary expression we return here is not + // a valid UnaryExpression and will cause problems later. + if (!mustBeUnary && inExpressionContext && token() === SyntaxKind.LessThanToken) { const topBadPos = typeof topInvalidNodePosition === "undefined" ? result.pos : topInvalidNodePosition; const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true, topBadPos)); if (invalidElement) { diff --git a/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.errors.txt b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.errors.txt new file mode 100644 index 0000000000000..6f638b4a2230f --- /dev/null +++ b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/a.js(1,4): error TS1003: Identifier expected. +tests/cases/compiler/a.js(1,5): error TS1109: Expression expected. + + +==== tests/cases/compiler/a.js (2 errors) ==== + ~< < + ~ +!!! error TS1003: Identifier expected. + +!!! error TS1109: Expression expected. + \ No newline at end of file diff --git a/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.js b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.js new file mode 100644 index 0000000000000..64357a51dc64e --- /dev/null +++ b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.js @@ -0,0 +1,7 @@ +//// [a.js] +~< < + + +//// [a.js] +~< /> < +; diff --git a/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.symbols b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.symbols new file mode 100644 index 0000000000000..e6ed11e193527 --- /dev/null +++ b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/a.js === + +~< < + diff --git a/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.types b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.types new file mode 100644 index 0000000000000..ec5c50b31c5b0 --- /dev/null +++ b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash1.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/a.js === +~< < +>~< < : boolean +>~< : number +>< : any +> : any + +> : any + diff --git a/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.errors.txt b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.errors.txt new file mode 100644 index 0000000000000..4ae236bce12a4 --- /dev/null +++ b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/a.js(1,9): error TS1109: Expression expected. + + +==== tests/cases/compiler/a.js (1 errors) ==== + ~<> < + +!!! error TS1109: Expression expected. + \ No newline at end of file diff --git a/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.js b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.js new file mode 100644 index 0000000000000..0a9f06793a66f --- /dev/null +++ b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.js @@ -0,0 +1,7 @@ +//// [a.js] +~<> < + + +//// [a.js] +~<> < +; diff --git a/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.symbols b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.symbols new file mode 100644 index 0000000000000..d6832b40cd279 --- /dev/null +++ b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/a.js === + +~<> < + diff --git a/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.types b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.types new file mode 100644 index 0000000000000..0c0fce49f7382 --- /dev/null +++ b/tests/baselines/reference/parseJsxElementInUnaryExpressionNoCrash2.types @@ -0,0 +1,8 @@ +=== tests/cases/compiler/a.js === +~<> < +>~<> < : boolean +>~<> : number +><> : any + +> : any + diff --git a/tests/cases/compiler/parseJsxElementInUnaryExpressionNoCrash1.ts b/tests/cases/compiler/parseJsxElementInUnaryExpressionNoCrash1.ts new file mode 100644 index 0000000000000..177022396f4ad --- /dev/null +++ b/tests/cases/compiler/parseJsxElementInUnaryExpressionNoCrash1.ts @@ -0,0 +1,4 @@ +// @allowJs: true +// @outDir: ./out +// @filename: a.js +~< < diff --git a/tests/cases/compiler/parseJsxElementInUnaryExpressionNoCrash2.ts b/tests/cases/compiler/parseJsxElementInUnaryExpressionNoCrash2.ts new file mode 100644 index 0000000000000..0fbf4b3eb2abb --- /dev/null +++ b/tests/cases/compiler/parseJsxElementInUnaryExpressionNoCrash2.ts @@ -0,0 +1,4 @@ +// @allowJs: true +// @outDir: ./out +// @filename: a.js +~<> < From 97dac8a261a93c0627330569aec131007b72d098 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 5 Apr 2023 13:35:44 -0700 Subject: [PATCH 28/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53665=20(Fix?= =?UTF-8?q?=20crash=20when=20private=20id=20in=20array=20...)=20into=20rel?= =?UTF-8?q?ease-5.0=20(#53677)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- src/compiler/transformers/classFields.ts | 8 ++++---- ...arserPrivateIdentifierInArrayAssignment.errors.txt | 11 +++++++++++ .../parserPrivateIdentifierInArrayAssignment.js | 6 ++++++ .../parserPrivateIdentifierInArrayAssignment.symbols | 4 ++++ .../parserPrivateIdentifierInArrayAssignment.types | 7 +++++++ .../parserPrivateIdentifierInArrayAssignment.ts | 1 + 6 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.errors.txt create mode 100644 tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.js create mode 100644 tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.symbols create mode 100644 tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.types create mode 100755 tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts diff --git a/src/compiler/transformers/classFields.ts b/src/compiler/transformers/classFields.ts index 76a24cfaebb50..7f03c26b80f55 100644 --- a/src/compiler/transformers/classFields.ts +++ b/src/compiler/transformers/classFields.ts @@ -2977,11 +2977,11 @@ export function transformClassFields(context: TransformationContext): (x: Source } function visitArrayAssignmentElement(node: Expression): Expression { - Debug.assertNode(node, isArrayBindingOrAssignmentElement); - if (isSpreadElement(node)) return visitAssignmentRestElement(node); - if (!isOmittedExpression(node)) return visitAssignmentElement(node); + if (isArrayBindingOrAssignmentElement(node)) { + if (isSpreadElement(node)) return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) return visitAssignmentElement(node); + } return visitEachChild(node, visitor, context); - } function visitAssignmentProperty(node: PropertyAssignment) { diff --git a/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.errors.txt b/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.errors.txt new file mode 100644 index 0000000000000..7f4ed01bc6ab5 --- /dev/null +++ b/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts(1,2): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. +tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts(1,8): error TS1109: Expression expected. + + +==== tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts (2 errors) ==== + [#abc]= + ~~~~ +!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. + +!!! error TS1109: Expression expected. + \ No newline at end of file diff --git a/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.js b/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.js new file mode 100644 index 0000000000000..e4cdd66647ff4 --- /dev/null +++ b/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.js @@ -0,0 +1,6 @@ +//// [parserPrivateIdentifierInArrayAssignment.ts] +[#abc]= + + +//// [parserPrivateIdentifierInArrayAssignment.js] +#abc = [0]; diff --git a/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.symbols b/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.symbols new file mode 100644 index 0000000000000..a2f582a5ba398 --- /dev/null +++ b/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts === + +[#abc]= + diff --git a/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.types b/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.types new file mode 100644 index 0000000000000..8c7531c314117 --- /dev/null +++ b/tests/baselines/reference/parserPrivateIdentifierInArrayAssignment.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts === +[#abc]= +>[#abc]= : any +>[#abc] : [any] + +> : any + diff --git a/tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts b/tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts new file mode 100755 index 0000000000000..f59bd76e18200 --- /dev/null +++ b/tests/cases/compiler/parserPrivateIdentifierInArrayAssignment.ts @@ -0,0 +1 @@ +[#abc]= From 365cb5815a891268c3c288000378c77172ba43a1 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 5 Apr 2023 13:38:48 -0700 Subject: [PATCH 29/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53613=20(Fix?= =?UTF-8?q?=20Go=20To=20Source=20Definition=20in=20`--m...)=20into=20relea?= =?UTF-8?q?se-5.0=20(#53617)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrew Branch --- src/compiler/binder.ts | 5 ++- src/compiler/checker.ts | 9 ++--- src/compiler/program.ts | 4 +-- src/compiler/utilities.ts | 6 ++++ .../goToSource15_bundler.baseline.jsonc | 34 +++++++++++++++++++ .../fourslash/server/goToSource15_bundler.ts | 34 +++++++++++++++++++ 6 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 tests/baselines/reference/goToSource15_bundler.baseline.jsonc create mode 100644 tests/cases/fourslash/server/goToSource15_bundler.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 78bf9e1f3a682..b08550bf7d6b5 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -84,7 +84,6 @@ import { getContainingClass, getEffectiveContainerForJSDocTemplateTag, getElementOrPropertyAccessName, - getEmitModuleResolutionKind, getEmitScriptTarget, getEnclosingBlockScopeContainer, getErrorSpanForNode, @@ -241,7 +240,6 @@ import { ModifierFlags, ModuleBlock, ModuleDeclaration, - ModuleResolutionKind, Mutable, NamespaceExportDeclaration, Node, @@ -279,6 +277,7 @@ import { setValueDeclaration, ShorthandPropertyAssignment, shouldPreserveConstEnums, + shouldResolveJsRequire, SignatureDeclaration, skipParentheses, sliceAfter, @@ -3532,7 +3531,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { if (!isBindingPattern(node.name)) { const possibleVariableDecl = node.kind === SyntaxKind.VariableDeclaration ? node : node.parent.parent; if (isInJSFile(node) && - getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Bundler && + shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & ModifierFlags.Export) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 406313020adff..dca3a2a9f5275 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -934,6 +934,7 @@ import { ShorthandPropertyAssignment, shouldAllowImportingTsExtension, shouldPreserveConstEnums, + shouldResolveJsRequire, Signature, SignatureDeclaration, SignatureFlags, @@ -3995,7 +3996,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const hasDefaultOnly = isOnlyImportedAsDefault(specifier); const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier); if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) { - if (hasExportAssignmentSymbol(moduleSymbol) && !(getAllowSyntheticDefaultImports(compilerOptions) || getESModuleInterop(compilerOptions))) { + if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) { const compilerOptionName = moduleKind >= ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; const exportEqualsSymbol = moduleSymbol.exports!.get(InternalSymbolName.ExportEquals); const exportAssignment = exportEqualsSymbol!.valueDeclaration; @@ -4138,7 +4139,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (!isIdentifier(name)) { return undefined; } - const suppressInteropError = name.escapedText === InternalSymbolName.Default && !!(compilerOptions.allowSyntheticDefaultImports || getESModuleInterop(compilerOptions)); + const suppressInteropError = name.escapedText === InternalSymbolName.Default && allowSyntheticDefaultImports; const targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, /*dontResolveAlias*/ false, suppressInteropError); if (targetSymbol) { if (name.escapedText) { @@ -9177,7 +9178,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // If `target` refers to a shorthand module symbol, the name we're trying to pull out isn;t recoverable from the target symbol // In such a scenario, we must fall back to looking for an alias declaration on `symbol` and pulling the target name from that let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName); - if (verbatimTargetName === InternalSymbolName.ExportEquals && (getESModuleInterop(compilerOptions) || compilerOptions.allowSyntheticDefaultImports)) { + if (verbatimTargetName === InternalSymbolName.ExportEquals && allowSyntheticDefaultImports) { // target refers to an `export=` symbol that was hoisted into a synthetic default - rename here to match verbatimTargetName = InternalSymbolName.Default; } @@ -33993,7 +33994,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } // In JavaScript files, calls to any identifier 'require' are treated as external module imports - if (isInJSFile(node) && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Bundler && isCommonJsRequire(node)) { + if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) { return resolveExternalModuleTypeByLiteral(node.arguments![0] as StringLiteral); } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index a3d49f9b600f1..440ddd9cfc0b0 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -284,6 +284,7 @@ import { setParentRecursive, setResolvedModule, setResolvedTypeReferenceDirective, + shouldResolveJsRequire, skipTrivia, skipTypeChecking, some, @@ -3207,8 +3208,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg collectModuleReferences(node, /*inAmbientModule*/ false); } - // `require` has no special meaning in `--moduleResolution bundler` - const shouldProcessRequires = isJavaScriptFile && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Bundler; + const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options); if ((file.flags & NodeFlags.PossiblyContainsDynamicImport) || shouldProcessRequires) { collectDynamicImportOrRequireCalls(file); } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index af4730f848460..57b02beea9432 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -8421,6 +8421,12 @@ export function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResol || moduleResolution === ModuleResolutionKind.Bundler; } +/** @internal */ +export function shouldResolveJsRequire(compilerOptions: CompilerOptions): boolean { + // `bundler` doesn't support resolving `require`, but needs to in `noDtsResolution` to support Find Source Definition + return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Bundler; +} + /** @internal */ export function getResolvePackageJsonExports(compilerOptions: CompilerOptions) { const moduleResolution = getEmitModuleResolutionKind(compilerOptions); diff --git a/tests/baselines/reference/goToSource15_bundler.baseline.jsonc b/tests/baselines/reference/goToSource15_bundler.baseline.jsonc new file mode 100644 index 0000000000000..dc233e8fa79f4 --- /dev/null +++ b/tests/baselines/reference/goToSource15_bundler.baseline.jsonc @@ -0,0 +1,34 @@ +// === goToSourceDefinition === +// === /node_modules/react/cjs/react.production.min.js === +// 'use strict';exports.[|{| defId: 0 |}useState|]=function(a){};exports.version='16.8.6'; + +// === /node_modules/react/cjs/react.development.js === +// 'use strict'; +// if (process.env.NODE_ENV !== 'production') { +// (function() { +// function useState(initialState) {} +// exports.[|{| defId: 1 |}useState|] = useState; +// exports.version = '16.8.6'; +// }()); +// } + +// === /index.ts === +// import { /*GOTO SOURCE DEF*/useState } from 'react'; + + // === Details === + [ + { + "defId": 0, + "containerKind": "", + "containerName": "", + "kind": "", + "name": "" + }, + { + "defId": 1, + "containerKind": "", + "containerName": "", + "kind": "", + "name": "" + } + ] \ No newline at end of file diff --git a/tests/cases/fourslash/server/goToSource15_bundler.ts b/tests/cases/fourslash/server/goToSource15_bundler.ts new file mode 100644 index 0000000000000..290caa62cbba3 --- /dev/null +++ b/tests/cases/fourslash/server/goToSource15_bundler.ts @@ -0,0 +1,34 @@ +/// + +// @Filename: /tsconfig.json +//// { "compilerOptions": { "module": "esnext", "moduleResolution": "bundler" } } + +// @Filename: /node_modules/react/package.json +//// { "name": "react", "version": "16.8.6", "main": "index.js" } + +// @Filename: /node_modules/react/index.js +//// 'use strict'; +//// +//// if (process.env.NODE_ENV === 'production') { +//// module.exports = require('./cjs/react.production.min.js'); +//// } else { +//// module.exports = require('./cjs/react.development.js'); +//// } + +// @Filename: /node_modules/react/cjs/react.production.min.js +//// 'use strict';exports./*production*/useState=function(a){};exports.version='16.8.6'; + +// @Filename: /node_modules/react/cjs/react.development.js +//// 'use strict'; +//// if (process.env.NODE_ENV !== 'production') { +//// (function() { +//// function useState(initialState) {} +//// exports./*development*/useState = useState; +//// exports.version = '16.8.6'; +//// }()); +//// } + +// @Filename: /index.ts +//// import { [|/*start*/useState|] } from 'react'; + +verify.goToSourceDefinition("start", ["production", "development"]); From 233b4b0540b90f1998374a5d06e80e380c9968fd Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 5 Apr 2023 13:39:16 -0700 Subject: [PATCH 30/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53611=20(Remo?= =?UTF-8?q?ve=20error=20on=20redundant=20isolatedM...)=20into=20release-5.?= =?UTF-8?q?0=20(#53612)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrew Branch --- src/compiler/program.ts | 3 --- ...ng isolatedModules (verbatimModuleSyntax=true).errors.txt | 2 -- ...dules (verbatimModuleSyntax=true).oldTranspile.errors.txt | 2 -- .../reference/verbatimModuleSyntaxCompat.errors.txt | 2 -- .../reference/verbatimModuleSyntaxCompat2.errors.txt | 5 +---- .../reference/verbatimModuleSyntaxCompat4.errors.txt | 5 +---- 6 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 440ddd9cfc0b0..0dbb3adcec3f6 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -4252,9 +4252,6 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg if (moduleKind === ModuleKind.AMD || moduleKind === ModuleKind.UMD || moduleKind === ModuleKind.System) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } - if (options.isolatedModules) { - createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); - } if (options.preserveValueImports) { createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); } diff --git a/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).errors.txt b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).errors.txt index e2c1781e29fad..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).errors.txt +++ b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).errors.txt @@ -1,8 +1,6 @@ -error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. !!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.errors.txt b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.errors.txt index e2c1781e29fad..3d6bff97de1a3 100644 --- a/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Does not support setting isolatedModules (verbatimModuleSyntax=true).oldTranspile.errors.txt @@ -1,8 +1,6 @@ -error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. -!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. !!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. ==== input.js (0 errors) ==== x; \ No newline at end of file diff --git a/tests/baselines/reference/verbatimModuleSyntaxCompat.errors.txt b/tests/baselines/reference/verbatimModuleSyntaxCompat.errors.txt index e9851f75ee188..4be77662da807 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxCompat.errors.txt +++ b/tests/baselines/reference/verbatimModuleSyntaxCompat.errors.txt @@ -4,7 +4,6 @@ error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functi error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. -error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. error TS5104: Option 'preserveValueImports' is redundant and cannot be specified with option 'verbatimModuleSyntax'. error TS5105: Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'. @@ -15,7 +14,6 @@ error TS5105: Option 'verbatimModuleSyntax' cannot be used when 'module' is set !!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. !!! error TS5101: Use 'verbatimModuleSyntax' instead. !!! error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. -!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. !!! error TS5104: Option 'preserveValueImports' is redundant and cannot be specified with option 'verbatimModuleSyntax'. !!! error TS5105: Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'. ==== tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat.ts (0 errors) ==== diff --git a/tests/baselines/reference/verbatimModuleSyntaxCompat2.errors.txt b/tests/baselines/reference/verbatimModuleSyntaxCompat2.errors.txt index 8efe570e1eac1..2c8fcfcbb1eee 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxCompat2.errors.txt +++ b/tests/baselines/reference/verbatimModuleSyntaxCompat2.errors.txt @@ -1,4 +1,3 @@ -/tsconfig.json(4,9): error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. /tsconfig.json(5,9): error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. /tsconfig.json(5,9): error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. @@ -8,13 +7,11 @@ /tsconfig.json(6,9): error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. -==== /tsconfig.json (6 errors) ==== +==== /tsconfig.json (5 errors) ==== { "compilerOptions": { "verbatimModuleSyntax": true, "isolatedModules": true, - ~~~~~~~~~~~~~~~~~ -!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. "preserveValueImports": true, ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. diff --git a/tests/baselines/reference/verbatimModuleSyntaxCompat4.errors.txt b/tests/baselines/reference/verbatimModuleSyntaxCompat4.errors.txt index cca2512076220..df27893087b07 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxCompat4.errors.txt +++ b/tests/baselines/reference/verbatimModuleSyntaxCompat4.errors.txt @@ -1,4 +1,3 @@ -/tsconfig.json(4,9): error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. /tsconfig.json(5,9): error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. /tsconfig.json(5,9): error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead. @@ -8,13 +7,11 @@ /tsconfig.json(6,9): error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'. -==== /tsconfig.json (6 errors) ==== +==== /tsconfig.json (5 errors) ==== { "extends": "./tsconfig.base.json", "compilerOptions": { "isolatedModules": true, - ~~~~~~~~~~~~~~~~~ -!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'. "preserveValueImports": true, ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later. From dc7e5a738a88f1dd72391d388d982df6ef082e90 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 5 Apr 2023 13:39:54 -0700 Subject: [PATCH 31/35] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#53599=20(Igno?= =?UTF-8?q?re=20`allowImportingTsExtensions`...)=20into=20release-5.0=20(#?= =?UTF-8?q?53600)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrew Branch --- src/compiler/commandLineParser.ts | 1 + src/testRunner/unittests/services/transpile.ts | 14 ++++++++++++++ ...ns without error (verbatimModuleSyntax=true).js | 2 ++ ...ror (verbatimModuleSyntax=true).oldTranspile.js | 2 ++ .../Can transpile .ts extensions without error.js | 2 ++ ...le .ts extensions without error.oldTranspile.js | 2 ++ ...out noEmit error (verbatimModuleSyntax=true).js | 2 ++ ...ror (verbatimModuleSyntax=true).oldTranspile.js | 2 ++ ...owImportingTsExtensions without noEmit error.js | 2 ++ ...Extensions without noEmit error.oldTranspile.js | 2 ++ 10 files changed, 31 insertions(+) create mode 100644 tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Can transpile .ts extensions without error.js create mode 100644 tests/baselines/reference/transpile/Can transpile .ts extensions without error.oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).js create mode 100644 tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).oldTranspile.js create mode 100644 tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.js create mode 100644 tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.oldTranspile.js diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 629063de29808..b88f6325ba0af 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1104,6 +1104,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, defaultValueDescription: false, + transpileOptionValue: undefined, }, { name: "resolvePackageJsonExports", diff --git a/src/testRunner/unittests/services/transpile.ts b/src/testRunner/unittests/services/transpile.ts index f20efec044f93..b9f8bc915eca2 100644 --- a/src/testRunner/unittests/services/transpile.ts +++ b/src/testRunner/unittests/services/transpile.ts @@ -606,4 +606,18 @@ export * as alias from './file';`, { testVerbatimModuleSyntax: "only" } ); + + transpilesCorrectly("Can transpile .ts extensions without error", + `import { foo } from "./foo.ts";`, { + options: { compilerOptions: { module: ts.ModuleKind.ESNext, target: ts.ScriptTarget.ESNext } }, + testVerbatimModuleSyntax: true + } + ); + + transpilesCorrectly("Ignores `allowImportingTsExtensions` without `noEmit` error", + `import { foo } from "./foo.ts";`, { + options: { compilerOptions: { module: ts.ModuleKind.ESNext, allowImportingTsExtensions: true, target: ts.ScriptTarget.ESNext } }, + testVerbatimModuleSyntax: true + } + ); }); diff --git a/tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..9a1ba82b5b69f --- /dev/null +++ b/tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +import { foo } from "./foo.ts"; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..9a1ba82b5b69f --- /dev/null +++ b/tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +import { foo } from "./foo.ts"; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Can transpile .ts extensions without error.js b/tests/baselines/reference/transpile/Can transpile .ts extensions without error.js new file mode 100644 index 0000000000000..e113dbc728253 --- /dev/null +++ b/tests/baselines/reference/transpile/Can transpile .ts extensions without error.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Can transpile .ts extensions without error.oldTranspile.js b/tests/baselines/reference/transpile/Can transpile .ts extensions without error.oldTranspile.js new file mode 100644 index 0000000000000..e113dbc728253 --- /dev/null +++ b/tests/baselines/reference/transpile/Can transpile .ts extensions without error.oldTranspile.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).js b/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).js new file mode 100644 index 0000000000000..9a1ba82b5b69f --- /dev/null +++ b/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).js @@ -0,0 +1,2 @@ +import { foo } from "./foo.ts"; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).oldTranspile.js b/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).oldTranspile.js new file mode 100644 index 0000000000000..9a1ba82b5b69f --- /dev/null +++ b/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).oldTranspile.js @@ -0,0 +1,2 @@ +import { foo } from "./foo.ts"; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.js b/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.js new file mode 100644 index 0000000000000..e113dbc728253 --- /dev/null +++ b/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.oldTranspile.js b/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.oldTranspile.js new file mode 100644 index 0000000000000..e113dbc728253 --- /dev/null +++ b/tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.oldTranspile.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=file.js.map \ No newline at end of file From 3b45f4db12bbae97d10f62ec0e2d94858252c5ab Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 5 Apr 2023 23:26:35 +0000 Subject: [PATCH 32/35] Bump version to 5.0.4 and LKG --- lib/tsc.js | 44 ++++++++++++++++++++--------------- lib/tsserver.js | 47 +++++++++++++++++++++++--------------- lib/tsserverlibrary.js | 46 ++++++++++++++++++++++--------------- lib/typescript.js | 45 +++++++++++++++++++++--------------- lib/typingsInstaller.js | 20 ++++++++++++---- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 7 files changed, 127 insertions(+), 79 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 6addc1d5ee94d..4af6416de6425 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -23,7 +23,7 @@ var __export = (target, all) => { // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = "5.0.3"; +var version = "5.0.4"; // src/compiler/core.ts var emptyArray = []; @@ -16192,6 +16192,9 @@ function getAllowSyntheticDefaultImports(compilerOptions) { function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } +function shouldResolveJsRequire(compilerOptions) { + return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */; +} function getResolvePackageJsonExports(compilerOptions) { const moduleResolution = getEmitModuleResolutionKind(compilerOptions); if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { @@ -29242,6 +29245,12 @@ var Parser; if (languageVariant === 1 /* JSX */) { return parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ + true, + /*topInvalidNodePosition*/ + void 0, + /*openingTag*/ + void 0, + /*mustBeUnary*/ true ); } @@ -29346,7 +29355,7 @@ var Parser; true )), pos); } - function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) { + function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag, mustBeUnary = false) { const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result; @@ -29384,7 +29393,7 @@ var Parser; Debug.assert(opening.kind === 282 /* JsxSelfClosingElement */); result = opening; } - if (inExpressionContext && token() === 29 /* LessThanToken */) { + if (!mustBeUnary && inExpressionContext && token() === 29 /* LessThanToken */) { const topBadPos = typeof topInvalidNodePosition === "undefined" ? result.pos : topInvalidNodePosition; const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ @@ -34074,7 +34083,8 @@ var commandOptionsWithoutBuild = [ affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, - defaultValueDescription: false + defaultValueDescription: false, + transpileOptionValue: void 0 }, { name: "resolvePackageJsonExports", @@ -41311,7 +41321,7 @@ function createBinder() { } if (!isBindingPattern(node.name)) { const possibleVariableDecl = node.kind === 257 /* VariableDeclaration */ ? node : node.parent.parent; - if (isInJSFile(node) && getEmitModuleResolutionKind(options) !== 100 /* Bundler */ && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { + if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); } else if (isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); @@ -44849,7 +44859,7 @@ function createTypeChecker(host) { const hasDefaultOnly = isOnlyImportedAsDefault(specifier); const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier); if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) { - if (hasExportAssignmentSymbol(moduleSymbol) && !(getAllowSyntheticDefaultImports(compilerOptions) || getESModuleInterop(compilerOptions))) { + if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) { const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */); const exportAssignment = exportEqualsSymbol.valueDeclaration; @@ -45017,7 +45027,7 @@ function createTypeChecker(host) { if (!isIdentifier(name)) { return void 0; } - const suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || getESModuleInterop(compilerOptions)); + const suppressInteropError = name.escapedText === "default" /* Default */ && allowSyntheticDefaultImports; const targetSymbol = resolveESModuleSymbol( moduleSymbol, moduleSpecifier, @@ -49646,7 +49656,7 @@ function createTypeChecker(host) { return; } let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName); - if (verbatimTargetName === "export=" /* ExportEquals */ && (getESModuleInterop(compilerOptions) || compilerOptions.allowSyntheticDefaultImports)) { + if (verbatimTargetName === "export=" /* ExportEquals */ && allowSyntheticDefaultImports) { verbatimTargetName = "default" /* Default */; } const targetName = getInternalSymbolName(target, verbatimTargetName); @@ -70737,7 +70747,7 @@ function createTypeChecker(host) { return anyType; } } - if (isInJSFile(node) && getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */ && isCommonJsRequire(node)) { + if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) { return resolveExternalModuleTypeByLiteral(node.arguments[0]); } const returnType = getReturnTypeOfSignature(signature); @@ -89240,11 +89250,12 @@ function transformClassFields(context) { return visitEachChild(node, visitor, context); } function visitArrayAssignmentElement(node) { - Debug.assertNode(node, isArrayBindingOrAssignmentElement); - if (isSpreadElement(node)) - return visitAssignmentRestElement(node); - if (!isOmittedExpression(node)) - return visitAssignmentElement(node); + if (isArrayBindingOrAssignmentElement(node)) { + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + } return visitEachChild(node, visitor, context); } function visitAssignmentProperty(node) { @@ -114357,7 +114368,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config false ); } - const shouldProcessRequires = isJavaScriptFile && getEmitModuleResolutionKind(options) !== 100 /* Bundler */; + const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options); if (file.flags & 2097152 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) { collectDynamicImportOrRequireCalls(file); } @@ -115285,9 +115296,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } - if (options.isolatedModules) { - createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); - } if (options.preserveValueImports) { createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); } diff --git a/lib/tsserver.js b/lib/tsserver.js index 6158bf4eb0a40..79c6930dacd75 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -2070,6 +2070,7 @@ __export(server_exports, { setValueDeclaration: () => setValueDeclaration, shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldResolveJsRequire: () => shouldResolveJsRequire, shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, showModuleSpecifier: () => showModuleSpecifier, signatureHasLiteralTypes: () => signatureHasLiteralTypes, @@ -2286,7 +2287,7 @@ module.exports = __toCommonJS(server_exports); // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = "5.0.3"; +var version = "5.0.4"; var Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -20263,6 +20264,9 @@ function getAllowSyntheticDefaultImports(compilerOptions) { function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } +function shouldResolveJsRequire(compilerOptions) { + return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */; +} function getResolvePackageJsonExports(compilerOptions) { const moduleResolution = getEmitModuleResolutionKind(compilerOptions); if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { @@ -33580,6 +33584,12 @@ var Parser; if (languageVariant === 1 /* JSX */) { return parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ + true, + /*topInvalidNodePosition*/ + void 0, + /*openingTag*/ + void 0, + /*mustBeUnary*/ true ); } @@ -33684,7 +33694,7 @@ var Parser; true )), pos); } - function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) { + function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag, mustBeUnary = false) { const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result; @@ -33722,7 +33732,7 @@ var Parser; Debug.assert(opening.kind === 282 /* JsxSelfClosingElement */); result = opening; } - if (inExpressionContext && token() === 29 /* LessThanToken */) { + if (!mustBeUnary && inExpressionContext && token() === 29 /* LessThanToken */) { const topBadPos = typeof topInvalidNodePosition === "undefined" ? result.pos : topInvalidNodePosition; const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ @@ -38412,7 +38422,8 @@ var commandOptionsWithoutBuild = [ affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, - defaultValueDescription: false + defaultValueDescription: false, + transpileOptionValue: void 0 }, { name: "resolvePackageJsonExports", @@ -45862,7 +45873,7 @@ function createBinder() { } if (!isBindingPattern(node.name)) { const possibleVariableDecl = node.kind === 257 /* VariableDeclaration */ ? node : node.parent.parent; - if (isInJSFile(node) && getEmitModuleResolutionKind(options) !== 100 /* Bundler */ && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { + if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); } else if (isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); @@ -49448,7 +49459,7 @@ function createTypeChecker(host) { const hasDefaultOnly = isOnlyImportedAsDefault(specifier); const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier); if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) { - if (hasExportAssignmentSymbol(moduleSymbol) && !(getAllowSyntheticDefaultImports(compilerOptions) || getESModuleInterop(compilerOptions))) { + if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) { const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */); const exportAssignment = exportEqualsSymbol.valueDeclaration; @@ -49616,7 +49627,7 @@ function createTypeChecker(host) { if (!isIdentifier(name)) { return void 0; } - const suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || getESModuleInterop(compilerOptions)); + const suppressInteropError = name.escapedText === "default" /* Default */ && allowSyntheticDefaultImports; const targetSymbol = resolveESModuleSymbol( moduleSymbol, moduleSpecifier, @@ -54245,7 +54256,7 @@ function createTypeChecker(host) { return; } let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName); - if (verbatimTargetName === "export=" /* ExportEquals */ && (getESModuleInterop(compilerOptions) || compilerOptions.allowSyntheticDefaultImports)) { + if (verbatimTargetName === "export=" /* ExportEquals */ && allowSyntheticDefaultImports) { verbatimTargetName = "default" /* Default */; } const targetName = getInternalSymbolName(target, verbatimTargetName); @@ -75336,7 +75347,7 @@ function createTypeChecker(host) { return anyType; } } - if (isInJSFile(node) && getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */ && isCommonJsRequire(node)) { + if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) { return resolveExternalModuleTypeByLiteral(node.arguments[0]); } const returnType = getReturnTypeOfSignature(signature); @@ -94010,11 +94021,12 @@ function transformClassFields(context) { return visitEachChild(node, visitor, context); } function visitArrayAssignmentElement(node) { - Debug.assertNode(node, isArrayBindingOrAssignmentElement); - if (isSpreadElement(node)) - return visitAssignmentRestElement(node); - if (!isOmittedExpression(node)) - return visitAssignmentElement(node); + if (isArrayBindingOrAssignmentElement(node)) { + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + } return visitEachChild(node, visitor, context); } function visitAssignmentProperty(node) { @@ -119192,7 +119204,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config false ); } - const shouldProcessRequires = isJavaScriptFile && getEmitModuleResolutionKind(options) !== 100 /* Bundler */; + const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options); if (file.flags & 2097152 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) { collectDynamicImportOrRequireCalls(file); } @@ -120120,9 +120132,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } - if (options.isolatedModules) { - createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); - } if (options.preserveValueImports) { createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); } @@ -169780,6 +169789,7 @@ __export(ts_exports3, { setValueDeclaration: () => setValueDeclaration, shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldResolveJsRequire: () => shouldResolveJsRequire, shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, showModuleSpecifier: () => showModuleSpecifier, signatureHasLiteralTypes: () => signatureHasLiteralTypes, @@ -183727,6 +183737,7 @@ start(initializeNodeSystem(), require("os").platform()); setValueDeclaration, shouldAllowImportingTsExtension, shouldPreserveConstEnums, + shouldResolveJsRequire, shouldUseUriStyleNodeCoreModules, showModuleSpecifier, signatureHasLiteralTypes, diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index d18ae2db12b4b..4cdee5ee4564c 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -35,7 +35,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = "5.0.3"; + version = "5.0.4"; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -17991,6 +17991,9 @@ ${lanes.join("\n")} function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } + function shouldResolveJsRequire(compilerOptions) { + return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */; + } function getResolvePackageJsonExports(compilerOptions) { const moduleResolution = getEmitModuleResolutionKind(compilerOptions); if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { @@ -31692,6 +31695,12 @@ ${lanes.join("\n")} if (languageVariant === 1 /* JSX */) { return parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ + true, + /*topInvalidNodePosition*/ + void 0, + /*openingTag*/ + void 0, + /*mustBeUnary*/ true ); } @@ -31796,7 +31805,7 @@ ${lanes.join("\n")} true )), pos); } - function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) { + function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag, mustBeUnary = false) { const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result; @@ -31834,7 +31843,7 @@ ${lanes.join("\n")} Debug.assert(opening.kind === 282 /* JsxSelfClosingElement */); result = opening; } - if (inExpressionContext && token() === 29 /* LessThanToken */) { + if (!mustBeUnary && inExpressionContext && token() === 29 /* LessThanToken */) { const topBadPos = typeof topInvalidNodePosition === "undefined" ? result.pos : topInvalidNodePosition; const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ @@ -38066,7 +38075,8 @@ ${lanes.join("\n")} affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, - defaultValueDescription: false + defaultValueDescription: false, + transpileOptionValue: void 0 }, { name: "resolvePackageJsonExports", @@ -43764,7 +43774,7 @@ ${lanes.join("\n")} } if (!isBindingPattern(node.name)) { const possibleVariableDecl = node.kind === 257 /* VariableDeclaration */ ? node : node.parent.parent; - if (isInJSFile(node) && getEmitModuleResolutionKind(options) !== 100 /* Bundler */ && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { + if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); } else if (isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); @@ -47258,7 +47268,7 @@ ${lanes.join("\n")} const hasDefaultOnly = isOnlyImportedAsDefault(specifier); const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier); if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) { - if (hasExportAssignmentSymbol(moduleSymbol) && !(getAllowSyntheticDefaultImports(compilerOptions) || getESModuleInterop(compilerOptions))) { + if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) { const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */); const exportAssignment = exportEqualsSymbol.valueDeclaration; @@ -47426,7 +47436,7 @@ ${lanes.join("\n")} if (!isIdentifier(name)) { return void 0; } - const suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || getESModuleInterop(compilerOptions)); + const suppressInteropError = name.escapedText === "default" /* Default */ && allowSyntheticDefaultImports; const targetSymbol = resolveESModuleSymbol( moduleSymbol, moduleSpecifier, @@ -52055,7 +52065,7 @@ ${lanes.join("\n")} return; } let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName); - if (verbatimTargetName === "export=" /* ExportEquals */ && (getESModuleInterop(compilerOptions) || compilerOptions.allowSyntheticDefaultImports)) { + if (verbatimTargetName === "export=" /* ExportEquals */ && allowSyntheticDefaultImports) { verbatimTargetName = "default" /* Default */; } const targetName = getInternalSymbolName(target, verbatimTargetName); @@ -73146,7 +73156,7 @@ ${lanes.join("\n")} return anyType; } } - if (isInJSFile(node) && getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */ && isCommonJsRequire(node)) { + if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) { return resolveExternalModuleTypeByLiteral(node.arguments[0]); } const returnType = getReturnTypeOfSignature(signature); @@ -91995,11 +92005,12 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitArrayAssignmentElement(node) { - Debug.assertNode(node, isArrayBindingOrAssignmentElement); - if (isSpreadElement(node)) - return visitAssignmentRestElement(node); - if (!isOmittedExpression(node)) - return visitAssignmentElement(node); + if (isArrayBindingOrAssignmentElement(node)) { + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + } return visitEachChild(node, visitor, context); } function visitAssignmentProperty(node) { @@ -117210,7 +117221,7 @@ ${lanes.join("\n")} false ); } - const shouldProcessRequires = isJavaScriptFile && getEmitModuleResolutionKind(options) !== 100 /* Bundler */; + const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options); if (file.flags & 2097152 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) { collectDynamicImportOrRequireCalls(file); } @@ -118138,9 +118149,6 @@ ${lanes.join("\n")} if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } - if (options.isolatedModules) { - createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); - } if (options.preserveValueImports) { createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); } @@ -180367,6 +180375,7 @@ ${e.message}`; setValueDeclaration: () => setValueDeclaration, shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldResolveJsRequire: () => shouldResolveJsRequire, shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, showModuleSpecifier: () => showModuleSpecifier, signatureHasLiteralTypes: () => signatureHasLiteralTypes, @@ -182725,6 +182734,7 @@ ${e.message}`; setValueDeclaration: () => setValueDeclaration, shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldResolveJsRequire: () => shouldResolveJsRequire, shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, showModuleSpecifier: () => showModuleSpecifier, signatureHasLiteralTypes: () => signatureHasLiteralTypes, diff --git a/lib/typescript.js b/lib/typescript.js index 4c5d21f4b46c0..06dfb5d36b63b 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -35,7 +35,7 @@ var ts = (() => { "src/compiler/corePublic.ts"() { "use strict"; versionMajorMinor = "5.0"; - version = "5.0.3"; + version = "5.0.4"; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -17991,6 +17991,9 @@ ${lanes.join("\n")} function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } + function shouldResolveJsRequire(compilerOptions) { + return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */; + } function getResolvePackageJsonExports(compilerOptions) { const moduleResolution = getEmitModuleResolutionKind(compilerOptions); if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { @@ -31692,6 +31695,12 @@ ${lanes.join("\n")} if (languageVariant === 1 /* JSX */) { return parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ + true, + /*topInvalidNodePosition*/ + void 0, + /*openingTag*/ + void 0, + /*mustBeUnary*/ true ); } @@ -31796,7 +31805,7 @@ ${lanes.join("\n")} true )), pos); } - function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) { + function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag, mustBeUnary = false) { const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result; @@ -31834,7 +31843,7 @@ ${lanes.join("\n")} Debug.assert(opening.kind === 282 /* JsxSelfClosingElement */); result = opening; } - if (inExpressionContext && token() === 29 /* LessThanToken */) { + if (!mustBeUnary && inExpressionContext && token() === 29 /* LessThanToken */) { const topBadPos = typeof topInvalidNodePosition === "undefined" ? result.pos : topInvalidNodePosition; const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ @@ -38066,7 +38075,8 @@ ${lanes.join("\n")} affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, - defaultValueDescription: false + defaultValueDescription: false, + transpileOptionValue: void 0 }, { name: "resolvePackageJsonExports", @@ -43764,7 +43774,7 @@ ${lanes.join("\n")} } if (!isBindingPattern(node.name)) { const possibleVariableDecl = node.kind === 257 /* VariableDeclaration */ ? node : node.parent.parent; - if (isInJSFile(node) && getEmitModuleResolutionKind(options) !== 100 /* Bundler */ && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { + if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); } else if (isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); @@ -47258,7 +47268,7 @@ ${lanes.join("\n")} const hasDefaultOnly = isOnlyImportedAsDefault(specifier); const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier); if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) { - if (hasExportAssignmentSymbol(moduleSymbol) && !(getAllowSyntheticDefaultImports(compilerOptions) || getESModuleInterop(compilerOptions))) { + if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) { const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */); const exportAssignment = exportEqualsSymbol.valueDeclaration; @@ -47426,7 +47436,7 @@ ${lanes.join("\n")} if (!isIdentifier(name)) { return void 0; } - const suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || getESModuleInterop(compilerOptions)); + const suppressInteropError = name.escapedText === "default" /* Default */ && allowSyntheticDefaultImports; const targetSymbol = resolveESModuleSymbol( moduleSymbol, moduleSpecifier, @@ -52055,7 +52065,7 @@ ${lanes.join("\n")} return; } let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName); - if (verbatimTargetName === "export=" /* ExportEquals */ && (getESModuleInterop(compilerOptions) || compilerOptions.allowSyntheticDefaultImports)) { + if (verbatimTargetName === "export=" /* ExportEquals */ && allowSyntheticDefaultImports) { verbatimTargetName = "default" /* Default */; } const targetName = getInternalSymbolName(target, verbatimTargetName); @@ -73146,7 +73156,7 @@ ${lanes.join("\n")} return anyType; } } - if (isInJSFile(node) && getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */ && isCommonJsRequire(node)) { + if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) { return resolveExternalModuleTypeByLiteral(node.arguments[0]); } const returnType = getReturnTypeOfSignature(signature); @@ -91995,11 +92005,12 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitArrayAssignmentElement(node) { - Debug.assertNode(node, isArrayBindingOrAssignmentElement); - if (isSpreadElement(node)) - return visitAssignmentRestElement(node); - if (!isOmittedExpression(node)) - return visitAssignmentElement(node); + if (isArrayBindingOrAssignmentElement(node)) { + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + } return visitEachChild(node, visitor, context); } function visitAssignmentProperty(node) { @@ -117210,7 +117221,7 @@ ${lanes.join("\n")} false ); } - const shouldProcessRequires = isJavaScriptFile && getEmitModuleResolutionKind(options) !== 100 /* Bundler */; + const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options); if (file.flags & 2097152 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) { collectDynamicImportOrRequireCalls(file); } @@ -118138,9 +118149,6 @@ ${lanes.join("\n")} if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); } - if (options.isolatedModules) { - createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax"); - } if (options.preserveValueImports) { createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); } @@ -169548,6 +169556,7 @@ ${options.prefix}` : "\n" : options.prefix setValueDeclaration: () => setValueDeclaration, shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldResolveJsRequire: () => shouldResolveJsRequire, shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, showModuleSpecifier: () => showModuleSpecifier, signatureHasLiteralTypes: () => signatureHasLiteralTypes, diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 9829c4b9ef38c..39786f7035a05 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -54,7 +54,7 @@ var path = __toESM(require("path")); // src/compiler/corePublic.ts var versionMajorMinor = "5.0"; -var version = "5.0.3"; +var version = "5.0.4"; // src/compiler/core.ts var emptyArray = []; @@ -11947,6 +11947,9 @@ function unusedLabelIsError(options) { function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; } +function shouldResolveJsRequire(compilerOptions) { + return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */; +} function getResolveJsonModule(compilerOptions) { if (compilerOptions.resolveJsonModule !== void 0) { return compilerOptions.resolveJsonModule; @@ -22092,6 +22095,12 @@ var Parser; if (languageVariant === 1 /* JSX */) { return parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ + true, + /*topInvalidNodePosition*/ + void 0, + /*openingTag*/ + void 0, + /*mustBeUnary*/ true ); } @@ -22196,7 +22205,7 @@ var Parser; true )), pos); } - function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) { + function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag, mustBeUnary = false) { const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result; @@ -22234,7 +22243,7 @@ var Parser; Debug.assert(opening.kind === 282 /* JsxSelfClosingElement */); result = opening; } - if (inExpressionContext && token() === 29 /* LessThanToken */) { + if (!mustBeUnary && inExpressionContext && token() === 29 /* LessThanToken */) { const topBadPos = typeof topInvalidNodePosition === "undefined" ? result.pos : topInvalidNodePosition; const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment( /*inExpressionContext*/ @@ -26924,7 +26933,8 @@ var commandOptionsWithoutBuild = [ affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, - defaultValueDescription: false + defaultValueDescription: false, + transpileOptionValue: void 0 }, { name: "resolvePackageJsonExports", @@ -32226,7 +32236,7 @@ function createBinder() { } if (!isBindingPattern(node.name)) { const possibleVariableDecl = node.kind === 257 /* VariableDeclaration */ ? node : node.parent.parent; - if (isInJSFile(node) && getEmitModuleResolutionKind(options) !== 100 /* Bundler */ && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { + if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); } else if (isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); diff --git a/package.json b/package.json index 9bf31add9adc8..3cb61b057424c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "5.0.3", + "version": "5.0.4", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 00780e262d647..3b82d4ba0c26d 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -4,7 +4,7 @@ export const versionMajorMinor = "5.0"; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version = "5.0.3" as string; +export const version = "5.0.4" as string; /** * Type of objects whose values are all of the same type. From 04423f1fb341950dfb435e46e11d4877deb769fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Mon, 17 Apr 2023 22:12:37 +0200 Subject: [PATCH 33/35] Trim library footprint and target ES2020 --- Herebyfile.mjs | 4 +--- src/tsconfig-base.json | 4 ++-- src/typescript/_namespaces/ts.ts | 3 --- src/typescript/typescript.ts | 7 ++----- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Herebyfile.mjs b/Herebyfile.mjs index 2ac34dfde47b5..9b85a9e9ccc5a 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -172,7 +172,7 @@ function createBundler(entrypoint, outfile, taskOptions = {}) { bundle: true, outfile, platform: "node", - target: "es2018", + target: "es2020", format: "cjs", sourcemap: "linked", sourcesContent: false, @@ -187,8 +187,6 @@ function createBundler(entrypoint, outfile, taskOptions = {}) { options.format = "iife"; // Name the variable ts, matching our old big bundle and so we can use the code below. options.globalName = "ts"; - // If we are in a CJS context, export the ts namespace. - options.footer = { js: `\nif (typeof module !== "undefined" && module.exports) { module.exports = ts; }` }; // esbuild converts calls to "require" to "__require"; this function // calls the real require if it exists, or throws if it does not (rather than diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index 37a2d53e38636..3b772f7d33f0f 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -4,8 +4,8 @@ "outDir": "../built/local", "pretty": true, - "lib": ["es2018"], - "target": "es2018", + "lib": ["es2020"], + "target": "es2020", "module": "CommonJS", "moduleResolution": "node", diff --git a/src/typescript/_namespaces/ts.ts b/src/typescript/_namespaces/ts.ts index e55b26438094f..b9fd7c710ab69 100644 --- a/src/typescript/_namespaces/ts.ts +++ b/src/typescript/_namespaces/ts.ts @@ -1,6 +1,3 @@ /* Generated file to emulate the ts namespace. */ export * from "../../compiler/_namespaces/ts"; -export * from "../../jsTyping/_namespaces/ts"; -export * from "../../services/_namespaces/ts"; -export * from "../../deprecatedCompat/_namespaces/ts"; diff --git a/src/typescript/typescript.ts b/src/typescript/typescript.ts index 9f1934f652a2c..944cb31b2bc20 100644 --- a/src/typescript/typescript.ts +++ b/src/typescript/typescript.ts @@ -1,13 +1,10 @@ -import { - Debug, - LogLevel, -} from "./_namespaces/ts"; import * as ts from "./_namespaces/ts"; // enable deprecation logging declare const console: any; if (typeof console !== "undefined") { - Debug.loggingHost = { + const { LogLevel } = ts; + ts.Debug.loggingHost = { log(level, s) { switch (level) { case LogLevel.Error: return console.error(s); From b553857d0930a30888fef0f73c4674ffecc7ec88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Mon, 17 Apr 2023 22:18:23 +0200 Subject: [PATCH 34/35] compiler: Skip `sys` code in case of frida-compile So we can use Terser to omit the Node.js implementation entirely. --- src/compiler/sys.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 21418f24574e0..036a6fc2b0d2b 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1451,7 +1451,9 @@ declare const __dirname: string; // TODO: GH#18217 this is used as if it's certainly defined in many places. // eslint-disable-next-line prefer-const -export let sys: System = (() => { +export let sys: System; + +function makeSystem(): System { // NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual // byte order mark from the specified encoding. Using any other byte order mark does // not actually work. @@ -2000,19 +2002,22 @@ export let sys: System = (() => { patchWriteFileEnsuringDirectory(sys); } return sys!; -})(); +} /** @internal */ export function setSys(s: System) { sys = s; } -if (sys && sys.getEnvironmentVariable) { - setCustomPollingValues(sys); - Debug.setAssertionLevel(/^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) - ? AssertionLevel.Normal - : AssertionLevel.None); -} -if (sys && sys.debugMode) { - Debug.isDebugging = true; +if (!process.env.FRIDA_COMPILE) { + sys = makeSystem(); + if (sys && sys.getEnvironmentVariable) { + setCustomPollingValues(sys); + Debug.setAssertionLevel(/^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) + ? AssertionLevel.Normal + : AssertionLevel.None); + } + if (sys && sys.debugMode) { + Debug.isDebugging = true; + } } From 944b0f411da01fc7ae99234724e0356a4883489b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Fri, 2 Sep 2022 13:58:28 +0200 Subject: [PATCH 35/35] Add support for prebinding source files Useful for caching purposes, e.g. when creating a V8 snapshot. Typically one would prebind a set of .d.ts files, and when these are later used, the type-checking and bind steps can be skipped. --- src/compiler/_namespaces/ts.ts | 1 + src/compiler/binderPublic.ts | 10 ++++++++++ src/compiler/checker.ts | 3 +++ src/compiler/types.ts | 1 + src/compiler/utilities.ts | 2 +- src/services/services.ts | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/compiler/binderPublic.ts diff --git a/src/compiler/_namespaces/ts.ts b/src/compiler/_namespaces/ts.ts index 5a01767f96d44..6a016e9b6e659 100644 --- a/src/compiler/_namespaces/ts.ts +++ b/src/compiler/_namespaces/ts.ts @@ -27,6 +27,7 @@ export * from "../parser"; export * from "../commandLineParser"; export * from "../moduleNameResolver"; export * from "../binder"; +export * from "../binderPublic"; export * from "../symbolWalker"; export * from "../checker"; export * from "../visitorPublic"; diff --git a/src/compiler/binderPublic.ts b/src/compiler/binderPublic.ts new file mode 100644 index 0000000000000..c77ad592f352b --- /dev/null +++ b/src/compiler/binderPublic.ts @@ -0,0 +1,10 @@ +import { + CompilerOptions, + SourceFile, +} from "./_namespaces/ts"; +import { bindSourceFile } from "./binder"; + +export function prebindSourceFile(file: SourceFile, options: CompilerOptions) { + bindSourceFile(file, options); + file.isPrebound = true; +} diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index dca3a2a9f5275..1a66c1f6dc218 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -46447,6 +46447,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function initializeTypeChecker() { // Bind all source files and propagate errors for (const file of host.getSourceFiles()) { + if (file.isPrebound) { + continue; + } bindSourceFile(file, compilerOptions); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 881f3576868cd..dc551af9e5591 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4256,6 +4256,7 @@ export interface SourceFile extends Declaration, LocalsContainer { typeReferenceDirectives: readonly FileReference[]; libReferenceDirectives: readonly FileReference[]; languageVariant: LanguageVariant; + isPrebound: boolean; isDeclarationFile: boolean; // this map is used by transpiler to supply alternative names for dependencies (i.e. in case of bundling) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 57b02beea9432..7ad41ce5a416d 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -9427,7 +9427,7 @@ export function skipTypeChecking(sourceFile: SourceFile, options: CompilerOption // If skipLibCheck is enabled, skip reporting errors if file is a declaration file. // If skipDefaultLibCheck is enabled, skip reporting errors if file contains a // '/// ' directive. - return (options.skipLibCheck && sourceFile.isDeclarationFile || + return sourceFile.isPrebound || (options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib) || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName); } diff --git a/src/services/services.ts b/src/services/services.ts index f5bba46bdbca7..7d8d7e9d3d442 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1017,6 +1017,7 @@ class SourceFileObject extends NodeObject implements SourceFile { public bindDiagnostics!: DiagnosticWithLocation[]; public bindSuggestionDiagnostics?: DiagnosticWithLocation[]; + public isPrebound = false; public isDeclarationFile!: boolean; public isDefaultLib!: boolean; public hasNoDefaultLib!: boolean;